Go to Post Ask the right questions and you can get the right answers. - Chief Hedgehog [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 05-07-2005, 08:13 PM
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Concept of PID explained

I have seen tons of references to it, some more advanced theory, which just confused me a bit more. Leaving me still confused as to how exactly PID works, and how it is implemented. I know what it does.

From researching around online, I have found some still advanced stuff, but nothing to really explain it that well and I want to make sure that I have the elements right before I learn it the wrong way and have to learn again later.

Ok on our imaginary robot, we will call each of the loops when the PID loop is called 1 "tick" when the motors go full speed forward (254) for 1 tick, we get 127 up counts, and full reverse(0), we get 127 down counts.

Now for the PID stuff.

The P, sees that if the desired speed is 200, which means there should have been 73 ticks (200-127) however there was only 47 ticks, so the motor's power would be changed to 200 + (73-47)*kP. Is this right?

I've had calculus so I understand the concept of integration, but for the I of the PID loop it would be something like this:
(S) would be the current desired speed, -127 so that zero is neutral
(S-x) would be the desired speed, x loops ago
(A) would be the current actual speed
(A-x) would be the actual speed x loops ago

How the I would be implemented would be:

Motor value from P + (( (S)+(S-1)+(S-2)...+(S-x) )-( (A)+(A-1)+(A-2)...+(A-x) )) * kI

It would be keeping track of the difference in motor speed versus desired speed for the past x loops, and use that to affect the motor output also. Is this how the I part works?

As for the D component, I am still a little more confused than the others.
From what I understand, you take the difference from the previous loop, subtract the difference in this loop, to see if the error is decreasing or increasing. Multiply this by kD and subtract it from the motor value from the I section.

Is that how PID works for drive motors? I know that it is different for things that have position controlled rather than velocity.

When I read the usual posts about it it seems rather hard to understand, but that doesn't seem so hard looking back over what I have up there.
__________________
2005 Philly #1 seeded team, highest average points, and semi-finalists
Thanks to 103 and 484 for being alliance mates.
 


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 cmd_drive can't drive straight? gnormhurst Programming 4 02-18-2005 01:54 AM
Drive Straight C Code using Encoders without PID? Chris_Elston Programming 17 02-15-2005 11:41 PM
All-Time PID Drive with Hall-effects: Coming along very nicely jdong Programming 6 02-05-2005 07:39 PM
Whegs, PID, and climbing phrontist Technical Discussion 9 05-02-2004 12:21 AM
PID control loops - closed loop feedback KenWittlief Technical Discussion 56 04-26-2004 09:27 PM


All times are GMT -5. The time now is 05:45 PM.

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