Servo getPosition only works when stopped?

Technical Discussions on any InterfaceKits
Post Reply
Rhybot
Phidgeteer!
Posts: 52
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

Servo getPosition only works when stopped?

Post 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!
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Servo getPosition only works when stopped?

Post 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
Rhybot
Phidgeteer!
Posts: 52
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

Re: Servo getPosition only works when stopped?

Post by Rhybot »

Good to know, thank you!! That's what I will do!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest