Thread: Dual encoders
View Single Post
  #7   Spotlight this post!  
Unread 18-02-2016, 14:41
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 146
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Thumbs up 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.