D = tunableGain('Decoupler',eye(2));
D.InputName = 'e';
D.OutputName = {'pL','pV'};
PI_L = tunablePID('PI_L','pi');
PI_L.InputName = 'pL';
PI_L.OutputName = 'qL';
PI_V = tunablePID('PI_V','pi');
PI_V.InputName = 'pV';
PI_V.OutputName = 'qV';
sum1 = sumblk('e = r - y',2);
The control system includes several tunable control elements. PI_L and PI_V are tunable
PI controllers. These elements represented by tunablePID models. The fixed control
structure also includes a decoupling gain matrix D, represented by a tunable
tunableGain model. When the control system is tuned, D ensures that each output of G
tracks the corresponding reference signal r with minimal crosstalk.
Assigning InputName and OutputName values to these control elements allows you to
interconnect them to create a tunable model of the entire controller C as shown.
When you tune the control system, looptune uses these channel names to interconnect C
and G. The controller C also includes the summing junction sum1. This a two-channel
summing junction, because r and y are vector-valued signals of dimension 2.
Connect the controller components.
C0 = connect(PI_L,PI_V,D,sum1,{'r','y'},{'qL','qV'});
C0 is a tunable genss model that represents the entire controller structure. C0 stores the
tunable controller parameters and contains the initial values of those parameters.
Tune the control system.
The inputs to looptune are G and C0, the plant and initial controller models that you
created. The input wc = [0.1,1] sets the target range for the loop bandwidth. This
Tune MIMO Control System for Specified Bandwidth