Closed loop control: SPI

Hi, I have a Rs485 absolute encoder, I am using TM4C1294 controller to get the position from encoder using UART and saving in variable ‘angle’, and I have configured SSI0(SPI) to send position ‘angle’ and, connected SSI0clk and MOSI is connedted with respective pins of controller, but encoder calibration is not connecting in odrive

Hi,
Just to make sure I understand:
You’re trying to use an rs485 encoder with an ODrive v3.6. Since rs485 is not supported on v3.6, you’re using an intermediate microcontroller to receive the rs485 encoder data and transform this into an ODrive v3.6 compatible SPI signal?

If this is correct, then there are a lot of reasons this could go wrong.
To start, the ODrive is only compatible with two SPI encoder protocols: CUI and AMS. You will have to mimic one of these protocols exactly, or you will have to add support for your SPI protocol in the ODrive firmware. Which approach are you using?

In general I would strongly suggest using an SPI encoder rather than trying to translate rs485 data to mimic an SPI encoder. Preferably an encoder that is already supported, or one that you can confidently modify the firmware so it is supported.

-Nick

p.s. - apologies if I did not understand the question and answered the wrong thing, if so please clarify what you’re trying to do.

1 Like

Yes, you are right I am doing it same, and now, I am not converting it to spi, just making it quadrature by making two gpio pins high and low, every degree, in phaseshift of 90 degree, Now I am getting correct shadow count of 720 for each rotation but getting error in Offset calibration

Hey Muzammil,

Likely you’re introducing significant latency, which is causing the ODrive controller’s encoder estimator to go unstable. Have you measured the end to end latency? What’s the quadrature clock-out frequency?

That being said, if you want to use RS485, I’d strongly suggest switching to the ODrive S1 or ODrive Pro. What RS485 encoder are you using?