Then remove the SOF block from the tunable block list and re-parameterize the PI blocks
as full-blown PIDs with the correct loop signs (as inferred from the first design).PID = pid(0,0.001,0.001,.01); % initial guess for PID controllersremoveBlock(ST0,'SOF');
setBlockParam(ST0,...
'PI1',tunablePID('C1',PID),...
'PI2',tunablePID('C2',-PID),...
'PI3',tunablePID('C3',-PID));Re-tune the three PID controllers and plot the closed-loop step responses.ST2 = systune(ST0,AllReqs);Final: Soft = 4.94, Hard = -Inf, Iterations = 67T2 = getIOTransfer(ST2,{'theta-ref','phi-ref','r-ref'},{'theta','phi','r'});
figure, step(T2,5)13 Control System Tuning Examples