Go to Post At this time of the season, there is only one response: BAAAAAAAAA-humbug! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 13-02-2012, 12:03
baronep's Avatar
baronep baronep is offline
Student President
FRC #2848 (Jesuit All-Sparks)
Team Role: Leadership
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Dallas TX
Posts: 167
baronep is on a distinguished road
Re: using the pid module

Because I could not tell from your post, I am assuming that you have no prior knowledge of PID.

First of all, I would suggest using the accelerometer and not the gyro to balance your robot. Search Chief Delphi or the NI FRC examples to determine how that works, there is plenty of material available.

As far as PID goes, there are several inputs to that you must provide in order to get an output. Fist is the process variable, this is the sensor reading (filterer, scaled or unfiltered. You just have to experiment to figure out which gives you the cleanest results). Then you have the setpoint which is the value that you want your process variable to go to. Make sure that any scaling that you do to the PV (process variable), you also do to to setpoint. Then you have something along the lines out output range which is generally [-1,1] or [0,1], depending if you want your motor to run backwards to slow itself down. (You would probably want [0,1].

Then the most interesting part, the PID gains. You need to create a cluster control or constant which then has 3 inputs. The P, I and D coefficients. Changing these coefficents is known as tuning the PID loop. Search Chief Delphi on how to do this, there is a lot of good advice out there.

Finally, you can use the output of the PID function to control your motor speed.

Honestly the hardest parts of this is A) getting a clean enough input and B) getting the PID gains set correctly. If you find that the gains are at the very bottom of the accepted input values (ex. P=.001 is still unstable), try dividing both the PV and setpoint by 10 or 100. Then you can change P to .01 or .1 respectively. Then go from there.

Hope this helps
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


All times are GMT -5. The time now is 22:07.

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