I burned a day trying to get hoverboard motors and their hall sensors working with the odrive and I thought I’d share the solution here to help others having the same problem out. There are some great resources for this, so I was optimistic it would be a quick project as I’ve been using odrives for several years now :
Odrive Hoverboard motor guide
detailed video by AustinTronics
Unfortunately after setting everything up and exactly following the instructions the encoder calibration kept failing with EncoderError.ILLEGAL_HALL_STATE. I tried switching wires on the hall sensor, switching hoverboard motors and switching odrives. The current version of the Odrive Firmware is 0.5.4 so I tried rolling back to 0.5.3 and 0.5.2 all with the same result. Nothing helped until I looked at the version of the firmware that AustinTronics was using in his video (by looking at his odrivetool output on his laptop). He was using FW 0.5.1. Sure enough this worked like a charm exactly as seen in the video without any changes in my hardware setup. So something has borked the hoverboard hall sensor calibration in the new releases and needs a fix. To save you some hunting around to get version 0.5.1 on your odrive do the following :
Download the .elf file for your specific odrive HW version from the odrive github releases folder :
For example this is the full url for release 0.5.1 for my 24v OD3.5 file :
You can download it directly using :
Then pass this file as an argument to odrivetool dfu to flash your odrive firmware :
odrivetool dfu ODriveFirmware_v3.5-24V.elf
Also using AustinTronics’s python script to do the config setting and calibration is really handy.
And lastly if you need smooth low speed operation of the motor then you’ll want to run the anti-cogging calibration, just ignore his config settings (as he is using a different motor and encoder). Also the calibration only took 45 seconds with the controller gains from AustinTronics’ script so you can ignore tweaking those too.
Hope this saves people some time! And a fix would be great in a new release at some point