PID Controller

A PID is a method that comes from control engineering, the controller continuously determines the deviation between the current value of a process to be controlled and a specified setpoint. On the basis of this deviation three components are calculated and added up, the proportional part to the deviation Kp, the part to the change in relation to the past KI and the part to fast change KD. Through the interaction of these components, an actuating value is calculated, which in turn acts on the process to reduce the deviation. The simple-pid library is used in this project to simplify the implementation of the PID controller to regulate the boost converter output voltage to the specified setpoint.

In Listing a simple control loop is implemented, this controls the output voltage of the boost converter constantly to 25V. The controller is additionally limited at its output to the minimum and maximum duty cycle 0% to 70% of the boost converter.

Listing simple pid loop
device.pid.tunings = (1.82, 60.45, 0)
device.pid.output_limits = (0, 70)
device.pid.setpoint = 25.

while(True):
    device.getfilteredADC()
    device.calcADCData()
    duty = device.pid(device.voltage[1])
    device.setDutyCycle(duty)

The Ziegler-Nichols method of stability limit is a common method of adjusting PID controllers based on determining the critical gain and period at which the system is just at the limit of stability. In this process, the gain KP is gradually increased until the system begins to oscillate. The period of these oscillations is measured with an oscilloscope, which determines the time constant of the boost controller, here a critical gain of Ku=4.03 and a time constant of Tu=36ms is obtained.

In this project, a PI controller is initially chosen because the control deviation should be kept to a minimum and overshoot is undesirable. The parameters Kp=1.82 and Ki=60.45 for the PI controller are calculated according to pid parameter table. For further optimization, an ordinary PID controller and a controller without overshoot are also listed here.

Table PID parameters
Type Kp Ki Kd
PI 0.45Ku 0.54Ku/Tu -
classic PID 0.60Ku 1.20Ku/Tu 0.075KuTu
no overshoot 0.20Ku 0.40Ku/Tu 0.066KuTu

Copyright © 2023 Arne Christian Schmidt. Distributed by an CC BY-NC 4.0.