Calibration in the "Field"

Hello Fellow ODrivers,

My team and I are building a 4-axis SCARA-style robot arm using four 270kv ODrive motors and four ODrive S1s.

I am using two encoders per axis (incremental for commutation and an absolute encoder on the load side). The robot has hard stops that limit continuous rotation on J1 and J2. I am concerned that when I try to calibrate I will hit these hard stops. If I recall correctly from my early experimenting, the calibration sequence on the GUI side does a 360deg rotation.

Is it possible to command a smaller angle sweep when calibrating? Can I save my config on the GUI side and then run a script that does a different calibration more suitable for my application? If so, wheat type of calibration is recommended for this? Please let me know if there is a better way to get around this issue.

Best and thanks,
Emi

PS I will post a picture of the robot + control cabinet soon!

Hi!

The calibration by default moves by eight pole pairs (calib_scan_distance). This can be reduced, but at the cost of lower calibration accuracy, so I would avoid touching this if possible.

Typically you also want to do encoder offset calibration while the motor is fully unloaded – it’s quite sensitive to load, especially any biased/gravity-based load. You can increase the robustness of calibration under load by increasing axis0.config.calibration_lockin.current to around 2/3 - 3/4 of the motor’s max continuous current, but I would still avoid reducing calib_scan_distance.

Usually if using an incremental encoder (which I assume has an index line), you’ll want to do index search + encoder calibration while the motor is unloaded, and then only run index search on each startup. Note though that index search requires a rotation up to 360° of the motor, so you may have the issue here of running into a hardstop.

I assume you’re using a gearbox, so a 360° rotation of the motor is okay, as long as it’s done in a safe location?

I would say you have two main options:

  1. Switch to an absolute encoder for commutation – if you can let me know what encoders you’re using for commutation/load at the moment, happy to recommend a solution to use absolute for both! Or you can use an absolute encoder for commutation and incremental for load, then add physical endstops to the robot and home against that to get the absolute position after startup (or do a hardstop-based homing where you reduce current limit → drive slowly into hardstops → wait for current to spike).
  2. On startup, move the motors in open loop mode until they’re both around the middle of the travel range (using AxisState.LOCKIN_SPIN, configured by axis0.config.general_lockin), then run index search there. Alternatively, since index search is always done in a known direction, you could very gently (low axis0.config.general_lockin.current) drive the motors into the hardstop in the opposite direction that index search will move.

PS I will post a picture of the robot + control cabinet soon!

Very excited to see!!

Hey Solomon,

You are correct that we are using gearboxes so I think we should be good. I thought that the calibration did 360deg rotation at the load end but it seems it only does it on the commutation end?

If that is correct, we should be good.

Emi

Hey Emi,

Yes, that’s correct – only on the commutation end! I would still strongly recommend doing an index search + calibration with the motor unloaded/disconnected, and then only do index search in the future, if possible. Alternatively, if you don’t have an index line, cranking the calibration lock-in spin current to around 30-40A should work fine.

1 Like