36 lines
1.5 KiB
ReStructuredText
36 lines
1.5 KiB
ReStructuredText
.. _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 |