Git Product home page Git Product logo

pid-controller-python's Introduction

PID controller in Python

Implementation of a simple PID controller in Python

A PID (Proportional-Integral-Derivative) controller is a control loop mechanism widely used in industrial control systems. It calculates an error value as the difference between a desired setpoint (SP) and a measured process variable (PV) and applies a correction based on proportional, integral, and derivative terms.

  • The Proportional component computes an output proportional to the error $P_{\text{out}} = K_p \times \text{Error}$, where $K_p$ is the proportional gain and Error is $\text{SP} - \text{PV}$.
  • The Integral component sums the error over time and multiplies it by the integral gain $I_{\text{out}} = K_i \times \int \text{Error} , dt$, with $K_i$ being the integral gain. This addresses any cumulative offset that the proportional component alone cannot eliminate.
  • The Derivative component calculates the rate of change of the error, multiplying it by the derivative gain $D_{\text{out}} = K_d \times \frac{d(\text{Error})}{dt}$, where $K_d$ is the derivative gain. This anticipates future error and applies a corrective action beforehand, enhancing system stability and response time.

The total output of the PID controller is the sum of these three components: $\text{Output} = P_{\text{out}} + I_{\text{out}} + D_{\text{out}} $.

Figure_1

pid-controller-python's People

Contributors

w-wojtak avatar

Watchers

 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.