Encoder error_illegal_hall_state

I believe I’m having the same issue as in this topic:

The motor will not finish calibration.

I’m using an electric skateboard motor with 5 pin hall effect output. I set the encoder to mode 1, 42 CPR, and I added 47nF caps to M0 header pins.

I wasn’t sure what wire colors go to what input (wire colors yellow white orange, and inputs A, B, Z) so I hooked them up in the same order as the connector on the skateboard motor.

Strangely, if I print out the shadow count and rotate the motor exactly one revolution, it increases by 42 every time as it should, so it seems like the hall effect sensors are working.

Do I need to recompile and reflash the firmware like in the question I linked? Or just flash the latest firmware?

I have an odrive V3.6 56V, fw version 0.5.1

I tried setting odrv0.axis0.encoder.config.ignore_illegal_hall_state = True, calibration now stops with no errors, but axis0.motor.is_calibrated is still False.

Here’s a scope capture of the hall effect signals, 1 2 and 3 are A, B and Z respectively.

I was able to get the motor working (well spinning at least) by upgrading to firmware version 5.2, I believe this is because 5.2 automatically detects hall polarity.

2 Likes