Creating TuningGoals for delay margin and multivariable margin.
Show older comments
I want to use systune to tune gains for my Simulink model, using the slTuner interface. I am trying to set up a non-smooth, multi-objective optimization problem that can be solved by systune. However, I am having a difficult time figuring out how to set up two of the hard constraints.
The optimization problem is stated as follows:
minimize 
subject to
< 
I think I have the soft constraints and first two hard constraints correctly implemented now, using TuningGoal.Variance. However, I have no idea how to properly set up the last two hard constraints. These are the dynamic margin (generalized delay margin) at δ and the multivarible module margin of δ. Where
is the complementary sensitivity function and
is the sensitivity function.
is the complementary sensitivity function and
is the sensitivity function.mdl = "TestVehicleModel";
open_system(mdl);
st0 = slTuner(mdl,"TuneGain");
Softreq1 = TuningGoal.Variance("u1","y1",1);
Softreq2 = TuningGoal.Variance("u2","y1",1);
Softreq3 = TuningGoal.Variance("u1","y2",1);
Softreq4 = TuningGoal.Variance("u2","y2",1);
Hardreq1 = TuningGoal.Variance("u1","y3",0.5);
Hardreq2 = TuningGoal.Variance("u2","y3",0.5);
[st, fSoft, gHard] = systune(st0,[Softreq1,Softreq2,Softreq3,Softreq4],[Hardreq1,Hardreq2]);
Can anyone help me with this? I know that it should be possible, as some researches have done it before in previous versions of MATLAB, probably 2018a.
Answers (1)
Ronit
on 24 Sep 2024
To handle the last two hard constraints related to the dynamic margin and multivariable module margin, you can use TuningGoal.Margins and TuningGoal.Loopshape.
- Dynamic Margin Constraint: TuningGoal.Margins can be used to impose constraints on the gain and phase margins. However, since you are interested in the generalized delay margin, you might need to use TuningGoal.Loopshape to indirectly enforce this by shaping the loop gain.
- Multivariable Module Margin Constraint: TuningGoal.Loopshape can be used to enforce a minimum loop gain, which can help ensure robustness.
mdl = "TestVehicleModel";
open_system(mdl);
st0 = slTuner(mdl, "TuneGain");
Softreq1 = TuningGoal.Variance("u1", "y1", 1);
Softreq2 = TuningGoal.Variance("u2", "y1", 1);
Softreq3 = TuningGoal.Variance("u1", "y2", 1);
Softreq4 = TuningGoal.Variance("u2", "y2", 1);
Hardreq1 = TuningGoal.Variance("u1", "y3", 0.5);
Hardreq2 = TuningGoal.Variance("u2", "y3", 0.5);
% Dynamic margin constraint: Adjust the frequency range and gain as needed.
tau_min = ...; % Define your tau_min value
DynamicMargin = TuningGoal.LoopShape("delta", 1/tau_min, 1);
% Multivariable module margin constraint
MultivarModuleMargin = TuningGoal.LoopShape("delta", 0.3, 1);
[st, fSoft, gHard] = systune(st0,[Softreq1,Softreq2,Softreq3,Softreq4],[Hardreq1,Hardreq2,DynamicMargin,MultivarModuleMargin]);
Ensure you adjust the parameters and frequency ranges according to your specific system requirements.
Please refer to the following MATLAB documentations for more information:
- TuningGoal.Margins: https://www.mathworks.com/help/control/ref/tuninggoal.margins.html
- TuningGoal.Loopshape: https://www.mathworks.com/help/control/ref/tuninggoal.loopshape.html
I hope it helps with your query!
2 Comments
Stijn
on 24 Sep 2024
Ronit
on 26 Sep 2024
Hi @Stijn
TuningGoal.Loopshape function in MATLAB can handle both types of constraints, minimum performance requirements and minimum roll-off requirements. Values less than "1" are interpreted as minimum roll-off requirements. They set an upper bound on the largest singular value of "L". This ensures that the system has sufficient roll-off and doesn't amplify noise excessively at high frequencies.
For the fourth hard constraint, where the minimum value is 0.3, you can still use TuningGoal.Loopshape. You need to specify a loop gain profile that reflects this requirement.
% Example gain profile
loopgain = makeweight(0.3, 1, 10);
MultivarModuleMargin = TuningGoal.LoopShape("delta", loopgain);
makeweight is a convenient way to specify target gain profiles. Please find the documentation link below:
Categories
Find more on Model Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!