Go to Post Let's Get Ready to (Graciously) Rumble! - Mr MOE [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 Rating: Thread Rating: 51 votes, 4.94 average. Display Modes
  #1   Spotlight this post!  
Unread 13-02-2015, 22:30
Pramizle Pramizle is offline
Registered User
FRC #3145
 
Join Date: Jan 2015
Location: United States
Posts: 5
Pramizle is an unknown quantity at this point
What is P.I.D.?

We are trying to set a Jaguar to position mode using an encoder and are confused as to the parameters. We know that we have to set the desired number of counts per revolution but we are confused as to what the P, I, and D for the parameters are. Please help us.

We know that they stand for Proportional, Integral, and Derivative, but we don't know where these come from.
  #2   Spotlight this post!  
Unread 13-02-2015, 22:51
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is online now
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: What is P.I.D.?

http://en.m.wikipedia.org/wiki/PID_controller

The Wikipedia page is very good.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
  #3   Spotlight this post!  
Unread 13-02-2015, 23:03
Bluman56's Avatar
Bluman56 Bluman56 is offline
Mentor Without Borders
AKA: Nikita
FRC #2579
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Brooklyn
Posts: 151
Bluman56 is a jewel in the roughBluman56 is a jewel in the roughBluman56 is a jewel in the roughBluman56 is a jewel in the rough
Re: What is P.I.D.?

If you're like me and appreciate a visual aid in understanding these kinds of concepts, I would highly recommend watching a few youtube videos to understand the theory of it before trying to apply it. Conceptually, I've found this video (and the whole series) to be really beneficial when introducing new programmers to PID Theory.

Of course it might not technically answer your question in regards to application with a Jaguar, but the concept is really the most important part to grasp.

In addition, search through previous CD posts I'm sure you'll find a more technical answer. Good Luck!
  #4   Spotlight this post!  
Unread 13-02-2015, 23:55
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,679
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: What is P.I.D.?

An encoder is not really the best solution if you're trying to attain a specific, precise, position. Encoders tell you how fast you're moving, and if they're quadrature or gray code, in which direction. However, they don't provide any useful feedback as you approach speed zero, which is where you need them to work if you're shooting for a position. A potentiometer is probably a better solution for this.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
  #5   Spotlight this post!  
Unread 14-02-2015, 00:18
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,511
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: What is P.I.D.?

Quote:
Originally Posted by GeeTwo View Post
An encoder is not really the best solution if you're trying to attain a specific, precise, position. Encoders tell you how fast you're moving, and if they're quadrature or gray code, in which direction. However, they don't provide any useful feedback as you approach speed zero, which is where you need them to work if you're shooting for a position. A potentiometer is probably a better solution for this.
We use encoders on all our arms and elevators due to the huge increase in resolution they allow. You don't lose position at zero or low velocity at all. Unsure where you heard that.
  #6   Spotlight this post!  
Unread 14-02-2015, 01:23
SousVide SousVide is offline
Registered User
no team
 
Join Date: Jan 2011
Location: CA
Posts: 91
SousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to behold
Re: What is P.I.D.?

If you are trying to infer linear position by the number of rotations (really number of the encoder ticks, so full or partial rotations) of the encoder - you'd need to have a way to provide a zero position first - pretty much each time you start the robot program. You might use a bump switch or some other type of fixed position sensor for this. Depending if you are using a set of chains, belts, or winch wire, you might have to also worry about some type of measurement hysteresis...

You might also try a linear magnetic encoder too, you'd get direct linear measurements instead of having to transform the rotational ticks into linear position.
  #7   Spotlight this post!  
Unread 14-02-2015, 01:33
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,112
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: What is P.I.D.?

Previous posts have already linked to in-depth explanations, so instead I'll just give a crude summary.

At any given moment, the "error" of your system is the difference between your set point and your current location.

The 'P' term contributes to output in a manner proportional to the current error. That is, if you are below the set point, the 'P' term will be positive.

The 'I' term contributes to output in a manner proportional to the sum of all past error. That is, if the sum of the error values at every previous iteration of your control loop is negative, then the 'I' term will be positive.

the 'D' term contributes to output in a manner inversely proportional to the rate of change of the mechanism's position. That is, if the mechanism is moving in the negative direction, then the 'D' term will be positive.

An easy way to think of this is that the 'P' term responds to where you are, the 'I' term responds to where you have been, and the 'D' term responds to where you're going.
__________________
"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 : 14-02-2015 at 01:40.
  #8   Spotlight this post!  
Unread 14-02-2015, 02:47
SousVide SousVide is offline
Registered User
no team
 
Join Date: Jan 2011
Location: CA
Posts: 91
SousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to beholdSousVide is a splendid one to behold
Re: What is P.I.D.?

A layman's explanation of the 3 tuning parameters: P, I, D.

CP = current position of your mechanism
TP = target position of where you want the mechanism

P term is a how far your CP is away from the TP, the farther it is (the longer that distance), the faster this will drive your mechanism to move towards TP.

I term is the length of time, how long your mechanism has been taking to get from the "beginning of time" (when you turned on the PID algorithm and gave it the TP) to now... the longer that time is, the faster this will drive your mechanism to move toward TP.

D term is how quickly the mechanism has been closing the distance between CP and TP. The faster the distance is being closed, D will try to slow down this rate.

There's a general problem in any mechanical and sensor system in that there are always a delays in the system - delays in issuing the motor output signal to the motors actually responding and changing speed; delays in the sensors measuring distance/turns and feeding it back to the computer... By the time you've made the measurement and gotten it into the computer and your program, the mechanism has already moved on to some place else...

In this end, some system lead to overshoot and oscillation... Depending on what you need, whether your mechanism can accept overshoot and oscillations, that is the goal of a properly tuned PID system, to get your mechanism from CP to TP at the speed that you desired (or the amount of time desired) without much (or any) overshoot or oscillations...

It gets harder if you allow the TP to change mid-travel. It also gets harder if there is a lot of noise in the sensor system.
  #9   Spotlight this post!  
Unread 14-02-2015, 09:25
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,679
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: What is P.I.D.?

Quote:
Originally Posted by AdamHeard View Post
We use encoders on all our arms and elevators due to the huge increase in resolution they allow. You don't lose position at zero or low velocity at all. Unsure where you heard that.
If your desired target has a tolerance that is wider than a couple of clicks of the encoder, and your system has enough drag (or a brake) to hold position with no actuator input, it can work. When either of these assumptions is not met, an encoder system will be jittery at best.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
  #10   Spotlight this post!  
Unread 14-02-2015, 10:26
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
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: What is P.I.D.?

Quote:
Originally Posted by GeeTwo View Post
If your desired target has a tolerance that is wider than a couple of clicks of the encoder, and your system has enough drag (or a brake) to hold position with no actuator input, it can work. When either of these assumptions is not met, an encoder system will be jittery at best.
I don't agree with your general point. An encoder will give you a change from one count to another at a specific, precise position. If that's where your target is, that's where your position will be driven to. It's going to have exactly the same effect as any quantized position or velocity feedback measurement, encoder or otherwise. It seems to me that your objection is based on assuming coarse measurement resolution. That's an issue whether you're using encoders or potentiomenters or Hall effect magnetic sensors.
  #11   Spotlight this post!  
Unread 16-02-2015, 19:03
Pramizle Pramizle is offline
Registered User
FRC #3145
 
Join Date: Jan 2015
Location: United States
Posts: 5
Pramizle is an unknown quantity at this point
Re: What is P.I.D.?

Thank you so much for all of the help. We understand what PID is now and are just working on fine tuning it
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:09.

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