Difference between revisions of "PID Control"
(→MATLAB code) 

(22 intermediate revisions by the same user not shown)  
Line 1:  Line 1:  
−  {{chheaderFrequency Domain AnalysisPID Control  +  {{chheaderFrequency Domain AnalysisPID ControlFrequency Domain Design}} 
This chapter describes the use of proportional integral derivative (PID) feedback for control systems design. We discuss the basic concepts behind PID control and the methods for choosing the PID gains.  This chapter describes the use of proportional integral derivative (PID) feedback for control systems design. We discuss the basic concepts behind PID control and the methods for choosing the PID gains.  
Line 5:  Line 5:  
{{chaptertable left}}  {{chaptertable left}}  
== Textbook Contents ==  == Textbook Contents ==  
−  {{am05pdf  +  {{am05pdfam08pid28Sep12PID Control}} 
−  * 1.  +  * 1. Basic Control Functions 
−  * 2.  +  * 2. Simple Controllers for Complex Systems 
−  * 3  +  * 3. PID Tuning (Ziegler Nichols) 
−  +  * 4. Integrator Windup  
* 5. Implementation  * 5. Implementation  
* 6. Further Reading  * 6. Further Reading  
Line 16:  Line 16:  
== Lecture Materials ==  == Lecture Materials ==  
−  * [[Lecture: PID Control]]  +  * Lectures: [[Lecture: PID ControlPID Control]], [[Lecture: PID ToolsPID Tools]] 
−  +  
* [[#ExercisesAdditional Exercises]]  * [[#ExercisesAdditional Exercises]]  
== Supplemental Information ==  == Supplemental Information ==  
* [[#Frequently Asked QuestionsFrequently Asked Questions]]  * [[#Frequently Asked QuestionsFrequently Asked Questions]]  
+  * [[#ErrataErrata]]  
* Wikipedia entries: [http://en.wikipedia.org/wiki/PID_controller PID controller]  * Wikipedia entries: [http://en.wikipedia.org/wiki/PID_controller PID controller]  
* [[#Additional InformationAdditional Information]]  * [[#Additional InformationAdditional Information]]  
Line 29:  Line 29:  
This chapter describes the design and use of PID (proportionalintegralderivative) control:  This chapter describes the design and use of PID (proportionalintegralderivative) control:  
<ol>  <ol>  
−  <li><p> The basic PID controller  +  <li><p> The basic PID controller has the form 
<center><amsmath>  <center><amsmath>  
u(t) = k_p e(t) + k_i \int_0^t e(\tau)\,d\tau + k_d \frac{de}{dt},  u(t) = k_p e(t) + k_i \int_0^t e(\tau)\,d\tau + k_d \frac{de}{dt},  
Line 48:  Line 48:  
u=k_pe+k_d\frac{de}{dt}=k\bigl(e+T_d\frac{de}{dt}\bigr),  u=k_pe+k_d\frac{de}{dt}=k\bigl(e+T_d\frac{de}{dt}\bigr),  
</amsmath></center>  </amsmath></center>  
−  where <math>T_d=k_d/k_p</math> is the derivative time constant. The action of a controller with proportional and derivative action can be interpreted as if the control is made proportional to the  +  where <math>T_d=k_d/k_p</math> is the derivative time constant. The action of a controller with proportional and derivative action can be interpreted as if the control is made proportional to the predicted process output, where the prediction is made by extrapolating the error <math>T_d</math> time units into the future using the tangent to the error curve. 
</p></li>  </p></li>  
−  <li><p>  +  <li><p>PID gains can be determined using ''ZieglerNichols'' tuning rules. The step response method characterizes the open loop response by the parameters <math>a</math> and <math>\tau</math> illustrated below (left): 
+  <center>[[Image:pidtuning.png]]</center>  
+  The frequency response method characterizes the process dynamics by the point where the Nyquist curve of the process transfer function first intersects the negative real axis and the frequency <math>\omega_c</math> where this occurs (above, right). The corresponding PID gains are given in the following table:  
+  <center>[[Image:pidzntable.png]]</center>  
</p></li>  </p></li>  
+  <li><p> ''Integral windup'' can occur in a controller with integral action when actuator saturation is present. In this situation, the system runs open loop when the actuator is saturated and the integral error builds up, requiring the system to overshoot in order to remove the integrated error. ''Antiwindup compensation'' can be used to minimize the effects of integral windup by feeding back the difference between the commanded input and the actual input, as illustrated below:  
+  <center>[[Image:pidantiwindup.png]]</center>  
+  </p></li>  
+  
+  <li><p> A number of variations of PID controllers are useful in implementation. These include filtering the derivative, setpoint weighting and other variations in how the derivative and integral actions are formulated. PID controllers can be implemented using analog hardware, such as operational amplifiers, or via digital implementations on a computer.  
+  </p></li>  
</ol>  </ol>  
−  == Exercises ==  +  {{chaptertable begin}} 
−  <ncl>PID  +  {{chaptertable left}} 
+  
+  <!  
+  == Additional Exercises ==  
+  The following exercises cover some of the topics introduced in this chapter. Exercises marked with a * appear in the printed text.  
+  <ncl>PID Exercises</ncl>  
+  >  
== Frequently Asked Questions ==  == Frequently Asked Questions ==  
<ncl>PID Control FAQ</ncl>  <ncl>PID Control FAQ</ncl>  
+  == Errata ==  
+  <ncl>PID Control errata v2.11b</ncl>  
+  * [[:Category:PID Control errataFull list of errata starting from first printing]]  
+  * {{submitbug}}  
+  {{chaptertable right}}  
+  
+  == MATLAB code ==  
+  The following MATLAB scripts are available for producing figures that appear in this chapter.  
+  * Figure 10.2: {{matlabfilepidpcon.m}}, {{matlabfilepidpicon.m}}, {{matlabfilepidpidcon.m}}  
+  * Figure 10.4: {{matlabfilepidneural_step.m}}  
+  * Figure 10.5: {{matlabfilepidafmtap_integral.m}}  
+  * Figure 10.6: {{matlabfilepidcruise_conpar_zsweep.m}}, {{matlabfilepidcruise_conpar_wsweep.m}}  
+  * Figure 10.8: {{matlabfilepidafmtap_nyquist.m}}, {{matlabfilepidafmtap_step.m}}  
+  * Figure 10.11: {{matlabfilepidcruisepi_lin_nl_ch9.m}}  
+  * Figure 10.12: {{matlabfilepidcruise_spweight_step.m}}, {{matlabfilepidcruise_spweight_bode.m}}  
+  * Cruise control files: {{matlabfile.cruise_conpar.m}}, {{matlabfile.cruise_lin.m}}, {{matlabfile.cruise_carpar.m}}, {{matlabfile.cruise_opcon.m}}, {{matlabfile.cruise_clsysode.m}}  
+  See the [[softwaresoftware page]] for more information on how to run these scripts.  
+  
== Additional Information ==  == Additional Information ==  
* [http://www.calerga.com/contrib/1/index.html Interactive Learning Modules for PID Control] (Calerga)  * [http://www.calerga.com/contrib/1/index.html Interactive Learning Modules for PID Control] (Calerga)  
+  {{chaptertable end}} 
Latest revision as of 04:23, 19 November 2012
Prev: Frequency Domain Analysis  Chapter 10  PID Control  Next: Frequency Domain Design 
This chapter describes the use of proportional integral derivative (PID) feedback for control systems design. We discuss the basic concepts behind PID control and the methods for choosing the PID gains.
Textbook Contents

Lecture Materials
Supplemental Information

Chapter Summary
This chapter describes the design and use of PID (proportionalintegralderivative) control:
The basic PID controller has the form
where is the control signal and is the control error. The control signal is thus a sum of three terms: a proportional term that is proportional to the error, an integral term that is proportional to the integral of the error, and a derivative term that is proportional to the derivative of the error.
Integral action guarantees that the process output agrees with the reference in steady state and provides an alternative to including a feedforward term for tracking a constant reference input. Integral action can be implemented using automatic reset, where the output of a proportional controller is fed back to its input through a low pass filter:
Derivative action provides a method for predictive action. The inputoutput relation of a controller with proportional and derivative action is
where is the derivative time constant. The action of a controller with proportional and derivative action can be interpreted as if the control is made proportional to the predicted process output, where the prediction is made by extrapolating the error time units into the future using the tangent to the error curve.
PID gains can be determined using ZieglerNichols tuning rules. The step response method characterizes the open loop response by the parameters and illustrated below (left):
The frequency response method characterizes the process dynamics by the point where the Nyquist curve of the process transfer function first intersects the negative real axis and the frequency where this occurs (above, right). The corresponding PID gains are given in the following table:
Integral windup can occur in a controller with integral action when actuator saturation is present. In this situation, the system runs open loop when the actuator is saturated and the integral error builds up, requiring the system to overshoot in order to remove the integrated error. Antiwindup compensation can be used to minimize the effects of integral windup by feeding back the difference between the commanded input and the actual input, as illustrated below:
A number of variations of PID controllers are useful in implementation. These include filtering the derivative, setpoint weighting and other variations in how the derivative and integral actions are formulated. PID controllers can be implemented using analog hardware, such as operational amplifiers, or via digital implementations on a computer.
Frequently Asked Questions
Errata

MATLAB codeThe following MATLAB scripts are available for producing figures that appear in this chapter.
See the software page for more information on how to run these scripts. Additional Information 