Giter Club home page Giter Club logo

pid-101's Introduction

PID 101 for Robotics

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.

Part I: Basics

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 $x(t)\in\mathbb{R}$ be the system state to be controlled and suppose that the control objective is to use the system input $u(t)\in\mathbb{R}$ to drive $x(t)\rightarrow x_{\rm d}$ as $t\rightarrow\infty$ with some desired transient performance. To this end, a PID controller takes the general form

$$u(t)=k_{{\rm P}}(x_{\textup{d}}-x(t)) + k_{{\rm I}}\int_0^t(x_{\textup{d}}-x(\tau))d\tau + k_{{\rm D}}\frac{\textup{d}}{\textup{d}t}(x_{\textup{d}}-x(t)),$$

where $k_{{\rm P}},k_{{\rm I}},k_{{\rm D}}\in\mathbb{R}$ are the proportional, integral, and derivative controller gains, respectively.

This notebook (Part I) employs a simple 1D mobile robot example to illustrate the role that each term plays in the PID control structure.

image

Main File (Part I)

Part II: Tuning

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 $\omega_{\textup{CL}}>0$ of the system.

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.

image

Main File (Part II)

References

  1. G. F. Franklin, J. D. Powell, and A. Emami-Naeini, Feedback Control of Dynamic Systems. Pearson Prentice Hall, 5th ed., 2006.

  2. J. Doyle, B. Francis, and A. Tannenbaum, Feedback Control Theory. Macmillan Publishing Co., 1990.

  3. R. Mukherji, MDR Controls Course: Time and Frequency Domain Methods for Continuous Systems, MDA Space Missions, Brampton, ON Canada, November 2003.

Contact the Author

Joshua A. Marshall, PhD, PEng
Ingenuity Labs Research Institute
Queen's University
Mitchell Hall, Room 395
Kingston, ON K7L 3N6 Canada

License

Source code examples in this notebook are subject to an MIT License.

pid-101's People

Contributors

botprof avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.