Using multiple encoders with Odrive

I currently have my odrive s1 driving a motor that then has a gearbox attached, this gearbox and the general design has some slop in the output, is there a way I can use the onboard magnetic encoder for accurate motor control but have a separate through bore encoder for accurate input for the PID/positioning control?

Yes, absolutely! You would simply configure the onboard magnetic encoder as the commutation encoder, and the separate encoder as the load encoder – this should be able to be done in the GUI’s configuration tool, or in ODrivetool (you can use the botwheel setup as an example for dual encoder support, but you’d have to adapt the configuration to use the onboard encoder and whatever type of external encoder you’re using).

Thank you for the reply! I will take a look at that and get back with the results!

Oh, one more thing, I can’t find any documentation or pins for an absolute PWM input from an encoder, is this not supported?

Unfortunately not, it’s just too slow - we need to read the encoder values at roughly 8kHz, and most PWM output encoders only report at 1kHz max, usually around 250Hz.

Maybe in the future this could be an option for strictly the load encoder, but it wouldn’t work for a commutation encoder.

That makes sense, tis a shame though, I’m looking forward to it being a feature for the load encoder in the future.

Agreed, it also causes a /lot/ more trouble than it’s worth unfortunately. 250Hz is pretty minuscule, and usually anything that can output PWM also has a part number that can output SPI. What encoder did you have in mind?

I was thinking of using this: Through Bore Encoder - REV Robotics
It might have spi but it seems like the only absolute output is with pwm

That can actually be changed to expose the SSI output of the internal AEAT-8800 encoder – that’s something I’m working on as a side project, happy to let you know when support is implemented.

1 Like