All Topics  
PID controller

 

   Email Print
   Bookmark   Link






 

PID controller



 
 
A proportional–integral–derivative controller (PID controller) is a generic control loop feedback mechanism (controller
Controller (control theory)

In control theory, a controller is a device which monitors and affects the operational conditions of a given dynamical system. The operational conditions are typically referred to as output variables of the system which can be affected by adjusting certain inputs variables....
) widely used in industrial control system
Control system

A control system is a device or set of devices to manage, command, direct or regulate the behavior of other devices or systems.There are two common classes of control systems, with many variations and combinations: logic gate, and feedback or linear controls....
s. A PID controller attempts to correct the error between a measured process variable
Process variable

A process variable is the current status of a process under control. An example of this would be the temperature of a furnace. The current temperature is called the process variable, while the desired temperature is known as the setpoint ....
 and a desired setpoint by calculating and then outputting a corrective action that can adjust the process accordingly.

PID controller calculation (algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
) involves three separate parameters; the proportional
Proportionality (mathematics)

In mathematics, two quantity are called proportional if they vary in such a way that one of the quantities is a constant multiple of the other, or equivalently if they have a constant ratio....
, the integral
Integral

Integration is an important concept in mathematics, specifically in the field of calculus and, more broadly, mathematical analysis. Given a function ƒ of a Real number variable x and an interval [ab] of the real line, the integral...
 and derivative
Derivative

In calculus, a branch of mathematics, the derivative is a measure of how a function changes as its input changes. Loosely speaking, a derivative can be thought of as how much a quantity is changing at a given point....
 values.






Discussion
Ask a question about 'PID controller'
Start a new discussion about 'PID controller'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A proportional–integral–derivative controller (PID controller) is a generic control loop feedback mechanism (controller
Controller (control theory)

In control theory, a controller is a device which monitors and affects the operational conditions of a given dynamical system. The operational conditions are typically referred to as output variables of the system which can be affected by adjusting certain inputs variables....
) widely used in industrial control system
Control system

A control system is a device or set of devices to manage, command, direct or regulate the behavior of other devices or systems.There are two common classes of control systems, with many variations and combinations: logic gate, and feedback or linear controls....
s. A PID controller attempts to correct the error between a measured process variable
Process variable

A process variable is the current status of a process under control. An example of this would be the temperature of a furnace. The current temperature is called the process variable, while the desired temperature is known as the setpoint ....
 and a desired setpoint by calculating and then outputting a corrective action that can adjust the process accordingly.

General


The PID controller calculation (algorithm
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
) involves three separate parameters; the proportional
Proportionality (mathematics)

In mathematics, two quantity are called proportional if they vary in such a way that one of the quantities is a constant multiple of the other, or equivalently if they have a constant ratio....
, the integral
Integral

Integration is an important concept in mathematics, specifically in the field of calculus and, more broadly, mathematical analysis. Given a function ƒ of a Real number variable x and an interval [ab] of the real line, the integral...
 and derivative
Derivative

In calculus, a branch of mathematics, the derivative is a measure of how a function changes as its input changes. Loosely speaking, a derivative can be thought of as how much a quantity is changing at a given point....
 values. The proportional value determines the reaction to the current error, the integral value determines the reaction based on the sum of recent errors, and the derivative value determines the reaction based on the rate at which the error has been changing. The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve or the power supply of a heating element.

By tuning the three constants in the PID controller algorithm, the controller can provide control action designed for specific process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the setpoint and the degree of system oscillation. Note that the use of the PID algorithm for control does not guarantee optimal control
Optimal control

Optimal control theory, an extension of the calculus of variations, is a mathematical optimization method for deriving control theory. The method is largely due to the work of Lev Pontryagin and his collaborators in the Soviet Union and Richard Bellman in the United States....
 of the system or system stability.

Some applications may require using only one or two modes to provide the appropriate system control. This is achieved by setting the gain of undesired control outputs to zero. A PID controller will be called a PI, PD, P or I controller in the absence of the respective control actions. PI controller
PI controller

