Go to Post Are we really at the point where the only useful thing we can discuss is Dean's choice in timekeeping apparel? The man has a watch. He uses it to tell time. Do we really care how much it is worth, or who made it? I would be much more interested in what he does, not what he wears. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 17-03-2016, 00:12
Oblarg Oblarg is offline
Registered User
AKA: Eli Barnett
FRC #0449 (The Blair Robot Project)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Philadelphia, PA
Posts: 1,111
Oblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond repute
Turn-to-angle PID tuning

So, we're currently using a cascading PID control to implement a turn-to-angle function. That is, we're running a position PID using the output of our gyro, whose outputs feed to our wheel velocity PID.

On the whole, it's working fine, but there are some fine-tuning issues we'd like to address.

Currently, we are only using P.

Namely, if we make P high enough to get within 1-2 degrees of the setpoint in a reasonable amount of time, the robot builds up enough inertia while turning to overshoot the setpoint. Setting P just high enough to not overshoot the setpoint, we can get to ~5 degree accuracy reasonably quickly, but it takes quite a few seconds more to zero in.

There are two solutions I can think of for this - introducing a bit of I to provide some extra "push," or setting a "minimum output" around 0 that small output values get raised to.

I've done the latter to overcome friction in an elevator control loop before, and it worked wonderfully. But my intuition is that it should not be needed for a cascading loop where the task of overcoming friction at small values *should* be handled by the inner velocity loop.

Any suggestions?

Addendum: We're also using a similar P loop to keep the robot driving straight while a button is held, by adding the output as a difference term to our linear velocity. The output is scaled between -1 and 1, where 1 represents max robot speed. We were struggling to find a value of P that worked optimally - if anyone who has done similar things could share what values they have used in the past (with offset being measured in degrees), it'd be appreciated.

We would do further testing to answer these questions ourselves, but we have exhausted our 6 hour window to toy with the robot.

Thanks!
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"

Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016

Last edited by Oblarg : 17-03-2016 at 00:14.
  #2   Spotlight this post!  
Unread 17-03-2016, 01:11
lethc's Avatar
lethc lethc is offline
#gkccurse
AKA: Becker Lethcoe
FRC #1806 (S.W.A.T.)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2013
Location: Smithville, MO
Posts: 119
lethc will become famous soon enough
Re: Turn-to-angle PID tuning

From my experience adding a 'minimum' output to your PID loop is by far the quickest, most painless solution. Our drivetrain has a large amount of friction and adding the minimum made it much more responsive and quicker to tune. It exponentially shortened PID tuning times for my team.
__________________
2016: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Semifinalists, IRI Quarterfinalists
2015: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Quarterfinalists, IRI Winners
2014: Central Illinois Regional Quarterfinalists, Greater Kansas City Regional Finalists, Newton Semifinalists
2013: Greater Kansas City Regional Winners, Oklahoma Regional Winners, Galileo Quarterfinalists
  #3   Spotlight this post!  
Unread 17-03-2016, 01:28
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Turn-to-angle PID tuning

See this thread http://www.chiefdelphi.com/forums/sh...d.php?t=145404
  #4   Spotlight this post!  
Unread 17-03-2016, 01:31
Oblarg Oblarg is offline
Registered User
AKA: Eli Barnett
FRC #0449 (The Blair Robot Project)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Philadelphia, PA
Posts: 1,111
Oblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond repute
Re: Turn-to-angle PID tuning

Quote:
Originally Posted by Tom Bottiglieri View Post
Quote:
Originally Posted by Jared Russel
This is a constant source of annoyance for doing precise turning with high-friction wheels. Some solutions that have worked for us in the past:

1) Figure out what the minimum required output is to get the robot to turn at all. If the PID output is less than this magnitude, output this magnitude (with the same sign as the PID output).

2) Instead of using your heading PID loop to generate PWM commands directly, use it to generate velocity commands that a second PID loop on each side of the drive will attempt to follow. Note that good velocity control at low speeds requires a really fast control loop and accurate velocity measurement. The CAN Talon SRX and CTRE Mag Encoder have impressed us in this regard.

3) Motion profiling can help (a bit) to ensure that the robot smoothly glides to its final heading, but this method works best in conjunction with 1 and/or 2.
Well, this is quite nicely consistent with our observations. We're already implementing suggestion 2) but we're handling PID in the 50hz main loop which is probably unable to handle the low speeds adequately. Minimum output it is!

Thanks for the help, both (or all three?) of you.

If anyone has input for a good P value for the "drive straight" loop, though, it'd still be greatly appreciated.
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"

Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016
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 04:14.

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