DC stepper control using a DCC1002 module - position reached
Posted: Thu Feb 09, 2023 10:51 am
Hello,
I've been playing with the servo phidget and the stepper phidget in the past but this is my first time using a DCC module.
It's not clear to me how I can make my motor positioning synchronous.
In the past I was monitorting the positionChanged event and blocking until the current position is the target position, but with a DC motor and depending on the PID, the motor might overshoot.
So here are my questions:
- Do you confirm that voidPhidgetMotorPositionController_setTargetPosition() is asynchronous?
- Do you confirm that the callback of voidPhidgetMotorPositionController_setTargetPosition_async() is not called when the position is reached, but when the targetPosition has been sent to the microcontroller?
- How do you recommend to program the detection of "position reached"?
Thanks in advance.
I've been playing with the servo phidget and the stepper phidget in the past but this is my first time using a DCC module.
It's not clear to me how I can make my motor positioning synchronous.
In the past I was monitorting the positionChanged event and blocking until the current position is the target position, but with a DC motor and depending on the PID, the motor might overshoot.
So here are my questions:
- Do you confirm that voidPhidgetMotorPositionController_setTargetPosition() is asynchronous?
- Do you confirm that the callback of voidPhidgetMotorPositionController_setTargetPosition_async() is not called when the position is reached, but when the targetPosition has been sent to the microcontroller?
- How do you recommend to program the detection of "position reached"?
Thanks in advance.