A Practical Guide to PID Controller Implementation
For engineers and practitioners implementing PID controllers, this guide offers a practical solution to common implementation pitfalls.
This paper addresses practical issues in PID controller implementation, such as actuator limitations and measurement noise, and provides a reference implementation with pseudo-code and simulation results.
How difficult can it be to implement a PID controller? The answer is twofold. Implementing the PID control law is simple and computationally inexpensive. However, this basic form will not work in practical applications. The primary reason for this is the various physical limitations of the actuator. Measurement noise, different implementations depending on the various structures (P, PI, PD or PID), bumpless transfer, and varying sampling time also result in problems rendering the basic form inoperable. PID implementation is therefore more difficult than meets the eye. This paper introduces a reference implementation of the PID controller which considers these practical issues. It includes pseudo-code, discussion of the implementation choices and simulation of carefully selected, important test cases.