setup ioc stuff

This commit is contained in:
2017-06-12 14:16:36 +02:00
parent 3b886088d9
commit 7794f23c5f
7 changed files with 108 additions and 2 deletions

26
ESB_MX.subs Normal file
View File

@@ -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}
}

9
Makefile Normal file
View File

@@ -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

27
PPMACMotor.template Normal file
View File

@@ -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")
}

23
add_device.cmd Normal file
View File

@@ -0,0 +1,23 @@
### Required Parameters ###
#PORT='PPMAC1'
#P='SARFE10-OAPU...'
#M1_ADDR=1
#powerPmacCreateController(<port_name>, <moving_poll_pseriod [ms]>, <idle_poll_period [ms]>)
#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)")

View File

@@ -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].MaxDac=L20
Motor[2].FatalFeLimit=L21 Motor[2].FatalFeLimit=L21
Motor[2].JogSpeed=L22 Motor[2].JogSpeed=L22

View File

@@ -36,9 +36,9 @@
//Mot 7: Test Stepper: Vextra PK244M 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) //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 //Enc 7: Test Stepper: ssi_enc multiturn 1 rev = 4096 enc_step
$$$*** //$$$***
//!common() //!common()
!common(PhaseFreq=20000,PhasePerServo=4) //!common(PhaseFreq=20000,PhasePerServo=4)
//!common(PhaseFreq=20000,PhasePerServo=1) //!common(PhaseFreq=20000,PhasePerServo=1)
//!common(PhaseFreq=40000) //!common(PhaseFreq=40000)

View File

@@ -888,3 +888,20 @@ cd ~/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg/;gpasciiCommander --hos
enable plc 1 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