Encoder output from Odrive Pro

Hey again,

We have some equipment that need encoder input to work - but we do not have an encoder (and do not have space for one). We just use the hall effect sensor on the motor as encoder feedback to the odrive, which works great for the application. But since Im in need of an encoder signal, is it possible to output this from the odrive in any way?

Hi! Apologies for the delay in my reply, this totally slipped through the cracks.

At the moment, this isn’t possible, however future products will have this functionality. Simplest option is of course just grabbing a quadrature encoder and running it both to the ODrive and your other equipment. Alternatively, you could to use an Arduino to read the ODrive position over UART or CAN and output the corresponding encoder signal – basically emulating a quadrature output.

Hey again! Im trying to emulate an encoder with an Arduino - but i am having some trouble with the resolution of the position stream from odrive. It does not seem to be high enough, so I am missing a lot of ticks as the difference between the position are to big. Any recommendations?

Would using canbus be faster?

Hmm, can you elaborate a bit on your algorithm? You said “missing a lot of ticks as the difference between the position are to big.” What specifically are you reading from the ODrive, and how are you outputting from the Arduino?

Yes, im reading position from odrive via this example: Controlling ODrive from an Arduino via UART — ODrive Documentation 0.6.11 documentation

The maximum speed we run the motor at is 9000 rpm. The readings i get from the odrive at higher rpm will have a difference from one position to the next of sometimes a full round of the motor - this will only register as one tick on the “encoder” even though it should tick every 1/42 of a round (or some other number).

I could maybe read the velocity instead, and integrate every 1ms to update the position and use that instead?

I’d likely recommend having an accumulator on the Arduino that counts the total number of up-counts/down-counts you’ve output over the quadrature output. Then whenever you get a new position from the ODrive, you can (at a constant frequency) output the pulses to make the accumulator match the number of counts you’ve output. You’ll see little “bursts” of quadrature counts from the Arduino every time it reads the new position from the ODrive, but that’s fine.

I ended up connecting the arudino to the hall-encoders as well. When calibrating, does the odrive calibrate the hall encoders with any parameters to get a better position reading? Or does the position reading come solely from reading the hall effect pins directly?

There’s an analog low-pass filter on the hall pins themselves, to filter out any very high frequency noise from motor switching. In addition, the ODrive uses an encoder estimator to filter the encoder position values and derive the velocity values.