Custom CAN functions

I’m looking to add Odrive to an existing system that has a bunch of CAN stuff running now. Ideally this would drop in and respond to the existing motor command structure.

That looks a bit like this:
MotorAddress - one byte command token - two bytes destination - two bytes speed - one byte maximum current

There’s also a couple other messages before motor start, an explicit “arm” command and a “go” command.

While the motor is moving, there is a periodic (about 100 mS) update message sent with RPM, position, motor current, and motor state.

The existing motor stops under two conditions - reaching commanded destination or exceeding commanded current level.

After it stops it sends the same report again, why it stopped is encoded in the motor state variable.

There’s the obvious problem of range and scaling to make these variables work with the internal floats, but that’s “just math” :slight_smile:
The problems I see at the moment is where to add these can commands, how to hook them to the internals of the controller and the “feature” of stopping the motor on overtorque.

Thoughts very much appreciated.