From 5923babd63d47cc1898ba634fb1af05bec3a8046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstr=C3=B6m?= Date: Thu, 15 Feb 2024 16:50:34 +0100 Subject: [PATCH] WIP --- GNUmakefile | 3 ++- iocsh/cfg/axis.yaml | 31 ++++++++++++++++--------------- iocsh/el7042-0052.script | 10 +++++----- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index fde5f30..3a1f7fb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,7 +17,8 @@ OPT_CXXFLAGS_YES = -O3 # dependencies ECmasterECMC_VERSION = v1.1.0 # motorECMC_VERSION = 7.0.7-ESS -ecmc_VERSION = v9.0.1_RC4 +#ecmc_VERSION = v9.0.1_RC4 +ecmc_VERSION = sandst_a ################################################################################ # THIS RELATES TO THE EtherCAT MASTER LIBRARY diff --git a/iocsh/cfg/axis.yaml b/iocsh/cfg/axis.yaml index 9462689..a2526e2 100644 --- a/iocsh/cfg/axis.yaml +++ b/iocsh/cfg/axis.yaml @@ -120,10 +120,10 @@ controller: trajectory: # type: 1 # Default 0 = trapetz, 1 = S-curve (ruckig) axis: - velocity: 100 # Default velo for axis - acceleration: 100 # Default acc for axis - deceleration: 100 # Default dec for axis - # emergencyDeceleration: 0.05 # Deceleration when axis in error state + velocity: 500 # Default velo for axis + acceleration: 200 # Default acc for axis + deceleration: 200 # Default dec for axis + emergencyDeceleration: 500 # Deceleration when axis in error state jerk: 10 # Default jerk for axis jog: velocity: 5 # Default velo fro JOG (motor record) @@ -169,7 +169,8 @@ monitoring: enable: true # Enable position lag monitoring (following error) tolerance: 2 # Allowed tolerance time: 10 # Allowed time outside tolerance target: - enable: false # Enable at target monitoring (needs to be enabled if using motor record) + target: + enable: true # Enable at target monitoring (needs to be enabled if using motor record) tolerance: 0.5 # Allowed tolerance time: 10 # Filter time inside tolerance to be at target velocity: @@ -185,16 +186,16 @@ monitoring: # trajectory: 100 # Time allowed outside max diff velo before system init halt # drive: 200 # Time allowed outside max diff velo before system disables drive -plc: - enable: true # Enable axis plc - externalCommands: true # Allow axis to inputs from PLC - file: ${PLC_PATH}test.plc - code: # Sync code - - "if(static.counter % ${LIMIT} == 0){println('AX PLC: Appended');static.counter:=0;};" # calculate set pos for physical axis - - "if(not(static.plc_code_loaded)) {static.counter:=static.counter+1;};" - - ec0.s$(DRV_SLAVE).ONE > 1; # Enable axis if one of master axes is enabled - - ec0.s$(DRV_SLAVE).ZERO > 1; # calculate set pos for physical axis -# velocity_filter: # Filter used to smother velocity feedforward +#plc: +# enable: true # Enable axis plc +# externalCommands: true # Allow axis to inputs from PLC +# file: ${PLC_PATH}test.plc +# code: # Sync code +# - "if(static.counter % ${LIMIT} == 0){println('AX PLC: Appended');static.counter:=0;};" # calculate set pos for physical axis +# - "if(not(static.plc_code_loaded)) {static.counter:=static.counter+1;};" +# - ec0.s$(DRV_SLAVE).ONE > 1; # Enable axis if one of master axes is enabled +# - ec0.s$(DRV_SLAVE).ZERO > 1; # calculate set pos for physical axis +# velocity_filter: # Filter used to smother velocity feedforward # encoder: # Filter plc enc velo # enable: false # Filter enable # size: 100 # Filter size diff --git a/iocsh/el7042-0052.script b/iocsh/el7042-0052.script index ae3a1e8..27fe6a6 100644 --- a/iocsh/el7042-0052.script +++ b/iocsh/el7042-0052.script @@ -1,11 +1,11 @@ ############################################################################## ## Example config for el7031 -require ecmccfg v9.0.1_RC4,"ECMC_VER=v9.0.1_RC4,ENG_MODE=1" +require ecmccfg v9.0.1_RC4,"ECMC_VER=sandst_a,ENG_MODE=1" epicsEnvSet(IOC,c6025a) # Load components lib -require ecmccomp sandst_a +require ecmccomp ############################################################################## ## Configure hardware @@ -16,7 +16,7 @@ ${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepp epicsEnvSet("ENC_SLAVE", "14") ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=$(ENC_SLAVE), HW_DESC=EL5042" -${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-24bit" +${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-24bit-BISS-C" #Apply hardware configuration ecmcConfigOrDie "Cfg.EcApplyConfig(1)" @@ -31,7 +31,7 @@ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=./cfg/axis.yaml,LIMIT=1 ############################################################################## ## PLC 1 # -${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlPlc.cmd, "FILE=./plc/plc_cfg.yaml,LIMIT=5000,TYPE=1" +#-${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlPlc.cmd, "FILE=./plc/plc_cfg.yaml,LIMIT=5000,TYPE=1" ############################################################################## ## Load safety plugin @@ -40,7 +40,7 @@ ${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlPlc.cmd, "FILE=./plc/plc_cfg.yaml,LIMIT require ecmc_plugin_safety sandst_a "PLUGIN_ID=0" -ecmcAddSafetyGroup("first","ec${ECMC_EC_MASTER_ID}.s${DRV_SLAVE}.ONE.0","ec${ECMC_EC_MASTER_ID}.s${DRV_SLAVE}.ONE.1",500) +ecmcAddSafetyGroup("first","ec${ECMC_EC_MASTER_ID}.s${DRV_SLAVE}.ZERO.0","ec${ECMC_EC_MASTER_ID}.s${DRV_SLAVE}.ZERO.1",500) ecmcAddAxisToSafetyGroup("first",1,1,0) ##############################################################################