diff --git a/Helical1.pbi b/Helical1.pbi deleted file mode 100644 index 152a1f6..0000000 --- a/Helical1.pbi +++ /dev/null @@ -1,113 +0,0 @@ -[ - [ - "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" - ] -] \ No newline at end of file diff --git a/MX3_coordTrf.md b/MX3_coordTrf.md deleted file mode 100644 index 2ba408b..0000000 --- a/MX3_coordTrf.md +++ /dev/null @@ -1,212 +0,0 @@ - - -``` - -telnet SAR-CPPM-EXPMX3 50001 - -zamofing_t@ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX$ PBInspect --host SAR-CPPM-EXPMX3 --cfg PBInspect3.pbi - - - -ssh root@SAR-CPPM-EXPMX3 -sendgetsends -1 - - -gpasciiCommander --host SAR-CPPM-EXPMX3 -i -//!MX3_coordTrf(exc=5000,height=118000,width=377500,length=600000,camSf=1.7453292519943296e-05) -!MX3_coordTrf(exc=5000,height=0,width=377500,length=600000,camSf=1.7453292519943296e-05) -!MX3_coordTrf(exc=5000,height=0,width=377500,length=600000,camSf=1.7453292519943296e-05,q=-.8) -Coord[1].Ta=10 -Coord[1].Td=10 -Coord[1].AltFeedRate=1000 -Coord[1].Tm=-10000 //1000um/FeedTime -> 1mm/sec -Coord[1].FeedTime=1000 //default value 1000um - - -list subProg10 -call15 -jog1=(L0) -call16 - -open prog 1 -call15 -abslinear -X(0) Y(0) U(0) V(0) w(0) -call16 -close -&1b1r - -open prog 1 -call15 -abslinear -X(2000) Y(0) U(0) V(0) w(0) -dwell 1000 -X(-2000) Y(0) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -call16 -close - -open prog 2 -call15 -abslinear -X(0) Y(2000) U(0) V(0) w(0) -dwell 1000 -X(0) Y(-2000) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -call16 -close - -open prog 3 -call15 -abslinear -X(0) Y(0) U(2000) V(0) w(0) -dwell 1000 -X(0) Y(0) U(-2000) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -call16 -close - -open prog 4 -call15 -abslinear -X(0) Y(0) U(0) V(2000) w(0) -dwell 1000 -X(0) Y(0) U(0) V(-2000) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -call16 -close - -open prog 5 -call15 -abslinear -X(0) Y(0) U(0) V(0) w(2000) -dwell 1000 -X(0) Y(0) U(0) V(0) w(-2000) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -call16 -close - -&1b1r -&1b2r -&1b3r -&1b4r -&1b5r - - - - - - - - -open prog 2 -call15 -abslinear -X(2000) Y(0) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -dwell 1000 -X(0) Y(2000) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(2000) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(2000) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -dwell 1000 -X(0) Y(0) U(0) V(0) w(2000) -dwell 1000 -X(0) Y(0) U(0) V(0) w(0) -call16 -close -&1b2r - -cpx call 15 -#1..5j=90000 -cpx call 16 - - - -Koordinate U is wrong - - - -fwd_inp(0) 90000 90000 90000 90000 90000 -fwd_inp(0) 2.16489e-13 2.16489e-13 2.16489e-13 2.16489e-13 2.16489e-13 -fwd_res -3.17041e-14 4.01274e-13 1.26816e-13 6.34082e-14 -6.34082e-14 -inv_inp(0) 2000 0 0 0 0 -inv_res 73570.1 106430 73570.1 106430 90000 -inv_inp(0) 0 0 0 0 0 -inv_res 90000 90000 90000 90000 90000 -inv_inp(0) 0 2000 0 0 0 -inv_res 73570.1 73570.1 73570.1 73570.1 66421.8 -inv_inp(0) 0 0 0 0 0 -inv_res 90000 90000 90000 90000 90000 -inv_inp(0) 0 0 2000 0 0 -inv_res 81869.9 98130.1 81869.9 81869.9 101537 -inv_inp(0) 0 0 0 0 0 -inv_res 90000 90000 90000 90000 90000 -inv_inp(0) 0 0 0 2000 0 -inv_res 98130.1 81869.9 81869.9 98130.1 90000 -inv_inp(0) 0 0 0 0 0 -inv_res 90000 90000 90000 90000 90000 -inv_inp(0) 0 0 0 0 2000 -inv_res 98130.1 98130.1 81869.9 81869.9 78463 -inv_inp(0) 0 0 0 0 0 -inv_res 90000 90000 90000 90000 90000 - - - - - - - - - - - - - - -> list forward -list forward -L6=118000/377500 -L7=5000/1.4142135623700001 -L11=L7*cos(L2*0.0000174532925199) -L12=L7*cos(L1*0.0000174532925199) -L13=L7*cos(L4*0.0000174532925199) -L14=L7*cos(L5*0.0000174532925199) -L15=L7*cos(L3*0.0000174532925199) -C6=0.5*L11-0.5*L12+(L6+0.25)*L13+(L6-0.75)*L14+(0.25-L6)*1.4142135623700001*L15 -C7=0.5*L11+0.5*L12+0.25*L13+0.25*L14+0.25*1.4142135623700001*L15 -C3=1*L13+1*L14-1*1.4142135623700001*L15 -C4=-1*L11+1*L12+1.5*L13-0.5*L14-0.5*1.4142135623700001*L15 -C5=-1*L11-1*L12+0.5*L13+0.5*L14+0.5*1.4142135623700001*L15 -D0=248 -> list inverse -list inverse -L6=118000/377500 -L11=0.5*C6+0.5*C7+(0.25-0.5*L6)*C3-0.25*C4-0.25*C5 -L12=-0.5*C6+0.5*C7+(0.5*L6-0.25)*C3+0.25*C4-0.25*C5 -L13=0.5*C6+0.5*C7+(0.25-0.5*L6)*C3+0.25*C4+0.25*C5 -L14=-0.5*C6+0.5*C7+(0.25+0.5*L6)*C3-0.25*C4+0.25*C5 -L15=0.5*1.4142135623700001*C7-0.25*1.4142135623700001*C3+0.25*1.4142135623700001*C5 -L7=1.4142135623700001/5000 -L2=acos(L11*L7)/0.0000174532925199 -L1=acos(L12*L7)/0.0000174532925199 -L4=acos(L13*L7)/0.0000174532925199 -L5=acos(L14*L7)/0.0000174532925199 -L3=acos(L15*L7)/0.0000174532925199 -> - - -``` diff --git a/Makefile b/Makefile deleted file mode 100644 index 45b3957..0000000 --- a/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -include /ioc/tools/driver.makefile -MODULE = $(notdir $(shell pwd)) -BUILDCLASSES = Linux -ARCH_FILTER = ARCH_FILTER = $(EPICS_HOST_ARCH) RHEL7-x86_64 eldk42% -EXCLUDE_VERSIONS = 3.14 # 7.0.6 -#EPICS_VERSIONS = 7.0.7 - -#SCRIPTS+=$(wildcard add_EXPMX*.cmd cfg/*.cfg cfg/*.py cfg/*.pbi python/*.py) -SCRIPTS+=$(wildcard add_EXPMX*.cmd cfg/*.cfg cfg/*.py cfg/*.pbi) -#SOURCES+=src/DHVSaSub.cpp -#DBDS+=src/DHVSaSub.dbd -USR_CXXFLAGS+= -fno-operator-names - -.PHONY: install_ioc generate - -install_ioc: generate - cd gen/ioc;make install - -generate: - /opt/gfa/python-3.8/latest/bin/python generate.py -m 0xf diff --git a/PBInspect.pbi b/PBInspect.pbi deleted file mode 100644 index 788b605..0000000 --- a/PBInspect.pbi +++ /dev/null @@ -1,184 +0,0 @@ -[ - [ - "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", - [ - [ - "Motor[1].idCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].iqCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].idMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].iqMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "EncTable[2].PrevEnc", - null - ], - [ - "Motor[2].Pos", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].DesPos", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].PosError", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].Servo.Integrator", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].ServoOut", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].idCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].iqCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].idMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].iqMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].iaMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].ibMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[2].I2tSum", - "lambda v: '%.8g'%float(v)" - ], - [ - "EncTable[3].PrevEnc", - null - ], - [ - "Motor[3].Pos", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].DesPos", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].PosError", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].Servo.Integrator", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].ServoOut", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].idCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].iqCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].idMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].iqMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].iaMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].ibMeas", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[3].I2tSum", - "lambda v: '%.8g'%float(v)" - ], - [ - "P2000", - null - ], - [ - "P3000", - 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=2;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", - [ - 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" - ], - [ - "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=2058;floaty=457;floatw=208;floath=377;notebookid=-1;transparent=255" - ], - [ - "StatusMotorListCtrl", - [ - 2 - ], - "name=m2;caption=motor2;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=2588;floaty=946;floatw=208;floath=677;notebookid=-1;transparent=255" - ] -] \ No newline at end of file diff --git a/PBInspect1.pbi b/PBInspect1.pbi deleted file mode 100644 index 322c7cd..0000000 --- a/PBInspect1.pbi +++ /dev/null @@ -1,191 +0,0 @@ -[ - [ - "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[9].PrevEnc", - null - ], - [ - "EncTable[10].PrevEnc", - null - ], - [ - "EncTable[11].PrevEnc", - null - ], - [ - "EncTable[12].PrevEnc", - null - ], - [ - "EncTable[13].PrevEnc", - null - ], - [ - "EncTable[14].PrevEnc", - null - ], - [ - "EncTable[15].PrevEnc", - null - ], - [ - "EncTable[16].PrevEnc", - null - ], - [ - "Motor[1].idCmd", - null - ], - [ - "Motor[2].idCmd", - null - ], - [ - "Motor[1].ServoOut", - null - ], - [ - "Motor[2].ServoOut", - null - ], - [ - "Motor[1].iqCmd", - null - ], - [ - "Motor[2].iqCmd", - null - ] - ], - "name=w;caption=watch;state=67377148;dir=4;layer=0;row=2;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=3;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=3;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" - ], - [ - "WatchListCtrl", - [ - [ - "P2010", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2011", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2012", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2013", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2014", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2015", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2016", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2017", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2018", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2019", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2020", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2021", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2022", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2023", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2024", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2025", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2026", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2027", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2028", - "lambda v: '%.5g'%float(v)" - ], - [ - "P2029", - "lambda v: '%.5g'%float(v)" - ] - ], - "name=w-1;caption=watch;state=67377148;dir=4;layer=0;row=1;pos=0;prop=129863;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=464;floaty=580;floatw=208;floath=377;notebookid=-1;transparent=255" - ] -] \ No newline at end of file diff --git a/PBInspect2.pbi b/PBInspect2.pbi deleted file mode 100644 index c3ec8b9..0000000 --- a/PBInspect2.pbi +++ /dev/null @@ -1,153 +0,0 @@ -[ - [ - "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", - [ - [ - "Motor[1].idCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].iqCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].ServoOut", - "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", - null - ], - [ - "P2000", - 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", - [ - 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=991;floaty=738;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=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" - ] -] \ No newline at end of file diff --git a/PBInspect3.pbi b/PBInspect3.pbi deleted file mode 100644 index c3ec8b9..0000000 --- a/PBInspect3.pbi +++ /dev/null @@ -1,153 +0,0 @@ -[ - [ - "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", - [ - [ - "Motor[1].idCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].iqCmd", - "lambda v: '%.8g'%float(v)" - ], - [ - "Motor[1].ServoOut", - "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", - null - ], - [ - "P2000", - 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", - [ - 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=991;floaty=738;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=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" - ] -] \ No newline at end of file diff --git a/PPMACMotor.template b/PPMACMotor.template deleted file mode 100644 index 01b9845..0000000 --- a/PPMACMotor.template +++ /dev/null @@ -1,21 +0,0 @@ -record(motor,"$(P):$(M)") -{ - field(DESC,"$(DESC)") - field(DTYP,"asynMotor") - field(OUT,"@asyn($(PORT=PPMAC),$(ADDR))") - field(DIR,"$(DIR=0)") - field(VMAX,"$(VMAX=0)") - field(VELO,"$(VELO)") -# field(JVEL,"$(JVEL=$(VELO)") - field(HVEL,"$(HVEL=1)") - field(ACCL,"$(ACCL=.1)") - field(JAR, "$(JAR=20)") - field(MRES,"$(MRES=1)") - field(PREC,"$(PREC=0)") - field(EGU,"$(EGU=ustep)") - field(DHLM,"$(DHLM=0)") - field(DLLM,"$(DLLM=0)") - field(MDEL,"$(MDEL=0.001)") - field(TWV,"$(TWV=0.1)") - field(RTRY,"0") -} diff --git a/Readme.md b/Readme.md index a777a0b..3060e3e 100644 --- a/Readme.md +++ b/Readme.md @@ -2,1541 +2,9 @@ Various motor documents ----------------------- - /home/zamofing_t/Documents/doc-ext/SwissFEL/ESB-MX-Stage -Parker stage ------------- -``` -- encoder is incremental encoder -25mm or 50mm travel stage -Stall Current Continuous 0.8 -Peak Current Amps RMS 2.4 (->sqrt(2)*2.4=3.39A_peak) -Resistance Ohms 8.8 -Inductance mH 2.4 -Max.BuxVoltage V 80 -Continous Force 4N -> assume 1kg load -> acceleration=a=F/m=4m/s^2 -Weight top stage: 250g=2.5N -``` - - -Mecapion rot stage ------------------- -``` -http://www.lsmecapion.com/eng/ -http://www.lsmecapion.com/eng/contents/sub01/sub02_03.php -http://www.a2v.fr/program/mdm-dc06d.htm -http://www.parkem.ch/medien/produkte/direktantriebstechnik/pdf/MDM_Rundtisch_katalog.pdf -http://www.goto.si/wp-content/uploads/2016/kat/L7%20Series%20catalog.pdf -http://farasys.ir/wp-content/uploads/2015/Direct%20Drive%20Rotary%20Motors.pdf -http://www.inmoco.co.uk/Upload/product/1037_DD_Series_Motors_79.pdf - -- encoder is biss 20 bit -- Rated Current 1.46 Arms -- Max Current 4.38 Arms -- 32 pole (16 einraster per rev) -``` - -Testing ServoFrq. ------------------ -``` -!common(PhaseFreq=20000,PhasePerServo=4) -> 25000points, 20um error leads the trajectory in x -!common(PhaseFreq=20000,PhasePerServo=2) -> 25000points, 6.6um error -!common(PhaseFreq=20000,PhasePerServo=1) -> 25000points, 6.1um error ossilates in y, x is quite good - --> the servo loop has to be optimized! -``` - -Testing linear,pvt,spline moves -------------------------------- -``` -Tested with shapepath.py: THE BEST TRAJECTORY RESULT IST WITH PVT MOTION -``` - - -Optimize/Test Parameters with Parker Stage ------------------------------------------- -``` -used ESB_MX/python/move_record.py to record and plot friction -used src/usrServo/usrcode.c to filter the following error of the stage - -Check Simulink project at /home/zamofing_t/afs/ESB-MX -subl /home/zamofing_t/afs/ESB-MX/Readme.md - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg -gpasciiCommander --host SAR-CPPM-EXPMX1 -i -!mx-stage() -#1..3$ -&1 -#1..3j/ - -load program prg/testPerfGrid.prg -b2r - -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/src/usrServo -make #will install the user servo loop -watch P3000 (average following error) -tweak servo parameters ->!motor_servo(mot=3,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000) - -Same for motor 2 -> watcp P2000 -Increase load will need an increase of gains to compensate following error - -Motor[2].Servo.Kp=20 -Motor[2].Servo.Kvfb=1000 -Motor[2].Servo.Ki=0.07 -Motor[2].Servo.Kvff=1000 -Motor[2].Servo.Kaff=4000 - - -Motor[3].Servo.Kp=20 -Motor[3].Servo.Kvfb=220 -Motor[3].Servo.Ki=0.02 -Motor[3].Servo.Kvff=240 -Motor[3].Servo.Kaff=1500 - - ./shapepath.py --yx -average error x 0.313575 um, y 0.461707 um, 0.629583 um - -./shapepath.py -average error x 0.371877 um, y 0.317152 um, 0.542073 um -``` - -Start motion on external signal -------------------------------- -``` -open plc 1 -Coord[1].DesTimeBase=0 // freezes timebase at boot -while(1) -{ - if(PowerBrick[0].GpioData[0].0.1==1) - { - PowerBrick[0].GpioData[0].16.8=255 - Coord[1].DesTimeBase=Sys.ServoPeriod - } - else - { - PowerBrick[0].GpioData[0].16.8=7 - Coord[1].DesTimeBase=0 - } -} -close -enable plc 1 --> run motion program. press gpio 0 to run at 100% - -``` - -29.9.17 Testing in MX-LAB -------------------------- -``` -Start the powerbrick. ioc is started automatically -zamofing_t@ganymede:~$ ssh x06mx-cons-1 - -caget SAR-ESB_MX:MOTOR_AX -cd /net/slsfs-crtl/export/sf/common/config/qt/ -startDM -macro 'P=SAR-ESB_MX' ESB_MX_exp -press homing button --> all axes can be moved. - -(on thierrys laptop only) -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python -./shapepath.py -will execute the custom motion. No problems with EPICS - -(on other machines) -module is installed in: -ls /net/slsfs-crtl/export/sf/ioc/modules/ESB_MX/zamofing_t/R3.14.12/ -PATH=/net/slsfs-crtl/export/sf/controls/bin/:$PATH -source /opt/gfa/python-2.7/2.3.0/bin/activate xblpython > /dev/null 2>&1 -cd /net/slsfs-crtl/export/sf/ioc/modules/ESB_MX/zamofing_t/R3.14.12/ -./shapepath.py - -``` - - -export EPICS_CA_ADDR_LIST="129.129.109.255" -export EPICS_CA_ADDR_LIST="129.129.126.255" -caQtDm -macro 'P=SAR-ESB_MX' ESB_MX_exp - -HelicalScan ------------ -``` -PPMAC=MOTTEST-CPPM-CRM0485 - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX -PBInspect --host $PPMAC --cfg PBInspect1.pbi - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg -gpasciiCommander --host $PPMAC sim_8_motors.cfg -i - -ssh root@$PPMAC -sendgetsends -1 -cpx send 1"SampleMessage\n" - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python -./helicalscan.py -``` - -fwd/inv kinematic stuff ------------------------ -``` -Coord[1].SegMoveTime=.05, will calculate all 0.05 sec the inverse kinematic. -default Coord[1].SegMoveTime=0, calculates inv kin. only at endpoints - -&1p ->this will trigger:forward kinematic -cpx pmatch ->this will trigger:forward kinematic - -cpx ;linear rel; X0Y0Z0B0 ->this will trigger: inverse - -test_coord_trf() (w is in mdeg) -> Output: -input : cx:0.2 cz:0.3 w:5729.58 fy:0.4 -fwd_trf: dx:-1.14768 dz:-19.0991 w:5729.58 fy:0.4 -inv_trf: cx:0.2 cz:0.3 w:5729.58 fy:0.4 - -input : dx:0.2 dz:0.3 w:5729.58 fy:0.4 -inv_trf: cx:1.54768 cz:19.6991 w:5729.58 fy:0.4 -fwd_trf: dx:0.2 dz:0.3 w:5729.58 fy:0.4 - -#4j=0.2 //cx -#5j=0.3 //cz -#3j=5729.58 //w -#1j=0.4 //fy -&1p -forward kinematic 0.199997 0.300003 5729.58 0.399994 -forward result -1.14769 -19.0991 5729.58 0.399994 - -cpx ;linear abs; X.2Y.4Z.3B5729.58 -inverse kinematic 0.2 0.3 5729.58 0.4 -inverse result 1.54579 19.7026 5729.58 0.4 - - -input : cx:10 cz:20 w:171887 fy:40 -fwd_trf: dx:28.9419 dz:-5.52304 w:171887 fy:40 -inv_trf: cx:10 cz:20 w:171887 fy:40 -#4j=10 //cx -#5j=20 //cz -#3j=171887 //w -#1j=40 //fy -&1p -forward kinematic 10 20 171887 40 -forward result 28.942 -5.52296 171887 40 - -input : dx:10 dz:20 w:171887 fy:40 -inv_trf: cx:-8.94193 cz:45.523 w:171887 fy:40 -fwd_trf: dx:10 dz:20 w:171887 fy:40 - -cpx ;linear abs; X10 Z20 B171887 Y40 -inverse kinematic 10 20 171887 40 -inverse result -8.94198 45.523 171887 40 -``` - -Motors final setup 20.12.17 ---------------------------- -``` -SAR-CPPM-EXPMX1: biss:y timing:y - 1: fy - 2: fx - 3: ry - 4: cx - 5: cz - 6: interfero y - 7: interfero x - -labels: -MOT_FY EXPMX1.1 MOT_FX EXPMX1.2 MOT_ROT_Y EXPMX1.3 MOT_CX EXPMX1.4 MOT_CZ EXPMX1.5 -ENC_FY EXPMX1.1 ENC_FX EXPMX1.2 ENC_ROT_Y EXPMX1.3 ENC_CX EXPMX1.4 ENC_CZ EXPMX1.5 -IFR_FY EXPMX1.6 IFR_FX EXPMX1.7 - -SAR-CPPM-EXPMX2: biss:n timing:n - 1: wedge1 - 2: wedge2 - 3: wedge3 - 4: wedge4 - 5: backlight - 6: cryojet - -SAR-CPPM-EXPMX3: biss:n timing:y - 1: girder1 - 2: girder2 - 3: girder3 - 4: girder4 - 5: girder5 - - -PPMAC=MOTTEST-CPPM-CRM0485 -ssh root@$PPMAC -cd /ioc/SAR-CPPM-EXPMX1;iocsh startup.script -sendgetsends -1 - - -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 EPICS_CA_ADDR_LIST="129.129.126.255" -caqtdm -macro "P=SAR-EXPMX" ESB_MX_exp.ui - -``` - -TODO 5.1.18 ------------ -``` -Fwd/inv kinematic is not yet fully correct for PVT moves: -Inverse kinematic need to calculate velocities: -Now a simplified approach with no dependencies is implemented: - vqCX=vDX - vqCZ=vDZ - vqW=vW - vqFY=vY - -To see the differences compare: - hs.gen_prog(fnPrg='/tmp/prg.cfg',host='MOTTEST-CPPM-CRM0485',mode=1,cntHor=1,cntVert=5,wRng=(120000,120000),pt2pt_time=100) - hs.gen_prog(fnPrg='/tmp/prg.cfg',host='MOTTEST-CPPM-CRM0485',mode=1,cntHor=1,cntVert=5,wRng=(120000,120000),pt2pt_time=100,smt=0) - - hs.gen_prog(fnPrg='/tmp/prg.cfg',host='MOTTEST-CPPM-CRM0485',mode=1,cntHor=1,cntVert=5,wRng=(0,360000)) - hs.gen_prog(fnPrg='/tmp/prg.cfg',host='MOTTEST-CPPM-CRM0485',mode=1,cntHor=1,cntVert=5,wRng=(0,360000),smt=0) - -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). -``` - - -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() - -``` - -``` -!!! WATCH OUT !!! -if the send buffer overruns, the programs will abort in an unexplainable way: - send 1"inv_res %f %f %f %f\\n",qCX,qCZ,qW,qFY -without reading it with sendgetsends -1 -``` - - -5 CAM mover ------------ -``` -/home/zamofing_t/Documents/doc-ext/SwissFEL/Devices/5CAM -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/5CAM_SYSTEM/ -git@git.psi.ch:epics_ioc_modules/5CAM_SYSTEM.git - -copied the coordTrf.py from /home/zamofing_t/Documents/doc-ext/SwissFEL/Devices/5CAM -to /cfg/MX3_coordTrf.py and modify it - -PPMAC=MOTTEST-CPPM-CRM0485 -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX -PBInspect --host $PPMAC --cfg PBInspect3.pbi - -PPMAC=MOTTEST-CPPM-CRM0485 -ssh root@$PPMAC -sendgetsends -1 - - - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg -gpasciiCommander --host $PPMAC -i -$$$*** -!common() -!SAR-EXPMX3() -``` - -5 CAM mover commissioning EH60 27.3.18 --------------------------------------- -``` -PPMAC=SAROP11-CPPM-MOT6765 -PPMAC=MOTTEST-CPPM-CRM0515 -PBInspect --host $PPMAC - -gpasciiCommander --host $PPMAC -i -$$$*** -!common() -PowerBrick[0].GpioData[0].17=1 -16 fail -17 ok -18 fail -19 ok -20 fail -21 fail on box -22 fail on box -23 fail on box -21 fail on box - -Testing on motor 2 - -$$$*** -!common() -!encoder_sim(enc=2,tbl=2,mot=2) -!motor(mot=2,dirCur=1000,JogSpeed=1024) -!encoder_ssi(enc=2,tbl=10,mot=10,numBits=18) - -PowerBrick[0].GpioData[0].17=1 -#2j:102400 -PowerBrick[0].GpioData[0].17=0 -#2k - -#2j:10240000 == 360 deg = 262037.6288 inc = 360000mdeg - - -//the motor has 512*200*100 usteps per revolution (512 uystep/step, 200 steps/rev 1:100 gear) -//the ssi-encoder has 2**18=262144 steps per revolution - - -//motor_u_steps/inc_enc_step=39.0625 -//the ssi-encoder has 2**18=262144 steps per revolution - -//10240000 ustep == 262144 encCnt == 360deg=360000mdeg -//posSf = userUnits/encoder_steps=360000/262144=5625./4096. -//servoSf=motor_u_steps/userUnits 10240000/360000=256./9. - - -$$$*** -!common() -!encoder_ssi(enc=2,numBits=18,posSf=5625./4096.) -!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,HomeOffset=0) -PowerBrick[0].GpioData[0].17=1 -#2j:360000 -PowerBrick[0].GpioData[0].17=0 -#2k -!cm_brake(mot=2,curOn=1000,cs=1,delay=200,gpio=17) - - - -cpx r0=180000;call 20 //motor 2 180deg -cpx r0=0 ;call 20 //motor 2 0 deg - - - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/ -gpasciiCommander --host $PPMAC -i -$$$*** -!common() -!SAR-EXPMX3() -cpx call 15 //current on, open breaks -#1..5j=180000 -#1..5j=0 -cpx call 16 //close breaks, current off -&1 -cpx r0=180000;call 20 //motor 2 180deg - -open prog 10 -call15 -abslinear -X(10) Y(0) U(0) V(0) W(0) -call16 -close -b10r - -open prog 11 -call15 -abslinear -jog1=0 -jog2=0 -jog3=0 -jog4=0 -jog5=0 -call16 -close -b11r - -open prog 12 -call15 -abslinear -jog1=180000 -jog2=180000 -jog3=180000 -jog4=180000 -jog5=180000 -call16 -close -b12r -&1p -``` - -5 CAM coord trf EH60 27.3.18 ----------------------------- -``` -PPMAC=MOTTEST-CPPM-CRM0515 -ssh root@$PPMAC -sendgetsends -1 - - -open prog 12 -call15 -abslinear -jog1=180000 -jog2=180000 -jog3=180000 -jog4=180000 -jog5=180000 -call16 -close -b12r -&1p -``` - -5 CAM coord trf EH60 27.3.18 ----------------------------- -``` -PPMAC=MOTTEST-CPPM-CRM0515 -ssh root@$PPMAC -sendgetsends -1 - -$$$*** -!common() -!SAR-EXPMX3() - - -&1p -> execute forward kinematics - -cpx call 15 -#1..5j=0 -cpx abslinear X(0)Y(0)U(0)V(0)W(0) ->executes inverse kinematic -cpx call 16 - - - - - L6=2000/3000 - L7=1000/1.41421356237 - L11=L7*sin(L1*1.74532925199e-05) - L12=L7*sin(L2*1.74532925199e-05) - L13=L7*sin(L3*1.74532925199e-05) - L14=L7*sin(L4*1.74532925199e-05) - L15=L7*sin(L5*1.74532925199e-05) - - -$$$*** -!common() -!SAR-EXPMX3() -&1 -#1..5j/ -#1..5hmz - -open prog 1 - //homez1..5 - call 15 - jog1..5=0 - call 16 - L0 = Sys.Time + 2 - while (L0 > Sys.Time){} - call 15 - jog1..5=180000 - call 16 - call 15 - abslinear X(1000)Y(0)U(0)V(0)W(0) - dwell 100 - abslinear X(0)Y(1000)U(0)V(0)W(0) - dwell 100 - abslinear X(0)Y(0)U(0)V(0)W(0) - dwell 100 - jog1..5=0 - call 16 -close -b1r -cpx call15;abslinear X(1000)Y(0)U(0)V(0)W(0);call16; -cpx call15;jog1..5=0;call16; -``` - - - -towards IOC 29.3.18 -------------------- -``` -PPMAC=MOTTEST-CPPM-CRM0515 -ssh root@$PPMAC -cd /ioc/SAR-CPPM-EXPMX3 -iocsh startup.script -dbl - -export EPICS_CA_ADDR_LIST="129.129.126.255" - -export EPICS_CA_ADDR_LIST=$PPMAC -caQtDM -macro 'P=SAR-EXPMX' ESB_MX_exp -caQtDM -macro 'P=SAR-EXPMX' ESB_MX_5cam - - - - -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-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 - -see also: - -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_boot_sf/SARES20-CSSU-ESB1/SARES20-CSSU-ESB1_startup.script -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_boot_sf/SARES20-CSSU-ESB1/SARES20-CSSU-ESB1_hexpodPI.subs -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_boot_sf/SARES20-CSSU-ESB1/hpod.template -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_boot_sf/SARES20-CSSU-ESB1/cfg/hpod.proto - -caQtDM -macro "P=SAR-EXPMX:,R=asyn" asynRecord.ui -caQtDM -macro "P=SAR-EXPMX:,R=asyn" asynSerialPortSetup.ui -caQtDM -macro "P=SAR-EXPMX:,R=asyn" asynOctet.ui -caQtDM -macro "P=SAR-EXPMX:,R=debug0" asynOctet.ui - - -caput SAR-EXPMX:asyn.AOUT '&1;#1..5j/;cpx call 15' -caput SAR-EXPMX:asyn.AOUT '&1;#1..5j/;cpx call 16' - -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call 15;jog1..5=0; call 16' -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call 15;jog1..5=10000; call 16' - - -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call15;abslinear X(1000)Y(0)U(0)V(0)W(0);call16' - -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call15;abslinear X(1000)Y(0)U(0)V(0)W(0);call16' -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call15;abslinear X(00)Y(0)U(0)V(0)W(0);call16' -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call15;abslinear X(1000)Y(0)U(0)V(0)W(0);call16' -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call15;abslinear X(00)Y(0)U(0)V(0)W(0);call16' -caput -S SAR-EXPMX:debug '&1;#1..5j/;cpx call15;abslinear X(1000)Y(0)U(0)V(0)W(0);call16' - - -SAR-EXPMX:MOT_GIR_W.SPMG -Plugin: epics3 : loaded & connected -===================================== -Description: Stop -TimeStamp: Apr 04, 2018 11:57:02.623574449 -Type: DBF_ENUM -Count: 1 -Value: 0 -nbStates: 4 -States: - 0 Stop - 1 Pause - 2 Move - 3 Go -``` - - -Check some coord trf 4.4.18 ---------------------------- -``` -$$$*** -!common() -!SAR-EXPMX3() //with !MX3_setup_sim() - - -using trf: -!MX3_coordTrf(exc=5000,height=2000,width=500000,length=1000000,camSf=1.7453292519943296e-05) - -open forward -// define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5') -// 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') - L6=2000/500000 - L7=5000/1.41421356237 - L11=L7*sin(L1*1.74532925199e-05) - L12=L7*sin(L2*1.74532925199e-05) - L13=L7*sin(L3*1.74532925199e-05) - L14=L7*sin(L4*1.74532925199e-05) - L15=L7*sin(L5*1.74532925199e-05) - - send 1"fwd_inp(%f) %f %f %f %f %f\n",D0,L1,L2,L3,L4,L5 - send 1"fwd_inp(%f) %f %f %f %f %f\n",D0,L11,L12,L13,L14,L15 - - - //C6=D^-1*S - C6=+.5*L11 -.5*L12 +(L6+.5)*L13 +(L6-.5)*L14 +(.5-L6)*1.41421356237*L15 - C7=+.5*L11 +.5*L12 +.25*L13 +.25*L14 +.25*1.41421356237*L15 - C3= -.5*L13 -.5*L14 +.5*1.41421356237*L15 - C4=-.5*L11 +1.*L12 +1.5*L13 -.5*L14 -.5*1.41421356237*L15 - C5=-.5*L11 -1.*L12 +.5*L13 +.5*L14 +.5*1.41421356237*L15 - - send 1"fwd_res %f %f %f %f %f\n",C6,C7,C3,C4,C5 - - D0=$000000f8; //C3=$8 C4=$10 C5=$20 C6=$40 C7=$80 hex(8+int('10',16)+int('20',16)+int('40',16)+int('80',16)) -> '0xf8' -close - -open inverse -// define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5') -// 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') - - //if(D0>0) - // send 1"Velocity calculation NOT SUPPORTED\n" - - send 1"inv_inp(%f) %f %f %f %f %f\n",D0,C6,C7,C3,C4,C5 - - L6=2000/500000 - - L11=+.5*C6 +.5*C7 +(0) *C3 -.5*C4 +.5*C5 - L12=-.5*C6 +.5*C7 +(0) *C3 +.5*C4 +.5*C5 - L13=+.5*C6 +.5*C7 -(.5) *C3 +.5*C4 -.5*C5 - L14=-.5*C6 +.5*C7 -(.5) *C3 -.5*C4 -.5*C5 - L15= .5*1.41421356237*C7 +.5*1.41421356237*C3 -.5*1.41421356237*C5 - - L7=1.41421356237/5000 - L1=asin(L11*L7)/1.74532925199e-05 - L2=asin(L12*L7)/1.74532925199e-05 - L3=asin(L13*L7)/1.74532925199e-05 - L4=asin(L14*L7)/1.74532925199e-05 - L5=asin(L15*L7)/1.74532925199e-05 - - send 1"inv_res %f %f %f %f %f\n",L1,L2,L3,L4,L5 - -close - - -&1;cpx abs linear;jog1=0;jog2=0;jog3=0;jog4=0;jog5=0 -&1;cpx abs linear;jog1=10000;jog2=20000;jog3=30000;jog4=40000;jog5=50000 - -&1;cpx abs linear;X(1365.89)Y(2879.23)U(-105.071)V(502.495)W(2419.1) - -&1;cpx abs linear;X(-10.000000)Y(200.000000)U(3.00000)V(4.00000)W(5.00000) - - -&1;cpx abs linear;X(0.000000)Y(0.000000)U(0.00000)V(0.00000)W(0.00000) -&1;cpx abs linear;X(-10.000000)Y(200.000000)U(3.00000)V(4.00000)W(5.00000) - - - - -#1..5p - -&1p -pmatch - -fwd_inp(0) 0 0 0 0 0 -fwd_inp(0) 0 0 0 0 0 -fwd_res 0 0 0 0 0 -inv_inp(0) 0 0 0 0 0 -inv_res 0 0 0 0 0 - -fwd_inp(0) 10000 20000 30000 40000 50000 -fwd_inp(0) 613.939 1209.22 1767.77 2272.6 2708.38 -fwd_res 1365.89 2879.23 -105.071 502.495 2419.1 - -fwd_res 1365.89 2879.23 -105.071 502.495 2419.1 -inv_inp(0) 1365.89 2879.23 -105.071 502.495 2419.1 -inv_res 60621.7 38843.4 20130.6 -10620.2 4072.1 - - -``` - - - - -Checking Homeoffset init bug ----------------------------- -``` -//the motor has 512*200*100 usteps per revolution (512 uystep/step, 200 steps/rev 1:100 gear) -//the ssi-encoder has 2**18=262144 steps per revolution -//posSf = userUnits/encoder_steps -//servoSf=motor_u_steps/userUnits - -512*200*100/262144 - - -cpx PowerBrick[1].GpioData[0].16.5=$1f;motor[1].idCmd=1000;jog1=-1000;PowerBrick[1].GpioData[0].16.5=$0;motor[1].idCmd=0 -!encoder_ssi(enc=1,numBits=18,posSf=5625./4096.) - -cpx PowerBrick[1].GpioData[0].16.5=$1f;motor[1].idCmd=1000;jog1=361000;PowerBrick[1].GpioData[0].16.5=$0;motor[1].idCmd=0 -!encoder_ssi(enc=1,numBits=18,posSf=5625./4096.) - -cpx PowerBrick[1].GpioData[0].16.5=$1f;motor[1].idCmd=1000;jog1=1000;PowerBrick[1].GpioData[0].16.5=$0;motor[1].idCmd=0 -!encoder_ssi(enc=1,numBits=18,posSf=5625./4096.) - -cpx PowerBrick[1].GpioData[0].16.5=$1f;motor[1].idCmd=1000;jog1=0;PowerBrick[1].GpioData[0].16.5=$0;motor[1].idCmd=0 -!encoder_ssi(enc=1,numBits=18,posSf=5625./4096.) - - - -$$$*** -!common() -!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.) -#1hmz - -$$$*** -!common() -!encoder_ssi(enc=1,numBits=18,posSf=1.) -!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf= 39.0625,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.) -#1hmz - - - -cpx PowerBrick[1].GpioData[0].16.5=$1f;jog1=-1000;PowerBrick[1].GpioData[0].16.5=$0 -Motor[1].idCmd=0 - -EncTable[1].PrevEnc -Motor[1].HomeOffset -Motor[1].HomePos -Motor[1].ActPos - -EncTable[1].PrevEnc=-2490368 - - -!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.) -#1hmz - - -!encoder_ssi(enc=1,numBits=18,posSf=5625./4096.) -!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-20907.) -#1hmz - - - -Motor[1].HomeOffset=-20907 -Motor[1].HomePos=-1100471.57226169435 -Motor[1].ActPos=-1100474.61749599339 - -!encoder_ssi(enc=1,numBits=18,posSf=5625./4096.) -> reate wrong values - - - -Motor[1].HomeOffset=0 -Motor[1].HomePos=-1439342.11669405433 -Motor[1].ActPos=-1100474.61749599339 - -!motor(mot=1,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=0,FatalFeLimit=1000,HomeOffset=-20907.) - - - - -Motor[1].HomeOffset=-20907 -Motor[1].HomePos=-372569.750242860231 -Motor[1].ActPos=-8.86266251358743773e-17 -#1p 372569.7502428602 -but should be -8000 - -#1p=Motor[1].ActPos-Motor[1].HomePos - -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 - disable plc 0 -close plc 0 - -enable plc 0 -``` - - -29.5.18 Calibration ID Lab +23.09.24 Restructure repos -------------------------- ``` -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 - --19000 -Motor[1].pLimits=PowerBrick[0].Chan[0].Status.a -Motor[2].pLimits=PowerBrick[0].Chan[1].Status.a - -``` - -29.5.18 Commissioning ESC -------------------------- -``` -[saresb-cons-01 ~]$ caqtdm -macro 'P=SAR-EXPMX' ESB_MX_exp - - -SAR-EXPMX:MOT_CX ok -SAR-EXPMX:MOT_CZ ok -SAR-EXPMX:MOT_FX encoder ok, failed phasing... cabeling issue. old cable ok. -SAR-EXPMX:MOT_FY encoder ok, failed phasing... cabeling issue. old cable ok. -SAR-EXPMX:MOT_ROT_Y ok - -SAR-EXPMX:MOT_BLGT hotor ok, homing fails -> check if ho,ing switsch is on correct pins? -SAR-EXPMX:MOT_CRYO ok -SAR-EXPMX:MOT_WEDGE1 motor ok, encoder cable issue. old incr. cable works -SAR-EXPMX:MOT_WEDGE2 motor ok, encoder cable issue. old incr. cable works -SAR-EXPMX:MOT_WEDGE3 motor ok, encoder cable issue. old incr. cable works -SAR-EXPMX:MOT_WEDGE4 motor ok, encoder cable issue. old incr. cable works - -Backlight: check register Gate3[1].Chan[0].Status when pressing home button... - -``` - - -``` -Wedge mover: -#3,4 -#3,4j=-17000 up limit -#3,4j=18000 down limit -#3j=350;#4j=-350 left right -#3j=-2900;#4j=2900 left right - - -#1j=-13000;#2j=0 up limit -#1j=1000;#2j=14000 down limit - -#1j=-6000;#2j=7000 start - -#1j=-8500;#2j=9500 left right -#1j=-6000;#2j=7000 also limit ? - - - -do this multiple times until motor 2 is far enough -> #1j-;#2j- -> #1j+;#2j- -then home motor 2 -#1j-;#2hm - -Measured distances schieblehre: -m1:67.85 -m2:67:42 -m3:66.73 -m4:68.97 - - -Alles bündig bei je 67mm - -m3 -330 -m4 1900 - -Wedge Mover Limits: -X -2.13 .. 1.5 -Y -1.68 .. 2.28 - -Individual motor limits: -Y-Min (moving until all limits kick in) -#1..4p -19594 16978 22575.5 21962 - -Y-Max -#1..4p --23962.5 -23414 -22669 -22413 - -right: -#1..4p --2023 2049 -3362 3379 - -left -#1..4p -3017 -3170 1415.5 -1693 - - -Y: -1.67 -``` - -Motor 1,2 tuning ----------------- -``` -Current loop: -rise time: 0.25ms -overshot 2.74% -damping: 0.753 -natural frq:1487Hz - -=>system 2ter Ordnung - -k*1/(1+T1*s+t2*s^2) - - -``` - -EVR ---- -``` -check git modules: -mrfioc2 -> EVR config -PB_BSREAD -> sample how to configure user Flags - -Gate3[1].Chan[0].UserFlag -> is set to 0 when event triggered (mapped to output FronUnivOut4 in the EVR) - -EVR output powerBrick register $(USR_FLAG_ID) -FrontUnivOut4 Gate3[1].Chan[0].UserFlag 5 -FrontUnivOut5 Gate3[1].Chan[1].UserFlag 6 -FrontUnivOut6 Gate3[1].Chan[2].UserFlag 7 - -Event 254 -> Pulser 0 -> FrontUnivOut4 Gate3[1].Chan[0].UserFlag -Event 40 -> Pulser 1 -> FrontUnivOut5 Gate3[1].Chan[1].UserFlag -Event 22 -> Pulser 2 -> FrontUnivOut6 Gate3[1].Chan[2].UserFlag - -caput SAR-CVME-TIFALL5-EVG0:SoftEvt-EvtCode-SP 254 - - -Sample test code for sync: - -open prog 2 -Gate3[0].GpioData[0].16.1=0 -linearabs -//X50Y-0 -dwell10 -while(Gate3[1].Chan[0].UserFlag==0){} -while(1) -{ -if(Gate3[1].Chan[1].UserFlag==0) -{ -break -} -} -Gather.Enable=2 -Gate3[0].GpioData[0].16.1=1 -//pvt40abs -//X50:443.604Y-0:0 -dwell1000 -Gather.Enable=0 -close -b2r -``` - - -Testing Helical Coord Trf -------------------------- -``` -B0.3504637004371034 X-13.68414496427224 Y-8.029999999998836 Z-1483.096457761122 - - -&1p ->this will trigger:forward kinematic -cpx pmatch ->this will trigger:forward kinematic - -cpx ;linear rel; X0Y0Z0B0 -cpx ;linear abs; X-13.68 Y-8.03 Z-1483.1 B0.35 - ->this will trigger: inverse - -&1;cpx abs linear;jog1=0;jog2=0;jog3=0;jog4=0;jog5=0 - - --1:fwd_inp(0) 0.45 -1103.7 0.350464 -7.98 --1:fwd_res -13.5538 -1481 0.350464 -7.98 - - -//motors CX CZ RY FY -// 4 5 3 1 - - -&1;cpx abs linear;jog1=0;jog2=0;jog3=0;jog4=0;jog5=0 - - def calcParam(self,x=((.468,-.627,-.523),(.357,-1.349,.351)), - y=(.557,-.008), - z=((1.73,.93,2.129),(2.13,.03,1.103))): - - -&1;cpx abs linear;jog1=557;jog3=0;jog4=-468;jog5=-1730 - -&1;cpx abs linear;jog1=-8;jog3=240000;jog4=-351;jog5=-1103 - - -caQtDM -macro "NAME=ESB-MX-CAM,CAMNAME=ESB-MX-CAM" /sf/controls/config/qt/Camera/CameraMiniView - -#1,3,4,5p -point 1 0,120,240 deg -575.5 0 -241.5 -1401.3 -575.5 120000 96.7 -1401.7 -575.5 240000 -53.8 -1802.4 - -point 2 0,120,240 deg -175.5 0 -162.3 -1802.5 -175.5 120000 -293.2 -1303.7 -175.5 240000 246.4 -1402.25 - - -#1j=575.5; #3j=0 ; #4j=-241.5; #5j=-1401.3 -#1j=575.5; #3j=120000; #4j= 96.7; #5j=-1401.7 -#1j=575.5; #3j=240000; #4j= -53.8; #5j=-1802.4 -#1j=175.5; #3j=0 ; #4j=-162.3; #5j=-1802.5 -#1j=175.5; #3j=120000; #4j=-293.2; #5j=-1303.7 -#1j=175.5; #3j=240000; #4j= 246.4; #5j=-1402.25 - - -pixel center 1110 1090 - -#1j=575.5; #3j=0 ; #4j=-241.5; #5j=-1401.3 -cpx pmatch - - --1:fwd_inp(0) -241.5 -1401.3 0 575.5 --1:fwd_res -88.9829 308.514 0 575.5 - - -cpx ;linear abs; X0 Z0 Y575 B0 -cpx ;linear abs; X0 Z0 Y575 B100000 -``` - -Software esbMX deploy ---------------------- -``` -zamofing_t@ganymede:~$ ll /sf/bernina/config/swissmx/zamofing_t/ - /sf/bernina/config/swissmx/ -ssh saresb-cons-01 - ssh sf-cons-01 -source /opt/gfa/python -source activate /sf/bernina/config/swissmx/conda/envs/b440_clone -zamofing_t@ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python$ - - -cp -farL ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/*.py \ - ~/Documents/prj/SwissFEL/PBTools/pbtools/ \ - ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/src/triggerSync/triggerSync \ - /sf/bernina/config/swissmx/zamofing_t/ - -cp -farL ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/ShapePathAnalyser/*.py \ - /sf/bernina/config/swissmx/zamofing_t/ShapePathAnalyser/ - -#scp -r pc9477:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/*.py /sf/bernina/config/swissmx/zamofing_t/ - - - ->alternatives but not recommanded -#scp -r ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/*.py ganymede:~/Documents/prj/SwissFEL/PBTools/pbtools/ /sf/bernina/config/swissmx/zamofing_t/ -#rsync -abuv --exclude 'records/' ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/*.py ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/PBMotionAnalyzer/ ~/Documents/prj/SwissFEL/PBTools/pbtools/ /sf/bernina/config/swissmx/zamofing_t/ -``` - - -Sync Start ----------- -``` -caput SAR-CVME-TIFALL5-EVG0:SoftEvt-EvtCode-SP 254 - - -``` - - - -Try to find encoder count loss ------------------------------- -``` -//set incEncFrq to 25MHz, (default was to low: 3.125MHz) - -Gate3[0].EncClockDiv=2 -Gate3[1].EncClockDiv=2 - -``` - -Helicalscan setup ------------------ -``` -calcParam( - x=((-34.05489905551743, 208.10204385266277, -606.4416461908648), - (22.139508829306088, 158.83214548238513, -618.6408606756819)), - y=(1700.0, 1252.0231362790232), - z=((-1200.0, -2000.0000000000005, -1900.0000000000005), - (-1200.0, -2000.0000000000005, -1800.0000000000002))) - -cpx X0 Z0 B0 Y1700.0 -cpx X0 Z0 B120000 Y1700.0 -cpx X0 Z0 B240000 Y1700.0 - -cpx X0 Z0 B0 Y1252.0 -cpx X0 Z0 B120000 Y1252.0 -cpx X0 Z0 B240000 Y1252.0 - -send 1"fwd_inp(%f) %f %f %f %f\\n",D0,{qCX},{qCZ},{qW},{qFY} -send 1"fwd_res %f %f %f %f\\n",{DX},{DZ},{W},{Y} -send 1"inv_inp(%f) %f %f %f %f\\n",D0,{DX},{DZ},{W},{Y} -send 1"inv_res %f %f %f %f\\n",{qCX},{qCZ},{qW},{qFY} - - -``` - - -Oct. 2019 Measure backlash wedge movers ---------------------------------------- -``` -Wedge Mover 1 Mover 2 Plate 1 Plate 2 - 0 0 0 0 0 --.1 -0.1030 -0.0990 -0.0990 -0.0990 --.2 -0.2045 -0.1990 -0.1985 -0.2000 --.3 -0.3060 -0.3005 -0.2990 -0.3000 --.2 -0.2040 -0.2000 -0.2015 -0.2030 --.1 -0.1030 -0.0990 -0.1020 -0.1030 - 0 0.0020 0.0025 0.0030 0.0020 - .1 0.0985 0.1030 0.0965 0.0980 - .2 0.1980 0.2015 0.1955 0.1980 - .3 0.2975 0.3020 0.2950 0.2960 - .2 0.1995 0.2035 0.1980 0.2020 - .1 0.0980 0.1045 0.0990 0.1010 - 0 0.0020 0.0045 0.0000 0.0010 - - -Mover 1/2 on the black metal block with the name -Plate 1/2 above mover 1/2 on aluminum border ob bread board - --> no backlash (ca. 10um) could be measured. - -``` - - -16.5.22 tunneling ------------------ -``` ---host=localhost:10001:10002 - -PPMAC=SAR-CPPM-EXPMX1 - -rsync -va ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp/ -ssh root@$PPMAC -LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/gather_server - - -ssh -L 10001:localhost:22 root@$PPMAC 'uname -a' -ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a' --> this tunnels port 22 and 2332 of $PPMAC to 10001 and 10002 of localhost - -Tests: -nc localhost 10001 -nc localhost 10002 - -list close ssh tunnel ---------------------- -lsof -i -n | grep '127.0.0.1:1000' - -. - -Make z to move over the grid. - -&0 -#1->0 -#2->0 -#3->0 -#4->0 -#5->0 -#6->0 -#7->0 -#8->0 -&1 -#1->y -#2->x -#5->.1x+.1y-1400 - - -?? what are the PV for the camera, zoom etc ??? -``` - - -30.9.22 Debug Synchronization -============================= - -https://docs.google.com/document/d/1soSuCZYyfGf_ntcgG_Y1_WeGuo_687OuFn0s4sMj1uY/edit - - -remote ssh tunnel + start gather_server ---------------------------------------- -``` -PPMAC=SAR-CPPM-EXPMX1 -rsync -va ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp/ -lsof -i -n | grep '127.0.0.1:1000' -ssh -L 10001:localhost:22 root@$PPMAC 'uname -a' -ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a' -ssh root@$PPMAC -LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/gather_server -``` - -cleanup /tmp/ -------------- -``` -PPMAC=SAR-CPPM-EXPMX1 -ssh root@$PPMAC rm /tmp/gather_server /tmp/triggerSync -ssh root@$PPMAC ls -l /tmp -``` - -start debug tools ------------------ -``` -PPMAC=SAR-CPPM-EXPMX1 -PBInspect --host=$PPMAC& -gpasciiCommander --host $PPMAC -i -``` - -restart IOC ------------ -``` -ssh saresc-cons-03 -PPMAC=SAR-CPPM-EXPMX1 -telnet $PPMAC 50001 -Ctrl-X -dbgf SAR-CPPM-EXPMX1:MOD_VER - - -``` - -checking versions ------------------ -``` -git: 7a968aac967 -caget SAR-CPPM-EXPMX1:MOD_VER -asyn 427.0.2 -motorBase alpha_220518 -asynMotor alpha_220518 -powerPmac alpha_220518 -PB_COMMON 2.0.1 -gpasciiCommander 0.9.0 -ESB_MX 0.0.2 -``` - -zamofing_t@ganymede:~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX$ -git loggraph -10 -* 7a968aa 2022-09-20 (HEAD -> master, tag: latest, tag: 0.0.2, psigithub/master) change speeds and directions [Thierry Zamofing] -* 00588f8 2022-09-16 minor changes [Thierry Zamofing] -* d52a6ce 2022-08-30 minor changes [Thierry Zamofing] -* f47e111 2022-05-20 (tag: 0.0.1) add DET_Z motor [Thierry Zamofing] -* 8e5b15e 2022-05-20 wip [Thierry Zamofing] -* 399282c 2019-03-20 enhance triggering [Thierry Zamofing] -* eda8caf 2019-03-19 wip [Thierry Zamofing] -* 0c45705 2019-03-08 optimize [Thierry Zamofing] -* c962ebd 2019-03-06 documentation [Thierry Zamofing] - -git reset --hard 7a968aa -rmake -e LIBVERSION=42.42.42 uninstall install --> restart IOC - -ssh root@$PPMAC rm /tmp/triggerSync -cd python -git dt latest -- shapepath.py -./shapepath.py --host=localhost:10001:10002 - -removing test verion -ssh sf-lc7 ls -l /ioc/modules/ESB_MX/ -ssh sf-lc7 rm -rf /ioc/modules/ESB_MX/42.42.42 - - -IOC locations -------------- -``` -~/Documents/prj/SwissFEL/epics_ioc_boot_sf/ESC_all/ESB_MX_PowerBrick -They are just using the new alphy driver. That should have no impact on the motion config. -``` - - -Current (old) Synchronization ------------------------------ -``` -default: -/ESB_MX/src/triggerSync/triggerSync.c -> read usage -simulate start trigger -> pshm->Coord[1].Q[10]=1 to simulate a Jungfrau aquire start\n\ -simulate frame trigger -> pshm->Coord[1].Q[11] -Coord[1].Q[0] is incremented at each trigger - -Coord[1].DesTimeBase is adjusted at each frame trigger - -Coord[1].pDesTimeBase=Coord[1].DesTimeBase.a - - -gpascii: set Gather.Enable=1 -PMAC: LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/triggerSync 10 0 11 -> wait for start trigger -gpascii: set Start trigger: pshm->Coord[1].Q[10]=1 or set EVR that generates the trigger -PMAC: start Gather (Gather.Enable=2) - count and sync frames: - Coord[1].Q[0] = frame counter -gpascii: stop Gather -> Gather.Enable=0 -PMAC: triggerSync stops when Gather.Enable=0 - - -``` - -Enhanced Synchronization ------------------------- -``` -(to be tested) -Coord[1].pDesTimeBase=Coord[1].DesTimeBase.a -For “external time base”, in which the coordinate system’s time base value is proportional to the -frequency of an incoming encoder signal or pulse train, Coord[x].pDesTimeBase should be set -to EncTable[i].DeltaPos.a - -Setup EncTable: -EncTable[n].type = (3)Software 1/T encoder extension (5)Four-byte read 32 bit int (11) Float 32f or 64f - -The ERV are mapped to -//Power PMAC Software Reference Manual.pdf Gate3[i].Chan[j].Status -> page 919 UserFlag -(gate3_1->Chan[0].Status&0x800) = Gate3[1].Chan[0].UserFlag Trigger start -(gate3_1->Chan[1].Status&0x800) = Gate3[1].Chan[1].UserFlag Trigger frame - - -Use EncTable 20 as Frame counter -Gate3[1].Chan[1].EncCtrl = $encctrl -EncTable[20].type = 3 -EncTable[20].pEnc = Gate3[1].Chan[1].UserFlag.a (is same as Gate3[1].Chan[1].Status) thus it will not work -EncTable[20].pEnc1 = Gate3[1].Chan[0].TimerA.a -EncTable[20].index1 = 0 -EncTable[20].index2 = 0 -EncTable[20].index3 = 0 -EncTable[20].index4 = 0 -EncTable[20].index5 = 0 -EncTable[20].ScaleFactor = 1/256 --> THIS DOES NOT WORK WITH CURRENT CONNECTIONS ! --> ONE PHYSICAL ENCODER WOULD NEED PULSE AND DIRECTION INPUT AND SET Gate3[1].Chan[1].EncCtrl TO 'pulse and direction' mode - - -> Sys.Ddata[0]=Sys.Ddata[0]+10 - -Use EncTable 20 as Frame counter -Gate3[1].Chan[1].EncCtrl = $encctrl -EncTable[20].type = 11 //loating point read -EncTable[20].pEnc = Sys.Ddata[0].a -EncTable[20].pEnc1 = Gate3[1].Chan[0].TimerA.a -EncTable[20].index1 = 0 -EncTable[20].index2 = 0 -EncTable[20].index3 = 0 -EncTable[20].index4 = 0 -EncTable[20].index5 = 99 //multiply with 100 -EncTable[20].index5 = 1 //float64 -EncTable[20].ScaleFactor = 1/256 -EncTable[20].ScaleFactor=1E-3 - - -Use EncTable 20 as Frame counter -EncTable[20].type = 1 //32 Bit uint -EncTable[20].pEnc = Sys.Udata[0].a -EncTable[20].index1 = 0 -EncTable[20].index2 = 0 -EncTable[20].index3 = 0 -EncTable[20].index4 = 0 -EncTable[20].index5 = 0 -EncTable[20].index5 = 0 -EncTable[20].ScaleFactor=1E-3 - -Sys.Udata[0];EncTable[20].PrevEnc - - -2.1 trigger zu spät -1.9 trigger zu früh -``` - -23.11.23 Changing stages ------------------------- -``` -https://jira.psi.ch/browse/SFELPHOTON-888 - -recommissioning exchanged stages. The software must not be changed. -the cabeling has to change so that it fits as it worked before. - SAR-EXPMX:MOT_FX: stages behave totally different not working - SAR-EXPMX:MOT_FY: stages behave totally different not working.encoder counts inverse? - SAR-EXPMX:MOT_CX: moves in closed loop, limitswitch +- must be swapped - SAR-EXPMX:MOT_CZ: moves in closed loop, limitswitch +- must be swapped - SAR-EXPMX:MOT_CY: before commissioning check encoder signal Level TTL? - -> we need the old stage to be able to check and compare each motor step by step. - now working and new stage CY is roughly commissined -``` - -24.11.23 Tweak CY stages ------------------------- -``` -stage without load: slowest open loop motion: -#3out-14 -#3out 15 -(14-15% of nominal curttent ~275mA) - -sometimes stuck and needs up to 35% !!! of nominal current to start mofing againg. -This is the drawback of brushes that do not provide a smooth current switching and continous torque - - -> #3out15 -> Motor[3].ServoOut -Motor[3].ServoOut=290.403002929687489 - -Motor[3].Servo.OutDbOn -Motor[3].Servo.OutDbOff -Motor[3].Servo.OutDbSeed - -Motor[3].Servo.OutDbOn=200 -Motor[3].Servo.OutDbOff=400 -Motor[3].Servo.OutDbSeed=0 - -Motor[3].Servo.OutDbOn=200 -Motor[3].Servo.OutDbOff=400 -Motor[3].Servo.OutDbSeed=200 - -Motor[3].Servo.Kp=50 -Motor[3].Servo.BreakPosErr=5 -Motor[3].Servo.Ki=.0004 - -./PBGatherPlot.py -r2 --ssh_tunnel -p '{"motId":3,"address":"Sys.ServoCount,Motor[{motId}].DesPos,Motor[{motId}].PosError,Motor[{motId}].ServoOut,Motor[{motId}].IaMeas,Motor[{motId}].Integrator"}' - - pp={ - 'openloop':False, - 'file' :fn, - 'motor' :3, - #'amp' :40, # openloop: % of maximal amplitude - 'amp' :100, # closed loop: um amplitude - 'minFrq' :1, - 'maxFrq' :20, - 'tSec' :6., - 'mode' :1, - } - tune.bode_chirp(**pp) - fig=plt.figure(1) - fig.suptitle('CY closedloop 6 sec. 1-20Hz amp=100um') - plt.show() - -./PBGatherPlot.py -r0 --ssh_tunnel - -./PBGatherPlot.py -r3 --ssh_tunnel -p '{"motId":3,"rng":[0,5000 ]}' - -./PBGatherPlot.py -r3 --ssh_tunnel -p '{"motId":3,"rng":[0,2000 ],"wait":0.2, "repeat":3}' -d2 - - - +https://jira.psi.ch/browse/SFELPHOTON-1337 ``` diff --git a/ReadmeMCS.md b/ReadmeMCS.md deleted file mode 100644 index 57b56c9..0000000 --- a/ReadmeMCS.md +++ /dev/null @@ -1,82 +0,0 @@ -asynReport 255 -asynSetTraceIOMask -asynSetTraceInfoMask -asynSetTraceMask -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/SASE_RIXS/Readme.md - -asynReport -asynReport 3 MCS -asynReport 3 asynMCS - - -asynSetTraceMask asynMCS 0 0xff -asynSetTraceIOMask asynMCS 0 0xff - -asynSetTraceMask asynMCS,0, error|device|filter|driver|flow|warning -asynSetTraceIOMask asynMCS,0, nodata|ascii|escape|hex -asynSetTraceInfoMask asynMCS,0, time|port|source|thread - -#quite/default asyn communication -asynSetTraceMask asynMCS,0, error -asynSetTraceIOMask asynMCS,0, escape -asynSetTraceInfoMask asynMCS,0, time|port|source -asynSetTraceMask MCS,0, error -asynSetTraceIOMask MCS,0, escape -asynSetTraceInfoMask MCS,0, time|port|source - - -#good debugging for asyn communication -asynSetTraceMask asynMCS,0, error|driver -asynSetTraceIOMask asynMCS,0, escape -asynSetTraceInfoMask asynMCS,0, time|port|source - -#good debugging for motor record tracing -asynSetTraceMask MCS,0, error|device|filter|driver|flow|warning -asynSetTraceIOMask MCS,0, escape -asynSetTraceInfoMask MCS,0, time|port|source - - -/home/zamofing_t/Documents/doc-ext/SmaractMCS/MCSrs232InterfaceDocumentation.pdf -ncat 129.129.244.32 5000 -->resut :ID4049801502 - -:GSI -:GIV -:GNC - -:GCT0 - -:MPA0,123000,2000 -:GP0 -->:P0,123000\n -:MPA0,987,2000 -:GST0 -:ST0,1 - -#good debugging for motor record tracing -asynSetTraceMask asynS1,0, 0x09 -asynSetTraceIOMask asynS1,0, 0x02 -asynSetTraceInfoMask asynS1,0, 0x07 - - - -add a ASYn record - -caqtdm -macro 'S=SARES30-SMX,M=MCS,T=MCS' ESB_MX_SmarAct - -caqtdm -macro 'P=SARES30-SMX:,R=ASYN' asynOctet - -caput SARES30-SMX:ASYN.AOUT :GSI -caput SARES30-SMX:ASYN.AOUT :GP0 -caput SARES30-SMX:ASYN.AOUT :MPA0,123000,2000 -caput SARES30-SMX:ASYN.AOUT :GST0 - - - -caget SARES30-SMX:ASYN.TINP - - - -/home/zamofing_t/Documents/prj/SwissFEL/driver_modules_epics/motorBase/motorApp/MotorSrc/asynMotorController.h - -if the position can not be reached, the $(S):$(M).MISS is set to 1 \ No newline at end of file diff --git a/asyn.template b/asyn.template deleted file mode 100644 index d56eb09..0000000 --- a/asyn.template +++ /dev/null @@ -1,8 +0,0 @@ -record(asyn,"$(P):$(R=asyn)") -{ - field(DTYP,"asynRecordDevice") - field(PORT,"$(PORT)") - field(ADDR,"0") - field(OMAX,"100") - field(IMAX,"100") -} diff --git a/cfg/MX1_coordTrf.cfg b/cfg/MX1_coordTrf.cfg deleted file mode 100644 index de56f90..0000000 --- a/cfg/MX1_coordTrf.cfg +++ /dev/null @@ -1,28 +0,0 @@ - -&1 -//#1-> 0.00001X+ 0.00001Y + A -//#2-> +1. X + .5Y + 0.01A -//#3-> + .5X +1. Y + 0.01A - -#1-> Y -#2-> X -#3-> A - -Coord[1].AltFeedRate=0 -Coord[1].Tm=1 //1ms time -Coord[1].Ta=1 -Coord[1].Td=1 -Coord[1].Ts=0 - -//Parker: Continous Force 4N -> assume 1kg load -> acceleration=a=F/m=4m/s^2 -//do not use time to accelerate but acceleration -//4m/s^2=4um/(ms)^2 Motor units=um -> JogTa= -1ms^2/4mu -2.5-> 4m/s^2 -25->0.4m/s^2 -Motor[1].JogTs=0 -Motor[1].JogTa=-2.5 -Motor[2].JogTs=0 -Motor[2].JogTa=-2.5 - - -Motor[1].MaxSpeed=50 -Motor[2].MaxSpeed=50 -Motor[3].MaxSpeed=360 diff --git a/cfg/MX1_home.cfg b/cfg/MX1_home.cfg deleted file mode 100644 index f773cac..0000000 --- a/cfg/MX1_home.cfg +++ /dev/null @@ -1,170 +0,0 @@ -define(PLC_Homing='1') -define(PLC_HomingCY='2') -define(statusHoming='P100') -statusHoming=0 - -//statusHoming: -// 1: M1 phased -// 2: M2 phased -// 4: M1 pos limit found -// 8: M2 pos limit found -// 16: M1 homed -// 32: M2 homed -// 256: homing failed - - -open plc PLC_Homing - define(timer='L1') - statusHoming=0 - L10=Motor[1].MaxDac - Motor[1].MaxDac=500 - L11=Motor[1].FatalFeLimit - Motor[1].FatalFeLimit=2000 - L12=Motor[1].JogSpeed - Motor[1].JogSpeed=1 - L13=Motor[1].pEncLoss - Motor[1].pEncLoss=0 - - L20=Motor[2].MaxDac - Motor[2].MaxDac=500 - L21=Motor[2].FatalFeLimit - Motor[2].FatalFeLimit=2000 - L22=Motor[2].JogSpeed - Motor[2].JogSpeed=1 - L23=Motor[2].pEncLoss - Motor[2].pEncLoss=0 - - - Motor[1].PhaseFindingStep=1 - Motor[2].PhaseFindingStep=1 - while(Motor[1].PhaseFindingStep>0 || Motor[2].PhaseFindingStep>0){} - if (Motor[1].PhaseFound==1) - { - statusHoming|=1 - cmd "#1j/" - send 1"phasing Y_Achse ok\n" - } - else - { - send 1"phasing Y Achsde error!\n" - goto 0 //ERROR_END - } - if (Motor[2].PhaseFound==1) - { - statusHoming|=2 - cmd "#2j/" - send 1"phasing X_Achse ok\n" - } - else - { - send 1"phasing X Achse error!\n" - statusHoming|=256 - goto 0 //ERROR_END - } - - - //move until FeWarn - Motor[1].JogSpeed=6 - Motor[2].JogSpeed=6 - timer = Sys.RunTime + .5;while (Sys.RunTime < timer){} //wait .5 sec - jog+1 - jog+2 - while(1) - { - if(Motor[1].FeWarn && (statusHoming&4)==0) - { - cmd "#1j/" - send 1"Y_Achse +limit\n" - statusHoming|=4 - } - if(Motor[2].FeWarn && (statusHoming&8)==0) - { - cmd "#2j/" - send 1"X_Achse +limit\n" - statusHoming|=8 - } - if((statusHoming&12)==12) - break - } - timer = Sys.RunTime + .5;while (Sys.RunTime < timer){} //wait .5 sec - - Motor[1].HomeVel=-3 - Motor[2].HomeVel=-3 - home1 - home2 - timer = Sys.RunTime + .5;while (Sys.RunTime < timer){} //wait .5 sec - while(Motor[1].HomeInProgress || Motor[2].HomeInProgress){} - - if(Motor[1].HomeComplete) - statusHoming=statusHoming|16 - else - { - statusHoming|=256 - send 1"Y_Achse home failed\n" - } - - if(Motor[2].HomeComplete) - statusHoming=statusHoming|32 - else - { - statusHoming|=256 - send 1"X_Achse home failed\n" - } - - //Motor[1].PhasePos=560 // 555 581 593 558 - //Motor[2].PhasePos=1540 //1549 1531 1543 1537 - homez6,7 - - goto 1 - -N0: //ERROR_END - statusHoming|=256 - -N1: //ENDPLC - Motor[1].MaxDac=L10 - Motor[1].FatalFeLimit=L11 - Motor[1].JogSpeed=L12 - Motor[1].pEncLoss=L13 - - Motor[2].MaxDac=L20 - Motor[2].FatalFeLimit=L21 - Motor[2].JogSpeed=L22 - Motor[2].pEncLoss=L23 - send 1"homeing done\n" - - disable plc PLC_Homing -close - - -open plc PLC_HomingCY - define(timer='L1') - statusHoming=0 - if (Motor[3].PlusLimit==1){ - jog3:-2000 // move out of limit switch - statusHoming|=16 - while(Motor[3].DesVelZero!=0){} - } - - Motor[3].pLimits=0 - Motor[3].HomeVel=1 - Motor[3].HomeOffset=-1500 - timer = Sys.RunTime + 2. ;while (Sys.RunTime < timer){} //wait x sec - statusHoming|=1 - home3 //homing to +lim, moving to relative position HomeOffset=-1000 and set this position to 0 - timer = Sys.RunTime + .5 ;while (Sys.RunTime < timer){} //wait x sec - while(Motor[3].HomeInProgress){} - if(Motor[3].HomeComplete) - statusHoming=statusHoming|2 - else - { - statusHoming|=256 - send 1"CY_Achse home failed\n" - } - - statusHoming|=4 - timer = Sys.RunTime + 1.;while (Sys.RunTime < timer){} //wait x sec - Motor[3].pLimits=PowerBrick[0].Chan[2].Status.a //seset limit switches - Motor[3].HomePos-=29000 //set this position to 29000um - statusHoming|=8 - disable plc PLC_HomingCY -close \ No newline at end of file diff --git a/cfg/MX1_setup.cfg b/cfg/MX1_setup.cfg deleted file mode 100644 index 6dce791..0000000 --- a/cfg/MX1_setup.cfg +++ /dev/null @@ -1,153 +0,0 @@ -//servoSf : motorusteps/user_units -//posSf : user_units/encoder_steps -//because of many problems with pos2Sf, selt them to 0 - -// Here we use 'real encoder with direct PWM'. Further the axis are scaled -// in this configuration, the PID gives 'torque' to iqCmd. -// the phasePos is received from tne encoder on the motor shaft. -// The idCmd is set to 0 -// the PID regulates the position by setting torque, if the motor is not at the desired position -// Compared to 'real encoder with direct microstepping', following main elements have to be reconfigured: -// SlipGain=0 (instead 0.25) ,PhasePosSf= calculated value (instead of 0) -// look also at PwmSf,PhaseMode,PhaseCtrl, - -// -> PhasePosSf is calculated as follows: (2048*pole_cycle)/(256*enc_step) = 8*pole_cycle/enc_step - -// e.g. Motor[x].pPhaseEnc -> PowerBrick[.].Chan[.].PhaseCapt.a -// 1 rev = 8192 phase_step = 4 pole_cycle = 512000 PhaseCapt =256*2000 (256=scaling of encTable, 2000=enc_step/rev) -// PhasePosSf 8*4/2000=0.016 - - -// x einraster == -> x-N and x-S poles =2*x poles -> 1 rev = x*2048 ustep=phase_step -// changing the polarity from S-N-S (one pole cycle) are 2048 phase_step. phase_step is also called ustep - -//Mot 1: Stage Y Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 1: Stage Y Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) - -//Mot 2: Stage X Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 2: Stage X Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) - -//OLD Stage 3 -//Mot 3: Rotation stage LS Mecapion MDM-DC06DNC0H 32 poles = 1 rev = 16*2048=32768 phase_step -//Enc 3: Rotation stage LS Mecapion 1 rev = 1048576 enc_steps - -// OWIS stage HMV 10N-303HiDS 42.N00.30WJ (DC-Mot. mech Endswitch Norm.Closed) -// 30mm max 12mm/s max 35V max 2.1A 500um/rev 2000enc_cnt/rev Incr. enc with home mark TTL level -//Mot 3: Stage Y DC-Motor (Brushed DC) -//Enc 3: Stage Y Incr. Encoder - - -//Mot 4: Stage X Stada Stepper 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 4: Renishaw absolute BiSS - -//Mot 5: Stage Z Stada Stepper 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 5: Renishaw absolute BiSS - -//Enc 6: Interferometer Y - -//Enc 7: Interferometer X - -//Stage Y Parker MX80L -//-------------------- -//Motor[1].pPhaseEnc -> PowerBrick[0].Chan[1].PhaseCapt.a -// 1 el_step = 13mm = 2048 phase_step = 166400000 PhaseCapt =256*650000 (256=scaling of encTable) -// -> PhasePosSf=(2048*el_cycle)/(256*enc_step) = 8*el_cycle/enc_step =2048*1/(256*650000)=8*1/650000=1./81250=1.23077e-05 -//2048 phase_step =166400000 PhaseCapt -> PhasePosSf = 2048/166400000= 2048./(256*650000) -//use um as motor unit -!encoder_sim(enc=1,tbl=9,mot=9,posSf=13000./2048) -!encoder_inc(enc=1,tbl=1,mot=1,posSf=13000./650000) -!motor_servo(mot=1,ctrl='ServoCtrl',Kp=25,Kvfb=350,Ki=0.02,Kvff=350,Kaff=1615,MaxInt=1000,Kfff=10) -!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') -//turn off encoder loss: Motor[1].pEncLoss=PowerBrick[0].Chan[0].Status.a -Motor[1].pEncLoss=0 - -//Stage X Parker MX80L (top stage, mounted on Y stage) -//---------------------------------------------------- -//Motor[2].pPhaseEnc -> PowerBrick[0].Chan[1].PhaseCapt.a -// 1 el_step = 13mm = 2048 phase_step = 166400000 PhaseCapt =256*650000 (256=scaling of encTable) -// -> PhasePosSf=(2048*el_cycle)/(256*enc_step) = 8*el_cycle/enc_step =2048*1/(256*650000)=8*1/650000=1./81250=1.23077e-05 -//2048 phase_step =166400000 PhaseCapt -> PhasePosSf = 2048/166400000= 2048./(256*650000) -//PhaseFreq=20000,PhasePerServo=1 -> Kvfb=220*4 Ki/=4,Kvff*=4,Kaff*=4*4 - -!encoder_sim(enc=2,tbl=10,mot=10,posSf=13000./2048) -!encoder_inc(enc=2,tbl=2,mot=2,posSf=13000./650000) -!motor_servo(mot=2,ctrl='ServoCtrl',Kp=22,Kvfb=450,Ki=0.02,Kvff=450,Kaff=4517,MaxInt=1000,Kfff=10) -!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') -//turn off encoder loss: Motor[2].pEncLoss=PowerBrick[0].Chan[1].Status.a -Motor[2].pEncLoss=0 - - - -//rot stage (decomissioned) -//------------------------- -//use 360'000 for 360 deg as motor unit -//1 rev = 16*2048=32768 phase_step = 1048576 enc_steps -//PhasePosSf= 8*el_cycle/enc_step =8*16/1048576=1./8192 -//Motor[1].pPhaseEnc=EncTable[1].pEnc=Acc84B[0].Chan[0].SerialEncDataA.a -// -> PhasePosSf is calculated as follows: (2048*pole_cycle)/(256*enc_step) = 8*pole_cycle/enc_step -//PhasePosSf = (2048*pole_cycle)/(SerialEncDataA)=8*16/1048576=1/32 -// Motor 3: 0dB at 18.8Hz Friction 70curr_bits -// Kaff= 1/((18.8*2*np.pi)**2/5000**2 ) = 1791.6970285327388 - -//!encoder_sim(enc=3,tbl=11,mot=11,posSf=360000./32768) -//!encoder_biss(enc=3,tbl=3,mot=3,numBits=20,posSf=360000./1048576) -//Motor[3].pPhaseEnc=Acc84B[0].Chan[2].SerialEncDataA.a -//!motor_servo(mot=3,ctrl='ServoCtrl',Kp=10,Kvfb=220,Ki=0.001,Kvff=220,Kaff=1792,MaxInt=1000,Kfff=5) -//!motor(mot=3,dirCur=0,contCur=1000,peakCur=2000,timeAtPeak=1,IiGain=2,IpfGain=12,IpbGain=12,JogSpeed=180.,numPhase=3,invDir=False,servo=None,PhasePosSf=1./8192,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=3000,WarnFeLimit=1000,InPosBand=10, HomeOffset=228987) - - -//Y stage OWIS -//------------ -//2000enc/rev 500um/rev -//1 rev = 2000 enc_cnt = 500um -> posSf=500um/2000=0.25 -//measured: 30mm=119640.5 enc_cnt posSf=30000/119640.5=0.2507 -// max. 2.1A 36V 12mm/s - -//!encoder_inc(enc=3,tbl=11,mot=11,posSf=1) -!encoder_inc(enc=3,tbl=3,mot=3,posSf=0.25) -!motor_servo(mot=3,ctrl='ServoCtrl',Kp=10,Kvfb=0,Ki=0.0,Kvff=0,Kaff=0,MaxInt=1000,Kfff=0) -!motor(mot=3,dirCur=0,contCur=1000,peakCur=2000,timeAtPeak=1,IiGain=1,IpfGain=3,IpbGain=3,JogSpeed=12.,numPhase=2,invDir=False,servo=None,PhasePosSf=0,PhaseFindingDac=0,PhaseFindingTime=0,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=3000,WarnFeLimit=1000,InPosBand=50,homing='hi-limit') -Motor[3].Servo.Kp=20 -Motor[3].Servo.BreakPosErr=1 -Motor[3].Servo.KBreak=10 -Motor[3].Servo.Ki=0 -Motor[3].Servo.OutDbOn=50 -Motor[3].Servo.OutDbOff=50 - -//Motor[3].Servo.Kp=80 -//Motor[3].Servo.BreakPosErr=0 -//Motor[3].Servo.KBreak=2 -//Motor[3].Servo.Ki=0 -//Motor[3].Servo.OutDbOn=150 -//Motor[3].Servo.OutDbOff=150 - -//Motor[3].Servo.Kp=50 -//Motor[3].Servo.BreakPosErr=5 -//Motor[3].Servo.Ki=.0005 -//Motor[3].Servo.OutDbOn=200 -//Motor[3].Servo.OutDbOff=200 - - -//Stada stage -//----------- -//512000 ustep == 50000 encCnt == 2500um -//posSf = userUnits/encoder_steps -//servoSf=motor_u_steps/userUnits - -!encoder_biss(enc=4,numBits=32,posSf=-1./20) -!encoder_biss(enc=5,numBits=32,posSf=-1./20) -!motor(mot=4,current=200,JogSpeed=0.5,invDir=0,servoSf=204.8,InPosBand=1,HomeOffset=-39278) -!motor(mot=5,current=200,JogSpeed=0.5,invDir=0,servoSf=204.8,InPosBand=1,HomeOffset=-39736) - - -//Interferometer 1,2 -//------------------ -!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=-.01) //1 incr=10nm,inverse direction -> posSf=.01 to scale to um - -#4,5hmz - -//holding current -!holding_current(m4=[0,240],m5=[0,240]) - - diff --git a/cfg/MX2_coordTrf.cfg b/cfg/MX2_coordTrf.cfg deleted file mode 100644 index eee31e4..0000000 --- a/cfg/MX2_coordTrf.cfg +++ /dev/null @@ -1,27 +0,0 @@ -// ---------- Coordinate System/Transformation ---------- - -//These values influence the speed of axis X,Y,Z and also A,B -Coord[1].Ta=100 -Coord[1].Td=100 -Coord[1].AltFeedRate=1000 -Coord[1].Tm=-1000 //1000um/FeedTime -> 1mm/sec -Coord[1].FeedTime=1000 //default value 1000um - - -//Coordinate Transformation -&1 -#1-> -1.X -10.Y +0.5A +5.B -#2-> +1.X -10.Y -0.5A +5.B //motor 2 has opposite direction -#3-> -1.X -10.Y -0.5A -5.B -#4-> +1.X -10.Y +0.5A -5.B //motor 4 has opposite direction - -//PITCH YAW are not exposed directly, because these would need -//inverse and forward kinematics due to the angle functions - -Motor[1].MaxSpeed=Motor[1].JogSpeed -Motor[2].MaxSpeed=Motor[2].JogSpeed -Motor[3].MaxSpeed=Motor[3].JogSpeed -Motor[4].MaxSpeed=Motor[4].JogSpeed - - - diff --git a/cfg/MX2_home.cfg b/cfg/MX2_home.cfg deleted file mode 100644 index 1cc69ef..0000000 --- a/cfg/MX2_home.cfg +++ /dev/null @@ -1,67 +0,0 @@ -define(PLC_Homing='1') - -//Homing: -//Move all motors left bottom -//move 1mm up -//move both mottors at same time - -//move to limit switch, gather data, move to other limit switch, gather stop. move back to first limit switch -//status :P100: local status -//timer :L0: local timer - -open plc PLC_Homing - define(status='P100',timer='L0') - jog-1; jog-2; jog-3; jog-4; - Motor[1].HomeVel=0.5 - Motor[2].HomeVel=0.5 - Motor[3].HomeVel=0.5 - Motor[4].HomeVel=0.5 - status=1 - - while(1) - { - if((Motor[1].LimitStop==1 || Motor[1].FeFatal==1)){ - if((Motor[2].LimitStop==1 || Motor[2].FeFatal==1)){ - if((Motor[3].LimitStop==1 || Motor[3].FeFatal==1)){ - if((Motor[4].LimitStop==1 || Motor[4].FeFatal==1)){ - status=2 - break - }}}} - } - timer = Sys.RunTime + 2 - while (Sys.RunTime < timer){} //wait 1 sec - status=3 - jog1:1000; jog2:1000; jog3:1000; jog4:1000; - timer = Sys.RunTime + .1 - while (Sys.RunTime < timer){} //wait 1 sec - status=4 - while(1) - { - if(Motor[1].DesVelZero==1 && Motor[2].DesVelZero==1 && Motor[3].DesVelZero==1 && Motor[4].DesVelZero==1) - { - status=5 - break - } - } - timer = Sys.RunTime + .1 - while (Sys.RunTime < timer){} - home 1; home 2; home 3; home 4 - status=6 - while(1) //wait homing index found done - { - if(Motor[1].HomeComplete==1 && Motor[2].HomeComplete==1 && Motor[3].HomeComplete==1 && Motor[4].HomeComplete==1) - { - status=7 - break - } - } - while(1) //wait moving to zero position done - { - if(Motor[1].DesVelZero==1 && Motor[2].DesVelZero==1 && Motor[3].DesVelZero==1 && Motor[4].DesVelZero==1) - { - status=8 - break - } - } - disable plc PLC_Homing -close diff --git a/cfg/MX2_setup.cfg b/cfg/MX2_setup.cfg deleted file mode 100644 index 004afb4..0000000 --- a/cfg/MX2_setup.cfg +++ /dev/null @@ -1,56 +0,0 @@ - - -//Wedge Movers -//-------------- -//Nanotec 2 ph motor 42.3mm 1.8deg, Planetgetriebe 1.5Nm I=1:12, Spindel 2mm steigung -//ST4118L1804-B 42 mm 17 50 Ncm 1.8 deg/step 1.8 A/Wicklung 49 mm €34.10 - -//102400*12=1228800 == 2mm -//#1j:1228800 -> 1 rev = 2mm = 2000inc -//posSf = userUnits/encoder_steps =1 -//servoSf=motor_u_steps/userUnits = 1228800/2000. = 614.4 - -//#1 = wedge 1a -//#2 = wedge 1b -//#3 = wedge 2a -//#4 = wedge 2b - -//steigung Keil: 11.4212deg = arctan(0.2)=11.31deg -> Steigung 1:5 -//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,FaultMode=0) - -!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,FaultMode=0) - -!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,FaultMode=0) - -!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,FaultMode=0) - - -//Backlight -//--------- -//#5j=0 //down #5j=-31000 //up -!encoder_sim(enc=5) -!motor(mot=5,dirCur=1800,JogSpeed=40,invDir=False) - - -//Cryojet -//--------- -//Max. 1.5A -1024000=-10mm -//posSf = userUnits/encoder_steps =10000/1024000 =10./1024 -//servoSf=motor_u_steps/userUnits = 1024000/10000. = 102.4 -!encoder_sim(enc=6,posSf=10./1024) -!motor(mot=6,dirCur=1500,JogSpeed=10,invDir=False,servoSf=102.4) - - -!holding_current(m1=[0,1000],m2=[0,1000],m3=[0,1000],m4=[0,1000],m5=[1400,1800],m6=[0,1000]) diff --git a/cfg/MX3_coordTrf.py b/cfg/MX3_coordTrf.py deleted file mode 100644 index 44a19fe..0000000 --- a/cfg/MX3_coordTrf.py +++ /dev/null @@ -1,129 +0,0 @@ -def MX3_coordTrf(fileParser,kwargs): - from math import sqrt - ''' - --- mandatory --- - exc : excentricity of cam - height: Height of the beam above moved plane - width : x-distance of P2 to P3 - length: y-distance of P1 to P2,P3 - camSf : scale factor to convert cam encoder to rotation angle (360deg=2*pi) - --- optional --- - ... - - Documentation: - /home/zamofing_t/Documents/doc-ext/SwissFEL/Devices/5CAM/cam_mov7.pdf - 'Cam Movers for SLS undulators' (21.5.2013, Calvi, Bruegger, Zimoch) - home/zamofing_t/Documents/doc-ext/DeltaTau/Training/TrainingSlides/22-Power PMAC Cam Tables 2014-04.ppt - Ref Manual: 96-106,488, 527-528, 655 - - - Coordinate Transformation - ------------------------- - L1-5: AA1-5 : Cam Angle = Motor position - L11-15: S1-5 : Linear shift of the cam S.= E/sqrt(2)*sin(AA.) - C3-7: X,Y,U,V,W : X,Y positions and rotation around axes X,Y,Z - -open forward -L1-L5 are input motor positions, C3-C7 are output coordinate -X=D^-1*S - - - -open inverse -L1-L5 are output motor positions, C3-C7 are input coordinate -S=D*X - - ''' - - kw=kwargs - - if not kw.has_key('q'): - kw['q']=0. - - kw['sqrt2']=sqrt(2.) - fileParser.parse_txt(''' -// ---------- Coordinate System/Transformation ---------- -// Set the motors as inverse kinematic axes in CS 1 -&1 -#1->I -#2->I -#3->I -#4->I -#5->I - -Coord[1].Ta=10 -Coord[1].Td=10 -Coord[1].AltFeedRate=1000 -Coord[1].Tm=-10000 //1000um/FeedTime -> 1mm/sec -Coord[1].FeedTime=1000 //default value 1000um -Motor[1].MaxSpeed=Motor[1].JogSpeed -Motor[2].MaxSpeed=Motor[2].JogSpeed -Motor[3].MaxSpeed=Motor[3].JogSpeed -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='L2',AA2='L1',AA3='L4',AA4='L5',AA5='L3') - - define(r='L6',scl='L7',q='L8') - 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 - q=$q - scl=$exc/$sqrt2 - 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 - - - //X=D^-1*S - X= +.5*S1 -.5*S2 +(r+.75)*S3 +(r-.25)*S4 -(r+.25)*$sqrt2*S5 - Y=(1.+q)*.5*S1 +(1.+q)*.5*S2 +(1.-q)*.25*S3 +(1.-q)*.25*S4 +(1.-q)*.25*$sqrt2*S5 - U= +1.*S3 +1.*S4 -1.*$sqrt2*S5 - V= -1.*S1 +1.*S2 +.5*S3 -1.5*S4 +.5*$sqrt2*S5 - W= -1.*S1 -1.*S2 +.5*S3 +.5*S4 +.5*$sqrt2*S5 - - //send 1"fwd_res %f %f %f %f %f\\n",X,Y,U,V,W - - D0=$$000000f8; //U=$$8 V=$$10 W=$$20 X=$$40 Y=$$80 hex(8+int('10',16)+int('20',16)+int('40',16)+int('80',16)) -> '0xf8' -close - -open inverse - //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',q='L8') - define(S1='L11',S2='L12',S3='L13',S4='L14',S5='L15') - define(X='C6',Y='C7',U='C3',V='C4',W='C5') - - //if(D0>0) - // send 1"Velocity calculation NOT SUPPORTED\\n" - - //send 1"inv_inp(%f) %f %f %f %f %f\\n",D0,X,Y,U,V,W - - r=$height/$width - q=$q - - S1=+.5*X +.5*Y -(.25+.5*r)*U -.25*V -.25*(1-q)*W - S2=-.5*X +.5*Y +(.25+.5*r)*U +.25*V -.25*(1-q)*W - S3=+.5*X +.5*Y +(.25-.5*r)*U +.25*V +.25*(1+q)*W - S4=-.5*X +.5*Y +(.25+.5*r)*U -.25*V +.25*(1+q)*W - S5= .5*$sqrt2*Y -.25*$sqrt2*U +.25*$sqrt2*(1+q)*W - - scl=$sqrt2/$exc - 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 - -close - -''',kw) diff --git a/cfg/MX3_setup.cfg b/cfg/MX3_setup.cfg deleted file mode 100644 index 0ce890c..0000000 --- a/cfg/MX3_setup.cfg +++ /dev/null @@ -1,83 +0,0 @@ -//the motor has 512*200*100 usteps per revolution (512 uystep/step, 200 steps/rev 1:100 gear) -//the ssi-encoder has 2**18=262144 steps per revolution -//calibration values such that 0 mdeg is the highest point (+5mm) and 180000mdeg = lowest point (-5mm) -//#1: homeoffset: -20907.5928142 -//#2: homeoffset: 102320.329068 -//#3: homeoffset: 168946.772022 -//#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=10,FatalFeLimit=1000,HomeOffset=65477.,FaultMode=0) - -!encoder_ssi(enc=2,numBits=18,posSf=-5625./4096) -!motor(mot=2,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=-154370.,FaultMode=0) - -!encoder_ssi(enc=3,numBits=18,posSf=-5625./4096) -!motor(mot=3,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=-5248.,FaultMode=0) - -!encoder_ssi(enc=4,numBits=18,posSf=-5625./4096) -!motor(mot=4,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=-46620.,FaultMode=0) - -!encoder_ssi(enc=5,numBits=18,posSf=-5625./4096) -!motor(mot=5,dirCur=1000,JogSpeed=40,servoSf=256./9.,InPosBand=10,FatalFeLimit=1000,HomeOffset=93168.,FaultMode=0) - -Motor[1].Servo.BreakPosErr=0 -Motor[2].Servo.BreakPosErr=0 -Motor[3].Servo.BreakPosErr=0 -Motor[4].Servo.BreakPosErr=0 -Motor[5].Servo.BreakPosErr=0 - - -// PKP266D14BA2 1.4A 1.8deb/step -// encoder: Renishaw: RL26BAT050B050A 26 bit, 50nm/enc_cnt -//!encoder_sim(enc=6) -//!motor(mot=6,dirCur=1400,JogSpeed=40,InPosBand=0,FatalFeLimit=1000,HomeOffset=0.) -// #6j=102400 -> 1 rev -//#6j=102400 == 1 rev == 102400 enc_cnt == 2000*1um -//#6j=102400 steps == 1 rev == 2000*20 enc_cnt == 2000*1um -//servoSf : motorusteps/user_units = 102400./2000 -//posSf : user_units/encoder_steps = 0.05nm/1enc_cnt=1/20 -//Open loop -//!encoder_sim(enc=6,posSf=2000./102400,pos2Sf=0) -//!encoder_biss(enc=6,tbl=16,mot=16,numBits=26,posSf=1./20) -//!motor(mot=6,dirCur=1400,servoSf=102400./2000,invDir=False,JogSpeed=2,InPosBand=1,FatalFeLimit=1000,HomeOffset=0.) -//Closed loop -!encoder_sim(enc=6,tbl=16,mot=16,posSf=2000./102400) -!encoder_biss(enc=6,numBits=26,posSf=1./20) -!motor(mot=6,dirCur=1400,servoSf=102400./2000,invDir=False,JogSpeed=2,InPosBand=1,FatalFeLimit=1000,HomeOffset=1684405.) - - -// break configuration -// at the beginning brakes were handeled with 'custom motion', but this has been removed, -// as it was possible to cofigure simple brake handling with the motor on a better approach -// s.a. following implementation -// ~/Documents/prj/SwissFEL/epics_ioc_modules/PBPG/cfg/motEnc-PBPG050.cfg -//!holding_current template not needed. The brake stuff below turns off the amplifiers -// brake -// PowerBrick[0].GpioData[0].16 is GPIO-OUT[1] - -Motor[1].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!! -Motor[1].BrakeOutBit = 16 -Motor[1].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered -Motor[1].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped - -Motor[2].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!! -Motor[2].BrakeOutBit = 17 -Motor[2].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered -Motor[2].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped - -Motor[3].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!! -Motor[3].BrakeOutBit = 18 -Motor[3].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered -Motor[3].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped - -Motor[4].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!! -Motor[4].BrakeOutBit = 19 -Motor[4].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered -Motor[4].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped - -Motor[5].pBrakeOut = PowerBrick[0].GpioData[0].a // put proper reference to gpio here !!! -Motor[5].BrakeOutBit = 20 -Motor[5].BrakeOffDelay = 100 // delay in ms before the brake is released after motion was triggered -Motor[5].BrakeOnDelay = 100 // delay in ms before the amplifier is disabled after motion has stopped diff --git a/cfg/MX3_setup_sim.cfg b/cfg/MX3_setup_sim.cfg deleted file mode 100644 index 3aff032..0000000 --- a/cfg/MX3_setup_sim.cfg +++ /dev/null @@ -1,19 +0,0 @@ -!encoder_sim(enc=1,tbl=1,mot=1) -!motor(mot=1,dirCur=0,contCur=100,peakCur=100,timeAtPeak=1,JogSpeed=100.,numPhase=3,invDir=True) -Motor[1].pLimits=0;Motor[1].AmpFaultLevel=0;Motor[1].pAmpEnable=0;Motor[1].pAmpFault=0 - -!encoder_sim(enc=2,tbl=2,mot=2) -!motor(mot=2,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=100.,numPhase=3,invDir=True) -Motor[2].pLimits=0;Motor[2].AmpFaultLevel=0;Motor[2].pAmpEnable=0;Motor[2].pAmpFault=0 - -!encoder_sim(enc=3,tbl=3,mot=3) -!motor(mot=3,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=100.,numPhase=3,invDir=True) -Motor[3].pLimits=0;Motor[3].AmpFaultLevel=0;Motor[3].pAmpEnable=0;Motor[3].pAmpFault=0 - -!encoder_sim(enc=4,tbl=4,mot=4) -!motor(mot=4,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=100.,numPhase=3,invDir=True) -Motor[4].pLimits=0;Motor[4].AmpFaultLevel=0;Motor[4].pAmpEnable=0;Motor[4].pAmpFault=0 - -!encoder_sim(enc=5,tbl=5,mot=5) -!motor(mot=5,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=100.,numPhase=3,invDir=True) -Motor[5].pLimits=0;Motor[5].AmpFaultLevel=0;Motor[5].pAmpEnable=0;Motor[5].pAmpFault=0 diff --git a/cfg/SAR-EXPMX1.cfg b/cfg/SAR-EXPMX1.cfg deleted file mode 100644 index 82facd8..0000000 --- a/cfg/SAR-EXPMX1.cfg +++ /dev/null @@ -1,10 +0,0 @@ - -//$$$*** -//!common() -//!common(PhaseFreq=20000,PhasePerServo=4) -//!common(PhaseFreq=20000,PhasePerServo=1) -//!common(PhaseFreq=40000) - -!MX1_setup() -!MX1_home() -!MX1_coordTrf() \ No newline at end of file diff --git a/cfg/SAR-EXPMX2.cfg b/cfg/SAR-EXPMX2.cfg deleted file mode 100644 index 20d208c..0000000 --- a/cfg/SAR-EXPMX2.cfg +++ /dev/null @@ -1,4 +0,0 @@ - -!MX2_setup() -!MX2_home() -!MX2_coordTrf() \ No newline at end of file diff --git a/cfg/SAR-EXPMX3.cfg b/cfg/SAR-EXPMX3.cfg deleted file mode 100644 index bd6de05..0000000 --- a/cfg/SAR-EXPMX3.cfg +++ /dev/null @@ -1,60 +0,0 @@ - -!MX3_setup() -//!MX3_setup_sim() // comment out !MX3_setup() when this is active -//!MX3_home() -//using 360000 for 1 rev. -> 1.7453292519943296e-05=np.pi/180000 -//excentricity= 5mm -//height = 90+28mm = 118 -//width = (450+305)/2=377.5 -//length = 600mm -//pivotpoint q= -.7 0= center 1=mover upstream -1=mover downstream ca. 100mm from downstream -//!MX3_coordTrf(exc=5000,height=118000,width=377500,length=600000,camSf=1.7453292519943296e-05) -!MX3_coordTrf(exc=5000,height=118000,width=377500,length=600000,camSf=1.7453292519943296e-05,q=-.7) - -//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 -Coord[1].AltFeedRate=1000 -Coord[1].Tm=-10000 //1000um/FeedTime -> 1mm/sec -Coord[1].FeedTime=1000 //default value 1000um - -&1 - -//initialization code -open plc 1 - 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 1 -close // plc 1 - -enable plc 1 - -#1..5dkill - -#6hmz -//motor 1..5 use break setup to kill motor -!holding_current(m6=[0,700]) - - diff --git a/cfg/sim_8_motors.cfg b/cfg/sim_8_motors.cfg deleted file mode 100644 index 5444aee..0000000 --- a/cfg/sim_8_motors.cfg +++ /dev/null @@ -1,42 +0,0 @@ -//simulated 8 motors without needing real ones -//$$$*** -//!common() - -//use some step and direction lines to setup simulate motors -// /afs/psi.ch/user/h/humar_t/public/Modules/XMI/cfg/xmi.cfg - -!encoder_sim(enc=1,tbl=1,mot=1) -!motor(mot=1,dirCur=0,contCur=100,peakCur=100,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[1].pLimits=0;Motor[1].AmpFaultLevel=0;Motor[1].pAmpEnable=0;Motor[1].pAmpFault=0 - -!encoder_sim(enc=2,tbl=2,mot=2) -!motor(mot=2,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[2].pLimits=0;Motor[2].AmpFaultLevel=0;Motor[2].pAmpEnable=0;Motor[2].pAmpFault=0 - -!encoder_sim(enc=3,tbl=3,mot=3) -!motor(mot=3,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[3].pLimits=0;Motor[3].AmpFaultLevel=0;Motor[3].pAmpEnable=0;Motor[3].pAmpFault=0 - -!encoder_sim(enc=4,tbl=4,mot=4) -!motor(mot=4,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[4].pLimits=0;Motor[4].AmpFaultLevel=0;Motor[4].pAmpEnable=0;Motor[4].pAmpFault=0 - -!encoder_sim(enc=5,tbl=5,mot=5) -!motor(mot=5,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[5].pLimits=0;Motor[5].AmpFaultLevel=0;Motor[5].pAmpEnable=0;Motor[5].pAmpFault=0 - -!encoder_sim(enc=6,tbl=6,mot=6) -!motor(mot=6,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[6].pLimits=0;Motor[6].AmpFaultLevel=0;Motor[6].pAmpEnable=0;Motor[6].pAmpFault=0 - -!encoder_sim(enc=7,tbl=7,mot=7) -!motor(mot=7,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[7].pLimits=0;Motor[7].AmpFaultLevel=0;Motor[7].pAmpEnable=0;Motor[7].pAmpFault=0 - -!encoder_sim(enc=8,tbl=8,mot=8) -!motor(mot=8,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[8].pLimits=0;Motor[8].AmpFaultLevel=0;Motor[8].pAmpEnable=0;Motor[8].pAmpFault=0 - -Motor[3].JogSpeed=1000 //used for joging -Motor[3].MaxSpeed=1000 //used for motion program -#1..8j/ diff --git a/evr_PCIe-300DC.subs b/evr_PCIe-300DC.subs deleted file mode 100644 index a2c0e43..0000000 --- a/evr_PCIe-300DC.subs +++ /dev/null @@ -1,471 +0,0 @@ -file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db" -{ - { - - ## Global settings - ExtInhib-Sel=0, #0 = Use Inhibit, 1 = Always permitt : Use HW trigger inhibit (EVRTG only) - Link-Clk-SP=142.8, #50-150 : Event Link speed (MHz) - Time-Src-Sel=0, #0 = Event clk, 1 = Mapped codes, 2 = DBus4 : Source for timestamping clock. - Time-Clock-SP=0.0, #50-150 : Timestamp tick rate (MHz) - PLL-Bandwidth-Sel=4, #0 = HM, 1 = HL, 2 = MH, 3 = MM, 4 = ML: PLL Bandwidth Select (see Silicon Labs Si5317 datasheet) - - ## Delay compensation - DlyCompensation-Enabled-Sel=1, #0 = Disabled, 1 = Enabled: Enables or disables delay compensation - DlyCompensation-Target-SP=5000, # Delay compensation value in [ns]. Should be set to max(path + someDelta) of all receivers in the timing system. This value can also be retrieved from an external record (see macro below). - DlyCompensation-Source="SIN-TIMAST-TMA:EvrDC-SP CP", # delay compensation target value is sourced from the record referenced here. - # this value must be set the same for all EVRs in the timing network. This is why we have a single record which acts as a source for all EVRs in the same timing network. - # NOTE: The value of DlyCompensation-Source needs to include CP to ensure the value is updated when the source changes. - # The CP can not be hidden in the template file because this would lead to an invalid input link CP when no substitution value for DlyCompensation-Source is provided. - # Recommended setting for SwissFEL is SIN-TIMAST-TMA:EvrDC-SP CP - DlyCompensation-Source-Disa=0, #0 = Enabled, 1 = Disabled: enables or disables sourcing the delay compensation target value from record specified with 'DlyCompensation-Source' macro - - ## Prescalers - PS0-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS0-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS0-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS1-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS1-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS1-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS2-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS2-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS2-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS3-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS3-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS3-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS4-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS4-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS4-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS5-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS5-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS5-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS6-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS6-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS6-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - PS7-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output. - PS7-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable - PS7-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable - - ## Distributed bus - PulserMap-Dbus0-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus1-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus2-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus3-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus4-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus5-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus6-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - PulserMap-Dbus7-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable - - - ## Pulsers - Pul0-Name-I="Pulser 0" #Description of the pulser. Maximum 40 characters allowed! - Pul0-Name-I.DESC="Pulse for WSC readout." #Secondary description of the pulser. Maximum 40 characters allowed! - Pul0-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul0-Polarity-Sel=1, #0 = Active High, 1 = Active Low - Pul0-Delay-SP=0, #Pulser delay in us (DI 1 event at 5400, need to trigger for bunch at 7500) - Pul0-Width-SP=5000, #Pulser width in us - Pul0-Prescaler-SP=1, #0-65535 : Pulser prescaler - - Pul1-Name-I="Pulser 1" #Description of the pulser. Maximum 40 characters allowed! - Pul1-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul1-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul1-Polarity-Sel=1, #0 = Active High, 1 = Active Low - Pul1-Delay-SP=750, #Pulser delay in us - Pul1-Width-SP=5000, #Pulser width in us - Pul1-Prescaler-SP=1, #0-65535 : Pulser prescaler - - Pul2-Name-I="Pulser 2" #Description of the pulser. Maximum 40 characters allowed! - Pul2-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul2-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul2-Polarity-Sel=1, #0 = Active High, 1 = Active Low - Pul2-Delay-SP=0, #Pulser delay in us - Pul2-Width-SP=5000, #Pulser width in us - Pul2-Prescaler-SP=1, #0-65535 : Pulser prescaler - - Pul3-Name-I="Pulser 3" #Description of the pulser. Maximum 40 characters allowed! - Pul3-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul3-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul3-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul3-Delay-SP=0, #Pulser delay in us - Pul3-Width-SP=0, #Pulser width in us - Pul3-Prescaler-SP=1, #0-65535 : Pulser prescaler - - Pul4-Name-I="Pulser 4" #Description of the pulser. Maximum 40 characters allowed! - Pul4-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul4-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul4-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul4-Delay-SP=0, #Pulser delay in us - Pul4-Width-SP=0, #0-65535 : Width in us - - Pul5-Name-I="Pulser 5" #Description of the pulser. Maximum 40 characters allowed! - Pul5-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul5-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul5-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul5-Delay-SP=0, #Pulser delay in us - Pul5-Width-SP=0, #0-65535 : Width in us - - Pul6-Name-I="Pulser 6" #Description of the pulser. Maximum 40 characters allowed! - Pul6-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul6-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul6-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul6-Delay-SP=0, #Pulser delay in us - Pul6-Width-SP=0, #0-65535 : Width in us - - Pul7-Name-I="Pulser 7" #Description of the pulser. Maximum 40 characters allowed! - Pul7-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul7-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul7-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul7-Delay-SP=0, #Pulser delay in us - Pul7-Width-SP=0, #0-65535 : Width in us - - Pul8-Name-I="Pulser 8" #Description of the pulser. Maximum 40 characters allowed! - Pul8-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul8-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul8-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul8-Delay-SP=0, #Pulser delay in us - Pul8-Width-SP=0, #0-65535 : Width in us - - Pul9-Name-I="Pulser 9" #Description of the pulser. Maximum 40 characters allowed! - Pul9-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul9-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul9-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul9-Delay-SP=0, #Pulser delay in us - Pul9-Width-SP=0, #0-65535 : Width in us - - Pul10-Name-I="Pulser 10" #Description of the pulser. Maximum 40 characters allowed! - Pul10-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul10-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul10-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul10-Delay-SP=0, #Pulser delay in us - Pul10-Width-SP=0, #0-65535 : Width in us - - Pul11-Name-I="Pulser 11" #Description of the pulser. Maximum 40 characters allowed! - Pul11-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul11-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul11-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul11-Delay-SP=0, #Pulser delay in us - Pul11-Width-SP=0, #0-65535 : Width in us - - Pul12-Name-I="Pulser 12" #Description of the pulser. Maximum 40 characters allowed! - Pul12-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul12-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul12-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul12-Delay-SP=0, #Pulser delay in us - Pul12-Width-SP=0, #0-65535 : Width in us - - Pul13-Name-I="Pulser 13" #Description of the pulser. Maximum 40 characters allowed! - Pul13-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul13-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul13-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul13-Delay-SP=0, #Pulser delay in us - Pul13-Width-SP=0, #0-65535 : Width in us - - Pul14-Name-I="Pulser 14" #Description of the pulser. Maximum 40 characters allowed! - Pul14-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul14-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul14-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul14-Delay-SP=0, #Pulser delay in us - Pul14-Width-SP=0, #0-65535 : Width in us - - Pul15-Name-I="Pulser 15" #Description of the pulser. Maximum 40 characters allowed! - Pul15-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed! - Pul15-Ena-Sel=1, #0 = Disabled, 1 = Enabled - Pul15-Polarity-Sel=0, #0 = Active High, 1 = Active Low - Pul15-Delay-SP=0, #Pulser delay in us - Pul15-Width-SP=0, #0-65535 : Width in us - - - ## Front panel outputs - # Available -Src-SP choices: - # 0 Pulser 0 - # 1 Pulser 1 - # 2 Pulser 2 - # 3 Pulser 3 - # 4 Pulser 4 - # 5 Pulser 5 - # 6 Pulser 6 - # 7 Pulser 7 - # 8 Pulser 8 - # 9 Pulser 9 - # 10 Pulser 10 - # 11 Pulser 11 - # 12 Pulser 12 - # 13 Pulser 13 - # 14 Pulser 14 - # 15 Pulser 15 - # 32 DBus 0 - # 33 DBus 1 - # 34 DBus 2 - # 35 DBus 3 - # 36 DBus 4 - # 37 DBus 5 - # 38 DBus 6 - # 39 Dbus 7 - # 40 Prescaler 0 - # 41 Prescaler 1 - # 42 Prescaler 2 - # 43 Prescaler 3 - # 44 Prescaler 4 - # 45 Prescaler 5 - # 46 Prescaler 6 - # 47 Prescaler 7 - # 63 Force Low - # 62 Force High - - - # Universal outputs - # Slot 0 - FrontUnivOut0-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut0-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut0-Ena-SP=1, # Default to enabled - FrontUnivOut0-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut0-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut1-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut1-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut1-Ena-SP=1, # Default to enabled - FrontUnivOut1-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut1-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 1 - FrontUnivOut2-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut2-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut2-Ena-SP=1, # Default to enabled - FrontUnivOut2-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut2-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut3-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut3-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut3-Ena-SP=1, # Default to enabled - FrontUnivOut3-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut3-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 2 - FrontUnivOut4-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut4-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut4-Ena-SP=1, # Default to enabled - FrontUnivOut4-Src-SP=0, # Use pulser 0 which generates 5000 us long pulse - FrontUnivOut4-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut5-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut5-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut5-Ena-SP=1, # Default to enabled - FrontUnivOut5-Src-SP=1, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut5-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 3 - FrontUnivOut6-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut6-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut6-Ena-SP=1, # Default to enabled - FrontUnivOut6-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut6-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut7-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut7-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut7-Ena-SP=1, # Default to enabled - FrontUnivOut7-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut7-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 4 - FrontUnivOut8-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut8-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut8-Ena-SP=1, # Default to enabled - FrontUnivOut8-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut8-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut9-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut9-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut9-Ena-SP=1, # Default to enabled - FrontUnivOut9-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut9-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 5 - FrontUnivOut10-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut10-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut10-Ena-SP=1, # Default to enabled - FrontUnivOut10-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut10-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut11-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut11-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut11-Ena-SP=1, # Default to enabled - FrontUnivOut11-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut11-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 6 - FrontUnivOut12-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut12-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut12-Ena-SP=1, # Default to enabled - FrontUnivOut12-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut12-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut13-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut13-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut13-Ena-SP=1, # Default to enabled - FrontUnivOut13-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut13-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - # Slot 7 - FrontUnivOut14-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut14-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut14-Ena-SP=1, # Default to enabled - FrontUnivOut14-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut14-Src2-SP=63, # Defaults to Force low (if enabled -> Ena-SP) - - FrontUnivOut15-Name-I="" # Description of the output. Maximum 40 characters allowed! - FrontUnivOut15-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed! - FrontUnivOut15-Ena-SP=1, # Default to enabled - FrontUnivOut15-Src-SP=63 # Defaults to Force low (if enabled -> Ena-SP) - FrontUnivOut15-Src2-SP=63 # Defaults to Force low (if enabled -> Ena-SP) - - } - } - -## Mapping between hardware event code and a software (EPICS) database event -## In addition to firing an EPICS database event on each occurance of hardware event, a counter for the specific EVT is increased. -# -# Macros: -# SYS = System name (auto expanded by parent) -# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent) -# EVT = Event code (hardware). Set EVT=0 to disable. -# CODE = EPICS database event number (software) -# FLNK = If provided, forward links to the record after all records from this template are processed -# -file "$(mrfioc2_TEMPLATES=db)/evr-softEvent.template"{ -pattern { EVT, CODE, FLNK } - { "22", "22", "" } # ESA laser diag-1 - { "28", "28", "" } # BeamSync read-1 -} -# If you want to enable measuring the jitter on received events comment out the previous substitution and use this one instead -# -# Additinal macros: -# HIST_LEN = number of histogram bins created from frequency measurements. Default 200. -# HIST_ULIM = histogram upper limit. Default 12. -# HIST_LLIM = histogram lower limit. Default 8. -# -# NOTE: make sure your system supports the 'histogram' record before using this template! -# -#file "$(mrfioc2_TEMPLATES=db)/evr-softEvent-measure.template"{ -#pattern { EVT, CODE, FLNK } -# { "1", "1", "" } -# { "2", "2", "" } -# { "3", "3", "" } -#} - -## Mapping between hardware event code and a special function of the EVR -## Each event can be mapped only to one function! -## There are some default events, that allways trigger specific functions! -## Available functions: -## - Blink : An LED on the EVRs front panel will blink when the code is received. -## - Forward : The received code will be immediately retransmitted on the upstream event link. -## - Stop Log (default event 121): Freeze the circular event log buffer. An CPU interrupt will be raised which will cause the buffer to be downloaded. This might be a useful action to map to a fault event. -## - Log : Include this event code in the circular event log. -## - Heartbeat (default event 122): This event resets the heartbeat timeout timer. -## - Reset PS (default event 123): Resets the phase of all prescalers. -## - TS reset (default event 124): Transfers the seconds timestamp from the shift register and zeros the sub-seconds part. -## - TS tick (default event 125): When the timestamp source is 'Mapped code' then any event with this mapping will cause the sub-seconds part of the timestamp to increment. -## - Shift 1 (default event 113): Shifts the current value of the seconds timestamp shift register up by one bit and sets the low bit to 1. -## - Shift 0 (default event 112): Shifts the current value of the seconds timestamp shift register up by one bit and sets the low bit to 0. -## - FIFO : Bypass the automatic allocation mechanism and always include this code in the event FIFO. -# -# Macros: -# SYS = System name (auto expanded by parent) -# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent) -# EVT = Event code (hardware). Set EVNT=0 to disable. -# FUNC = Function to be mapped -# Choices are: "FIFO", "Latch TS", "Blink", "Forward", -# "Stop Log", "Log", "Heartbeat", "Reset PS", -# "TS reset", "TS tick", "Shift 1", "Shift 0", -# -file "$(mrfioc2_TEMPLATES=db)/evr-specialFunctionMap.template"{ -pattern { EVT, FUNC } - {"1", "Blink"} -} - -## Control for mapping a Pulser geneator to an event code in hardware. -## Each pulser-function combination can be mapped to multiple events. -## Available functions: -## - Trig : causes a received event to trigger a pulser. A Pulser based on pulser polarity, delay and width will be outputted. -## - Set : causes a received event to force a pulser into set state(based on pulser polarity). -## - Reset: causes a received event to force a pulser into reset state(based on pulser polarity). -# -## Pulser polarity defines the pulser set and reset state: -## - Active high: Output is logic high in set state and logic low in reset state -## - Active low: Output is logic low in set state and logic high in reset state -# -# Macros: -# SYS = system name (auto expanded by parent) -# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent) -# PID = Pulser ID # -# F = Pulser generator function -# Choices are: "Trig", "Set", "Reset" -# EVT = Initial event code -# ID = Mappings must have unique ID for each PID-F combination. -# Only mappings with ID=0 are displayed in the GUI -# -file "$(mrfioc2_TEMPLATES=db)/evr-pulserMap.template"{ -pattern {PID F, EVT, ID} - {0, Trig, 214, 0 } # ESB JF-Start - {1, Trig, 40, 0 } # ESB JF-Acquire frame - {2, Trig, 22, 0 } # ESA laser diag-1 - {3, Trig, 0, 0 } - {4, Trig, 0, 0 } - {5, Trig, 0, 0 } - {6, Trig, 0, 0 } - {7, Trig, 0, 0 } - {8, Trig, 0, 0 } - {9, Trig, 0, 0 } - {10, Trig, 0, 0 } - {11, Trig, 0, 0 } - {12, Trig, 0, 0 } - {13, Trig, 0, 0 } - {14, Trig, 0, 0 } - {15, Trig, 0, 0 } - - - {0, Set, 0, 0 } - {1, Set, 0, 0 } - {2, Set, 0, 0 } - {3, Set, 0, 0 } - {4, Set, 0, 0 } - {5, Set, 0, 0 } - {6, Set, 0, 0 } - {7, Set, 0, 0 } - {8, Set, 0, 0 } - {9, Set, 0, 0 } - {10, Set, 0, 0 } - {11, Set, 0, 0 } - {12, Set, 0, 0 } - {13, Set, 0, 0 } - {14, Set, 0, 0 } - {15, Set, 0, 0 } - - - {0, Reset, 0, 0 } - {1, Reset, 0, 0 } - {2, Reset, 0, 0 } - {3, Reset, 0, 0 } - {4, Reset, 0, 0 } - {5, Reset, 0, 0 } - {6, Reset, 0, 0 } - {7, Reset, 0, 0 } - {8, Reset, 0, 0 } - {9, Reset, 0, 0 } - {10, Reset, 0, 0 } - {11, Reset, 0, 0 } - {12, Reset, 0, 0 } - {13, Reset, 0, 0 } - {14, Reset, 0, 0 } - {15, Reset, 0, 0 } -} - -## Flash access support -## Uncomment this substitution to load records that expose read and write access to the flash chip on the device. -# -# Macros: -# SYS = System name (auto expanded by parent) -# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent) -# -#file "$(mrfioc2_TEMPLATES=db)/flash.template" -#{ -# {} -#} diff --git a/generate.py b/generate.py deleted file mode 100755 index d5e96b3..0000000 --- a/generate.py +++ /dev/null @@ -1,485 +0,0 @@ -#!/usr/bin/env python -#*-----------------------------------------------------------------------* -#| | -#| Copyright (c) 2019 by Paul Scherrer Institute (http://www.psi.ch) | -#| | -#| Author Thierry Zamofing (thierry.zamofing@psi.ch) | -#*-----------------------------------------------------------------------* -''' -generate .subs and _startup.script files - mode bits: - 0x001: genYAML() - 0x002: genIOC() - 0x004: genLauncher() - -Long Doc''' -from __future__ import print_function - -import logging, sys, os, json -import string - -class Generate: - yamlParam={ - # ioc : ( host , port , ver , arch , osys , osys_id , - # 'SAR-CSSU-EXPMX1' : ('SAR-CSSU-EXPMX1' , 50001 , '3.14.12' , 'moxa42-armv6l' , 'moxa42-armv6l' , 'moxa42-armv6l' , ) , - 'SAR-CPPM-EXPMX1' : ('SAR-CPPM-EXPMX1' , 50001 , '7.0.7' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , ) , - 'SAR-CPPM-EXPMX2' : ('SAR-CPPM-EXPMX2' , 50001 , '7.0.7' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , ) , - 'SAR-CPPM-EXPMX3' : ('SAR-CPPM-EXPMX3' , 50001 , '7.0.7' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , ) , - 'SAR-CPPM-EXPMX4' : ('SAR-CPPM-EXPMX4' , 50001 , '7.0.7' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , 'eldk42-ppc4xxFP' , ) , - 'SARES30-CPCL-MCSSMX' : ('saresc-vserv-01' , 50001 , '7.0.7' , 'x86_64' , 'RHEL8' , 'rhel' , ) , - } - - iocSmarAct={ - 'SARES30-CPCL-MCSSMX': - { - 'port':'MCS', - 'host':'129.129.244.32', # 00:04:a3:a2:71:35, MCS0060 Serial: 3762 - 'prefix':'SARES30-SMX', - 'loc':'EH.057 MobRack', - 'fmt':'{{{PORT:5},{S:14},{M:6},{ADDR:>4},{DESC:14},{DIR:3},{VELO:4},{DHLM:>6},{DLLM:>6},{EGU:4},{PTYP:4},{RTRY:4}}}\n', - 'motLst':( - # dir: Pos:0 Neg:1 - ( 'DESC' , 'M' , 'ADDR', 'DHLM', 'DLLM', 'DIR', 'EGU', 'PTYP'), - ('COLLI:TX' , 'MCS1' , 0 , 12 , -10 , 1 , 'mm' , 'S' ) , - ('COLLI:TY' , 'MCS2' , 1 , 12 , -10 , 1 , 'mm' , 'S' ) , - ('Motor3' , 'MCS3' , 2 , 10 , -10 , 0 , 'mm' , 'S' ) , - ('POSTTUBE:TX1', 'MCS4' , 3 , 10 , -10 , 0 , 'mm' , 'S' ) , - ('POSTTUBE:TX2', 'MCS5' , 4 , 10 , -10 , 0 , 'mm' , 'S' ) , - ('POSTTUBE:TY1', 'MCS6' , 5 , 15 , -20 , 0 , 'mm' , 'S' ) , - ('POSTTUBE:TY2', 'MCS7' , 6 , 15 , -20 , 0 , 'mm' , 'S' ) , - ('POSTTUBE:TZ' , 'MCS8' , 7 , 10 , -10 , 1 , 'mm' , 'S' ) , - ('Motor9' , 'MCS9' , 8 , 10 , -10 , 0 , 'mm' , 'S' ) , - ('SLITS:X1' , 'MCS10', 9 , 10 , -10 , 1 , 'mm' , 'S' ) , - ('SLITS:X2' , 'MCS11', 10 , 10 , -10 , 1 , 'mm' , 'S' ) , - ('SLITS:Y1' , 'MCS12', 11 , 10 , -10 , 1 , 'mm' , 'S' ) , - ('SLITS:Y2' , 'MCS13', 12 , 10 , -10 , 1 , 'mm' , 'S' ) , - ('unused' , 'MCS14', 13 , 10 , -10 , 0 , 'mm' , 'S' ) , - ('unused' , 'MCS15', 14 , 10 , -10 , 0 , 'mm' , 'S' ) , - ), - } - } - - iocPowerBrick={ - # HOST runScript - 'SAR-CPPM-EXPMX1':{ - 'port':'PPMAC', - 'prefix':'SAR-EXPMX', - 'loc':'EH.057 MobRack', - 'fmt': - '{{{P:10},{M:10},{ADDR:4},{DESC:19},{DIR:3},{VELO:4},{HVEL:4},{MRES:5},{PREC:4},{EGU:4}}}\n', - 'motLst':( - ( 'DESC' , 'M' , 'ADDR' , 'DIR' , 'VELO' , 'HVEL' , 'MRES' , 'PREC' , 'EGU' ) , - ( '"Sample F-Trans Y"' , 'MOT_FY' , 1 , 0 , 16 , 2 , 0.001 , 4 , 'mm' ) , - ( '"Sample F-Trans X"' , 'MOT_FX' , 2 , 0 , 16 , 2 , 0.001 , 4 , 'mm' ) , - ( '"Sample C-Trans Y"' , 'MOT_CY' , 3 , 0 , 12 , 4 , 0.001 , 4 , 'mm' ) , - ( '"Sample C-Trans X"' , 'MOT_CX' , 4 , 0 , 2 , 2 , 0.001 , 4 , 'mm' ) , - ( '"Sample C-Trans Z"' , 'MOT_CZ' , 5 , 0 , 2 , 2 , 0.001 , 4 , 'mm' ) , - ( '"Interfero Y"' , 'ENC_FY' , 6 , 0 , 2 , 2 , 0.001 , 4 , 'mm' ) , - ( '"Interfero X"' , 'ENC_FX' , 7 , 0 , 2 , 2 , 0.001 , 4 , 'mm' ) , - ), - }, - 'SAR-CPPM-EXPMX2':{ - 'port':'PPMAC', - 'prefix':'SAR-EXPMX', - 'loc':'EH.057 MobRack', - 'fmt': - '{{{P:10},{M:10},{ADDR:4},{DESC:12},{DIR:3},{VELO:4},{HVEL:4},{MRES:5},{PREC:4},{EGU:4}}}\n', - 'motLst':( - ( 'DESC' , 'M' , 'ADDR' , 'DIR' , 'VELO' , 'HVEL' , 'MRES' , 'PREC' , 'EGU' ) , - ( '"Wedge 1"' , 'MOT_WEDGE1' , 1 , 0 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge 2"' , 'MOT_WEDGE2' , 2 , 0 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge 3"' , 'MOT_WEDGE3' , 3 , 0 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge 4"' , 'MOT_WEDGE4' , 4 , 0 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge X"' , 'MOT_WEDGEX' , 9 , 1 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge Y"' , 'MOT_WEDGEY' , 10 , 0 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge A"' , 'MOT_WEDGEA' , 11 , 0 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Wedge B"' , 'MOT_WEDGEB' , 12 , 1 , 1. , .5 , 0.001 , 3 , 'mm' ) , - ( '"Backlight"' , 'MOT_BLGT' , 5 , 1 , 40E3 , 20E3 , 1 , 0 , 'usr' ) , - ( '"Cryojet"' , 'MOT_CRYO' , 6 , 1 , 10. , 5. , 0.001 , 3 , 'mm' ) , - ), - }, - 'SAR-CPPM-EXPMX3':{ - 'port':'PPMAC', - 'prefix':'SAR-EXPMX', - 'loc':'EH.057 MobRack', - 'fmt': - '{{{P:10},{M:10},{ADDR:4},{DESC:13},{DIR:3},{VELO:4},{MRES:5},{PREC:4},{EGU:4}}}\n', - 'motLst':( - ( 'DESC' , 'M' , 'ADDR' , 'DIR' , 'VELO' , 'MRES' , 'PREC' , 'EGU' ) , - ( '"Girder 1"' , 'MOT_GIR_1' , 1 , 0 , 40 , 0.001 , 3 , 'deg' ) , - ( '"Girder 2"' , 'MOT_GIR_2' , 2 , 0 , 40 , 0.001 , 3 , 'deg' ) , - ( '"Girder 3"' , 'MOT_GIR_3' , 3 , 0 , 40 , 0.001 , 3 , 'deg' ) , - ( '"Girder 4"' , 'MOT_GIR_4' , 4 , 0 , 40 , 0.001 , 3 , 'deg' ) , - ( '"Girder 5"' , 'MOT_GIR_5' , 5 , 0 , 40 , 0.001 , 3 , 'deg' ) , - ( '"Girder X"' , 'MOT_GIR_X' , 9 , 0 , 40 , 0.001 , 3 , 'mm' ) , - ( '"Girder Y"' , 'MOT_GIR_Y' , 10 , 0 , 40 , 0.001 , 3 , 'mm' ) , - ( '"Girder U"' , 'MOT_GIR_U' , 11 , 0 , 40 , 0.001 , 3 , 'mrad' ) , - ( '"Girder V"' , 'MOT_GIR_V' , 12 , 0 , 40 , 0.001 , 3 , 'mrad' ) , - ( '"Girder W"' , 'MOT_GIR_W' , 13 , 0 , 40 , 0.001 , 3 , 'mrad' ) , - ( '"Detector Z"' , 'MOT_DET_Z' , 6 , 1 , 4 , 0.001 , 3 , 'mm' ) , - ), - }, - 'SAR-CPPM-EXPMX4':{ - 'port':'PPMAC', - 'prefix':'SAR-EXPMX', - 'loc':'EH.057 MobRack', - 'fmt': - '{{{P:10},{M:10},{ADDR:4},{DESC:27},{DIR:3},{VELO:4},{MRES:5},{PREC:4},{EGU:4}}}\n', - 'motLst':( - ('DESC', 'M', 'ADDR', 'DIR', 'VELO', 'MRES', 'PREC', 'EGU'), - # desc , m , addr , dir , velo , hvel , accl , jar , mres , prec , egu , dhlm , dllm , - # NOT YET ANY MOTOR - ), - }, - } - - tplYaml='''\ -ioc_host: {host} -ioc_port: {port} -epics_version: {ver} -cpu_architecture: {arch} -os: {osys} -os_id: {osys_id} -''' - - # /home/zamofing_t/Documents/doc-ext/SmaractMCS/MCS2PositionerTypes.pdf Positioner Types Cross Reference - lutPSENS={ # abrev_(MCS2code, MCS1code) - 'S':(300,1),'SD':(301,21),'SP':(302,5),'SC':(303,6),'SCD':(304,24),'SC500':(307,18),'SR20':(309,8), - 'SR':(312,2),'SR2':(313,23),'SR77':(316,20),'SR120':(320,37),'G605DS':(325,48),'G775DS':(328,49), - 'LE':(342,43),'LED':(343,44),'L':(345,41),'LD':(346,42),'LC':(348,38),'LCD':(349,40),'LR':(354,39), - 'M':(357,9),'MD':(358,32),'GD':(363,11),'GE':(366,12),'G605L':(381,50),'G775L':(383,51),'G605LE':(387,53), - 'G775LE':(389,54),'G605LC':(396,57),'G775LC':(398,58),'G775LE':(389,54), - } - - tplMcsCtrl='''\ -################################################################### -# DO NOT EDIT: Generated with epics_ioc_modules/ESB_MX/generate.py -# This is the IOC {ioc} on {ioc_host}:{ioc_port} -################################################################## - -epicsEnvSet("ENGINEER", "zamofing_t") -epicsEnvSet("LOCATION", "{loc}") - -###### require modules ############ -# motorSmarAct community driver -# smarActMot PSI templates and other files -require motorSmarAct -require smarActMot -require ESB_MX - -###### initialize device ############ -drvAsynIPPortConfigure("asyn{port}", "{host}:5000", 0, 0, 0) -#ctrlPort, asynPort, number of axes, active poll period (ms), idle poll period ms), [default debug lvl] -MCSCreateController("{port}", "asyn{port}", {num_ax}, 100, 1000, 0x00) - -''' - - mcsSubsHdr='''\ -file asyn.template {{{{P={prefix}, PORT=asyn{port}}}}} - -##### MCS -file $(smarActMot_DIR)/db/MCS_axis.template -{{ - pattern -''' - - tplPwrBrkCtrl='''\ -########################################## -# DO NOT EDIT: Generated with generate.py -# This is the IOC on host {ioc} -########################################## -# PPMAC responsible: Thierry Zamofing -########################################## - -###### initialize device ############ -require PB_COMMON -{req} - -#powerPmacCreateController(, , ) -powerPmacCreateController("{port}", 200, 1000) - -###### initialize axes ############ -''' - - tplPwrBrkAxis='''\ -powerPmacCreateAxis({PORT}, {ADDR}) -''' - - tplEXPMX1=''' -###### initialize EVR ############ -# https://git.psi.ch/epics_driver_modules/mrfioc2 -require mrfioc2 -runScript $(mrfioc2_DIR)/mrfioc2_evr-PCIe.cmd, "DEVICE=EVR0,EVR_SUBS=$(ESB_MX_DIR)/db/evr_PCIe-300DC.subs,EVR_DOMAIN=0x2,EVR_BUS=0x21,SYS=SAR-EXPMX" - -###### initialize EVR data buffer ############ -# https://git.psi.ch/epics_driver_modules/mrfioc2_regDev -require mrfioc2_regDev -runScript $(mrfioc2_regDev_DIR)/mrfioc2_regDev_pulseID_RX.cmd, "DEVICE=EVR0,SYS=SAR-EXPMX" - -require PB_EXTRA -dbLoadRecords("$(PB_EXTRA_TEMPLATES)motorStatus.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_FY, M_NO=1") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)motorStatus.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_FX, M_NO=2") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)motorStatus.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_CY, M_NO=3") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)motorStatus.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_CX, M_NO=4") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)motorStatus.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_CZ, M_NO=5") - -dbLoadRecords("$(PB_EXTRA_TEMPLATES)killOne.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_FY, M_NO=1") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)killOne.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_FX, M_NO=2") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)killOne.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_CY, M_NO=3") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)killOne.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_CX, M_NO=4") -dbLoadRecords("$(PB_EXTRA_TEMPLATES)killOne.db" "SYS=SAR-EXPMX, PORT=PPMAC, M=MOT_CZ, M_NO=5") -''' - - tplEXPMX2=''' -#powerPmacCreateVirtualAxis(, , , ,, , , ,1: - motLst=v['motLst'][1:] - else: - motLst=tuple() - param= {k: v[k] for k in {'port','prefix','loc'}} - param['ioc']=ioc - param['idx']=ioc[-1] - param['num_ax']=len(motLst) - param['req']='require ESB_MX\n\n! $(gpasciiCommander_DIR)/gpasciiCommander --path $(ESB_MX_DIR) $(ESB_MX_DIR)/{prefix}{idx}.cfg'.format(**param) - #print(param) - - fn=f'gen/ioc/{ioc}_startup.script' - print('generate '+fn+' ...') - fh_ss=open(fn,'w') - - fn=f'gen/ioc/{ioc}_gen.subs' # with a name _* the .subs file is recognize by the 'ioc install' tool - print('generate '+fn+' ...') - fh_sb=open(fn,'w') - - #fn=f'gen/ioc/cfg/{ioc}_sr.req' - #print('generate '+fn+' ...') - #fh_sr=open(fn,'w') - - fh_ss.write(tplCtrl.format(**param)) - - fh_sb.write(subsHdr.format(**param)) - port=param['port'] - prefix=param['prefix'] - motPar=dict(zip(hdr, hdr)) - motPar['PORT']='PORT' - motPar['P']='P' - fh_sb.write(fmt.format(**motPar)) - for motPar in motLst: - motPar=dict(zip(hdr, motPar)) - motPar['PORT']=v['port'] - motPar['P']=v['prefix'] - fh_sb.write(fmt.format(**motPar)) - if motPar['ADDR']<=8: - fh_ss.write(tplAxis.format(**motPar)) - fh_sb.write('}\n\n') - - if ioc=='SAR-CPPM-EXPMX1': - fh_ss.write(Generate.tplEXPMX1) - elif ioc=='SAR-CPPM-EXPMX2': - fh_ss.write(Generate.tplEXPMX2) - elif ioc=='SAR-CPPM-EXPMX3': - fh_ss.write(Generate.tplEXPMX3) - - fh_ss.close() - fh_sb.close() - - - def genSmarActIOC(self): - tplCtrl=Generate.tplMcsCtrl - #tplAxis=Generate.tplMcsAxis - #tplAxSR=Generate.tplMcsAxisSaveRestore - subsHdr=Generate.mcsSubsHdr - lutPSENS=Generate.lutPSENS - os.makedirs('gen/ioc/cfg/',exist_ok=True) - for ioc,v in Generate.iocSmarAct.items(): - # fh_ss startup script - # fh_sb substitution - # fh_sr save restore - fmt=' '+v['fmt'] - hdr=v['motLst'][0] - if len(v['motLst'])>1: - motLst=v['motLst'][1:] - else: - motLst=tuple() - param= {k: v[k] for k in {'port','host','prefix','loc'}} - try: - ioc_host,ioc_port=Generate.yamlParam[ioc][:2] - except KeyError as e: - _log.warning(repr(e)+': skipped');continue - param['ioc']=ioc - param['ioc_host']=ioc_host - param['ioc_port']=ioc_port - param['num_ax']=len(motLst) - #print(param) - - fn=f'gen/ioc/{ioc}_startup.script' - print('generate '+fn+' ...') - fh_ss=open(fn,'w') - - fn=f'gen/ioc/{ioc}_gen.subs' # with a name _* the .subs file is recognize by the 'ioc install' tool - print('generate '+fn+' ...') - fh_sb=open(fn,'w') - - #fn=f'gen/ioc/cfg/{ioc}_sr.req' - #print('generate '+fn+' ...') - #fh_sr=open(fn,'w') - - fh_ss.write(tplCtrl.format(**param)) - fh_sb.write(subsHdr.format(**param)) - h=hdr+('PORT','S','VELO','RTRY') - motPar=dict(zip(h, h)) - fh_sb.write(fmt.format(**motPar)) - for motPar in motLst: - motPar=dict(zip(hdr, motPar)) - try: - motPar['PTYP']=lutPSENS[motPar['PTYP']][1] #idx1 is for MCS1 - except KeyError as e: - if motPar['PTYP']!=0: - _log.info(f'{motPar["PTYP"]} not in lookup table') - motPar['PORT']=v['port'] - motPar['S']=v['prefix'] - motPar['VELO']=2 - motPar['RTRY']=1 - fh_sb.write(fmt.format(**motPar)) - #fh_ss.write(tplAxis.format(**motPar)) - #fh_sr.write(tplAxSR.format(**motPar)) - fh_sb.write('}\n\n') - fh_ss.close() - fh_sb.close() - #fh_sr.close() - - #fn='gen/ioc/asyn.template' - #print('generate '+fn+' ...') - #with open(fn,'w') as fh: - # fh.write(Generate.tpl_asyn) - -if __name__=='__main__': - def parse_args(): - import argparse - (h, t)=os.path.split(sys.argv[0]);cmd='\n '+(t if len(h)>20 else sys.argv[0])+' ' - #print(sys.argv,h,t) - exampleCmd=('', '-m0xf -v0' ) - epilog=__doc__+'\nExamples:'+''.join(map(lambda s:cmd+s, exampleCmd))+'\n' - - parser = argparse.ArgumentParser(epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-m', '--mode', type=lambda x: int(x,0), help='mode bits', default=0xff) - args = parser.parse_args() - #print(args) - - obj=Generate() - if args.mode&0x1: - obj.genYAML() - if args.mode&0x2: - obj.genIOC() - if args.mode&0x4: - obj.genLauncher() - - parse_args() - diff --git a/logbook.md b/logbook.md deleted file mode 100644 index b193092..0000000 --- a/logbook.md +++ /dev/null @@ -1,1023 +0,0 @@ -Text that was in readme and not used any more is stored here -============================================================ - - -*** 14.12.2016 *** -================== - -Parker stage -============ - -Using IDE ---------- -1 detect current sensor direction - Motor[1].PhaseOffset 683 - Motor[1].PwmSf 2154 -2 current bias - Motor[1].IaBias=0 - Motor[1].IbBias=0 -3 Voltage six step - Motor[1].PhaseOffset -683 - Motor[1].PwmSf -2154 - Motor[1].PhasePosSf=2048/(1*256*213333.3333) -4 Tune Current Loop (Mag=200, dur=50) - Motor[1].IiGain 10.5 - Motor[1].IpfGain=0 - Motor[1].IpbGain=14.7 -5 Current six step - Motor[1].PhasePosSf=2048/(1*1*61440000.) -6 Phase ref search - Motor[1].PhaseFindingDac=160.95 - Motor[1].PhaseFindingTime=50 - - - -Open Loop ---------- -20mm = 1003994 enc_step -20mm = 1'000'000 enc_step -> 20nm/enc step -1 pole= 600'000 enc_step -> 12mm - - ->>>>>>>>>> DONT FORGET <<<<<<<<<<< -$$$*** -!common() - ->>> open loop with encoder counts <<< -!encoder_sim(enc=1,tbl=1,mot=1) -!encoder_inc(enc=1,tbl=9,mot=9,encctrl=7,posSf=1./1) -!motor(mot=1,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=1.,numPhase=3,invDir=True) -#1j/ -#1,9hmz - -#1j:2048 -> moves one pole= 650'000 enc_step =13mm (Electrical Pitch in MX80 doc) - -512= 90deg -> check phase * - - * o x * o x - * * o o x x * * o o x x - * o* xo x * o* xo x - * o * x o x * o * x o x - * o x * o x * o x * o x -*------o------x-----*------o------x-----*------o------x-----*------o------x-----*------o------x-----*------o------x - * o x * o x * o x * o x * o x * o x - * o * x o x * o * x o x * o * x o x - * o* xo x * o* xo x * o* xo x - * * o o x x * * o o x x * * o o x x - * o x * o x * o x -0 512 1024 1536 2048 - ->>> scaling encoder etc to um <<< -!encoder_sim(enc=1,tbl=1,mot=1,posSf=12000./2048) -!encoder_inc(enc=1,tbl=9,mot=9,encctrl=7,posSf=12000./600000) -!motor(mot=1,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=1.*12000./2048,numPhase=3,invDir=True) - -JogSpeed=1.*12000./2048 6um/ms =6mm/s - - ->>> close the loop with inc-encoder <<< -servoSf : motorusteps/userUnits - -!encoder_sim(enc=1,tbl=9,mot=9,posSf=12000./2048) -!encoder_inc(enc=1,tbl=1,mot=1,encctrl=7,posSf=12000./600000) -!motor(mot=1,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=6.,numPhase=3,invDir=True,servoSf=2048/12000.) - ->>> close the loop with inc-encoder removing direct current<<< -$$$*** -!common() -!encoder_sim(enc=1,tbl=9,mot=9,posSf=12000./2048) -!encoder_inc(enc=1,tbl=1,mot=1,encctrl=7,posSf=12000./600000) -!motor(mot=1,dirCur=0,contCur=500,peakCur=800,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=6.,numPhase=3,invDir=True,servoSf=2048/12000.) - -Motors are not moving, because no current will be set due to some wrong parameters. -But the servoloop is running and gives output: -ServoOut set value from 0.5099 to -0.5099 (= MaxPosErr*Kp) when moving at different position -Motor[1].Servo.MaxPosErr=1000.0169 -Motor[1].Servo.Kp=0.000512 -1000.0169*0.000512=0.5120086528 - -Motor[1].Servo.Kp=0.0007 -Motor[1].Servo.MaxPosErr=1000.0169 -1000.0169*0.0007=0.70001183 - -Now some elements have to be reconfigured: -SlipGain,PwmSf,PhaseMode,PhaseCtrl,PhasePosSf - - -Motor[1].pPhaseEnc = PowerBrick[0].Chan[0].PhaseCapt.a //is default -use configuration open loop with encoder counts -#1j/ -Read PowerBrick[0].Chan[0].PhaseCapt 130559 -move one pole (13mm) -Read PowerBrick[0].Chan[0].PhaseCapt 166599808 -difference = 166599808-130559= 166469249 - 166469249/256 = 650270 =650000incr = 13mm -1 commutation cycle=163537664 PhaseCapt = 2048 com_cycl_units -PhasePosSf= 2048./166469249 = 1.2303e-05 or precise: 2048/(256*650000)=1.23077e-05 - -servoSf : motorusteps/userUnits - -servoSf=2048/12000.,PhaseCtrl=4,SlipGain=0,PhasePosSf=1.23077e-05 - - -******************************* -****** WORKS !!!!!!!!!!!! ***** -** But positioning has very bad performance ** -******************************* - -// controlling speed/velocity on iqCmd and constant current(=torque) on idCmd -//precission +-1 step in steady state -$$$*** -!common() -!encoder_inc(enc=1,tbl=1,mot=1,encctrl=7,posSf=12000./600000) -!motor(mot=1,dirCur=300,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=6.,numPhase=3,invDir=True,servoSf=2048/12000.) - - -// controlling torque(=current) on iqCmd and idCmd=0 -//precission +-100 and more step in steady state -$$$*** -!common() -!encoder_inc(enc=1,tbl=1,mot=1,encctrl=7,posSf=12000./600000) -!motor(mot=1,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=6.,numPhase=3,invDir=True,servoSf=2048/12000.,PhaseCtrl=4,SlipGain=0,PhasePosSf=1.23077e-05,PhaseMode=0,PhaseFindingDac=200,PhaseFindingTime=22.586512) - -#1out10 -!!! HOLD BY HAND TO LIMIT THE SPEED !!! - Motor[1].Servo.Kp=1 -Motor[1].InPosBand=0 -Motor[1].Servo.BreakPosErr=0 -#1j/ -#1j:1000 -******************************* - - - --> Tadejs input: use simulated encoder for the phasing - - -Motor[1].Servo.BreakPosErr=0 -Motor[3].Servo.Kp=2000 - -///Motor[3].Servo.BreakPosErr=0 -//Motor[3].Servo.Kp=2000 -//#3out5 - - -Testing IDE with QBL test motor -=============================== - ->>> close the loop with inc-encoder removing direct current<<< - --> the current/speed must be set with that PWM-scale factor - -Motor idx 1 3 -Motor[x].AdvGain 0.020479999 0 -Motor[x].PhasePosSf 0 0.0160000000000000003 -Motor[x].PhaseCtrl 6 4 -Motor[x].PhaseMode 1 0 -Motor[x].PwmSf -15134.891 4309 -Motor[x].SlipGain 0.25 0 -Motor[x].PhaseFindingDac 0 95.976563 -Motor[x].PhaseFindingTime 0 22.586512 - ->>> origin setup by ide+ tweaks <<< -!encoder_inc(enc=3,tbl=3,mot=3,encctrl=7,posSf=1./2000) -!motor_servo(mot=3,ctrl='ServoCtrl',Kp=4.0424199*2000, Kvfb=160.43646*2000,Kvff=160.43646*2000,Kaff=3184.5818*2000) -!motor(mot=3,numPhase=3,servo=None, homing=None,dirCur=0,contCur=1790,peakCur=5400,timeAtPeak=1,IiGain=1.0628819,IpfGain=0,IpbGain=6.5684085,AdvGain=0,FatalFeLimit=2000,WarnFeLimit=1000,InPosBand=0,PhasePosSf=0.016,PhaseCtrl=4,PhaseMode=0,PwmSf=4309,SlipGain=0,PhaseFindingDac=95.976563,PhaseFindingTime=22.586512) - -AdvGain -PhasePosSf 0 does not work at all -> must be calculated correctly as below -PhaseCtrl 6 not working. must be 4 for phase feedback and 6 for direct microstepping -PhaseMode 0,1 both are working, should be 0 for 3 phase -PwmSf 0 2000 4309 -> the higher, the more torque on error -SlipGain 0.25 squeezing -PhaseFindingDac 0 no change -PhaseFindingTime 0 no change -$$$*** -!common() -!encoder_inc(enc=3,tbl=3,mot=3,encctrl=7,posSf=1./2000) -!motor_servo(mot=3,ctrl='ServoCtrl',Kp=4.0424199*2000, Kvfb=160.43646*2000,Kvff=160.43646*2000,Kaff=3184.5818*2000) -!motor(mot=3,numPhase=3,servo=None, homing=None,dirCur=0,contCur=1790,peakCur=5400,timeAtPeak=1,IiGain=1.0628819,IpfGain=0,IpbGain=6.5684085,AdvGain=0,FatalFeLimit=2000,WarnFeLimit=1000,InPosBand=0,PhasePosSf=0.016,PhaseCtrl=6,PhaseMode=1,PwmSf=1000,SlipGain=0,PhaseFindingDac=0,PhaseFindingTime=0) -!sh sleep 1 -#3j/ -!sh sleep 10 -#3j:100 - -#3out10 sets directly the Motor[3].ServoOut value , sets to 10% of Motor[x].MaxDac -Motor[3].MaxDac=4526.9282 - Out ServoOut iqCmd IqVolts -#3out100 -> 4526.9 set to 100 %of Motor[x].MaxDac -#3out50 -> 2263.46411 2263.4641 -#3out10 -> 452.692822 452.69281 - -iqMeas=iqCmd if motor is blocked, when motor moves, iqCmd stays and iqMeas drops -PwmSf IqCmd iqMeas(when blocked) -Motor[3].PwmSf;Motor[3].IqCmd;Motor[3].IqMeas;Motor[3].IqVolts -PwmSf=500 IqCmd=2263.4641 IqMeas=232.44925 IqVolts=34406.398 -PwmSf=1000 IqCmd=2263.4641 IqMeas=779.05316 IqVolts=34406.398 -PwmSf=2000 IqCmd=2263.4641 IqMeas=1944.9929 IqVolts=34406.398 -PwmSf=3000 IqCmd=2263.4641 IqMeas=2234.2734 IqVolts=34406.398 - - -Motor[x].PhasePosSf scale factor to convert encoder position to phase position -Motor[3].pPhaseEnc=PowerBrick[0].Chan[2].PhaseCapt.a -Motor[3].PhaseEncLeftShift=0 -Motor[3].PhaseEncRightShift=0 -1 rev=2000*256 enc_steps (PowerBrick[0].Chan[2].PhaseCapt) - -4 Pole magnet, 2000 enc_steps/rev -encoder configured to have 1 enc_step per revolution -PhasePosSf=0.016=1/62.5=32/2000= (4*2048)/(256*2000) = (numPoles*const)/(256*2000) -const=Power PMAC divides a commutation cycle into 2048 parts - -Motor[3].PhasePos position of the phase: 0..2048 this does not change if the motor is blocked - - ->>>>>>find PhasePosSf <<<<<<<<<<< -$$$*** -!common() -!encoder_sim(enc=3,tbl=3,mot=3) -!encoder_inc(enc=3,tbl=11,mot=11,encctrl=7,posSf=1./2000) -!motor(mot=3,numPhase=3, dirCur=500,contCur=1790,peakCur=2400,timeAtPeak=1,IiGain=1.0628819,IpfGain=0,IpbGain=6.5684085,AdvGain=0,FatalFeLimit=2000,WarnFeLimit=1000,InPosBand=0,PhasePosSf=0.0,PhaseCtrl=4,PhaseMode=0,SlipGain=0) - -Do manually one revolution -feeling 4 pole changes -> 8 poles (locks on N-S S-N positions, moves on N-N S-S position) -Motor[3].pPhaseEnc -> Motor[3].pPhaseEnc=PowerBrick[0].Chan[2].PhaseCapt.a - -PowerBrick[0].Chan[2].PhaseCapt after one revolution -1535488-1022464=513024=512000 - -Phase_step = change pole from N->S->N -1 Phase_step = 2048 Phase_uStep -512000 PhaseEnc_step == 4 pole changes = 4*2048 Phase_uStep -PhasePosSf=Phase_uStep/PhaseEnc_step=4*2048/512000==0.016 - - -!encoder_inc(enc=3,tbl=3,mot=3,encctrl=7,posSf=1./2000) -!motor(mot=3,numPhase=3, dirCur=0,contCur=1790,peakCur=2400,timeAtPeak=1,IiGain=1.0628819,IpfGain=0,IpbGain=6.5684085,AdvGain=0,FatalFeLimit=2000,WarnFeLimit=1000,InPosBand=0,servoSf=2000./1,PhasePosSf=0.016,PhaseCtrl=4,PhaseMode=0,PwmSf=4309,SlipGain=0,PhaseFindingDac=95.976563,PhaseFindingTime=22.586512) -Motor[3].Servo.BreakPosErr=0 -Motor[3].Servo.Kp=2000 -#3out5 - - - - - - - -#3j/ - - -PowerBrick[0].AdcAmpCtrl = $f00cfe00 $f00cfe00 -PowerBrick[0].Chan[0].InCtrl = $47 $47 -PowerBrick[0].Chan[0].OutCtrl = $f000001 $f000101 -PowerBrick[1].AdcAmpCtrl = $f00cfe00 $f00cfe00 -Motor[1].Servo.Kp = 4.0424199 4.0424199 -Motor[1].Servo.Kvifb = 0 0 -Motor[1].Servo.Kviff = 0 0 -Motor[1].Servo.Kvfb = 160.43646 40.951927 -Motor[1].Servo.Kvff = 160.43646 40.951927 -Motor[1].Servo.Kafb = 0 0 -Motor[1].Servo.Kaff = 3184.5818 207.48897 -Motor[1].Servo.Ki = 2.6301687e-4 0.0010304153 -Motor[1].Servo.Kfff = 0 0 -Motor[1].PhasePosSf = 0.0160000000000000003 1.59999999999999993e-5 -Motor[1].IiGain = 1.0628819 0.2278125 -Motor[1].IpbGain = 6.5684085 0.0099999998 -Motor[1].MotorTa = -10 -10 -Motor[1].MotorTs = -50 -50 -Motor[1].I2tSet = 1499.7477 418.92395 -Motor[1].I2tTrip = 18220758 2632459 -Motor[1].JogOffset = 0 0 -Motor[1].AdcMask = $fffc0000 $fffc0000 -Motor[1].PhaseOffset = 683 -683 -Motor[1].Stime = 0 0 -Motor[1].PwmSf = 4309 -2154 -Motor[1].MaxDac = 4524.3784 1675.6958 -Motor[1].PhaseFindingDac = 95.976563 0 -Motor[1].PhaseFindingTime = 22.586512 1 -Motor[1].TraceSize = 0 0 -Motor[1].Control[0] = $14000100 $14000100 -Motor[1].Control[1] = $0 $0 -Node15[0].MasterNum = 255 255 -Node15[1].MasterNum = 255 255 -Node15[2].MasterNum = 255 255 -Node15[3].MasterNum = 255 255 - - - - -IDE Setup -> changed variables ------------------------------- -*Command/Feedback(3) -Motor[3].pAbsPhasePos=0 // Encoder //12/9/2016 :8:51 AM - 129.129.144.138 -Motor[3].AbsPhasePosFormat=0 // Encoder //12/9/2016 :8:51 AM - 129.129.144.138 -Motor[3].AbsPhasePosSf=0 // Encoder //12/9/2016 :8:51 AM - 129.129.144.138 -Motor[3].AbsPhasePosOffset=0 // Encoder //12/9/2016 :8:51 AM - 129.129.144.138 -Motor[3].PhaseFindingTime=1 // Encoder //12/9/2016 :8:51 AM - 129.129.144.138 -Motor[3].PhaseFindingDac=0 // Encoder //12/9/2016 :8:51 AM - 129.129.144.138 - -*Hardware Interface -Motor[3].pLimits=PowerBrick[0].Chan[2].Status.a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pEnc= EncTable[3].a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pEnc2= EncTable[3].a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].EncType= 5 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pDac=PowerBrick[0].Chan[2].Pwm[0].a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pAdc=PowerBrick[0].Chan[2].AdcAmp[0].a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pAmpEnable=PowerBrick[0].Chan[2].OutCtrl.a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].ServoCtrl = 1 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PhaseCtrl = 4 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Gate3[0].Chan[2].PackIndata = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Gate3[0].Chan[2].PackOutdata = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PhaseMode = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pPhaseEnc=PowerBrick[0].Chan[2].PhaseCapt.a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -BrickLV.Chan[2].TwoPhaseMode=0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PhaseSplineCtrl = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pSineTable = Sys.SineTable[0].a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pVoltSineTable = Sys.SineTable[0].a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PwmDbComp = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PwmDbI = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -PowerBrick[0].Chan[2].OutputMode = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PwmSf =7618.5 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].AmpEnableBit = 8 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].AmpFaultBit = 7 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].AmpFaultLevel = 1 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].pAmpFault=PowerBrick[0].Chan[2].Status.a // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].LimitBits = 9 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].DacShift=0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].AdcMask = $FFFC0000 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].ctrl=Sys.servoctrl // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].DtOverRotorTc = 0 // Hardware Interface //12/9/2016 0:8:53 AM - 129.129.144.138 -Motor[3].IxCoupleGain = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].SlipGain = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].AdvGain = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].Stime = 0 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -Motor[3].PhaseOffset =-683 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 -BrickLV.Reset = 1 // Hardware Interface //12/9/2016 :8:53 AM - 129.129.144.138 - - - -*** 16.1.2017 *** -================== - -Parker stage current step response ----------------------------------- - -Motor[2].IiGain=0 -Motor[2].IpfGain=1 -Motor[2].IpbGain=-1 - -Current step: Magnitude 4000 bits -Phasing 0 -Dwell 10 ms - -Motor 2 Phase pos at hard limit (towards kable) - -> Motor[2].PhasePos;#2$ -Motor[2].PhasePos=1317.26495427904138 -Motor[2].PhasePos=1286.11002741653601 -Motor[2].PhasePos=1310.62328616849777 -Motor[2].PhasePos=1310.62328616849686 -Motor[2].PhasePos=1307.26431089312473 -Motor[2].PhasePos=1323.77420922660667 -Motor[2].PhasePos=1323.77735999583911 -Motor[2].PhasePos=1331.42989161901664 -Motor[2].PhasePos=1332.17854273394619 - -Use Motor[2].PhasePos=1330 -Use Motor[3].PhasePos=150 (or 1200???) - -*** 19.1.2017 *** -================== - -Friction force of Parker stage - -X(top stage): 1N max 0.1N min.. depends on the magnetic poles -#3out20 -> Force 2N -#3out30 -> Force 3N (changes in torque at poles) -Weight: ca 250g - - -Y(lower stage): 1N max 0.1N min.. depends on the magnetic poles -#2out20 -> Force 2.5N iqCmd=402 -#2out30 -> Force 3N iqCmd=603 (changes in torque at poles) -Weight: ca 750g - -*** 27.1.2017 *** -================== - -Friction force of Parker stage: see blue logbook. -Calculate the current at a given force: - -import numpy as np -import plt as matplotlib.pyplot - -F=np.array([+300, +100, 0.,-50,-100,-150,-200,-250,-300]) -i=np.array([+625, 214, 38.,-104,-207,-300,-400,-500,-600]) - -plt.plot(i,F,'.-') - -average Motor[3].iqMeas -610.949923065 -average Motor[3].iaMeas 432.573485303 -average Motor[3].ibMeas -699.459308138 --> icMeas 432.573485303-699.459308138=-266.885822835 - - -Check cur_bits to current -------------------------- - -Block motor 4 -set current to 10%: #4out10 -Measure current with amp meter and ./move_record.py - -Motor[4].PhasePos=313 - -gelb 293 mA -idCmd=0 -average Motor[4].iqMeas 452.897308732 -average Motor[4].iaMeas -274.830633873 -average Motor[4].ibMeas 523.056988602 - -> icMeas 248.226 - -rot 560 mA -average Motor[4].iqMeas 452.719438794 -average Motor[4].iaMeas -264.325534893 -average Motor[4].ibMeas 523.057788442 - -> icMeas 258.73 - -schwarz 290mA -average Motor[4].iqMeas 453.042713114 -average Motor[4].iaMeas -252.726254749 -average Motor[4].ibMeas 523.302539492 - -> icMeas 270.57 - -PhasePos=0 ia=-512 ib=260 ic=240 -PhasePos=682 ia=250 ib=250 ic=500 -PhasePos=1364 ia=320 ib=-500 ic=180 - -https://de.wikipedia.org/wiki/D/q-Transformation -ia=-sin(phi)*iq -ib=-sin(phi-120deg)*iq -ic=-sin(phi-240deg)*iq - -...cant yet figure out the scaling... - - -Measuring position depenmdent friction(=current) ------------------------------------------------- - ./move_record.py cfg = {"sequencer": ['prog_1(host="SAROP11-CPPM-MOT6871",acq_per=10)', 'plot_1()']} - -Avg current forward: 37.2596025196 Avg current backward: -68.9828819531 -lut [[ 1.00000000e+03 -2.70746096e+01] - [ 1.31399384e+03 -3.76975094e+01] - [ 1.71398707e+03 -5.78253228e+01] -... - [ 2.57135808e+04 -1.09363816e+01] - [ 2.61135740e+04 -1.42231517e+01] - [ 2.65135673e+04 -1.19655511e+01] - [ 2.69135605e+04 -6.38521106e+01]] - - - - -Python to Matlab ----------------- - -import numpy as np, scipy.io -fn='/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/python/data/prog_1.npz' -fh=np.load(fn) -scipy.io.savemat(fn[:-3]+'mat',mdict=dict(fh.iteritems())) - - -compensate position depenmdent friction 1.2.2017 ------------------------------------------------- - -Git tag: 3fafe53 -gpasciiCommander --host SAROP11-CPPM-MOT6871 -i -!mx-stage() -&1 #1->0 -&1 #2->0 -#3$ -an anschlag (kabel) bewegen -#3hmz -Motor[3].PhasePos=1200 -#3j/ - -./move_record.py -abs average pos Error 2.1890901307 - -Motor[3].Servo.Kp=10 -Motor[3].Servo.Kvfb=100 -Motor[3].Servo.Kvff=100 -abs average pos Error 1.89392140871 - -/home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/src/usrServo/usrcode.c -line 100: c=0.f; //no friction compensation at all -abs average pos Error 1.82212631688 - -line 85: c=0.f; //do not use friction lut -abs average pos Error 1.47794399154 - -using friction lut: -abs average pos Error 0.893315213359 - -But if it is put vertically, the value becomes bad again. -check friction on vertical stage - -average PosError to P3000 2.2.2017 ----------------------------------- - -modify programm generated by ./move_record.py: - -open prog 2 -N0: -linearabs -X505.488Y7.15189 -dwell10 -pvt10abs -X505.488:2526.97Y7.15189:-85.15309999999999 -X556.028:4937.42Y5.44883:-34.6476 -... -X508.588:0Y954.585:0 -X508.588Y954.585 -dwell10 -goto 0 -close - - - - -modify user servo to average PosError to P3000 2.2.2017 -tweak parameters: -Motor[3].Servo.Kp -Motor[3].Servo.Kvfb -Motor[3].Servo.Ki -Motor[3].Servo.Kvff -Motor[3].Servo.Kaff - -Kp = 10 10 10 10 10 10 20 -Kvfb = 220 220 220 220 220 220 220 -Ki = 0.001 0.01 0.02 0.01 0 0 0.02 -Kvff = 240 240 240 240 240 240 240 -Kaff = 0 0 0 20 1500 1500 1500 - 1.3 .53 .43 0.52 1.88 0.7 0.1 - A - -A: Higher Ki than 0.02 do not help - -Set Ki to 0 and seek optimal Kvff -Kvff =240 local minimum -Kvfb =220 local minimum -Kaff =1500 Kaff does not change the error amount, but makes the error smoother at 1500 -Kp =20 average error becomes smaller - - -Motor[3].Servo.Kvff - -commit after: 3fafe53 -./move_record.py ->>>>>>>> abs average pos Error 0.353193239442 <<<<<<< - -./shapepath.py gen_rand_points(n=400, scale=1000) -Random path at speed: -%100 average error x 1.32075 um, y 0.940694 um, 1.84578 um -%50 average error x 0.336186 um, y 0.259554 um, 0.478149 um -%25 average error x 0.177138 um, y 0.077619 um, 0.209937 um - - -./shapepath.py gen_grid_points(w=20,h=20,pitch=50,rnd=0.2) -Grid path at speed: -%100 average error x 0.363065 um, y 0.314149 um, 0.536246 um -%50 average error x 0.246374 um, y 0.0985771 um, 0.283925 um -%25 average error x 0.150303 um, y 0.0429124 um, 0.163468 um - - - -Interferometer 11.4.2017 ------------------------- - - -adding to torqueCtrl lines: -!encoder_inc(enc=4,tbl=4,mot=4)# ,posSf=13000./650000) -!encoder_inc(enc=5,tbl=5,mot=5)# ,posSf=13000./650000) - -gpasciiCommander --host SAR-CPPM-EXPMX1 -i -!mx-stage() -#1..3$ -&1 -#1..3j/ - -both interferometer works -homing and move: - -#2..5p --0.04000000000000008 0.0200000000000023 -298.8984375 39.890625 -> #2j=10000;#3j=0000 -#2j=10000;#3j=0000 -> #2..5p -#2..5p -10000 2.380040609040179e-15 -500672.5625 4334.390625 -> #2j=0000;#3j=0000 -#2j=0000;#3j=0000 -> #2j=0000;#3j=10000 -#2j=0000;#3j=10000 -> #2..5p -#2..5p --0.02000000000000006 10000 -3559.06640625 -499752.609375 - - - - -#2..5p --0.08000000000000007 -0.003515624999636202 -0.5 7.2890625 - -#2j=10000 -#2..5p -9999.980000000001 -0.01000000000021828 4290.96875 -500362.453125 -#2j=0;#3j=10000 -#2..5p -0 9999.992812500001 -499789.3984375 -3260.984375 - -Interferometer have 500000 counts per 10000um = 50 counts per um =20nm -at Motor[2].JogSpeed=10 the interferometer can not follow the motion. -It will not loose steps, but the maximum frequency is limiting during motion. -at Motor[2].JogSpeed=10 the interferometer and the encoder delivers similar values. - - -interfero_move_rec.py - self.gather={"MaxSamples":1000000, "Period":acq_per} - self.channels=channels=["Motor[3].ActPos","Motor[3].DesPos","Motor[3].PhasePos","Motor[3].idMeas","Motor[3].iqMeas"] - -Gather.Enable=0 -Gather.Items=6 -Gather.MaxSamples=1000000 -Gather.Period=10 -Gather.Addr[0]=Motor[2].DesPos.a -Gather.Addr[1]=Motor[3].DesPos.a -Gather.Addr[2]=Motor[2].ActPos.a -Gather.Addr[3]=Motor[3].ActPos.a -Gather.Addr[4]=Motor[4].ActPos.a -Gather.Addr[5]=Motor[5].ActPos.a -open prog 2 - linear abs - X0 Y0 - dwell 10 - Gather.Enable=2 - X10000 Y0 - dwell 100 - X0 Y0 - dwell 100 - X0 Y10000 - dwell 100 - X0 Y0 - dwell 1000 -Gather.Enable=0 -close -&1 -b2r - -download data with -PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 - -cat /tmp/gather.txt - -Motor[2].MaxSpeed=50 -Motor[3].MaxSpeed=50 -->gather50.txt - -Motor[2].MaxSpeed=5 -Motor[3].MaxSpeed=5 -->gather5.txt - -Motor[2].MaxSpeed=1 -Motor[3].MaxSpeed=1 -->gather1.txt - -Changing encoder frequency on atto cube makes it run even at high speed - - -28. 4.2017 prepare for vibration measurement --------------------------------------------- -PPMAC=SAR-CPPM-EXPMX1 - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX -PBInspect --host $PPMAC --cfg PBinspect.pbi - -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/src/usrServo -make - - -cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg -gpasciiCommander --host SAR-CPPM-EXPMX1 -i -!mx-stage() -#1..3$ -&1 -#1..3j/ - -#1j=360000 //360deg gegenuhrzeiger - -#2j:100 //100 um right -#3j:100 //100 um up - -move bottom left -#2,3$ -Motor[2].PhasePos;Motor[3].PhasePos - -Motor[2].PhasePos=310;Motor[3].PhasePos=1210 -#2,3hmz -Motor[3].HomePos=Motor[3].HomePos+15000 - - -Motor 2 vibriert mit 76ms =13.15 Hz - - -b2r -Load is now Alublock + mirrors - -at 50 Hz peak to peak 200um -at 100Hz peak to Peak 50um -at 200Hz peak to Peak 13um -at 400Hz peak to Peak 1.5um - - - -2. 5.2017 Vertical stage with load ----------------------------------- - - scale=0.83832 #np.sqrt(3)/2*32767/33.850/1000 - -Motor[3].I2tSet=670.65601 -670.65601/0.83832 = 800.000 - -ohne Platte iqCmd = 625 -Platte 133.2g iqCmd = 910 -Platte 156.8g iqCmd = 965 - -Motor[3].IaMeas=-660 -Motor[3].IbMeas=580 -Motor[3].IqMeas=634.15991 - - -Motor[3].IaMeas=-708 -Motor[3].IbMeas=256 - - - -Motor[3].IaMeas=436 =520 -Motor[3].IbMeas=-632 =-753 -Motor[3].IqMeas=566.46863 = 675 - - -Claude messungen: -Phase 1: 330mA -Phase 2: 125mA -Phase 3: 694mA - -Stromzange: 650 mA - - - -Interferometer 29.5.2017 ------------------------- -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX;PBInspect --cfg PBinspect.pbi --host SAR-CPPM-EXPMX1 - -gpasciiCommander --host SAR-CPPM-EXPMX1 -i -!mx-stage() -#1..3$ -&1 -#1..3j/ - -zero to neative inc values -move motor 2,3 from 500 to 28500 -#1..5hmz - -read acquire statements and program at to of plot_interfero.py - - -Motor[2].MaxSpeed=30;Motor[3].MaxSpeed=30 -Motor[2].MaxSpeed=10;Motor[3].MaxSpeed=10 - -PPMAC=SAR-CPPM-EXPMX1 -PBGatherPlot -m24 -v7 --host $PPMAC --dat gather1.txt - - -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather0.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather1.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather2.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather3.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather4.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather5.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather6.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather7.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather8.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather9.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather10.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather11.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather12.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather13.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather14.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather15.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather16.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather17.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather18.txt -b2r -!sh PBGatherPlot -m24 -v7 --host SAR-CPPM-EXPMX1 --dat ../data_interfero_spd10/gather19.txt - - -Konstantfeder 2.6.2017 ----------------------- - -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX;PBInspect --cfg PBinspect.pbi --host SAR-CPPM-EXPMX1 -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/;gpasciiCommander --host SAR-CPPM-EXPMX1 -i -!mx-stage() - -//#1..3$ -//move bottom left -#2,3$ -Motor[2].PhasePos;Motor[3].PhasePos - -Motor[2].PhasePos=310;Motor[3].PhasePos=1210 -#2,3hmz -Motor[2].HomePos=Motor[2].HomePos+5000 -Motor[3].HomePos=Motor[3].HomePos+5000 - - -&1 - -#1..3j/ -#2..3j=0 -L2=Motor[2].MaxDac -L3=Motor[3].MaxDac - - -Motor[2].MaxDac=500 -#2j+ - -enable plc 1 - -Motor[2].HomeVel=2 -Motor[3].HomeVel=2 -#2,3$ - -Homing 12.6.2017 ---------------- - -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX;PBInspect --cfg PBinspect.pbi --host SAR-CPPM-EXPMX1 -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/;gpasciiCommander --host SAR-CPPM-EXPMX1 -i -!mx-stage() -//!init() -//!init_limit() - -enable plc 1 - - - -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/qt -CAQTDM_DISPLAY_PATH=/sf/controls/config/qt -EPICS_CA_ADDR_LIST='sf-cagw SAR-CPPM-EXPMX1' -EPICS_CA_ADDR_LIST=SAR-CPPM-EXPMX1 -$ caget SAR-ESB_MX:MOTOR_X1 - -root@:/ioc/SAR-CPPM-EXPMX1# service shellbox status -pid port user dir command -STOPPED 50001 ioc /ioc/SAR-CPPM-EXPMX1 iocsh startup.script -root@:/ioc/SAR-CPPM-EXPMX1# service shellbox start -Starting shellbox service: -Starting: 50001 ioc /ioc/SAR-CPPM-EXPMX1 iocsh startup.script - -dbl -dbpf SAR-ESB_MX:MOTOR_Y1 10 -dbpf SAR-ESB_MX:MOTOR_X1 10 - -dbpf SAR-ESB_MX:ASYN.AOUT 'enable plc 1' - -Boot time of SAR-CPPM-EXPMX1 ca.4min. -telnet SAR-CPPM-EXPMX1 50001 - -ssh x06mx-cons-1 -cd /scratch/ESB_MX/ESB_MX/qt -caqtdm -macro 'P=SAR-ESB_MX' ESB_MX_exp.ui -caput SAR-ESB_MX:ASYN.AOUT 'enable plc 1' - - - -tweak param 13.6.2017 ---------------------- - -with stada stage 21.7.2017 --------------------------- -telnet SAR-CPPM-EXPMX1 50001 -ctrl-T -ctrl-X - -$$$*** -!common() -!mx-stage() - -#7j:512000 -511999.9988954368 49999 - -Motor8:#8,16p -511999.9922968491 49976 - -RL32-BAS050C15... -512000 ustep == 50000 encCnt == 2.5mm -> 50nm/encCnt - -OpenLoop: -!encoder_sim(enc=7) -!encoder_sim(enc=8) -!encoder_biss(enc=7,tbl=15,mot=15) -!encoder_biss(enc=8,tbl=16,mot=16) -!motor(mot=7,current=200,JogSpeed=102.4*1,invDir=1,HomeOffset=39263) -!motor(mot=8,current=200,JogSpeed=102.4*1,invDir=1)//,HomeOffset=39762) - -!encoder_biss(enc=7,tbl=15,mot=15) -!encoder_biss(enc=8,tbl=16,mot=16) -!motor(mot=7,current=200,JogSpeed=102.4*1,invDir=1) -!motor(mot=8,current=200,JogSpeed=102.4*1,invDir=1) - - - - -Status Review 2.8.2017 ----------------------- -``` -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX;PBInspect --cfg PBinspect.pbi --host SAR-CPPM-EXPMX1 -cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/;gpasciiCommander --host SAR-CPPM-EXPMX1 -i -$$$*** -!common() -!mx-stage() -enable plc 1 //homing - -#1j:1000 //rotate 1 deg -#2j:1000 //x-stage parker 1000um -#3j:1000 //y-stage parker 1000um -#4,5p //position of interferometer (if connected) -#7,8j/ -#7j:1000 //x-stage stada 1000um -#8j:1000 //z-stage stada 1000um - - -telnet SAR-CPPM-EXPMX1 50001 -ctrl-T -ctrl-X - -ssh x06mx-cons-1 -cd /scratch/ESB_MX/ESB_MX/qt -caqtdm -macro 'P=SAR-ESB_MX' ESB_MX_exp.ui -Press homing or following line: -caput SAR-ESB_MX:ASYN.AOUT 'enable plc 1' -``` - -Recommissioning 13.4.2022 -------------------------- -``` -MCS: - -Purchased On: 2017/12/18 -Part Type Name: MCS-3CC-ETHA-MOD -MAC 1: 00:04:A3:A2:71:35 -Purchase Number: 5200119415 - -root@SAR-CSSU-EXPMX1:~# echo -ne "\xff" > /dev/ttyM0 --> it worked but Zan can not make it run any more - - - -caput SAR-EXPMX1:ASYN.AOUT '#1p' -caget SAR-EXPMX1:ASYN.TINP - -caput SAR-EXPMX1:ASYN.AOUT 'BrickLV.Reset=1' - --> Motor 4 has a short cirquit, therefore the motion and shapepath is not possible. - - -caput SAR-EXPMX1:ASYN.AOUT '&0#4->0' -caput SAR-EXPMX1:ASYN.AOUT '&0#5->0' -caput SAR-EXPMX1:ASYN.AOUT '&0#6->0' -caput SAR-EXPMX1:ASYN.AOUT '&0#7->0' -caput SAR-EXPMX1:ASYN.AOUT '&0#8->0' - -caput SAR-EXPMX1:ASYN.AOUT '#1..3j/' -caput SAR-EXPMX1:ASYN.AOUT '#4j/' - - -``` diff --git a/python/shapepath.py b/python/shapepath.py index 73dc423..7b28497 100755 --- a/python/shapepath.py +++ b/python/shapepath.py @@ -70,7 +70,7 @@ hostname=socket.gethostname() if hostname=='ganymede': sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/')) else: - sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/mx/zamofing_t/PBTools/')) + sys.path.insert(0, os.path.expanduser('/sf/cristallina/applications/SwissMX/PBTools/')) from pbtools.misc.pp_comm import PPComm from pbtools.misc.gather import Gather diff --git a/qt/ESB_MX_5cam.ui b/qt/ESB_MX_5cam.ui deleted file mode 100644 index 41ab3b4..0000000 --- a/qt/ESB_MX_5cam.ui +++ /dev/null @@ -1,1164 +0,0 @@ - - - Form - - - - 0 - 0 - 720 - 620 - - - - Form - - - - - 20 - 10 - 721 - 28 - - - - - 18 - 75 - true - - - - ESB MX 5 cam girder $(P) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - 160 - 160 - 164 - - - - - - - 10 - 50 - 700 - 274 - - - - P=$(P),M=MOT_GIR_1;P=$(P),M=MOT_GIR_2;P=$(P),M=MOT_GIR_3;P=$(P),M=MOT_GIR_4;P=$(P),M=MOT_GIR_5;P=$(P),M=MOT_GIR_X;P=$(P),M=MOT_GIR_Y;P=$(P),M=MOT_GIR_U;P=$(P),M=MOT_GIR_V;P=$(P),M=MOT_GIR_W - - - motor_1m.ui - - - 10 - - - 6 - - - - - - 20 - 582 - 411 - 31 - - - - $(P):debug3.VAL - - - caLineEdit::string - - - - - - 20 - 532 - 451 - 41 - - - - type motion code as: -'&1;#1..5j/;cpx abslinear X(1000)Y(0)U(0)V(0)W(0)' - - - - - - 20 - 332 - 341 - 194 - - - - - - 180 - 120 - 10 - 10 - - - - - 51 - 153 - 0 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 51 - 153 - 0 - - - - caGraphics::IfNotZero - - - A - - - $(P):MOT_GIR_3.MOVN - - - caGraphics::Circle - - - - - - 50 - 36 - 25 - 25 - - - - - 14 - - - - x - - - - - - 57 - 146 - 10 - 10 - - - - - 120 - 120 - 120 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 120 - 120 - 120 - - - - caGraphics::IfZero - - - A - - - $(P):MOT_GIR_2.MOVN - - - caGraphics::Circle - - - - - - 230 - 146 - 10 - 10 - - - - - 51 - 153 - 0 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 51 - 153 - 0 - - - - caGraphics::IfNotZero - - - A - - - $(P):MOT_GIR_5.MOVN - - - caGraphics::Circle - - - - - - 57 - 146 - 10 - 10 - - - - - 51 - 153 - 0 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 51 - 153 - 0 - - - - caGraphics::IfNotZero - - - A - - - $(P):MOT_GIR_2.MOVN - - - caGraphics::Circle - - - - - - 270 - 118 - 15 - 24 - - - - 2 - - - caGraphics::Arc - - - 35 - - - 50 - - - 226 - - - 243 - - - - - - 80 - 165 - 10 - 10 - - - - - 51 - 153 - 0 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 51 - 153 - 0 - - - - caGraphics::IfNotZero - - - A - - - $(P):MOT_GIR_1.MOVN - - - caGraphics::Circle - - - - - - 140 - 66 - 191 - 141 - - - - caGraphics::Filled - - - caGraphics::Arrow - - - 10 - - - caGraphics::Double - - - 172 - - - - - - 320 - 126 - 25 - 25 - - - - - 14 - - - - z - - - - - - 33 - 146 - 20 - 16 - - - - M2 - - - Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - QFrame::NoFrame - - - - - - 84 - 89 - 10 - 12 - - - - caGraphics::Filled - - - caGraphics::Arrow - - - 4 - - - caGraphics::Single - - - 212 - - - - - - 80 - 76 - 21 - 21 - - - - 2 - - - caGraphics::Arc - - - 35 - - - 50 - - - 357 - - - 243 - - - - - - 60 - 60 - 91 - 91 - - - - caGraphics::Filled - - - caGraphics::Arrow - - - 8 - - - caGraphics::Double - - - 51 - - - - - - 180 - 120 - 10 - 10 - - - - - 120 - 120 - 120 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 120 - 120 - 120 - - - - caGraphics::IfZero - - - A - - - $(P):MOT_GIR_3.MOVN - - - caGraphics::Circle - - - - - - 93 - 12 - 100 - 141 - - - - caGraphics::Filled - - - caGraphics::Arrow - - - 8 - - - caGraphics::Double - - - 90 - - - - - - 230 - 146 - 10 - 10 - - - - - 120 - 120 - 120 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 120 - 120 - 120 - - - - caGraphics::IfZero - - - A - - - $(P):MOT_GIR_5.MOVN - - - caGraphics::Circle - - - - - - 270 - 140 - 51 - 16 - - - - - 9 - - - - roll - - - - - - 160 - 116 - 20 - 16 - - - - M3 - - - Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - QFrame::NoFrame - - - - - - 264 - 119 - 19 - 10 - - - - caGraphics::Filled - - - caGraphics::Arrow - - - 9 - - - caGraphics::Single - - - 291 - - - - - - 160 - 41 - 51 - 16 - - - - - 9 - - - - yaw - - - - - - 80 - 165 - 10 - 10 - - - - - 120 - 120 - 120 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 120 - 120 - 120 - - - - caGraphics::IfZero - - - A - - - $(P):MOT_GIR_1.MOVN - - - caGraphics::Circle - - - - - - 50 - 86 - 51 - 16 - - - - - 9 - - - - pitch - - - - - - 270 - 76 - 51 - 21 - - - - - 11 - - - - Beam - - - - - - 196 - 142 - 20 - 16 - - - - M4 - - - Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - QFrame::NoFrame - - - - - - 130 - 56 - 31 - 18 - - - - 2 - - - caGraphics::Arc - - - 35 - - - 50 - - - 105 - - - 243 - - - - - - 150 - -4 - 25 - 25 - - - - - 14 - - - - y - - - - - - 153 - 59 - 15 - 8 - - - - caGraphics::Filled - - - caGraphics::Arrow - - - 11 - - - caGraphics::Single - - - 99 - - - - - - 10 - 86 - 281 - 111 - - - - - 0 - 5 - 0 - - - - caPolyLine::Solid - - - 2 - - - 28,37;62,62;244,39;172,19;30,38;39,61;69,92;62,61;240,39;243,39;236,72;70,92 - - - caPolyLine::Outline - - - caPolyLine::Polyline - - - - - - 250 - 86 - 61 - 41 - - - - - 255 - 255 - 0 - - - - caGraphics::Filled - - - 4 - - - - 255 - 255 - 0 - - - - caGraphics::Arrow - - - 16 - - - caGraphics::Single - - - 171 - - - 226 - - - 243 - - - - - - 217 - 141 - 10 - 10 - - - - - 51 - 153 - 0 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 51 - 153 - 0 - - - - caGraphics::IfNotZero - - - A - - - $(P):MOT_GIR_4.MOVN - - - caGraphics::Circle - - - - - - 230 - 161 - 20 - 16 - - - - M5 - - - Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - QFrame::NoFrame - - - - - - 217 - 141 - 10 - 10 - - - - - 120 - 120 - 120 - - - - caGraphics::Solid - - - caGraphics::Filled - - - - 120 - 120 - 120 - - - - caGraphics::IfZero - - - A - - - $(P):MOT_GIR_4.MOVN - - - caGraphics::Circle - - - - - - 78 - 177 - 20 - 16 - - - - M1 - - - Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - QFrame::NoFrame - - - capolyline - m3move - label_7 - m5move - cagraphics_9 - m1move - cagraphics_4 - label_8 - caLabel_10 - cagraphics_5 - cagraphics_2 - cagraphics_3 - m3stop - cagraphics - m5stop - label_11 - caLabel_11 - cagraphics_10 - label_10 - m1stop - label_9 - label_12 - caLabel_12 - cagraphics_7 - label_6 - cagraphics_8 - cagraphics_6 - m4move - caLabel_13 - m4stop - caLabel_9 - m2move - m2stop - - - - - 450 - 342 - 161 - 31 - - - - Reset $(P)3 - - - $(P):debug3 - - - Reset $(P)3 - - - BrickLV.Reset=1;#1..8j/ - - - - - - caTextEntry - caLineEdit -
caTextEntry
-
- - caMessageButton - QPushButton -
caMessageButton
-
- - caFrame - QFrame -
caFrame
- 1 -
- - caLabel - QLabel -
caLabel
-
- - caGraphics - QWidget -
caGraphics
-
- - caPolyLine - QWidget -
caPolyLine
-
- - caInclude - QWidget -
caInclude
-
- - caLineEdit - QLineEdit -
caLineEdit
-
-
- - -
diff --git a/qt/ESB_MX_SmarAct.ui b/qt/ESB_MX_SmarAct.ui deleted file mode 100644 index b2566f1..0000000 --- a/qt/ESB_MX_SmarAct.ui +++ /dev/null @@ -1,132 +0,0 @@ - - - Form - - - - 0 - 0 - 610 - 735 - - - - Form - - - false - - - - - 0 - 0 - 781 - 26 - - - - Expert - - - Smaract Controller $(P):$(M) - - - Qt::AlignLeading - - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - - caLabel::Default - - - QFrame::NoFrame - - - - - - 5 - 53 - 590 - 672 - - - - P=$(P),T=$(T),M=$(M)1;P=$(P),T=$(T),M=$(M)2;P=$(P),T=$(T),M=$(M)3;P=$(P),T=$(T),M=$(M)4;P=$(P),T=$(T),M=$(M)5;P=$(P),T=$(T),M=$(M)6;P=$(P),T=$(T),M=$(M)7;P=$(P),T=$(T),M=$(M)8;P=$(P),T=$(T),M=$(M)9;P=$(P),T=$(T),M=$(M)10;P=$(P),T=$(T),M=$(M)11;P=$(P),T=$(T),M=$(M)12;P=$(P),T=$(T),M=$(M)13;P=$(P),T=$(T),M=$(M)14;P=$(P),T=$(T),M=$(M)15 - - - motor_exp.ui - - - 15 - - - 3 - - - caInclude::NoFrame - - - - - - 480 - 10 - 109 - 24 - - - - -Homing - - - - 128 - 136 - 255 - - - - Homing - - - python /ioc/modules/qt/ESB_MX_SmarAct_home.py - - - $(P):$(M) - - - - - - caLabel - QLabel -
caLabel
-
- - caInclude - QWidget -
caInclude
-
- - caShellCommand - QWidget -
caShellCommand
-
-
- - -
diff --git a/qt/ESB_MX_SmarAct_home.py b/qt/ESB_MX_SmarAct_home.py deleted file mode 100755 index 7d651d6..0000000 --- a/qt/ESB_MX_SmarAct_home.py +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/env python -#*-----------------------------------------------------------------------* -#| | -#| Copyright (c) 2014 by Paul Scherrer Institute (http://www.psi.ch) | -#| | -#| Author Thierry Zamofing (thierry.zamofing@psi.ch) | -#*-----------------------------------------------------------------------* -''' -Homing procedure for PPRM. - -Long Doc''' -#for ID in 1 2 3 4 5 6 -#do -#caput MYPREFIX:MOTOR_$ID.RLV 55 -#caput MYPREFIX:MOTOR_$ID.SET Set -#caput MYPREFIX:MOTOR_$ID.VAL 0 -#caput MYPREFIX:MOTOR_$ID.SET Use -#done - -#for ID in 1 2 3 4 5 6 -#do -#caput MYPREFIX:MOTOR_$ID.RLV -10 -#done - - -import logging, sys, os, json -import CaChannel,time - -class SwissMxSmarAct: - - def __init__(self, args): - self.args=args - prefix=self.args.var[0] - if prefix[-1]==':':prefix[:-1] - self.prefix=prefix - self.pv=pvDict=dict() - for i in range(1,16): - #SARES30-ESBMX1:FRM_FORW.PROC - #SARES30-ESBMX1:DRIVE - s1=prefix+'%i'%i - for j in ('.VAL','.RBV','.HOMF','.HOMR','.MSTA','_AUTOZERO'): - s2=s1+j - print(s2) - pv = CaChannel.CaChannel(s2) - pv.setTimeout(10.0) - pv.search() - pvDict[s2]=pv - CaChannel.ca.pend_io(10.0) - #print(pvDict) - #pvDict['cryorbv'] = CaChannel.CaChannel("SAR-EXPMX:MOT_CRYO.RBV") - #pvDict['cryorbv'].search() - - def home(self,idx,fwd): - print('home motor %i fwd:%d...'%(idx,fwd)) - pv=self.pv[self.prefix+'%i'%idx+'_AUTOZERO'] - pv.putw(1) #set autozero on - if fwd: - pv=self.pv[self.prefix+'%i'%idx+'.HOMF'] - else: - pv=self.pv[self.prefix+'%i'%idx+'.HOMR'] - #print('aaa') - pv.putw(1) #set position and move - #print('bbb') - CaChannel.ca.pend_event(0.1) - #print('ccc') - - def waitHomed(self,idx): - #print('ddd') - pv=self.pv[self.prefix+'%i'%idx+'.MSTA'] - #print('eee',pv,self.prefix+'%i'%idx+'.MSTA') - while pv.getw()==0: - print('wait motor %i homing done ...'%idx) - CaChannel.ca.pend_event(0.2) - #print('fff') - - def moveAbs(self,idx,val): - pv=self.pv[self.prefix+'%i'%idx+'.VAL'] - pv.putw(val) #set position and move - - - def check_pos(self, idx, val, tolerance=0.1): - pvrbv = self.pv[self.prefix+'%i'%idx+'.RBV'] - pvst = self.pv[self.prefix+'%i'%idx+'.MSTA'] - - CaChannel.ca.pend_event(0.2) - while pvst.getw(): - CaChannel.ca.pend_event(0.2) - rbv=pvrbv.getw() - if abs(val - rbv) > tolerance: - raise Exception("failed to reach target value %g,%g,%g"%(val,rbv,tolerance)) - - def homing(self): - #start homing in desired direction - #cryorbv = self.pv['cryorbv'] - #if cryorbv.getw() < 4.9: - # raise Exception("Cryojet is too close, move it to 5.0 mm") - - # home Colli Y first and move it to the TOP - ###self.home(2, True) - ###CaChannel.ca.pend_event(0.5) - ###self.waitHomed(2) - ###CaChannel.ca.pend_event(0.5) - ###self.moveAbs(2, 10.0) - ###self.check_pos(2, 10.0) - - ###for idx,fwd in ((1,True),(4,True),(5,True),(6,True),(7,True),(8,True),(10,True),(11,True),(12,True),(13,True),(14,True),(15,True),): - for idx,fwd in ((1,True),(2,True),(3,True),(4,True),(5,True),(6,True),(7,True),(8,True),(9,True),(10,True),(11,True),(12,True),(13,True),(14,True),(15,True),): - self.home(idx,fwd) - CaChannel.ca.pend_event(0.5) - ####wait homing done - ###for idx in (1,4,5,6,7,8,10,11,12,13,14,15,): - ### self.waitHomed(idx) - - ####move to desired position - ###for idx,val in ((1,-10),(4,.4),(5,.5),(6,.6),(7,.7),(8,.8),(10,1.0),(11,1.1),(12,1.2),(13,1.3),(14,1.4),(15,1.5),): - ### self.moveAbs(idx,val) - print('Homing done') - -if __name__=='__main__': - from optparse import OptionParser, IndentedHelpFormatter - class MyFormatter(IndentedHelpFormatter): - 'helper class for formating the OptionParser' - - def __init__(self): - IndentedHelpFormatter.__init__(self) - - def format_epilog(self, epilog): - if epilog: - return epilog - else: - return "" - - def parse_args(): - 'main command line interpreter function' - #usage: gpasciiCommunicator.py --host=PPMACZT84 myPowerBRICK.cfg - (h, t)=os.path.split(sys.argv[0]);cmd='\n '+(t if len(h)>3 else sys.argv[0])+' ' - exampleCmd=('SARES30-ESBMX', - ) - epilog=__doc__+''' -Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n ' - - fmt=MyFormatter() - parser=OptionParser(epilog=epilog, formatter=fmt) - #parser.add_option('', '--host', dest='host', help='hostname (or none to use locally)', metavar='HOST') - #parser.add_option('-v', '--verbose', type="int", dest='verbose', help='verbosity bits (see below)', default=0) - (args, other)=parser.parse_args() - print(args,other) - args.var=other - smrct=SwissMxSmarAct(args) - smrct.homing() - - #os.environ['EPICS_CA_ADDR_LIST']='localhost' - parse_args() - diff --git a/qt/ESB_MX_exp.ui b/qt/ESB_MX_exp.ui deleted file mode 100644 index 4ef853b..0000000 --- a/qt/ESB_MX_exp.ui +++ /dev/null @@ -1,247 +0,0 @@ - - - Form - - - - 0 - 0 - 720 - 695 - - - - Form - - - - - 10 - 10 - 721 - 28 - - - - - 18 - 75 - true - - - - ESB MX $(P) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - 160 - 160 - 164 - - - - - - - 10 - 50 - 700 - 582 - - - - P=$(P),M=MOT_FY;P=$(P),M=MOT_FX;P=$(P),M=MOT_CY;P=$(P),M=MOT_CX;P=$(P),M=MOT_CZ;P=$(P),M=MOT_WEDGE1;P=$(P),M=MOT_WEDGE2;P=$(P),M=MOT_WEDGE3;P=$(P),M=MOT_WEDGE4;P=$(P),M=MOT_WEDGEX;P=$(P),M=MOT_WEDGEY;P=$(P),M=MOT_WEDGEA;P=$(P),M=MOT_WEDGEB;P=$(P),M=MOT_BLGT;P=$(P),M=MOT_CRYO;P=$(P),M=MOT_GIR_X;P=$(P),M=MOT_GIR_Y;P=$(P),M=MOT_GIR_U;P=$(P),M=MOT_GIR_V;P=$(P),M=MOT_GIR_W;P=$(P),M=MOT_DET_Z - - - motor_1m.ui - - - 21 - - - 6 - - - - - - 130 - 640 - 120 - 22 - - - - Homing wedge stage - - - $(P):asyn2.AOUT - - - Homing wedge stage - - - enable plc 1 - - - - - - 350 - 640 - 100 - 22 - - - - Backlight - - - $(P):MOT_BLGT - - - -29000 - - - 0 - - - - - - 250 - 640 - 90 - 22 - - - - Home BkLight - - - $(P):MOT_BLGT.HOMR - - - 1 - - - - - - 10 - 640 - 120 - 22 - - - - Homing fast stage - - - $(P):asyn1.AOUT - - - Homing fast stage - - - enable plc 1 - - - - - - 510 - 640 - 180 - 31 - - - - -related panels - - - - 0 - 0 - 0 - - - - - 89 - 126 - 225 - - - - SmarAct;Girder;EVR;EVR-simple - - - ESB_MX_SmarAct.ui;ESB_MX_5cam.ui;G_EVR_main.ui;S_LAS-TMAIN.ui - - - P=SARES30-SMX,M=MCS,T=MCS;P=$(P);SYS=$(P),DEVICE=EVR0,FF=PCIe;SYS=$(P),DEVICE=EVR0,FF=PCIe - - - caRowColMenu::Menu - - - false;false;false;false;false;false;false;false;false;false;false;false;false;false;false;false - - - - - - 10 - 660 - 120 - 22 - - - - Homing CY stage - - - $(P):asyn1.AOUT - - - Homing CY stage - - - enable plc 2 - - - - - - caRelatedDisplay - QWidget -
caRelatedDisplay
-
- - caMessageButton - QPushButton -
caMessageButton
-
- - caToggleButton - QCheckBox -
caToggleButton
-
- - caLabel - QLabel -
caLabel
-
- - caInclude - QWidget -
caInclude
-
-
- - -