OCCRA
Go to Post Hmmm, the Michelangelo method of robot building. Just cut away anything that doesn't look like a robot. - GaryVoshol [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 12-30-2005, 09:39 AM
Mr.G Mr.G is offline
My brain hirts.
AKA: Kevin
FRC #0326 (Xtreme Eagles / Romulus High School / General Motors)
Team Role: Engineer
 
Join Date: Dec 2002
Rookie Year: 2001
Location: Romulus
Posts: 244
Mr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond repute
Send a message via AIM to Mr.G
Autonomous using encoders

I have a question on how other teams use encoders to control the motion of there robot in autonomous. I understand how to turn reliably and go straight for short distances, but my problem is going straight for long distances.

The difference in encoder counts between both sides of the robot builds up at the end of a long run. This is worse if the floor isn't level or the motors on one side are stronger. What do teams do with this error?

Any sample code would be appreciated.
  #2   Spotlight this post!  
Unread 12-30-2005, 09:43 AM
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #2586
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Holly, MI
Posts: 715
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan Send a message via Skype™ to JBotAlan
Re: Autonomous using encoders

I don't have much experience with encoders, but my guess is that you have a pair of encoders that doesn't match. I didn't think that encoders differ at all, so this comes as a surprise to me; however, 1140 (last year's Holly team) didn't even think about using encoders...made auton programming fun let me tell you...

JBotAlan

PS: Someone with knowledge of encoders please post here!
__________________
This post brought to you by Jacob Rau.
Junior Electrical Engineer/Computer Engineer at Michigan Technological University
Former Programming/Electrical mentor for FRC3418 (Robo Riot)
Former Programming mentor for FRC2586 (Copper Robotics)
Alumni programmer of FRC68 (Truck Town Thunder)
I can help with programming problems. Let me know if you need help. (I don't bite )
  #3   Spotlight this post!  
Unread 12-30-2005, 10:48 AM
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,352
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Autonomous using encoders

Quote:
Originally Posted by Eagle Master
The difference in encoder counts between both sides of the robot builds up at the end of a long run. This is worse if the floor isn't level or the motors on one side are stronger. What do teams do with this error?
I'm not quite sure which problem you're having. Is it:

A) Your robot is driving perfectly straight (or nearly so) but the encoders are giving you different counts at the end of your run, indicating that the encoders aren't counting accurately for some reason.

or

B) Your encoders are giving you different counts and your robot is veering off to one side (i.e. the encoder counts are right, and you just want to use the difference between them to be able to drive straight).
  #4   Spotlight this post!  
Unread 12-30-2005, 11:58 AM
Unsung FIRST Hero
Greg Needel Greg Needel is offline
Lets do this....
FRC #2848 (All-sparks)
Team Role: Engineer
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Dallas, TX
Posts: 2,887
Greg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond repute
Send a message via AIM to Greg Needel Send a message via Skype™ to Greg Needel
Re: Autonomous using encoders

Another common problem i have seen like this is wheel size.

If you are using pneumatic tires make sure the outside diameter of the tire is the same.

If you are using solid tires make sure the wear is the same.

When tires have difference sizes from side to side then the robot will travel a bit farther causing a turn regardless of the output speed from you reduction being the same and your encoders working fine.
__________________
Greg Needel│www.robogreg.com
Director of the Innovation Gym, Lyle School of Engineering, Southern Methodist University
  #5   Spotlight this post!  
Unread 12-30-2005, 12:16 PM
Mr.G Mr.G is offline
My brain hirts.
AKA: Kevin
FRC #0326 (Xtreme Eagles / Romulus High School / General Motors)
Team Role: Engineer
 
Join Date: Dec 2002
Rookie Year: 2001
Location: Romulus
Posts: 244
Mr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond reputeMr.G has a reputation beyond repute
Send a message via AIM to Mr.G
Re: Autonomous using encoders

Dave everything is working correctly as far as the encoders go. I am looking to find out how other teams keep the robot going straight over long distances. Like you mentioned, an active feedback of the difference between the counts of the 2 sides. Does anyone have a sample equation?

Greg we use solid aluminum wheels so they all have the same diameter, but that is a very good observation that other teams should note.

This will also help solve other problems we have had:
Examples:
1. We get everything working good in one robot and then we download it into another robot with the same drive train and it tracks different. I assume it is because there are different motors and differing amount of friction in the drivetrains on each side, but we should be able to use the encoders to compensate for that.
2. The robot frame take a hit and start binding on one side, we donít notice it, but from then on all the autonomous functions are off.
3. Or we burn up a motor or have one going bad and everything changes in autonomous.
4. The floor at one end of the area isnít as level as the other end and the robot tracks different yet again.

As you can see this gets to be very frustrating and time consuming.
  #6   Spotlight this post!  
Unread 12-30-2005, 12:55 PM
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,422
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Autonomous using encoders

the best algorithm is PID(search these forums). If you want something simpler then just P:

*Subtract the left side encoder count from the right side. I you get a negative value then you are
veering to the left. Positive means you are going to the right

*multiply this number by some constant.

*Add the result to the left wheel. subtract it from the right wheel. Make sure nothing overflows.

This is not the best algorithm but it helps. One year, we found that for whatever reason one side of our robot was slightly more powerful than the other. We simply multiplied the more powerful side by a constant and it almost completely eliminated the problem without any feedback at all.
__________________
1139 Alumni
  #7   Spotlight this post!  
