Go to Post By being on your team, you are just that - on a team of people. Every person represents a team... You do, too. - Amanda Morrison [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 19-12-2010, 22:10
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Holonomic + gyro/PID

I've been doing some research on holonomic drivetrains, and understand the physics behind it. I'm assuming that, of course, error will begin to mount up, which requires some additional programming to overcome.

I've heard people say they use a gyro and a PID loop, but I'm confused as to how the gyro is implemented. And, even if the gyro is used to control the angle, how can you control the velocity? Doesn't the gyro itself rack up some error over time?

I'd appreciate any advice and any good links. Thanks!
  #2   Spotlight this post!  
Unread 19-12-2010, 22:41
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Holonomic + gyro/PID

Usually, when a gyro is implemented, it is used for "field-centric" control. The robot is moved relative to the field, whatever direction it might be facing. This is usually implemented by converting the X/Y inputs from the joystick into a polar coordinate (magnitude and direction), and then add the gyro heading to that direction, then convert the polar coordinate into four motor outputs for either the omni wheels or mecanum wheels.

By itself, an omnidirectional drive has no control loop (or controls the speed of its wheels using P/PID and encoders), but there isn't much error to build up in the drive alone.

Possible sources of gyro error:
IF you boot up while moving, then the gyro accumulator will set the centerpoint to whatever it was when you booted up, and then when you stop moving it will think you are continuously spinning. I do not know if it is possible to set the centerpoint manually.
IF you somehow manage to max out the gyro's output (since it has a 5v or 0v limit), you will loose all of the data above that point. Which means you will be off.
The gyro does have a little bit of running error, which might or might not be negligible during a 2.5 minute match. I have only ever used it during auto, and the error in 15 seconds is negligible.

If you would like to experiment with new drivetrains (especially field-centric driving), I highly suggest that you prototype during the off-season.


Any more questions? feel free to ask.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #3   Spotlight this post!  
Unread 19-12-2010, 22:43
Jeremy Germita's Avatar
Jeremy Germita Jeremy Germita is offline
Co-Advisor/Lead Engineering Mentor
AKA: wood is good. plastic is fantastic.
FRC #5012 (Gryffingear) / (Antelope Valley FIRST Teams)
Team Role: Coach
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Lancaster, CA
Posts: 285
Jeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond reputeJeremy Germita has a reputation beyond repute
Re: Holonomic + gyro/PID

The gyro is used in allowing the robot to be controlled reletive to the driver(driver-centric) as opposed to the traditional robot-centric mode.

For example, if you push forward on the stick, the robot will move away from you, pulling it back will bring it closer to you.

A PID loop can be used to control this angle more precisely.

Gyros DO drift over time. This is measured by Degrees/minute. Check your model's datasheet for the exact rate.

I recommend you have your program "Zero" out the gyro reading at the beginning of autonomous and teleop(given that the angle should the same at the end of auton). In Arizona last year, our robot was left on during an especially long reset period and our autonomous program behaved strangely, almost incurring a penalty.

Perhaps you could use a complementary filter with an accelerometer and gyro. This will make your angle heading more accurate. Google is your friend.

A PID loop is can also be used to control the velocities of each wheel. You must use an encoder on each wheel.
__________________
Drive Coach Team 5012 Gryffingear / Antelope Valley FIRST teams / EWCP - (2013 - Current)
Student / Driver / Programmer / CAD - FRC Team 399: Eagle Robotics / FTC Team 72: GarageBots - (2009 - 2013)
Los Angeles Region FTC FTA/CSA/Head Ref
[FF] FIRST Pick
2014 FTC Los Angeles Regional Compass Award Winner.

2017 - San Diego Regional / Sacramento Regional / Las Vegas Regional
2016 - Los Angeles Regional Creativity + Winners (1197, 987, 5012) / Las Vegas Regional Team Spirit + SF (5012, 5851, 5049) / Galileo Subdivision
2015 - Inland Empire QF (597, 5012, 4413) / Las Vegas Imagery + Winners (148, 987, 5012) / Newton Subdivision and World Champions (118, 1678, 1671, 5012)
2014 - Inland Empire Rookie All Star + Highest Rookie Seed + SF (2339, 1967, 5012) / Las Vegas Rookie All Star / Galileo Division Imagery
  #4   Spotlight this post!  
Unread 19-12-2010, 22:52
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Holonomic + gyro/PID

I would use a gyro to make sure that when you want your robot to go straight, that it goes straight and does not turn. Encoders will help you keep your wheels spinning at the same speed which should keep you going straight but if your wheels have different amounts of traction then the gyro can be used to keep the robot going straight. For velocity you can try an accelerometer or just use the encoders, even though it'd be hard to get a good measurement, again because of traction.
  #5   Spotlight this post!  
Unread 19-12-2010, 23:19
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Holonomic + gyro/PID

I disagree. There is generally not enough slip to make a difference. I would argue that an accelerometer is an almost useless sensor for FRC robots, since we have access to encoders, which measure much more precisely than accelerometers.

I would actually argue that it is easier for a driver to drive the robot directly (robot-centric) than field-centricly, since 1. it is easier to drive, and 2. once you get used to driving, it is very nice to have direct control of where you want your robot go go.

Just because you have a holonomic drive, that does not mean it must use a gyro and be field-centric.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #6   Spotlight this post!  
Unread 19-12-2010, 23:20
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Holonomic + gyro/PID

Quote:
Originally Posted by Jogo View Post
I've been doing some research on holonomic drivetrains, and understand the physics behind it. I'm assuming that, of course, error will begin to mount up, which requires some additional programming to overcome.
Could you please explain what error you are referring to, which will begin to mount up ?



  #7   Spotlight this post!  
Unread 19-12-2010, 23:24
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Holonomic + gyro/PID

I believe he may be referring to the error in all sensors which may deviate from the actual, true reality, like a gyro reading +/- .01 degrees per second turn when it's in fact stopped. It's the nearly unavoidable stuff in cheap electronic parts.
__________________
Attending: MN Duluth Regional
  #8   Spotlight this post!  
Unread 19-12-2010, 23:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Holonomic + gyro/PID

Quote:
Originally Posted by theprgramerdude View Post
I believe he may be referring to the error in all sensors which may deviate from the actual, true reality, like a gyro reading +/- .01 degrees per second turn when it's in fact stopped. It's the nearly unavoidable stuff in cheap electronic parts.
Thank you, that's one possible interpretation... but I'd like to hear from the OP if that's what he meant... or if he had something else in mind.

He doesn't mention gyro in the first paragraph where he says he understands the physics but is concerned that "error will begin to mount up".

He mentions gyro in the second paragraph, but says he doesn't know how it is implemented. So I inferred that he wasn't referring to gyro error in the first paragraph.



Last edited by Ether : 19-12-2010 at 23:35.
  #9   Spotlight this post!  
Unread 20-12-2010, 00:02
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Holonomic + gyro/PID

Quote:
Originally Posted by apalrd View Post
I would argue that an accelerometer is an almost useless sensor for FRC robots, since we have access to encoders, which measure much more precisely than accelerometers.
We've seen wheelspin when accelerating quickly, and the wheels will slip when the robot gets hit hard. Both of those are relatively common in a match, so the encoders will no longer be at the correct position. This doesn't mean that encoders are useless sensors, but that they aren't a magic bullet. A clever algorithm would decide which one is more likely to be right, and use it to correct the other one based on the measured conditions.
  #10   Spotlight this post!  
Unread 20-12-2010, 01:37
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Holonomic + gyro/PID

Quote:
Originally Posted by AustinSchuh View Post
We've seen wheelspin when accelerating quickly, and the wheels will slip when the robot gets hit hard. Both of those are relatively common in a match, so the encoders will no longer be at the correct position. This doesn't mean that encoders are useless sensors, but that they aren't a magic bullet. A clever algorithm would decide which one is more likely to be right, and use it to correct the other one based on the measured conditions.
Or, you could use follower wheels with encoders on them.
http://www.chiefdelphi.com/media/photos/32440
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #11   Spotlight this post!  
Unread 20-12-2010, 01:43
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Holonomic + gyro/PID

Which work best on flat ground. Not a problem in 2009 when the ground was flat, but I wouldn't have been willing to put them on our robot this year.
  #12   Spotlight this post!  
Unread 20-12-2010, 09:02
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Holonomic + gyro/PID

Kris noted the simplest use of a yaw rate sensor and it's easiest implementation: driving straight. We have used this technique on most of our 'bots, holonomic, treaded & wheeled, since 2004. The algorithm is a simple multiplier on the yaw rate detected. We usually determine it empirically, This is added to the motor outputs to create an automatic, opposite spin to the measured yaw rate. When driving straight, the yaw rate is close to zero, so the effect is nil...easy and powerful. Add in a small deadband around zero yaw rate, if it wants to twitch when still. This also helps, if someone is trying push on a corner of your 'bot. Typically we give the driver a button or switch, to turn the effect on and off. We always want the driver to have the final decision on handling.

We've used the gyro for field-centric control, as well. Our results are mixed - a great implementation with our 2004 holonomic 'bot, and a rather disastrous implementation with our swerve drive, last year. Give yourself a lot of time for driver training and robot testing.

Eric
__________________

Don't PANIC!
S. P. A. M.
  #13   Spotlight this post!  
Unread 20-12-2010, 09:22
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Holonomic + gyro/PID

Quote:
Originally Posted by EricS-Team180 View Post
and a rather disastrous implementation with our swerve drive, last year.
What was disastrous about it?


  #14   Spotlight this post!  
Unread 20-12-2010, 12:34
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
Re: Holonomic + gyro/PID

Wow you guys are all really helpful! I think two separate issues are coming up here, mostly due to my ignorance.


1) Driver-centric vs. Robot-centric: It seems that this issue is not related to the type of drive train. For example, by turning the joystick into a polar coordinate, if I push the joystick to (0.5,pi/4), then I could see using a gyro to constantly PID to the angle even without holonomic wheels. Error in this case could be caused by the gyro, which if it mounts up might require the driver to zero the gyro midway through the match.

