REV Absolute Encoder

Trying to setup this absolute encoder

I think I need SPI connection. It seems like this encoder is now supported.
I checked the pin connections twice.
Rev | Odrive
V | 3.3
Miso| Miso
Sel | Pin 8
Mosi | Mosi
CLK | SCK
GND | GND
(I’m not sure what SEL means on the REV.)

calibration for it

odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin = 8
odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_AMS
odrv0.axis0.encoder.config.cpr = 8192
 dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: Error(s):
    ENCODER_ERROR_ABS_SPI_COM_FAIL
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: no error
  controller: no error

I think we need switch option S but not sure. I also tried both

I don’t need to do anything but power it up for the error to show. If I unplug the encoder, the errors go away and I can go back to using axis1 that is still setup properly. Once I plug the encoder back in, i get the error again. If I clear errors then the error is still there. I was unable to search for advice.

the SEL from the REV encoder is on GPIO 8. not pin #8 I mispoke in the original post

Paul: I know it has PWM out. If it also has SPI then the odrive needs to be in ABS_AEAT mode
Sage: so I would do
odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_AEAT
is this correct
Paul: Correct. then save and reboot I think

I ran with a bunch of dump errors scattered in between steps

odrv0.erase_configuration()
odrv0.config.enable_brake_resistor = True
odrv0.config.dc_max_negative_current = -1
odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin = 8
odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_AEAT
odrv0.axis0.encoder.config.cpr = 8192
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
In [23]: dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: no error
  sensorless_estimator: no error
  encoder: Error(s):
    ENCODER_ERROR_NO_RESPONSE
  controller: no error
axis1
  axis: no error
  motor: no error
  sensorless_estimator: no error
  encoder: no error
  controller: no error

plugging in the encoder seems to give a MOTOR_ERROR_DRV_FAULT sometimes and can be turned off by unplugging the encoder

In [17]: odrv0.erase_configuration()
Oh no odrv0 disappeared

Reconnected to ODrive 206235A55748 as odrv0
In [18]: dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: no error
  controller: no error

In [19]: dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: no error
  controller: no error

I removed and plugged the encoder back in

In [20]: odrv0.clear_errors()

In [21]: dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: no error
  sensorless_estimator: no error
  encoder: no error
  controller: no error
axis1
  axis: no error
  motor: no error
  sensorless_estimator: no error
  encoder: no error
  controller: no error

In [22]: odrv0.config.enable_brake_resistor = True
    ...: odrv0.config.dc_max_negative_current = -1
    ...: odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin = 8
    ...: odrv0.axis0.encoder.config.mode = ENCODER_MODE_SPI_ABS_AEAT
    ...: odrv0.axis0.encoder.config.cpr = 8192

In [23]: odrv0.save_configuration()
Oh no odrv0 disappeared

Reconnected to ODrive 206235A55748 as odrv0
In [24]: dump_errors(odrv0)
system: no error
axis0
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: Error(s):
    ENCODER_ERROR_UNSUPPORTED_ENCODER_MODE
    ENCODER_ERROR_ABS_SPI_COM_FAIL
  controller: no error
axis1
  axis: no error
  motor: Error(s):
    MOTOR_ERROR_DRV_FAULT
  sensorless_estimator: no error
  encoder: no error
  controller: no error

In [25]:

Looks like the encoder has a switch on it.

It might only support PWM or incremental mode, though.

I doubt anyone has used this encoder in absolute mode with ODrive, despite the “Guide” (perhaps someone indicated it would be compatible due to the AEAT encoder built-in?)

is there an absolute encoder that works and has been tested in absolute mode?

darkvortex: The rev document specifically says SPI is not supported, only for factory setup
Paul: ah well there you have it

1 Like

As mentioned on discord, the AS5047P, the AS5048A, and the RLS Orbis encoders I know function. The CUI AMT23 series work, but not very well (due to some bug in the AMT23 encoder PCB)