In control engineering, a PI Controller is a feedback controller which drives the plant to be controlled with a weighted sum of the error and the integral of that value....
s are particularly common, since derivative action is very sensitive to measurement noise, and the absence of an integral value may prevent the system from reaching its target value due to the control action.

Note: Due to the diversity of the field of control theory and application, many naming conventions for the relevant variables are in common use.

Control loop basics


A familiar example of a control loop is the action taken to keep one's shower water at the ideal temperature, which typically involves the mixing of two process streams, cold and hot water. The person feels the water to estimate its temperature. Based on this measurement they perform a control action: use the cold water tap to adjust the process. The person would repeat this input-output control loop, adjusting the hot water flow until the process temperature stabilized at the desired value.

Feeling the water temperature is taking a measurement of the process value or process variable (PV). The desired temperature is called the setpoint (SP). The output from the controller and input to the process (the tap position) is called the manipulated variable (MV). The difference between the measurement and the setpoint is the error (e), too hot or too cold and by how much.

As a controller, one decides roughly how much to change the tap position (MV) after one determines the temperature (PV), and therefore the error. This first estimate is the equivalent of the proportional action of a PID controller. The integral action of a PID controller can be thought of as gradually adjusting the temperature when it is almost right. Derivative action can be thought of as noticing the water temperature is getting hotter or colder, and how fast, anticipating further change and tempering adjustments for a soft landing at the desired temperature (SP).

Making a change that is too large when the error is small is equivalent to a high gain controller and will lead to overshoot. If the controller were to repeatedly make changes that were too large and repeatedly overshoot the target, this control loop would be termed unstable and the output would oscillate around the setpoint in either a constant, growing, or decaying sinusoid. A human would not do this because we are adaptive control
Adaptive control

Adaptive control involves modifying the control law used by a controller to cope with the fact that the parameters of the system being controlled are slowly time-varying or uncertain....
lers, learning from the process history, but PID controllers do not have the ability to learn and must be set up correctly. Selecting the correct gains for effective control is known as tuning the controller.

If a controller starts from a stable state at zero error (PV = SP), then further changes by the controller will be in response to changes in other measured or unmeasured inputs to the process that impact on the process, and hence on the PV. Variables that impact on the process other than the MV are known as disturbances. Generally controllers are used to reject disturbances and/or implement setpoint changes. Changes in feed water temperature constitute a disturbance to the shower process.

In theory, a controller can be used to control any process which has a measurable output (PV), a known ideal value for that output (SP) and an input to the process (MV) that will affect the relevant PV. Controllers are used in industry to regulate temperature
Temperature

In physics, temperature is a physical property of a Physical system that underlies the common notions of hot and cold; something that feels hotter generally has the greater temperature....
, pressure
Pressure

Pressure is the force per unit area applied to an object in a direction surface normal to the surface. Gauge pressure is the pressure relative to the local atmospheric or ambient pressure....
, flow rate, chemical composition, speed
Speed

Speed is the rate of Motion , or equivalently the rate of change of distance.Speed is a Scalar quantity with dimensions length/time; the equivalent Vector quantity to speed is velocity....
 and practically every other variable for which a measurement exists. Automobile cruise control
Cruise control

Cruise control is a system that automatically controls the rate of motion of a motor vehicle. The driver sets the speed and the system will take over the throttle of the car to maintain the same speed....
 is an example of a process which utilizes automated control.

Due to their long history, simplicity, well grounded theory and simple setup and maintenance requirements, PID controllers are the controllers of choice for many of these applications.

PID controller theory


This section describes the parallel or non-interacting form of the PID controller. For other forms please see the Section "Alternative notation and PID forms".

The PID control scheme is named after its three correcting terms, whose sum constitutes the manipulated variable (MV). Hence:

where , , and are the contributions to the output from the PID controller from each of the three terms, as defined below.

Proportional term


