Go to Post I pumped my fist to cheer - but since I was a ref at the time it looked like I signaled a red foul... - Tom Ore [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-02-2016, 17:27
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,058
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
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?
  #2   Spotlight this post!  
Unread 14-02-2016, 17:39
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,092
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Dual encoders

Quote:
Originally Posted by Caleb Sykes View Post
we are basically getting slightly more precision in exchange for a doubled failure rate.
If you play your cards right, you can use the redundancy to reduce the effect of an encoder failure.



  #3   Spotlight this post!  
Unread 14-02-2016, 17:47
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Surf City Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 520
seg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond repute
Re: Dual encoders

Quote:
Originally Posted by Caleb Sykes View Post
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?
In industry, we would actually use 3 encoders and then always select the midvalue one.

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)
__________________
My FIRST legacy:

Team 204 Student 2001, 2002 (Voorhees, NJ)
Team 1493 College Mentor 2006 - 2008 (Troy, NY)
Team 2150 Intern/Professional Mentor 2007, 2009 (Palos Verdes)
Team 4123 Lead Engineering Mentor 2012 (Bellflower, CA)
Team 4276 Engineering Mentor 2012-2016 (Huntington Beach, CA)

Last edited by seg9585 : 14-02-2016 at 17:50.
  #4   Spotlight this post!  
Unread 14-02-2016, 17:48
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,058
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: Dual encoders

Quote:
Originally Posted by Ether View Post
If you play your cards right, you can use the redundancy to reduce the effect of an encoder failure.



Does anyone actually do this in FRC? I had played around with the idea of constantly checking both encoders, and if one is consistently outputting zero (possibly indicative of faulty wiring), switch to the other one. Are there any other common failure modes that we could look for?
  #5   Spotlight this post!  
Unread 18-02-2016, 13:51
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,058
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: Dual encoders

Quote:
Originally Posted by Caleb Sykes View Post
How does your team integrate dual encoders into the code?
I'm still hoping for answers. If I don't get any responses, I will assume that everyone just averages the two values.
  #6   Spotlight this post!  
Unread 18-02-2016, 14:03
martin417's Avatar
martin417 martin417 is offline
Opinionated old goat
AKA: Martin Wilson
no team
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Buford, GA
Posts: 720
martin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond reputemartin417 has a reputation beyond repute
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.
__________________
Former Mentor Team 1771
Former mentor Team 4509
  #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: 147
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.
  #8   Spotlight this post!  
Unread 18-02-2016, 15:13
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,573
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
We use 2 encoders and check if one or the other is where we want, that way we can handle a single encoder failure.
  #9   Spotlight this post!  
Unread 18-02-2016, 15:20
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 520
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
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. . .
__________________
The sooner we get behind schedule, the more time we have to catch up.


Last edited by tr6scott : 18-02-2016 at 15:22. Reason: miss u
  #10   Spotlight this post!  
Unread 19-02-2016, 01:20
mehnadnerd mehnadnerd is offline
Registered User
AKA: Brendan
FRC #1458 (Red Tie Robotics)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2009
Location: Danville
Posts: 5
mehnadnerd is an unknown quantity at this point
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.
  #11   Spotlight this post!  
Unread 19-02-2016, 14:11
Caleb Sykes's Avatar
Caleb Sykes Caleb Sykes is offline
Registered User
FRC #4536 (MinuteBots)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: St. Paul, Minnesota
Posts: 1,058
Caleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond reputeCaleb Sykes has a reputation beyond repute
Re: Dual encoders

Quote:
Originally Posted by Joe Ross View Post
We use 2 encoders and check if one or the other is where we want, that way we can handle a single encoder failure.
Can you tell which one is behaving correctly and which one is failing? Or do you just abort if they are different enough?
  #12   Spotlight this post!  
Unread 19-02-2016, 15:07
Alan Anderson's Avatar
Alan Anderson Alan Anderson is online now
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Dual encoders

Quote:
Originally Posted by Caleb Sykes View Post
Can you tell which one is behaving correctly and which one is failing? Or do you just abort if they are different enough?
His description suggests that it accounts only for an encoder reporting too few counts. If either of the two reaches the target, the code considers the travel distance satisfied and continues to the next step. Since the typical encoder failure results in it not counting at all, this is highly likely to have the desired result.
  #13   Spotlight this post!  
Unread 19-02-2016, 15:25
Travis Schuh Travis Schuh is offline
Registered User
FRC #0971 (Spartan Robotics)
Team Role: Engineer
 
Join Date: Dec 2006
Rookie Year: 1999
Location: Los Altos, CA
Posts: 123
Travis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant futureTravis Schuh has a brilliant future
Re: Dual encoders

Quote:
Originally Posted by Caleb Sykes View Post
Does anyone actually do this in FRC? I had played around with the idea of constantly checking both encoders, and if one is consistently outputting zero (possibly indicative of faulty wiring), switch to the other one. Are there any other common failure modes that we could look for?
We have encoders and potentiometers on all of our joints, both for zeroing and fault detection. Last year we correctly e-stopped our elevators when one of the encoders got unplugged. Not the drivetrain, but still a use of redundancy.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi