Two Absolute Encoders to ODrive

Hello,

My name is jimmy.

We bought ODrive v3.6 56v board.

May we communicate with ODrive by UART with two absolute encoders?

And we also need one UART to communicate with Arduino.

So we need total three UART.

Do you have any idea of experience similar to this situation?

Thank you!

ODrive normally communicates with absolute encoders via SPI, not UART.
What type of encoder are you trying to use?

1 Like

We use orbis encoder.
https://www.rls.si/cn_en/orbis-true-absolute-rotary-encoder?___from_store=cn

If we want to use two absolute encoders to ODrive via SPI,
How do I create the second SPI CS Port?

The CS “port” is just a GPIO pin. You can use any of the GPIOs, just set encoder.config.abs_spi_cs_gpio_pin to the corresponding number.

The Release Candidate version of the firmware supports those encoders natively. Hook up CLK, MISO, and the two CS pins (GPIO 8 and GPIO 7 shown below, but that’s configurable).

odrv0.axis0.encoder.config.mode = 259
odrv0.axis0.encoder.config.cpr = 2**14
odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin = 8
odrv0.axis1.encoder.config.mode = 259
odrv0.axis1.encoder.config.cpr = 2**14
odrv0.axis1.encoder.config.abs_spi_cs_gpio_pin = 7

odrv0.axis0.config.startup_closed_loop_control = True
odrv0.axis0.config.startup_encoder_offset_calibration = True
odrv0.axis0.config.startup_motor_calibration = True

odrv0.save_configuration()
odrv0.reboot()

odrv0.axis0.encoder.config.cpr = 2**14
2**14 =>This is a value?

I bought AMT20-V KITS (https://www.mouser.tw/datasheet/2/670/amt20_v-1775926.pdf)
Do u know what cpr value?

It tells you right there in the datasheet: 4096

Thank you!
And another question.
AMT20-V
Command 0x10: rd_pos (read position)
Command 0x70: set_zero_point (zero set)
How do I set config? and how to send command by odrive native protocol?

We’ve discovered recently (two days ago) that the AMT20 is not supported by ODrive. Please substitute the AMT232-b

Supported absolute encoders are:

  • AS5047p
  • AS5048A
  • AMT232-b
  • RLS Orbis (SSI LVTTL 5V)

Probably also AS5147U. AS5047P seems to be discontinued (I wonder why, given the issues we have been having…)

The AS5147U is explicitly NOT supported at this time, but could easily be added (the protocol is slightly different)

1 Like

Hi, I am testing your release candidate version of the firmware. I am a bit confused about the encoder doc (https://github.com/madcowswe/ODrive/blob/rc-v0.5.1/docs/encoders.md). It mentioned “The encoder’s SCK, MISO (aka “DATA” on CUI encoders), GND and 3.3V should connect to the ODrive pins with the same label.” I have CUI AMT232B encoder, it requires 5v power supply. Should I tie 5v to 3.3v from Odrive or 5v from Odrive please?