From 789224b83d67e991b93c8e0bfa3f9fca58dba6d5 Mon Sep 17 00:00:00 2001 From: Thierry Zamofing Date: Thu, 21 Dec 2017 14:43:07 +0100 Subject: [PATCH] towards recabeling and reconfiguring all Powerbricks and Smaracts devices Here all IOCs were started without any hardware. So in the next steps the hardware must be tested. --- ESB_MX.subs | 31 ----- Makefile | 2 +- PBinspect2.pbi | 94 ++++++++++++++ PPMACMotor.template | 10 -- Readme.md | 47 ++++++- SAR-EXPMX1.subs | 25 ++++ SAR-EXPMX2.subs | 29 +++++ SAR-EXPMX3.subs | 25 ++++ add_EXPMX1.cmd | 20 +++ add_EXPMX2.cmd | 28 ++++ add_EXPMX3.cmd | 42 ++++++ add_device.cmd | 33 ----- asyn.template | 9 ++ cfg/{coordTrf.cfg => MX1_coordTrf.cfg} | 31 +---- cfg/MX1_home.cfg | 78 +++++++++++ cfg/{torqueCtrl.cfg => MX1_setup.cfg} | 144 ++++++++------------- cfg/MX2_coordTrf.cfg | 27 ++++ cfg/MX2_home.cfg | 70 ++++++++++ cfg/MX2_setup.cfg | 25 ++++ cfg/MX3_setup.cfg | 22 ++++ cfg/{mx-stage.cfg => SAR-EXPMX1.cfg} | 6 +- cfg/SAR-EXPMX2.cfg | 4 + cfg/SAR-EXPMX3.cfg | 4 + cfg/init.cfg | 72 ----------- cfg/{ => old}/dirMicrostep.cfg | 0 cfg/{ => old}/init_limit.cfg | 0 cfg/{ => old}/simEncoder.cfg | 0 cfg/{ => old}/startOnTrigger.cfg | 0 cfg/{ => old}/testPerfGrid.cfg | 0 cfg/{mx-stage_sim.cfg => sim_8_motors.cfg} | 0 qt/ESB_MX_exp.ui | 124 ++++++++++++++---- 31 files changed, 706 insertions(+), 296 deletions(-) delete mode 100644 ESB_MX.subs create mode 100644 PBinspect2.pbi create mode 100644 SAR-EXPMX1.subs create mode 100644 SAR-EXPMX2.subs create mode 100644 SAR-EXPMX3.subs create mode 100644 add_EXPMX1.cmd create mode 100644 add_EXPMX2.cmd create mode 100644 add_EXPMX3.cmd delete mode 100644 add_device.cmd create mode 100644 asyn.template rename cfg/{coordTrf.cfg => MX1_coordTrf.cfg} (52%) create mode 100644 cfg/MX1_home.cfg rename cfg/{torqueCtrl.cfg => MX1_setup.cfg} (55%) create mode 100644 cfg/MX2_coordTrf.cfg create mode 100644 cfg/MX2_home.cfg create mode 100644 cfg/MX2_setup.cfg create mode 100644 cfg/MX3_setup.cfg rename cfg/{mx-stage.cfg => SAR-EXPMX1.cfg} (77%) create mode 100644 cfg/SAR-EXPMX2.cfg create mode 100644 cfg/SAR-EXPMX3.cfg delete mode 100644 cfg/init.cfg rename cfg/{ => old}/dirMicrostep.cfg (100%) rename cfg/{ => old}/init_limit.cfg (100%) rename cfg/{ => old}/simEncoder.cfg (100%) rename cfg/{ => old}/startOnTrigger.cfg (100%) rename cfg/{ => old}/testPerfGrid.cfg (100%) rename cfg/{mx-stage_sim.cfg => sim_8_motors.cfg} (100%) diff --git a/ESB_MX.subs b/ESB_MX.subs deleted file mode 100644 index 9126659..0000000 --- a/ESB_MX.subs +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -#P, M - Define motor record name -#PORT - Name of the ppmac controller port created by powerPmacCreateController -#ADDR - Axis index - second parameter of powerPmacCreateAxis and powerPmacCreateVirtualAxis -# -#The rest are standard motor record fields -################################################################################ - -#!motor(mot=1,current=600,JogSpeed=102.4*5/25.6/10,servoSf=25.6*10,invDir=True) -# 102.4*7/ 71.67/20 um/ms =0.500 mm/s -> use 0.40 mm/s - -#Speed: 102.4*5/25.6/10 um/ms =2 mm/s -#Position Units are in um - -#ms to achive speed VELO -> same as Motor[1].JogTa (if positive). Motor[1].JogTa will be set to a caculated negative number -# JAR = EGU/s^2 -> JAR = VELO/ACCL (Jog acceleration) - -#global {M1="TX", M2="TZ", M3="RX", M4="RZ"} - - -file PPMACMotor.template { -pattern{ DESC , P , M , PORT , ADDR , DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM} - { "Rotation Y" , "$(P_M)", "MOTOR_ROT_Y", "$(PORT_M)", "$(M1)", 1 , 50 , 50 , 0.1 , 20 , -0.001, 3 , "deg", 0 , 0 } - { "Sample F-Trans X", "$(P_M)", "MOTOR_FX" , "$(PORT_M)", "$(M2)", 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } - { "Sample F-Trans Y", "$(P_M)", "MOTOR_FY" , "$(PORT_M)", "$(M3)", 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } - { "CamBase X" , "$(P_M)", "MOTOR_CAMX" , "$(PORT_M)", "$(M4)", 1 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } - { "CamBase Y" , "$(P_M)", "MOTOR_CAMY" , "$(PORT_M)", "$(M5)", 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } - { "Backlight" , "$(P_M)", "MOTOR_BLGT" , "$(PORT_M)", "$(M6)", 1 , 40E3, 20E3, 0.1 , 20 , -1 , 0 , "usr", 0 , 0 } - { "Sample C-Trans X", "$(P_M)", "MOTOR_CX" , "$(PORT_M)", "$(M7)", 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } - { "Sample C-Trans Z", "$(P_M)", "MOTOR_CZ" , "$(PORT_M)", "$(M8)", 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } -} diff --git a/Makefile b/Makefile index a11eb03..5075207 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MODULE = $(notdir $(shell pwd)) BUILDCLASSES = Linux ARCH_FILTER = eldk42% SL6-x86_64 EXCLUDE_VERSIONS = 3.14.8 -SCRIPTS+=$(wildcard add_device*.cmd cfg/*.cfg cfg/*.py cfg/*.pbi qt/*.ui qt/*.jpg python/*.py) +SCRIPTS+=$(wildcard add_EXPMX*.cmd cfg/*.cfg cfg/*.py cfg/*.pbi python/*.py) #SOURCES+=src/DHVSaSub.cpp #DBDS+=src/DHVSaSub.dbd USR_CXXFLAGS+= -fno-operator-names diff --git a/PBinspect2.pbi b/PBinspect2.pbi new file mode 100644 index 0000000..da30f66 --- /dev/null +++ b/PBinspect2.pbi @@ -0,0 +1,94 @@ +[ + [ + "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 + ] + ], + "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", + [ + 7 + ], + "name=m7;caption=motor7;state=67377148;dir=4;layer=0;row=3;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1220;floaty=261;floatw=208;floath=677;notebookid=-1;transparent=255" + ], + [ + "StatusMotorListCtrl", + [ + 8 + ], + "name=m8;caption=motor8;state=67377148;dir=4;layer=0;row=3;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1257;floaty=494;floatw=208;floath=677;notebookid=-1;transparent=255" + ] +] \ No newline at end of file diff --git a/PPMACMotor.template b/PPMACMotor.template index 778f0ae..79e54ee 100644 --- a/PPMACMotor.template +++ b/PPMACMotor.template @@ -4,7 +4,6 @@ record(motor,"$(P):$(M)") field(DTYP,"asynMotor") field(OUT, "@asyn($(PORT),$(ADDR))") field(DIR, $(DIR)) - field(VMAX,$(VELO)) field(VELO,$(VELO)) field(JVEL,$(VELO)) field(HVEL,$(HVEL)) @@ -17,12 +16,3 @@ record(motor,"$(P):$(M)") field(DLLM,$(DLLM)) field(RTRY,0) } - -record(asyn,"$(P):ASYN") -{ - field(DTYP,"asynRecordDevice") - field(PORT,"$(PORT)") - field(ADDR,"0") - field(OMAX,"100") - field(IMAX,"100") -} diff --git a/Readme.md b/Readme.md index f9cb4a4..2e6e898 100644 --- a/Readme.md +++ b/Readme.md @@ -19,7 +19,6 @@ Weight top stage: 250g=2.5N Mecapion rot stage ------------------- ``` http://www.lsmecapion.com/eng/ http://www.lsmecapion.com/eng/contents/sub01/sub02_03.php @@ -201,12 +200,8 @@ ssh root@$PPMAC sendgetsends -1 execute helicalscan.py -``` - -HelicalScan SCRATCH -------------------- -``` - +SCRATCH +------- &1p ->this will trigger:forward kinematic cpx pmatch ->this will trigger:forward kinematic @@ -247,3 +242,41 @@ fwd_trf: dx:0.2 dz:0.3 w:5.72958 fy:3.3 ``` + + +Motors final setup 20.12.17 +--------------------------- +``` +SAR-CPPM-EXPMX1: biss:y timing:y + 1: fy + 2: fx + 3: ry + 4: cx + 5: cy + 6: interfero y + 7: interfero x + +SAR-CPPM-EXPMX2: biss:n timing:n + 1: wedge1 + 2: wedge2 + 3: wedge3 + 4: wedge4 + 5: backlight + +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 + + +ssh sf-lc +caqtdm -macro "P=SAR-EXPMX" ESB_MX_exp.ui + +``` diff --git a/SAR-EXPMX1.subs b/SAR-EXPMX1.subs new file mode 100644 index 0000000..069cc93 --- /dev/null +++ b/SAR-EXPMX1.subs @@ -0,0 +1,25 @@ +################################################################################ +#P - prefix of the PV +#PORT - Name of the ppmac controller port created by powerPmacCreateController +#ADDR - Axis index - second parameter of powerPmacCreateAxis and powerPmacCreateVirtualAxis +################################################################################ + +#Position Units are in um + +#ms to achive speed VELO -> same as Motor[1].JogTa (if positive). Motor[1].JogTa will be set to a caculated negative number +# JAR = EGU/s^2 -> JAR = VELO/ACCL (Jog acceleration) + +#caput SAROP21-OAPU092:ASYN.AOUT '&1;#1..2p' +#caget SAROP21-OAPU092:ASYN.TINP +#caput SAROP21-OAPU092:ASYN.AOUT '&1;cpx abs;X(-900)Y(10)A(5200)B(5100)' + +file asyn.template {{P="$(P_M)1", PORT=$(PORT_M)}} + +file PPMACMotor.template { +pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM} + { "Sample F-Trans Y", "$(P_M)", "MOT_FY" , "$(PORT_M)", 1 , 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Sample F-Trans X", "$(P_M)", "MOT_FX" , "$(PORT_M)", 2 , 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Rotation Y" , "$(P_M)", "MOT_ROT_Y", "$(PORT_M)", 3 , 1 , 50 , 50 , 0.1 , 20 , -0.001, 3 , "deg", 0 , 0 } + { "Sample C-Trans X", "$(P_M)", "MOT_CX" , "$(PORT_M)", 4 , 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Sample C-Trans Z", "$(P_M)", "MOT_CZ" , "$(PORT_M)", 5 , 1 , 2 , 2 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } +} diff --git a/SAR-EXPMX2.subs b/SAR-EXPMX2.subs new file mode 100644 index 0000000..c71bfee --- /dev/null +++ b/SAR-EXPMX2.subs @@ -0,0 +1,29 @@ +################################################################################ +#P - prefix of the PV +#PORT - Name of the ppmac controller port created by powerPmacCreateController +#ADDR - Axis index - second parameter of powerPmacCreateAxis and powerPmacCreateVirtualAxis +################################################################################ + +#Position Units are in um + +#ms to achive speed VELO -> same as Motor[1].JogTa (if positive). Motor[1].JogTa will be set to a caculated negative number +# JAR = EGU/s^2 -> JAR = VELO/ACCL (Jog acceleration) + +#caput SAROP21-OAPU092:ASYN.AOUT '&1;#1..2p' +#caget SAROP21-OAPU092:ASYN.TINP +#caput SAROP21-OAPU092:ASYN.AOUT '&1;cpx abs;X(-900)Y(10)A(5200)B(5100)' + +file asyn.template {{P="$(P_M)2", PORT=$(PORT_M)}} + +file PPMACMotor.template { +pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM} + { "Wedge 1" , "$(P_M)", "MOT_WEDGE1", "$(PORT_M)", 1 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge 2" , "$(P_M)", "MOT_WEDGE2", "$(PORT_M)", 2 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge 3" , "$(P_M)", "MOT_WEDGE3", "$(PORT_M)", 3 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge 4" , "$(P_M)", "MOT_WEDGE4", "$(PORT_M)", 4 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge X" , "$(P_M)", "MOT_WEDGEX", "$(PORT_M)", 9 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge Y" , "$(P_M)", "MOT_WEDGEY", "$(PORT_M)", 10 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge A" , "$(P_M)", "MOT_WEDGEA", "$(PORT_M)", 11 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Wedge B" , "$(P_M)", "MOT_WEDGEB", "$(PORT_M)", 12 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm" , 0 , 0 } + { "Backlight", "$(P_M)", "MOT_BLGT" , "$(PORT_M)", 5 , 1 , 40E3, 20E3, 0.1 , 20 , -1 , 0 , "usr", 0 , 0 } +} diff --git a/SAR-EXPMX3.subs b/SAR-EXPMX3.subs new file mode 100644 index 0000000..1d484e0 --- /dev/null +++ b/SAR-EXPMX3.subs @@ -0,0 +1,25 @@ +################################################################################ +#P - prefix of the PV +#PORT - Name of the ppmac controller port created by powerPmacCreateController +#ADDR - Axis index - second parameter of powerPmacCreateAxis and powerPmacCreateVirtualAxis +################################################################################ + +#Position Units are in um + +#ms to achive speed VELO -> same as Motor[1].JogTa (if positive). Motor[1].JogTa will be set to a caculated negative number +# JAR = EGU/s^2 -> JAR = VELO/ACCL (Jog acceleration) + +#caput SAROP21-OAPU092:ASYN.AOUT '&1;#1..2p' +#caget SAROP21-OAPU092:ASYN.TINP +#caput SAROP21-OAPU092:ASYN.AOUT '&1;cpx abs;X(-900)Y(10)A(5200)B(5100)' + +file asyn.template {{P="$(P_M)3", PORT=$(PORT_M)}} + +file PPMACMotor.template { +pattern{ DESC , P , M , PORT , ADDR, DIR, VELO, HVEL, ACCL, JAR, MRES , PREC, EGU , DHLM, DLLM} + { "Girder 1", "$(P_M)", "MOT_GIRDER1", "$(PORT_M)", 1 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm", 0 , 0 } + { "Girder 2", "$(P_M)", "MOT_GIRDER2", "$(PORT_M)", 2 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm", 0 , 0 } + { "Girder 3", "$(P_M)", "MOT_GIRDER3", "$(PORT_M)", 3 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm", 0 , 0 } + { "Girder 4", "$(P_M)", "MOT_GIRDER4", "$(PORT_M)", 4 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm", 0 , 0 } + { "Girder 5", "$(P_M)", "MOT_GIRDER5", "$(PORT_M)", 5 , 0 , .3 , .3 , 0.1 , 20 , -0.001, 3 , "mm", 0 , 0 } +} diff --git a/add_EXPMX1.cmd b/add_EXPMX1.cmd new file mode 100644 index 0000000..d2e7558 --- /dev/null +++ b/add_EXPMX1.cmd @@ -0,0 +1,20 @@ +### Required Parameters ### +#PORT='PPMAC1' +#P='SARFE10-OAPU090' +#powerPmacCreateController(, , ) +#powerPmacCreateController("$(PORT)", 100, 100) <<< done in commom module +########################### +require gpasciiCommander +! $(gpasciiCommander_DIR)/gpasciiCommander --path $(ESB_MX_DIR) $(ESB_MX_DIR)/$(P)1.cfg + +powerPmacCreateAxis($(PORT), 1) +powerPmacCreateAxis($(PORT), 2) +powerPmacCreateAxis($(PORT), 3) +powerPmacCreateAxis($(PORT), 4) +powerPmacCreateAxis($(PORT), 5) +#powerPmacCreateAxis($(PORT), 6) +#powerPmacCreateAxis($(PORT), 7) +#powerPmacCreateAxis($(PORT), 8) + +# Load databse +dbLoadTemplate("$(ESB_MX_TEMPLATES)/$(P)1.subs", "PORT_M=$(PORT),P_M=$(P)") diff --git a/add_EXPMX2.cmd b/add_EXPMX2.cmd new file mode 100644 index 0000000..00dc0c7 --- /dev/null +++ b/add_EXPMX2.cmd @@ -0,0 +1,28 @@ +### Required Parameters ### +#PORT='PPMAC1' +#P='SARFE10-OAPU090' +#powerPmacCreateController(, , ) +#powerPmacCreateController("$(PORT)", 100, 100) <<< done in commom module +########################### +require gpasciiCommander +! $(gpasciiCommander_DIR)/gpasciiCommander --path $(ESB_MX_DIR) $(ESB_MX_DIR)/$(P)2.cfg + +powerPmacCreateAxis($(PORT), 1) +powerPmacCreateAxis($(PORT), 2) +powerPmacCreateAxis($(PORT), 3) +powerPmacCreateAxis($(PORT), 4) +powerPmacCreateAxis($(PORT), 5) +#powerPmacCreateAxis($(PORT), 6) +#powerPmacCreateAxis($(PORT), 7) +#powerPmacCreateAxis($(PORT), 8) + +#powerPmacCreateVirtualAxis(, , , ,, , ) +#powerPmacCreateController("$(PORT)", 100, 100) <<< done in commom module +########################### +require gpasciiCommander +! $(gpasciiCommander_DIR)/gpasciiCommander --path $(ESB_MX_DIR) $(ESB_MX_DIR)/$(P)3.cfg + +powerPmacCreateAxis($(PORT), 1) +powerPmacCreateAxis($(PORT), 2) +powerPmacCreateAxis($(PORT), 3) +powerPmacCreateAxis($(PORT), 4) +powerPmacCreateAxis($(PORT), 5) +#powerPmacCreateAxis($(PORT), 6) +#powerPmacCreateAxis($(PORT), 7) +#powerPmacCreateAxis($(PORT), 8) + +#powerPmacCreateVirtualAxis(, , , ,, , ) -#powerPmacCreateController("$(PORT)", 100, 100) <<< done in commom module -########################### -require gpasciiCommander -! $(gpasciiCommander_DIR)/gpasciiCommander --path $(ESB_MX_DIR) $(ESB_MX_DIR)/mx-stage.cfg - -#M1=$(M1_ADDR) -M1=1 -M2=$(M1)+1 -M3=$(M1)+2 -M4=$(M1)+3 -M5=$(M1)+4 -M6=$(M1)+5 -M7=$(M1)+6 -M8=$(M1)+7 - -powerPmacCreateAxis($(PORT), $(M1)) -powerPmacCreateAxis($(PORT), $(M2)) -powerPmacCreateAxis($(PORT), $(M3)) -powerPmacCreateAxis($(PORT), $(M4)) -powerPmacCreateAxis($(PORT), $(M5)) -powerPmacCreateAxis($(PORT), $(M6)) -powerPmacCreateAxis($(PORT), $(M7)) -powerPmacCreateAxis($(PORT), $(M8)) - - - -# Load databse -dbLoadTemplate("$(ESB_MX_TEMPLATES)/ESB_MX.subs", "PORT_M=$(PORT),P_M=$(P),M1=$(M1),M2=$(M2),M3=$(M3),M4=$(M4),M5=$(M5),M6=$(M6),M7=$(M7),M8=$(M8)") diff --git a/asyn.template b/asyn.template new file mode 100644 index 0000000..680bbf1 --- /dev/null +++ b/asyn.template @@ -0,0 +1,9 @@ + +record(asyn,"$(P):ASYN") +{ + field(DTYP,"asynRecordDevice") + field(PORT,"$(PORT)") + field(ADDR,"0") + field(OMAX,"100") + field(IMAX,"100") +} diff --git a/cfg/coordTrf.cfg b/cfg/MX1_coordTrf.cfg similarity index 52% rename from cfg/coordTrf.cfg rename to cfg/MX1_coordTrf.cfg index 21cf08d..de56f90 100644 --- a/cfg/coordTrf.cfg +++ b/cfg/MX1_coordTrf.cfg @@ -4,9 +4,9 @@ //#2-> +1. X + .5Y + 0.01A //#3-> + .5X +1. Y + 0.01A -#1-> A +#1-> Y #2-> X -#3-> Y +#3-> A Coord[1].AltFeedRate=0 Coord[1].Tm=1 //1ms time @@ -17,31 +17,12 @@ 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[3].JogTs=0 -Motor[3].JogTa=-2.5 -Motor[1].MaxSpeed=360 +Motor[1].MaxSpeed=50 Motor[2].MaxSpeed=50 -Motor[3].MaxSpeed=50 - -open prog 1 - //this uses jogspeed - rapid abs - X(10000) Y(0) A(0) - X(0) Y(10000) A(0) - X(0) Y(0) A(36000) - X(0) Y(0) A(0) -close - -open prog 2 - //this uses Coord[1].Tm and limits with MaxSpeed - linear abs - X(10000) Y(0) A(0) - X(0) Y(10000) A(0) - X(0) Y(0) A(0) - X(0) Y(0) A(36000) - X(0) Y(0) A(0) -close +Motor[3].MaxSpeed=360 diff --git a/cfg/MX1_home.cfg b/cfg/MX1_home.cfg new file mode 100644 index 0000000..2fa88b6 --- /dev/null +++ b/cfg/MX1_home.cfg @@ -0,0 +1,78 @@ +define(PLC_Homing='1') +define(statusHoming='P100') +statusHoming=0 + +//statusHoming: +// 1: M1 phased +// 2: M2 phased +// 4: M1 homed +// 8: M2 homed +// 16: M1 neg limit +// 32: M2 neg limit +// 64: homing done +// 128: 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 + + L20=Motor[2].MaxDac + Motor[2].MaxDac=500 + L21=Motor[2].FatalFeLimit + Motor[2].FatalFeLimit=2000 + L22=Motor[2].JogSpeed + Motor[2].JogSpeed=1 + + + Motor[1].PhaseFindingStep=1 + Motor[2].PhaseFindingStep=1 + timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec + + Motor[1].HomeVel=2 + Motor[2].HomeVel=2 + + home1 + home2 + timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec + statusHoming|=1 + while(1) + { + if(Motor[1].FeFatal && (statusHoming&2)==0) + { + statusHoming=statusHoming|2 + Motor[1].HomeVel=-Motor[1].HomeVel + home1 + } + if(Motor[2].HomeInProgress==0 && (statusHoming&4)==0) + { + statusHoming=statusHoming|4 + Motor[2].HomeVel=-Motor[2].HomeVel + home2 + } + if(Motor[1].HomeInProgress==0 && Motor[1].HomeInProgress==0) + { + statusHoming=statusHoming|8 + break + } + } + + Motor[1].PhasePos=560 // 555 581 593 558 + Motor[2].PhasePos=1540 //1549 1531 1543 1537 + + + Motor[1].MaxDac=L10 + Motor[1].FatalFeLimit=L11 + Motor[1].JogSpeed=L12 + Motor[2].MaxDac=L20 + Motor[2].FatalFeLimit=L21 + Motor[2].JogSpeed=L22 + + disable plc PLC_Homing +close diff --git a/cfg/torqueCtrl.cfg b/cfg/MX1_setup.cfg similarity index 55% rename from cfg/torqueCtrl.cfg rename to cfg/MX1_setup.cfg index 6002cd2..33319e0 100644 --- a/cfg/torqueCtrl.cfg +++ b/cfg/MX1_setup.cfg @@ -17,31 +17,52 @@ // 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: Rotation stage LS Mecapion MDM-DC06DNC0H 32 poles = 1 rev = 16*2048=32768 phase_step -//Enc 1: Rotation stage LS Mecapion 1 rev = 1048576 enc_steps +//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 Y Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 2: 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) -//Mot 3: Stage X Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 3: Stage X Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) +//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 -//Mot/Enc 4: camera base plate X -// OBSOLETE: Enc 4: Interferometer 1 +//Mot 4: Stage X Stada Stepper 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) +//Enc 4: Renishaw absolute BiSS -//Mot/Enc 5: camera base plate Y -// OBSOLETE Enc 5: Interferometer 2 +//Mot 5: Stage Y Stada Stepper 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) +//Enc 5: Renishaw absolute BiSS -//Mot 6: Backlight 2.3A +//Enc 6: Interferometer Y -//Mot 7: Stada Stepper: 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 7: Renishaw absolute BiSS +//Enc 7: Interferometer X -//Mot 8: Stada Stepper: 670mA 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 8: Renishaw absolute BiSS +//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=20,Kvfb=1000,Ki=0.07,Kvff=1000,Kaff=4000,MaxInt=1000) +//!motor_servo(mot=1,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000) +!motor_servo(mot=1,ctrl='ServoCtrl',Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000) +!motor(mot=1,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,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') +//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) +!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=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000) +//PhaseFreq=20000,PhasePerServo=1 -> Kvfb=220*4 Ki/=4,Kvff*=4,Kaff*=4*4 +!motor(mot=2,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,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') //rot stage @@ -53,92 +74,33 @@ // -> 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 -!encoder_sim(enc=1,tbl=9,mot=9,posSf=360000./32768) -!encoder_biss(enc=1,tbl=1,mot=1,numBits=20,posSf=360000./1048576) -Motor[1].pPhaseEnc=Acc84B[0].Chan[0].SerialEncDataA.a -//Motor[1].pAbsPhasePos=Acc84B[0].Chan[0].SerialEncDataA.a - -!motor_servo(mot=1,ctrl='ServoCtrl',Kp=0.8,Kvfb=20,Ki=0.001,Kvff=40,Kaff=0,MaxInt=1000) -!motor(mot=1,dirCur=0,contCur=1000,peakCur=2000,timeAtPeak=1,IiGain=1.5,IpfGain=0,IpbGain=3,JogSpeed=180.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./8192,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=3000,WarnFeLimit=1000,InPosBand=10, HomeOffset=228987) - - -//Stage Y Parker MX80L -//-------------------- -//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) -//use um as motor unit -!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=20,Kvfb=1000,Ki=0.07,Kvff=1000,Kaff=4000,MaxInt=1000) -//!motor_servo(mot=2,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000) -!motor_servo(mot=2,ctrl='ServoCtrl',Kp=25,Kvfb=400,Ki=0.02,Kvff=350,Kaff=5000,MaxInt=1000) -!motor(mot=2,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,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') - - -//Stage X Parker MX80L (top stage, mounted on Y stage) -//---------------------------------------------------- -//Motor[3].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) - -!encoder_sim(enc=3,tbl=11,mot=11,posSf=13000./2048) -!encoder_inc(enc=3,tbl=3,mot=3,posSf=13000./650000) -!motor_servo(mot=3,ctrl='ServoCtrl',Kp=20,Kvfb=220,Ki=0.02,Kvff=240,Kaff=1500,MaxInt=1000) -//PhaseFreq=20000,PhasePerServo=1 -> Kvfb=220*4 Ki/=4,Kvff*=4,Kaff*=4*4 -!motor(mot=3,dirCur=0,contCur=800,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,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') - -//Interferometer 1,2 -//------------------ -//!encoder_inc(enc=4,tbl=4,mot=4)# ,posSf=13000./650000) -//!encoder_inc(enc=5,tbl=5,mot=5)# ,posSf=13000./650000) - -//camera base plate X,Y -//--------------------- - -//102400000 ustep 200000 encCnt = 10mm = 10000um -//posSf = userUnits/encoder_steps = 10000/200000 =1./20 -//servoSf=motor_u_steps/userUnits = 102400000/10000 = 10240./1 -!encoder_inc(enc=4,posSf=1./20) -!motor(mot=4,dirCur=250,JogSpeed=.3,invDir=0,servoSf=10240.,InPosBand=1,HomeOffset=0) -Motor[4].Pos2Sf=0 // Pos2Sf set to 0 to avoid programming leak values - -//-51200000 ustep = -200000 encCnt == 10mm =10000 um -//posSf = userUnits/encoder_steps = 10000/-200000 =1/-20. -//servoSf=motor_u_steps/userUnits = -51200000/10000 = -5120./1 -!encoder_inc(enc=5,posSf=1./20) -!motor(mot=5,dirCur=250,JogSpeed=.3,invDir=0,servoSf=5120.,InPosBand=1,HomeOffset=0) -Motor[5].Pos2Sf=0 // Pos2Sf set to 0 to avoid programming leak values - - -//Backlight -//--------- -//#6j=0 //down -//#6j=-31000 //up -!encoder_sim(enc=6) -!motor(mot=6,dirCur=1800,JogSpeed=40,invDir=False) +!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[0].SerialEncDataA.a +!motor_servo(mot=3,ctrl='ServoCtrl',Kp=0.8,Kvfb=20,Ki=0.001,Kvff=40,Kaff=0,MaxInt=1000) +!motor(mot=3,dirCur=0,contCur=1000,peakCur=2000,timeAtPeak=1,IiGain=1.5,IpfGain=0,IpbGain=3,JogSpeed=180.,numPhase=3,invDir=True,servo=None,PhasePosSf=1./8192,PhaseFindingDac=100,PhaseFindingTime=50,SlipGain=0,AdvGain=0,PwmSf=10000,FatalFeLimit=3000,WarnFeLimit=1000,InPosBand=10, HomeOffset=228987) //Stada stage -//---------------------------------------------------- +//----------- //512000 ustep == 50000 encCnt == 2500um //posSf = userUnits/encoder_steps //servoSf=motor_u_steps/userUnits -!encoder_biss(enc=7,numBits=32,posSf=1./20) -!encoder_biss(enc=8,numBits=32,posSf=1./20) -!motor(mot=7,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39278) -!motor(mot=8,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39736) +!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=1,servoSf=204.8,InPosBand=1,HomeOffset=39278) +!motor(mot=5,current=200,JogSpeed=0.5,invDir=1,servoSf=204.8,InPosBand=1,HomeOffset=39736) -//turn off servon and inpos below ... user units (here 1um) -//Motor[7].InPosBand=1;Motor[7].Servo.BreakPosErr=Motor[7].InPosBand -//Motor[8].InPosBand=1;Motor[8].Servo.BreakPosErr=Motor[8].InPosBand -#1,7,8hmz +//Interferometer 1,2 +//------------------ +!encoder_inc(enc=6,tbl=6,mot=6)# ,posSf=13000./650000) +!encoder_inc(enc=7,tbl=7,mot=7)# ,posSf=13000./650000) + +#3,4,5hmz //holding current -!holding_current(m4=[0,240],m5=[0,240],m6=[1400,1800],m7=[0,200],m8=[0,200]) +!holding_current(m4=[0,240],m5=[0,240]) diff --git a/cfg/MX2_coordTrf.cfg b/cfg/MX2_coordTrf.cfg new file mode 100644 index 0000000..eee31e4 --- /dev/null +++ b/cfg/MX2_coordTrf.cfg @@ -0,0 +1,27 @@ +// ---------- 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 new file mode 100644 index 0000000..aa67f4b --- /dev/null +++ b/cfg/MX2_home.cfg @@ -0,0 +1,70 @@ +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 +//motID :P0 : Motor Number +//direction :P1 : Motion direction to first limit switch: -1 -> #1j- ,+1 -> #1j+ +//status :P100: local status +//timer :P101: local timer + +open plc PLC_Homing +define(motID='L0',direction='P1',status='P100',timer='P101') +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=10 +while(1) +{ + if((Motor[1].MinusLimit==1 || Motor[1].FeFatal==1)){ + if((Motor[2].MinusLimit==1 || Motor[2].FeFatal==1)){ + if((Motor[3].MinusLimit==1 || Motor[3].FeFatal==1)){ + if((Motor[4].MinusLimit==1 || Motor[4].FeFatal==1)){ + status=11 + break + }}}} +} +timer = Sys.RunTime + 2 +status=100 +while (Sys.RunTime < timer){} //wait 2 sec +status=101 +jog1:1000; jog2:1000; jog3:1000; jog4:1000; +timer = Sys.RunTime + 2 +status=200 +while (Sys.RunTime < timer){} //wait 2 sec +status=201 +while(1) +{ + if(Motor[1].DesVelZero==1 && Motor[2].DesVelZero==1 && Motor[3].DesVelZero==1 && Motor[4].DesVelZero==1) + { + status=12 + break + } +} +timer = Sys.RunTime + 2 +while (Sys.RunTime < timer){} +home 1; home 2; home 3; home 4 +status=13 +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=14 + 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=15 + break + } +} +disable plc PLC_Homing +close diff --git a/cfg/MX2_setup.cfg b/cfg/MX2_setup.cfg new file mode 100644 index 0000000..8723fc7 --- /dev/null +++ b/cfg/MX2_setup.cfg @@ -0,0 +1,25 @@ + + +//Wedge Movers +-------------- +!encoder_inc(enc=1,posSf=1./20) +!motor(mot=1,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2855,InPosBand=1) + +!encoder_inc(enc=2,posSf=1./20) +!motor(mot=2,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2844,InPosBand=1) + +!encoder_inc(enc=3,posSf=1./20) +!motor(mot=3,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=204,InPosBand=1) + +!encoder_inc(enc=4,posSf=1./20) +!motor(mot=4,current=120,JogSpeed=1,HomeVel=.5,servoSf=12.28878*20,homing='enc-index',invDir=True,HomeOffset=2094,InPosBand=1) + + +//Backlight +//--------- +//#5j=0 //down #5j=-31000 //up +!encoder_sim(enc=5) +!motor(mot=5,dirCur=1800,JogSpeed=40,invDir=False) + + +!holding_current(m5=[1400,1800]) diff --git a/cfg/MX3_setup.cfg b/cfg/MX3_setup.cfg new file mode 100644 index 0000000..86d0258 --- /dev/null +++ b/cfg/MX3_setup.cfg @@ -0,0 +1,22 @@ +//5 simulated cam movers + + +!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 diff --git a/cfg/mx-stage.cfg b/cfg/SAR-EXPMX1.cfg similarity index 77% rename from cfg/mx-stage.cfg rename to cfg/SAR-EXPMX1.cfg index dccab38..82facd8 100644 --- a/cfg/mx-stage.cfg +++ b/cfg/SAR-EXPMX1.cfg @@ -5,6 +5,6 @@ //!common(PhaseFreq=20000,PhasePerServo=1) //!common(PhaseFreq=40000) -!torqueCtrl() -!init() -!coordTrf() \ No newline at end of file +!MX1_setup() +!MX1_home() +!MX1_coordTrf() \ No newline at end of file diff --git a/cfg/SAR-EXPMX2.cfg b/cfg/SAR-EXPMX2.cfg new file mode 100644 index 0000000..20d208c --- /dev/null +++ b/cfg/SAR-EXPMX2.cfg @@ -0,0 +1,4 @@ + +!MX2_setup() +!MX2_home() +!MX2_coordTrf() \ No newline at end of file diff --git a/cfg/SAR-EXPMX3.cfg b/cfg/SAR-EXPMX3.cfg new file mode 100644 index 0000000..133004c --- /dev/null +++ b/cfg/SAR-EXPMX3.cfg @@ -0,0 +1,4 @@ + +!MX3_setup() +//!MX3_home() +//!MX3_coordTrf() \ No newline at end of file diff --git a/cfg/init.cfg b/cfg/init.cfg deleted file mode 100644 index b7fd5ed..0000000 --- a/cfg/init.cfg +++ /dev/null @@ -1,72 +0,0 @@ -define(PLC_Homing='1') - -open subprog 12 -enable plc PLC_Homing -close - -open plc PLC_Homing -define(status='P100',timer='P101') - -L20=Motor[2].MaxDac -Motor[2].MaxDac=500 -L21=Motor[2].FatalFeLimit -Motor[2].FatalFeLimit=2000 -L22=Motor[2].JogSpeed -Motor[2].JogSpeed=1 - -L30=Motor[3].MaxDac -Motor[3].MaxDac=500 -L31=Motor[3].FatalFeLimit -Motor[3].FatalFeLimit=2000 -L32=Motor[3].JogSpeed -Motor[3].JogSpeed=1 - - -Motor[2].PhaseFindingStep=1 -Motor[3].PhaseFindingStep=1 -timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec - -Motor[2].HomeVel=2 -Motor[3].HomeVel=2 - -P200=Motor[2].HomeInProgress -home2 -home3 -timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec -P201=Motor[2].HomeInProgress - -status=1 -while(1) -{ - if(Motor[2].FeFatal && (status&2)==0) - { - status=status|2 - Motor[2].HomeVel=-Motor[2].HomeVel - home2 - } - if(Motor[3].HomeInProgress==0 && (status&4)==0) - { - status=status|4 - Motor[3].HomeVel=-Motor[3].HomeVel - home3 - } - if(Motor[2].HomeInProgress==0 && Motor[3].HomeInProgress==0) - { - status=status|8 - break - } -} - -Motor[2].PhasePos=560 // 555 581 593 558 -Motor[3].PhasePos=1540 //1549 1531 1543 1537 - - -Motor[2].MaxDac=L20 -Motor[2].FatalFeLimit=L21 -Motor[2].JogSpeed=L22 -Motor[3].MaxDac=L30 -Motor[3].FatalFeLimit=L31 -Motor[3].JogSpeed=L32 - -disable plc PLC_Homing -close diff --git a/cfg/dirMicrostep.cfg b/cfg/old/dirMicrostep.cfg similarity index 100% rename from cfg/dirMicrostep.cfg rename to cfg/old/dirMicrostep.cfg diff --git a/cfg/init_limit.cfg b/cfg/old/init_limit.cfg similarity index 100% rename from cfg/init_limit.cfg rename to cfg/old/init_limit.cfg diff --git a/cfg/simEncoder.cfg b/cfg/old/simEncoder.cfg similarity index 100% rename from cfg/simEncoder.cfg rename to cfg/old/simEncoder.cfg diff --git a/cfg/startOnTrigger.cfg b/cfg/old/startOnTrigger.cfg similarity index 100% rename from cfg/startOnTrigger.cfg rename to cfg/old/startOnTrigger.cfg diff --git a/cfg/testPerfGrid.cfg b/cfg/old/testPerfGrid.cfg similarity index 100% rename from cfg/testPerfGrid.cfg rename to cfg/old/testPerfGrid.cfg diff --git a/cfg/mx-stage_sim.cfg b/cfg/sim_8_motors.cfg similarity index 100% rename from cfg/mx-stage_sim.cfg rename to cfg/sim_8_motors.cfg diff --git a/qt/ESB_MX_exp.ui b/qt/ESB_MX_exp.ui index 87fdc2f..e80461c 100644 --- a/qt/ESB_MX_exp.ui +++ b/qt/ESB_MX_exp.ui @@ -7,7 +7,7 @@ 0 0 776 - 342 + 643 @@ -49,25 +49,36 @@ 20 70 725 - 192 + 456 -P=$(P),M=MOTOR_CX; -P=$(P),M=MOTOR_CZ; -P=$(P),M=MOTOR_ROT_Y; -P=$(P),M=MOTOR_FX; -P=$(P),M=MOTOR_FY; -P=$(P),M=MOTOR_CAMX; -P=$(P),M=MOTOR_CAMY; -P=$(P),M=MOTOR_BLGT +P=$(P),M=MOT_FY; +P=$(P),M=MOT_FX; +P=$(P),M=MOT_ROT_Y; +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_GIRDER1; +P=$(P),M=MOT_GIRDER2; +P=$(P),M=MOT_GIRDER3; +P=$(P),M=MOT_GIRDER4; +P=$(P),M=MOT_GIRDER5 ESB_MX_motor.ui - 8 + 19 @@ -202,17 +213,20 @@ P=$(P),M=MOTOR_BLGT - 620 - 20 - 100 + 50 + 570 + 121 22 - Homing + Homing wedge stage - $(P):ASYN.AOUT + $(P)2:ASYN.AOUT + + + Homing wedge stage enable plc 1 @@ -221,8 +235,8 @@ P=$(P),M=MOTOR_BLGT - 620 - 300 + 190 + 570 121 24 @@ -250,8 +264,8 @@ P=$(P),M=MOTOR_BLGT - 460 - 300 + 200 + 540 100 22 @@ -260,7 +274,7 @@ P=$(P),M=MOTOR_BLGT Backlight - $(P):MOTOR_BLGT + $(P):MOT_BLGT 28000 @@ -272,8 +286,8 @@ P=$(P),M=MOTOR_BLGT - 110 - 300 + 60 + 600 100 22 @@ -288,6 +302,70 @@ P=$(P),M=MOTOR_BLGT 1 + + + + 50 + 540 + 121 + 22 + + + + Homing fast stage + + + $(P)1:ASYN.AOUT + + + Homing fast stage + + + enable plc 1 + + + + + + 190 + 600 + 151 + 30 + + + + -ESB_MX Girder + + + + 0 + 0 + 0 + + + + + 89 + 126 + 225 + + + + HEXGIR + + + S_CS_HEXGIR_5Dbasic.ui + + + NAME=$(P), NAME1=$(P) + + + caRowColMenu::Menu + + + false;false;false;false;false;false;false;false;false;false;false;false;false;false;false;false + +