Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
anderssandstrom committed Nov 26, 2024
1 parent ffedee9 commit b7d2258
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 79 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

epicsEnvSet("MASTER_ID", "0")

require ecmccfg v9.5.5_RC1,"ENG_MODE=1,ECMC_VER=v9.5.5_RC1"
require ecmccfg "ENG_MODE=1"
require ecmccomp
require ecmc_master_slave sandst_a

#- #################################################################
# only print error messages
asynSetTraceMask(${ECMC_ASYN_PORT}, -1, 0x01)


##############################################################################
# - apply hardware configuration
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstConfig.cmd, "FILE=cfg/hw.subst"
Expand Down Expand Up @@ -69,15 +68,6 @@ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadPLCFile.cmd, "FILE=cfg/VFM.plc,PLC_ID=1,INC
#- Temporary test
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=cfg/ax_Servo_angle.yaml, DRV_SLAVE=021"

#- #################################################################
#- apply the configuration
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}applyConfig.cmd


#- #################################################################
#- go active
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}setAppMode.cmd

require "calc"
require "opticaltable","wang_x1"
# The following lines were generated by "ioc install"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL1008"

# 0:7 - EL7041 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"
${SCRIPTEXEC} ${ecmccomp_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}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"

# 0:8 - EL7041 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"
${SCRIPTEXEC} ${ecmccomp_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}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_ax6_HI.yaml, DRV_SLAVE=${ECMC_EC_SLAVE_NUM}, ENC_SLAVE=${ECMC_EC_SLAVE_NUM}, ENC_CHANNEL=01"

# 0:9 - EL7041 1Ch Stepper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#- Configuration scripts
require ecmccfg,"ENG_MODE=1,EC_RATE=100"

#- Components lib
require ecmccomp

#- Syncronization configs
require ecmc_master_slave

Expand All @@ -20,11 +17,6 @@ asynSetTraceMask(${ECMC_ASYN_PORT}, -1, 0x01)
#- The group ID:s configured in yaml are stored in GRP_<axis.group>_ID
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/axis_main.plc, PLC_ID=1, INC=.:${ecmc_master_slave_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}'"

#- #################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd

#- #############################################################################
#- reset all errors
afterInit("ecmcConfigOrDie 'ControllerErrorReset()'")
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#- Configuration scripts
require ecmccfg,"ENG_MODE=1,EC_RATE=100"

#- Components lib
require ecmccomp

#- Syncronization configs
require ecmc_master_slave

Expand All @@ -19,11 +16,6 @@ asynSetTraceMask(${ECMC_ASYN_PORT}, -1, 0x01)
#- The group ID:s configured in yaml are stored in GRP_<axis.group>_ID
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/axis_main.plc, PLC_ID=1, INC=.:${ecmc_master_slave_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}'"

#- #################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd

#- #############################################################################
#- reset all errors
afterInit("ecmcConfigOrDie 'ControllerErrorReset()'")
7 changes: 1 addition & 6 deletions examples/PSI/best_practice/motion/servo/startup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
## Example config for ep7211-0034

require ecmccfg "ENG_MODE=1"
require ecmccomp

#- ############################################################################
#- Configure hardware
Expand All @@ -14,10 +13,6 @@ require ecmccomp

${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=15, HW_DESC=EP7211-0034_ALL_FB"
#- Limit torque to 50% of motor rated torque. Rated current = 2710mA, set to half I_MAX_MA=1355
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Beckhoff-AM8111-XFX0, MACROS='I_MAX_MA=1355'"
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-Beckhoff-AM8111-XFX0, MACROS='I_MAX_MA=1355'"
$(SCRIPTEXEC) $(ecmccfg_DIR)loadYamlAxis.cmd "FILE=./cfg/axis.yaml, DRV_ID=$(ECMC_EC_SLAVE_NUM), AX_NAME='Axis1', AX_ID=1"

#- ############################################################################
#- Go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd
12 changes: 3 additions & 9 deletions examples/PSI/best_practice/motion/stepper_bissc/startup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
## Example config for EL7041 and EL5042

require ecmccfg "ENG_MODE=1"
require ecmccomp

#- ############################################################################
#- Master0
Expand All @@ -18,7 +17,6 @@ require ecmccomp
#- 9 0:9 PREOP + EL7041 1Ch. Stepper motor output stage (50V, 5A)
#- 10 0:10 PREOP + EL7041 1Ch. Stepper motor output stage (50V, 5A)


# 0:0 - EK1100 EtherCAT coupler
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EK1100"

Expand All @@ -27,8 +25,8 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL9227-5500"

# 0:2 - EL5042 2Ch BiSS-C Encoder, RLS-LA11
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL5042"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=2"
${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})

