Implement Gain-Scheduled PID Controllers
This example shows how to implement gain-scheduled control in a Simulink model using a
family of PID controllers. The PID controllers are tuned for a series of steady-state
operating points of the plant, which is highly nonlinear.
This example builds on the work done in “Design Family of PID Controllers for Multiple
Operating Points” on page 7-192. In that example, the continuous stirred tank reactor
(CSTR) plant model is linearized at steady-state operating points that have output
concentrations C = 2, 3, ..., 8, 9. The nonlinearity in the CSTR plant yields different
linearized dynamics at different output concentrations. The example uses the pidtune
command to generate and tune a separate PID controller for each output concentration.
You can expect each controller to perform well in a small operating range around its
corresponding output concentration. This example shows how to use the PID Controller
block to implement all of these controllers in a gain-scheduled configuration. In such a
configuration, the PID gains change as the output concentration changes. This
configuration ensures good PID control at any output concentration within the operating
range of the control system.
Begin with the controllers generated in “Design Family of PID Controllers for Multiple
Operating Points” on page 7-192. If these controllers are not already in the MATLAB
workspace, load them from the data file PIDGainSchedExample.mat.
load PIDGainSchedExample
This operation puts two variables in the MATLAB workspace, Controllers and C. The
model array Controllers contains eight pid models, each tuned for one output
concentration in the vector C.
To implement these controllers in a gain-scheduled configuration, create lookup tables
that associate each output concentration with the corresponding set of PID gains. The
Simulink model PIDGainSchedCSTRExampleModel contains such lookup tables,
configured to provide gain-scheduled control for the CSTR plant. Open this model.
open_system('PIDGainSchedCSTRExampleModel')