The proportional term (sometimes called gain) makes a change to the output that is proportional to the current error value. The proportional response can be adjusted by multiplying the error by a constant Kp, called the proportional gain.

The proportional term is given by:

Where
  • : Proportional term of output
  • : Proportional gain, a tuning parameter
  • : Error
  • : Time or instantaneous time (the present)


A high proportional gain results in a large change in the output for a given change in the error. If the proportional gain is too high, the system can become unstable (See the section on loop tuning). In contrast, a small gain results in a small output response to a large input error, and a less responsive (or sensitive) controller. If the proportional gain is too low, the control action may be too small when responding to system disturbances.

In the absence of disturbances, pure proportional control will not settle at its target value, but will retain a steady state error that is a function of the proportional gain and the process gain. Despite the steady-state offset, both tuning theory and industrial practice indicate that it is the proportional term that should contribute the bulk of the output change.

Integral term


The contribution from the integral term (sometimes called reset) is proportional to both the magnitude of the error and the duration of the error. Summing the instantaneous error over time (integrating the error) gives the accumulated offset that should have been corrected previously. The accumulated error is then multiplied by the integral gain and added to the controller output. The magnitude of the contribution of the integral term to the overall control action is determined by the integral gain, .

The integral term is given by:

Where
  • : Integral term of output
  • : Integral gain, a tuning parameter
  • : Error
  • : Time or instantaneous time (the present)
  • : A dummy integration variable


The integral term (when added to the proportional term) accelerates the movement of the process towards setpoint and eliminates the residual steady-state error that occurs with a proportional only controller. However, since the integral term is responding to accumulated errors from the past, it can cause the present value to overshoot the setpoint value (cross over the setpoint and then create a deviation in the other direction). For further notes regarding integral gain tuning and controller stability, see the section on loop tuning.

Derivative term


The rate of change of the process error is calculated by determining the slope of the error over time (i.e., its first derivative with respect to time) and multiplying this rate of change by the derivative gain . The magnitude of the contribution of the derivative term (sometimes called rate) to the overall control action is termed the derivative gain, .

The derivative term is given by:

Where
  • : Derivative term of output
  • : Derivative gain, a tuning parameter
  • : Error
  • : Time or instantaneous time (the present)


The derivative term slows the rate of change of the controller output and this effect is most noticeable close to the controller setpoint. Hence, derivative control is used to reduce the magnitude of the overshoot produced by the integral component and improve the combined controller-process stability. However, differentiation of a signal amplifies noise and thus this term in the controller is highly sensitive to noise in the error term, and can cause a process to become unstable if the noise and the derivative gain are sufficiently large.

Summary


The proportional, integral, and derivative terms are summed to calculate the output of the PID controller. Defining as the controller output, the final form of the PID algorithm is:



and the tuning parameters are: Proportional gain, : larger values typically mean faster response since the larger the error, the larger the Proportional term compensation. An excessively large proportional gain will lead to process instability and oscillation. Integral gain, : larger values imply steady state errors are eliminated quicker. The trade-off is larger overshoot: any negative error integrated during transient response must be integrated away by positive error before we reach steady state. Derivative gain, : larger values decrease overshoot, but slows down transient response and may lead to instability due to signal noise amplification in the differentiation of the error.

Loop tuning

If the PID controller parameters (the gains of the proportional, integral and derivative terms) are chosen incorrectly, the controlled process input can be unstable, i.e. its output diverges, with or without oscillation
Oscillation

Oscillation is the repetitive variation, typically in time, of some measure about a central value or between two or more different states. Familiar examples include a swinging pendulum and Alternating current power....
, and is limited only by saturation or mechanical breakage. Tuning a control loop is the adjustment of its control parameters (gain/proportional band, integral gain/reset, derivative gain/rate) to the optimum values for the desired control response.

