In this example, it takes the PID controller about 0.04 seconds to bring the boost
converter to the nominal operating point. Strong oscillation is observed in the initial
transient, which indicates that the existing controller needs to be re-tuned.
At 0.04 seconds, the autotuning process starts. The experiment lasts 0.02 seconds,
because it typically takes about "200/bandwidth" seconds for the online frequency
response estimation to converge.
When PID tuning stops at 0.06 seconds, the block calculates new gains, P = 0.04, I =
100, D = 0.00006 and N = 30000. The new gains are immediately written to the data
store memory and sent to the external gain inports of the PID block, overwriting the
original gains.
The model has a line disturbance (Vin from 5V to 10V) and a load current disturbance
(Load from 6A to 3A). They occur at 0.07 second and 0.08 second respectively, and you
can use them to examine controller performance. The new set of PID gains provides an
improved closed-loop response with much less oscillation.
Using Autotuner Block in Stand-Alone Application
To tune a PID controller against a physical boost converter in a stand-alone real-time
application, you need to generate C/C++ code from the Closed-Loop PID Autotuner block
and deploy it on your hardware.
Here is a list of tunable parameters that you can change at run-time:
- PID Type
- PID Form
- PID Integrator and Filter Methods (discrete-time only)
- Target Bandwidth
- Target Phase Margin
- Plant Type
- Plant Sign
- Amplitudes of sine waves
Sample time of the Closed-Loop PID Autotuner block is not a tunable parameter. To use
the autotuner block with different sample time without re-compilation, set the Controller
Tune PID Controller in Real Time Using Closed-Loop PID Autotuner Block