-
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 branch 'master' of github.com:paulscherrerinstitute/ecmccfg
- Loading branch information
Showing
18 changed files
with
107 additions
and
74 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
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
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
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
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
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
18 changes: 6 additions & 12 deletions
18
examples/PSI/best_practice/motion/stepper_bissc/startup_local_hw.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 |
---|---|---|
@@ -1,25 +1,19 @@ | ||
############################################################################## | ||
## Example config for EL7041 and EL5042 | ||
|
||
require ecmccfg "ENG_MODE=1" | ||
require ecmccomp | ||
require ecmccfg "ENG_MODE=1,MASTER_ID=1" | ||
|
||
# 0:7 - EL7041 1Ch Stepper | ||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=13,HW_DESC=EL7041-0052" | ||
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1500, I_STDBY_MA=1000, U_NOM_MV=48000, R_COIL_MOHM=1230'" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=14,HW_DESC=EL7041-0052" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1500, I_STDBY_MA=1000, U_NOM_MV=48000, R_COIL_MOHM=1230'" | ||
epicsEnvSet(DRV_SID,${ECMC_EC_SLAVE_NUM}) | ||
|
||
|
||
# 0:2 - EL5042 2Ch BiSS-C Encoder, RLS-LA11 | ||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=14,HW_DESC=EL5042" | ||
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1" | ||
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=2" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=9,HW_DESC=EL5042" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=2" | ||
epicsEnvSet(ENC_SID,${ECMC_EC_SLAVE_NUM}) | ||
|
||
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${DRV_SID}, ENC_SID=${ENC_SID}, ENC_CH=01" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlEnc.cmd, "FILE=./cfg/enc_open_loop.yaml, DEV=${IOC}, DRV_SID=${DRV_SID}" | ||
|
||
#- ########################################################################### | ||
#- go active | ||
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd | ||
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.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
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
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
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,81 @@ | ||
axis: | ||
id: ${AXIS_ID=1} # Axis id | ||
|
||
epics: | ||
name: ${AX_NAME=M1} # Axis anme | ||
precision: 3 # Decimal count | ||
description: Test cfg # Axis description | ||
unit: deg # Unit | ||
motorRecord: | ||
fieldInit: 'RTRY=0,FOFF=Frozen' # Extra config for Motor record | ||
|
||
# Seems the setting is in deg/s?!? | ||
# num=1 and denom=1 works PERFECT (controller params zero and following setpoint perfect). | ||
# For twincat the manual where it states the output should be: | ||
# With inc encoder: | ||
# output_scaling = 360/enc_st_res/4*125 | ||
# Without in encoder: | ||
# output_scaling = 360/35535*125 | ||
# Twincat is recalculating behind the scenes... | ||
drive: | ||
numerator: 1 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s) | ||
denominator: 1 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET (normally +-16bit) | ||
type: 1 # Stepper: 0. DS402: 1 (DS402 = servos and advanced stepper drives) | ||
setpoint: ec0.s$(DRV_SID).velocitySetpoint01 # Velocity setpoint if CSV. Position setpoint if CSP | ||
control: ec0.s$(DRV_SID).driveControl01 # Control word ethercat entry | ||
status: ec0.s$(DRV_SID).driveStatus01 # Status word ethercat entry | ||
|
||
encoder: | ||
desc: Incremental | ||
numerator: 360 # Scaling numerator example 1 mm/rev | ||
denominator: 4096 # Scaling denominator example 4096 ticks per 360 degree | ||
type: 0 # Type: 0=Incremental, 1=Absolute | ||
bits: 32 # Total bit count of encoder raw data | ||
position: ec0.s$(DRV_SID).positionActual${ENC_CH=01} # Ethercat entry for actual position input (encoder) | ||
status: ec0.s$(DRV_SID).encoderStatus${ENC_CH=01} # mandatory only if 'warning' or 'error' are used | ||
|
||
controller: | ||
Kp: 5 # Kp proportinal gain | ||
Ki: 0 # Ki integral gain | ||
Kd: 0 # Kd derivative gain | ||
|
||
trajectory: | ||
type: 1 | ||
axis: | ||
velocity: 1720 # Default velo for axis | ||
acceleration: 1720 # Default acc for axis | ||
deceleration: 1720 # Default dec for axis | ||
emergencyDeceleration: 1720 # Deceleration when axis in error state | ||
jerk: 1720 # Default jerk for axis | ||
jog: | ||
velocity: 1720 # Default velo fro JOG (motor record) | ||
|
||
input: | ||
limit: | ||
forward: ec0.s$(DRV_SID).ONE.0 # Ethercat entry for low limit switch input | ||
backward: ec0.s$(DRV_SID).ONE.0 # Ethercat entry for high limit switch input | ||
home: 'ec0.s$(DRV_SID).ONE.0' # Ethercat entry for home switch | ||
interlock: 'ec0.s$(DRV_SID).ONE.0' # Ethercat entry for interlock switch input | ||
|
||
softlimits: | ||
enable: false # Enable soft limits | ||
forward: 100 # Soft limit position fwd | ||
forwardEnable: false # Soft limit position fwd enable | ||
backward: -100 # Soft limit position bwd | ||
backwardEnable: false # Soft limit position bwd enable | ||
|
||
monitoring: | ||
lag: | ||
enable: true # Enable position lag monitoring (following error) | ||
tolerance: 360 # Allowed tolerance | ||
time: 100 # Allowed time outside tolerance target: | ||
velocity: | ||
enable: true # Enable velocity monitoring | ||
max: 15000 # Allowed max velocity | ||
time: | ||
trajectory: 100 # Time allowed outside max velo before system init halt | ||
drive: 200 # Time allowed outside max velo before system disables drive | ||
target: | ||
enable: true # Enable at target monitoring (needs to be enabled if using motor record) | ||
tolerance: 0.1 # Allowed tolerance | ||
time: 100 # Filter time inside tolerance to be at target |
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,12 @@ | ||
############################################################################## | ||
## Example config for el7411 with Qmot BLDC motor (incremental encoder) | ||
## Note, the encoder needed to be inverted to fit motor rotation (otherwise the motor will act strange, however no real error..) | ||
|
||
require ecmccfg sandst_a "MASTER_ID=1,ENG_MODE=1" | ||
|
||
#-############################################################################# | ||
## Configure hardware | ||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd "SLAVE_ID=16, HW_DESC=EL7411" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Motor-QMot-4208-61-04-013-DS, MACROS='I_MAX_MA=2000,VELO_KP=1000,VELO_TI=100,CURR_KP=100,CURR_TI=50'" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}applyComponent.cmd "COMP=Encoder-Generic-INC, MACROS='ST_ENC_RES=4096, INV_DIR=1'" | ||
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd "FILE=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${ECMC_EC_SLAVE_NUM}" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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