Unread 12-30-2005, 03:58 PM
phrontist's Avatar
phrontist phrontist is offline
Proto-Engineer
AKA: Bjorn Westergard
FRC #1418 (Vae Victus)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Falls Church, VA
Posts: 828
phrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond repute
Send a message via AIM to phrontist
Re: Autonomous using encoders

Rickterson speaks the truth. What you need is a simple porportional algorithm, full PID is overkill for this.

Another, perhaps obvious, fix is to make sure your robot isn't peeling out. Don't floor it right off the bat in autonomus, but ramp up the values you send to the motors.
__________________

University of Kentucky - Radio Free Lexington

"I would rather have a really big success or a really spectacular crash and failure then live out the warm eventual death of mediocrity" - Dean Kamen
  #8   Spotlight this post!  
Unread 12-30-2005, 04:18 PM
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 9,957
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Autonomous using encoders

Let us not forget that depending on the encoder used, accuracy enters into the calculations. If your encoder is only able to resolve about 1" of travel by counting at the wheel, you can get really far off before the encoders will try to pull you straight again. Accuracy can be improved by encdoding a shaft further up the reduction chain. The errors are then divided by the reduction ratio (all other things being equal). You may find that there is a constant difference between sides and apply a constant correction to one side as a simple fix. Although the Chalupa does not exhibit differences between forward and reverse, production differences do effect it's loaded speed and no two transmissions are identical so differences in speed (side to side) are a fact of life.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
All is better now, NOS parts are working fine. Why does this year's game remind me of Violet in Willie Wonka? Hmmmm, I see blueberries!
  #9   Spotlight this post!  
Unread 01-16-2006, 11:36 PM
binary_sandman's Avatar
binary_sandman binary_sandman is offline
Registered User
AKA: andrew sweet
FRC #1388 (Eagle robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2003
Location: california
Posts: 12
binary_sandman is infamous around these parts
Re: Autonomous using encoders

we are also using encoders on our wheels and there is no way to stop this real-life application problem. but the ground is going to be level; the only problem is a motor going faster than another. which beforehand we will find our the difference if it is long term and put a speed filter on the other motor of the difference variable Usually divide by .2 ; if temporarily it is the chain's problem and will get fixed.
  #10   Spotlight this post!  
Unread 01-17-2006, 02:11 AM
Avarik Avarik is offline
Registered User
#0022
 
Join Date: Jan 2004
Location: Chatsworth, CA
Posts: 75
Avarik is an unknown quantity at this point
Re: Autonomous using encoders

There are a few ways to address this problem. The simplest is probably, as stated, to just find a constant which will get your fairly close to driving straight.

Another method would be to implement checks while trying to run straight. Maybe after every 100 encoder counts, you would, at that point, get your robot to adjust by sending a forward signal to one side, and a 127 to the other. One the counts were equal again, you could try going straight once more.

Another way is to adjust pwm values on the fly, implementing a straight drive. You could add and subtract to your pwm values depending on which side was going faster throughout your entire autonomous, which would make your robot travel much straighter. We implented this system with a gyro last year during human control, and it worked wonderfully.
  #11   Spotlight this post!  
Unread 01-17-2006, 02:27 AM
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: Autonomous using encoders

Quote:
Originally Posted by Avarik
Another method would be to implement checks while trying to run straight. Maybe after every 100 encoder counts, you would, at that point, get your robot to adjust by sending a forward signal to one side, and a 127 to the other. One the counts were equal again, you could try going straight once more.
Avarik,

Don't forget: just because the number of ticks on each wheel are equal doesn't mean that your path was straight. You need the ticks to alternate one wheel then the other for the straightest path. If you just correct every 100 pulses, then you drive sideways for 100 pulses, straighten the robot, then drive sideways for another 100 pulses.

In an extreme case, one wheel sticks and the other goes 100 pulses, so you turned, say 90 degrees. Then you correct and wait till the other sees 100 pulses. That straightens you back out but you have barely moved.

Cheers!
-Joe
  #12   Spotlight this post!  
Unread 01-17-2006, 02:34 AM
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: Autonomous using encoders

Quote:
Originally Posted by Eagle Master
Dave everything is working correctly as far as the encoders go. I am looking to find out how other teams keep the robot going straight over long distances. Like you mentioned, an active feedback of the difference between the counts of the 2 sides. Does anyone have a sample equation?
Kevin,
The way we approached this a few years back was to implement an observer on the optical encoders that tracked the current state of the robot (i.e. x/y position and orientation) We then used a PID control loop using our state as the feedback, not the raw encoder values. This allowed us to see that we drove away from the line we intended to follow and turn back toward it.

I can explain how the observer was modeled if that sounds like something you'd be interested in. The model is very simple and the implementation was straightforward.

Cheers!
-Joe
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Warning to Human Players During Autonomous The Lucas General Forum 21 04-07-2005 01:29 AM
Setting Autonomous Settings from OI Tom Saxton Programming 15 03-27-2005 10:45 AM
Despite what IFI says, you can configure autonomous from OI... TedP Programming 19 03-31-2004 09:09 AM
autonomous mode problem on field Chris_C Programming 17 03-26-2003 06:11 PM


All times are GMT -5. The time now is 07:14 AM.

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


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