Custom homing sequence

Background:
I am building an xy-table with corexy desing. I use two mechanical endstops and I want to home the axis one after each other (the y-axis has to be homed beofore the x-axis, otherwise it will miss the mechanical endstop).

Problem:
Odrives homing sequence assumes that it can turn the motor of axis_n until it hits the axis_n.min_endstop. As I am using a corexy design this assumption does not hold and the procedure does not work.

Question:
How should I customize the homing sequence to fit my needs?
I see two approaches:

  • Python: I could write a custom homing sequence sending velocity commands to the odrive an poll the endstop. The problem I have with this approach is that the odrive fires an error ( with good reason ) when it hits the endstop without beeing in AXIS_STATE_HOMING mode. I then have to clear all erros which is quiet uglly as also other erros could have been occured.
  • C++: I could write a homing sequence runnig directly on the odrive. The problem with this approach is that I dont feel confortable writing this from scratch, has any one done somthing similar and could give me some example code and support ?

Typically you will have a motion controller that sends commands to the ODrive, step/dir is pretty common here, but other interfaces could work.
Usually you would do homing with the switches wired to this motion controller, and then apply an offset there.

1 Like