The tuned response has significantly less overshoot and satisfies the response time
requirement. However these simulations are obtained using a continuous-time lead/lag
compensator (looptune operates in continuous time) so we need to further validate the
design in Simulink using a digital implementation of the lead/lag compensator. Use
writeBlockValue to apply the tuned values to the Simulink model and automatically
discretize the lead/lag compensator to the rate specified in Simulink.
writeBlockValue(ST1)
You can now simulate the response of the continuous-time plant with the digital
controller:
sim('rct_dmc'); % angular position logged in "yout" variable
t = yout.time;
12 Loop-Shaping Design