How to stop motor for homing on sensor

Hello guys,

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


Software Interface:

Beckhoff CoDeSys

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.

1 Like

Hi Jonathan,

Thank you very much! I will write the homing offset to zero on every startup. I will test this solution in the upcoming weeks.