From 229ca9f3412a3727b4a820a6dc35cdfd1408d307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstr=C3=B6m?= Date: Mon, 16 Dec 2024 15:41:28 +0100 Subject: [PATCH] Update some startup scripts --- .../master_slave/slit/common/axis_ax5_LO.yaml | 79 +++++++++++++++++++ .../master_slave/slit/common/axis_ax6_HI.yaml | 79 +++++++++++++++++++ .../slit/common/axis_vax5_YCEN.yaml | 65 +++++++++++++++ .../slit/common/axis_vax6_YGAP.yaml | 65 +++++++++++++++ .../slit/common/cfgHW_and_motion_local.cmd | 18 +++++ .../PSI/lab_setup/master_slave/slit/readme.md | 7 ++ .../slit/slit_equations/cfg/EPICSVERSION | 1 + .../slit/slit_equations/cfg/axis_main.plc | 8 ++ .../slit/slit_equations/startup.script | 11 +++ .../startup.script_ecmc_local_hw | 19 +++++ .../slit/slit_matrix/cfg/EPICSVERSION | 1 + .../slit/slit_matrix/cfg/axis_main.plc | 31 ++++++++ .../slit/slit_matrix/startup.script | 11 +++ .../slit_matrix/startup.script_ecmc_local_hw | 19 +++++ .../stepper_bissc/startup_local_hw_lookup.cmd | 5 +- .../stepper_bissc/startup_local_hw_plugin.cmd | 43 ++++++++++ 16 files changed, 458 insertions(+), 4 deletions(-) create mode 100644 examples/PSI/lab_setup/master_slave/slit/common/axis_ax5_LO.yaml create mode 100644 examples/PSI/lab_setup/master_slave/slit/common/axis_ax6_HI.yaml create mode 100644 examples/PSI/lab_setup/master_slave/slit/common/axis_vax5_YCEN.yaml create mode 100644 examples/PSI/lab_setup/master_slave/slit/common/axis_vax6_YGAP.yaml create mode 100644 examples/PSI/lab_setup/master_slave/slit/common/cfgHW_and_motion_local.cmd create mode 100644 examples/PSI/lab_setup/master_slave/slit/readme.md create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/EPICSVERSION create mode 100755 examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/axis_main.plc create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script_ecmc_local_hw create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/EPICSVERSION create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/axis_main.plc create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script create mode 100644 examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script_ecmc_local_hw create mode 100644 examples/PSI/lab_setup/stepper_bissc/startup_local_hw_plugin.cmd diff --git a/examples/PSI/lab_setup/master_slave/slit/common/axis_ax5_LO.yaml b/examples/PSI/lab_setup/master_slave/slit/common/axis_ax5_LO.yaml new file mode 100644 index 000000000..a05efa13a --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/common/axis_ax5_LO.yaml @@ -0,0 +1,79 @@ +# https://paulscherrerinstitute.github.io/ecmccfg/manual/axis/axisyaml/ + +axis: + id: 5 + group: realAxes + mode: CSV + features: + allowSrcChangeWhenEnabled: true + +epics: + name: TR_LO + precision: 4 + unit: mm + motorRecord: + description: "Low" + fieldInit: "SPAM=0,RTRY=1,FOFF=Frozen,TWV=1" + +drive: + numerator: 10 # max velo in EGU/s + denominator: 32768 # MAX_INT for a 16-bit register, always this for this stepper drive! + type: 0 + control: ec${M_ID=0}.s$(DRV_SLAVE).driveControl01 + status: ec${M_ID=0}.s$(DRV_SLAVE).driveStatus01 + setpoint: ec${M_ID=0}.s$(DRV_SLAVE).velocitySetpoint01 + +encoder: + numerator: 1 # 1egu = 1mm + denominator: 12800 # Number of ticks when motor moves numerator (=1mm): 1 mm / 50 nm = 20000 + type: 0 # Type: 0=Incremental, 1=Absolute + bits: 16 # Total bit count of encoder raw data + absBits: 0 # Absolute bit count (for abs enc) always least significant part of 'bits' + absOffset: 0.0000 # Encoder offset in eng units (for absolute encoders) + position: ec${M_ID=0}.s$(ENC_SLAVE).positionActual$(ENC_CHANNEL) + +controller: + Kp: 10.00 + Ki: 0.001 + Kd: 0.000 + Kff: 1.00 + +trajectory: + axis: + velocity: 1.0 + acceleration: 1.0 + deceleration: 1.0 + +input: + limit: + forward: ec${M_ID=0}.s$(DRV_SLAVE).driveStatus01.12 # 1119994 cnts // 55.9997 mm + backward: ec${M_ID=0}.s$(DRV_SLAVE).driveStatus01.11 # 98010 cnts // 4.9005 mm + home: ec${M_ID=0}.s$(DRV_SLAVE).ONE.0 # unused + interlock: ec${M_ID=0}.s$(DRV_SLAVE).ONE.0 # unused + +softlimits: + enable: false + backwardEnable: true + forwardEnable: true + forward: 55.8 + backward: 5.1 + +monitoring: + lag: + enable: true + tolerance: 0.05 + time: 100 + target: + enable: true + tolerance: 0.05 + time: 100 + velocity: + enable: true + max: 5 + time: + trajectory: 100 + drive: 200 + +plc: + enable: true + externalCommands: true diff --git a/examples/PSI/lab_setup/master_slave/slit/common/axis_ax6_HI.yaml b/examples/PSI/lab_setup/master_slave/slit/common/axis_ax6_HI.yaml new file mode 100644 index 000000000..7b7c08609 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/common/axis_ax6_HI.yaml @@ -0,0 +1,79 @@ +# https://paulscherrerinstitute.github.io/ecmccfg/manual/axis/axisyaml/ + +axis: + id: 6 + group: realAxes + mode: CSV + features: + allowSrcChangeWhenEnabled: true + +epics: + name: TR_HI + precision: 4 + unit: mm + motorRecord: + description: "Hi" + fieldInit: "SPAM=0,RTRY=1,FOFF=Frozen,TWV=1" + +drive: + numerator: 10 # max velo in EGU/s + denominator: 32768 # MAX_INT for a 16-bit register, always this for this stepper drive! + type: 0 + control: ec${M_ID=0}.s$(DRV_SLAVE).driveControl01 + status: ec${M_ID=0}.s$(DRV_SLAVE).driveStatus01 + setpoint: ec${M_ID=0}.s$(DRV_SLAVE).velocitySetpoint01 + +encoder: + numerator: 1 # 1egu = 1mm + denominator: 12800 # Number of ticks when motor moves numerator (=1mm): 1 mm / 50 nm = 20000 + type: 0 # Type: 0=Incremental, 1=Absolute + bits: 16 # Total bit count of encoder raw data + absBits: 0 # Absolute bit count (for abs enc) always least significant part of 'bits' + absOffset: 0.0000 # Encoder offset in eng units (for absolute encoders) + position: ec${M_ID=0}.s$(ENC_SLAVE).positionActual$(ENC_CHANNEL) + +controller: + Kp: 2.000 + Ki: 0.001 + Kd: 0.000 + Kff: 1.00 + +trajectory: + axis: + velocity: 1.0 + acceleration: 1.0 + deceleration: 1.0 + +input: + limit: + forward: ec${M_ID=0}.s$(DRV_SLAVE).driveStatus01.12 # 1111969 cnts // 55.5984 mm + backward: ec${M_ID=0}.s$(DRV_SLAVE).driveStatus01.11 # 109007 cnts // 5.4504 mm + home: ec${M_ID=0}.s$(DRV_SLAVE).ONE.0 # unused + interlock: ec${M_ID=0}.s$(DRV_SLAVE).ONE.0 # unused + +softlimits: + enable: false + backwardEnable: true + forwardEnable: true + forward: 55.4 + backward: 5.7 + +monitoring: + lag: + enable: true + tolerance: 0.05 + time: 100 + target: + enable: true + tolerance: 0.05 + time: 100 + velocity: + enable: true + max: 5 + time: + trajectory: 100 + drive: 200 + +plc: + enable: true + externalCommands: true diff --git a/examples/PSI/lab_setup/master_slave/slit/common/axis_vax5_YCEN.yaml b/examples/PSI/lab_setup/master_slave/slit/common/axis_vax5_YCEN.yaml new file mode 100644 index 000000000..02dfbf3cb --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/common/axis_vax5_YCEN.yaml @@ -0,0 +1,65 @@ +axis: + id: ${AX_ID} + group: virtualAxes + type: end effector + +epics: + name: CENTERY + precision: 4 + unit: mm + motorRecord: + description: "Center (Virtual)" + fieldInit: "SPAM=0,RTRY=1,FOFF=Frozen,TWV=1" + +encoder: + type: 1 + source: 1 + numerator: 1 + bits: 32 + +trajectory: + axis: + velocity: 0.5 + acceleration: 0.25 + jerk: 0.25 + +input: + limit: + forward: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + backward: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + home: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + interlock: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + +softlimits: + enable: false + forwardEnable: true + backwardEnable: true + forward: 52 + backward: 8 + +monitoring: + lag: + enable: yes + tolerance: 0.02 + time: 100 + target: + enable: yes + tolerance: 0.02 + time: 100 + velocity: + enable: yes + max: 0.6 + time: + trajectory: 100 + drive: 100 + +plc: + enable: true + externalCommands: true + filter: + velocity: + enable: false + size: 10 + trajectory: + enable: false + size: 10 diff --git a/examples/PSI/lab_setup/master_slave/slit/common/axis_vax6_YGAP.yaml b/examples/PSI/lab_setup/master_slave/slit/common/axis_vax6_YGAP.yaml new file mode 100644 index 000000000..82c2545f6 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/common/axis_vax6_YGAP.yaml @@ -0,0 +1,65 @@ +axis: + id: ${AX_ID} + group: virtualAxes + type: end effector + +epics: + name: GAPY + precision: 4 + unit: mm + motorRecord: + description: "Gap (Virtual)" + fieldInit: "SPAM=0,RTRY=1,FOFF=Frozen,TWV=1" + +encoder: + type: 1 + source: 1 + numerator: 1 + bits: 32 + +trajectory: + axis: + velocity: 0.5 + acceleration: 0.25 + jerk: 0.25 + +input: + limit: + forward: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + backward: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + home: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + interlock: ec${M_ID=0}.s${DRV_SLAVE}.ONE.0 # unused + +softlimits: + enable: false + forwardEnable: true + backwardEnable: true + forward: 20 + backward: -20 + +monitoring: + lag: + enable: yes + tolerance: 0.02 + time: 100 + target: + enable: yes + tolerance: 0.02 + time: 100 + velocity: + enable: yes + max: 0.6 + time: + trajectory: 100 + drive: 100 + +plc: + enable: true + externalCommands: true + filter: + velocity: + enable: false + size: 10 + trajectory: + enable: false + size: 10 diff --git a/examples/PSI/lab_setup/master_slave/slit/common/cfgHW_and_motion_local.cmd b/examples/PSI/lab_setup/master_slave/slit/common/cfgHW_and_motion_local.cmd new file mode 100644 index 000000000..a24c1378e --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/common/cfgHW_and_motion_local.cmd @@ -0,0 +1,18 @@ + + +# 0:7 - EL7031 1Ch Stepper +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=12,HW_DESC=EL7031" +${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1000, I_STDBY_MA=500, U_NOM_MV=24000, R_COIL_MOHM=1230'" +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=../common/axis_ax6_HI.yaml, DRV_SLAVE=${ECMC_EC_SLAVE_NUM}, ENC_SLAVE=${ECMC_EC_SLAVE_NUM}, ENC_CHANNEL=01,M_ID=${ECMC_EC_MASTER_ID}" + + +# 0:7 - EL7041 1Ch Stepper +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=14,HW_DESC=EL7041-0052" +${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1000, I_STDBY_MA=500, U_NOM_MV=48000, R_COIL_MOHM=1230'" +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=../common/axis_ax5_LO.yaml, DRV_SLAVE=${ECMC_EC_SLAVE_NUM}, ENC_SLAVE=${ECMC_EC_SLAVE_NUM}, ENC_CHANNEL=01,M_ID=${ECMC_EC_MASTER_ID}" + +#- ################################################################# +#- Virtual axes +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=../common/axis_vax5_YCEN.yaml, AX_ID=${AX_NUM=12},M_ID=${ECMC_EC_MASTER_ID},DRV_SLAVE=${ECMC_EC_SLAVE_NUM}" +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=../common/axis_vax6_YGAP.yaml, AX_ID=${AX_NUM=13},M_ID=${ECMC_EC_MASTER_ID},DRV_SLAVE=${ECMC_EC_SLAVE_NUM}" + diff --git a/examples/PSI/lab_setup/master_slave/slit/readme.md b/examples/PSI/lab_setup/master_slave/slit/readme.md new file mode 100644 index 000000000..00fc32d31 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/readme.md @@ -0,0 +1,7 @@ +## Panel +``` +caqtdm -macro "IOC=c6025a" ecmcMain.ui +``` + +## TODO +Test with motor record. diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/EPICSVERSION b/examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/EPICSVERSION new file mode 100644 index 000000000..2f2974f9b --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/EPICSVERSION @@ -0,0 +1 @@ +7.0.7 diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/axis_main.plc b/examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/axis_main.plc new file mode 100755 index 000000000..b241a077a --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_equations/cfg/axis_main.plc @@ -0,0 +1,8 @@ + +####### Kinematics for slit system. +# Macros cannot be used in an include. In order to find files, the loadPLCFile.cmd parameter "INC" defines the dirs that MSI will look for the file) +include "axis_kin_slit.plc_inc" + +####### State machine +# Macros cannot be used in an include. In order to find files, the loadPLCFile.cmd parameter "INC" defines the dirs that MSI will look for the file) +include "axis_sm.plc_inc" diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script b/examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script new file mode 100644 index 000000000..4c54d46a7 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script @@ -0,0 +1,11 @@ +# The following lines were generated by "ioc install" +# Generated at: 2024-08-07 16:32:41.171272 + +epicsEnvSet IOC c6025a +epicsEnvSet ENGINEER sandst_a +< /ioc/startup/startup.script_linux + +# ---- ioc/system specific startup script(s) +< startup.script_ecmc_local_hw + +iocInit diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script_ecmc_local_hw b/examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script_ecmc_local_hw new file mode 100644 index 000000000..49b111593 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_equations/startup.script_ecmc_local_hw @@ -0,0 +1,19 @@ + +#- Configuration scripts +require ecmccfg v10.0.0_RC1,"MASTER_ID=1,ENG_MODE=1,EC_RATE=100,ECMC_VER=v10.0.0_RC1" + +#- Only output errors +asynSetTraceMask(${ECMC_ASYN_PORT}, -1, 0x01) + +#- ################################################################# +# Configure Hardware and Motion +< ../common/cfgHW_and_motion_local.cmd + +#- ################################################################# +#- PLCs with inverse kinematics (note the INC var including dirs to search for include files) +#- The group ID:s configured in yaml are stored in GRP__ID +${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/axis_main.plc, PLC_ID=1, INC=.:${ecmccfg_DIR}, PLC_MACROS='PLC_ID=1, AX_CEN=12, AX_GAP=13, AX_LO=5, AX_HI=6, GRP_ID_SA=${GRP_realAxes_ID}, GRP_ID_MA=${GRP_virtualAxes_ID}'" + +#- ############################################################################# +#- reset all errors +afterInit("ecmcConfigOrDie 'ControllerErrorReset()'") diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/EPICSVERSION b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/EPICSVERSION new file mode 100644 index 000000000..2f2974f9b --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/EPICSVERSION @@ -0,0 +1 @@ +7.0.7 diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/axis_main.plc b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/axis_main.plc new file mode 100644 index 000000000..74d1c3aa4 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/cfg/axis_main.plc @@ -0,0 +1,31 @@ +/* Forward kinematics to calculate virtual axes from real axes + | CEN | = FWD * | S1_LO | + | GAP | | S2_HI | + + Equations: + ax{AX_CEN}.enc.actpos:=(ax{AX_LO}.enc.actpos+ax{AX_HI}.enc.actpos)/2; + ax{AX_GAP}.enc.actpos:=ax{AX_HI}.enc.actpos-ax{AX_LO}.enc.actpos; +*/ + +var FWD1[2] := {0.5, 0.5}; +var FWD2[2] := { -1, 1 }; + +/* Inverse kinematics to calculate real axes from virtal axes + | S1_LO | = INV * | CEN | + | S2_HI | | GAP | + + Equations: + ax{AX_LO}.traj.extsetpos:=ax{AX_CEN}.traj.setpos-ax{AX_GAP}.traj.setpos/2; + ax{AX_HI}.traj.extsetpos:=ax{AX_CEN}.traj.setpos+ax{AX_GAP}.traj.setpos/2; +*/ + +var INV1[2] := { 1, -0.5}; +var INV2[2] := { 1, 0.5}; + +####### Kinematics for slit system. +# Macros cannot be used in an include. In order to find files, the loadPLCFile.cmd parameter "INC" defines the dirs that MSI will look for the file) +include "axis_kin_2DoF.plc_inc" + +####### State machine +# Macros cannot be used in an include. In order to find files, the loadPLCFile.cmd parameter "INC" defines the dirs that MSI will look for the file) +include "axis_sm.plc_inc" diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script new file mode 100644 index 000000000..4c54d46a7 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script @@ -0,0 +1,11 @@ +# The following lines were generated by "ioc install" +# Generated at: 2024-08-07 16:32:41.171272 + +epicsEnvSet IOC c6025a +epicsEnvSet ENGINEER sandst_a +< /ioc/startup/startup.script_linux + +# ---- ioc/system specific startup script(s) +< startup.script_ecmc_local_hw + +iocInit diff --git a/examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script_ecmc_local_hw b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script_ecmc_local_hw new file mode 100644 index 000000000..622bc15c5 --- /dev/null +++ b/examples/PSI/lab_setup/master_slave/slit/slit_matrix/startup.script_ecmc_local_hw @@ -0,0 +1,19 @@ +#- Configuration scripts +require ecmccfg sandst_a,"MASTER_ID=1,ENG_MODE=1,EC_RATE=100,ECMC_VER=v10.0.0_RC1" + +#- Only output errors +asynSetTraceMask(${ECMC_ASYN_PORT}, -1, 0x01) + +#- ################################################################# +# Configure Hardware and Motion +< ../common/cfgHW_and_motion_local.cmd + +#- ################################################################# +#- PLCs with kinematics (note the INC var including dirs to search for include files) +#- The group ID:s configured in yaml are stored in GRP__ID +${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/axis_main.plc, PLC_ID=1, INC=.:${ecmccfg_DIR}, PLC_MACROS='PLC_ID=1, AX_M1=12, AX_M2=13, AX_S1=5, AX_S2=6, GRP_ID_SA=${GRP_realAxes_ID}, GRP_ID_MA=${GRP_virtualAxes_ID}'" + +#- ############################################################################# +#- reset all errors +afterInit("ecmcConfigOrDie 'ControllerErrorReset()'") + diff --git a/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_lookup.cmd b/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_lookup.cmd index 2b0bb8eca..6de6f6bea 100644 --- a/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_lookup.cmd +++ b/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_lookup.cmd @@ -1,7 +1,7 @@ ############################################################################## ## Example config for EL7041 and EL5042 -require ecmccfg "ENG_MODE=1,MASTER_ID=1" +require ecmccfg "ECMC_VER=sandst_a,ENG_MODE=1,MASTER_ID=1" # 0:7 - EL7041 1Ch Stepper ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=14,HW_DESC=EL7041-0052" @@ -17,6 +17,3 @@ epicsEnvSet(ENC_SID,${ECMC_EC_SLAVE_NUM}) ${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis_lookup.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${DRV_SID}, ENC_SID=${ENC_SID}, ENC_CH=01" ${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_open_loop.yaml, DEV=${IOC}, ENC_SID=${DRV_SID}" ${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_RLS_lookup.yaml, DEV=${IOC}, ENC_SID=${ENC_SID}" - -epicsEnvSet(ECMC_PLUGIN_CONFIG,"PLUGIN_ID=1,AX=1,BUFF_SIZE=2000,DBG=0,ENA=1") -require ecmc_plugin_motion "${ECMC_PLUGIN_CONFIG}" diff --git a/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_plugin.cmd b/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_plugin.cmd new file mode 100644 index 000000000..11a5ee0ba --- /dev/null +++ b/examples/PSI/lab_setup/stepper_bissc/startup_local_hw_plugin.cmd @@ -0,0 +1,43 @@ +############################################################################## +## Example config for EL7041 and EL5042 + +require ecmccfg v10.0.0_RC1 "ECMC_VER=v10.0.0_RC1,ENG_MODE=1,MASTER_ID=1" + +# 0:7 - EL7041 1Ch Stepper +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=14,HW_DESC=EL7041-0052" +${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1500, I_STDBY_MA=100, U_NOM_MV=48000, R_COIL_MOHM=1230'" +epicsEnvSet(DRV_SID,${ECMC_EC_SLAVE_NUM}) + +# 0:2 - EL5042 2Ch BiSS-C Encoder, RLS-LA11 +${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=9,HW_DESC=EL5042" +${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1" +${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=2" +epicsEnvSet(ENC_SID,${ECMC_EC_SLAVE_NUM}) + +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis_lookup.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${DRV_SID}, ENC_SID=${ENC_SID}, ENC_CH=01" +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_open_loop.yaml, DEV=${IOC}, ENC_SID=${DRV_SID}" +${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_RLS_lookup.yaml, DEV=${IOC}, ENC_SID=${ENC_SID}" +# +epicsEnvSet(ECMC_PLUGIN_CONFIG,"PLUGIN_ID=1,AX=1,BUFF_SIZE=2000,DBG=0,ENA=1") +require ecmc_plugin_motion sandst_a "${ECMC_PLUGIN_CONFIG}" + +#-############################################################################# +#-# Load safety plugin +#- +require ecmc_plugin_safety sandst_a +## Create SS1 group +##- EC_RAMP_DOWN_CMD : EtherCAT entry for ramp down command, input to ecmc (command from safety PLC/system) +##- EC_REST_STAT : EtherCAT entry for signaling that all axes in group are at rest, output from ecmc (feedback to safety PLC/system) +##- EC_RED_VEL_CMD : EtherCAT entry for reducing velocity, input to ecmc (command from safety PLC/system) +##- DELAY_MS : Time between ramp-down command and STO +epicsEnvSet(RAMP_DOWN_CMD,"ec${ECMC_EC_MASTER_ID}.s${ENC_SID}.ONE.0") +epicsEnvSet(REST_STAT,"ec${ECMC_EC_MASTER_ID}.s${ENC_SID}.ONE.1") +epicsEnvSet(RED_VEL_CMD,"ec${ECMC_EC_MASTER_ID}.s${ENC_SID}.ONE.2") +epicsEnvSet(SAFETY_TIMEOUT,500) +${SCRIPTEXEC} ${ecmc_plugin_safety_DIR}addSS1Group.cmd "NAME=first,EC_RAMP_DOWN_CMD=${RAMP_DOWN_CMD},EC_REST_STAT=${REST_STAT},EC_RED_VEL_CMD=${RED_VEL_CMD=empty},DELAY_MS=${SAFETY_TIMEOUT}" + +#- Add axis +#- AX_ID : Axis ID +#- VELO_REST_LIM : Velocity at rest limit [unit same as EGU of axis] +#- VELO_MAX_LIM : Velocity maximum limit, -1 to disable [unit same as EGU of axis] +${SCRIPTEXEC} ${ecmc_plugin_safety_DIR}addAxisToSafetyGroup.cmd "NAME=first,AX_ID=1,VELO_REST_LIM=1,VELO_MAX_LIM=100"