first optimized parameters with pole pülacement: TODO: check for resonance compensator

This commit is contained in:
2019-03-01 16:56:55 +01:00
parent 842dc87860
commit cb4e0eea01
4 changed files with 127 additions and 60 deletions

View File

@@ -9,23 +9,28 @@ function DeltaTauOptimizer()
if isempty(mot)
mot=identifyFxFyStage(7);
end
%SIM1=[1 1; 1 2; 8 2; 9 2];
%SIM1=[1 1; 1 2; 8 2; 9 2;9 3];
%SIM2=[1 1; 1 2; 8 2; 9 2];
SIM1=[10 0;7 3];
SIM1=[10 0];
%SIM2=[9 0];
if 1 || isempty(simData1)
SIM1=[9 1; 9 2; 9 3; 9 4];
SIM2=[9 1; 9 2; 9 3; 9 4];
%SIM2=[8 1; 8 2; 8 3; 8 4];
%SIM2=[8 1; 8 2; 9 1; 9 2];
%SIM2=[8 2; 9 2;8 3; 9 3];
%SIM2=[8 3; 9 3;8 4; 9 4];
%SIM2=[9 4;9 0];
%SIM2=[8 3; 9 3];
if isempty(simData1)
close all;
simData1=ExecSim(mot{1},SIM1);
end
%if isempty(simData2)
% close all;
% simData2=ExecSim(mot{2},SIM2);
%end
if isempty(simData2)
close all;
simData2=ExecSim(mot{2},SIM2);
end
close all;
%test()
bodeSim(simData1);
%bodeSim(simData2);
bodeSim(simData2);
end
function test()
@@ -37,7 +42,15 @@ function test()
%pb.C=[1 -1.3236 6.2472 -11.8555 11.3067 -5.4188 1.0440];
%pb.D=[1.0000 -6.6330 17.6945 -24.5314 18.7409 -7.5020 1.2309];
global tfs
tfz=c2d(tf(tfs),1/5000)
Ts=1/5000;
frq0=55;d0=.5;
frq1=85;d1=.5;
w0=frq0*2*pi;
w1=frq1*2*pi;
tf0=tf([w0^2],[1 2*d0*w0 w0^2 ])
tf1=tf([1 2*d1*w1 w1^2 ],[w1^2])
tfs=tf0*tf1
tfz=c2d(tfs,Ts)
h=bodeplot(tfz,tfs);setoptions(h,'FreqUnits','Hz','Grid','on');
pb.C=tfz.Numerator{1};
pb.D=tfz.Denominator{1};
@@ -59,26 +72,7 @@ function test()
% tfz=c2d(tfs,1/5000)
% h=bodeplot(tfs,tfz)
% setoptions(h,'FreqUnits','Hz','Grid','on');
%C=num=0 -1.3236 6.2472 -11.8555 11.3067 -5.4188 1.0440
%D=den=1.0000 -6.6330 17.6945 -24.5314 18.7409 -7.5020 1.2309
% controlSystemDesigner('bode',1,tf(1,1))
% controlSystemDesigner( 1/simData2(2).tfEst2)
% controlSystemDesigner(tfa)
%C =
% 1035.3 (s+217.8)
% -------------------
% (s+845.3) (s+266.8)
% 0.18956 (z-0.9574)
% --------------------
% (z-0.948) (z-0.8444)
% 0.1896 z - 0.1815
% ----------------------
% z^2 - 1.792 z + 0.8006
% controlSystemDesigner(tfa)
end
@@ -132,5 +126,6 @@ function simData=bodeSim(simData)
grid(ax1,'on');grid(ax2,'on');
set(ax1, 'XScale', 'log');
set(ax2, 'XScale', 'log');
linkaxes([ax1,ax2],'x')
legend('Location','best');
end