Page 1 of 1

Servo getPosition only works when stopped?

Posted: Fri Mar 06, 2020 3:44 pm
by Rhybot
Hello Phidget Forms,

I have an 16X RC Servo Phidget (RCC1000_0) board version 110.

Imagine the following scenario:
[*] getPosition(), returns 0.0°
[*] setVelocityLimit(5.0)
[*] setTargetPosition(180.0)
[*] wait 1 second
[*] the bug - getPosition(), returns 0.0°
[*] wait 1 second
[*] the bug - getPosition(), returns 0.0°
[*] wait until motion completion
[*] getPosition(), returns ~180.0°

In other words, I found getPosition() doesn't work when the servo is moving.

Can you please confirm this is the current behavior? Or what am I doing wrong?

Thank you in advance!

Re: Servo getPosition only works when stopped?

Posted: Fri Mar 06, 2020 3:48 pm
by Patrick
RCC1000 doesn't report it's position while it's moving, it just reports when it has arrived at position.

You can handle the TargetPositionReached event to get notified as soon as this happens.

If you need position/velocity update events, have a look at RCC0004.

-Patrick

Re: Servo getPosition only works when stopped?

Posted: Fri Mar 06, 2020 4:22 pm
by Rhybot
Good to know, thank you!! That's what I will do!