The optimum behavior on a process change or setpoint change varies depending on the application. Some processes must not allow an overshoot of the process variable beyond the setpoint if, for example, this would be unsafe. Other processes must minimize the energy expended in reaching a new setpoint. Generally, stability of response (the reverse of instability
Instability

Instability in systems is generally characterized by some of the outputs or internal state growing without bounds. Not all systems that are not stability are unstable; systems can also be marginal stability or exhibit limit cycle behavior....
) is required and the process must not oscillate for any combination of process conditions and setpoints. Some processes have a degree of non-linearity and so parameters that work well at full-load conditions don't work when the process is starting up from no-load. This section describes some traditional manual methods for loop tuning.

There are several methods for tuning a PID loop. The most effective methods generally involve the development of some form of process model, then choosing P, I, and D based on the dynamic model parameters. Manual tuning methods can be relatively inefficient.

The choice of method will depend largely on whether or not the loop can be taken "offline" for tuning, and the response time of the system. If the system can be taken offline, the best tuning method often involves subjecting the system to a step change in input, measuring the output as a function of time, and using this response to determine the control parameters.

Choosing a Tuning Method
Method Advantages Disadvantages
Manual Tuning No math required. Online method. Requires experienced personnel.
Ziegler–Nichols Proven Method. Online method. Process upset, some trial-and-error, very aggressive tuning.
Software Tools Consistent tuning. Online or offline method. May include valve and sensor analysis. Allow simulation before downloading. Some cost and training involved.
Cohen-Coon Good process models. Some math. Offline method. Only good for first-order processes.


Manual tuning


If the system must remain online, one tuning method is to first set and values to zero. Increase the until the output of the loop oscillates, then the should be left set to be approximately half of that value for a "quarter amplitude decay" type response. Then increase until any offset is correct in sufficient time for the process. However, too much will cause instability. Finally, increase , if required, until the loop is acceptably quick to reach its reference after a load disturbance. However, too much will cause excessive response and overshoot. A fast PID loop tuning usually overshoots slightly to reach the setpoint more quickly; however, some systems cannot accept overshoot, in which case an "over-damped" closed-loop system is required, which will require a setting significantly less than half that of the setting causing oscillation.

Effects of increasing parameters
Parameter Rise time Overshoot Settling time Error at equilibrium
Decrease Increase Small change Decrease
Decrease Increase Increase Eliminate
Indefinite (small decrease or increase) Decrease Decrease None


Ziegler–Nichols method


Another tuning method is formally known as the Ziegler–Nichols method
Ziegler–Nichols method

The Ziegler?Nichols tuning method is a heuristic method of tuning a PID controller. It was developed by John G. Ziegler and Nathaniel B. Nichols....
, introduced by John G. Ziegler and Nathaniel B. Nichols
Nathaniel B. Nichols

Nathaniel B. Nichols was an United States control engineer who made significant contributions to the field of control theory. He is well-known for his book Theory of Servomechanism, one of the most widely read books in control engineering....
. As in the method above, the and gains are first set to zero. The P gain is increased until it reaches the critical gain, , at which the output of the loop starts to oscillate. and the oscillation period are used to set the gains as shown:

Ziegler–Nichols method
Control Type
P - -
PI -
PID


PID tuning software


Most modern industrial facilities no longer tune loops using the manual calculation methods shown above. Instead, PID tuning and loop optimization software are used to ensure consistent results. These software packages will gather the data, develop process models, and suggest optimal tuning. Some software packages can even develop tuning by gathering data from reference changes.

Mathematical PID loop tuning induces an impulse in the system, and then uses the controlled system's frequency response to design the PID loop values. In loops with response times of several minutes, mathematical loop tuning is recommended, because trial and error can literally take days just to find a stable set of loop values. Optimal values are harder to find. Some digital loop controllers offer a self-tuning feature in which very small setpoint changes are sent to the process, allowing the controller itself to calculate optimal tuning values.

Other formulas are available to tune the loop according to different performance criteria.

Modifications to the PID algorithm


The basic PID algorithm presents some challenges in control applications that have been addressed by minor modifications to the PID form.