2) Holonomic vs….well, non-holonomic: Having never tried a holonomic drivetrain, I was wondering if error could mount up naturally. For example, pushing the joystick to (0.5, pi/4) might for some reason not move the robot at precisely this amount due to environmental factors. I was wondering if teams use a gyro or other sensors to deal with this, but maybe this isn’t a significant problem.

I'd appreciate any attempts to help clarify this stuff for me. Thanks
  #15   Spotlight this post!  
Unread 20-12-2010, 12:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Holonomic + gyro/PID

Quote:
Originally Posted by Jogo View Post
2) Holonomic vs….well, non-holonomic: Having never tried a holonomic drivetrain, I was wondering if error could mount up naturally. For example, pushing the joystick to (0.5, pi/4) might for some reason not move the robot at precisely this amount due to environmental factors. I was wondering if teams use a gyro or other sensors to deal with this, but maybe this isn’t a significant problem.
This isn't a holonomic vs non-holonomic question. You could ask the same question (or a similar question) about a simple tank drive: "If I push both joysticks forward by the same amount, will the robot go precisely straight ahead?". The answer is no, and it doesn't matter because the driver adjusts (within reason) the joystick position(s) to get the response he seeks.

The only reason holonomic is different is because it has three degrees of freedom, and it's annoying for the driver if, for example, he's got a Halo-style interface and he has to continuously hold a rotation command in order to keep the robot from rotating while he's busy working the fwd/rev and strafe joystick. That's when gyro feedback or a "calibrate" button on the joystick is nice to have.




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
Holonomic issues dwodrich NI LabVIEW 11 02-02-2010 21:19
Holonomic Programming??? sknkmeistermatt Programming 2 12-02-2008 15:47
Gyro PID User drive - How we did it adamdb Programming 17 26-02-2007 20:16
Holonomic... Greg Perkins Technical Discussion 2 02-02-2005 11:59
holonomic drives Max Lobovsky Technical Discussion 5 10-03-2004 21:31


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

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