The proportional-integral-derivative (PID) control structure is widely used but sometimes blindly applied and poorly understood. These two notebooks—with sample code and examples written in Python—provide a concise and systematic introduction to PID control. Students and practitioners in robotics are the intended audience, although the concepts are applicable more broadly.
The first notebook (Part I) provides a hands-on introduction to the feedback control of simple single-input, single-output (SISO) systems. What is perhaps unique about this notebook is that we introduce PID control solely in the time domain (i.e., without reliance on Laplace domain techniques), which is arguably more intuitive.
Let
where
This notebook (Part I) employs a simple 1D mobile robot example to illustrate the role that each term plays in the PID control structure.
- PID-101-Part1 (Jupyter notebook)
This second notebook introduces one practical way for choosing PID gains (i.e., tuning). The approach is particularly well suited to robotics applications where we usually want the tracking error for step inputs to be zero and we would like the closed-loop response to have high damping (i.e., avoids oscillations). Moreover, the technique allows for very easy tuning by a single parameter that merely selects the desired closed-loop bandwidth
A vehicle cruise control example and a DC motor speed control example are employed to show how to select and tune the derived controller design for first- and second-order systems, respectively.
- PID-101-Part2 (Jupyter notebook)
-
G. F. Franklin, J. D. Powell, and A. Emami-Naeini, Feedback Control of Dynamic Systems. Pearson Prentice Hall, 5th ed., 2006.
-
J. Doyle, B. Francis, and A. Tannenbaum, Feedback Control Theory. Macmillan Publishing Co., 1990.
-
R. Mukherji, MDR Controls Course: Time and Frequency Domain Methods for Continuous Systems, MDA Space Missions, Brampton, ON Canada, November 2003.
Joshua A. Marshall, PhD, PEng
Ingenuity Labs Research Institute
Queen's University
Mitchell Hall, Room 395
Kingston, ON K7L 3N6 Canada
Source code examples in this notebook are subject to an MIT License.