st = slTuner('scdcascade',{'C1','C2'});
Specify the tuning goals and necessary analysis points.
tg1 = TuningGoal.StepTracking('r','y1m',5);
addPoint(st,{'r','y1m'});
tg2 = TuningGoal.Poles();
tg2.MaxFrequency = 10;
Tune the controller.
[sttuned,fSoft] = systune(st,[tg1 tg2]);
Final: Soft = 1.28, Hard = -Inf, Iterations = 37
After validating the tuning results, update the model to use the tuned controller values.
writeBlockValue(sttuned);
Input Arguments
st — Interface for tuning control systems modeled in Simulink
slTuner interface
Interface for tuning control systems modeled in Simulink, specified as an slTuner
interface.
blockid — Blocks to update
character vector | string | cell array of character vectors | string array
Blocks to update with tuned values, specified as a:
- Character vector or string, to update one block.
- Cell array of character vectors or string array, to update multiple blocks.
The blocks in blockid must be in the TunedBlocks property of the slTuner interface
st. You can specify a full block path, or any portion of the block path that uniquely
identifies the block among the other tuned blocks of st.
Example: blk = {'scdcascade/C1','scdcascade/C2'}
writeBlockValue