2018-10-07 22:07:21 +02:00
|
|
|
function [K] = generateDiagPidControl(G, fs)
|
|
|
|
%%
|
|
|
|
pid_opts = pidtuneOptions(...
|
|
|
|
'PhaseMargin', 50, ...
|
|
|
|
'DesignFocus', 'disturbance-rejection');
|
|
|
|
|
|
|
|
%%
|
|
|
|
K = tf(zeros(6));
|
|
|
|
|
2018-10-30 14:37:19 +01:00
|
|
|
for i = 1:6
|
2018-10-07 22:07:21 +02:00
|
|
|
input_name = G.InputName(i);
|
|
|
|
output_name = G.OutputName(i);
|
|
|
|
K(i, i) = tf(pidtune(minreal(G(output_name, input_name)), 'PIDF', 2*pi*fs, pid_opts));
|
|
|
|
end
|
|
|
|
|
|
|
|
K.InputName = G.OutputName;
|
|
|
|
K.OutputName = G.InputName;
|
|
|
|
end
|