-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from Canadian-Light-Source/ELM7231
ELM7231 and AM8123
- Loading branch information
Showing
6 changed files
with
236 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
file "ecmcEL72XX_DRV.template" | ||
{ | ||
pattern {CH_ID} | ||
{01 } | ||
} | ||
|
||
file "ecmcEL72XX_ENC.template" | ||
{ | ||
pattern {CH_ID} | ||
{01 } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#-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 | ||
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})" | ||
epicsEnvUnset("ECMC_TEMP_PERIOD_NANO_SECS") | ||
|
||
#- watchdog | ||
${SCRIPTEXEC} ${ecmccfg_DIR}ecmcWatchDog.cmd | ||
|
||
#- 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. | ||
#- 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})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
hardware/Motors/ecmcELM7231-0010-Motor-Beckhoff-AM8123-1NH1-0000.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" |