%this script calculates the closed loop model and the belonging tuning %parameters % Belonging files: P3_closedloop_3f.txt and P3_closedloop_3_plot.m clear all close all clc %% make_plot_P4_Kc2_5_41 %From the experiment: Kc0=2.5; %absolute value %data read from figure 5 dys=2; tp=192-175; yp=abs(28.5-30.5); %yu=abs(28-29.4); %calc dss_inf= abs(30.5-30.5); %dss2= 0.45*(yp+yu); Overshoot= (yp-dss_inf)/dss_inf; ss_offset= abs((dys-dss_inf)/dss_inf); A=1.152*Overshoot^2 - 1.607*Overshoot + 1; r= 2*A/ss_offset; %model param k=1/(Kc0*ss_offset); theta=tp*(0.309+0.209*exp(-0.61*r)); tau1=r*theta; %plotting the model % s=tf('s'); % G=(k*exp(-theta*s))/(tau1*s+1); % x=0:0.25:100; % output=42+step(-5*30*G,x); % hold on % plot(x+100,output,'g') %tunings Kc= 1/k*(tau1/(2*theta)) tauI=min(tau1,4*(theta*2))/60