Synchronising CAN of multiple odrives

Hi,

I have 6 ODrive V3.6 on a CAN bus. Everything works well, however there is one thing which could be improved.

I have the ODrives send the encoder estimates every 5ms. Would there be a way of synchronizing these messages so the estimates are sent out all close together? There are 6 messages together and then the other 3 odrives send them later with gaps. I assume this is just random due to the bootup times and what not. See the oscilloscope image below:

Hi! Unfortunately I don’t think there’s a great way to do this. Could I ask why you’re going for synchronization here?

I’m doing a state estimation together with an IMU. Therefore it would be nice to have these estimates as close as possible timewise. Another part is having 2-3ms after the last estimate to postprocess them all together before new estimates arrive. Perhaps I can try rebooting them in different order to see if I can get it close together.

Gotcha, totally makes sense. You could possibly modify the firmware to trigger the CAN on a GPIO, but other than that I don’t think there’s a super easy way to do this. I think though that if you timestamp the incoming CAN packets well, most modern UKF / EKF implementations should be able to handle the staggered timestamps.

OK in that case it would be good, I’m not an expert on Kalman filters so I have more reading to do.

You can also poll for feedback over CAN, the response from the drives are pretty quick on CAN, see Broadcast here to request in one message. CAN Protocol — ODrive Documentation 0.6.11 documentation

@solomondg Have you considered implementation similar to CANOpen where you send position targets to all drives, send a SYNC message, then all drives synchronously start moving and respond with telemetry as configured? The telemetry is polled as the SYNC message is received, so this enforces the telemetry to be aligned. It would be very helpful in something like CNC machines or robotic arms aiming to produce very accurate motion profiles. This would be good with CAN and even better with CAN FD.

@solomondg Have you considered implementation similar to CANOpen where you send position targets to all drives, send a SYNC message, then all drives synchronously start moving and respond with telemetry as configured? The telemetry is polled as the SYNC message is received, so this enforces the telemetry to be aligned. It would be very helpful in something like CNC machines or robotic arms aiming to produce very accurate motion profiles. This would be good with CAN and even better with CAN FD.

Yes! We have a very long and fun feature backlog :slight_smile: it’s just a matter of development time to get to it unfortunately. I’d personally love something like that.

1 Like