From 09212ba3dbeffe64a98b8b2467b23e2eaafac4f4 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Thu, 1 Feb 2024 13:29:57 -0600 Subject: [PATCH 1/3] EL1859 --- db/Beckhoff_1XXX/ecmcEL1859.substitutions | 25 +++++++++++++++++++++++ hardware/Beckhoff_1XXX/EL/ecmcEL1859.cmd | 19 +++++++++++++++++ hardware/Beckhoff_1XXX/ecmcEX1008.cmd | 16 +++++++-------- 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 db/Beckhoff_1XXX/ecmcEL1859.substitutions create mode 100644 hardware/Beckhoff_1XXX/EL/ecmcEL1859.cmd diff --git a/db/Beckhoff_1XXX/ecmcEL1859.substitutions b/db/Beckhoff_1XXX/ecmcEL1859.substitutions new file mode 100644 index 000000000..2bd3d35e6 --- /dev/null +++ b/db/Beckhoff_1XXX/ecmcEL1859.substitutions @@ -0,0 +1,25 @@ +# binary inputs +file "ecmc_binaryInput-chX.template"{ + pattern {CH_ID} + {01 } + {02 } + {03 } + {04 } + {05 } + {06 } + {07 } + {08 } +} + +file "ecmc_binaryOutput-chX.template" +{ + pattern {CH_ID} + {01 } + {02 } + {03 } + {04 } + {05 } + {06 } + {07 } + {08 } +} diff --git a/hardware/Beckhoff_1XXX/EL/ecmcEL1859.cmd b/hardware/Beckhoff_1XXX/EL/ecmcEL1859.cmd new file mode 100644 index 000000000..aba809a42 --- /dev/null +++ b/hardware/Beckhoff_1XXX/EL/ecmcEL1859.cmd @@ -0,0 +1,19 @@ +#-d /** +#-d \brief hardware script for EL1859 +#-d \details HD terminal 8 ch digital input/output +#-d \author Niko Kivel +#-d \file +#-d */ + +epicsEnvSet("ECMC_EC_HWTYPE" "EL1859") +epicsEnvSet("ECMC_EC_VENDOR_ID" "0x2") +epicsEnvSet("ECMC_EC_PRODUCT_ID" "0x07433052") + +#- verify slave +${SCRIPTEXEC} ${ecmccfg_DIR}slaveVerify.cmd + +#- binary inputs +${SCRIPTEXEC} ${ecmccfg_DIR}ecmcEX1008.cmd SM=1 + +#- binary outputs +${SCRIPTEXEC} ${ecmccfg_DIR}ecmcEX2008.cmd diff --git a/hardware/Beckhoff_1XXX/ecmcEX1008.cmd b/hardware/Beckhoff_1XXX/ecmcEX1008.cmd index cbee4d18c..adb583cf6 100644 --- a/hardware/Beckhoff_1XXX/ecmcEX1008.cmd +++ b/hardware/Beckhoff_1XXX/ecmcEX1008.cmd @@ -1,9 +1,9 @@ #- binary inputs -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a00,0x6000,0x1,B1,${KEY=binaryInput}01)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a01,0x6010,0x1,B1,${KEY=binaryInput}02)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a02,0x6020,0x1,B1,${KEY=binaryInput}03)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a03,0x6030,0x1,B1,${KEY=binaryInput}04)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a04,0x6040,0x1,B1,${KEY=binaryInput}05)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a05,0x6050,0x1,B1,${KEY=binaryInput}06)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a06,0x6060,0x1,B1,${KEY=binaryInput}07)" -ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,0,0x1a07,0x6070,0x1,B1,${KEY=binaryInput}08)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a00,0x6000,0x1,B1,${KEY=binaryInput}01)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a01,0x6010,0x1,B1,${KEY=binaryInput}02)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a02,0x6020,0x1,B1,${KEY=binaryInput}03)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a03,0x6030,0x1,B1,${KEY=binaryInput}04)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a04,0x6040,0x1,B1,${KEY=binaryInput}05)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a05,0x6050,0x1,B1,${KEY=binaryInput}06)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a06,0x6060,0x1,B1,${KEY=binaryInput}07)" +ecmcConfigOrDie "Cfg.EcAddEntryDT(${ECMC_EC_SLAVE_NUM},${ECMC_EC_VENDOR_ID},${ECMC_EC_PRODUCT_ID},2,${SM=0},0x1a07,0x6070,0x1,B1,${KEY=binaryInput}08)" From 22a8d9fbb62e2185fb14e4b10ac0159e2f7b4be8 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Tue, 12 Mar 2024 13:24:14 -0600 Subject: [PATCH 2/3] Nanotec ASA5618 --- .../ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd | 58 +++++++++++++++++++ ...mcEL7041-0052-Motor-Nanotec-ASA5618M42.cmd | 25 ++++++++ 2 files changed, 83 insertions(+) create mode 100644 hardware/Encoders/ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd create mode 100644 hardware/Motors/ecmcEL7041-0052-Motor-Nanotec-ASA5618M42.cmd diff --git a/hardware/Encoders/ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd b/hardware/Encoders/ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd new file mode 100644 index 000000000..17541604d --- /dev/null +++ b/hardware/Encoders/ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd @@ -0,0 +1,58 @@ +#-d /** +#-d \brief hardware script for ecmcEL5042-Encoder-Nanotec-ASA5618M42 +#-d \details SSI encoder used in Nanotec ASA5618M42 stepper motor, 17/16 bit +#-d \author Niko Kivel +#-d \file +#-d \pre Need the following varibales: +#-d \pre ECMC_EC_SLAVE_NUM Slave index +#-d \pre ECMC_EC_SDO_INDEX 0x8008 for CH1, 0x8018 for CH2 +#-d \note Supply: 4.75..15 V +#-d \note Resolution: 16 start bits + 17/16 => 49 bits total +#-d */ + +#- 0x80p8:01: Invert feedback direction (default 0) +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x1,0,1)" + +#- 0x80p8:12: Supply voltage +#- 50: 5V (default) +#- 90: 9V +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x12,50,1)" + +#- 0x80p8:13: Clock Frequency +#- 0: 10 MHz (default) +#- 1: 5 MHZ +#- 2: 3.33 MHz +#- 3: 2.5 MHz +#- 4: 2 MHz +#- 9: 1 MHz (Max for SSI) +#- 17: 500 kHz +#- 19: 250 kHz +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x13,9,1)" + +#- 0x80p8:14: Coding +#- 0: Dual code active (default) +#- 1: Gray code active +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x14,0,1)" + +#- total bit count: +# 16 starting bits +# 16 multi turn bits +# 17 single turn bits +# 2 status bits (which are _NOT_ used by the slave) +# ==> 49 bits total + +#- 0x80p8:15: Multiturn [Bit] Number of multiturn bits (16 start + 16 data) +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x15,32,1)" + +#- 0x80p8:16: Singleturn [Bit] Number of singleturn bits (17 data) +#- WORKING with 33 bit +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x16,17,1)" + +#- 0x80p8:17: Offset LSB Bit [Bit] Number of “right aligned” Offset bits +#- default 0 +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x17,0,1)" + +#- 0x80p8:18: Mode +#- 0: BiSS-C mode (default) +#- 1: SSI mode +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},${ECMC_EC_SDO_INDEX},0x18,1,1)" diff --git a/hardware/Motors/ecmcEL7041-0052-Motor-Nanotec-ASA5618M42.cmd b/hardware/Motors/ecmcEL7041-0052-Motor-Nanotec-ASA5618M42.cmd new file mode 100644 index 000000000..9a591a923 --- /dev/null +++ b/hardware/Motors/ecmcEL7041-0052-Motor-Nanotec-ASA5618M42.cmd @@ -0,0 +1,25 @@ +#-d /** +#-d \brief hardware script for ecmcEL7041-0052-Motor-Nanotec-ASA5618M42 +#-d \details Parametrization of EL7041 for motor Nanotec ecmcEL7041-0052-Motor-Nanotec-ASA5618M42 +#-d \author Niko Kivel +#-d \file +#-d */ + +#- Set max current to 4200mA (actually max current is 4.2A for this motor) +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x1,4200,2)" + +#- Reduced current 500mA +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x2,2000,2)" + +#- Nominal voltage 48V (unit 1mV) +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x3,48000,2)" + +#- Coil resistance 0.5 Ohm (unit 10mOhm) +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x4,50,2)" + +#- Motor full steps count 200 +ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x6,200,2)" + +#- Coil inductance 1.5mH (unit 0.01mH) NOT USED FOR EL7041 +#- ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0xA,150,2)" + From 5ca30e85f8774c6fddb9ba4e9609d6c582675f52 Mon Sep 17 00:00:00 2001 From: Niko Kivel Date: Tue, 12 Mar 2024 14:51:13 -0600 Subject: [PATCH 3/3] channel wrapper --- .../ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd | 10 ++++++++++ .../ecmcEL5042-Encoder-ch1-Renishaw_32-bit.cmd | 2 +- .../ecmcEL5042-Encoder-ch2-Nanotec-ASA5618M42.cmd | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 hardware/Encoders/ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd create mode 100644 hardware/Encoders/ecmcEL5042-Encoder-ch2-Nanotec-ASA5618M42.cmd diff --git a/hardware/Encoders/ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd b/hardware/Encoders/ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd new file mode 100644 index 000000000..34fbb5cc0 --- /dev/null +++ b/hardware/Encoders/ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd @@ -0,0 +1,10 @@ +#-d /** +#-d \brief hardware script for ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd +#-d \details Parametrization of EL5042 channel 1 for encoder ASA5618M42 +#-d \author Niko Kivel +#-d \file +#-d */ + +epicsEnvSet("ECMC_EC_SDO_INDEX" "0x8008") # CH1=0x8008. CH2=0x8018 +#- Call generic config file +${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd diff --git a/hardware/Encoders/ecmcEL5042-Encoder-ch1-Renishaw_32-bit.cmd b/hardware/Encoders/ecmcEL5042-Encoder-ch1-Renishaw_32-bit.cmd index 379d24b9b..f30415639 100644 --- a/hardware/Encoders/ecmcEL5042-Encoder-ch1-Renishaw_32-bit.cmd +++ b/hardware/Encoders/ecmcEL5042-Encoder-ch1-Renishaw_32-bit.cmd @@ -1,6 +1,6 @@ #-d /** #-d \brief hardware script for ecmcEL5042-Encoder-ch1-Renishaw-32bit.cmd -#-d \details Parametrization of EL5042 channel 1 for encoder Renisahw 32bit +#-d \details Parametrization of EL5042 channel 1 for encoder Renishaw 32bit #-d \author Niko Kivel #-d \file #-d */ diff --git a/hardware/Encoders/ecmcEL5042-Encoder-ch2-Nanotec-ASA5618M42.cmd b/hardware/Encoders/ecmcEL5042-Encoder-ch2-Nanotec-ASA5618M42.cmd new file mode 100644 index 000000000..878c87477 --- /dev/null +++ b/hardware/Encoders/ecmcEL5042-Encoder-ch2-Nanotec-ASA5618M42.cmd @@ -0,0 +1,10 @@ +#-d /** +#-d \brief hardware script for ecmcEL5042-Encoder-ch1-Nanotec-ASA5618M42.cmd +#-d \details Parametrization of EL5042 channel 2 for encoder ASA5618M42 +#-d \author Niko Kivel +#-d \file +#-d */ + +epicsEnvSet("ECMC_EC_SDO_INDEX" "0x8018") # CH1=0x8008. CH2=0x8018 +#- Call generic config file +${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}ecmcEL5042-Encoder-Nanotec-ASA5618M42.cmd