Go to Post we have to get our robots to watch tv and drink beer. - nreynolds [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

 
 
 
Thread Tools Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 29-01-2015, 05:09
rclothier rclothier is offline
Coach, Team 1723
AKA: Russell Clothier
FRC #1723 (The FIRST Bots of Independence, "The FBI")
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2006
Location: Independence, MO
Posts: 42
rclothier is on a distinguished road
PID Issue

We are trying to use PID on LabVIEW for the first time, and are having difficulties getting it to work. I've read the tutorials and threads, so I understand how it's supposed to function. We have encoders on the left and right wheels of a tank drive practice bot. We convert the rotation rate of each wheel into a linear speed in inches/sec. We feed that into a PID as the Process Variable. On the Front Panel of Teleop, we have a control to enter the desired speed for each wheel as the Setpoint. We set the maximum output to +/- 1, and feed that into a Tank Drive. A screen shot of the code is attached.

We put both Setpoints to 25 in/s, which is about one rotation per sec. When we set all 3 gains to 0, the wheels don't turn (of course). When the P gain increases above 0.003 the wheels begin to turn slowly, but not at the Setpoint. When the gain gets above 0.007, the wheels ramp up directly to full speed (+/- 1); the encoder velocity (process variable) goes to about 250 in/s. Its basically all or nothing. Adjusting the Setpoint higher or lower has no effect. If the P gain goes above 0.2, the wheels switch rapidly between +1 and -1, flipping back and forth. Adding gain to I or D only makes matters worse.

Clearly there is too much gain if we're maxxing out at P=0.007. The robot is on blocks, so there's no real load on the wheels; shouldn't it work anyway? (We don't want to put it on the ground when it's acting crazy.) Do we leave the dt(s) input empty? Is there something else we are missing?

Any advice would be appreciated. Thanks.
Attached Thumbnails
Click image for larger version

Name:	PID Code 1.png
Views:	65
Size:	197.5 KB
ID:	18041  
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 08: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