From dc354476e4e87710d5623cd70cd6f147a60646f9 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 14 Mar 2024 11:52:39 -0600 Subject: [PATCH 1/6] CSV mode for ELM7231 --- .../ecmcELM7231-0010_CSV.substitutions | 11 +++ .../ELM/ecmcELM7231-0010_CSV.cmd | 71 +++++++++++++++++++ hardware/Beckhoff_7XXX/ecmcEX72XX_CSV.cmd | 29 ++++++++ 3 files changed, 111 insertions(+) create mode 100644 db/Beckhoff_7XXX/ecmcELM7231-0010_CSV.substitutions create mode 100644 hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd diff --git a/db/Beckhoff_7XXX/ecmcELM7231-0010_CSV.substitutions b/db/Beckhoff_7XXX/ecmcELM7231-0010_CSV.substitutions new file mode 100644 index 000000000..d7fc5d734 --- /dev/null +++ b/db/Beckhoff_7XXX/ecmcELM7231-0010_CSV.substitutions @@ -0,0 +1,11 @@ +file "ecmcEL72XX_DRV.template" +{ + pattern {CH_ID} + {01 } +} + +file "ecmcEL72XX_ENC.template" +{ + pattern {CH_ID} + {01 } +} diff --git a/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd new file mode 100644 index 000000000..70d0d457f --- /dev/null +++ b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd @@ -0,0 +1,71 @@ +#-d /** +#-d \brief hardware script for ELM7231-0010 +#-d \details ELM7231-0010 Servo terminal with OCT feedback +#-d \author Niko Kivel +#-d \file +#-d \note SDOS +#-d \param [out] SDO 0x1011:01 --> 1684107116 \b reset +#-d */ + +#- ########################################################### +#- ############ Information: +#- Description: ELM7231-0010 Servo terminal with OCT feedback +#- +#- Note: The sync mode can not be written to in newer firmwares: +#- (0x1C32,0x1,0x1C33,0x1). So then these lines below needs +#- to be removed or commented out. +#- The log will then show error like: +#- EtherCAT ERROR 0-46: SDO download 0x1C32:01 (2 bytes) aborted. +#- EtherCAT ERROR 0-46: SDO abort message 0x06090030: "Value range of parameter exceeded". +#- EtherCAT ERROR 0-46: SDO configuration failed. +#- +#- ########################################################### + +epicsEnvSet("ECMC_EC_HWTYPE" "ELM7231-0010_CSV") +epicsEnvSet("ECMC_EC_VENDOR_ID" "0x2") +epicsEnvSet("ECMC_EC_PRODUCT_ID" "0x502275f9") +epicsEnvSet("ECMC_EC_COMP_TYPE" "EL7231_OCT") + +#- verify slave, including reset +${SCRIPTEXEC} ${ecmccfg_DIR}slaveVerify.cmd "RESET=true" + +#- Activly choose CSV mode +#- AddSdo does not work??? +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x7010,0x3,9,1)" + +#- ############ read electronic nameplate +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x1,1,1)" +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x2,1,1)" +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x3,1,1)" + +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},1,2,0x1610,0x7010,0x01,U16,driveControl01)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},1,2,0x1612,0x7010,0x06,S32,velocitySetpoint01)" + +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,3,0x1a00,0x6000,0x11,U32,positionActual01)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,3,0x1a10,0x6010,0x01,U16,driveStatus01)" + +#- ############ Distributed clocks config: +#- Configure DC clock +#- From TwinCAT: SYNC 0: User defined 62.5 us, SYNC 1: 4000 us <-- I set this to the cycle time below +ecmcEpicsEnvSetCalc("ECMC_TEMP_PERIOD_NANO_SECS",1000/${ECMC_EC_SAMPLE_RATE=1000}*1E6) +ecmcConfigOrDie "Cfg.EcSlaveConfigDC(${ECMC_EC_SLAVE_NUM},0x700,62500,${ECMC_SYNC_0_OFFSET_NS=0},${ECMC_TEMP_PERIOD_NANO_SECS},${ECMC_SYNC_1_OFFSET_NS=0})" + +#- watchdog +${SCRIPTEXEC} ${ecmccfg_DIR}ecmcWatchDog.cmd + +# #- Watchdog +# ecmcEpicsEnvSetCalc("ECMC_TEMP_WHATCHDOG_1",1000/${ECMC_EC_SAMPLE_RATE=1000}*1000) +# ecmcEpicsEnvSetCalc("ECMC_TEMP_WHATCHDOG_2",${ECMC_TEMP_WHATCHDOG_1}*10) +# ecmcConfigOrDie "Cfg.EcSlaveConfigWatchDog(${ECMC_EC_SLAVE_NUM},${ECMC_TEMP_WHATCHDOG_1},${ECMC_TEMP_WHATCHDOG_2})" + +epicsEnvUnset("ECMC_TEMP_PERIOD_NANO_SECS") +# epicsEnvUnset("ECMC_TEMP_WHATCHDOG_1") +# epicsEnvUnset("ECMC_TEMP_WHATCHDOG_2") + +#- Set 4000ms delay of ethercat bus at startup: +#- Somtimes the Ex72xx-xxxx will not report a correct encoder signal when transition from PREOP to OP. This is not reflected in any status word or bit +#- This will result in problems sicne ecmc cannot know if teh value is correct or not after startup. +#- For the drives with problems measurements have been made which concludes that after 2600ms after entering OP the EL72xx will give correct encoder position. +#- For twincat probably this is not an isue since the terminals are not goung from PROP to OP so often. +#- Conclusion: Need to contact Beckhoff. Probably firmware bug. +ecmcConfigOrDie "Cfg.EcSetDelayECOkAtStartup(${ECMC_EC_STARTUP_DELAY=4000})" diff --git a/hardware/Beckhoff_7XXX/ecmcEX72XX_CSV.cmd b/hardware/Beckhoff_7XXX/ecmcEX72XX_CSV.cmd index bcb8461f9..0c21787df 100644 --- a/hardware/Beckhoff_7XXX/ecmcEX72XX_CSV.cmd +++ b/hardware/Beckhoff_7XXX/ecmcEX72XX_CSV.cmd @@ -11,3 +11,32 @@ ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${EC #- For twincat probably this is not an isue since the terminals are not goung from PROP to OP so often. #- Conclusion: Need to contact Beckhoff. Probably firmware bug. ecmcConfigOrDie "Cfg.EcSetDelayECOkAtStartup(${ECMC_EC_STARTUP_DELAY=4000})" + +# ethercat -p22 pdos +# SM0: PhysAddr 0x1000, DefaultSize 256, ControlRegister 0x26, Enable 1 +# SM1: PhysAddr 0x1100, DefaultSize 256, ControlRegister 0x22, Enable 1 + +# SM2: PhysAddr 0x1200, DefaultSize 12, ControlRegister 0x24, Enable 1 +# RxPDO 0x1610 "DRV RxPDO-Map Controlword Ch.1" +# PDO entry 0x7010:01, 16 bit, "Controlword" +# RxPDO 0x1611 "DRV RxPDO-Map Target position Ch.1" +# PDO entry 0x7010:05, 32 bit, "Target position" +# RxPDO 0x1650 "DRV RxPDO-Map Controlword Ch.2" +# PDO entry 0x7110:01, 16 bit, "Controlword" +# RxPDO 0x1651 "DRV RxPDO-Map Target position Ch.2" +# PDO entry 0x7110:05, 32 bit, "Target position" + +# SM3: PhysAddr 0x1600, DefaultSize 20, ControlRegister 0x20, Enable 1 +# TxPDO 0x1a00 "FB TxPDO-Map Position Ch.1" +# PDO entry 0x6000:11, 32 bit, "Position" +# TxPDO 0x1a10 "DRV TxPDO-Map Statusword Ch.1" +# PDO entry 0x6010:01, 16 bit, "Statusword" +# TxPDO 0x1a11 "DRV TxPDO-Map Following error actual value Ch.1" +# PDO entry 0x6010:06, 32 bit, "Following error actual value" + +# TxPDO 0x1a40 "FB TxPDO-Map Position Ch.2" +# PDO entry 0x6100:11, 32 bit, "Position" +# TxPDO 0x1a50 "DRV TxPDO-Map Statusword Ch.2" +# PDO entry 0x6110:01, 16 bit, "Statusword" +# TxPDO 0x1a51 "DRV TxPDO-Map Following error actual value Ch.2" +# PDO entry 0x6110:06, 32 bit, "Following error actual value" From 091c7b6a8ddf3fc69780b7f5a3bcd9c763a5f732 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 14 Mar 2024 12:16:48 -0600 Subject: [PATCH 2/6] AddSdo for nameplate --- .../Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd index 70d0d457f..a3948ff1b 100644 --- a/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd +++ b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd @@ -34,9 +34,9 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}slaveVerify.cmd "RESET=true" ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x7010,0x3,9,1)" #- ############ read electronic nameplate -ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x1,1,1)" -ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x2,1,1)" -ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x3,1,1)" +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x1,1,1)" +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x2,1,1)" +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x3,1,1)" ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},1,2,0x1610,0x7010,0x01,U16,driveControl01)" ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},1,2,0x1612,0x7010,0x06,S32,velocitySetpoint01)" @@ -49,20 +49,12 @@ ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${EC #- From TwinCAT: SYNC 0: User defined 62.5 us, SYNC 1: 4000 us <-- I set this to the cycle time below ecmcEpicsEnvSetCalc("ECMC_TEMP_PERIOD_NANO_SECS",1000/${ECMC_EC_SAMPLE_RATE=1000}*1E6) ecmcConfigOrDie "Cfg.EcSlaveConfigDC(${ECMC_EC_SLAVE_NUM},0x700,62500,${ECMC_SYNC_0_OFFSET_NS=0},${ECMC_TEMP_PERIOD_NANO_SECS},${ECMC_SYNC_1_OFFSET_NS=0})" +epicsEnvUnset("ECMC_TEMP_PERIOD_NANO_SECS") #- watchdog ${SCRIPTEXEC} ${ecmccfg_DIR}ecmcWatchDog.cmd -# #- Watchdog -# ecmcEpicsEnvSetCalc("ECMC_TEMP_WHATCHDOG_1",1000/${ECMC_EC_SAMPLE_RATE=1000}*1000) -# ecmcEpicsEnvSetCalc("ECMC_TEMP_WHATCHDOG_2",${ECMC_TEMP_WHATCHDOG_1}*10) -# ecmcConfigOrDie "Cfg.EcSlaveConfigWatchDog(${ECMC_EC_SLAVE_NUM},${ECMC_TEMP_WHATCHDOG_1},${ECMC_TEMP_WHATCHDOG_2})" - -epicsEnvUnset("ECMC_TEMP_PERIOD_NANO_SECS") -# epicsEnvUnset("ECMC_TEMP_WHATCHDOG_1") -# epicsEnvUnset("ECMC_TEMP_WHATCHDOG_2") - -#- Set 4000ms delay of ethercat bus at startup: +#- Set 4000 ms delay of ethercat bus at startup: #- Somtimes the Ex72xx-xxxx will not report a correct encoder signal when transition from PREOP to OP. This is not reflected in any status word or bit #- This will result in problems sicne ecmc cannot know if teh value is correct or not after startup. #- For the drives with problems measurements have been made which concludes that after 2600ms after entering OP the EL72xx will give correct encoder position. From aa100bbc1664ea28ce95ec02b56d7b243968c269 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 14 Mar 2024 12:48:18 -0600 Subject: [PATCH 3/6] recover from power loss --- hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd index a3948ff1b..b01cee2af 100644 --- a/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd +++ b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd @@ -30,13 +30,12 @@ epicsEnvSet("ECMC_EC_COMP_TYPE" "EL7231_OCT") ${SCRIPTEXEC} ${ecmccfg_DIR}slaveVerify.cmd "RESET=true" #- Activly choose CSV mode -#- AddSdo does not work??? ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x7010,0x3,9,1)" #- ############ read electronic nameplate -ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x1,1,1)" -ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x2,1,1)" -ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x3,1,1)" +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x1,1,1)" +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x2,1,1)" +ecmcConfigOrDie "Cfg.EcWriteSdo(${ECMC_EC_SLAVE_NUM},0x8008,0x3,1,1)" ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},1,2,0x1610,0x7010,0x01,U16,driveControl01)" ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},1,2,0x1612,0x7010,0x06,S32,velocitySetpoint01)" From e1b96a9c9d69a9bd415f8c9cd5547b53b20587b3 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 14 Mar 2024 15:39:03 -0600 Subject: [PATCH 4/6] renaming of CSV --- ...7231-0010_CSV.substitutions => ecmcELM7231-0010.substitutions} | 0 .../ELM/{ecmcELM7231-0010_CSV.cmd => ecmcELM7231-0010.cmd} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename db/Beckhoff_7XXX/{ecmcELM7231-0010_CSV.substitutions => ecmcELM7231-0010.substitutions} (100%) rename hardware/Beckhoff_7XXX/ELM/{ecmcELM7231-0010_CSV.cmd => ecmcELM7231-0010.cmd} (100%) diff --git a/db/Beckhoff_7XXX/ecmcELM7231-0010_CSV.substitutions b/db/Beckhoff_7XXX/ecmcELM7231-0010.substitutions similarity index 100% rename from db/Beckhoff_7XXX/ecmcELM7231-0010_CSV.substitutions rename to db/Beckhoff_7XXX/ecmcELM7231-0010.substitutions diff --git a/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd b/hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010.cmd similarity index 100% rename from hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010_CSV.cmd rename to hardware/Beckhoff_7XXX/ELM/ecmcELM7231-0010.cmd From a64bdbdbe83ad550e885ea4db7a6c635eacb28d8 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 14 Mar 2024 15:39:11 -0600 Subject: [PATCH 5/6] AM8123 --- ...1-0010-Motor-Beckhoff-AM8123-1NH1-0000.cmd | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 hardware/Motors/ecmcELM7231-0010-Motor-Beckhoff-AM8123-1NH1-0000.cmd diff --git a/hardware/Motors/ecmcELM7231-0010-Motor-Beckhoff-AM8123-1NH1-0000.cmd b/hardware/Motors/ecmcELM7231-0010-Motor-Beckhoff-AM8123-1NH1-0000.cmd new file mode 100644 index 000000000..f4e00c6e2 --- /dev/null +++ b/hardware/Motors/ecmcELM7231-0010-Motor-Beckhoff-AM8123-1NH1-0000.cmd @@ -0,0 +1,43 @@ +############################################################ +############# Parmetrization of ELM7231-XXXX for motor AM8122-0FH1-0000 +#- Motor WITH brake +#- +#- Note: For important parameters see TwinCAT CoE startup list for the +#- motor terminal configuration. +#- +#- Macros (optional): +#-d \param I_MAX_MA : Maximum current in mA (defaults to 22400) +#-d \param I_RUN_MA : Running current in mA (defaults to 4000mA) +#-d */ + +#- Current loop integral time +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x12,21,2)" +#- Current loop proportianal gain +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x13,58,2)" + +#- Motor max current +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x11,${I_MAX_MA=88400},4)" +#- Motor rated current +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x12,${I_RUN_MA=14600},4)" +#- Motor pole pairs +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x13,3,1)" +#- Commutation offset +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x15,270,2)" +#- Torque contstant +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x16,78,4)" +#- Rotor moment of inertia +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x18,449,4)" +#- Winding inductance +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x19,3,2)" +#- Motor speed limitation +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x1b,7883,4)" + +#- Motor Temperature warn level +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x2b,1200,2)" +#- Motor thermal time constant +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x2d,832,2)" + +#- Release delay +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8012,0x11,25,2)" +#- Application delay +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8012,0x12,8,2)" From cbefe39e12c399461d4b269660f4aae3f493087b Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 14 Mar 2024 15:45:57 -0600 Subject: [PATCH 6/6] ELM7231 AM8123 example --- examples/test/elm7321/cfg/AM8123.yaml | 70 +++++++++++++++++++++++++++ examples/test/elm7321/startup.iocsh | 21 ++++++++ 2 files changed, 91 insertions(+) create mode 100644 examples/test/elm7321/cfg/AM8123.yaml create mode 100644 examples/test/elm7321/startup.iocsh diff --git a/examples/test/elm7321/cfg/AM8123.yaml b/examples/test/elm7321/cfg/AM8123.yaml new file mode 100644 index 000000000..cd120d318 --- /dev/null +++ b/examples/test/elm7321/cfg/AM8123.yaml @@ -0,0 +1,70 @@ +axis: + id: 1 + type: joint # this is for future selection of axis type + mode: CSV # supported mode, CSV and CSP + +epics: + name: axis + precision: 3 + unit: deg + motorRecord: + description: AM8123 CSV + +drive: + numerator: 2880000 # Fastest speed in engineering units + denominator: 2147483648 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET + type: 1 # Stepper: 0. DS402: 1 (DS402 = servos and advanced stepper drives) + control: ec0.s$(DRV_SLAVE).driveControl01 + status: ec0.s$(DRV_SLAVE).driveStatus01 + setpoint: ec0.s$(DRV_SLAVE).velocitySetpoint01 + # control bit for reset in 'control' + reset: 7 + # status bit for warning in 'status' + warning: 7 + # list of error bits in 'status', or if type==string, complete EC-link + error: + - 3 # Error + - 7 # Warning as Error + +encoder: + numerator: 360 + denominator: 1048576 + type: 1 # Type: 0=Incremental, 1=Absolute + bits: 32 # Total bit count of encoder raw data + absBits: 25 # Absolute bit count (for absolute encoders) always least significant part of 'bits' + absOffset: 0 # Encoder offset in eng units (for absolute encoders) + position: ec0.s$(DRV_SLAVE).positionActual01 # Ethercat entry for actual position input (encoder) + +controller: + Kp: 10 + Ki: 0.05 + +trajectory: + type: 1 + axis: + velocity: 36000 # 5000 rpm (web page), 7883 rpm (name plate) => 47298 deg/s + acceleration: 144000 + jerk: 360000 + +input: + limit: + forward: ec0.s$(DRV_SLAVE).ONE.0 # Ethercat entry for low limit switch input + backward: ec0.s$(DRV_SLAVE).ONE.0 # Ethercat entry for high limit switch input + home: ec0.s$(DRV_SLAVE).ONE.0 # Ethercat entry for home switch input + interlock: ec0.s$(ENC_SLAVE).ONE.0 # Ethercat entry for interlock switch input + +monitoring: + lag: + enable: true + tolerance: 360 + time: 100 + target: + enable: yes + tolerance: 0.1 + time: 100 + velocity: + enable: true + max: 40000 + time: + trajectory: 100 + drive: 200 diff --git a/examples/test/elm7321/startup.iocsh b/examples/test/elm7321/startup.iocsh new file mode 100644 index 000000000..5f18c483f --- /dev/null +++ b/examples/test/elm7321/startup.iocsh @@ -0,0 +1,21 @@ +require ecmccfg,ELM7231 "ENG_MODE=1,ECMC_VER=9.2.0" + +${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}configureSlave.cmd, "HW_DESC=ELM7231-0010, SLAVE_ID=20, CONFIG=-Motor-Beckhoff-AM8123-1NH1-0000" + +epicsEnvSet("DRV_SLAVE", ${ECMC_EC_SLAVE_NUM}) +${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=cfg/AM813.yaml, DEV=${DEV=${IOC}}, DRV_SLAVE=${DRV_SLAVE}" + +#- ############################################################################# +#- apply configuration +${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}applyConfig.cmd +#- ############################################################################# +#- go active +${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}setAppMode.cmd + +#- be quiet +asynSetTraceMask(MC_CPU1, -1, 0x01) +asynSetTraceIOMask(MC_CPU1, -1, 6) +asynSetTraceInfoMask(MC_CPU1, -1, 1) + +#- reset all errors +ecmcConfigOrDie "ControllerErrorReset()"