servo>arduino>Max problem reading servo position

Hi
Hitec digital servo with potentiometer - Arduino Duemilanove - Max 5.1.3
the configuration:
servo (potentiometer) > arduino (digital pin9 PWM) > Max [serial] external

what works:
controlling the servo with Max

what doesn't work:
getting servo position from the servo potentiometer in Max

I am getting really frustrated because i don't get this simpel input working.
Searched the forum and internet and done a lot of tests in Arduino and Max.

Please help.

what works:
controlling the servo with Max

With what code?

what doesn't work:
getting servo position from the servo potentiometer in Max

With what code?

The function to "read" a servo position will only return the last position the servo was commanded to go to, not it's actual position (in case they are not the same).

Doesn't max have the ability to remember anything?

Arduino code: ServoFirmata
Max code: Homebrewed + part from Maxuino.maxpat

"..., not it's actual position (in case they are not the same)."

Is there no way to read the actual position?
Why there is then a potentiometer with the servo?

Max has brains, so it can remember. :slight_smile:
You mean that i will have to make Max program to remember the position that i have send?

Why there is then a potentiometer with the servo?

The potentiometer tells the servo when it is in the correct position. It is not available to be read. It simply isn't wired that way.

If the servo can get to the commanded position, it will. The position read will be where the servo is, and will be the same as the commanded position.

If the servo can not get there, because the value is out of range, the torque required is too high, the current available is too low, or for any other reason, the position read will not be where the servo actually is. Rather, it will be where the servo was last to go.

So, reading the servo doesn't provide any new/accurate information.

As a result, it is unlikely that the ServoFirmata code even includes such a capability.

You mean that i will have to make Max program to remember the position that i have send?

Yes.

Thanks to make this more clear.
I whas already busy programming in Max to remember positions.

regards