Thread: PID behavior
View Single Post
  #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