AMT232 Absolute Encoder Not Working

Hello, I recently bought an Odrive and am trying to get it to run with an AMT232B encoder, to no avail. I’ve seen a few issues similar to mine, but not as recent or with Windows.


  • Motor: DUAL SHAFT MOTOR - D5065 270KV
  • Encoder: AMT232B-V absolute encoder
  • Power Supply: 24V 18A
  • ODrive Firmware: v0.5.1-dev
  • OS: Windows 10
  • ODRIVE V3.6 56V

I was able to follow the intructions in for SPI Encoder until:
odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_CUI
Where I recieved an error:
NameError: name 'ENCODER_MODE_SPI_ABS_CUI' is not defined
I then just set the odrv0.axis0.encoder.config.mode = 256 which is what I think the macro is equal too. However when I run the calibration, nothing happens. I run shadow_count an it only returns 0.

Have you set up the CS GPIO pin? You may need to save config & reboot.

Also, the reason the enum doesn’t exist is because you are running an old version of odrivetool. Can you run the one from the repo instead?

1 Like

For the AMT232B-V specifically, we very recently discovered that it does not tristate the MISO line properly when CS is high. As a result, it conflicts with the gate driver SPI communications on startup and precludes the usage of two AMT232B-V at the same time.

There are a few solutions. One is to sequence power to the encoder a second or two after the ODrive receives power. This allows for the gate driver to properly initialize, but only allows for one SPI encoder to be used due to the MISO conflict. Another is to use a tristate buffer between the encoder MISO and ODrive like a 74AHC1G125SE. The enable line on the tristate buffer should be connected to the encoder CS. This should allow for multiple AMT232B-V to be used at the same time (one for each axis).

1 Like

I set up the CS GPIO pin as well to be 4. I will with the new odrivetool

That seemed to fix the problem of not being able to shadow step! However now when I run the AXIS_STATE_MOTOR_CALIBRATION I get ERROR_DC_BUS_UNDER_VOLTAGE on my axis. I am using a 24 v powersupply and set :
odrv0.axis0.motor.config.calibration_current = 10
odrv0.axis0.motor.config.resistance_calib_max_voltage = 12.0
odrv0.axis0.controller.config.vel_limit = 5
Is there something I am missing?

Is there a smart way to get the updated odrivetool on windows?

Download the source code from github, then open a powershell terminal in the tools folder (shift+right-click -> Open Powershell Here), and type ./odrivetool

1 Like

Alrighty. I will give that a shot, thanks!

1 Like

Did you get it working (and how?) @Cobdor ?