%anti_windup_demo %Uses HD model num=3e6; den=[1 157.0796 0]; %Only proportional gain P=0.036;I=0;S=inf;f=0; %Run and observe/quantify effect of pulsed disturbance %Add integral gain I=0.5; %Run and observe quick recovery from disturbance %Observe additional demand on control input %Add saturation level S=0.003; %Run and observe windup phenomenon: uunsat winds up %Add anti-windup gain f=100; %Run and observe shorter time spent under saturation %Observe clamping of uunsat to saturation value. %In the presence of saturation and disturbance, is it better to use %I-action + antiwindup or just I=0? %Simulate using I=0, S=0.008 and compare to last plot.