Go to Post DO NOT THROW THINGS AT THE PROGRAMMER! - demosthenes2k8 [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-02-2012, 19:56
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
PID In-Range Ideas

Does anyone have any ideas about how to determine if a PID loop has settled out yet? We have our PID loop running relatively well, but I am trying to find a way to sense if the loop has settled out in order to trigger our intake system to shoot the ball. I tried if ERROR < 5 then RUN INTAKE. But it runs momentarily on the overshoot and undershoot. I was able to partially fix this by only allowing it to shoot after 3 seconds, but I feel that there is a better way to do this?

Patrick
Reply With Quote
  #2   Spotlight this post!  
Unread 26-02-2012, 19:59
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: PID In-Range Ideas

We accomplished by averaging. If the average was in range, then fire.
__________________
corin.rypkema.org
WPI Class of '17
'12 Dean's List Finalist, Mentor of 706 - Cyberhawks
Reply With Quote
  #3   Spotlight this post!  
Unread 26-02-2012, 20:41
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: PID In-Range Ideas

Is there a VI that will do averaging for you? If not, how do you do it?
Reply With Quote
  #4   Spotlight this post!  
Unread 26-02-2012, 23:50
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: PID In-Range Ideas

You combine a check of error with a timer.

The psudocode would be:
Code:
int timer = 0; //Make sure you use a signed type to prevent underflow


int delta_t = time_now - time_last; //delta_t is millisecond loop time - in LabVIEW it would be a Tick Count block and a shift register/feedback node to store the last time

if(abs(error) < threshold) timer += delta_t;
else timer -= delta_t;

if(timer <= 0) timer = 0;

if(timer >= threshold) fire();
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
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:11.

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