Create An Auto Pid Tuning Algorithm

  

  1. Pid Tuning For Dummies
  2. Create An Auto Pid Tuning Algorithm Download
  3. Pid Algorithm Code
  4. Create An Auto Pid Tuning Algorithm Free

This project has been created to support tuning a PID controller for a home brewing setup using CraftBeerPI.It consists of a brewing kettle simulation, a PID controller (based on Arduino PID Library) and a PID autotune algorithm (based on Arduino PID Autotune Library)

Genetic: enable the user to control the genetic algorithm parameters such as: input: value of the input applied on the system. Min/max Kx: boundary values of each PID action. Evaluation time: system running time when evaluating fitness. Population size: size of the genetic algorithm's population. The MathWorks algorithm for tuning PID controllers helps you meet these objectives by automatically tuning the PID gains to balance performance (response time) and robustness (stability margins). By default, the algorithm chooses a crossover frequency (loop bandwidth) based upon the plant dynamics, and designs for a target phase margin of 60°.

Project goals

  • allow users to find PID parameters which provide a sufficient basis for further manual tuning
  • allow users to compare different PID parameters
  • help users to understand how different PID parameters (Kp, Ki, Kd) influence a PID controller's behavior (not only limited to home brewing setups)
  • speed up auto tuning

PID comparison

Compare different PID parameters using the default kettle setup:
sim.py --pid 'reference' 98 0.66 230 --pid 'Kp too low' 30 0.66 230 --pid 'Ki too low' 98 0.01 230

Pid Tuning For Dummies

PID autotune simulation

Simulate a PID autotune run on a 50l kettle with a 4 kW heater:
sim.py --atune --volume 50 --power 4

Create An Auto Pid Tuning Algorithm

Generated PID parameters using different tuning rules:

Create An Auto Pid Tuning Algorithm Download

Options

Pid Algorithm Code

  1. Install git and python3
  2. Clone this repository:
    git clone https://github.com/hirschmann/pid-autotune.git
  3. Install project dependencies:
    pip install matplotlib

Create An Auto Pid Tuning Algorithm Free

After you have completed these steps, you should be able to run sim.py as shown above. If plots are not shown, you have to configure the matplotlib backend, see What is a backend?