Go to Post Sounds fun? Maybe only if you're a giant dork, but I'm a pretty giant dork, so... - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-05-2010, 15:32
masoug's Avatar
masoug masoug is offline
Food Consumer
FRC #0114
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Planet Earth
Posts: 78
masoug is an unknown quantity at this point
Question What is PID?

Hi,
I am REALLY confused, but what are PID loops? I am getting all sorts of weird answers. I am looking for a definitive answer...

THANKS!!!

-Masoug
__________________

JabbaScript
Reply With Quote
  #2   Spotlight this post!  
Unread 25-05-2010, 16:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
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: What is PID?

Quote:
Originally Posted by masoug View Post
Hi,
I am REALLY confused, but what are PID loops? I am getting all sorts of weird answers. I am looking for a definitive answer...

THANKS!!!

-Masoug
PID is an acronym for Proportional Integral Derivative. It is one very popular and effective way to do closed-loop control.

The easiest kind of PID loop to understand is the "P-only" loop - that is, it contains only Proportional control (no Integral or Derivative).

It is fairly easy to explain and understand intuitively. Let's say you have a wheel with an encoder on it which senses the wheel's speed. Let's say you want to be able to make the wheel turn at a desired speed by sending the necessary command to the drive motor.

To create a "P" loop to do this in software, you take the desired wheel speed (called the "set speed") and you subtract the actual wheel speed as measured by the sensor (sometimes called the "process variable"). This creates a "speed error". When the speed error is positive, it means that the wheel is turning slower than what you want. When the speed error is negative, it means the wheel is turning faster than what you want.

Take the speed error and multiply it by a gain, Kp. Kp is a constant in your software which you will "tune" (by experimenting) to get the right value. This product (Kp*error) becomes your command to the motor.

OK, start asking questions!


~
Reply With Quote
  #3   Spotlight this post!  
Unread 25-05-2010, 17:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
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: What is PID?

Oh, I forgot to mention:

The "loop" part refers to the fact that PID is a form of closed-loop control... there is a feedback loop. You are "looping" the output from the "plant" (explained in a moment) back into the controller (PID).

The "plant" is the device your PID is controlling, in the example I gave it is the drivetrain (motor+gearbox+wheel etc). The "output" of the plant is the wheel speed. The wheel speed signal is "looped back" to the PID.

Questions? Fire away...
Reply With Quote
  #4   Spotlight this post!  
Unread 25-05-2010, 16:34
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,112
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 PID?

(First, ignore the word "loop". It can mean two completely different things depending on context, neither of which is important to the basic concept of PID control.)

PID stands for the three words Proportional, Integral, and Derivative. Those are fancy ways of saying that the output depends on the input right now, on the accumulated input over time, and on how quickly the input is changing. It's a way to control something in order to cause a measured value to match a desired value. Changing the relative strength of the three parameters is called "tuning" the system, with the goal of reaching the target quickly with minimal overshoot and oscillation.

Most PID control algorithms start by computing an error value, which is just the difference between the target and the measured values.

With that simple description, you should be able to look at any number of detailed references and understand them better.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-05-2010, 17:09
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: What is PID?

Every year when we teach PID to our students, I use the following definitions of the terms and examples. I think they're very straight forward to grasp and gives you an understanding before diving into math.

The P term makes your speed proportional to how far you are away from your target. The farther you are away, the faster you will go. Think of this as running as fast as possible and stopping on a dime. You will run as fast as you can while you're far away, but as you get close, you start slowing down.

The I term makes you go faster the longer you've been away from your target. It is dependent on time. Think of this as trying to run at a constant speed with a parachute on your back. You'll start out running at the constant speed you are supposed to be at, but at some point the parachute makes it so that constant speed doesn't get you to your end point. So what do you do? You run faster since you've haven't been making progress.

The D term counteracts fast change. Picture a conveyor belt that's supposed to be running at a constant speed. If a heavy box is dropped onto the belt, it is going to slow down quickly. The desired action here is to apply a speed increase to counteract the slowdown. Alternatively, if you're walking at a constant speed and I shove you in the back, you will speed up because of the push, but you will slow your steps down until you're back at a constant rate.

Hope that helps.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-05-2010, 20:37
Unsung FIRST Hero
Karthik Karthik is offline
VEX Robotics GDC Chairman
no team
Team Role: Mentor
 
Join Date: Apr 2002
Rookie Year: 1998
Location: Toronto, Ontario, Canada
Posts: 2,343
Karthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond repute
Re: What is PID?

Here's a tutorial that 1114 programmer, Mike DiRamio, did on PID a couple of years ago.

Part 1
Part 2

The accompanying code and powerpoints are available on our website, which is currently down. I'll update this post with the links to those once the site is back up.
__________________
:: Karthik Kanagasabapathy ::
"Enthusiasm is one of the most powerful engines of success. When you do a thing, do it with all your might. Put your whole soul into it. Stamp it with your own personality. Be active, be energetic, be enthusiastic and faithful and you will accomplish your object. Nothing great was ever achieved without enthusiasm" -- R.W. Emerson
My TEDx Talk - The Subtle Secrets of Success
Full disclosure: I work for IFI and VEX Robotics, and am the Chairman of the VEX Robotics and VEX IQ Game Design Committees
.
Reply With Quote
  #7   Spotlight this post!  
Unread 26-06-2010, 21:13
Unsung FIRST Hero
Karthik Karthik is offline
VEX Robotics GDC Chairman
no team
Team Role: Mentor
 
Join Date: Apr 2002
Rookie Year: 1998
Location: Toronto, Ontario, Canada
Posts: 2,343
Karthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond reputeKarthik has a reputation beyond repute
Re: What is PID?

Quote:
Originally Posted by Karthik View Post
Here's a tutorial that 1114 programmer, Mike DiRamio, did on PID a couple of years ago.

Part 1
Part 2

The accompanying code and powerpoints are available on our website, which is currently down. I'll update this post with the links to those once the site is back up.
As promised, now that the website is back up:

The PID specific powerpoint can be found on this page: http://www.simbotics.org/workshops

The PID code described in the video can be found on this page: http://www.simbotics.org/controls
__________________
:: Karthik Kanagasabapathy ::
"Enthusiasm is one of the most powerful engines of success. When you do a thing, do it with all your might. Put your whole soul into it. Stamp it with your own personality. Be active, be energetic, be enthusiastic and faithful and you will accomplish your object. Nothing great was ever achieved without enthusiasm" -- R.W. Emerson
My TEDx Talk - The Subtle Secrets of Success
Full disclosure: I work for IFI and VEX Robotics, and am the Chairman of the VEX Robotics and VEX IQ Game Design Committees
.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-07-2010, 00:50
masoug's Avatar
masoug masoug is offline
Food Consumer
FRC #0114
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Planet Earth
Posts: 78
masoug is an unknown quantity at this point
Re: What is PID?

Thanks a lot Karthik!

-Masoug
__________________

JabbaScript
Reply With Quote
Reply


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
PID: P+D or P-D billbo911 Programming 1 27-01-2008 23:52
PID Troubleshooting Disar Programming 4 13-09-2006 15:27
PID shadowops06 Programming 5 16-06-2006 22:48
What constants are u using for high velocity PID Salik Syed Programming 3 18-02-2006 23:22
PID Control Chris Bright Programming 9 26-03-2005 19:44


All times are GMT -5. The time now is 13:51.

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