toward optimized cotroller parameters

This commit is contained in:
2019-02-18 10:51:31 +01:00
parent f1b91f068f
commit db8640997a
7 changed files with 51 additions and 4 deletions

View File

@@ -270,6 +270,29 @@ function motCell=identifyFxFyStage(mode)
mot.ss_q.Name='simplified mechanics, no current loop, no resonance';
chkCtrlObsv(mot.ss_q,'ss_q fyStage');
% TESTS
% u +-----------+ y
%iqCmd------->|1 1|-------> iqMeas
% | 2|-------> actVel
% | 3|-------> actPos
% +-----------+
s=tfq.InputName{1};tfq.InputName{1}='iqMeas';
mot.ss_cq=connect(tfc,tfq,'iqCmd',{'iqMeas','actVel','actPos'});
mot.ss_cq.Name='simplified mechanics, current loop, no resonance';
tfq.InputName{1}=s;%restore
% TESTS
% u +-----------+ y
%iqCmd------->|1 1|-------> actVel
% | 2|-------> actPos
% +-----------+
s=tf1.InputName{1};tf1.InputName{1}='iqCmd';
mot.ss_qr=connect(tfq,tf1,'iqCmd',{'actVel','actPos'});
mot.ss_qr.Name='simplified mechanics, no current loop, resonance';
tfp.InputName{1}=s;%restore
%h=bodeplot(mot.meas,'r',mot.tf4_2,'b',mot.tf6_4,'g');
%h=bodeplot(mot.meas,'r',mot.tf2_0,'b',mot.tf_mdl,'g',mot.w);
plotBode(mot)

Binary file not shown.

Binary file not shown.

View File

@@ -13,12 +13,20 @@ function [pb]=simFxFyStage(mot)
if mot.id==1
%!motor_servo(mot=1,ctrl='ServoCtrl',Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000)
%!motor(mot=1,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=5,IpfGain=8,IpbGain=8,JogSpeed=10.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./81250,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=200,WarnFeLimit=100,InPosBand=2,homing='enc-index')
pb.Kp=25;pb.Kvfb=400;pb.Ki=0.02;pb.Kvff=350;pb.Kaff=5000;pb.MaxInt=1000;
%pb.Kp=25;pb.Kvfb=400;pb.Ki=0.02;pb.Kvff=350;pb.Kaff=5000;pb.MaxInt=1000;
pb.Kp=25;pb.Kvfb=350;pb.Ki=0.02;pb.Kvff=350;pb.Kaff=1/(1.548e04*(pb.Ts^2));pb.MaxInt=1000;
%19.8Hz 0dB K=(19.8*2*np.pi)**2=15477.1 Ts=5kHz=.2ms
%Kaff = 1/(Ts*Ts*K) = 1/((19.8*2*np.pi)**2/5000**2) = 1615.2877200403302
%Kfff=100
else
%!motor_servo(mot=2,ctrl='ServoCtrl',Kp=22,Kvfb=350,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000)
%!motor(mot=2,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=5,IpfGain=8,IpbGain=8,JogSpeed=10.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./81250,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=200,WarnFeLimit=100,InPosBand=2,homing='enc-index')
%Kp=22;Kvfb=350;Ki=0.02;Kvff=240;Kaff=1500;MaxInt=1000;
pb.Kp=22;pb.Kvfb=350;pb.Ki=0.02;pb.Kvff=240;pb.Kaff=3500;pb.MaxInt=1000;
%11.84Hz 0dB K=(11.84*2*np.pi)**2=5534.3 Ts=5kHz=.2ms
%Kaff = 1/(Ts*Ts*K) = 1/((11.84*2*np.pi)**2/5000**2) = 4517.278506241803
%Kfff=100
end
pb.ss_plt=mot.ss_plt; pb.sel={3,[3]};
%pb.ss_plt=mot.ss_plt0; pb.sel={3,[3]};
@@ -26,6 +34,7 @@ function [pb]=simFxFyStage(mot)
%pb.ss_plt=mot.ss_d1; pb.sel={3,[3]};
%pb.ss_plt=mot.ss_1; pb.sel={2,[2]};
%pb.ss_plt=mot.ss_p; pb.sel={2,[2]};
%pb.ss_plt=mot.ss_q; pb.sel={2,[2]};
%mdlName='stage_closed_loop';
%open(mdlName)

Binary file not shown.