Tune PID Controller in Real Time Using Open-Loop PID
Autotuner Block
This example shows how to use Open-Loop PID Autotuner block to tune a PI controller of
an engine speed control system in both simulation and real time.
Introduction of Open-Loop PID Autotuner Block
Open-Loop PID Autotuner block allows you to tune a single-loop PID controller in real
time. It carries out an open-loop experiment that injects perturbation signals to the plant
and computes PID gains based on the plant frequency responses estimated near the
desired bandwidth.
The Open-Loop PID Autotuner block supports two typical PID tuning scenarios in real
time applications:
(1) Deploy the block on hardware and use it in a stand-alone real time application,
without the presence of Simulink.
(2) Deploy the block on hardware but monitor and manage the real time tuning process in
Simulink, using the external mode. External mode allows communication between the
Simulink block diagram running on the host computer and the generated code running on
the hardware.
This example focuses on the second scenario, where the Open-Loop PID Autotuner block
is used to tune an engine speed control system in real time using the external mode.
Tuning Engine Speed Controller
The Simulink model contains a PID block, an Open-Loop PID Autotuner block and an
engine model.
mdl = 'scdspeedctrlOnlinePIDTuning';
open_system(mdl);
Tune PID Controller in Real Time Using Open-Loop PID Autotuner Block