One common problem resulting from the ideal PID implementations is integral windup
Integral windup

Integral windup refers to the situation in a PID controller where the integral, or reset action continues to integrate indefinitely. This usually occurs when the controller's output can no longer affect the controlled variable, which in turn can be caused by controller...
. This problem can be addressed by:

  • Initializing the controller integral to a desired value
  • Increasing the setpoint in a suitable ramp
  • Disabling the integral function until the PV has entered the controllable region
  • Limiting the time period over which the integral error is calculated
  • Preventing the integral term from accumulating above or below pre-determined bounds


Many PID loops control a mechanical device (for example, a valve). Mechanical maintenance can be a major cost and wear leads to control degradation in the form of either stiction
Stiction

Stiction is an informal portmanteau of the term "static friction" , perhaps also influenced by the verb "Adhesion".Two solid objects pressing against each other will require some threshold of force parallel to the surface of contact in order to overcome static cohesion....
 or a deadband
Deadband

A Deadband is an area of a Signalling range or band where no action occurs . Deadband is used in voltage regulators and other controllers. The purpose is common, to prevent oscillation or repeated activation-deactivation Periodicitys ....
 in the mechanical response to an input signal. The rate of mechanical wear is mainly a function of how often a device is activated to make a change. Where wear is a significant concern, the PID loop may have an output deadband
Deadband

A Deadband is an area of a Signalling range or band where no action occurs . Deadband is used in voltage regulators and other controllers. The purpose is common, to prevent oscillation or repeated activation-deactivation Periodicitys ....
 to reduce the frequency of activation of the output (valve). This is accomplished by modifying the controller to hold its output steady if the change would be small (within the defined deadband range). The calculated output must leave the deadband before the actual output will change.

The proportional and derivative terms can produce excessive movement in the output when a system is subjected to an instantaneous step increase in the error, such as a large setpoint change. In the case of the derivative term, this is due to taking the derivative of the error, which is very large in the case of an instantaneous step change. As a result, some PID algorithms incorporate the following modifications:

Derivative of output: In this case the PID controller measures the derivative of the output quantity, rather than the derivative of the error. The output is always continuous (i.e., never has a step change). For this to be effective, the derivative of the output must have the same sign as the derivative of the error. Setpoint ramping: In this modification, the setpoint is gradually moved from its old value to a newly specified value using a linear or first order differential ramp function. This avoids the discontinuity
Discontinuity

Discontinuity can be:*Discontinuity , a property of a mathematical functionDiscontinuity may also refer to:*A break in continuity , in literature...
 present in a simple step change. Setpoint weighting: Setpoint weighting uses different multipliers for the error depending on which element of the controller it is used in. The error in the integral term must be the true control error to avoid steady-state control errors. This affects the controller's setpoint response. These parameters do not affect the response to load disturbances and measurement noise.

Limitations of PID control


While PID controllers are applicable to many control problems, they can perform poorly in some applications.

PID controllers, when used alone, can give poor performance when the PID loop gains must be reduced so that the control system does not overshoot, oscillate or hunt about the control setpoint value. The control system performance can be improved by combining the feedback
Feedback

Feedback describes the situation when output from an event or phenomenon in the past will influence the same event/phenomenon in the present or future....
 (or closed-loop) control of a PID controller with feed-forward
Feed-forward

Feed-forward is a term describing an element or pathway within a control system which passes a controlling signal from a source in the control system's external environment, often a command signal from an external operator, to a load elsewhere in its external environment....
 (or open-loop) control. Knowledge about the system (such as the desired acceleration and inertia) can be fed forward and combined with the PID output to improve the overall system performance. The feed-forward value alone can often provide the major portion of the controller output. The PID controller can then be used primarily to respond to whatever difference or error remains between the setpoint (SP) and the actual value of the process variable (PV). Since the feed-forward output is not affected by the process feedback, it can never cause the control system to oscillate, thus improving the system response and stability.

