I am using ODrive to control the motors on chassis. I don’t care where the index is on a wheel.
My encoder is bought from ODrive shop, AMT102, it has a Z signal, which I don’t need.
I understand the two aspects of calibrating encoders: (A)let ODrive know how encoders are mounted to motor(direction), (B)let ODrive know where the index is.
I believe I should only need to do (A) once, and don’t need to do (B) at all.
But I tried to follow this page https://docs.odriverobotics.com/encoders, both instructions for “without index” and “with index”, couldn’t get what I want.
Now, how can i set up(calibrate) my ODrive so that I don’t need to calibrate it every time after reboot?
AMT102 is an incremental encoder.
When you power it up it has no idea where it is in absolute space - so your odrive doesn’t either.
The index pulse is the only fixed absolute reference on the AMT102. At the minimum (with an incremental encoder) you must perform an index search on startup to use the pre-calibrated data.
Only way to avoid index search on startup is to use an absolute encoder (eg AMT203S) but the odrive doesn’t support it out of the box so some extra lifting is required on your end to make it work.
Not all incremental encoder have Z-phase. Can I not plug the Z-phase of the encoder into Odrive, and just use AMT102 as a AB non-indexed encoder? (I have done similar things with other driver and encoder)
What about encoders(incremental encoder) without index, do we also need to calibrate them every time on startup? why?
The odrive controls motors using something called field oriented control. This control method requires that the odrive know exactly where the rotor poles are with respect to the stator windings. Without knowing this information torque cannot be generated (at least not efficiently) because the odrive doesn’t know at which angle to apply current w.r.t. the rotor.
The only way to get around the calibration step is to somehow maintain an absolute reference through power cycling. This is typically done using an absolute encoder. You may be able to use sensorless control, but it generally doesn’t have very good torque control at low speeds.
This type of situation is not unique to Odrive. It is a general problem that you run into when working with electronically commutating synchronous motors.
I should probably mention that the use of an absolute encoder isn’t currently supported by Odrive. I think someone in the community has developed the functionality, but I don’t think it has been ported into the main Odrive development branch yet.
You could skip the calibration on startup and simply run in sensorless mode. Like jalbob mentioned, this results in poor torque (especially at low speeds). But since your encoder has a Z channel it is essentially an absolute encoder with a very poor resolution. As soon as you pass the Z-index you could resync the ODrive and re-enable the sensored FOC.
So like in the tutorial for ‘Encoder with index signal’, but instead of automatically searching for the Z-index, you run your application like normal and as soon as you pass the Z-index, you resync and enable sensored mode. You will have to dig into the firmware to make these changes however.
If you get a motor with integrated hall encoders (3-phase), you can run it in sensored control immediately without calibration or editing the firmware: check the hoverboard guide https://docs.odriverobotics.com/hoverboard (might need to add capacitors on the hall encoder lines however: Encoder error ERROR_ILLEGAL_HALL_STATE).