From 7794f23c5f19cfea71e73f3552d4ccc81d83e998 Mon Sep 17 00:00:00 2001 From: Thierry Zamofing Date: Mon, 12 Jun 2017 14:16:36 +0200 Subject: [PATCH] setup ioc stuff --- ESB_MX.subs | 26 ++++++++++++++++++++++++++ Makefile | 9 +++++++++ PPMACMotor.template | 27 +++++++++++++++++++++++++++ add_device.cmd | 23 +++++++++++++++++++++++ cfg/init.cfg | 4 ++++ cfg/mx-stage.cfg | 4 ++-- logbook.md | 17 +++++++++++++++++ 7 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 ESB_MX.subs create mode 100644 Makefile create mode 100644 PPMACMotor.template create mode 100644 add_device.cmd diff --git a/ESB_MX.subs b/ESB_MX.subs new file mode 100644 index 0000000..4ddef1f --- /dev/null +++ b/ESB_MX.subs @@ -0,0 +1,26 @@ +################################################################################ +#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,VMAX,VELO,JVEL,HVEL,ACCL,JAR,MRES ,PREC,EGU ,DHLM,DLLM} +{ "Rotation Y" ,"$(P_M)","MOTOR_ROT_Y1","$(PORT_M)","$(M1)",0 ,2 ,2 ,2 ,1 ,0.1 ,20 ,-0.001,3 ,"deg",0 ,0} +{ "Translation X","$(P_M)","MOTOR_X1" ,"$(PORT_M)","$(M2)",0 ,2 ,2 ,2 ,1 ,0.1 ,20 ,-0.001,3 ,"mm",0 ,0} +{ "Translation Y","$(P_M)","MOTOR_Y1" ,"$(PORT_M)","$(M3)",0 ,2 ,2 ,2 ,1 ,0.1 ,20 ,-0.001,3 ,"mm",0 ,0} +} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3da60c1 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +include /ioc/tools/driver.makefile +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) +#SOURCES+=src/DHVSaSub.cpp +#DBDS+=src/DHVSaSub.dbd +USR_CXXFLAGS+= -fno-operator-names diff --git a/PPMACMotor.template b/PPMACMotor.template new file mode 100644 index 0000000..2023c24 --- /dev/null +++ b/PPMACMotor.template @@ -0,0 +1,27 @@ +record(motor,"$(P):$(M)") +{ + field(DESC,"$(DESC)") + field(DTYP,"asynMotor") + field(OUT,"@asyn($(PORT),$(ADDR))") + field(DIR,"$(DIR)") + field(VMAX,"$(VMAX)") + field(VELO,"$(VELO)") + field(JVEL,"$(JVEL)") + field(HVEL,"$(HVEL)") + field(ACCL,"$(ACCL)") + field(JAR, "$(JAR)") + field(MRES,"$(MRES)") + field(PREC,"$(PREC)") + field(EGU,"$(EGU)") + field(DHLM,"$(DHLM)") + field(DLLM,"$(DLLM)") +} + +record(asyn,"$(P):ASYN") +{ + field(DTYP,"asynRecordDevice") + field(PORT,"$(PORT)") + field(ADDR,"0") + field(OMAX,"100") + field(IMAX,"100") +} diff --git a/add_device.cmd b/add_device.cmd new file mode 100644 index 0000000..ae4248f --- /dev/null +++ b/add_device.cmd @@ -0,0 +1,23 @@ +### Required Parameters ### +#PORT='PPMAC1' +#P='SARFE10-OAPU...' +#M1_ADDR=1 +#powerPmacCreateController(, , ) +#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 + +powerPmacCreateAxis($(PORT), $(M1)) +powerPmacCreateAxis($(PORT), $(M2)) +powerPmacCreateAxis($(PORT), $(M3)) +#powerPmacCreateAxis($(PORT), $(M4)) + +# Load databse +dbLoadTemplate("$(ESB_MX_TEMPLATES)/ESB_MX.subs", "PORT_M=$(PORT),P_M=$(P),M1=$(M1),M2=$(M2),M3=$(M3)") diff --git a/cfg/init.cfg b/cfg/init.cfg index e102288..b7fd5ed 100644 --- a/cfg/init.cfg +++ b/cfg/init.cfg @@ -57,6 +57,10 @@ while(1) } } +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 diff --git a/cfg/mx-stage.cfg b/cfg/mx-stage.cfg index 485513f..d653d92 100644 --- a/cfg/mx-stage.cfg +++ b/cfg/mx-stage.cfg @@ -36,9 +36,9 @@ //Mot 7: Test Stepper: Vextra PK244M 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) //Enc 7: Test Stepper: ssi_enc multiturn 1 rev = 4096 enc_step -$$$*** +//$$$*** //!common() -!common(PhaseFreq=20000,PhasePerServo=4) +//!common(PhaseFreq=20000,PhasePerServo=4) //!common(PhaseFreq=20000,PhasePerServo=1) //!common(PhaseFreq=40000) diff --git a/logbook.md b/logbook.md index 15af451..1a49e7b 100644 --- a/logbook.md +++ b/logbook.md @@ -888,3 +888,20 @@ cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/;gpasciiCommander --hos 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 + + +dbl +dbpf SAR-ESB_MX:MOTOR_Y1 10 +dbpf SAR-ESB_MX:MOTOR_X1 10 + +dbpf SAR-ESB_MX:ASYN.AOUT 'enable plc 1' + + +dbpf \ No newline at end of file