Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Proportional–integral–derivative controller
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Alternative nomenclature and forms== {{Unreferenced section|date=December 2012}} ===Standard versus parallel (ideal) form=== The form of the PID controller most often encountered in industry, and the one most relevant to tuning algorithms is the ''standard form''. In this form the <math>K_p</math> gain is applied to the <math>I_{\mathrm{out}}</math>, and <math>D_{\mathrm{out}}</math> terms, yielding: :<math>u(t) = K_p \left( e(t) + \frac{1}{T_i}\int_0^t e(\tau)\,d\tau + T_d\frac{d}{dt}e(t) \right)</math> where :<math>T_i</math> is the ''integral time'' :<math>T_d</math> is the ''derivative time'' In this standard form, the parameters have a clear physical meaning. In particular, the inner summation produces a new single error value which is compensated for future and past errors. The proportional error term is the current error. The derivative components term attempts to predict the error value at <math>T_d</math> seconds (or samples) in the future, assuming that the loop control remains unchanged. The integral component adjusts the error value to compensate for the sum of all past errors, with the intention of completely eliminating them in <math>T_i</math> seconds (or samples). The resulting compensated single error value is then scaled by the single gain <math>K_p</math> to compute the control variable. In the parallel form, shown in the controller theory section :<math>u(t) = K_p e(t) + K_i \int_0^t e(\tau)\,d\tau + K_d\frac{d}{dt}e(t)</math> the gain parameters are related to the parameters of the standard form through <math>K_i = K_p/T_i</math> and <math>K_d = K_p T_d</math>. This parallel form, where the parameters are treated as simple gains, is the most general and flexible form. However, it is also the form where the parameters have the weakest relationship to physical behaviors and is generally reserved for theoretical treatment of the PID controller. The standard form, despite being slightly more complex mathematically, is more common in industry. ===Reciprocal gain, a.k.a. proportional band=== In many cases, the manipulated variable output by the PID controller is a dimensionless fraction between 0 and 100% of some maximum possible value, and the translation into real units (such as pumping rate or watts of heater power) is outside the PID controller. The process variable, however, is in dimensioned units such as temperature. It is common in this case to express the gain <math>K_p</math> not as "output per degree", but rather in the reciprocal form of a ''proportional band'' <math>100/K_p</math>, which is "degrees per full output": the range over which the output changes from 0 to 1 (0% to 100%). Beyond this range, the output is saturated, full-off or full-on. The narrower this band, the higher the proportional gain. ===Basing derivative action on PV=== In most commercial control systems, derivative action is based on process variable rather than error. That is, a change in the setpoint does not affect the derivative action. This is because the digitized version of the algorithm produces a large unwanted spike when the setpoint is changed. If the setpoint is constant then changes in the PV will be the same as changes in error. Therefore, this modification makes no difference to the way the controller responds to process disturbances. ===Basing proportional action on PV=== Most commercial control systems offer the ''option'' of also basing the proportional action solely on the process variable. This means that only the integral action responds to changes in the setpoint. The modification to the algorithm does not affect the way the controller responds to process disturbances. Basing proportional action on PV eliminates the instant and possibly very large change in output caused by a sudden change to the setpoint. Depending on the process and tuning this may be beneficial to the response to a setpoint step. :<math>\mathrm{MV(t)}=K_p\left(\,{-PV(t)} + \frac{1}{T_i}\int_{0}^{t}{e(\tau)}\,{d\tau} - T_d\frac{d}{dt}PV(t)\right)</math> King<ref>{{cite book |last=King |first=Myke |title=Process Control: A Practical Approach |publisher=Wiley |year=2011 |pages=52–78 |isbn=978-0-470-97587-9}}</ref> describes an effective chart-based method. ===Laplace form=== Sometimes it is useful to write the PID regulator in [[Laplace transform]] form: :<math>G(s)=K_p + \frac{K_i}{s} + K_d{s}=\frac{K_d{s^2} + K_p{s} + K_i}{s}</math> Having the PID controller written in Laplace form and having the transfer function of the controlled system makes it easy to determine the closed-loop transfer function of the system. ===Series/interacting form=== Another representation of the PID controller is the series, or ''interacting'' form :<math>G(s) = K_c (\frac{1}{\tau_i{s}}+1) (\tau_d{s}+1)</math> where the parameters are related to the parameters of the standard form through :<math>K_p = K_c \cdot \alpha</math>, <math>T_i = \tau_i \cdot \alpha</math>, and :<math>T_d = \frac{\tau_d}{\alpha}</math> with :<math>\alpha = 1 + \frac{\tau_d}{\tau_i}</math>. This form essentially consists of a PD and PI controller in series. As the integral is required to calculate the controller's bias this form provides the ability to track an external bias value which is required to be used for proper implementation of multi-controller advanced control schemes. ===Discrete implementation=== The analysis for designing a digital implementation of a PID controller in a [[microcontroller]] (MCU) or [[FPGA]] device requires the standard form of the PID controller to be ''discretized''.<ref>{{cite web |url=https://www.scribd.com/doc/19070283/Discrete-PI-and-PID-Controller-Design-and-Analysis-for-Digital-Implementation |title=Discrete PI and PID Controller Design and Analysis for Digital Implementation |publisher=Scribd.com |access-date=2011-04-04 |url-access=registration}}</ref> Approximations for first-order derivatives are made by backward [[finite difference]]s. <math>u(t)</math> and <math>e(t)</math> are discretized with a sampling period <math>\Delta t</math>, k is the sample index. Differentiating both sides of PID equation using [[Newton's notation]] gives: <math>\dot{u}(t) = K_p\dot{e}(t) + K_ie(t) + K_d\ddot{e}(t)</math> Derivative terms are approximated as, :<math>\dot{f}(t_k) = \dfrac{df(t_k)}{dt}=\dfrac{f(t_{k})-f(t_{k-1})}{\Delta t}</math> So, :<math>\frac{u(t_{k})-u(t_{k-1})}{\Delta t} = K_p\frac{e(t_{k})-e(t_{k-1})}{\Delta t} + K_i e(t_{k}) + K_d \frac{\dot{e}(t_{k}) - \dot{e}(t_{k-1})}{\Delta t}</math> Applying backward difference again gives, :<math>\frac{u(t_{k})-u(t_{k-1})}{\Delta t} = K_p\frac{e(t_{k})-e(t_{k-1})}{\Delta t} + K_i e(t_{k}) + K_d \frac{ \frac{e(t_{k})-e(t_{k-1})}{\Delta t} - \frac{e(t_{k-1})-e(t_{k-2})}{\Delta t} }{\Delta t}</math> By simplifying and regrouping terms of the above equation, an algorithm for an implementation of the discretized PID controller in a MCU is finally obtained: :<math>u(t_{k})=u(t_{k-1})+\left(K_p+K_i\Delta t+\dfrac{K_d}{\Delta t}\right) e(t_{k})+\left(-K_p-\dfrac{2K_d}{\Delta t}\right) e(t_{k-1}) + \dfrac{K_d}{\Delta t}e(t_{k-2})</math> or: :<math>u(t_k)=u(t_{k-1})+K_p\left[\left(1+\dfrac{\Delta t}{T_i}+\dfrac{T_d}{\Delta t}\right) e(t_k)+\left(-1-\dfrac{2T_d}{\Delta t}\right)e(t_{k-1}) + \dfrac{T_d}{\Delta t}e(t_{k-2})\right]</math> s.t. <math> T_i = K_p/K_i, T_d = K_d/K_p</math> Note: This method solves in fact <math>u(t) = K_\text{p} e(t) + K_\text{i} \int_0^t e(\tau) \,\mathrm{d}\tau + K_\text{d} \frac{\mathrm{d}e(t)}{\mathrm{d}t} + u_0</math> where <math>u_0</math> is a constant independent of t. This constant is useful when you want to have a start and stop control on the regulation loop. For instance, setting Kp,Ki and Kd to 0 will keep u(t) constant. Likewise, when you want to start a regulation on a system where the error is already close to 0 with u(t) non null, it prevents from sending the output to 0.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)