A PID pendulum controller.


License
GPL-3.0
Install
pip install PID-pendulum==0.0.7

Documentation

PID pendulum controller

PyPI PyPI - Wheel Web App - Demo

Overview

This is a short description of the PID controlled pendulum project. The project illustrates several concepts of real-world PID controllers, that theoretical descriptions often disregard. At the moment this includes

  • bounded controller output
  • limited controller speed
  • controller measurement imprecision
  • incomplete system information

Additional features will be added in the future.

Build Sources and Documentation

Make sure to install the following dependencies with Python 3 (might require pip3 on your system) if you want to build documentation or use the web server:

  • pip install flask for the web app
  • pip install flake8 for linting
  • pip install sphinx for all documentation

You might also need:

  • LaTeX for creating PDF documentation

Then, run:

pip3 install PID-pendulum # install the PID_pendulum package
make # show a list of documentation formats, e.g. `make latexpdf` creates PDF docs

You can now import the pendulum in your code as follows:

from PID_pendulum.PID_control import Pendulum, PIDControl
# see documentation for pendulum and controller methods

The file debug.py contains examples for the usage of the Pendulum and AnimatedPendulum classes. To check basic features of the current build version, type make doctest.

Web API and Demonstration

An online demonstration of the PID pendulum controller implementation is available here. To run the web app locally though, type:

cd api
flask run # now, visit localhost:5000 in a web browser

If the webserver is running, API requests can be send to the route /api/v1. The following script demonstrates that:

cd utils
./req_api.sh # performs an API request with valid parameters
./req_api.sh err # performs an API request with invalid parameters

The API returns a json object with two arrays containing the function and support values that correspond to the user-provided arguments.

License

The code in this repository is GPL-3.0 licensed. html and css files are not distributed under any license if not stated otherwise in the files themselves.