% Paper 2021 Vrancic/Huba: High-Order Filtered PID Controller Tuning Based
% on Magnitude Optimum; Mathematics 2021, 9, 1340, 24 pages;
% plant equation (18a):
Vs1a=1;
num1a=1;
den1a=conv([1 1],conv([1 1],conv([1 1],[1 1])));

TF=0.1; % filter in controller for realization <--> Simulink: TF=0.001 typ.
den_ad1=[TF  1];
den_ad2=conv(den_ad1,[TF  1]);   den_ad3=conv(den_ad2,[TF  1]);
den1a1=conv(den_ad1,den1a);
den1a2=conv(den_ad2,den1a);       den1a3=conv(den_ad3,den1a);

Ru3=bo_u_gen02(13,Vs1a,num1a,den1a1), % PID  undelayed [VR,TN,T0,TV,TQ,TT]
% for comparison paper table 2:
ParPap11=[1.295  1.295/0.438  1/0.438  1.041/1.295 0 0 ],
% for simulink:
Ru3zae=[Ru3(4)*Ru3(2)  Ru3(2)  1],
Ru3nen=conv(den_ad1,[Ru3(3)  0]),    % Ru3(3) = TR0 = integrator

Ru4=bo_u_gen02(14,Vs1a,num1a,den1a2), % PID2 undelayed [VR,TN,T0,TV,TQ,TT]
% for comparison paper table 2:
ParPap12=[2.911 2.911/0.812 1/0.812 3.599/2.911 1.556/2.911 0],
% for simulink:
Ru4zae=[Ru4(5)*Ru4(2)  Ru4(4)*Ru4(2)  Ru4(2)  1],
Ru4nen=conv(den_ad2,[Ru4(3)  0]),    % Ru4(3) = TR0 = integrator

Ru5=bo_u_gen02(15,Vs1a,num1a,den1a3), % PID3 undelayed [VR,TN,T0,TV,TQ,TT]
% for comparison paper table 2:
ParPap13=[7.252 7.252/1.810 1/1.810 11.008/7.252 7.417/7.252 1.883/7.252],
% for simulink:
Ru5zae=[Ru5(6)*Ru5(2)  Ru5(5)*Ru5(2)  Ru5(4)*Ru5(2)  Ru5(2)  1],
Ru5nen=conv(den_ad3,[Ru5(3)  0]),    % Ru5(3) = TR0 = integrator