# 0:3 - EL5042 2Ch BiSS-C Encoder
Expand All @@ -46,7 +44,7 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL1008"

# 0:7 - EL7041 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"
${SCRIPTEXEC} ${ecmccomp_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}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=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${ECMC_EC_SLAVE_NUM}, ENC_SID=${ENC_SID}, ENC_CH=01, BO_SID=${BO_SID}, BO_CH=01"
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_open_loop.yaml, DEV=${IOC}, DRV_SID=${ECMC_EC_SLAVE_NUM}"

Expand All @@ -59,7 +57,3 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"
# 0:10 - EL7041 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"

#- ###########################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
##############################################################################
## Example config for EL7041 and EL5042

require ecmccfg "ENG_MODE=1"
require ecmccomp
require ecmccfg "ENG_MODE=1,MASTER_ID=1"

# 0:7 - EL7041 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=13,HW_DESC=EL7041-0052"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1500, I_STDBY_MA=1000, U_NOM_MV=48000, R_COIL_MOHM=1230'"
${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=1000, 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=14,HW_DESC=EL5042"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=2"
${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.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}, DRV_SID=${DRV_SID}"

#- ###########################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstConfig.cmd, "FILE=cfg/hw.subs"
# - motion
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=7, ENC_SID=2, ENC_CH=01, BO_SID=5, BO_CH=01"
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_open_loop.yaml, DEV=${IOC}, DRV_SID=7"

#- ###########################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
## Example config for EL7041 and EL5042

require ecmccfg "MODE=NO_MR,ENG_MODE=1,EC_RATE=100"
require ecmccomp

#- ############################################################################
#- Master0
Expand All @@ -18,7 +17,6 @@ require ecmccomp
#- 9 0:9 PREOP + EL7041 1Ch. Stepper motor output stage (50V, 5A)
#- 10 0:10 PREOP + EL7041 1Ch. Stepper motor output stage (50V, 5A)


# 0:0 - EK1100 EtherCAT coupler
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EK1100"

Expand Down Expand Up @@ -58,8 +56,3 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"

# 0:10 - EL7041 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL7041-0052"

#- ###########################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd
5 changes: 0 additions & 5 deletions examples/PSI/best_practice/plcs/startup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,3 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=10, HW_DESC=EL2819"
#- Load PLC (note the include dir (INC) and the use of ECMC_EC_SLAVE_NUM)
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=./cfg/main.plc, INC=.:./cfg/, DESC='Toggle bits', SAMPLE_RATE_MS=1000, PLC_MACROS='BO_S_ID=${ECMC_EC_SLAVE_NUM}'"

#- ############################################################################
#- Go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd

11 changes: 5 additions & 6 deletions examples/test/el7411/el7411_qmot.script
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
## Example config for el7411 with Qmot BLDC motor (incremental encoder)
## Note, the encoder needed to be inverted to fit motor rotation (otherwise the motor will act strange, however no real error..)

require ecmccfg "MASTER_ID=1,ENG_MODE=1"
require ecmccomp
require ecmccfg sandst_a "MASTER_ID=1,ENG_MODE=1"

#-#############################################################################
## Configure hardware
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=16, HW_DESC=EL7411"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-QMot-4208-61-04-013-DS, MACROS='I_MAX_MA=2000,VELO_KP=1000,VELO_TI=100,CURR_KP=100,CURR_TI=50'"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-Generic-INC, MACROS='ST_ENC_RES=4096, INV_DIR=1'"
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${ECMC_EC_SLAVE_NUM}"
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd "SLAVE_ID=16, HW_DESC=EL7411"
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-QMot-4208-61-04-013-DS, MACROS='I_MAX_MA=2000,VELO_KP=1000,VELO_TI=100,CURR_KP=100,CURR_TI=50'"
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-Generic-INC, MACROS='ST_ENC_RES=4096, INV_DIR=1'"
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd "FILE=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${ECMC_EC_SLAVE_NUM}"

0 comments on commit b7d2258

Please sign in to comment.