For example, in most motion control systems, in order to accelerate a mechanical load under control, more force or torque is required from the prime mover, motor, or actuator. If a velocity loop PID controller is being used to control the speed of the load and command the force or torque being applied by the prime mover, then it is beneficial to take the instantaneous acceleration desired for the load, scale that value appropriately and add it to the output of the PID velocity loop controller. This means that whenever the load is being accelerated or decelerated, a proportional amount of force is commanded from the prime mover regardless of the feedback value. The PID loop in this situation uses the feedback information to effect any increase or decrease of the combined output in order to reduce the remaining difference between the process setpoint and the feedback value. Working together, the combined open-loop feed-forward controller and closed-loop PID controller can provide a more responsive, stable and reliable control system.

Another problem faced with PID controllers is that they are linear. Thus, performance of PID controllers in non-linear systems (such as HVAC systems
HVAC control system

A HVAC control system is a computerized control system for climate control system in buildings. Stand alone control devices may be pneumatic or electronic....
) is variable. Often PID controllers are enhanced through methods such as PID gain scheduling
Gain scheduling

In control theory, gain scheduling is an approach to control of non-linear systems that uses a family of linear controllers, each of which provides satisfactory control for a different operating point of the system....
 or fuzzy logic
Fuzzy logic

Fuzzy logic is a form of multi-valued logic derived from fuzzy set theory to deal with reasoning that is approximate rather than precise. In binary sets with binary logic, in contrast to fuzzy logic named also crisp logic, the variables may have a Membership function of only 0 or 1....
. Further practical application issues can arise from instrumentation connected to the controller. A high enough sampling rate, measurement precision, and measurement accuracy are required to achieve adequate control performance.

A problem with the Derivative term is that small amounts of measurement or process noise
Noise

In common use, the word noise means unwanted sound or noise pollution. In electronics noise can refer to the electronic signal corresponding to acoustic noise or the electronic signal corresponding to the noise commonly seen as 'Noise ' on a degraded television or video image....
 can cause large amounts of change in the output. It is often helpful to filter the measurements with a low-pass filter
Low-pass filter

A low-pass filter is a electronic filter that passes low-frequency signal but attenuates signals with frequencies higher than the cutoff frequency....
 in order to remove higher-frequency noise components. However, low-pass filtering and derivative control can cancel each other out, so reducing noise by instrumentation means is a much better choice. Alternatively, the differential band can be turned off in many systems with little loss of control. This is equivalent to using the PID controller as a PI controller.

Cascade control

One distinctive advantage of PID controllers is that two PID controllers can be used together to yield better dynamic performance. This is called cascaded PID control. In cascade control there are two PIDs arranged with one PID controlling the set point of another. A PID controller acts as outer loop controller, which controls the primary physical parameter, such as fluid level or velocity. The other controller acts as inner loop controller, which reads the output of outer loop controller as set point, usually controlling a more rapid changing parameter, flowrate or acceleration. It can be mathematically proven that the working frequency of the controller is increased and the time constant of the object is reduced by using cascaded PID controller.

Physical implementation of PID control


In the early history of automatic process control the PID controller was implemented as a mechanical device. These mechanical controllers used a lever
Lever

In physics, a lever is a rigid object that is used with an appropriate fulcrum or wiktionary:pivot point to multiply the mechanical force that can be applied to another object....
, spring
Spring (device)

A spring is an Elasticity object used to store mechanical energy. Springs are usually made out of hardened steel. Small springs can be wound from pre-hardened stock, while larger ones are made from annealing steel and hardened after fabrication....
 and a mass
Mass

In physical science, mass refers to the degree of acceleration a body acquires when subject to a force: bodies with greater mass are accelerated less by the same force....
 and were often energized by compressed air. These pneumatic controllers were once the industry standard.

Electronic analog controllers can be made from a solid-state
Transistor

In electronics, a transistor is a semiconductor device commonly used to Electronic amplifier or switch Electronics signals. A transistor is made of a solid piece of a semiconductor material, with at least three terminals for connection to an external circuit....
 or tube
