Pages

Search Here

PID Controller Basics

Proportional-integral-derivative (PID) control is the most common control algorithm used in industry today. The popularity of PID controllers can be attributed to their effectiveness in a wide range of operating conditions, their functional simplicity and how easily engineers can implement them using current computer technology. This article discusses PID control and practical implementations and provides a brief overview on how to tune PID controllers.

Why do engineers need control, and which types of control can they use? Engineers use control to either modify plant behavior to keep system output stable and improve response time (the time the plant takes to go from its current state to the state defined with the new input) or minimize the energy the plant uses to transition between states. To accomplish this, engineers can operate controllers themselves or use mechanical devices or PC or PC-related technology. Thanks to the development of computer-based systems, engineers can use PCs and appropriate hardware to interact with plants and read their output and input signals.


Definitions

A plant is a physical process that must be controlled, meaning a PID controller needs to increase the stability or performance of the process. A tank with one input valve and a fixed output flow, where height level is regulated, is one example. Other examples include a deposit where a chemical reaction takes place, and pH is maintained precisely, or a motor connected to a conveyor belt whose speed must be sustained.

All these systems share one common characteristic: they have one input that can be controlled to produce a desired change in the output signal.

Figure 1: All plant systems have one input that can be controlled to produce a desired change in the output signal

A mathematical model can approximate how the plant behaves. A "black box" with one input and one output can represent this plant model. In the case of a DC motor connected to a conveyor belt, the input would be the voltage applied, and the output would be the speed at which it turns.

On a hydraulic system, the input would be how open the valve is, and the output would be the height on the tank. Finally, on a pH reactor plant, the input is the rate at which a chemical reactor is fed, and the output is the pH measured.


Figure 2. Open-loop systems such as this lack the information needed to change the value on the controller to correct error.

Open-loop systems lack the information needed to change the value on the controller to correct error. To do this, engineers must add feedback information, resulting in a closed-loop system.



Figure 3. A closed-loop system includes a feedback mechanism to correct error.


The controller's purpose

What is the purpose of the controller? It takes into account the desired output of the plant (setpoint) and its actual state and thus finds the error. Based on this error, it works to apply the input necessary to obtain the desired output. Consider a plant that has an input set to zero and that is stable. An engineer could set the input up a step to observe how it behaves. This is called the "step response" in control theory.



Figure 4. PID controllers have three components: the first component, proportional control, makes the actuation by multiplying the current error. The second component, integral control, takes into account the error history. Finally, derivative control acts based on the rate of error, as it is an indicator of how the error is going to evolve in the near future.



How a PID Controller Works

PID controllers have three components: the first component, proportional control, makes the actuation by multiplying the current error. The second component, integral control, takes into account the error history. Finally, derivative control acts based on the rate of error, as it is an indicator of how the error is going to evolve in the near future.

Proportional control acts much like a human operator would. The bigger the error, the bigger the actuation applied. This can lead to oscillations or, because of the dynamics, permanent error if the error is not significant enough to create a corrective action. This is called a "steady-state error."

Integral control considers the history of the error. It keeps adding the value of the error, consequently removing the steady-state error once the system is near its final state.

In systems with long transitions, however, integral control integrates over time, causing "integral windup," where the system evolves beyond the desired setpoint. The output overshoots " that is, it goes over the desired value before going back and settling. High integral gains may also cause the system to become unstable.

Derivative control evolves with the rate of change. This allows the controller to estimate how the error will change in the near future. It makes the system react faster to changes, but it also can make it unstable. Another drawback is that derivatives are very sensitive to noise, making the actuation itself noisy.

There are several PID implementations " or methods for calculating the different PID components " including academic, parallel and serial. In an academic implementation, each term has a constant: Kp for proportional, Ki for integral and Kd for derivative.

The proportional actuation is common, so "integral time" (Ti, equals to Kp/Ki) is used for the integral component, and "derivative time" (Td equals Kp*Kd) is used for the derivative component. This decouples the proportional part of the controller from the dynamics of the controller related to Kp and Ki.

In a parallel implementation, each component is calculated independently and then added together, while in a serial implementation the output of each component feeds the next, so they are interconnected. The latter is the most restrictive of the three and was used in older pneumatic controllers.

It is important to consider that some controllers do not have all three components; it is possible to have P, PD or PI controllers, where one or two components are missing.


How to Set Up a PID Controller

There are several ways to set up the different constants, depending on whether the plant can be offline or online and on how long it takes for a change in the input to be reflected in the output. The following example uses Ziegler-Nichols rules.

These rules consist of having an offline plant and implementing a PID but with Ki and Kd set to zero. If engineers increase the until the system oscillates, they can consider the following rules to find the different gains using the proportional gain implemented (Kc) and the period of the oscilation (Pc).



Figure 5. This example uses Ziegler-Nichols rules, which consist of having an offline plant and implementing a PID but with Ki and Kd set to zero.

These are only rules of thumb and can vary for different types of plants. Engineers may need to tune the plant manually to further improve the overall system.


How to Build a PID Controller

As mentioned before, there are different ways to implement PID controllers: pneumatic, hydraulic and so on; however, PC-based control tools, programmable logic controllers and programmable automation controllers (PACs) provide the easiest and fastest ways to design, prototype and deploy PID controllers.

Modern PC-based systems are especially prepared for PID implementation because they are highly cost-effective and have high processing power and data-logging capabilities, as well as hardware capable of interacting with physical sensors and actuators.

The new generation of graphical programming languages provides flexible and powerful programming capabilities " users with little or no control or programming experience can implement advanced PID algorithms. An example of this architecture is a PC equipped with a National Instruments Compact FieldPoint or CompactRIO PAC and NI LabVIEW graphical development software.


Limitations of PID

Although PID has been widely adopted, it has some limitations. For example, it can only handle systems with one input and one output. It expects the system to behave in a linear manner throughout the entire working range, and it does not take into account the actuators' physical or mechanical limitations.

To overcome these problems, engineers can use a wide variety of techniques, including gain scheduling, cascading controllers or the use of filters with the PID algorithm. Also, with computer-based technology, engineers can build custom, PC-based PID controllers capable of overcoming these limitations.


About the Author
Javier Gutirrez, Product Manager, National Instruments

No comments:

Post a Comment