%% Tuning parameters for the controllers
% Collecting the gains from the output of part 2
h_gain_q1 = 0.25;
cA_gain_q2 = 0.006089743589744;
% The delay in the transfer functions as shown in the report
theta11 = 0;
theta22 = 2/34;
% Determining the closed loop time constant, as explained in the report
tauc2 = theta22*25;
tauc1 = tauc2/5;
% Calculating Kc and tauI
Kc1 = (1/h_gain_q1)*(1/(tauc1+theta11));
tauI1 = 4*(tauc1+theta11);

% The transfer function G11:

s=tf('s');
G11 = 0.25/s;
c1 = Kc1*(tauI1*s+1)/((tauI1*s));

L1 = G11*c1;
%L=set(zpk(L1), 'DisplayFormat','time constant')
margin(L1)
