SPI Encoder triggers motor: Error(s): MotorError.DRV_FAULT

Hello, I recently bought an S1 ODrive, where i got familliar with ODrive but sadly there is no option to use a different SPI encoder, than the supported ones. So I got a second hand ODrive v3.6 from a friend, because there the code is open source. I now added code for my own SPI encoder (AEAT-9922 reconfigured for 14bits absolut pos). When i run livplotter of the axis with my encoder and read pos_abs, everything seem fine. But everytime the encoder is plugged in i get error motor: Error(s): MotorError.DRV_FAULT, as soon as i disconnect the spi and clear errors or reboot the error disappears. I sadly do not have an officaly supported encoder on hand to check if i can observe the same with that. My simple question would now just be, could and most likely will this error be of my spi implementation, because i read on this forum that unexpected spi signals also can trigger such behaviour, or if this is indicating another issue? Just becuase I don’t wanna search for somthing wich can easly be indetified to be somthing else…

Today I connected my logic analyser to the spi port. First Without having the encoder connected, and also no DRV error showing up with dump_errors. I’m sending the position read commands over SPI but no feddback (Encoder is disconnected) and probably data beeing transmitted to drv via SPI interface.

Then also with my encoder beeing connected. I receive the correct position from reading with spi read command. But I get a DRV_FAULT error.

Can someone help me understand what is working wrong on the SPI bus and how I would proably be able to resolve that issue. Im now pretty shure it will have to do somthing with my SPI Encoder, because as soon as there is Encoder Data on MISO, i receive the error…

If it help, here are my full logic analyser Saleae Files (can only be opend using their logic 2 software, Logic analyzer software from Saleae)

Thanks in advance!

Geat news!! Im still not exactly shure whats the “real problem” but if i power up the encoder after the spi commands from startup and Data on miso (Still not shure if this really has to do somthing with the drv, but i suspect that it is some communcation to the drv chip) everything seems to work. Now I only have to figure out hav to do that automatically, maybe somthing like a tristate buffer could solve the issue.

1 Like

Hey! I’m glad to see you’ve got it working. It sounds like the note here is similar to the problem you were encountering, yeah?
On ODrive v3.x both motor drv chips use the same SPI MISO/MOSI lines, so your encoder could be interfering with drv chip.

1 Like

Okay thanks, yes I actually only got it working because of that note, I havent considered befor that the DRV only talks at startup back to the MCU on MISO. I think im going to try with the chip stated there or something else like that if availability is bad. I’m also not shure if the AEAT-9922 has even a trsitate buffer or somthing like that or if its just supposed to be on a specific SPI line only for the encoder.