Vacuum tube

In electronics, a vacuum tube, electron tube , thermionic valve, or just valve is a device used to amplifier, switch, otherwise modify, or create an Electricity signal by controlling the movement of electrons in a low-pressure space....
 amplifier
Operational amplifier

An operational amplifier, which is often called an op-amp, is a direct current-Direct coupling high-gain electronic voltage electronic amplifier with differential inputs and, usually, a single output....
, a capacitor
Capacitor

A capacitor or condenser is a Passive component electronic component consisting of a pair of electrical conductor separated by a dielectric....
 and a resistance
Electrical resistance

The electrical resistance of an object is a measure of its opposition to the passage of a steady electrical current. An object of uniform cross section will have a resistance proportional to its length and inversely proportional to its cross-sectional area, and proportional to the resistivity of the material....
. Electronic analog PID control loops were often found within more complex electronic systems, for example, the head positioning of a disk drive, the power conditioning of a power supply
Power supply

Power supply is a reference to a source of electrical power. A device or system that supplies electrical or other types of energy to an output External electric load or group of loads is called a power supply unit or PSU....
, or even the movement-detection circuit of a modern seismometer
Seismometer

Seismometers are instruments that measure and record motions of the ground, including those of seismic waves generated by earthquakes, nuclear explosions, and other seismic sources....
. Nowadays, electronic controllers have largely been replaced by digital controllers implemented with microcontrollers or FPGAs.

Most modern PID controllers in industry are implemented in programmable logic controller
Programmable logic controller

A programmable logic controller or programmable controller is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines, control of amusement rides, or control of lighting fixtures....
s (PLCs) or as a panel-mounted digital controller. Software implementations have the advantages that they are relatively cheap and are flexible with respect to the implementation of the PID algorithm.

Alternative nomenclature and PID forms


Pseudocode


Here is a simple software loop that implements the PID algorithm:

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

Ideal versus standard PID 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 gain is applied to the , and terms, yielding:

where is the integral time is the derivative time

In the ideal parallel form, shown in the controller theory section

the gain parameters are related to the parameters of the standard form through and . 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 least physical interpretation 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.

Laplace form of the PID controller


Sometimes it is useful to write the PID regulator in Laplace transform
Laplace transform

In mathematics, the Laplace transform is one of the best known and most widely used integral transforms. It is commonly used to produce an easily solvable algebraic equation from an ordinary differential equation....
 form:

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 where the parameters are related to the parameters of the standard form through , , and with .

This form essentially consists of a PD and PI controller in series, and it made early (analog) controllers easier to build. When the controllers later became digital, many kept using the interacting form.

See also


  • Control Theory
    Control theory

    Control theory is an interdisciplinary branch of engineering and mathematics, that deals with the behavior of dynamical systems. The desired output of a system is called the reference....
  • Feedback
    Feedback

    Feedback describes the situation when output from an event or phenomenon in the past will influence the same event/phenomenon in the present or future....
  • Instability
    Instability

    Instability in systems is generally characterized by some of the outputs or internal state growing without bounds. Not all systems that are not stability are unstable; systems can also be marginal stability or exhibit limit cycle behavior....
  • Oscillation
    Oscillation

    Oscillation is the repetitive variation, typically in time, of some measure about a central value or between two or more different states. Familiar examples include a swinging pendulum and Alternating current power....
  • Oscillation (mathematics)
    Oscillation (mathematics)

    In mathematics, oscillation is the behaviour of a sequence of real numbers or a real-valued function , which does not convergence, but also does not divergent series to +∞ or -∞; that is, oscillation is the failure to have a Limit , and is also a quantitative measure for that....


External links


PID tutorials

  • : a beginner's guide to PID loop theory with sample programming code
  • Article in Electronic Design
  • (pg. 22)

Simulations



Special topics and PID control applications

  • Article in Embedded Systems Programming