I would like to home the motor on an inductive sensor.
I am using the dynamixel motor XH540-V150-R to rotate a plate. The motor and plate are coupled by gears. On this plate there will be a piece of metal which can be detected by an inductive sensor.
Desired homing functionality:
Move the motor 360 degrees to the right (on a low speed if necessary).
Stop the motor on the rising edge of the sensor signal.
Adjust the Home Offset.
How can I stop the motor midway when its already moving to a goal position (360 degrees)?
My best guess is to write the present position to the goal position on the rising edge of the sensor.
Are there better ways to do this?
Please advise,
DYNAMIXEL Servo:
XH540-V150-R
DYNAMIXEL Controller:
Dynamixel will be controlled by a Beckhoff PLC with an RS485 interface. So the Beckhoff PLC will detect the sensor and control the Dynamixel motor.
Dynamixel operating mode: current-based Position Control Mode
Your initial idea is pretty much how I would recommend implementing something like this. Updating the goal position to the present position will stop the motion as you expect.
I did want to state that you’ll also probably want to clear the homing offset on every startup, prior to the described homing procedure, otherwise you might see the 0 position “walk” a little bit across multiple homing instances.
I have solved this problem by using the velocity mode during the homing sequence. This way I can just set the speed to 0 when the sensor=HIGH. After the homing is done, I switch back to current based position mode and after write the HomingOffset.
This way I don’t have the delay of requesting the present position.