SPI Encoder Com Fail but reads position data fine

Hi,

I have been trying for the last few days to get my odrive 3.6-56v board running, I am using an AS5047U SPI encoder, but I cant get it to work properly with ODrive.

I have followed all the steps, however I always get an ENCODER_ERROR_ABS_SPI_COM_FAIL

I have tested the encoder on SPI with an arduino, and also get clean data from odrv0.axis0.encoder.shadow_count so it is working fine. Once I set all the settings and save I get no errors from dump_errors(odrv0) however once I reboot then I get the following.

    In [**69**]: dump_errors(odrv0)
    axis0
    axis: **Error(s):**
    AXIS_ERROR_ENCODER_FAILED
    motor: **no error**
    fet_thermistor: **no error**
    motor_thermistor: **no error**
    encoder: **Error(s):**
    ENCODER_ERROR_ABS_SPI_COM_FAIL
    controller: **no error**

I also get an error rate of around 0.5, which I believe should be 0. Any help would be massively appreciated!

In [**52**]: odrv0.axis0.encoder.shadow_count
Out[**52**]: 349

In [**53**]: odrv0.axis0.encoder.shadow_count
Out[**53**]: 347

In [**54**]: odrv0.axis0.encoder.shadow_count
Out[**54**]: 349

In [**55**]: odrv0.axis0.encoder.shadow_count
Out[**55**]: 349

In [**56**]: odrv0.axis0.encoder.shadow_count
Out[**56**]: 350

In [**57**]: odrv0.axis0.encoder.shadow_count
Out[**57**]: -9167

In [**58**]: odrv0.axis0.encoder.shadow_count
Out[**58**]: -56215

In [**38**]: odrv0.axis0.encoder.spi_error_rate
Out[**38**]: 0.5484153628349304

In [**39**]: odrv0.axis0.encoder.spi_error_rate
Out[**39**]: 0.47363629937171936

In [**40**]: odrv0.axis0.encoder.spi_error_rate
Out[**40**]: 0.4634641110897064

In [**41**]: odrv0.axis0.encoder.spi_error_rate
Out[**41**]: 0.4897249639034271

I also tried running a lower voltage (15v) and no change.

AXIS_STATE_FULL_CALIBRATION_SEQUENCE only works with a clear config but rotates the motor one way and then stops, I presume because it’s expecting to receive an encoder signal on the A B inputs by default. Once I add the config info then the motor calibration sequence does not run at all. Also I try to clear the errors with dump_errors(odrv0, True) but it seams to just print the errors again.

Not sure if you’re the same guy from Discord, but the AS5047U is not supported. It reads the data fine, but the AS5047U doesn’t have the flag bits in the right spot.

It’s a simple matter of adding an enum and parser for this chip though, if that’s something that’s interesting to you.

I have this same problem with the AS5047P which is listed as supported in AMS mode.

Did you figure this out?

Thanks

Hi, I then used the AS5047P which worked fine for me.

1 Like