{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains course material from [CBE30338](https://jckantor.github.io/CBE30338)\n", "by Jeffrey Kantor (jeff at nd.edu); the content is available [on Github](https://github.com/jckantor/CBE30338.git).\n", "The text is released under the [CC-BY-NC-ND-4.0 license](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode),\n", "and code is released under the [MIT license](https://opensource.org/licenses/MIT).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Modeling and Control of a Campus Outbreak of Coronavirus COVID-19](http://nbviewer.jupyter.org/github/jckantor/CBE30338/blob/master/notebooks/03.09-COVID-19.ipynb) | [Contents](toc.ipynb) | [Implementing PID Controllers with Python Yield Statement](http://nbviewer.jupyter.org/github/jckantor/CBE30338/blob/master/notebooks/04.01-Implementing_PID_Control_with_Python_Yield_Statement.ipynb) >

\"Open

\"Download\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# PID Control\n", "\n", "Proportional-Integral-Derivative (PID) control is a workhorse of modern engineering. Orginally developed in the 1920's for the automatic steering of ships, the technology eventually found its way to the process industries following publication of _Principles and Practice of Automatic Control_ for the British trade magazine _The Engineer_ in 1937. The publication of this paper kicked off a period of rapid innovation in which instrument makers developed the equipment to put these ideas into practice, and the process industries adopted these new technologies.\n", "\n", "In this series of notebooks we will review the basic formulations of PID control, issues that arise and how they are managed, and develop a basic implementation. Our goal here is to provide with the knowledge needed to understand the principles of PID control, how to put the technology to work, and how to recognize and troubleshoot issues arising in practice." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## PID Control Formulations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Non-interacting Form\n", "\n", "A typical mathematical formulation known as the **non-interacting form** of PID control can be written\n", "\n", "\\begin{align}\n", "MV & = \\overline{MV} + K_P \\left(SP - PV\\right) + K_I\\int_0^t (SP - PV)\\ dt' + K_D\\frac{d(SP - PV)}{dt}\n", "\\end{align}\n", "\n", "where we use the generic notation $MV$ to denote the manipulated variable, and $PV$ the process variable to be controlled to the desired setpoint value $SP$. $\\overline{MV}$ denotes a nominal or reference value of the manipulated variable. The remaining terms on the right hand side are prescription of how to adjust the manipulated variable in response to a deviation of the process variable for the desired setpoint value.\n", "\n", "In this formulation there are three coefficients, $K_P$, $K_I$, and $K_D$ denoting the relative contributions of the **proportional**, **integral**, and **derivative** terms to the control action. These constants can be adjusted to achieve a useful closed-loop dynamics." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### ISA Form\n", "\n", "Another commmon formulation (sometimes also called the **ideal**, or **additive* form) is given by\n", "\n", "\\begin{align}\n", "MV & = \\overline{MV} + K_c \\left[ \\left(SP - PV\\right) + \\frac{1}{\\tau_I}\\int_0^t (SP - PV)\\ dt' + \\tau_D\\frac{d(SP - PV)}{dt}\n", "\\right]\\end{align}\n", "\n", "For the purposes of control, this form has the same functionality of the non-interacting form but with a different set of parameters. The constant $K_c$ is called the **control gain**, $\\tau_I$ the **integral time constant**, and $\\tau_D$ the **derivative time constant**. \n", "\n", "Comparing these two forms of PID control shows they are identical under a conversion of parameters. Going from ISA to non-interacting form\n", "\n", "\\begin{align}\n", "K_P & = K_c \\\\\n", "K_I & = \\frac{K_c}{\\tau_I} \\\\\n", "K_D & = K_c\\tau_D\n", "\\end{align}\n", "\n", "or from non-interacting to ISA form\n", "\n", "\\begin{align}\n", "K_c & = K_P \\\\\n", "\\tau_I & = \\frac{K_P}{K_I} \\\\\n", "\\tau_D & = \\frac{K_D}{K_P}\n", "\\end{align}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Implementation\n", "\n", "In these notebooks we'll proceed through a series of PID control implementations. These are intended to demonstrate key features of the control algorithm, and issues that arise in practice. Since these implementations are for demonstration only, we'll keep them as simple and straightforward as possible." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Modeling and Control of a Campus Outbreak of Coronavirus COVID-19](http://nbviewer.jupyter.org/github/jckantor/CBE30338/blob/master/notebooks/03.09-COVID-19.ipynb) | [Contents](toc.ipynb) | [Implementing PID Controllers with Python Yield Statement](http://nbviewer.jupyter.org/github/jckantor/CBE30338/blob/master/notebooks/04.01-Implementing_PID_Control_with_Python_Yield_Statement.ipynb) >

\"Open

\"Download\"" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }