calibrating 5Cam in ID lab

This commit is contained in:
2018-05-29 14:38:58 +02:00
parent c889da80aa
commit db8e9e8636
6 changed files with 119 additions and 54 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ usralgo.mod.c
*o.cmd
Module.symvers
modules.order
python/images/

View File

@@ -853,6 +853,48 @@ open plc 0
if (Motor[5].ActPos-Motor[5].HomePos>180000)
Motor[5].HomePos=Motor[5].HomePos+360000
disable plc 0
close plc 0```
close plc 0
enable plc 0
```
29.5.18 Calibration ID Lab
--------------------------
```
PPMAC=MOTTEST-CPPM-CRM0515
ssh root@$PPMAC
cd /ioc/SAR-CPPM-EXPMX3
iocsh startup.script
dbl
export EPICS_CA_ADDR_LIST=$PPMAC
caQtDM -macro 'P=SAR-EXPMX' ESB_MX_exp
caQtDM -macro 'P=SAR-EXPMX' ESB_MX_5cam
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX
PBInspect --host $PPMAC --cfg PBInspect2.pbi
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg
gpasciiCommander --host $PPMAC -i
$$$***
!common()
!SAR-EXPMX3()
caput SAR-EXPMX3:ASYN.AOUT '&1;#1..5j/;cpx call 15'
caput SAR-EXPMX3:ASYN.AOUT '&1;cpx jog1..5=000;call 16'
caput SAR-EXPMX3:ASYN.AOUT '&1;#1..5j/;cpx call 15'
caput SAR-EXPMX3:ASYN.AOUT '&1;cpx jog1..5=10000;call 16'
caput SAR-EXPMX3:ASYN.AOUT cpx call 16
caput SAR-EXPMX3:ASYN.AOUT cpx call 15
caput SAR-EXPMX3:ASYN.debug cpx call 16
caput SAR-EXPMX3:ASYN.debug0 cpx call 16
#1..5p
-204709.6252433953 -242008.2092276345 -269883.2702626893 -124867.8588862641 -189315.0329582951
```

View File

@@ -56,17 +56,19 @@ Motor[4].MaxSpeed=Motor[4].JogSpeed
Motor[5].MaxSpeed=Motor[5].JogSpeed
open forward
define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5')
//define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5')
define(AA1='L2',AA2='L1',AA3='L4',AA4='L5',AA5='L3')
define(r='L6',scl='L7')
define(S1='L11',S2='L12',S3='L13',S4='L14',S5='L15')
define(X='C6',Y='C7',U='C3',V='C4',W='C5')
r=$height/$width
scl=$exc/$sqrt2
S1=scl*sin(AA1*$camSf)
S2=scl*sin(AA2*$camSf)
S3=scl*sin(AA3*$camSf)
S4=scl*sin(AA4*$camSf)
S5=scl*sin(AA5*$camSf)
S1=scl*cos(AA1*$camSf)
S2=scl*cos(AA2*$camSf)
S3=scl*cos(AA3*$camSf)
S4=scl*cos(AA4*$camSf)
S5=scl*cos(AA5*$camSf)
//send 1"fwd_inp(%f) %f %f %f %f %f\\n",D0,AA1,AA2,AA3,AA4,AA5
//send 1"fwd_inp(%f) %f %f %f %f %f\\n",D0,S1,S2,S3,S4,S5
@@ -85,7 +87,8 @@ open forward
close
open inverse
define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5')
//define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5')
define(AA1='L2',AA2='L1',AA3='L4',AA4='L5',AA5='L3')
define(r='L6',scl='L7')
define(S1='L11',S2='L12',S3='L13',S4='L14',S5='L15')
define(X='C6',Y='C7',U='C3',V='C4',W='C5')
@@ -104,11 +107,11 @@ open inverse
S5= .5*$sqrt2*Y -.25*$sqrt2*U +.25*$sqrt2*W
scl=$sqrt2/$exc
AA1=asin(S1*scl)/$camSf
AA2=asin(S2*scl)/$camSf
AA3=asin(S3*scl)/$camSf
AA4=asin(S4*scl)/$camSf
AA5=asin(S5*scl)/$camSf
AA1=acos(S1*scl)/$camSf
AA2=acos(S2*scl)/$camSf
AA3=acos(S3*scl)/$camSf
AA4=acos(S4*scl)/$camSf
AA5=acos(S5*scl)/$camSf
//send 1"inv_res %f %f %f %f %f\\n",AA1,AA2,AA3,AA4,AA5

View File

@@ -7,25 +7,25 @@
//#4: homeoffset: -87830.7554146
//#5: homeoffset: -47956.2759182
!encoder_ssi(enc=1,numBits=18,posSf=-5625./4096.)
//!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!encoder_ssi(enc=1,numBits=18,posSf=-5625./4096)
//!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=65477.)
!encoder_ssi(enc=2,numBits=18,posSf=-5625./4096.)
//!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!encoder_ssi(enc=2,numBits=18,posSf=-5625./4096)
//!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-154370.)
!encoder_ssi(enc=3,numBits=18,posSf=-5625./4096.)
//!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!encoder_ssi(enc=3,numBits=18,posSf=-5625./4096)
//!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-5248.)
!encoder_ssi(enc=4,numBits=18,posSf=-5625./4096.)
//!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!encoder_ssi(enc=4,numBits=18,posSf=-5625./4096)
//!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-46620.)
!encoder_ssi(enc=5,numBits=18,posSf=-5625./4096.)
//!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!encoder_ssi(enc=5,numBits=18,posSf=-5625./4096)
//!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,Pos2Sf=0,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.)
!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=93168.)
define(SP_RelBrk='15',SP_LockBrk='16')

View File

@@ -4,11 +4,19 @@
//!MX3_home()
//using 360000 for 1 rev. -> 1.7453292519943296e-05=np.pi/180000
//excentricity= 5mm
//height = 2mm ?
//width = 50cm ?
//length = 100cm ?
!MX3_coordTrf(exc=5000,height=2000,width=500000,length=1000000,camSf=1.7453292519943296e-05)
//height = 90+28mm = 118
//width = (450+305)/2=377.5
//length = 600mm
!MX3_coordTrf(exc=5000,height=118000,width=377500,length=600000,camSf=1.7453292519943296e-05)
//Motor 1 -> AA2
//Motor 2 -> AA1
//Motor 3 -> AA5
//Motor 4 -> AA3
//Motor 5 -> AA4
// define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5')
// define(AA1='L2',AA2='L1',AA3='L4',AA4='L5',AA5='L3')
Coord[1].Ta=10
Coord[1].Td=10
@@ -16,8 +24,6 @@ Coord[1].AltFeedRate=1000
Coord[1].Tm=-10000 //1000um/FeedTime -> 1mm/sec
Coord[1].FeedTime=1000 //default value 1000um
//motor current off (as cpxcall 16)
Motor[1].IdCmd=0;Motor[1].InPosBand=10
Motor[2].IdCmd=0;Motor[2].InPosBand=10
@@ -25,22 +31,28 @@ Motor[3].IdCmd=0;Motor[3].InPosBand=10
Motor[4].IdCmd=0;Motor[4].InPosBand=10
Motor[5].IdCmd=0;Motor[5].InPosBand=10
#1..5hmz
#1..5j/
//#1..5hmz
//#1..5j/
&1
//initialization code
open plc 0
if (Motor[1].ActPos-Motor[1].HomePos>180000)
Motor[1].HomePos=Motor[1].HomePos+360000
if (Motor[2].ActPos-Motor[2].HomePos>180000)
Motor[2].HomePos=Motor[2].HomePos+360000
if (Motor[3].ActPos-Motor[3].HomePos>180000)
Motor[3].HomePos=Motor[3].HomePos+360000
if (Motor[4].ActPos-Motor[4].HomePos>180000)
Motor[4].HomePos=Motor[4].HomePos+360000
if (Motor[5].ActPos-Motor[5].HomePos>180000)
Motor[5].HomePos=Motor[5].HomePos+360000
homez1..5
L0 = Sys.RunTime + .1
while (Sys.RunTime < L0){} //wait .1 sec
jog/1..5
while (Sys.RunTime < L0){} //wait .1 sec
if (Motor[1].ActPos-Motor[1].HomePos<-180000)
Motor[1].HomePos=Motor[1].HomePos-360000
if (Motor[2].ActPos-Motor[2].HomePos<-180000)
Motor[2].HomePos=Motor[2].HomePos-360000
if (Motor[3].ActPos-Motor[3].HomePos<-180000)
Motor[3].HomePos=Motor[3].HomePos-360000
if (Motor[4].ActPos-Motor[4].HomePos<-180000)
Motor[4].HomePos=Motor[4].HomePos-360000
if (Motor[5].ActPos-Motor[5].HomePos<-180000)
Motor[5].HomePos=Motor[5].HomePos-360000
disable plc 0
close // plc 0

View File

@@ -62,18 +62,25 @@ def plot():
&1;b14r
&1;b15r
'''
data1=[0,-.475,-1.123,-1.916,-2.819,-3.797,-4.799,-5.786,-6.708,-7.531,-8.219,-8.746,-9.085,-9.229,-9.176,-8.929,-8.499,-7.895,-7.142,-6.271,-5.320,-4.325,-3.329,-2.377,-1.513,-.780,-.216,.151,.305,.241]
data2=[0,1.04,2.092,3.108,4.041,4.847,5.496,5.946,6.184,6.196,5.976,5.540,4.907,4.110,3.181,2.162,1.103,0.051,-.953,-1.859,-2.639,-3.252,-3.677,-3.892,-3.893,-3.677,-3.256,-2.648,-1.878,-.980]
data3=[0,.296,0.785,1.445,2.248,3.160,4.146,5.165,6.170,7.120,7.968,8.676,9.210,9.541,9.660,9.564,9.274,8.807,8.154,7.340,6.398,5.378,4.318,3.271,2.310,1.485,.790,.282,-.028,-.130,]
data4=[0,-1.035,-2.021,-2.930,-3.713,-4.333,-4.777,-5.018,-5.057,-4.888,-4.522,-3.967,-3.249,-2.393,-1.430,-0.402,.650,1.678,2.633,3.470,4.146,4.626,4.887,4.916,4.711,4.297,3.69,2.917,2.010,1.021]
data5=[0,-.847,-1.786,-2.794,-3.815,-4.808,-5.727,-6.537,-7.194,-7.681,-7.987,-8.089,-7.990,-7.688,-7.204,-6.547,-5.745,-4.831,-3.840,-2.814,-1.799,-.844,0.015,.726,1.257,1.58,1.683,1.562,1.223,.685]
#data1=[0,-.475,-1.123,-1.916,-2.819,-3.797,-4.799,-5.786,-6.708,-7.531,-8.219,-8.746,-9.085,-9.229,-9.176,-8.929,-8.499,-7.895,-7.142,-6.271,-5.320,-4.325,-3.329,-2.377,-1.513,-.780,-.216,.151,.305,.241]
#data2=[0,1.04,2.092,3.108,4.041,4.847,5.496,5.946,6.184,6.196,5.976,5.540,4.907,4.110,3.181,2.162,1.103,0.051,-.953,-1.859,-2.639,-3.252,-3.677,-3.892,-3.893,-3.677,-3.256,-2.648,-1.878,-.980]
#data3=[0,.296,0.785,1.445,2.248,3.160,4.146,5.165,6.170,7.120,7.968,8.676,9.210,9.541,9.660,9.564,9.274,8.807,8.154,7.340,6.398,5.378,4.318,3.271,2.310,1.485,.790,.282,-.028,-.130,]
#data4=[0,-1.035,-2.021,-2.930,-3.713,-4.333,-4.777,-5.018,-5.057,-4.888,-4.522,-3.967,-3.249,-2.393,-1.430,-0.402,.650,1.678,2.633,3.470,4.146,4.626,4.887,4.916,4.711,4.297,3.69,2.917,2.010,1.021]
#data5=[0,-.847,-1.786,-2.794,-3.815,-4.808,-5.727,-6.537,-7.194,-7.681,-7.987,-8.089,-7.990,-7.688,-7.204,-6.547,-5.745,-4.831,-3.840,-2.814,-1.799,-.844,0.015,.726,1.257,1.58,1.683,1.562,1.223,.685]
#measurement ID-Lab
data1=[2.044,2.950,3.724,4.333,4.748,4.955,4.960,4.739,4.303,3.674,2.881,1.967,0.963,-.082,-1.126,-2.119,-3.020,-3.794,-4.398,-4.814,-5.022,-5.018,-4.795,-4.362,-3.734,-2.947,-2.029,-1.025,0.022,1.067,]
data2=[-4.713,-5.064,-5.203,-5.133,-4.844,-4.343,-3.665,-2.831,-1.885,-0.861,.190,1.222,2.197,3.064,3.789,4.336,4.693,4.827,4.758,4.461,3.957,3.273,2.438,1.491,.468,-.582,-1.614,-2.581,-3.447,-4.169,]
data3=[0,-.213,-.669,-1.356,-2.231,-3.263,-4.403,-5.597,-6.790,-7.932,-8.970,-9.856,-10.556,-11.035,-11.280,-11.278,-11.034,-10.558,-9.872,-9.010,-8.005,-6.900,-5.743,-4.581,-3.462,-2.433,-1.540,-0.817,-0.310,-0.033]
data4=[2.547,1.665,0.669,-.4,-1.496,-2.573,-3.586,-4.491,-5.249,-5.821,-6.202,-6.353,-6.276,-5.970,-5.450,-4.734,-3.852,-2.847,-1.762,-0.645,0.457,1.490,2.409,3.172,3.746,4.104,4.236,4.132,3.803,3.263,]
data5=[-1.412,-.328,.728,1.706,2.556,3.244,3.739,4.014,4.064,3.890,3.490,2.896,2.126,1.216,.212,-.849,-1.915,-2.949,-3.901,-4.731,-5.408,-5.902,-6.189,-6.257,-6.105,-5.888,-5.149,-4.389,-3.483,-2.466,]
data=[data1,data2,data3,data4,data5]
for d in data:
meas_rot_ctr(d,1)
plt.plot(d)
plt.show()
gen_code()
#plot()
#gen_code()
plot()