% Register points of interest for open- and closed-loop analysis
addPoint(ST0,{'Vcmd','iLoad','Vchip','Vin'});
We want to use an FIR filter as feedforward compensator. To do this, create a
parameterization of a first-order FIR filter and assign it to the "Feedforward FIR" block in
Simulink.
FIR = tunableTF('FIR',1,1,Tm);
% Fix denominator to z^n
FIR.Denominator.Value = [1 0];
FIR.Denominator.Free = false;
setBlockParam(ST0,'FIR',FIR);
Note that slTuner automatically parameterizes the feedback compensator as a third-
order state-space model (the order specified in the Simulink block). Next tune the
feedforward and feedback compensators with systune. Treat the damping and margin
requirements as hard constraints and try to best meet the remaining requirements.
rng(0)
topt = systuneOptions('RandomStart',6);
ST = systune(ST0,[Req1 Req2 Req3],[Req4 Req5],topt);
Final: Soft = 1.3, Hard = 0.97233, Iterations = 399
Final: Soft = 1.29, Hard = 0.94399, Iterations = 316
Final: Soft = 1.29, Hard = 0.99641, Iterations = 319
Final: Soft = 1.29, Hard = 0.99844, Iterations = 479
Final: Soft = 1.29, Hard = 0.95789, Iterations = 387
Final: Soft = 1.29, Hard = 0.99792, Iterations = 360
Final: Soft = 1.82, Hard = 0.99522, Iterations = 166
The best design satisfies the hard constraints (Hard less than 1) and nearly satisfies the
other constraints (Soft close to 1). Verify this graphically by plotting the tuned responses
for each requirement.
figure('Position',[10,10,1071,714])
viewGoal([Req1 Req2 Req3 Req4 Req5],ST)
Digital Control of Power Stage Voltage