Multiple encoders for one axis

Hi, I’m working on a gearbox project that I’m driving with the Odrive. I’m currently using an encoder mounted on the motor to drive it properly, but in the future, I want to use another encoder on the output of the gearbox.

I figured for simplicity’s sake I could just plug a second one into the second axis, but I don’t know how I would then control it. I’d want to use the encoder mounted on the gearbox output to control the position, but then I don’t know how I would translate that to the other axis with feedback so that it goes to the correct position. Some kind of loop program that multiplies the output position by the reduction and then adjusts the motor axis position depending on the gearbox output position? I think that could work I just don’t know exactly how I would go about something like that.

One limitation to using two encoders would be that it would limit me to only using one motor per ODrive (I’m building a robotic arm so controlling two motors with one ODrive would be preferable) so another idea I had was using hall feedback because I’m getting different motors soon and I have the option of getting them with hall feedback. But then my question is can I use the hall feedback to drive the motor but then use the gearbox output encoder for position control? And if so how the hell would I go about doing that because to me that seems more complicated than the first idea I had.

Now while writing this I’ve also thought of a third option of only having one encoder, on the gearbox output but then I would have to translate that to the proper motor rpm, plus if there are issues with the gearbox and it slips I would not know and would like to for design and maintenance.

Using one motor per odrive and two encoders is supported by ODrive today. See “Load encoder” in the axis config.

It’s been a while since I’ve asked this but, I cannot find anything about “Load encoder.” I’ve looked everywhere in the documentation. Nor have I found anything on google yet. Help would be appreciated. I’m only starting this now because I recently got the second encoder.

What the hell I just found it. “load_encoder_axis” Just gotta figure out how to use it now…

1 Like

If your motor is connected to axis 0, then set load_encoder_axis to 1 - the odrive will use the encoder of axis 1 as the load encoder.

Normally this is set to -1 or the same as the current axis, so the motor encoder is used as the load encoder.