Go to Post After all, bitterness takes all the fun out of wiring. - Venkatesh [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: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 05-02-2010, 08:57
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: PID behavior

Quote:
Originally Posted by Felipe Sagui View Post
When the PV = SP the output starts to be constant but not 0. We guess that it has something with the I term and with the reinitialize boolean on PID .VI

Now we ask: why output doesn't decrease until 0? What we can make to do it in the better way that is possible?
Yes, it's because of the integral term. Think about this: the controller has no idea of what's going on other than, at that particular output, it drove the error to zero. Why would it want to change its output?

You are too attached to this "output must go to zero" mantra. Truth is, it's not always the case. Suppose you were controlling a motor's speed with a PID loop. When you reached the desired setpoint, would you like the controller output to go to zero? Of course not, because then the motor would stop spinning.

Manually changing the process variable value isn't really a way to test anything, as it doesn't represent anything and isn't even reproducible. You guys should follow Greg's suggestion of trying the PID example VIs - they actually simulate a process and will be a lot more helpful.


PS - It seems you already understand a bit about PID controllers, so what is the purpose of those tests?

Please ask again if you need clarifications, and best of luck!
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2010, 09:36
Felipe Sagui Felipe Sagui is offline
Registered User
FRC #1382 (EtepTeam)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Brazil
Posts: 25
Felipe Sagui is an unknown quantity at this point
Send a message via MSN to Felipe Sagui
Re: PID behavior

Quote:
Originally Posted by Manoel View Post
You are too attached to this "output must go to zero" mantra. Truth is, it's not always the case. Suppose you were controlling a motor's speed with a PID loop. When you reached the desired setpoint, would you like the controller output to go to zero? Of course not, because then the motor would stop spinning.
Here we want to attach a motor on a encoder, set a SP and get the encoder pulses as variable process, but we were intending to do an output curve that starts on maximum(error high) and while the PV increases, the output decreases until a value near 0 (motor stops spinning). is possible make it on PID .VI on LV?
we already did it on past years when the programming was on RC (C language), but we decided to try another kind of programming. It was like it:
previous_error = 0
integral = 0
start:
error = setpoint - actual_position
integral = integral + (error*dt)
derivative = (error - previous_error)/dt
output = (Kp*error) + (Ki*integral) + (Kd*derivative)
previous_error = error
wait(dt)
goto start
We tested on the motor before the manually test of the PV. However, we got the same result.
__________________
Felipe Cezar Salgado
ETEPTEAM #1382
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2010, 09:39
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: PID behavior

Have you read the PID manual that is included with LabVIEW? I think you'll find that Ki and Kd are treated differently then the code you used in the past.

It certainly is possible to write your own PID code, but it's worth the time to understand NI's implementation.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2010, 10:23
Felipe Sagui Felipe Sagui is offline
Registered User
FRC #1382 (EtepTeam)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Brazil
Posts: 25
Felipe Sagui is an unknown quantity at this point
Send a message via MSN to Felipe Sagui
Re: PID behavior

We read the PID manual before starts the tests, and we discovered that on LV PID is on Academic formula. Ti divides 1 (inverse of Ki) the Td only sums.

We are wondering too write our own PID like that pseudocode we already used. Or try to discovery another logic that fits to our problem.
__________________
Felipe Cezar Salgado
ETEPTEAM #1382
Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2010, 10:48
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: PID behavior

Quote:
Originally Posted by Felipe Sagui View Post
Here we want to attach a motor on a encoder, set a SP and get the encoder pulses as variable process, but we were intending to do an output curve that starts on maximum(error high) and while the PV increases, the output decreases until a value near 0 (motor stops spinning). is possible make it on PID .VI on LV?
Yes, if properly tuned, your system will behave as described.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2010, 08:10
Felipe Sagui Felipe Sagui is offline
Registered User
FRC #1382 (EtepTeam)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Brazil
Posts: 25
Felipe Sagui is an unknown quantity at this point
Send a message via MSN to Felipe Sagui
Re: PID behavior

Thanks everybody...

We got it
__________________
Felipe Cezar Salgado
ETEPTEAM #1382
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
Random behavior RedBarons Programming 9 25-02-2006 23:03
my behavior lil_longo General Forum 1 24-02-2006 13:53
Bizzare Quaderature Behavior phrontist Electrical 8 22-01-2006 09:04
Problematic 2004 RC behavior Danny Diaz Control System 1 21-01-2006 17:48
Strange Behavior Gary Bonner Control System 17 09-11-2005 19:01


All times are GMT -5. The time now is 11:50.

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