Page 1 of 1

Position Controller: determine when move is complete

Posted: Wed Jan 19, 2022 9:09 am
by ndemarco
Many position control systems include an 'in position' event, raised when the motor is within the deadband window. This enables simple, non-blocking calls to make a move: go, and let me know when you're there.

Some moves are composite, also called on-the-fly moves: Start moving with motion parameter set 1 (velocity, acceleration, tuning parameters). When in position, change to motion parameter set 2. A common example is when the system's dynamics change mid-move - a sliding platform contacts something it must push, for example.

Phidget22 includes getPosition, which can then be tested against setTargetPosition. Before I code this up, the loop seems like it would be slow and intensive (bandwidth, processor).

Is there a way to achieve this using Phidget22?

Re: Position Controller: determine when move is complete

Posted: Thu Jan 20, 2022 12:56 pm
by jdecoux
While there is no "Motion Complete" event, you could potentially use the PositionChange event to check whether your motor is near the target position and set a flag from there, moving the bulk of the comparison out of your main loop.

Re: Position Controller: determine when move is complete

Posted: Sun Jan 23, 2022 8:47 am
by ndemarco
That approach works great, especially considering this is a 24 pulse/rev (commutations/rev) motor.