![]() |
Dual encoders
My team is running a tank drive setup this year, and have added an encoder onto each side. We are also using the NavX for angle measurements. We will have a variety of methods that rely on angle measurements from the NavX and distance measurements using one or both encoders.
However, I am wondering if there is really any benefit to having both encoders. If for distance we just take a raw average of both measurements, we are basically getting slightly more precision in exchange for a doubled failure rate. It seems to me that unless you are using two encoders to sense angles in place of a gyro (or some sort of fusion) there is almost no benefit to having dual encoders. How does your team integrate dual encoders into the code? Does anyone just mount/use a single encoder? |
Re: Dual encoders
Quote:
|
Re: Dual encoders
Quote:
Just as we say: - With 1 sensor, you don't know that you're wrong. - With 2 sensors, you know you're wrong but aren't sure which is correct. - With 3 sensors, you always know which one is wrong and which is right (From a single-fault-tolerance perspective) |
Re: Dual encoders
Quote:
|
Re: Dual encoders
Quote:
|
Re: Dual encoders
Two encoder are essential for drive straight using encoders. If one gets ahead of the other, you can adjust the direction. It all goes out the window when crossing defenses though.
|
Re: Dual encoders
Ok I'll chime in, we typically end up using just one encoder and the gyro even though we have two encoders.
Some years, we have implemented some code which has some logic like the following "psuedo-code": if ((encoder count isn't changing) && (trying to drive)) { encoder_is_broken_counter++; } else { encoder_is_broken_counter = 0; } const int ENCODER_MUST_BE_BROKEN_COUNT = 100; if (encoder_broken_counter > ENCODER_MUST_BE_BROKEN_COUNT) { ABORT_AUTONOMOUS_MODE! } Maybe one could improve on this logic to switch which encoder you are using, switch from averaging the encoders to ignoring the one that isn't working? Typically we run out of time to do all of the fancy stuff we would like to do in autonomous. |
We use 2 encoders and check if one or the other is where we want, that way we can handle a single encoder failure.
|
Re: Dual encoders
^ Same, we typically just check if either is greater than target, and call it good. Close enough for FRC... We use $60 encoders, not wanting to buy another, to know which is broke, as I am broke. . .
|
Re: Dual encoders
Having two encoders also helps to ensure driving straight. The way we implement it can be found at https://github.com/FRC1458/turtleshe...tDrivePID.java, we combine the gyro data and the difference (left - right) to figure out how much the motors need to drive differently.
|
Re: Dual encoders
Quote:
|
Re: Dual encoders
Quote:
|
Re: Dual encoders
Quote:
|
| All times are GMT -5. The time now is 19:43. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi