first steps to commission wedge mover: all motors + encoder ok.

Homing limit switch and coorTrf to be done.
This commit is contained in:
2018-01-15 11:28:14 +01:00
parent c2695e0ebf
commit 4d197eb204
12 changed files with 941 additions and 364 deletions

113
Helical1.pbi Normal file
View File

@@ -0,0 +1,113 @@
[
[
"StatusGblListCtrl",
[],
"name=g;caption=global;state=67377148;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=41;floaty=486;floatw=208;floath=377;notebookid=-1;transparent=255"
],
[
"MotorListCtrl",
[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16
],
"name=p;caption=motor pos;state=67377148;dir=4;layer=0;row=0;pos=1;prop=100000;bestw=200;besth=350;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255"
],
[
"WatchListCtrl",
[
[
"EncTable[1].PrevEnc",
null
],
[
"EncTable[9].PrevEnc",
null
],
[
"Motor[1].idCmd",
null
],
[
"Motor[1].Ctrl",
null
],
[
"Motor[1].pos",
null
],
[
"Motor[1].ServoOut",
null
],
[
"P1000",
null
],
[
"Gather.Samples",
null
],
[
"Gather.MaxLines",
null
]
],
"name=w;caption=watch;state=67377148;dir=4;layer=0;row=1;pos=0;prop=100000;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=221;floaty=858;floatw=208;floath=377;notebookid=-1;transparent=255"
],
[
"StatusMotorListCtrl",
[
1
],
"name=m1;caption=motor1;state=67377148;dir=4;layer=0;row=4;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=485;floaty=810;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusMotorListCtrl",
[
2
],
"name=m2;caption=motor2;state=67377148;dir=4;layer=0;row=4;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=520;floaty=734;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusCoordListCtrl",
[
1
],
"name=c1;caption=coord1;state=67377148;dir=4;layer=0;row=2;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=350;floaty=493;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusMotorListCtrl",
[
3
],
"name=m3;caption=motor3;state=67377148;dir=4;layer=0;row=5;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1490;floaty=556;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusMotorListCtrl",
[
4
],
"name=m4;caption=motor4;state=67377148;dir=4;layer=0;row=5;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1528;floaty=501;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusMotorListCtrl",
[
5
],
"name=m5;caption=motor5;state=67377148;dir=4;layer=0;row=6;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1588;floaty=238;floatw=208;floath=677;notebookid=-1;transparent=255"
]
]

View File

@@ -27,25 +27,95 @@
[ [
"Motor[1].idCmd", "Motor[1].idCmd",
"lambda v: '%.8g'%float(v)" "lambda v: '%.8g'%float(v)"
], ],
[ "Motor[1].iqCmd", "lambda v: '%.8g'%float(v)" ], [
[ "Motor[1].idCmd", "lambda v: '%.8g'%float(v)" ], "Motor[1].iqCmd",
[ "Motor[2].iqCmd", "lambda v: '%.8g'%float(v)" ], "lambda v: '%.8g'%float(v)"
[ "Motor[2].idCmd", "lambda v: '%.8g'%float(v)" ], ],
[ "Motor[3].iqCmd", "lambda v: '%.8g'%float(v)" ], [
[ "Motor[3].idCmd", "lambda v: '%.8g'%float(v)" ], "Motor[1].ServoOut",
[ "Motor[4].iqCmd", "lambda v: '%.8g'%float(v)" ], "lambda v: '%.8g'%float(v)"
[ "Motor[4].idCmd", "lambda v: '%.8g'%float(v)" ], ],
[ "Motor[5].iqCmd", "lambda v: '%.8g'%float(v)" ], [
[ "Motor[5].idCmd", "lambda v: '%.8g'%float(v)" ], "Motor[2].iqCmd",
[ "Motor[6].iqCmd", "lambda v: '%.8g'%float(v)" ], "lambda v: '%.8g'%float(v)"
[ "Motor[6].idCmd", "lambda v: '%.8g'%float(v)" ], ],
[ "Motor[7].iqCmd", "lambda v: '%.8g'%float(v)" ], [
[ "Motor[7].idCmd", "lambda v: '%.8g'%float(v)" ], "Motor[2].idCmd",
[ "Motor[8].iqCmd", "lambda v: '%.8g'%float(v)" ], "lambda v: '%.8g'%float(v)"
[ "Motor[8].idCmd", "lambda v: '%.8g'%float(v)" ], ],
[ "P2000", null ], [
[ "P3000", null ] "Motor[2].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[3].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[3].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[3].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[4].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[4].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[4].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[5].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[5].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[5].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[6].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[6].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[6].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[7].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[7].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[7].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"P1000",
null
],
[
"P2000",
null
]
], ],
"name=w;caption=watch;state=67377148;dir=4;layer=0;row=1;pos=0;prop=100000;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=221;floaty=858;floatw=208;floath=377;notebookid=-1;transparent=255" "name=w;caption=watch;state=67377148;dir=4;layer=0;row=1;pos=0;prop=100000;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=221;floaty=858;floatw=208;floath=377;notebookid=-1;transparent=255"
], ],
@@ -54,7 +124,7 @@
[ [
3 3
], ],
"name=m3;caption=motor3;state=67377148;dir=4;layer=0;row=5;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=694;floaty=941;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m3;caption=motor3;state=67377148;dir=4;layer=0;row=6;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=694;floaty=941;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusGblListCtrl", "StatusGblListCtrl",
@@ -66,48 +136,48 @@
[ [
2 2
], ],
"name=m2;caption=motor2;state=67377148;dir=4;layer=0;row=4;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=2588;floaty=946;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m2;caption=motor2;state=67377148;dir=4;layer=0;row=5;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=2588;floaty=946;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
4 4
], ],
"name=m4;caption=motor4;state=67377148;dir=4;layer=0;row=6;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=905;floaty=792;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m4;caption=motor4;state=67377148;dir=4;layer=0;row=7;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=905;floaty=792;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
5 5
], ],
"name=m5;caption=motor5;state=67377148;dir=4;layer=0;row=6;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1139;floaty=836;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m5;caption=motor5;state=67377148;dir=4;layer=0;row=7;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1139;floaty=836;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
7 7
], ],
"name=m7;caption=motor7;state=67377148;dir=4;layer=0;row=7;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1353;floaty=657;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m7;caption=motor7;state=67377148;dir=4;layer=0;row=8;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1353;floaty=657;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
6 6
], ],
"name=m6;caption=motor6;state=67377148;dir=4;layer=0;row=7;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1276;floaty=771;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m6;caption=motor6;state=67377148;dir=4;layer=0;row=8;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1276;floaty=771;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusCoordListCtrl",
[
0
],
"name=c0;caption=coord0;state=67377148;dir=4;layer=0;row=2;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=457;floaty=774;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
1 1
], ],
"name=m1;caption=motor1;state=67377148;dir=4;layer=0;row=4;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=669;floaty=892;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m1;caption=motor1;state=67377148;dir=4;layer=0;row=5;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=669;floaty=892;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusCoordListCtrl",
[
1
],
"name=c1;caption=coord1;state=67377148;dir=4;layer=0;row=2;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=527;floaty=439;floatw=208;floath=677;notebookid=-1;transparent=255"
] ]
] ]

View File

@@ -29,34 +29,74 @@
[ [
"WatchListCtrl", "WatchListCtrl",
[ [
[
"EncTable[1].PrevEnc",
null
],
[
"EncTable[9].PrevEnc",
null
],
[ [
"Motor[1].idCmd", "Motor[1].idCmd",
null "lambda v: '%.8g'%float(v)"
], ],
[ [
"Motor[1].Ctrl", "Motor[1].iqCmd",
null "lambda v: '%.8g'%float(v)"
],
[
"Motor[1].pos",
null
], ],
[ [
"Motor[1].ServoOut", "Motor[1].ServoOut",
null "lambda v: '%.8g'%float(v)"
],
[
"Motor[2].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[2].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[2].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[3].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[3].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[3].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[4].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[4].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[4].ServoOut",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[5].iqCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[5].idCmd",
"lambda v: '%.8g'%float(v)"
],
[
"Motor[5].ServoOut",
"lambda v: '%.8g'%float(v)"
], ],
[ [
"P1000", "P1000",
null null
], ],
[
"P2000",
null
],
[ [
"Gather.Samples", "Gather.Samples",
null null
@@ -92,15 +132,22 @@
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
7 4
], ],
"name=m7;caption=motor7;state=67377148;dir=4;layer=0;row=3;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1220;floaty=261;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m4;caption=motor4;state=67377148;dir=4;layer=0;row=5;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=991;floaty=738;floatw=208;floath=677;notebookid=-1;transparent=255"
], ],
[ [
"StatusMotorListCtrl", "StatusMotorListCtrl",
[ [
8 5
], ],
"name=m8;caption=motor8;state=67377148;dir=4;layer=0;row=3;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1257;floaty=494;floatw=208;floath=677;notebookid=-1;transparent=255" "name=m5;caption=motor5;state=67377148;dir=4;layer=0;row=6;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1181;floaty=512;floatw=208;floath=677;notebookid=-1;transparent=255"
],
[
"StatusMotorListCtrl",
[
3
],
"name=m3;caption=motor3;state=67377148;dir=4;layer=0;row=5;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1168;floaty=473;floatw=208;floath=677;notebookid=-1;transparent=255"
] ]
] ]

View File

@@ -155,7 +155,7 @@ HelicalScan
PPMAC=MOTTEST-CPPM-CRM0485 PPMAC=MOTTEST-CPPM-CRM0485
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX
PBInspect --host $PPMAC --cfg PBInspect2.pbi PBInspect --host $PPMAC --cfg PBInspect1.pbi
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg
gpasciiCommander --host $PPMAC sim_8_motors.cfg -i gpasciiCommander --host $PPMAC sim_8_motors.cfg -i
@@ -263,7 +263,7 @@ ssh x06mx-cons-1
export CAQTDM_DISPLAY_PATH=/net/slsfs-crtl/export/sf/common/config/qt/:/net/slsfs-crtl/export/sf/controls/config/qt/ export CAQTDM_DISPLAY_PATH=/net/slsfs-crtl/export/sf/common/config/qt/:/net/slsfs-crtl/export/sf/controls/config/qt/
export EPICS_CA_ADDR_LIST="129.129.126.255"
caqtdm -macro "P=SAR-EXPMX" ESB_MX_exp.ui caqtdm -macro "P=SAR-EXPMX" ESB_MX_exp.ui
``` ```
@@ -289,3 +289,44 @@ To see the differences compare:
When using segmented mode (SegMoveTime>0) the velocities are not needed. When using segmented mode (SegMoveTime>0) the velocities are not needed.
With SegMoveTime=0 these velocities are needed and will result in a non optimal trajectory (with the current buggy calculation). With SegMoveTime=0 these velocities are needed and will result in a non optimal trajectory (with the current buggy calculation).
``` ```
Testing Helicalscan with real motors 8.1.18
-------------------------------------------
```
PPMAC=SAR-CPPM-EXPMX1
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg
gpasciiCommander --host $PPMAC -i
$$$***
!common()
!SAR-EXPMX1()
enable plc 1
export EPICS_CA_ADDR_LIST=$PPMAC
caQtDM -macro 'P=SAR-EXPMX' ESB_MX_exp
do homing (or call plc 1)
cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python
./helicalscan.py
```
Testing Wedge mover
-------------------
```
PPMAC=SAR-CPPM-EXPMX2
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-EXPMX2()
Motor[1].pLimits=0
Motor[2].pLimits=0
Motor[3].pLimits=0
Motor[4].pLimits=0
```

View File

@@ -17,13 +17,13 @@ file asyn.template {{P="$(P_M)2", PORT=$(PORT_M)}}
file PPMACMotor.template { file PPMACMotor.template {
pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM} pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM}
{ "Wedge 1" , "$(P_M)", "MOT_WEDGE1", "$(PORT_M)", 1 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge 1" , "$(P_M)", "MOT_WEDGE1", "$(PORT_M)", 1 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge 2" , "$(P_M)", "MOT_WEDGE2", "$(PORT_M)", 2 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge 2" , "$(P_M)", "MOT_WEDGE2", "$(PORT_M)", 2 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge 3" , "$(P_M)", "MOT_WEDGE3", "$(PORT_M)", 3 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge 3" , "$(P_M)", "MOT_WEDGE3", "$(PORT_M)", 3 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge 4" , "$(P_M)", "MOT_WEDGE4", "$(PORT_M)", 4 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge 4" , "$(P_M)", "MOT_WEDGE4", "$(PORT_M)", 4 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge X" , "$(P_M)", "MOT_WEDGEX", "$(PORT_M)", 9 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge X" , "$(P_M)", "MOT_WEDGEX", "$(PORT_M)", 9 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge Y" , "$(P_M)", "MOT_WEDGEY", "$(PORT_M)", 10 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge Y" , "$(P_M)", "MOT_WEDGEY", "$(PORT_M)", 10 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge A" , "$(P_M)", "MOT_WEDGEA", "$(PORT_M)", 11 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge A" , "$(P_M)", "MOT_WEDGEA", "$(PORT_M)", 11 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Wedge B" , "$(P_M)", "MOT_WEDGEB", "$(PORT_M)", 12 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } { "Wedge B" , "$(P_M)", "MOT_WEDGEB", "$(PORT_M)", 12 , 0 , 1. , .5 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 }
{ "Backlight", "$(P_M)", "MOT_BLGT" , "$(PORT_M)", 5 , 1 , 40E3, 20E3, 0.1 , 20 , -1 , 0 , "usr", 0 , 0 } { "Backlight", "$(P_M)", "MOT_BLGT" , "$(PORT_M)", 5 , 1 , 40E3, 20E3, 0.1 , 20 , -1 , 0 , "usr", 0 , 0 }
} }

View File

@@ -108,6 +108,8 @@ open plc PLC_Homing
//Motor[1].PhasePos=560 // 555 581 593 558 //Motor[1].PhasePos=560 // 555 581 593 558
//Motor[2].PhasePos=1540 //1549 1531 1543 1537 //Motor[2].PhasePos=1540 //1549 1531 1543 1537
homez6,7
goto 1 goto 1
N0: //ERROR_END N0: //ERROR_END

View File

@@ -95,8 +95,8 @@ Motor[3].pPhaseEnc=Acc84B[0].Chan[2].SerialEncDataA.a
//Interferometer 1,2 //Interferometer 1,2
//------------------ //------------------
!encoder_inc(enc=6,tbl=6,mot=6)# ,posSf=13000./650000) !encoder_inc(enc=6,tbl=6,mot=6 ,posSf=.01) //1 incr=10nm -> posSf=.01 to scale to um
!encoder_inc(enc=7,tbl=7,mot=7)# ,posSf=13000./650000) !encoder_inc(enc=7,tbl=7,mot=7 ,posSf=-.01) //1 incr=10nm,inverse direction -> posSf=.01 to scale to um
#3,4,5hmz #3,4,5hmz

View File

@@ -1,18 +1,40 @@
//Wedge Movers //Wedge Movers
-------------- //--------------
!encoder_inc(enc=1,posSf=1./20) //Nanotec 2 ph motor 42.3mm 1.8deg, Planetgetriebe 1.5Nm I=1:12, Spindel 2mm steigung
!motor(mot=1,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2855,InPosBand=1) //ST4118L1804-B 42 mm 17 50 Ncm 1.8 deg/step 1.8 A/Wicklung 49 mm €34.10
!encoder_inc(enc=2,posSf=1./20) //102400*12=1228800 == 2mm
!motor(mot=2,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2844,InPosBand=1) //#1j:1228800 -> 1 rev = 2mm = 2000inc
//posSf = userUnits/encoder_steps =1
//servoSf=motor_u_steps/userUnits = 1228800/2000. = 614.4
!encoder_inc(enc=3,posSf=1./20) //#1 = wedge 1a
!motor(mot=3,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=204,InPosBand=1) //#2 = wedge 1b
//#3 = wedge 2a
//#4 = wedge 2b
!encoder_inc(enc=4,posSf=1./20) //steigung Keil: 11.4212deg = arctan(0.2)=11.31deg -> Steigung 1:5
!motor(mot=4,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2094,InPosBand=1) //on 146mm from 35 to 21.5mm 146/(35-21.5)=10.81
//on 280mm from 61mm to 38 mm 280/(61-38)=
//!encoder_sim(enc=1)
//!encoder_inc(enc=1,tbl=9,mot=9,posSf=1)
//!motor(mot=1,dirCur=120,JogSpeed=102.4*1,invDir=False)
//Motor[1].pLimits=0
!encoder_inc(enc=1,posSf=1.)
!motor(mot=1,dirCur=1000,JogSpeed=1.,HomeVel=.5,servoSf=614.4,homing='enc-index',invDir=False,HomeOffset=0,InPosBand=1)
!encoder_inc(enc=2,posSf=1.)
!motor(mot=2,dirCur=1000,JogSpeed=1.,HomeVel=.5,servoSf=614.4,homing='enc-index',invDir=False,HomeOffset=0,InPosBand=1)
!encoder_inc(enc=3,posSf=1.)
!motor(mot=3,dirCur=1000,JogSpeed=1.,HomeVel=.5,servoSf=614.4,homing='enc-index',invDir=False,HomeOffset=0,InPosBand=1)
!encoder_inc(enc=4,posSf=1.)
!motor(mot=4,dirCur=1000,JogSpeed=1.,HomeVel=.5,servoSf=614.4,homing='enc-index',invDir=False,HomeOffset=0,InPosBand=1)
//Backlight //Backlight
@@ -22,4 +44,4 @@
!motor(mot=5,dirCur=1800,JogSpeed=40,invDir=False) !motor(mot=5,dirCur=1800,JogSpeed=40,invDir=False)
!holding_current(m5=[1400,1800]) !holding_current(m1=[0,1000],m2=[0,1000],m3=[0,1000],m4=[0,1000],m5=[1400,1800])

View File

@@ -30,7 +30,7 @@ verbose bits:
''' '''
import os, sys, json import os, sys, json,re
import numpy as np import numpy as np
import matplotlib as mpl import matplotlib as mpl
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@@ -275,7 +275,7 @@ class HelicalScan:
param=self.param param=self.param
# param[i]=(z_i, y_i, x_i, r_i,phi_i) # param[i]=(z_i, y_i, x_i, r_i,phi_i)
ctr=param[:,0:3].mean(0)[::-1] ctr=param[:,0:3].mean(0)[::-1]
self.axSetCenter(ctr,10) self.axSetCenter(ctr,param[0,3]+param[1,3])
axCx=plt.axes([0.1, 0.01, 0.8, 0.02]) axCx=plt.axes([0.1, 0.01, 0.8, 0.02])
axCz=plt.axes([0.1, 0.04, 0.8, 0.02]) axCz=plt.axes([0.1, 0.04, 0.8, 0.02])
@@ -348,7 +348,7 @@ class HelicalScan:
# param[i]=(z_i, y_i, x_i, r_i,phi_i) # param[i]=(z_i, y_i, x_i, r_i,phi_i)
ctr=(0,0,0) ctr=(0,0,0)
self.axSetCenter(ctr,10) self.axSetCenter(ctr,param[0,3]+param[1,3])
axDx=plt.axes([0.1, 0.01, 0.8, 0.02]) axDx=plt.axes([0.1, 0.01, 0.8, 0.02])
axDz=plt.axes([0.1, 0.04, 0.8, 0.02]) axDz=plt.axes([0.1, 0.04, 0.8, 0.02])
@@ -404,7 +404,7 @@ class HelicalScan:
# param[i]=(z_i, y_i, x_i, r_i,phi_i) # param[i]=(z_i, y_i, x_i, r_i,phi_i)
ctr=(0,0,0) ctr=(0,0,0)
self.axSetCenter(ctr,10) self.axSetCenter(ctr,param[0,3]+param[1,3])
axFrm=plt.axes([0.1, 0.01, 0.8, 0.02]) axFrm=plt.axes([0.1, 0.01, 0.8, 0.02])
@@ -704,7 +704,7 @@ open forward
p0_z=z_0+r_0*cos(phi_0+qW) p0_z=z_0+r_0*cos(phi_0+qW)
p1_z=z_1+r_1*cos(phi_1+qW) p1_z=z_1+r_1*cos(phi_1+qW)
scale=(qFY-y_0)/(y_1-y_0) scale=(qFY-(y_0))/(y_1-(y_0))
p0_x=p0_x+scale*(p1_x-p0_x) p0_x=p0_x+scale*(p1_x-p0_x)
p0_y=p0_y+scale*(p1_y-p0_y) p0_y=p0_y+scale*(p1_y-p0_y)
p0_z=p0_z+scale*(p1_z-p0_z) p0_z=p0_z+scale*(p1_z-p0_z)
@@ -727,10 +727,11 @@ open inverse
define( qCX='L4', qCZ='L5', qW='L3', qFY='L1') define( qCX='L4', qCZ='L5', qW='L3', qFY='L1')
define(vqCX='R4', vqCZ='R5', vqW='R3', vqFY='R1') define(vqCX='R4', vqCZ='R5', vqW='R3', vqFY='R1')
define(qCX='L4', qCZ='L5', qW='L3', qFY='L1')
define(p0_x='L10', p0_y='L11', p0_z='L12') define(p0_x='L10', p0_y='L11', p0_z='L12')
define(p1_x='L13', p1_y='L14', p1_z='L15') define(p1_x='L13', p1_y='L14', p1_z='L15')
define(scale='L16') define(p_x='L16', p_y='L17', p_z='L18')
define(sclY='L19')
define(scl='L20')
if(D0>0) if(D0>0)
send 1"inv_inp(%f) %f:%f %f:%f %f:%f %f:%f\\n",D0,DX,vDX,DZ,vDZ,W,vW,Y,vY send 1"inv_inp(%f) %f:%f %f:%f %f:%f %f:%f\\n",D0,DX,vDX,DZ,vDZ,W,vW,Y,vY
else else
@@ -750,20 +751,26 @@ open inverse
p0_z=z_0+r_0*cos(phi_0+W) p0_z=z_0+r_0*cos(phi_0+W)
p1_z=z_1+r_1*cos(phi_1+W) p1_z=z_1+r_1*cos(phi_1+W)
scale=(Y-y_0)/(y_1-y_0) sclY=(Y-(y_0))/(y_1-(y_0))
p0_x=p0_x+scale*(p1_x-p0_x) p_x=p0_x+sclY*(p1_x-p0_x)
p0_y=p0_y+scale*(p1_y-p0_y) p_y=p0_y+sclY*(p1_y-p0_y)
p0_z=p0_z+scale*(p1_z-p0_z) p_z=p0_z+sclY*(p1_z-p0_z)
qCX=DX+p0_x qCX=DX+p_x
qCZ=DZ+p0_z qCZ=DZ+p_z
qFY=Y qFY=Y
if(D0>0) if(D0>0)
{ // calculate velocities for PVT motion { // calculate velocities for PVT motion''')
vqCX=vDX prg.append(" vW=vW*%g"%(d2r/1000.)) #scale from 1000*deg to rad
vqCZ=vDZ prg.append(''' p_x=sclY*(p1_x-p0_x)
vqW=vW p_z=sclY*(p1_z-p0_z)
vqFY=vY vqFY=vY
send 1"inv_res %f:%f %f:%f %f:%f %f:%f\\n",qCX,vqCX,qCZ,vqCZ,qW,vqW,qFY,vqFY vqCX=vDX + (p1_x-p0_x)/(p1_y-p0_y)*vY //+ vqW*p_z
vqCZ=vDZ + (p1_z-p0_z)/(p1_y-p0_y)*vY //+ vqW*p_x
//vqW=vqW+(vqCX+(p1_x-p0_x)/(p1_y-p0_y)*vY)*p_z+(vqCZ+(p1_z-p0_z)/(p1_y-p0_y)*vY)*p_x
vqW=vW//+((p1_x-p0_x)/(p1_y-p0_y)*vY)*p_z+((p1_z-p0_z)/(p1_y-p0_y)*vY*p_x
''')
prg.append(" vqW=vqW*%g"%(1000./d2r)) #scale from rad to 1000*deg
prg.append(''' send 1"inv_res %f:%f %f:%f %f:%f %f:%f\\n",qCX,vqCX,qCZ,vqCZ,qW,vqW,qFY,vqFY
} }
else else
send 1"inv_res %f %f %f %f\\n",qCX,qCZ,qW,qFY send 1"inv_res %f %f %f %f\\n",qCX,qCZ,qW,qFY
@@ -771,6 +778,11 @@ open inverse
close close
''') ''')
# vqCX=vDX + (p1_x-p0_x)/(p1_y-p0_y)*vY + vqW*p_x
# vDX is in same direction, so add as it is
# (p1_x-p0_x)/(p1_y-p0_y)*vY velocity part in vqCX direction, when moving in vY
# vqW*p_x velocity part of the rotation (vqW is in rad)
self.download(prg,mode=0,file='/tmp/coordTrf.cfg') self.download(prg,mode=0,file='/tmp/coordTrf.cfg')
@@ -845,7 +857,7 @@ close
cntHor = kwargs.get('cntHor', 4) cntHor = kwargs.get('cntHor', 4)
hRng = kwargs.get('hRng', (-.2,.2)) hRng = kwargs.get('hRng', (-.2,.2))
wRng = kwargs.get('wRng', (0,360000)) wRng = kwargs.get('wRng', (0,360000))
yRng = kwargs.get('yRng', (2.3,6.2)) yRng = kwargs.get('yRng', self.param[:,1])
numPt=cntVert*cntHor numPt=cntVert*cntHor
pt=np.zeros((numPt,4)) pt=np.zeros((numPt,4))
@@ -881,7 +893,7 @@ close
cntHor = kwargs.get('cntHor', 4) cntHor = kwargs.get('cntHor', 4)
hRng = kwargs.get('hRng', (-.2,.2)) hRng = kwargs.get('hRng', (-.2,.2))
wRng = kwargs.get('wRng', (0,360000)) wRng = kwargs.get('wRng', (0,360000))
yRng = kwargs.get('yRng', (2.3,6.2)) yRng = kwargs.get('yRng', self.param[:,1])
pt2pt_time = kwargs.get('pt2pt_time', 100) pt2pt_time = kwargs.get('pt2pt_time', 100)
smt = kwargs.get('smt', 1) # SegMoveTime, default = 1ms -> velocity calc not yet 100% correct (smt=0 not 100% working) smt = kwargs.get('smt', 1) # SegMoveTime, default = 1ms -> velocity calc not yet 100% correct (smt=0 not 100% working)
numPt=cntVert*cntHor numPt=cntVert*cntHor
@@ -1001,6 +1013,18 @@ close
stderr=sprc.PIPE) stderr=sprc.PIPE)
res = p.wait() res = p.wait()
self.rec = np.genfromtxt(fnLoc, delimiter=' ') self.rec = np.genfromtxt(fnLoc, delimiter=' ')
com=GpasciiCommunicator().connect(host,prompt='# ')
ack=GpasciiCommunicator.gpascii_ack
channels=["Motor[4].HomePos","Motor[5].HomePos","Motor[3].HomePos","Motor[1].HomePos"]
ofs=np.ndarray(len(channels))
for i,v in enumerate(channels):
com.write(v+'\n')
val=com.read_until(ack)
#print val
#regexp: https://docs.python.org/2/library/re.html -> %e, %E, %f, %g
ofs[i]=float(re.search('=([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)',val).group(1))
self.rec-=ofs
self.save_rec() self.save_rec()
@@ -1062,19 +1086,45 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
hs=HelicalScan(args) hs=HelicalScan(args)
hs.args.verbose = 255 hs.args.verbose = 255
hs.args.host='MOTTEST-CPPM-CRM0485' #hs.args.host='MOTTEST-CPPM-CRM0485'
hs.args.host='SAR-CPPM-EXPMX1'
#SAR-CPPM-EXPMX1 MOTTEST-CPPM-CRM0485 #SAR-CPPM-EXPMX1 MOTTEST-CPPM-CRM0485
#hs.sequencer() #hs.sequencer()
#hs.test_find_rot_ctr() #hs.test_find_rot_ctr()
#hs.test_find_rot_ctr(n=5. ,per=1.,bias=2.31,ampl=4.12,phi=24.6) #hs.test_find_rot_ctr(n=5. ,per=1.,bias=2.31,ampl=4.12,phi=24.6)
hs.calcParam() hs.calcParam()
#hs.param[0]=(15,2,0,3,0)#(z_i, y_i, x_i, r_i,phi_i)
#hs.param[1]=(15,4,0,3,0)#(z_i, y_i, x_i, r_i,phi_i)
#hs.param[0]=(-100, 10,0,50,0)#(z_i, y_i, x_i, r_i,phi_i)
#hs.param[1]=(-100,-10,0,70,0)#(z_i, y_i, x_i, r_i,phi_i)
hs.test_coord_trf() hs.test_coord_trf()
#hs.interactive_cx_cz_w_fy() #hs.interactive_cx_cz_w_fy()
#hs.interactive_dx_dz_w_y() #hs.interactive_dx_dz_w_y()
hs.download(file='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/sim_8_motors.cfg') #mode bits:
hs.gen_coord_trf_code() #0:1 config simulated motors
#1:2 config real motors
#2:4 config coord trf
mode=6#6#5#4#0
os.chdir(os.path.join(os.path.dirname(__file__),'../cfg'))
if mode&1:
hs.download(file='sim_8_motors.cfg')
if mode&2:
hs.download(['$$$***','!common()','!SAR-EXPMX1()','#1..7j/','enable plc 1','Motor[1].MaxSpeed=25','Motor[2].MaxSpeed=25'])
raw_input('press return when homed')
if mode&4:
hs.download(['disable plc 0',])
time.sleep(.5)
hs.gen_coord_trf_code()
print ('gen_coord_trf_code')
time.sleep(.5)
hs.download(['enable plc 0',])
time.sleep(.5)
hs.download(['#1..7j/',])
time.sleep(.5)
#hs.gen_prog(mode=-1) #hs.gen_prog(mode=-1)
#hs.gen_prog(mode=0,cntHor=1,cntVert=3,wRng=(120000,120000)) #hs.gen_prog(mode=0,cntHor=1,cntVert=3,wRng=(120000,120000))
#hs.gen_prog(mode=0,cntHor=1) #hs.gen_prog(mode=0,cntHor=1)
@@ -1083,9 +1133,14 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
#hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(120000,120000),pt2pt_time=100) #hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(120000,120000),pt2pt_time=100)
#hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(120000,120000),pt2pt_time=100,smt=0) #hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(120000,120000),pt2pt_time=100,smt=0)
#hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(0,360000)) #hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(0,360000))
#hs.gen_prog(mode=1,cntHor=1,cntVert=5,wRng=(0,360000),smt=0) #hs.gen_prog(mode=1,cntHor=1,cntVert=5,hRng=(-.3,.3),wRng=(0,360000),smt=1)
#hs.gen_prog(mode=1,cntHor=7,cntVert=2,hRng=(-3,3),wRng=(120000,120000),smt=0)
hs.gen_prog(mode=1,cntHor=3,cntVert=6,hRng=(-5,5),wRng=(00,120000),smt=0,pt2pt_time=10)
#hs.gen_prog(mode=1, cntHor=1, cntVert=2, wRng=(0, 360000), smt=0)
#hs.gen_prog(mode=1) #hs.gen_prog(mode=1)
hs.gen_prog(mode=1,pt2pt_time=100,cnt=1,cntVert=35,cntHor=7,hRng=(-.3,.3),wRng=(0,360000*3),yRng=(6.2,2.3)) #hs.gen_prog(mode=1,pt2pt_time=100,cnt=1,cntVert=35,cntHor=7,hRng=(-.3,.3),wRng=(0,360000*3),yRng=(6.2,2.3))
#hs.gen_prog(mode=1,pt2pt_time=100,cnt=1,cntVert=10,cntHor=3,hRng=(-30,30),wRng=(0,36000),yRng=(-50,-100))
#hs.gen_prog(mode=1,cntHor=7,cntVert=2,hRng=(-100,50),wRng=(000,10000),smt=0)
hs.load_rec() hs.load_rec()
hs.show_pos();hs.show_vel() hs.show_pos();hs.show_vel()
hs.interactive_anim() hs.interactive_anim()

View File

@@ -18,6 +18,34 @@
sodipodi:docname="helicalscan1.svg"> sodipodi:docname="helicalscan1.svg">
<defs <defs
id="defs4"> id="defs4">
<inkscape:path-effect
effect="spiro"
id="path-effect4596"
is_visible="true" />
<inkscape:path-effect
effect="spiro"
id="path-effect4592"
is_visible="true" />
<inkscape:path-effect
effect="spiro"
id="path-effect4588"
is_visible="true" />
<inkscape:path-effect
is_visible="true"
id="path-effect4584"
effect="spiro" />
<inkscape:path-effect
effect="spiro"
id="path-effect4580"
is_visible="true" />
<inkscape:path-effect
effect="spiro"
id="path-effect4540"
is_visible="true" />
<inkscape:path-effect
effect="spiro"
id="path-effect3650"
is_visible="true" />
<inkscape:path-effect <inkscape:path-effect
effect="spiro" effect="spiro"
id="path-effect3724" id="path-effect3724"
@@ -133,9 +161,9 @@
borderopacity="1.0" borderopacity="1.0"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="1.8926215" inkscape:zoom="1.3840277"
inkscape:cx="369.55834" inkscape:cx="613.76584"
inkscape:cy="749.80396" inkscape:cy="136.85913"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="false" showgrid="false"
@@ -281,9 +309,9 @@
sodipodi:cy="373.53488" sodipodi:cy="373.53488"
sodipodi:rx="20.900398" sodipodi:rx="20.900398"
sodipodi:ry="5.2250996" sodipodi:ry="5.2250996"
sodipodi:start="0.47984631" sodipodi:start="1.1988058"
sodipodi:end="3.2616514" sodipodi:end="0.71174827"
d="m -404.18498,375.94701 a 20.900398,5.2250996 0 0 1 -24.71557,2.57967 20.900398,5.2250996 0 0 1 -14.5744,-5.61761" d="m -415.12833,378.40261 a 20.900398,5.2250996 0 0 1 -26.00072,-2.39137 20.900398,5.2250996 0 0 1 6.33652,-6.74251 20.900398,5.2250996 0 0 1 27.54003,0.75342 20.900398,5.2250996 0 0 1 0.35372,6.92555"
transform="scale(-1,1)" transform="scale(-1,1)"
sodipodi:open="true" /> sodipodi:open="true" />
<path <path
@@ -294,23 +322,23 @@
sodipodi:cy="192.17082" sodipodi:cy="192.17082"
sodipodi:rx="18.581232" sodipodi:rx="18.581232"
sodipodi:ry="4.645308" sodipodi:ry="4.645308"
sodipodi:start="6.0151975" sodipodi:start="0.63234095"
sodipodi:end="1.0471386" sodipodi:end="2.0378307"
d="m 439.44423,190.94078 a 18.581232,4.645308 0 0 1 -8.62642,5.25286" d="m 436.51472,194.91636 a 18.581232,4.645308 0 0 1 -23.35449,1.40229"
sodipodi:open="true" /> sodipodi:open="true" />
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="428.61023" x="431.80341"
y="384.22964" y="384.86829"
id="text5154" id="text5154"
sodipodi:linespacing="125%"><tspan sodipodi:linespacing="125%"><tspan
sodipodi:role="line" sodipodi:role="line"
id="tspan5156" id="tspan5156"
x="428.61023" x="431.80341"
y="384.22964">φ<tspan y="384.86829">φ<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5158">s</tspan></tspan></text> id="tspan5158">0</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;baseline-shift:baseline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -323,7 +351,7 @@
x="469.13644" x="469.13644"
y="214.94801">p<tspan y="214.94801">p<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5192">e</tspan></tspan></text> id="tspan5192">1</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -336,20 +364,20 @@
x="312.47342" x="312.47342"
y="415.07755">p<tspan y="415.07755">p<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5198">s</tspan></tspan></text> id="tspan5198">0</tspan></tspan></text>
<text <text
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
id="text5200" id="text5200"
y="187.17661" y="203.88509"
x="435.12906" x="416.34329"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan xml:space="preserve"><tspan
y="187.17661" y="203.88509"
x="435.12906" x="416.34329"
id="tspan5202" id="tspan5202"
sodipodi:role="line">φ<tspan sodipodi:role="line">φ<tspan
id="tspan5204" id="tspan5204"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub">e</tspan></tspan></text> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub">1</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -362,7 +390,7 @@
x="65.620399" x="65.620399"
y="373.21445">y<tspan y="373.21445">y<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5210">s</tspan></tspan></text> id="tspan5210">0</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -375,7 +403,7 @@
x="64.260834" x="64.260834"
y="192.74004">y<tspan y="192.74004">y<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5216">e</tspan></tspan></text> id="tspan5216">1</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -387,7 +415,7 @@
sodipodi:role="line" sodipodi:role="line"
id="tspan5220" id="tspan5220"
x="3.9073553" x="3.9073553"
y="484.16422">v crystal</tspan></text> y="484.16422">crystal</tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -400,7 +428,7 @@
x="357.74579" x="357.74579"
y="395.25363">r<tspan y="395.25363">r<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5226">s</tspan></tspan></text> id="tspan5226">0</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Caligraphic;-inkscape-font-specification:MathJax_Caligraphic;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -413,7 +441,7 @@
x="439.08008" x="439.08008"
y="203.08162">r<tspan y="203.08162">r<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub"
id="tspan5232">e</tspan></tspan></text> id="tspan5232">1</tspan></tspan></text>
<path <path
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
id="path4228" id="path4228"
@@ -451,7 +479,7 @@
id="tspan4238" id="tspan4238"
sodipodi:role="line">x<tspan sodipodi:role="line">x<tspan
id="tspan4240" id="tspan4240"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub">e</tspan></tspan></text> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub">1</tspan></tspan></text>
<text <text
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
id="text4242" id="text4242"
@@ -464,7 +492,7 @@
id="tspan4244" id="tspan4244"
sodipodi:role="line">x<tspan sodipodi:role="line">x<tspan
id="tspan4246" id="tspan4246"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub">s</tspan></tspan></text> style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;baseline-shift:sub">0</tspan></tspan></text>
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 313.43382,405.30526 7.00627,0 -3.10069,-2.33388" d="m 313.43382,405.30526 7.00627,0 -3.10069,-2.33388"
@@ -475,11 +503,6 @@
id="path4262" id="path4262"
d="m 470.10885,206.24745 7.00627,0 -3.10069,-2.33388" d="m 470.10885,206.24745 7.00627,0 -3.10069,-2.33388"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 361.04398,306.084 4.97745,-4.93079 -3.84533,0.52411"
id="path4264"
inkscape:connector-curvature="0" />
<path <path
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
id="path4266" id="path4266"
@@ -508,73 +531,69 @@
id="flowPara4337" /></flowRoot> <text id="flowPara4337" /></flowRoot> <text
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
id="text4339" id="text4339"
y="541.96143" y="516.4162"
x="101.44707" x="94.294395"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan xml:space="preserve"><tspan
id="tspan3453" id="tspan3453"
y="541.96143" y="516.4162"
x="101.44707" x="94.294395"
sodipodi:role="line">coord transformation:</tspan><tspan sodipodi:role="line">coord transformation:</tspan><tspan
y="560.71143" y="535.1662"
x="101.44707" x="94.294395"
sodipodi:role="line" sodipodi:role="line"
id="tspan3553">input ω,y,d<tspan id="tspan3553">input ω,y,dx,dz</tspan><tspan
style="font-size:64.99999762%;baseline-shift:sub" y="553.9162"
id="tspan3557">x</tspan>,d<tspan x="94.294395"
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3559">z</tspan></tspan><tspan
y="579.46143"
x="101.44707"
sodipodi:role="line" sodipodi:role="line"
id="tspan3555">output: ω,x,y,z,</tspan><tspan id="tspan3555">output: qω,qcx,qfy,qcz,</tspan><tspan
y="598.21143" y="572.6662"
x="101.44707" x="94.294395"
sodipodi:role="line" sodipodi:role="line"
id="tspan3541" /><tspan id="tspan3561"></tspan><tspan
y="616.96143" y="591.4162"
x="101.44707" x="94.294395"
sodipodi:role="line" sodipodi:role="line"
id="tspan3561">d<tspan id="tspan3550">dx,dz are translation from the vector v after rotation</tspan><tspan
style="font-size:64.99999762%;baseline-shift:sub" y="610.1662"
id="tspan3573">x</tspan>,d<tspan x="94.294395"
style="font-size:64.99999762%;baseline-shift:sub" sodipodi:role="line"
id="tspan3575">z</tspan> are translation from the vector v after rotation</tspan><tspan id="tspan3546">q vaiables are 'real motor' variables</tspan><tspan
y="635.71143" y="628.9162"
x="101.44707" x="94.294395"
sodipodi:role="line" sodipodi:role="line"
id="tspan3563" /><tspan id="tspan3563" /><tspan
y="654.46143" y="647.6662"
x="101.44707" x="94.294395"
sodipodi:role="line" sodipodi:role="line"
id="tspan3547" /></text> id="tspan3547" /></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="101.0957" x="93.943031"
y="514.2149" y="488.66965"
id="text3461" id="text3461"
sodipodi:linespacing="125%"><tspan sodipodi:linespacing="125%"><tspan
id="tspan3475" id="tspan3475"
sodipodi:role="line" sodipodi:role="line"
x="101.0957" x="93.943031"
y="514.2149">known values after fft: y<tspan y="488.66965">known values after fft: y<tspan
id="tspan3473" id="tspan3473"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>, r<tspan style="font-size:64.99999762%;baseline-shift:sub">0</tspan>, r<tspan
id="tspan3471" id="tspan3471"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>, x<tspan style="font-size:64.99999762%;baseline-shift:sub">0</tspan>, x<tspan
id="tspan3469" id="tspan3469"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>, φ<tspan style="font-size:64.99999762%;baseline-shift:sub">0</tspan>, φ<tspan
id="tspan3467" id="tspan3467"
style="font-size:64.99999762%;baseline-shift:sub">s, </tspan>y<tspan style="font-size:64.99999762%;baseline-shift:sub">0, </tspan>y<tspan
id="tspan3483" id="tspan3483"
style="font-size:64.99999762%;baseline-shift:sub">e</tspan>, r<tspan style="font-size:64.99999762%;baseline-shift:sub">1</tspan>, r<tspan
id="tspan3481" id="tspan3481"
style="font-size:64.99999762%;baseline-shift:sub">e</tspan>, x<tspan style="font-size:64.99999762%;baseline-shift:sub">1</tspan>, x<tspan
id="tspan3479" id="tspan3479"
style="font-size:64.99999762%;baseline-shift:sub">e</tspan>, φ<tspan style="font-size:64.99999762%;baseline-shift:sub">1</tspan>, φ<tspan
id="tspan3477" id="tspan3477"
style="font-size:64.99999762%;baseline-shift:sub">e</tspan></tspan></text> style="font-size:64.99999762%;baseline-shift:sub">1</tspan></tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:MathJax_Size1;-inkscape-font-specification:MathJax_Size1;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -600,40 +619,6 @@
style="-inkscape-font-specification:sans-serif;font-family:sans-serif;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">φ<tspan style="-inkscape-font-specification:sans-serif;font-family:sans-serif;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">φ<tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:sans-serif;-inkscape-font-specification:sans-serif;baseline-shift:sub" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:64.99999762%;font-family:sans-serif;-inkscape-font-specification:sans-serif;baseline-shift:sub"
id="tspan4321">e</tspan></tspan></text> id="tspan4321">e</tspan></tspan></text>
<g
id="g3643"
transform="translate(-15.455292,12.364234)">
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="110.69898"
y="732.79047"
id="text4359"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4361"
x="110.69898"
y="732.79047">v=p<tspan
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan4365">e</tspan>-p<tspan
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan4363">s</tspan></tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 111.88677,722.10095 7.00627,0 -3.10069,-2.33388"
id="path3533"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3535"
d="m 133.33099,721.71457 7.00627,0 -3.10069,-2.33388"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 153.61606,721.32819 7.00627,0 -3.10069,-2.33388"
id="path3537"
inkscape:connector-curvature="0" />
</g>
<flowRoot <flowRoot
xml:space="preserve" xml:space="preserve"
id="flowRoot3565" id="flowRoot3565"
@@ -659,7 +644,7 @@
id="tspan4373" id="tspan4373"
sodipodi:role="line">p<tspan sodipodi:role="line">p<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3936">s</tspan>(ω)=</tspan></text> id="tspan3936">n</tspan>(ω)=</tspan></text>
<text <text
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
id="text4377" id="text4377"
@@ -672,11 +657,11 @@
id="tspan4395" id="tspan4395"
sodipodi:role="line">x<tspan sodipodi:role="line">x<tspan
id="tspan4403" id="tspan4403"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>+r<tspan style="font-size:64.99999762%;baseline-shift:sub">n</tspan>+r<tspan
id="tspan4401" id="tspan4401"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>·cos<tspan style="font-size:64.99999762%;baseline-shift:sub">n</tspan>·sin<tspan
id="tspan4399" id="tspan4399"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>+ω)</tspan></text> style="font-size:64.99999762%;baseline-shift:sub">n</tspan>+ω)</tspan></text>
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@@ -687,13 +672,13 @@
sodipodi:role="line" sodipodi:role="line"
id="tspan4407" id="tspan4407"
x="131.06863" x="131.06863"
y="738.32257">y<tspan y="738.32257">z<tspan
style="font-size:65%;baseline-shift:sub"
id="tspan3696">n</tspan>+r<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan4409">s</tspan>+r<tspan id="tspan4411">n</tspan>·cos(φ<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan4411">s</tspan>·sin(φ<tspan id="tspan4413">n</tspan>+ω)</tspan></text>
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan4413">s</tspan>+ω)</tspan></text>
<path <path
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
id="path3539" id="path3539"
@@ -711,7 +696,7 @@
id="tspan3656" id="tspan3656"
sodipodi:role="line">y<tspan sodipodi:role="line">y<tspan
id="tspan3658" id="tspan3658"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan></tspan></text> style="font-size:64.99999762%;baseline-shift:sub">n</tspan></tspan></text>
<path <path
sodipodi:nodetypes="ccccc" sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
@@ -728,115 +713,76 @@
<text <text
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="84.446236" x="347.44675"
y="857.24939" y="650.60614"
id="text3732" id="text3732"
sodipodi:linespacing="125%"><tspan sodipodi:linespacing="125%"><tspan
id="tspan3742" id="tspan3742"
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="857.24939">output:</tspan><tspan y="650.60614">output:</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="875.99939" y="669.35614"
id="tspan3763">ω=ω</tspan><tspan id="tspan3763">qω=ω</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="894.74939" y="688.10614"
id="tspan3765">x=p<tspan id="tspan3765">qcx=p<tspan
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3778">sx</tspan>+v<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3780">x</tspan>(y)+d<tspan id="tspan3780">x</tspan>(y)+d<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3782">x</tspan></tspan><tspan id="tspan3782">x</tspan></tspan><tspan
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="913.49939" y="706.85614"
id="tspan3767">y=y</tspan><tspan id="tspan3767">qfy=y</tspan><tspan
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="932.24939" y="725.60614"
id="tspan3769">z=p<tspan id="tspan3769">qcz=p<tspan
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3784">sy</tspan>+v<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3786">z</tspan>(y)+d<tspan id="tspan3786">z</tspan>(y)+d<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3788">z</tspan></tspan><tspan id="tspan3788">z</tspan></tspan><tspan
id="tspan3752" id="tspan3752"
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="950.99939" /><tspan y="744.35614" /><tspan
id="tspan3754" id="tspan3754"
sodipodi:role="line" sodipodi:role="line"
x="84.446236" x="347.44675"
y="969.74939" /></text> y="763.10614" /></text>
<g <g
id="g3894" id="g3894"
transform="translate(10.818705,-53.32076)"> transform="translate(10.818705,-53.32076)">
<g <text
transform="translate(-86.356448,64.943501)" sodipodi:linespacing="125%"
id="g3624"> id="text4417"
<text y="862.1496"
xml:space="preserve" x="194.54089"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="280.89734" xml:space="preserve"><tspan
y="797.20612" y="862.1496"
id="text4417" x="194.54089"
sodipodi:linespacing="125%"><tspan id="tspan4419"
sodipodi:role="line" sodipodi:role="line" /></text>
id="tspan4419" <text
x="280.89734" sodipodi:linespacing="125%"
y="797.20612">v ·(y<tspan id="text3600"
id="tspan3641" y="843.57159"
style="font-size:64.99999762%;baseline-shift:sub">e</tspan>-y<tspan x="199.85245"
id="tspan3639" style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>)</tspan></text> xml:space="preserve"><tspan
<path y="843.57159"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.07920456px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="199.85245"
d="m 355.31423,784.61292 -80.18818,0" id="tspan3602"
id="path3598" sodipodi:role="line" /></text>
inkscape:connector-curvature="0" /> <path
<text inkscape:connector-curvature="0"
xml:space="preserve" id="path3940"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="m 75.483262,842.17966 7.00627,0 -3.10069,-2.33388"
x="286.20889" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
y="778.62811"
id="text3600"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3602"
x="286.20889"
y="778.62811">v·(y-y<tspan
id="tspan3637"
style="font-size:64.99999762%;baseline-shift:sub">s</tspan>)</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 286.23752,769.09771 7.00627,0 -3.10069,-2.33388"
id="path3608"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 278.81444,787.34506 0,11.74818"
id="path3620"
inkscape:connector-curvature="0" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 291.79208,787.07185 0,12.56782"
id="path3622"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path3938"
d="m 281.37064,787.95979 7.00627,0 -3.10069,-2.33388"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.93431133px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 161.83971,777.23616 7.00627,0 -3.10069,-2.33388"
id="path3940"
inkscape:connector-curvature="0" />
</g>
<g <g
transform="translate(55.189138,4.917844)" transform="translate(55.189138,4.917844)"
id="g3860"> id="g3860">
@@ -850,9 +796,13 @@
y="827.30298" y="827.30298"
x="70.195465" x="70.195465"
id="tspan3792" id="tspan3792"
sodipodi:role="line">v<tspan sodipodi:role="line">p<tspan
id="tspan3796" id="tspan3796"
style="font-size:64.99999762%;baseline-shift:sub">x</tspan>(y)</tspan></text> style="font-size:64.99999762%;baseline-shift:sub">0x</tspan>+scl·(p<tspan
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3672">1x</tspan>-p<tspan
style="font-size:64.99999762%;baseline-shift:sub"
id="tspan3674">0x</tspan>)</tspan></text>
<path <path
sodipodi:nodetypes="ccccc" sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
@@ -861,7 +811,7 @@
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path <path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 107.80288,812.25612 5.40935,0 0,63.3667 -5.21616,0 0,0" d="m 190.56327,811.74521 5.40935,0 0,63.3667 -5.21616,0 0,0"
id="path3818" id="path3818"
inkscape:connector-curvature="0" inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" /> sodipodi:nodetypes="ccccc" />
@@ -875,9 +825,13 @@
sodipodi:role="line" sodipodi:role="line"
id="tspan3822" id="tspan3822"
x="70.195465" x="70.195465"
y="846.34308">v<tspan y="846.34308">p<tspan
style="font-size:64.99999762%;baseline-shift:sub" style="font-size:65%;baseline-shift:sub"
id="tspan3824">y</tspan>(y)</tspan></text> id="tspan3680">0y</tspan>+scl·(p<tspan
style="font-size:65%;baseline-shift:sub"
id="tspan3678">1y</tspan>-p<tspan
style="font-size:65%;baseline-shift:sub"
id="tspan3676">0y</tspan>)</tspan></text>
<text <text
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
id="text3826" id="text3826"
@@ -888,9 +842,13 @@
y="867.29114" y="867.29114"
x="70.519196" x="70.519196"
id="tspan3828" id="tspan3828"
sodipodi:role="line">v<tspan sodipodi:role="line">p<tspan
id="tspan3830" style="font-size:65%;baseline-shift:sub"
style="font-size:64.99999762%;baseline-shift:sub">z</tspan>(y)</tspan></text> id="tspan3686">0z</tspan>+scl·(p<tspan
style="font-size:65%;baseline-shift:sub"
id="tspan3684">1z</tspan>-p<tspan
style="font-size:65%;baseline-shift:sub"
id="tspan3682">0z</tspan>)</tspan></text>
</g> </g>
<text <text
sodipodi:linespacing="125%" sodipodi:linespacing="125%"
@@ -902,18 +860,7 @@
y="852.44177" y="852.44177"
x="74.771553" x="74.771553"
id="tspan3834" id="tspan3834"
sodipodi:role="line">v(y)=</tspan></text> sodipodi:role="line">p(y)=</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="170.94273"
y="853.00574"
id="text3848"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3850"
x="170.94273"
y="853.00574">=</tspan></text>
</g> </g>
<flowRoot <flowRoot
xml:space="preserve" xml:space="preserve"
@@ -925,5 +872,105 @@
height="54.642712" height="54.642712"
x="56.828419" x="56.828419"
y="805.37714" /></flowRegion><flowPara y="805.37714" /></flowRegion><flowPara
id="flowPara3858" /></flowRoot> </g> id="flowPara3858" /></flowRoot> <flowRoot
xml:space="preserve"
id="flowRoot3556"
style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:15px;line-height:125%;letter-spacing:0px;word-spacing:0px"><flowRegion
id="flowRegion3558"><rect
id="rect3560"
width="125.79026"
height="60.134426"
x="179.22008"
y="763.85321" /></flowRegion><flowPara
id="flowPara3562"></flowPara></flowRoot> <g
id="g3652"
transform="translate(-139.98799,-0.51090509)">
<text
sodipodi:linespacing="125%"
id="text3552"
y="740.19922"
x="221.22189"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="740.19922"
x="221.22189"
id="tspan3554"
sodipodi:role="line">scl=</tspan></text>
<text
sodipodi:linespacing="125%"
id="text3552-3"
y="728.49036"
x="259.22372"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
id="tspan3604"
y="728.49036"
x="259.22372"
sodipodi:role="line">y-y<tspan
id="tspan3564-7"
style="font-size:64.99999762%;baseline-shift:sub">0</tspan></tspan><tspan
id="tspan3609"
y="747.24036"
x="259.22372"
sodipodi:role="line">y<tspan
id="tspan3611"
style="font-size:64.99999762%;baseline-shift:sub">1</tspan>-y<tspan
id="tspan3613"
style="font-size:64.99999762%;baseline-shift:sub">0</tspan></tspan></text>
<path
inkscape:connector-curvature="0"
inkscape:original-d="m 257.49616,734.57924 42.91603,0"
inkscape:path-effect="#path-effect3650"
id="path3648"
d="m 257.49616,734.57924 42.91603,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<circle
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4534"
cx="503.2533"
cy="915.08173"
r="107.65681" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.67399621px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 389.01618,915.08171 123.25682,0"
id="path4578"
inkscape:path-effect="#path-effect4580"
inkscape:original-d="m 389.01618,915.08171 123.25682,0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
inkscape:original-d="m 415.30888,988.54423 0,-92.76905"
inkscape:path-effect="#path-effect4584"
id="path4582"
d="m 415.30888,988.54423 0,-92.76905"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.53006274px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 514.25995,907.1339 401.54544,987.8765"
id="path4586"
inkscape:path-effect="#path-effect4588"
inkscape:original-d="M 514.25995,907.1339 401.54544,987.8765"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 503.2533,1022.7385 0,-215.31358"
id="path4594"
inkscape:path-effect="#path-effect4596"
inkscape:original-d="m 503.2533,1022.7385 0,-215.31358"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:15px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="437.85251"
y="905.32758"
id="text4598"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4600"
x="437.85251"
y="905.32758">p1x-p0x</tspan></text>
</g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -11,33 +11,39 @@
zamofing_t@ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg$ gpasciiCommander --host $PPMAC -i zamofing_t@ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg$ gpasciiCommander --host $PPMAC -i
$$$*** $$$***
!common() !common()
!mx-stage() !SAR-EXPMX1()
enable plc 1
Motor[1].MaxSpeed=25
Motor[2].MaxSpeed=25
X -12000 ..12000
Y -12000 .. 12000
Gather.Enable=0 Gather.Enable=0
Gather.Items=6 Gather.Items=6
Gather.MaxSamples=1000000 Gather.MaxSamples=1000000
Gather.Period=10 Gather.Period=10
Gather.Addr[0]=Motor[2].DesPos.a Gather.Addr[0]=Motor[1].DesPos.a
Gather.Addr[1]=Motor[3].DesPos.a Gather.Addr[1]=Motor[2].DesPos.a
Gather.Addr[2]=Motor[2].ActPos.a Gather.Addr[2]=Motor[1].ActPos.a
Gather.Addr[3]=Motor[3].ActPos.a Gather.Addr[3]=Motor[2].ActPos.a
Gather.Addr[4]=Motor[4].ActPos.a Gather.Addr[4]=Motor[6].ActPos.a
Gather.Addr[5]=Motor[5].ActPos.a Gather.Addr[5]=Motor[7].ActPos.a
open prog 2 open prog 2
linear abs linear abs
X1000 Y1000 X-12000 Y-12000
dwell 10 dwell 10
Gather.Enable=2 Gather.Enable=2
X28000 Y1000 X-12000 Y12000
dwell 100 dwell 100
X1000 Y1000 X-12000 Y-12000
dwell 100 dwell 100
X1000 Y28000 X12000 Y-12000
dwell 100 dwell 100
X1000 Y1000 X-12000 Y-12000
dwell 1000 dwell 1000
Gather.Enable=0 Gather.Enable=0
close close
#1..7j/
&1 &1
b2r b2r
@@ -57,43 +63,217 @@ b2r
''' '''
import os, sys, json import os, sys, json, time
import numpy as np import numpy as np
import matplotlib as mpl import matplotlib as mpl
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import subprocess as sprc import subprocess as sprc
import telnetlib import telnetlib
if __name__=='__main__': class Interferometer():
def plot_gather(base): def __init__(self,**kwargs):
#rec=Motor[1].ActPos,Motor[2].ActPos,Motor[3].ActPos,Motor[1].DesPos,Motor[2].DesPos,Motor[3].DesPos for k,v in kwargs.iteritems():
#res=rot.ActPos,y.ActPos,x.ActPos,rot.DesPos,y.DesPos,x.DesPos setattr(self,k,v)
def gen_prog(self,prgId=2,mode=0,**kwargs):
'''
kwargs:
acq_per : acquire period: acquire data all acq_per servo loops (default=1)
mode=0: test motion
xrng:
yrng:
spd:
'''
prg=[]
acq_per=kwargs.get('acq_per',10)
gather={"MaxSamples":1000000, "Period":acq_per}
#Sys.ServoPeriod is dependent of !common() macro
ServoPeriod= .2 #0.2ms
#ServoPeriod = .05
self.meta = {'timebase': ServoPeriod*gather['Period']}
channels=["Motor[1].DesPos","Motor[2].DesPos","Motor[1].ActPos","Motor[2].ActPos","Motor[6].ActPos","Motor[7].ActPos"]
prg.append('Gather.Enable=0')
prg.append('Gather.Items=%d'%len(channels))
for k,v in gather.iteritems():
prg.append('Gather.%s=%d'%(k,v))
for i,c in enumerate(channels):
prg.append('Gather.Addr[%d]=%s.a'%(i,c))
prg.append('open prog %d'%(prgId))
prg.append(' P1000=0')
# this uses Coord[1].Tm and limits with MaxSpeed
#******** mode -1 ********
if mode==0: #### jog all motors 10000um (or 10000 mdeg)
xRng = kwargs.get('xRng', (-12000,12000))
yRng = kwargs.get('yRng', (-12000,12000))
spd = kwargs.get('spd', 10)
prg.append('Motor[1].MaxSpeed=%f'%spd)
prg.append('Motor[2].MaxSpeed=%f'%spd)
prg.append('''
linear abs
X%g Y%g
dwell 10
Gather.Enable=2
X%g Y%g
dwell 100
X%g Y%g
dwell 100
X%g Y%g
dwell 100
X%g Y%g
dwell 100
Gather.Enable=0
'''%(xRng[0],yRng[0],xRng[0],yRng[1],xRng[0],yRng[0],xRng[1],yRng[0],xRng[0],yRng[0]))
prg.append(' P1000=1')
prg.append('close')
prg.append('&1\nb%dr\n'%prgId)
self.download(prg,mode=3,file='/tmp/prg.cfg')
def download(self,prg=None,mode=0,file='/tmp/interfero.cfg'):
'''
mode bits:
bit 0 (1): wait execution finished (P1000==1)
bit 1 (2): gather and save data
bit 2 (4): ...
'''
host=self.host
if prg is not None and self.verbose & 4:
for ln in prg:
print(ln)
if file is not None and prg is not None:
fh=open(file,'w')
fh.write('\n'.join(prg))
fh.close()
if host is not None:
# ***download and start the program***
cmd ='gpasciiCommander --host '+host+' '+ file
print(cmd)
p = sprc.Popen(cmd, shell=True)#, stdout=sprc.PIPE, stderr=sprc.STDOUT)
#res=p.stdout.readlines(); print res
retval = p.wait()
if mode &1:
# ***wait program finished P1000=1***
com=GpasciiCommunicator().connect(host,prompt='# ')
ack=GpasciiCommunicator.gpascii_ack
sys.stdout.write('wait execution...');sys.stdout.flush()
while(True):
#Gather.MaxLines calculates maximum numbewr of gathering into memory
com.write('P1000\n')
val=com.read_until(ack)
#print val
val=int(val[val.find('=')+1:].rstrip(ack))
if val==1:break
#com.write('Gather.Index\n')
#val=com.read_until(ack)
#print val
time.sleep(.2)
sys.stdout.write('.');sys.stdout.flush()
if mode &2:
fnRmt = '/var/ftp/gather/out.txt'
fnLoc = '/tmp/gather.txt'
print('\ngather data to %s...' % fnRmt)
p = sprc.Popen(('ssh', 'root@' + host, 'gather ', '-u', fnRmt), shell=False, stdin=sprc.PIPE, stdout=sprc.PIPE,
stderr=sprc.PIPE)
res = p.wait()
if res:
print('ssh failed. ssh root@%s to open a session' % host)
return
print('transfer data to %s...' % fnLoc)
p = sprc.Popen(('scp', 'root@' + host + ':' + fnRmt, fnLoc), shell=False, stdin=sprc.PIPE, stdout=sprc.PIPE,
stderr=sprc.PIPE)
res = p.wait()
self.rec = np.genfromtxt(fnLoc, delimiter=' ')
def show_pos(self):
rec=self.rec
#"M1.DesPos","M2.DesPos","M1.ActPos","M2.ActPos","M6.ActPos","M7.ActPos"]
#idx 0 1 2 3 4 5 #idx 0 1 2 3 4 5
f1=plt.figure() f1=plt.figure()
#f2 = plt.figure()
ax1 = f1.add_subplot(1,1,1) ax1 = f1.add_subplot(1,1,1)
#ax2 = f2.add_subplot(1, 1, 1)
for fn in sorted(os.listdir(base)): x=range(len(rec[:,0]))
print fn
rec = np.genfromtxt(base+'/'+fn, delimiter=' ')
print rec.shape
x=range(len(rec[:,0])) hl=ax1.plot(x,-(rec[:,0]-rec[0,0]),'k')
#hl=ax[0].plot(x, y, color=col) hl=ax1.plot(x,-(rec[:,2]-rec[0,2]),'r')
hl=ax1.plot(x,-(rec[:,4]-rec[0,4])/100,'m')
hl=ax1.plot(x,-(rec[:,0]-rec[0,0]),'k') hl=ax1.plot(x,rec[:,1]-rec[0,1],'k')
hl=ax1.plot(x,-(rec[:,2]-rec[0,2]),'r') hl=ax1.plot(x,rec[:,3]-rec[0,3],'b')
hl=ax1.plot(x,-(rec[:,4]-rec[0,4])/100,'m') hl=ax1.plot(x,-(rec[:,5]-rec[0,5])/100,'c')
hl=ax1.plot(x,rec[:,1]-rec[0,1],'k') #hl=ax1.plot(x,-(rec[:,0]-rec[0,0]),'k')
hl=ax1.plot(x,rec[:,3]-rec[0,3],'b') #hl=ax1.plot(x,-(rec[:,2]-rec[0,2]),'r')
hl=ax1.plot(x,-(rec[:,5]-rec[0,5])/100,'c') #hl=ax1.plot(x,-(rec[:,4]-rec[0,4])/100,'m')
#hl=ax1.plot(x,rec[:,1]-rec[0,1],'k')
#hl=ax1.plot(x,rec[:,3]-rec[0,3],'b')
#hl=ax1.plot(x,-(rec[:,5]-rec[0,5])/100,'c')
plt.show() plt.show()
#plot_gather(base='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/gather5/') def show_poserr(self):
#plot_gather(base='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/gather50/') rec=self.rec
#plot_gather(base='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/tmp/') #"M1.DesPos","M2.DesPos","M1.ActPos","M2.ActPos","M6.ActPos","M7.ActPos"]
#plot_gather(base='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/data_interfero_spd10') #idx 0 1 2 3 4 5
#plot_gather(base='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/data_interfero_spd20') f1=plt.figure()
plot_gather(base='data_interfero_spd10') ax1 = f1.add_subplot(1,1,1)
t=range(len(rec[:,0]))
actYerr=(rec[:,2]-rec[:,0]);actYerr-=actYerr[0]
actXerr=(rec[:,3]-rec[:,1]);actXerr-=actXerr[0]
infYerr=(rec[:,4]-rec[:,0]);infYerr-=infYerr[0]
infXerr=(rec[:,5]-rec[:,1]);infXerr-=infXerr[0]
hl=ax1.plot(t,actYerr,'r',label='actYerr')
hl=ax1.plot(t,actXerr,'b',label='actXerr')
hl=ax1.plot(t,infYerr,'m',label='infYerr')
hl=ax1.plot(t,infXerr,'c',label='infXerr')
#plt.legend(handles=h)
ax1.legend()
plt.show()
class GpasciiCommunicator():
'''Communicates with the Delta Tau gpascii programm
'''
gpascii_ack="\x06\r\n"
gpascii_inp='Input\r\n'
def connect(self, host, username='root', password='deltatau',prompt='ppmac# ',verbose=0):
p=telnetlib.Telnet(host)
s=p.read_until('login: ')
if verbose: print(s)
p.write(username+'\n')
s =p.read_until('Password: ')
if verbose: print(s)
p.write(password+'\n')
s =p.read_until(prompt) # command prompt
if verbose: print(s)
p.write('gpascii -2\n') # execute gpascii command
s=p.read_until(self.gpascii_inp)
if verbose: print(s)
return p
if __name__=='__main__':
ifm=Interferometer(verbose = 255,host='SAR-CPPM-EXPMX1')
os.chdir(os.path.join(os.path.dirname(__file__), '../cfg'))
ifm.download(['$$$***','!common()','!SAR-EXPMX1()','#1..7j/','enable plc 1','Motor[1].MaxSpeed=25','Motor[2].MaxSpeed=25'])
raw_input('press return when homed')
#ifm.gen_prog(mode=0)
#ifm.show_poserr()
#ifm.gen_prog(mode=0,xRng=(-10000,10000),yRng=(-10000,10000),spd=10)
ifm.gen_prog(mode=0,xRng=(-5000,5000),yRng=(-5000,5000),spd=5)
ifm.show_poserr()
#ifm.gen_prog(mode=0,xRng=(-2000,2000),yRng=(4000,8000),spd=5)
#ifm.show_poserr()
#ifm.rec = np.genfromtxt('/scratch/gather.txt', delimiter=' ')
#ifm.show_pos()

View File

@@ -296,7 +296,7 @@ P=$(P),M=MOT_GIRDER5</string>
<string>Home BkLight</string> <string>Home BkLight</string>
</property> </property>
<property name="channel" stdset="0"> <property name="channel" stdset="0">
<string notr="true">$(P):MOTOR_BLGT.HOMF</string> <string notr="true">$(P):MOT_BLGT.HOMF</string>
</property> </property>
<property name="pressMessage"> <property name="pressMessage">
<string notr="true">1</string> <string notr="true">1</string>