AS5048A SPI error

Hi all,

We have a major issue with the Odrive S1’s in combination with the AS5048A (AMS) encoders. These work great in our current custom VESC based design (4 controllers per robot). We have switched to Odrive S1 for our new batch of robots (big stock of Odrive components arrived). But to our surprise the encoders are not read out. After many hours of debugging we might have found the culprit. See the scoped images of the SPI bus:

No error:

Error:

The encoder works great (when configured). We can read out the position as expected. But once we do any motor related calibration the error flag (EF) of the AMS encoder (second bit from the left, see images) is raised. At this point the Odrive seems to ignore all readings (even if they continue to be send, despite the error flag).

We have designed special differential ended signalling circuits for the SPI bus to minimize the influence of any EMC. This works great on our custom VESC based controllers. Even under high load/currents. But not on the Odrive S1.

Is there anything we can do to ignore the error flag? The source code doesn’t seem to be available. Or am I not looking correctly? Maybe anything else I can try/do to make the Odrive happy?

Looking forward to your reply. Really hope someone can help.

Hi Willem,

Thanks for reaching out!

The S1 will attempt to auto-clear errors that come up on the AS5048A; do your differential circuits also transmit the contents of the MOSI line, or does it hold this high on the AS5048A side? That would explain why the errors aren’t being cleared.

You could also try reducing spi_encoder0.config.baudrate and see if this helps, e.g. if it’s a signal propagation delay issue (I believe the default baudrate is about 1.5MHz, some differential transceivers may introduce significant clock skew) – though it does seem like that’s not the case, if this is only happening after starting motor calibration.

S1 firmware is closed source, however we can make it available under an NDA in some cases – feel free to shoot an email to info@odriverobotics.com and we can chat. Alternatively I’m happy to send over a build that ignores the error bit, if that would be a shorter-term solution that works for you. Generally we recommend our OA1 encoder, which communicates over RS485 (and is thus quite resistant to EMI).