diff --git a/404.html b/404.html index af2859ed9..fd88b2c44 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -
Woops. Looks like this page doesn't exist ¯\_(ツ)_/¯.
Go to homepage
Built with from Grav and Hugo
A configuration framework for ECMC Motion Control Module for EPICS.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -10,4 +10,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
This is the respective plc file
ax${AXIS_NO}.enc.actpos:=(ax{{ var.ty1 }}.enc.actpos+ax{{ var.ty2 }}.enc.actpos)/2;
Note the mixed use to MACROs ${AXIS_NO} and local variables {{ var.ty1 }} to boost flexibility.
${AXIS_NO}
{{ var.ty1 }}
This will affect the motorRecord only, thus ECMC internally is still moving in the wrong direction. You have been warned!
From v8+ yaml files are linted for syntactic errors, observe the iocsh for warnings and errors. Additionally the schema of the yaml file is checked by Cerberus. This check will point out errors in the structure of the configuration as well as certain type errors.
numerator
type: 0
uint16
bits: 16
check the module loads for version dev, Epics R7+ and ECMC version dev, note MASTER_ID=-1 which runs ECMC in master-less mode. Make proper adjustments to match your needs in terms of versions.
dev
R7+
MASTER_ID=-1
iocsh -7 -r "ecmccfg,dev 'ECMC_VER=dev,MASTER_ID=-1'"
file
code
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}loadYamlPlc.cmd" "FILE=./plc1File.yaml, ECMC_TMPDIR=/tmp/"
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd
iocsh call
iocsh
ethercat download
With this command the value of a register can be set on the slave.
If the type is not explicitly given, first issue ethercat -p <slaveID> sdos. This will allow implicit type handling.
type
ethercat -p <slaveID> sdos
Example: Set value of register 0x8010, sub-register 0x07 from slave 7 to 314.
0x8010
0x07
7
314
ethercat download -m0 -p7 0x8010 0x07 314
ethercat states
With this command a specific state of a slave can be forced, or at least an attempt to enter the specific state is made.
This is helpful when a slave is stuck, e.g. with an error. Rather than cycle the power of the entire controller, the slave can be set to ‘REBOOT’. This might be enough to recover.
Alternatively, cycling to ‘INIT’ and back to ‘OP’ might also be attempted.
A power cycling of the of the EtherCAT components is the last resort!
Due to the complexity an EtherCAT bus topology can assume, troubleshooting can be challenging. This guide should provide the basic means to diagnose simple errors and is by no means complete!
A very powerful tool is provided through the command line. See a summary, incl. some examples of what possible here.
For motion related issues, a very short troubleshooting guide is provided here.
red
Blindly restarting the IOC, with only partially working EtherCAT hardware, WILL RESULT IN TOTAL FAILURE OF THE IOC!!!
Check the hardware BEFORE restarting the IOC!
This procedure is for experst only. You run the risk of destroying expansive devices! Limit switches are not obeyed! YOU HAVE BEEN WARNED!
For this however, the IOC needs to be reconfigured to not link the hardware to an axis!
dbgrep "*s007*"
-Drv01-Cmd
-Drv01-Spd
1
Anders Sandstroem
Niko Kivel, Anders Sandstroem
Script for adding axis related EPICS PVs.
Adds motorRecord to the IOC.
This script is typically called by \b addAxis.cmd
Script for configuring a physical axis.
Configures a physical axis in ECMC, based on previously set environment variables.
This script is typically called by \b addAxis.cmd, often via \b ecmc_axis-records.cmd
Script for adding axis diagnostic EPICS PVs.
Adds diagnostic PVs to the IOC.
This script is typically called by \b ecmc_axis.cmd, often via \b ecmc_axis-records.cmd
Script for configuring axis synchronization
Configures ECMC for axis synchronization, based on previously set environment variables.
This script is typically called by \b applyAxisSynchronization.cmd
Script for adding an extra encoder
Configures a encoder object in ECMC, based on previously set environment variables.
This script is typically called by \b addEncoder.cmd
This script is typically called by \b addVirtualAxis.cmd
Script for configuring a virtual axis.
Configures a virtual axis in ECMC, based on previously set environment variables.
This script is typically called by \b addVirtualAxis.cmd, often via \b ecmc_virt_axis-records.cmd
Script for defining ${ECMC_PREFIX}
Gathers relevant information about MasterID, SlaveID, … to create naming convention compliant PREFIX
Niko Kivel
Script for defining ${ECMC_P}
Script for adding dataStorage.
Adds dataStorage buffer.
DS_SIZE Size of data buffer.DS_ID (optional), default 0, buffer IDDS_TYPE (optional), default 0, 0: Normal Buffer, 1: Ring Buffer, 2: FIFO BufferSAMPLE_RATE_MS (optional), default 1DS_DEBUG (optional), default 0, 0: No debug printouts, 1: Debug printouts
Example calls:
${SCRIPTEXEC} ${ecmccfg_DIR}addDataStorage.cmd "DS_ID=1, DS_SIZE=1000, SAMPLE_RATE_MS=100"
Anders Sandström
EXE_RATE (optional) Execution rate [cycles] defaults 0 (same EC_RATE)EXE_OFFSET (optional) Execution offset cycles [cycles] defaults 0ALLOW_OFFLINE (optional) Allow domain to be offline defaults 0
All EtherCAT entries generated after this command will be assigned
Script for adding an axis with configuration.
Adds an axis to the configuration and applies parameters provided by CONFIG.
CONFIG configuration file, i.e. ./cfg/axis_1_enc_2.encDEV (optional) device name, i.e. MOTOR1CLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if vars needed for later use).CFG_MACROS (optional) Substitution macros for config file
Example call:
${SCRIPTEXEC} ${ecmccfg_DIR}addEncoder.cmd, "CONFIG=./cfg/linear_1_enc_3.enc"
MASTER_ID (optional) master ID as shown by ethercat master.
ethercat master
${SCRIPTEXEC} ${ecmccfg_DIR}addMaster.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}addMaster.cmd, "MASTER_ID=3"
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL1018, SLAVE_ID=1, P_SCRIPT=mXsXXX"
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL3204, DEFAULT_SUBS=false, DEFAULT_SLAVE_PVS=true"
Script for adding a slave to the EtherCAT bus configuration of KL type.
Adds the respective hardware to the bus configuration, adds specific and default PV to the EPICS database. For some/most slaves also a default
Anders Sandstrom
HW_DESC Hardware descriptor, i.e. KL2032SLAVE_ID EtherCAT bus position of the BK1250 (or similar terminal)SLAVE_ID_KL KL-Bus index in two digit hex starting at zero for the first slave after BK1250 (or similar terminal)SUBST_FILE (optional) substitution file
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "HW_DESC=EL1018, SLAVE_ID=1, SLAVE_ID_KL=0A"
Script for applying axis synchronization
Adds synchronization parameters to an axis provided by CONFIG.
CONFIG configuration file, i.e. ./cfg/linear_1.saxCLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if needed vars for later use).
${SCRIPTEXEC} ${ecmccfg_DIR}applyAxisSynchronization.cmd, "CONFIG=./cfg/linear_1.sax"
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cfg
Example call:call applySlaveConfig with CONFIG
${SCRIPTEXEC} ${ecmccfg_DIR}applySlaveConfig.cmd, "CONFIG=-Motor-Nanotec-ST4118L1804-B"
call applySlaveConfig with LOCAL_CONFIG
${SCRIPTEXEC} ${ecmccfg_DIR}applySlaveConfig.cmd, "LOCAL_CONFIG=./myFancyServoConfig.cfg"
Script for applying substitution file
Applies substitution from ${SUBST_FILE} with ${P_SCRIPT}
SUBST_FILE (optional) substitution fileECMC_P PV prefixP_SCRIPT (optional) naming convention prefix scriptNELM (optional) Used for oversampling cards. Defaults to 1
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}applySubstitutions.cmd" "SUBST_FILE=${SUBST_FILE=ecmc${ECMC_EC_HWTYPE}.substitutions},ECMC_P=${ECMC_P}"
Script for applying a template
Applies template from ${TEMPLATE_FILE} with ${P_SCRIPT}, PARAMS can be passed
TEMPLATE_FILE template fileECMC_P PV prefixPARAMS (optional) additional parameters
${SCRIPTEXEC} "${ECMC_CONFIG_ROOT}applyTemplate.cmd" "TEMPLATE_FILE=ecmcEcSlave.template,ECMC_P=${ECMC_P}"
CONFIG configuration file, i.e. ./cfg/linear_1.paxDEV (optional) device name, i.e. MOTOR1CLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if vars needed for later use).CFG_MACROS (optional) Substitution macros for config file
${SCRIPTEXEC} ${ecmccfg_DIR}configureAxis.cmd, "CONFIG=./cfg/linear_1.pax"
Script for adding a slave with dedicated slave configuration to the EtherCAT bus configuration.
Adds the respective hardware to the bus configuration, adds specific and default PV to the EPICS database. Applies a specific slave configuration.
HW_DESC Hardware descriptor, i.e. EL7037CONFIG configuration file, i.e. -Motor-Nanotec-ST4118L1804-B
The CONFIG together with the HW_DESC form the full filename which by definition is ecmc${HW_DESC}${CONFIG}.cmd, i.e.: ecmcEL7037-Motor-Nanotec-ST4118L1804-B.cmd
SLAVE_ID (optional) bus positionCFG_MACROS (optional) Substitution macros for config fileNELM (optional) Used for oversampling cards. Defaults to 1
${SCRIPTEXEC} ${ecmccfg_DIR}configureSlave.cmd, "HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B"
${SCRIPTEXEC} ${ecmccfg_DIR}configureSlave.cmd, "HW_DESC=EL7037, CONFIG=-Motor-Nanotec-ST4118L1804-B, SLAVE_ID=8"
Script for adding a virtual axis with configuration.
Adds a virtual axis to the configuration and applies parameters provided by CONFIG.
CONFIG configuration file, i.e. ./cfg/linear_11.vaxDEV (optional) device name, i.e. GAPCLEAR_VARS_CMD (optional) Set to “empty” for not clear env vars (if needed vars for later use).
${SCRIPTEXEC} ${ecmccfg_DIR}configureVirtualAxis.cmd, "CONFIG=./cfg/linear_11.vax"
Script for loading Axis from yaml file via jinja2
jinja2
adds an Axis, based on a yaml config file
Niko Kivel, Anders Sandström
FILE the yaml-file containing the PLC definitionDEV the device name (optional, defaults to ${IOC}
${SCRIPTEXEC} "./loadYamlAxis.cmd" "FILE=./axis1.yaml" ${SCRIPTEXEC} "./loadYamlAxis.cmd" "FILE=./axis1.yaml, DEV=foobar"
Script for adding Encoder from yaml file via jinja2
${SCRIPTEXEC} "./loadYamlEnc.cmd" "FILE=./enc.yaml" ${SCRIPTEXEC} "./loadYamlEnc.cmd" "FILE=./enc.yaml, DEV=foobar"
Script for loading PLC from yaml file via jinja2
adds a PLC, line by line, from a yaml-file, parsed by jinja2
FILE the yaml-file containing the PLC definition
${SCRIPTEXEC} "./loadYamlPlc.cmd" "FILE=./plc1.yaml"
Script for adding a PLC from file.
Adds a PLC defined in FILE. Also adds PLC specific EPICS PVs, i.e. for enable/disable.
FILE PLC definition file, i.e. ./plc/homeSlit.plcAX_ID (optional) Ax number, default 0PLC_MACROS (optional) Substitution macros for PLC codeTMP_PATH (optional) directory to dump the temporary plc file after macro substitutionPRINT_PLC_FILE (optional) 1/0, printout msi parsed plc file (default enable(1)).SUBST_FILE (optional) custom substitution file otherwise ecmccfg default will be loaded
${SCRIPTEXEC} ${ecmccfg_DIR}loadAxisPLCFile.cmd, "AX_ID=1, FILE=./plc/homeSlit.plc"
FILE PLC definition file, i.e. ./plc/homeSlit.plcPLC_ID (optional) PLC number, default 0SAMPLE_RATE_MS (optional) excecution rate, default 1000/EC_RATEPLC_MACROS (optional) Substitution macros for PLC codeTMP_PATH (optional) directory to dump the temporary plc file after macro substitutionPRINT_PLC_FILE (optional) 1/0, printout msi parsed plc file (default enable(1)).SUBST_FILE (optional) custom substitution file otherwise ecmccfg default will be loaded
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "PLC_ID=0, FILE=./plc/homeSlit.plc, SAMPLE_RATE_MS=100"
FILE Filename of plugin shared lib (./ecmcPlugin_Advanced.so)PLUGIN_ID Id of plugin to loadCONFIG (optional) Configuration string sent to plugin at constructREPORT (optional) Printout information of loaded plugin if set to “1”
${SCRIPTEXEC} ${ecmccfg_DIR}loadPlugin.cmd, "PLUGIN_ID=0,FILE=./ecmcPlugin_Advanced.so,CONFIG='PLUGIN CONFIGS GO HERE '
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstAxes.cmd, "FILE=./ax.subs"
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstConfig.cmd, "FILE=./cfg.subs"
${SCRIPTEXEC} ${ecmccfg_DIR}loadSubstHw.cmd, "FILE=./hw.subs"
** script for slave verification and optional reset**
will verify the slave identity and reset by writing to 0x1011, optionally read firmwre version from 0x100a
Macros