Controller Tuning with LOOPTUNE
You can also use looptune to tune control systems modeled in Simulink. The looptune
workflow is very similar to the systune workflow. One difference is that looptune needs
to know the boundary between the plant and controller, which is specified in terms of
controls and measurements signals. For a single loop the performance is essentially
captured by the response time, or equivalently by the open-loop crossover frequency.
Based on first-order characteristics the crossover frequency should exceed 1 rad/s for the
closed-loop response to settle in less than 5 seconds. You can therefore tune the PID loop
using 1 rad/s as target 0-dB crossover frequency.
% Mark the signal "u" as a point of interest
addPoint(ST0,'u')
% Tune the controller parameters
Control = 'u';
Measurement = 'Speed';
wc = 1;
ST1 = looptune(ST0,Control,Measurement,wc);
Final: Peak gain = 0.979, Iterations = 4
Achieved target gain value TargetGain=1.
Again the final value is close to 1, indicating that the target control bandwidth was
achieved. As with systune, use getIOTransfer to compute and plot the closed-loop
response from speed command to actual speed. The result is very similar to that obtained
with systune.
T0 = getIOTransfer(ST0,'Ref','Speed');
T1 = getIOTransfer(ST1,'Ref','Speed');
step(T0,T1)
legend('Initial','Tuned')
13 Control System Tuning Examples