Coder Social home page Coder Social logo

almadajack / ardupid-library Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tellicious/ardupid-library

0.0 0.0 0.0 43 KB

A PID Library for Arduino digitalized with the Tustin's method with Anti-Windup

License: GNU General Public License v3.0

C++ 100.00%

ardupid-library's Introduction

ArduPID

A PID Library for Arduino digitalized with the Tustin's method with Anti-Windup by Andrea Vivani ([email protected])

To install drag the ArduPID folder to your Arduino=>libraries folder and include "ArduPID.h" in your script

This libray has some major improvements over the already existing libraries:

  • The PID has been digitalized with Tustin's method, in order to maintain the avoid the risk of become unstable because of the digitalization itself (this can happen using forward Euler, mainly). The Tustin's method numerically computes the integral using the trapezoidal rule and preserves the continuous time stability. To have more informations about Tustin's method refer to http://en.wikipedia.org/wiki/Bilinear_transform;
  • The derivative is low-pass filtered, using this approximation D(s)=s/(1+s/N), this in order to have a causal transfer function and to avoid enormous/infinite values, that can happen using D(s)=s. As an example, using D(s)=s and forward Euler, the digital derivative is approximated to D(k)=(u(k)-u(k-1))/T, where T is the sampling time. As T gets smaller, the D(k) value tends to be too much dependant on numeric issues and it is likely to become infinite and to vary almost instantly;
  • There are three different classes: PID, PID_BC, PID_IC; the first one does not have any anti-windup method, the second uses the back-calculation algorithm while the third uses the integral clamping algorithm. Integral windup can happen when the output of the control hits a saturation: if when saturated the error decreases too slowly, the integrator still increases the control output, even if not effective, and then when the error gets towards zero the integral is still over-charged and needs some time to decharge, causing the output to have an undesired behaviour. Usually the integral clamping method performs better. To have more infos about the integral windup and anti-windup methods refer to:

THE AUTOCOMPUTE AND RESET FUNCTIONS HAVE NOT BEEN TESTED YET, ALL THE OTHERS ARE WORKING PERFECTLY FINE.

Feel free to report any issue you encounter.

This library is licensed under GPL v3.

Contact me if you need any help.

ardupid-library's People

Contributors

tellicious avatar per1234 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.