Go to Post Use sensors to collect data about the surrounding environment, then discard it and drive into walls. - Jared Russell [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #25   Spotlight this post!  
Unread 02-01-2013, 14:56
Sparks333's Avatar
Sparks333 Sparks333 is offline
Robotics Engineer
AKA: Dane B.
FRC #1425 (Wilsonville Robotics)
Team Role: Alumni
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Wilsonville, Oregon
Posts: 184
Sparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of lightSparks333 is a glorious beacon of light
Send a message via AIM to Sparks333
Re: PID: what is it exactly?

Little bit of repeat here, but controls engineer, so I have to chime in.

PID is a form of control system that assumes that what you're controlling is pretty simple (your plant is somewhere around second-order). It's particularly useful if the thing doing the controlling (motor) has a power output that is fairly close to or significantly greater than the load (robot, arm, etc), and if the system being controlled will not move on its own without a control input (a marginally stable system - for example, a motor holding an arm out at an angle is an unstable system. If the motor's power is cut, the arm falls down. A robot drive train is a marginally stable system - if power is cut, it drifts to a halt, but not anywhere predictable. A stable system, in case anyone cares, is one that has a tendency to return to a neutral point - like the velocity of a spinning wheel). Since PID controllers are based solely on the error between where you want to be and where you are, they don't do well with scenarios where the system has to fight a continuous force (like gravity) - what ends up happening is it reaches equilibrium with the P term while undershooting, then the I term slowly ramps up power until it's where you want it to be, then you reach your goal and the P term goes zero or negative and the system falls back into undershoot - repeat as necessary. You can insert what's called a 'feed forward' term into the controller that attempts to combat the force (at its simplest it's just adding a constant that would prevent the motor from moving - in the arm example above it would most likely be the sine of the angle the arm is making with the gravity norm multiplied by the arm's mass and lever arm moment) but the assumption is that your plant model is very simple.

One of the nice things about PID is that it is a very well-understood control system - unlike most other control systems, you don't have to have a comprehensive model of the system you're controlling, and there is tons of literature on how to tune them. They're also pretty easy to implement, and since the derivative term on a position control loop is velocity, the measurement is free with encoders (and believe me, deriving in a control loop is painful - derivative terms tend to spike pretty hard when they're being calculated). The bad things about them is they can be tricky to tune, finicky when the system changes (for example - pick up a ball in your grabber? There goes your precision tuning) and prone to integrator windup (when your integral term grows to the point where it takes over the control loop - put in integrator term limits, you'll thank me later).

On the topic of bang-bang controllers - they're useful for scenarios where the system is stable on its own, and when the power you've got for control pales in comparison to the load being controlled. Think thermostat - you can turn that on full for a good half-hour, and the temperature won't rise quickly. Then, when the controller (thermostat) kicks off, the system (temperature) slowly tries to get back to its stable position, thereby engaging the controller once again. This won't work with a marginally stable system, where the temperature would stabilize somewhere outside the limits of the bang-bang controller, or (heaven help you) an unstable system.

The best thing you can do for your control system is try to figure out how the system is going to behave - if you can express that mathematically, then you can do amazing things with control. This unfortunately takes a bit of math - differential equations, to be exact - but if you are comfortable with referring to acceleration as the second derivative of position, and know how to take a Laplace transform, you can come up with plant equations that will lead you right to how your control system should look. Or, just stick a PID, PI, PD, or bang-bang on there and fiddle with coefficients until it works right.

Sparks
__________________
ICs do weird things when voltage is run out of spec.

I love to take things apart. The fact that they work better when I put them back together it just a bonus.

http://www.ravenblack.net/random/surreal.html
 


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 16:27.

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