Two motors working together, are 2 encoders better or worse than 1?

We have dual motors on our arm with VP gear boxes and are planning to use the integrated mag encoder stage. Trying to figure out if one on each motor is better than just 1 on one motor. More accuracy or more conflict?

You should only need one. Especially if the motors are physically connected. Think about it like a drive train.

3 Likes

I think it would come down to how you read the sensors (not physically, but how you are interpreting the signals). If you average the two encoder counts to give “one” reading, it is probably doable.

If you read them as two separate inputs and try to drive each motor to meet the same encoder count (given appropriate zeroing), they will most likely fight with each other.

The simplest option is to just read one encoder and drive the 2nd motor as a slave to the first.

3 Likes

Could be better, but as others have said it comes down to interpretation of the measurements.

I would start with the assumption there is only one physical speed you care about, and in theory both sensors are measuing that same speed. When you have two inputs that disagree, you can say “at least one of these is wrong”, but you can’t say which is right without additional information. For example, if you had a third encoder, you could discard the one reading which misaligns with the other two. You could also pull in motor command or motor current to say roughly whether you expect the speed to be “high” or “low”.

Personally, I would say this level of redundancy is overkill for a robot that has to run for just a few minutes at a stretch, and will be maintainenced in between matches. Remember the second encoder is another part which can fail, and an extra line item on a checklist. I’d personally only use one.

1 Like

Interesting. Somehow we were told to put an encoder on both of our gearboxes on the drivetrain although I can’t remember who or where. Do most teams have just one on the drivetrain? We are using TB minis with mag encoders.
Thanks

You want one encoder per gearbox for the drivetrain.

What @Zem was saying was that each gearbox has two motors but you only have one encoder

1 Like

Sorry about that. The arm motors we are planning are not physically connected but one can be slaved.

Wouldn’t the motors be physically connected by the arm?

Both.

If you only use one, then that’s the only data point you have, so you just assume it’s correct. If you use two, then you have two data points, which is more information, but the two of them are both supposed to be correct. Since they will be reading different values, there will be no way to deny that neither one of them is likely to be exactly correct, and you will have to reconcile the two measurements somehow.

If you are fairly sure that both of them are moving in sync, and that the values of the encoder are accurate, one should be fine. If you are not sure about accuracy, figure out how to use the two sets of data together to improve the estimate. On an arm, you really shouldn’t have any slip like you would on a drive train, so one probably ought to do ok.

There are some pitfalls in using two encoders and trying to reconcile them. One of them occurred to us in this match:

(Marysville 2018, match 59)

If you watch the video, we are the red robot on the far side. You’ll see us drive toward the scale, turn to face it, lift up our arm, and dump the cube on the scale. It was actually the first time we had scored the scale in autonomous, so everyone was turning to me (the programming mentor) in the stands, congratulating me. I, on the other hand, was texting the lead programmer, who was in the pits. I knew they had a live feed so I was asking, “What was that? Did you change the autonomous code?”

I knew that when we went for the scale in autonomous, we were supposed to turn away from the scale and pop the cube in backwards. It was more reliable.

It turns out we had two drive encoders. For more accuracy, we used the average

averageEncoder=(leftEncoder.get()+rightEncoder.get())/2;

The pit crew had left one disconnected after a hasty repair. The right encoder was always outputting zero. We had actually gone twice as far as intended. We were trying to score to the switch, and we missed.

Moral of the story, for purposes of this thread, is that if you use two, you have the potential for greater accuracy, but you also have the potential to create a situation where you have two possible failure points instead of one. If you don’t know how, or don’t have time, to write the software to take care of both encoders and reconcile conflicts, one might be more reliable.

2 Likes