Start documentation of PID controller

This commit is contained in:
Mario Hüttel 2021-06-14 23:16:07 +02:00
parent 67932bf465
commit f4fcaf1e3a
4 changed files with 41 additions and 0 deletions

3
doc/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"restructuredtext.confPath": "${workspaceFolder}/source"
}

View File

@ -11,6 +11,7 @@ mechanisms and the behavior. For a detailed code documentation see the doxygen o
:maxdepth: 2
pt1000-processing
pid-controller
safety/index
code/index

View File

@ -0,0 +1,36 @@
.. _pid_controller:
PID Controller
==============
The PID controller is the main element of the oven. It controls the output of the solid state relais in order to achieve the desired temperature.
The PID controller is implemented in the ``pid-controller.c`` file. See the :ref:`pid_code_api` for details.
Functional Description
----------------------
The following figure shows the PID controller's structure.
.. drawio-image:: pid.drawio
The controller is composed of 3 paths. The proportional, the derivate, and the integrator path.
Compared to a textbook PID controller, this version contains a few additional features.
The integrator has a configurable maximum limit of :c:var:`pid_controller.integral_max`. Once this value is reached (plus or minus), the integrator freezes.
The integrator is also frozen in case the output value is in saturation. This serves as an anti-windup protection.
The output value saturates at configurable high and low limits (:c:var:`pid_controller.output_sat_max` and :c:var:`pid_controller.output_sat_min`). The controller instance used for the
reflow oven's solid state relais output is saturated by software to a limit of 0 to 100.
In addition to the above features, the derivate term contains an additional first order low pass filter in order to prevent coupling of high frequency noise amplified by the derivate term.
The low pass filter is charcterized by its time constant :math:`k_{d\tau}`.
.. _pid_code_api:
PID Controller Code API
-----------------------
.. doxygengroup:: pid-controller
:project: Reflow Controller Firmware

View File

@ -0,0 +1 @@
<mxfile host="Electron" modified="2021-06-14T21:01:35.428Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/14.1.8 Chrome/87.0.4280.88 Electron/11.1.1 Safari/537.36" etag="ORruDkFRflEPSgIrI-Cx" version="14.1.8" type="device"><diagram name="Page-1" id="b520641d-4fe3-3701-9064-5fc419738815">3Vttb6M4EP41+dgIMObl4/bl7lba1VXqSbt3XyonOMRX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