Encoder.is_ready becoming false after reboot

Hi,

I am using two hub motor for my differential drive system having an incremental encoder of 4069 resolution with no index. And i want to run in AXIS_STATE_CLOSED_LOOP_CONTROL. I did the calibration for motor and encoder but after rebooting the driver the encoder.is_ready is toggling back to false hence i cannot change to AXIS_STATE_CLOSED_LOOP_CONTROL. Since its been used for differential drive system calibration after every reboot is not possible. Since I want to run in CLOSED LOOP VELOCITY MODE so after every reboot current motor position is not required.

How can i solve this issue?

That is the intended design.

That is incorrect. It is not possible to save calibration across reboots with only an incremental encoder, because you don’t know the electrical phase at boot. If you want to run ODrive without calibrating, you need an absolute encoder.

But motor current pose is only required if we are running in POSITION based control mode (Case of a manipulator), is it required for VELOCITY based control also, since the encoder CPR is set and for closed loop velocity control the feedback can be calculated using the change in encoder counts ?

What if i tweak the firmware to retain true for encoder config.pre_calibrated and encoder is_ready while using using incremental encoder after reboot, is it possible ? and will it cause any problem?

The encoder position is required to know the electrical phase, for the current control to work. Since you don’t know the electrical phase at startup, you have to calibrate every time. And of course velocity mode uses current control.

You could use the sensorless mode but it can’t stop or change directions

If we use hall feedback this is solved, In our motor we have both hall and encoder (incremental). So is it possible to used hall sensor for position and encoder for control ?

Unfortunately that’s not currently possible, but should be possible once the encoder refactor happens (essentially, this is the “dual encoder” or “Load encoder” mode, where you are using hall sensors for commutation and encoder for position or velocity estimate). See Using an absolute and incremental encoder per axis