Go to Post FIRST is a life lesson on steroids. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 25 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 24-04-2013, 21:50
Tanaythan's Avatar
Tanaythan Tanaythan is offline
Programmer
AKA: Tanay Nathan
FRC #3256 (Warriorborgs)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: San Jose
Posts: 27
Tanaythan is an unknown quantity at this point
Re: PID

PID (stands for proportional, integral, and derivative) is a control loop where the feedback is used as an adjustment for the next iteration. It takes in a setpoint that the loop will try to adjust for and the sensors that you stated will give you back a current value. You can subtract your current from your setpoint to get your error.

The way that most people understand PID is thinking about it as a function graph where the x-axis is the number of iterations and the y-axis is your error (setpoint - current). Now this function (let's call it f(x)) is your basic function for your error versus iterations that is constantly growing as your PID loop continues. Your proportional value will be a constant (kP) multiplied by f(b) where b is equal to your last iteration. The integral (if you have not taken calculus) is the area underneath the curve of the function, which can be simply done by adding all the error terms. Then, you can multiply your constant (kI) by the sum of your error to find your integral constant. The derivative term is the slope of the function and is given by your point slope formula: (f(b) - f(a)) / (b - a). The derivative value is given by multiplying this slope and the constant (kD). You add all of these together to get a PID value to send to your motor.

Now, the proportional value is pretty self-explanatory. It decreases as the error becomes smaller or as you approach your setpoint. Thus, it gives a huge boost at the beginning and reduces its effectiveness as the error decreases. A P-only loop will result in oscillation. The integral term provides an extra boost that will get the PID loop to the setpoint required. Since it is the sum of the errors, it can "predict" where the power level will go next and try to compensate. The derivative portion speeds up (or slows down if your constant is negative) the loop because it multiplies a constant by your slope and adds it to the system.
__________________
Tanay Nathan
Programmer
Team #3256 Warriorborgs
Reply With Quote
 


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 10:00.

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