This commit is contained in:
2024-11-21 08:29:26 +01:00
commit f4bea16752
19 changed files with 1680 additions and 0 deletions

100
el7031/README.md Normal file
View File

@@ -0,0 +1,100 @@
# Configuration for EL7041-0052 and EL5042
* Lab test stage (1mm/rev)
* Lab 4 axis motion control box
* RLS BISS-C linear encoder (absolute)
* Open loop encoder (incremental)
## Scalings
Config for scaling in mm, mm/s, mm/s2
### Encoder scalings
Two encoders are configured:
1. Closed loop: BISS-C. This is used as the default encoder for control
2. Open loop: EL7041 Step counter
Both these encoders (and drive) should be scaled to the same unit (mm).
#### RLS BISS-C (encoder 1)
RLS BISS-C:
* encoder.numerator: Travels 1 mm/rev (linear encoder)
* encoder.denominator: Resolution: 4096 counts per = 1mm
* encoder.absBits: 26 bits
* encoder.type: Absolute (type 1)
* ecnoder.absOffset: Offset to 0 position of linear stage (-1408.794 in this example)
```
encoder:
desc: BISS-C
numerator: 1 # Scaling numerator example 1 mm/rev
denominator: 4096 # Scaling denominator example 4096 ticks per 360 degree
type: 1 # Type: 0=Incremental, 1=Absolute
bits: 26 # Total bit count of encoder raw data
absBits: 26 # Absolute bit count (for absolute encoders) always least significant part of 'bits'
absOffset: -1408.794 # Encoder offset in eng units (for absolute encoders)
position: ec0.s$(ENC_SID).positionActual${ENC_CH=01} # Ethercat entry for actual position input (encoder)
status: ec0.s$(ENC_SID).encoderStatus${ENC_CH=01} # mandatory only if 'warning' or 'error' are used
ready: 2 # Bit in encoder status word for encoder ready
warning: 0 # Warning (optional)
error: # max 3 (optional)
- 1 # Error 0
```
#### Open loop (encoder 2)
The EL7041 drive has a build in micro step counter (64 microsteps/fullstep):
* encoder.numerator: Travels 1 mm/rev
* encoder.denominator: Resolution: 200*64=12800 microsteps/rev = 12800 microsteps/mm
* encoder.bits: The counter is 16bit (default)
* encoder.type: Incremental (type 0)
```
encoder:
desc: 'Open loop'
unit: mm
numerator: 1 # Scaling numerator
denominator: 12800 # Scaling denominator
type: 0 # Type: 0=Incremental, 1=Absolute
bits: 16 # Total bit count of encoder raw data
absBits: 0 # Absolute bit count (for absolute encoders)
absOffset: 0 # Encoder offset in eng units (for absolute encoders)
position: ec0.s$(DRV_SID).positionActual01 # Ethercat entry for actual position input (encoder)
homing:
refToEncIDAtStartup: 1 # Ref encoder at startup (to BISS value)
```
### Drive scalings
The EL7041 is default setup to operate in a velocity range of +-2000 full steps/s which then corresponds to the 16bit drive.setpoint parameter (ec0.s$(DRV_SID).velocitySetpoint01):
* drive.numerator: Max velo = 2000 fullsteps/s == 10mm/s
* drive.denominator: velocity setpoint is 16bit == +-15bit = 32768
* drive.type: Stepper drive, set to 0
```
drive:
numerator: 10 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s)
denominator: 32768 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET (normally +-16bit)
type: 0 # 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
enable: 0 # Enable bit index in control word (not used if DS402)
reset: 1 # Reset bit in control word (if no drive reset bit then leave empty)
reduceTorque: 2 # Reduce torque bit in drive control word
reduceTorqueEnable: True # Enable reduce torque functionality
status: ec0.s$(DRV_SID).driveStatus01 # Status word ethercat entry
enabled: 1 # Enabled bit index in status word (not used if DS402)
warning: 2 # Warning bit in status word (if no drive warning bit then leave empty)
error: # max 3 error bits in status word
- 3 # Error 0 (if no drive error bit then leave empty)
- 7 # Error 1 (if no drive error bit then leave empty)
- 14 # Error 2 (if no drive error bit then leave empty)
```
## Switches
In standard setup switches are feed from 24V output, for the lab 4ax motion crate this is not the case.
However, the configuration for feeding switches (axis.feedSwitchesOutput) have been added anyway:
```
axis:
id: 1 # Axis id
feedSwitchesOutput: ec0.s5.binaryOutput01 # Ethercat entry for feed switches
```

View File

@@ -0,0 +1,84 @@
axis:
id: ${AXIS_ID=1} # Axis id
#feedSwitchesOutput: ec0.s${BO_SID}.binaryOutput${BO_CH=01} # Ethercat entry for feed switches
epics:
name: ${AX_NAME=M1} # Axis anme
precision: 3 # Decimal count
description: Test cfg # Axis description
unit: mm # Unit
motorRecord:
fieldInit: 'RTRY=0,FOFF=Frozen' # Extra config for Motor record
drive:
numerator: 57600 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s)
denominator: 32768 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET (normally +-16bit)
type: 0 # 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
enable: 0 # Enable bit index in control word (not used if DS402)
reset: 1 # Reset bit in control word (if no drive reset bit then leave empty)
reduceTorque: 2 # Reduce torque bit in drive control word
reduceTorqueEnable: True # Enable reduce torque functionality
status: ec0.s$(DRV_SID).driveStatus01 # Status word ethercat entry
enabled: 1 # Enabled bit index in status word (not used if DS402)
warning: 2 # Warning bit in status word (if no drive warning bit then leave empty)
error: # max 3 error bits in status word
- 3 # Error 0 (if no drive error bit then leave empty)
- 7 # Error 1 (if no drive error bit then leave empty)
- 14 # Error 2 (if no drive error bit then leave empty)
encoder:
desc: Openloop
numerator: 360 # Scaling numerator example 1 mm/rev
denominator: 12800 # Scaling denominator example 4096 ticks per 360 degree
type: 0 # Type: 0=Incremental, 1=Absolute
bits: 16 # Total bit count of encoder raw data
absBits: 0 # Absolute bit count (for absolute encoders) always least significant part of 'bits'
position: ec0.s$(ENC_SID).positionActual${ENC_CH=01} # Ethercat entry for actual position input (encoder)
status: ec0.s$(ENC_SID).encoderStatus${ENC_CH=01} # mandatory only if 'warning' or 'error' are used
controller:
Kp: 10 # Kp proportinal gain
Ki: 0 # Ki integral gain
Kd: 0 # Kd derivative gain
trajectory:
axis:
velocity: 720 # Default velo for axis
acceleration: 2000 # Default acc for axis
deceleration: 2000 # Default dec for axis
emergencyDeceleration: 7200 # Deceleration when axis in error state
jerk: 7200 # Default jerk for axis
jog:
velocity: 1 # 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: 10 # Allowed tolerance
time: 100 # Allowed time outside tolerance target:
velocity:
enable: false # Enable velocity monitoring
max: 8 # 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: 10 # Filter time inside tolerance to be at target

View File

@@ -0,0 +1,28 @@
##############################################################################
## Example config for open loop only
require ecmccfg "ENG_MODE=1,MASTER_ID=1,EC_RATE=500"
require ecmccomp
# 0:11 - EL7031 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=11,HW_DESC=EL7031"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1000, I_STDBY_MA=500, U_NOM_MV=24000, R_COIL_MOHM=8000,SPEED_RANGE=5'"
epicsEnvSet(DRV_SID,${ECMC_EC_SLAVE_NUM})
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis_open_loop.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${DRV_SID}, ENC_SID=${DRV_SID}, ENC_CH=01"
#- Disable boosts.. Nicer current control
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x7,0,2)"
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x8,0,2)"
# 8010:05 EMF
#ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8010,0x5,100,2)"
##- Kp
#ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x1,40,2)"
#
##- Ki
#ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x8011,0x2,4,2)"
#- ###########################################################################
#- Go Active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd

100
el7041-0052/README.md Normal file
View File

@@ -0,0 +1,100 @@
# Configuration for EL7041-0052 and EL5042
* Lab test stage (1mm/rev)
* Lab 4 axis motion control box
* RLS BISS-C linear encoder (absolute)
* Open loop encoder (incremental)
## Scalings
Config for scaling in mm, mm/s, mm/s2
### Encoder scalings
Two encoders are configured:
1. Closed loop: BISS-C. This is used as the default encoder for control
2. Open loop: EL7041 Step counter
Both these encoders (and drive) should be scaled to the same unit (mm).
#### RLS BISS-C (encoder 1)
RLS BISS-C:
* encoder.numerator: Travels 1 mm/rev (linear encoder)
* encoder.denominator: Resolution: 4096 counts per = 1mm
* encoder.absBits: 26 bits
* encoder.type: Absolute (type 1)
* ecnoder.absOffset: Offset to 0 position of linear stage (-1408.794 in this example)
```
encoder:
desc: BISS-C
numerator: 1 # Scaling numerator example 1 mm/rev
denominator: 4096 # Scaling denominator example 4096 ticks per 360 degree
type: 1 # Type: 0=Incremental, 1=Absolute
bits: 26 # Total bit count of encoder raw data
absBits: 26 # Absolute bit count (for absolute encoders) always least significant part of 'bits'
absOffset: -1408.794 # Encoder offset in eng units (for absolute encoders)
position: ec0.s$(ENC_SID).positionActual${ENC_CH=01} # Ethercat entry for actual position input (encoder)
status: ec0.s$(ENC_SID).encoderStatus${ENC_CH=01} # mandatory only if 'warning' or 'error' are used
ready: 2 # Bit in encoder status word for encoder ready
warning: 0 # Warning (optional)
error: # max 3 (optional)
- 1 # Error 0
```
#### Open loop (encoder 2)
The EL7041 drive has a build in micro step counter (64 microsteps/fullstep):
* encoder.numerator: Travels 1 mm/rev
* encoder.denominator: Resolution: 200*64=12800 microsteps/rev = 12800 microsteps/mm
* encoder.bits: The counter is 16bit (default)
* encoder.type: Incremental (type 0)
```
encoder:
desc: 'Open loop'
unit: mm
numerator: 1 # Scaling numerator
denominator: 12800 # Scaling denominator
type: 0 # Type: 0=Incremental, 1=Absolute
bits: 16 # Total bit count of encoder raw data
absBits: 0 # Absolute bit count (for absolute encoders)
absOffset: 0 # Encoder offset in eng units (for absolute encoders)
position: ec0.s$(DRV_SID).positionActual01 # Ethercat entry for actual position input (encoder)
homing:
refToEncIDAtStartup: 1 # Ref encoder at startup (to BISS value)
```
### Drive scalings
The EL7041 is default setup to operate in a velocity range of +-2000 full steps/s which then corresponds to the 16bit drive.setpoint parameter (ec0.s$(DRV_SID).velocitySetpoint01):
* drive.numerator: Max velo = 2000 fullsteps/s == 10mm/s
* drive.denominator: velocity setpoint is 16bit == +-15bit = 32768
* drive.type: Stepper drive, set to 0
```
drive:
numerator: 10 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s)
denominator: 32768 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET (normally +-16bit)
type: 0 # 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
enable: 0 # Enable bit index in control word (not used if DS402)
reset: 1 # Reset bit in control word (if no drive reset bit then leave empty)
reduceTorque: 2 # Reduce torque bit in drive control word
reduceTorqueEnable: True # Enable reduce torque functionality
status: ec0.s$(DRV_SID).driveStatus01 # Status word ethercat entry
enabled: 1 # Enabled bit index in status word (not used if DS402)
warning: 2 # Warning bit in status word (if no drive warning bit then leave empty)
error: # max 3 error bits in status word
- 3 # Error 0 (if no drive error bit then leave empty)
- 7 # Error 1 (if no drive error bit then leave empty)
- 14 # Error 2 (if no drive error bit then leave empty)
```
## Switches
In standard setup switches are feed from 24V output, for the lab 4ax motion crate this is not the case.
However, the configuration for feeding switches (axis.feedSwitchesOutput) have been added anyway:
```
axis:
id: 1 # Axis id
feedSwitchesOutput: ec0.s5.binaryOutput01 # Ethercat entry for feed switches
```

View File

@@ -0,0 +1,84 @@
axis:
id: ${AXIS_ID=1} # Axis id
#feedSwitchesOutput: ec0.s${BO_SID}.binaryOutput${BO_CH=01} # Ethercat entry for feed switches
epics:
name: ${AX_NAME=M1} # Axis anme
precision: 3 # Decimal count
description: Test cfg # Axis description
unit: mm # Unit
motorRecord:
fieldInit: 'RTRY=0,FOFF=Frozen' # Extra config for Motor record
drive:
numerator: 7200 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s)
denominator: 32768 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET (normally +-16bit)
type: 0 # 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
enable: 0 # Enable bit index in control word (not used if DS402)
reset: 1 # Reset bit in control word (if no drive reset bit then leave empty)
reduceTorque: 2 # Reduce torque bit in drive control word
reduceTorqueEnable: True # Enable reduce torque functionality
status: ec0.s$(DRV_SID).driveStatus01 # Status word ethercat entry
enabled: 1 # Enabled bit index in status word (not used if DS402)
warning: 2 # Warning bit in status word (if no drive warning bit then leave empty)
error: # max 3 error bits in status word
- 3 # Error 0 (if no drive error bit then leave empty)
- 7 # Error 1 (if no drive error bit then leave empty)
- 14 # Error 2 (if no drive error bit then leave empty)
encoder:
desc: Openloop
numerator: 360 # Scaling numerator example 1 mm/rev
denominator: 12800 # Scaling denominator example 4096 ticks per 360 degree
type: 0 # Type: 0=Incremental, 1=Absolute
bits: 16 # Total bit count of encoder raw data
absBits: 0 # Absolute bit count (for absolute encoders) always least significant part of 'bits'
position: ec0.s$(ENC_SID).positionActual${ENC_CH=01} # Ethercat entry for actual position input (encoder)
status: ec0.s$(ENC_SID).encoderStatus${ENC_CH=01} # mandatory only if 'warning' or 'error' are used
controller:
Kp: 10 # Kp proportinal gain
Ki: 0 # Ki integral gain
Kd: 0 # Kd derivative gain
trajectory:
axis:
velocity: 720 # Default velo for axis
acceleration: 2000 # Default acc for axis
deceleration: 2000 # Default dec for axis
emergencyDeceleration: 7200 # Deceleration when axis in error state
jerk: 7200 # Default jerk for axis
jog:
velocity: 1 # 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: 10 # Allowed tolerance
time: 100 # Allowed time outside tolerance target:
velocity:
enable: false # Enable velocity monitoring
max: 8 # 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: 10 # Filter time inside tolerance to be at target

View File

@@ -0,0 +1,23 @@
##############################################################################
## Example config for open loop only
require ecmccfg "ENG_MODE=1"
require ecmccomp
# 0:11 - EL7031 1Ch Stepper
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=11,HW_DESC=EL7031"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1000, I_STDBY_MA=200, U_NOM_MV=24000, R_COIL_MOHM=1230,SPEED_RANGE=2'"
epicsEnvSet(DRV_SID,${ECMC_EC_SLAVE_NUM})
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis_open_loop.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${DRV_SID}, ENC_SID=${DRV_SID}, ENC_CH=01"
# 0:13 - 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=1000, I_STDBY_MA=200, U_NOM_MV=48000, R_COIL_MOHM=1230,SPEED_RANGE=2'"
epicsEnvSet(DRV_SID,${ECMC_EC_SLAVE_NUM})
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis_open_loop.yaml, DEV=${IOC}, AX_NAME=M2, AXIS_ID=2, DRV_SID=${DRV_SID}, ENC_SID=${DRV_SID}, ENC_CH=01"
#- ###########################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd

View File

@@ -0,0 +1,197 @@
macros:
axis:
id: 1 # Axis id
type: joint # this is for future selection of axis type
# mode: CSV # supported mode, CSV and CSP, defaults CSV
# parameters: 'axisPar' # additional parameters # Additional params to motor record driver
# healthOutput: ec0... # Ethercat entry for health output
# autoMode: # Switch drive modes automaticaly for normal motion and homing (smaract for instance)
# modeSet: ec0.. # Ethercat entry drive mode write (set CSV,CSP,homing)
# modeAct: ec0.. # Ethercat entry drive mode reading (set CSV,CSP,homing)
# modeCmdMotion: 9 # Drive mode value for normal motion (written to axis.drvMode.modeSet when normal motion)
# modeCmdHome: 10 # Drive mode value for when homing (written to axis.drvMode.modeSet when homing)
# features:
# blockCom: 0 # Block communication to axis
# allowedFunctions:
# homing: 1 # Allow homing
# constantVelocity: 1 # Allow constant velocity
# positioning: 1 # Allow positioning
epics:
name: Axis1 # Axis anme
precision: 3 # Decimal count
description: Festo drive test # Axis description
unit: deg # Unit
# fieldInit: 'RRES=1.0,RTRY=2,RMOD=1,UEIP=0,RDBD=0.1,URIP=1,RDBL=$(IOC):$(ECMC_MOTOR_NAME)-PosActSim' # Extra config for Motor record
drive:
numerator: 360 # Fastest speed in engineering units
denominator: 16777216 # 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_ID).driveControl01 # Control word ethercat entry
# enable: 0 # Enable bit index in control word (not used if DS402)
# enabled: 1 # Enabled bit index in status word (not used if DS402)
status: ec0.s$(DRV_ID).driveStatus01 # Status word ethercat entry
setpoint: ec0.s$(DRV_ID).velocitySetpoint01 # Velocity setpoint if CSV. Position setpoint if CSP
# reduceTorque: 2 # Reduce torque bit in drive control word
# brake:
# output: ec0... # Ethercat link to brake output
# openDelay: 0 # Brake timing parameter in cycles (default 1kHz)
# closeAhead: 0 # Brake timing parameter in cycles (default 1kHz)
# reset: 1 # Reset (if no drive reset bit then leave empty)
# warning: 2 # Warning (if no drive warning bit then leave empty)
# error: # max 3
# - 3 # Error 0 (if no drive error bit then leave empty)
# - 7 # Error 1 (if no drive error bit then leave empty)
# - 14 # Error 2 (if no drive error bit then leave empty)
encoder:
numerator: 360 # Scaling numerator example 360 deg/rev
denominator: 16777216 # Scaling denominator example 16777216 ticks per 360 degree
type: 1 # Type: 0=Incremental, 1=Absolute
bits: 32 # Total bit count of encoder raw data
# absBits: 0 # Absolute bit count (for absolute encoders) always least significant part of 'bits'
# absOffset: 0 # Encoder offset in eng units (for absolute encoders)
# mask: 0xFFF00 # Mask applied to raw encoder value
position: ec0.s$(DRV_ID).positionActual01 # Ethercat entry for actual position input (encoder)
control: ec0.s$(DRV_ID).encoderControl01 # mandatory only if 'reset' is used
status: ec0.s$(DRV_ID).encoderStatus01 # mandatory only if 'warning' or 'error' are used
# ready: ec.. # Etehrcat entry for encoder ready
# source: 0 # 0 = Encoder value from etehrcat hardware, 1 = Encoder value from PLC
# reset: 1 # Reset (optional)
# warning: 2 # Warning (optional)
# error: # max 3 (optional)
# - 5 # Error 0
# - 9 # Error 1
# - 11 # Error 2
# filter:
# velocity:
# size: 100 # Filter size for velocity
# enable: 1 # enable velocity filter
# position:
# size: 100 # Filter size for encoder value
# enable: 1 # enable encoder value filter
# latch:
# position: '' # Link to latched value. Used for some homing seqs
# control: '' # Latch control trigger ethercat entry bit. Used for some homing seqs
# status: '' # Latch status ethercat entry bit. Used for some homing seqs
# primary: 1 # Use this encoder as primary (for control)
homing:
type: 0 # Homing sequence type
# position: -30 # Position to reference encoder to
# velocity:
# to: 10 # Velocity to cam/sensor (used for some homing seqs)
# from: 5 # Velocity from cam/sensor (used for some homing seqs)
# acceleration: 20 # Acceleration during homing
# deceleration: 100 # Deceleration during homing
# refToEncIDAtStartup: 1 # At startup then set the start value of this encoder to actpos of this encoder id
# refAtHome: 1 # If homing is executed then set position of this encoder
# tolToPrim: 0 # If set then this is the max allowed tolerance between prim encoder and this encoder
# postMoveEnable: yes # Enable move after successfull homing
# postMovePosition: 10 # Position to move to after successfull homing
# trigg: ec0.. # Ethercat entry for triggering drive internal homing seq (seq id 26)
# ready: ec0.. # Ethercat entry for readinf drive internal homing seq ready (seq id 26)
controller:
Kp: 10 # Kp proportinal gain
Ki: 0.1 # Ki integral gain
Kd: 0 # Kd derivative gain
# Kff: 1 # Feed forward gain
# deadband:
# tol: 0.01 # Stop control if within this distance from target for the below time
# time: 100
# limits:
# minOutput: -100 # Minimum controller output
# maxOutput: 100 # Maximum controller output
# minIntegral: -100 # Minimum integral output
# maxIntegral: 100 # Maximum integral output
# inner:
# Kp: 0.1 # Kp for when close to target
# Ki: 0.1 # Ki for when close to target
# Kd: 0.1 # Kd for when close to target
# tol: 0.1 # Distance from target for when inner PID params will be used, defaults to atTarget tol
trajectory:
# type: 1 # Default 0 = trapetz, 1 = S-curve (ruckig)
axis:
velocity: 2000 # Default velo for axis
acceleration: 1000 # Default acc for axis
deceleration: 1000 # Default dec for axis
# emergencyDeceleration: 0.05 # Deceleration when axis in error state
jerk: 10 # Default jerk for axis
jog:
velocity: 2000 # Default velo fro JOG (motor record)
# modulo:
# range: 360 # Modulo range 0..360
# type: 0 # Modulo type
input:
limit:
forward: ec0.s$(DRV_ID).ONE.0 # Ethercat entry for low limit switch input
# forwardPolarity: 0 # Polarity of forward limit switch
backward: ec0.s$(DRV_ID).ONE.0 # Ethercat entry for high limit switch input
# backwardPolarity: 0 # Polarity of forward limit switch
home: 'ec0.s$(DRV_ID).ONE.0' # Ethercat entry for home switch
# homePolarity: 0 # Polarity of home switch
interlock: 'ec0.s$(DRV_ID).ONE.0' # Ethercat entry for interlock switch input
# interlockPolarity: 0 # Polarity of interlock switch
# homing:
# type: 3 # Homing sequence type
# position: -30 # Position to reference encoder to
# velocity:
# to: 10 # Velocity to cam/sensor (used for some homing seqs)
# from: 5 # Velocity from cam/sensor (used for some homing seqs)
# acc: 20 # Acceleration during homing
# dec: 100 # Deceleration during homing
# refToEncIDAtStartup: 1 # At startup then set the start value of this encoder to actpos of this encoder id
# refAtHome: 1 # If homing is executed then set position of this encoder
# tolToPrim: 0 # If set then this is the max allowed tolerance between prim encoder and this encoder
# postMoveEnable: yes # Enable move after successfull homing
# postMovePosition: 10 # Position to move to after successfull homing
# timeout: 100 # Sequence timeout
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: false # Enable position lag monitoring (following error)
tolerance: 0.5 # Allowed tolerance
time: 100 # Allowed time outside tolerance
target:
enable: true # Enable at target monitoring (needs to be enabled if using motor record)
tolerance: 0.5 # Allowed tolerance
time: 10 # Filter time inside tolerance to be at target
velocity:
enable: false # Enable velocity monitoring
max: 2000 # 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
# velocityDifference:
# enable: 1 # Enable velocity diff monitoring (velo set vs velo act)
# max: 100 # Allowed max difference
# time:
# trajectory: 100 # Time allowed outside max diff velo before system init halt
# drive: 200 # Time allowed outside max diff velo before system disables drive
# plc:
# enable: 1 # Enable axis plc
# externalCommands: 1 # Allow axis to inputs from PLC
# code: # Sync code
# - if(ax2.traj.source){ax2.drv.enable:=(ax10.drv.enable or ax11.drv.enable)}; # Enable axis if one of master axes is enabled
# - ax2.traj.setpos:=ax10.traj.setpos-ax11.traj.setpos/2; # calculate set pos for physical axis
# velocity_filter: # Filter used to smother velocity feedforward
# encoder: # Filter plc enc velo
# enable: false # Filter enable
# size: 100 # Filter size
# trajectory: # Filter plc traj velo
# enable: false # Filter enable
# size: 100 # Filter size

View File

@@ -0,0 +1,199 @@
macros:
axis:
id: 1 # Axis id
type: joint # this is for future selection of axis type
# mode: CSV # supported mode, CSV and CSP, defaults CSV
# parameters: 'axisPar' # additional parameters # Additional params to motor record driver
# healthOutput: ec0... # Ethercat entry for health output
# autoMode: # Switch drive modes automaticaly for normal motion and homing (smaract for instance)
# modeSet: ec0.. # Ethercat entry drive mode write (set CSV,CSP,homing)
# modeAct: ec0.. # Ethercat entry drive mode reading (set CSV,CSP,homing)
# modeCmdMotion: 9 # Drive mode value for normal motion (written to axis.drvMode.modeSet when normal motion)
# modeCmdHome: 10 # Drive mode value for when homing (written to axis.drvMode.modeSet when homing)
# features:
# blockCom: 0 # Block communication to axis
# allowedFunctions:
# homing: 1 # Allow homing
# constantVelocity: 1 # Allow constant velocity
# positioning: 1 # Allow positioning
epics:
name: Axis1 # Axis anme
precision: 3 # Decimal count
description: Festo drive test # Axis description
unit: deg # Unit
# fieldInit: 'RRES=1.0,RTRY=2,RMOD=1,UEIP=0,RDBD=0.1,URIP=1,RDBL=$(IOC):$(ECMC_MOTOR_NAME)-PosActSim' # Extra config for Motor record
drive:
numerator: 360 # Fastest speed in engineering units
denominator: 15100000 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET
#denominator: 16777216 # 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_ID).driveControl01 # Control word ethercat entry
# enable: 0 # Enable bit index in control word (not used if DS402)
# enabled: 1 # Enabled bit index in status word (not used if DS402)
status: ec0.s$(DRV_ID).driveStatus01 # Status word ethercat entry
setpoint: ec0.s$(DRV_ID).velocitySetpoint01 # Velocity setpoint if CSV. Position setpoint if CSP
# reduceTorque: 2 # Reduce torque bit in drive control word
# brake:
# output: ec0... # Ethercat link to brake output
# openDelay: 0 # Brake timing parameter in cycles (default 1kHz)
# closeAhead: 0 # Brake timing parameter in cycles (default 1kHz)
# reset: 1 # Reset (if no drive reset bit then leave empty)
# warning: 2 # Warning (if no drive warning bit then leave empty)
# error: # max 3
# - 3 # Error 0 (if no drive error bit then leave empty)
# - 7 # Error 1 (if no drive error bit then leave empty)
# - 14 # Error 2 (if no drive error bit then leave empty)
encoder:
numerator: 360 # Scaling numerator example 360 deg/rev
denominator: 15100000 # Scaling denominator example 16777216 ticks per 360 degree
#denominator: 16777216 # Scaling denominator example 16777216 ticks per 360 degree
type: 1 # Type: 0=Incremental, 1=Absolute
bits: 32 # Total bit count of encoder raw data
# absBits: 0 # Absolute bit count (for absolute encoders) always least significant part of 'bits'
# absOffset: 0 # Encoder offset in eng units (for absolute encoders)
# mask: 0xFFF00 # Mask applied to raw encoder value
position: ec0.s$(DRV_ID).positionActual01 # Ethercat entry for actual position input (encoder)
control: ec0.s$(DRV_ID).encoderControl01 # mandatory only if 'reset' is used
status: ec0.s$(DRV_ID).encoderStatus01 # mandatory only if 'warning' or 'error' are used
# ready: ec.. # Etehrcat entry for encoder ready
# source: 0 # 0 = Encoder value from etehrcat hardware, 1 = Encoder value from PLC
# reset: 1 # Reset (optional)
# warning: 2 # Warning (optional)
# error: # max 3 (optional)
# - 5 # Error 0
# - 9 # Error 1
# - 11 # Error 2
# filter:
# velocity:
# size: 100 # Filter size for velocity
# enable: 1 # enable velocity filter
# position:
# size: 100 # Filter size for encoder value
# enable: 1 # enable encoder value filter
# latch:
# position: '' # Link to latched value. Used for some homing seqs
# control: '' # Latch control trigger ethercat entry bit. Used for some homing seqs
# status: '' # Latch status ethercat entry bit. Used for some homing seqs
# primary: 1 # Use this encoder as primary (for control)
homing:
type: 0 # Homing sequence type
# position: -30 # Position to reference encoder to
# velocity:
# to: 10 # Velocity to cam/sensor (used for some homing seqs)
# from: 5 # Velocity from cam/sensor (used for some homing seqs)
# acceleration: 20 # Acceleration during homing
# deceleration: 100 # Deceleration during homing
# refToEncIDAtStartup: 1 # At startup then set the start value of this encoder to actpos of this encoder id
# refAtHome: 1 # If homing is executed then set position of this encoder
# tolToPrim: 0 # If set then this is the max allowed tolerance between prim encoder and this encoder
# postMoveEnable: yes # Enable move after successfull homing
# postMovePosition: 10 # Position to move to after successfull homing
# trigg: ec0.. # Ethercat entry for triggering drive internal homing seq (seq id 26)
# ready: ec0.. # Ethercat entry for readinf drive internal homing seq ready (seq id 26)
controller:
Kp: 15 # Kp proportinal gain
Ki: 0.1 # Ki integral gain
Kd: 0 # Kd derivative gain
# Kff: 1 # Feed forward gain
deadband:
tol: 0.01 # Stop control if within this distance from target for the below time
time: 100
# limits:
# minOutput: -100 # Minimum controller output
# maxOutput: 100 # Maximum controller output
# minIntegral: -100 # Minimum integral output
# maxIntegral: 100 # Maximum integral output
# inner:
# Kp: 0.1 # Kp for when close to target
# Ki: 0.1 # Ki for when close to target
# Kd: 0.1 # Kd for when close to target
# tol: 0.1 # Distance from target for when inner PID params will be used, defaults to atTarget tol
trajectory:
type: 1 # Default 0 = trapetz, 1 = S-curve (ruckig)
axis:
velocity: 360 # Default velo for axis
acceleration: 360 # Default acc for axis
deceleration: 360 # Default dec for axis
# emergencyDeceleration: 0.05 # Deceleration when axis in error state
jerk: 1000 # Default jerk for axis
jog:
velocity: 360 # Default velo fro JOG (motor record)
# modulo:
# range: 360 # Modulo range 0..360
# type: 0 # Modulo type
input:
limit:
forward: ec0.s$(DRV_ID).ONE.0 # Ethercat entry for low limit switch input
# forwardPolarity: 0 # Polarity of forward limit switch
backward: ec0.s$(DRV_ID).ONE.0 # Ethercat entry for high limit switch input
# backwardPolarity: 0 # Polarity of forward limit switch
home: 'ec0.s$(DRV_ID).ONE.0' # Ethercat entry for home switch
# homePolarity: 0 # Polarity of home switch
interlock: 'ec0.s$(DRV_ID).ONE.0' # Ethercat entry for interlock switch input
# interlockPolarity: 0 # Polarity of interlock switch
# homing:
# type: 3 # Homing sequence type
# position: -30 # Position to reference encoder to
# velocity:
# to: 10 # Velocity to cam/sensor (used for some homing seqs)
# from: 5 # Velocity from cam/sensor (used for some homing seqs)
# acc: 20 # Acceleration during homing
# dec: 100 # Deceleration during homing
# refToEncIDAtStartup: 1 # At startup then set the start value of this encoder to actpos of this encoder id
# refAtHome: 1 # If homing is executed then set position of this encoder
# tolToPrim: 0 # If set then this is the max allowed tolerance between prim encoder and this encoder
# postMoveEnable: yes # Enable move after successfull homing
# postMovePosition: 10 # Position to move to after successfull homing
# timeout: 100 # Sequence timeout
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: false # Enable position lag monitoring (following error)
tolerance: 0.5 # Allowed tolerance
time: 100 # Allowed time outside tolerance
target:
enable: true # Enable at target monitoring (needs to be enabled if using motor record)
tolerance: 0.5 # Allowed tolerance
time: 10 # Filter time inside tolerance to be at target
velocity:
enable: false # Enable velocity monitoring
max: 2000 # 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
# velocityDifference:
# enable: 1 # Enable velocity diff monitoring (velo set vs velo act)
# max: 100 # Allowed max difference
# time:
# trajectory: 100 # Time allowed outside max diff velo before system init halt
# drive: 200 # Time allowed outside max diff velo before system disables drive
# plc:
# enable: 1 # Enable axis plc
# externalCommands: 1 # Allow axis to inputs from PLC
# code: # Sync code
# - if(ax2.traj.source){ax2.drv.enable:=(ax10.drv.enable or ax11.drv.enable)}; # Enable axis if one of master axes is enabled
# - ax2.traj.setpos:=ax10.traj.setpos-ax11.traj.setpos/2; # calculate set pos for physical axis
# velocity_filter: # Filter used to smother velocity feedforward
# encoder: # Filter plc enc velo
# enable: false # Filter enable
# size: 100 # Filter size
# trajectory: # Filter plc traj velo
# enable: false # Filter enable
# size: 100 # Filter size

View File

@@ -0,0 +1,32 @@
# ecmc test system
# Anders Sandström
require ecmccfg sandst_a "MASTER_ID=0,ENG_MODE=1"
require ecmccomp sandst_a
epicsEnvSet("IOC" ,"$(IOC="c6025a")")
epicsEnvSet("SCRIPTEXEC" ,"$(SCRIPTEXEC="iocshLoad")")
# Configuration loaded via FoE
epicsEnvSet(DRV_ID,20)
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=${DRV_ID}, HW_DESC=Festo-CMMT-ST"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Phytron-pyhBasic-42-1-1.5,MACROS='U_NOM_MV=24000,MAX_RPM=1800,NOM_RPM=1000,COMMUTATION=2'"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,MACROS='CLK_FRQ_KHZ=6000,ST_BITS=12,MT_BITS=14,INV_DIR=0'"
ecmcConfigOrDie "Cfg.EcApplyConfig(1)"
# To check mode:
${SCRIPTEXEC} ${ecmccfg_DIR}addEcSdoRT.cmd, "SLAVE_ID=${DRV_ID},INDEX=0x6060,SUBINDEX=0x0,DT=U8,NAME=DrvMode"
# Configure Motion
epicsEnvSet("DEV", "$(IOC)")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=./cfg/axis_CSV_OL_EMMS-ST_INCREMENTS.yaml"
# Other
ecmcConfigOrDie "Cfg.EcSetDiagnostics(1)"
ecmcConfigOrDie "Cfg.EcEnablePrintouts(0)"
ecmcConfigOrDie "Cfg.EcSetDomainFailedCyclesLimit(100)"
# go active
$(SCRIPTEXEC) $(ecmccfg_DIR)setAppMode.cmd

View File

@@ -0,0 +1,30 @@
# ecmc test system
# Anders Sandström
require ecmccfg "MASTER_ID=0,ENG_MODE=1"
require ecmccomp
epicsEnvSet("IOC" ,"$(IOC="c6025a")")
epicsEnvSet("SCRIPTEXEC" ,"$(SCRIPTEXEC="iocshLoad")")
# Configuration loaded via FoE
epicsEnvSet(DRV_ID,0)
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=${DRV_ID}, HW_DESC=Festo-CMMT-ST_PV"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper,MACROS=U_NOM_MV=24000,MAX_RPM=1740,NOM_RPM=800,COMMUTATION=2,I_MAX_MA=1000,I_STDBY_MA=500,R_COIL_MOHM=8000,L_COIL_UH=12000,I_CTRL_GAIN_REACT_CURR=10,I_CTRL_GAIN_ACT_CURR=10"
#-d I_CTRL_GAIN_REACT_CURR : P1.80.0.0 Current controller amplification gain reactive current (50.0)
#-d I_CTRL_INT_REACT_CURR : P1.81.0.0 Current controller integartion constant reactive current (10000.0)
#-d I_CTRL_GAIN_ACT_CURR : P1.82.0.0 Current controller amplification gain active current (50.0)
#-d I_CTRL_INT_ACT_CURR : P1.83.0.0 Current controller integartion constant active current (10000.0)
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-Generic-OPENLOOP,MACROS=''"
# To check mode:
${SCRIPTEXEC} ${ecmccfg_DIR}addEcSdoRT.cmd, "SLAVE_ID=${DRV_ID},INDEX=0x6060,SUBINDEX=0x0,DT=U8,NAME=DrvMode"
# Configure Motion
epicsEnvSet("DEV", "$(IOC)")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=./cfg/axis_PV_PURE_OL_EMMS-ST_INCREMENTS.yaml"
# go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
$(SCRIPTEXEC) ($(ecmccfg_DIR)setAppMode.cmd)

View File

@@ -0,0 +1,39 @@
# ecmc test system
# Anders Sandström
require ecmccfg "MASTER_ID=0,ENG_MODE=1"
require ecmccomp sandst_a
epicsEnvSet("IOC" ,"$(IOC="c6025a")")
epicsEnvSet("SCRIPTEXEC" ,"$(SCRIPTEXEC="iocshLoad")")
# Configuration loaded via FoE
epicsEnvSet(DRV_ID,15)
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=${DRV_ID}, HW_DESC=Festo-CMMT-ST_PV"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper,MACROS=U_NOM_MV=24000,MAX_RPM=1740,NOM_RPM=800,COMMUTATION=2,I_MAX_MA=500,I_STDBY_MA=500,R_COIL_MOHM=10000,L_COIL_UH=2000,I_CTRL_GAIN_REACT_CURR=10,I_CTRL_GAIN_ACT_CURR=10"
#-d I_CTRL_GAIN_REACT_CURR : P1.80.0.0 Current controller amplification gain reactive current (50.0)
#-d I_CTRL_INT_REACT_CURR : P1.81.0.0 Current controller integartion constant reactive current (10000.0)
#-d I_CTRL_GAIN_ACT_CURR : P1.82.0.0 Current controller amplification gain active current (50.0)
#-d I_CTRL_INT_ACT_CURR : P1.83.0.0 Current controller integartion constant active current (10000.0)
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-Generic-OPENLOOP,MACROS=''"
ecmcConfigOrDie "Cfg.EcApplyConfig(1)"
# To check mode:
${SCRIPTEXEC} ${ecmccfg_DIR}addEcSdoRT.cmd, "SLAVE_ID=${DRV_ID},INDEX=0x6060,SUBINDEX=0x0,DT=U8,NAME=DrvMode"
# Configure Motion
epicsEnvSet("DEV", "$(IOC)")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=./cfg/axis_PV_PURE_OL_EMMS-ST_INCREMENTS.yaml"
# Other
ecmcConfigOrDie "Cfg.EcSetDiagnostics(1)"
ecmcConfigOrDie "Cfg.EcEnablePrintouts(0)"
ecmcConfigOrDie "Cfg.EcSetDomainFailedCyclesLimit(100)"
# go active
$(SCRIPTEXEC) ($(ecmccfg_DIR)setAppMode.cmd)

240
festo/readme.md Normal file
View File

@@ -0,0 +1,240 @@
# IMPORTANT
2024-10-29:
?!?! MUST RE-INIT FROM FESTO AUTOMATION SUITE at almost every restart.. BUG in new FW (not the one that should fix below)..?!!??!
In openloop the drive will not report open loop position in CSV.. MUST use PV mode.. Less performance..
# Scalings
## Increments
Use this setting if possible.
In directory "inc" the drive is set up in increments
Scalings are set in the CIA part of festo software. Default scalings:
* Position : 0
* Velocity : 0
For scaling in degrees:
```
drive:
numerator: 360 # Fastest speed in engineering units
denominator: 16777216 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET
...
encoder:
numerator: 360 # Scaling numerator example 360 deg/rev
denominator: 16777216 # Scaling denominator example 4096 ticks per 360 degree
```
For scaling in fullsteps: SEEMS NOT TO BE CORRECT.. MOVES TO FAR...
```
drive:
numerator: 200 # Fastest speed in engineering units
denominator: 16777216 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET
...
encoder:
numerator: 200 # Scaling numerator example 360 deg/rev
denominator: 16777216 # Scaling denominator example 4096 ticks per 360 degree
```
## Degrees in CMMT-ST(do not use)
In directory "deg_obsolete"
Scalings are set in the CIA part of festo software. Deafult scalings:
* Position : 1E-6
* Velocity : 1E-3
```
drive:
numerator: 1 # Fastest speed in engineering units
denominator: 1000 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET
...
encoder:
numerator: 4 # Scaling numerator example 360 deg/rev
denominator: 1000000 # Scaling denominator example 4096 ticks per 360 degree
```
# test IOC:
## start IOC
Start test ioc configured to run in pure open loop in profile velocioty mode. (can be switched to BISS-C at run time by special procedure)
```
# Defaults to PV and without encoder (open loop)
sudo iocsh -7.0.7 festo_PV_OL_OWIS_WITHOUT.script
# Defaults to CSV and with BISS-C encoder (Sometimes issues to enable drive resulting in state machine timeout, have asked festo...)
sudo iocsh -7.0.7 festo_CSV_OL_OWIS_BISS.script
```
## Panels
```
caqtdm -macro "IOC=c6025a-04,MasterID=1,SlaveID=000" ecmcCMMT-ST.ui
caqtdm -macro "IOC=c6025a-04,SYS=c6025a-04,Axis=Axis1" ecmcAxisExpert_v1.ui
or:
source ~/myhome/projects/panel.sh c6025a-04 Axis1
```
## Switch encoder to BISS-C
BISS-C is only working well in CSV mode (not PV)
In the hardware panel:
1. press the "expert" button, a new panel should appear.
2. Go to "cfg" tab
3. Make sure axis is disabled
4. Choose BISS-C in the drop down (this is an Async SDO)
5. Press the left write toggle box to write to drive
6. Now drive needs a reinit, press the bottom reinit toggle box to reinit the drive.
7. IMPORTANT: Switch to CSV mode
## Switch encoder to Openloop
Openloop is only working well in PV mode (not CSV)
In the hardware panel:
1. Press the "expert" button, a new panel should appear.
2. Go to "cfg" tab
3. Make sure axis is disabled
4. Choose Without in the drop down (this is an Async SDO)
5. Press the left write toggle box to write to drive
6. Now drive needs a reinit, press the bottom reinit toggle box to reinit the drive.
7. IMPORTANT: Switch to PV mode
# new drive
## festo software
Festo project can be found in drive_params_params_owis_stage/increments3
1. Connect with the festo tool
2. Connect directlly to drive with ethernet cable.
3. The festo tool will find teh drive if within subnet (example for this drive 192.168.0.1)
4. Set ip of your computer to similar ip
5. Connect to drive in festo tool inside an open project
6. Press resart
7. Answer yes to download parameters
8. wait for restart, now etehrcat should be visible (ethercat slaves)
For ethercat:
NOTE can also set the dip switch S2 to one (the centre dip switch on top of the drive should be moved twoards the din-rail/wall direction)
## FoE
Festo parameter export can be found in drive_params_params_owis_stage/increments3.etstmp131.pck
See the readme_FoE.md for details.. Probably the file neds to be renamed..
For ethercat:
NOTE can also set the dip switch S2 to one (the centre dip switch on top of the drive should be moved twoards the din-rail/wall direction)
# Other
* The sdo subindex in festo tool is in decimal!! 0x1234:13 => 0x1234:0xD .. However in manual its all in hex..
* Sometimes when the drive refuses to enable (stuck in enable state and not going to enabled state). This could be related to that festo softwarev has taken over control of the drive ("Plugin PLC-Control" is activated).
* The Drive will not complain if a addSDO has a wrong size in some situations. Then the setting will just be ignored. (UINT in festo tool is U16 in ecmc syntax)
* Etehrcat as default can also set the dip switch S2 to one (teh centre dip switch on top of the drive should be moved twoards the din-rail/wall direction)
* Sometimes the drive refuses to start because of reinitialization needed..
# Inputs
```
ec0.s0.binaryInputWd01
```
Linked to epics records:
* bit 16: Ctrl enable input X1A.6
* bit 24: STO02 X1A.3
* bit 25: STO01 X1A.2
* bit 26: BI02 X1A.8
* bit 27: BI01 X1A.7
# Outputs
```
ec0.s0.binaryOutputWd01
```
Not linked to epics-records
* bit 0: brake output
* bit 16: Digital output 01
* bit 17: Digital output 02
# OBSOLETE: Open loop
## CSV Open loop
The drive will not update the openloop position if configured in CSV without encoder. Also confirmed by festo (support from festo in progress). However the actual velo updates.
## CSV Open loop with incremental encoder
Works in CSV.
Test with festo motor EMMS-ST:
```
sudo iocsh festo_CSV_OL_EMMS-ST.script
```
Festo cfgs: WORKS_CSV_OL_OWIS_BISS.fsp
## CSV Open loop with BISS-C OWIS stage (Single turn bits match rotation 12bits)
RLS encoder:
* ST_BITS=12 (4096 per turn==1mm travel)
* MT_BITS=14
Test with Owis stage:
```
sudo iocsh festo_CSV_OL_OWIS_BISS.script
```
Festo cfgs: WORKS_CSV_OL_OWIS_BISS.fsp
## CSV Open loop with BISS-C OWIS stage (Single turn bits _DON'T_ match rotation 14bits)
RLS encoder:
* ST_BITS=14 (4 times more than obe rev)
* MT_BITS=12
So actually the scaling factor needs to be 4 times as high.
This means that the axis then also need another scaling:
```
drive:
numerator: 1 # Fastest speed in engineering units
denominator: 1000 # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET
...
encoder:
numerator: 4 # Scaling numerator example 360 deg/rev
denominator: 1000000 # Scaling denominator example 4096 ticks per 360 degree
```
Test with Owis stage:
```
sudo iocsh festo_CSV_OL_OWIS_BISS_ST_BITS_WRONG.script
```
Festo cfgs: WORKS_CSV_OL_OWIS_BISS.fsp
The velocity monitoring in Festo needs to be disabled to run in this mode:
P14624.0.0
0x2166.25 = 0x2166:0x19 set to 2 (ignore)
# BISS
* Seems will only work with 6MHz..
* Bit count divided into single turn and multiturn
# RLS LA11 test
* Real scaling of LA11 is 1/4096mm, leadscrew pitch 1mm/rev
* Bit count = 26
* This means that the drive will see 4096 ticks per rev => ST_BITS=12bits,ST_BITS=14bits,
* Seems to work!
# Todo test generic scalings
* 256 levels of microsetp=>51200 microsteps/rev for a 200 stepper
* Set single tun count as close as possible = 16bits = 65536
# Closed loop
Get error about "closed loop not permissable" reasomn should be that commutation angle is unknown..
# GUI
```
caqtdm -macro "IOC=c6025a-04,MasterID=1,SlaveID=000" ecmcCMMT-ST.ui
```

41
festo/test.cmd Normal file
View File

@@ -0,0 +1,41 @@
# ecmc test system
# Anders Sandström
require ecmccfg sandst_a "MASTER_ID=0,ENG_MODE=1,ECMC_VER=sandst_a"
require ecmccomp
epicsEnvSet("IOC" ,"$(IOC="c6025a")")
epicsEnvSet("SCRIPTEXEC" ,"$(SCRIPTEXEC="iocshLoad")")
# Configuration loaded via FoE
epicsEnvSet(DRV_ID,15)
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=${DRV_ID}, HW_DESC=Festo-CMMT-ST_PV"
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper,MACROS=U_NOM_MV=24000,MAX_RPM=1740,NOM_RPM=800,COMMUTATION=2,I_MAX_MA=500,I_STDBY_MA=500,R_COIL_MOHM=10000,L_COIL_UH=2000,I_CTRL_GAIN_REACT_CURR=10,I_CTRL_GAIN_ACT_CURR=10"
#-d I_CTRL_GAIN_REACT_CURR : P1.80.0.0 Current controller amplification gain reactive current (50.0)
#-d I_CTRL_INT_REACT_CURR : P1.81.0.0 Current controller integartion constant reactive current (10000.0)
#-d I_CTRL_GAIN_ACT_CURR : P1.82.0.0 Current controller amplification gain active current (50.0)
#-d I_CTRL_INT_ACT_CURR : P1.83.0.0 Current controller integartion constant active current (10000.0)
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-Generic-OPENLOOP,MACROS=''"
ecmcConfigOrDie "Cfg.EcApplyConfig(1)"
# To check mode:
${SCRIPTEXEC} ${ecmccfg_DIR}addEcSdoRT.cmd, "SLAVE_ID=${DRV_ID},INDEX=0x6060,SUBINDEX=0x0,DT=U8,NAME=DrvMode"
# Configure Motion
epicsEnvSet("DEV", "$(IOC)")
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlAxis.cmd, "FILE=./cfg/axis_PV_PURE_OL_EMMS-ST_INCREMENTS.yaml"
# Other
ecmcConfigOrDie "Cfg.EcSetDiagnostics(1)"
ecmcConfigOrDie "Cfg.EcEnablePrintouts(0)"
ecmcConfigOrDie "Cfg.EcSetDomainFailedCyclesLimit(100)"
# go active
$(SCRIPTEXEC) ($(ecmccfg_DIR)setAppMode.cmd)
ecmcGetSlaveIdFromEcPath(ec10.s12.test,TEST_SID)
epicsEnvShow(TEST_SID)

73
ipos4808/cfg/axis.yaml Normal file
View File

@@ -0,0 +1,73 @@
axis:
id: ${AXIS_ID=1} # Axis id
epics:
name: ${AX_NAME=M1} # Axis anme
precision: 3 # Decimal count
description: Test cfg # Axis description
unit: mm # Unit
motorRecord:
fieldInit: 'RTRY=0,FOFF=Frozen' # Extra config for Motor record
drive:
numerator: 1 # Fastest speed in eng. units (2000 Fullsteps/s==10mm/s)
denominator: 9322 # 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: Openloop
numerator: 360 # Scaling numerator example 1 mm/rev
denominator: 51200 # 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: 720 # Default velo for axis
acceleration: 720 # Default acc for axis
deceleration: 720 # Default dec for axis
emergencyDeceleration: 720 # Deceleration when axis in error state
jerk: 720 # Default jerk for axis
jog:
velocity: 720 # 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.11 # 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: 1 # 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

View File

@@ -0,0 +1,91 @@
#General
epicsEnvSet("ECMC_MOTOR_NAME", "M1")
epicsEnvSet("ECMC_R", "M1-")
epicsEnvSet("ECMC_AXIS_NO", "1")
epicsEnvSet("ECMC_DESC", "IPOS4808 Test")
epicsEnvSet("ECMC_EGU", "mm") # Motor Record Unit
epicsEnvSet("ECMC_PREC", "3") # Motor Record Precision
epicsEnvSet("ECMC_AXISCONFIG", "") # Extra parameters to driver
epicsEnvSet("ECMC_EC_AXIS_HEALTH", "") # Entry for axis health output (example: ec0.s1.binaryOutput01.0)
epicsEnvSet("ECMC_MOD_RANGE" , "0") # Modulo range (traj setpoints and encoder values will be in range 0..ECMC_MOD_RANGE)
epicsEnvSet("ECMC_MOD_TYPE", "0")
#Encoder
epicsEnvSet("ECMC_ENC_SCALE_NUM" "360")
epicsEnvSet("ECMC_ENC_SCALE_DENOM" "51200")
epicsEnvSet("ECMC_ENC_TYPE" "0") # Type: 0=Incremental, 1=Absolute
epicsEnvSet("ECMC_ENC_BITS" "32") # Total bit count of encoder raw data
epicsEnvSet("ECMC_ENC_ABS_BITS", "0") # Absolute bit count (for absolute encoders) always least significant part of ECMC_ENC_BITS
epicsEnvSet("ECMC_ENC_ABS_OFFSET" "0") # Encoder offset in eng units (for absolute encoders)
epicsEnvSet("ECMC_EC_ENC_ACTPOS", "ec0.s$(ECMC_EC_SLAVE_NUM).positionActual01") # Ethercat entry for actual position input (encoder)
epicsEnvSet("ECMC_EC_ENC_RESET", "") # Reset handled by DS402 statemachine
epicsEnvSet("ECMC_EC_ENC_ALARM_0", "") # Error 0 handled by DS402 statemachine
epicsEnvSet("ECMC_EC_ENC_ALARM_1", "") # Error 1 handled by DS402 statemachine
epicsEnvSet("ECMC_EC_ENC_ALARM_2", "") # Error 2 handled by DS402 statemachine
epicsEnvSet("ECMC_EC_ENC_WARNING", "") # Warning handled by DS402 statemachine
#Drive
epicsEnvSet("ECMC_DRV_TYPE" "1") # Stepper: 0. DS402: 1 (DS402 = servos and advanced stepper drives)
epicsEnvSet("ECMC_DRV_SCALE_NUM" "1") # Fastest speed in engineering units
epicsEnvSet("ECMC_DRV_SCALE_DENOM" "9322") # I/O range for ECMC_EC_ALIAS_DRV_VELO_SET
epicsEnvSet("ECMC_EC_DRV_CONTROL", "ec0.s$(ECMC_EC_SLAVE_NUM).driveControl01") # Ethercat entry for control word or bit output
epicsEnvSet("ECMC_EC_DRV_STATUS", "ec0.s$(ECMC_EC_SLAVE_NUM).driveStatus01") # Ethercat entry for status word or bit input
epicsEnvSet("ECMC_EC_DRV_VELOCITY", "ec0.s$(ECMC_EC_SLAVE_NUM).velocitySetpoint01") # Ethercat entry for velocity setpoint output
epicsEnvSet("ECMC_EC_DRV_REDUCE_TORQUE", "") # Ethercat entry for reduce torque output
epicsEnvSet("ECMC_EC_DRV_BRAKE", "") # Ethercat entry for brake output
epicsEnvSet("ECMC_DRV_BRAKE_OPEN_DLY_TIME", "0") # Brake timing parameter in cycles (default 1kHz)
epicsEnvSet("ECMC_DRV_BRAKE_CLOSE_AHEAD_TIME", "0") # Brake timing parameter in cycles (default 1kHz)
epicsEnvSet("ECMC_EC_DRV_RESET", "") # Reset (handled by ds402 statemachine. Bit can be used anyway if needed)
epicsEnvSet("ECMC_EC_DRV_ALARM_0", "") # Error 0 (handled by ds402 statemachine. Bit can be used anyway if needed)
epicsEnvSet("ECMC_EC_DRV_ALARM_1", "") # Error 1 (handled by ds402 statemachine. Bit can be used anyway if needed)
epicsEnvSet("ECMC_EC_DRV_ALARM_2", "") # Error 2 (handled by ds402 statemachine. Bit can be used anyway if needed)
epicsEnvSet("ECMC_EC_DRV_WARNING", "") # Warning (handled by ds402 statemachine. Bit can be used anyway if needed)
#Trajectory
epicsEnvSet("ECMC_VELO", "720")
epicsEnvSet("ECMC_JOG_VEL", "1080")
epicsEnvSet("ECMC_JAR", "0.0") # JAR defaults to VELO/ACCL
epicsEnvSet("ECMC_ACCS_EGU_PER_S2", "720")
epicsEnvSet("ECMC_EMERG_DECEL", "1000") # Emergency deceleration
#Homing
epicsEnvSet("ECMC_HOME_PROC", "1")
epicsEnvSet("ECMC_HOME_POS", "0.0")
epicsEnvSet("ECMC_HOME_VEL_TO", "5")
epicsEnvSet("ECMC_HOME_VEL_FRM", "4")
epicsEnvSet("ECMC_HOME_ACC", "21")
epicsEnvSet("ECMC_HOME_DEC", "100")
epicsEnvSet("ECMC_HOME_POS_MOVE_ENA", "0") # Enable move to position after successfull homing
epicsEnvSet("ECMC_HOME_POS_MOVE_TARG_POS","0") # Target position to go to after successfull homing
#Controller
epicsEnvSet("ECMC_CNTRL_KP", "5.0")
epicsEnvSet("ECMC_CNTRL_KI", "0.02")
epicsEnvSet("ECMC_CNTRL_KD", "0.0")
epicsEnvSet("ECMC_CNTRL_KFF", "1.0")
#Monitoring
# Switches
epicsEnvSet("ECMC_EC_MON_LOWLIM", "ec0.s$(ECMC_EC_SLAVE_NUM).ONE.0") # Ethercat entry for low limit switch input
epicsEnvSet("ECMC_EC_MON_HIGHLIM", "ec0.s$(ECMC_EC_SLAVE_NUM).ONE.0") # Ethercat entry for high limit switch inpuit
epicsEnvSet("ECMC_EC_MON_HOME_SWITCH", "ec0.s$(ECMC_EC_SLAVE_NUM).ONE.0") # Ethercat entry for home switch input
epicsEnvSet("ECMC_EC_MON_EXT_INTERLOCK", "ec0.s$(ECMC_EC_SLAVE_NUM).ONE.0") # Ethercat entry for external interlock input
# Softlimits (disable with 0,0,0)
epicsEnvSet("ECMC_SOFT_LOW_LIM", "0")
epicsEnvSet("ECMC_SOFT_HIGH_LIM", "0")
epicsEnvSet("ECMC_DXLM_ENABLE", "0")
# Position lag
epicsEnvSet("ECMC_MON_LAG_MON_TOL", "5")
epicsEnvSet("ECMC_MON_LAG_MON_TIME", "100")
epicsEnvSet("ECMC_MON_LAG_MON_ENA", "0")
# At target
epicsEnvSet("ECMC_MON_AT_TARGET_TOL", "0.1")
epicsEnvSet("ECMC_MON_AT_TARGET_TIME", "100")
epicsEnvSet("ECMC_MON_AT_TARGET_ENA", "1")
# Velocity
epicsEnvSet("ECMC_MON_VELO_MAX", "100.0")
epicsEnvSet("ECMC_MON_VELO_MAX_TRAJ_TIME","100")
epicsEnvSet("ECMC_MON_VELO_MAX_DRV_TIME", "200")
epicsEnvSet("ECMC_MON_VELO_MAX_ENA", "0")

35
ipos4808/ipos4808.script Normal file
View File

@@ -0,0 +1,35 @@
#- #############################################################################
#- Example config for iPOS4808
require ecmccfg sandst_a "ENG_MODE=1"
require ecmccomp sandst_a
#- #############################################################################
#- Configure hardware
epicsEnvSet("ECMC_EC_SLAVE_NUM", "5")
epicsEnvSet("ECMC_EC_SLAVE_NUM_DRIVE", "$(ECMC_EC_SLAVE_NUM)")
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=$(ECMC_EC_SLAVE_NUM), HW_DESC=iPOS4808BX_2"
#- NOTE USE HW_DESC = iPOS4808BX_2 (iPOS4808BX is for legacy)
#- Apply component: Oriental motor PKE244A
#- For IPOS4808 some macros are mandatory:
#- * I_CTRL_GAIN : Current loop gain
#- * I_CTRL_INT : Current loop integrator gain
#- * I_MAX_MA : Mandatory if Motor-Generic-2Phase-Stepper is used
#- * I_STDBY_MA : Mandatory if Motor-Generic-2Phase-Stepper is used
#- The values can be taken from EasyMotionStudio or by trial and error (BTW, coil resistance and inductance are not used in the iPOS cfgs)
#- After running a tuning test in EasyMotionStudio, a reset is needed (from easymotion studio or over SDO (see motor cfg scripts).)
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepper, MACROS='I_MAX_MA=1000,I_STDBY_MA=100,I_CTRL_GAIN=1.0,I_CTRL_INT=0.26'"
#- #############################################################################
#- AXIS 1
#- The reduced current will be applied automatically by the iPOS4808 (no links needed in axis cfgs)
#- $(SCRIPTEXEC) ($(ecmccfg_DIR)configureAxis.cmd, CONFIG=./cfg/ipos4808_1.ax)
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis.yaml, DEV=${IOC}, AX_NAME=M1, AXIS_ID=1, DRV_SID=${ECMC_EC_SLAVE_NUM}"
#- ###########################################################################
#- go active
${SCRIPTEXEC} ${ecmccfg_DIR}applyConfig.cmd
${SCRIPTEXEC} ${ecmccfg_DIR}setAppMode.cmd

View File

@@ -0,0 +1,135 @@
#-d /**
#-d \brief hardware script for iPOS4808-Motor-Nanotec-AS5918L4204-ENM24B
#-d \details Parametrization of technosoft IPOS4808 for motor Oriental Motor PK296DB
#-d \author Anders Sandstroem
#-d \file
#-d */
#- ###########################################################
#- ############ Parametrization of technosoft IPOS4808 for motor Oriental Motor PK296DB
#-
#- Connection Parallel connection
#- Max current: 4.2A
#- Run current: 4.0A
#- standby current: 1.0A
#- NoMicroStepsPerStep=256
#- NoMotorSteps=200
#-
#- NOTE: If "NoMicroStepsPerStep" or "NoMotorSteps" is changed from the default (256,200)
#- a save and reset is needed of the drive. See "Save and reset" below.
#-
#- ###########################################################
#- ############ Configure settings not directly accessible as sdos:
#- Use 0x2064, 0x2067 for drive memory access, see technosoft CoE manual.
#-
#- Configuration word to next write
#- Bit 31..16: Address=0x271 (example KPI)
#- Bit 15..8: Always 0
#- Bit 7: 1 (Do not auto increment)
#- Bit 6..4 Always 0
#- Bit 3,2: 01 (DATA)
#- Bit 1: Always 0
#- Bit 0: 0 (16bit)
#- Result: 0x2710084
epicsEnvSet("ECMC_TECHNOSOFT_CFG_HEX" "0084")
#- ############ Number of steps per revolution:
#- NOTE:If changed from default then save and reset is needed (SE BELOW "Save and Reset section")!
#- SFTCL1 at technosoft address 280:
#- SFTCL1 = log(2048/NoMicroStepsPerStep)/log(2)-1
#- SFTCL1= log(2048/256)/log(2)-1=2
#- Write data SFTCL1=1 (1dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0280")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "0002")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- SCL2L_long = 2*DSP_FREQ*NoMicroStepsPerStep*Ts_S ()
#- SCL2H=HIGH(SCL2L_long) at technosoft address 281:
#- SCL2L=LOW(SCL2L_long) at technosoft address 282:
#- Write SCL2H=0x02BF (read in EasyMotion Studio)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0281")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "02BF")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- Write SCL2L=0x2000 (read in EasyMotion Studio)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0282")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "2000")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- STEPRES at technosoft address 802
#- STEPRES=NoMotorSteps*NoMicroStepsPerStep (200*256)
#- Write STEPRES=C800 (51200) (read in EasyMotion Studio)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0282")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "C800")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- ############ Current controller:
#- The values for current control can be automatically tuned/calculated in EasymotionStudio.
#- KPI at technosoft address 0x0271 range 0..32737 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?KPI
#- SFTKPI at technosoft address 0x0272 range 0..14 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?SFTKPI
#- Formula Kp=KPI/32767*2^SFTKPI
#- Kp=5.0126 (from autotune in EasyMotionStudio)=>KPI=21501 (53FD), SFTKPI=1
#- Write data KPI=53FD (21501)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0271")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "53FD")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- Write data SFTKPI=0x2(2dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0272")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "0001")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#-KI=1.0443
#- KII at technosoft address 0x0273 range 0..32737 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?KII
#- SFTKII at technosoft address 0x0274 range 0..14 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?SFTKII
#- Formula Ki=KII/32767*2^SFTKII
#- Ki=0.33543 (from autotune in EasyMotionStudio)=>KII=10991 (0x2AEF), SFTKII=0
#- Write data KII=4982 (18818)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0273")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "4982")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- Write data SFTKII=0x0 (0dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0274")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "0001")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- ############ Max Current protection:
#- IMAXPROT at technosoft address 0x0295
#- IMAXPROT=Imax*1638=4.5*1638=7371dec (0x1CCB)
#- Write data IMAXPROT=0x1CCB (7371dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0295")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "1CCB")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- ############ Speed controller:
#- KPS at technosoft address 0x0237 range 0..32737 (int)
#- SFTKPS at technosoft address 0x0238 range 0..14 (int)
#- Formula Kp=KPS/32767*2^SFTKPS
#- NOT IMPLEMENTED since not needed yet
#- KIS at technosoft address 0x0269 range 0..32737 (int)
#- SFTKIS at technosoft address 0x026A range 0..14 (int)
#- Formula Ki=KIS/32767*2^SFTKIS
#- NOT IMPLEMENTED since not needed yet
#- ###########################################################
#- ############ Save changes and reset (NOTE: only needs to be executed if number of steps is changed above):
#- ${SCRIPTEXEC} ${ecmccfg_DIR}technosoftSaveAndReset.cmd
#- ###########################################################
#- ############ Configure SDOS:
#- NOTE: SHOULD NOT BE USED. Already set above! Steps per rev 200poles, 256 levels of microstepping=>51200steps SHOULD NOT BE USED.
#- ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x2084,0x0,51200,4)"
#- Stepper current in open loop configuration 1A => 1638 (Isetting=2*Ipeak/65520*I, Ipeak=20A =>Isetting=1638*I)
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x2025,0x0,1638,2)"
#- Stepper current in standby (open loop) 0.2A=>3281638 (Isetting=2*Ipeak/65520*I, Ipeak=20A =>Isetting=1638*I)
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x2026,0x0,328,2)"

View File

@@ -0,0 +1,135 @@
#-d /**
#-d \brief hardware script for iPOS4808-Motor-Nanotec-AS5918L4204-ENM24B
#-d \details Parametrization of technosoft IPOS4808 for motor Oriental Motor PK296DB
#-d \author Anders Sandstroem
#-d \file
#-d */
#- ###########################################################
#- ############ Parametrization of technosoft IPOS4808 for motor Oriental Motor PK296DB
#-
#- Connection Parallel connection
#- Max current: 4.2A
#- Run current: 4.0A
#- standby current: 1.0A
#- NoMicroStepsPerStep=256
#- NoMotorSteps=200
#-
#- NOTE: If "NoMicroStepsPerStep" or "NoMotorSteps" is changed from the default (256,200)
#- a save and reset is needed of the drive. See "Save and reset" below.
#-
#- ###########################################################
#- ############ Configure settings not directly accessible as sdos:
#- Use 0x2064, 0x2067 for drive memory access, see technosoft CoE manual.
#-
#- Configuration word to next write
#- Bit 31..16: Address=0x271 (example KPI)
#- Bit 15..8: Always 0
#- Bit 7: 1 (Do not auto increment)
#- Bit 6..4 Always 0
#- Bit 3,2: 01 (DATA)
#- Bit 1: Always 0
#- Bit 0: 0 (16bit)
#- Result: 0x2710084
epicsEnvSet("ECMC_TECHNOSOFT_CFG_HEX" "0084")
#- ############ Number of steps per revolution:
#- NOTE:If changed from default then save and reset is needed (SE BELOW "Save and Reset section")!
#- SFTCL1 at technosoft address 280:
#- SFTCL1 = log(2048/NoMicroStepsPerStep)/log(2)-1
#- SFTCL1= log(2048/256)/log(2)-1=2
#- Write data SFTCL1=1 (1dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0280")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "0002")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- SCL2L_long = 2*DSP_FREQ*NoMicroStepsPerStep*Ts_S ()
#- SCL2H=HIGH(SCL2L_long) at technosoft address 281:
#- SCL2L=LOW(SCL2L_long) at technosoft address 282:
#- Write SCL2H=0x02BF (read in EasyMotion Studio)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0281")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "02BF")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- Write SCL2L=0x2000 (read in EasyMotion Studio)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0282")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "2000")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- STEPRES at technosoft address 802
#- STEPRES=NoMotorSteps*NoMicroStepsPerStep (200*256)
#- Write STEPRES=C800 (51200) (read in EasyMotion Studio)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0282")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "C800")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- ############ Current controller:
#- The values for current control can be automatically tuned/calculated in EasymotionStudio.
#- KPI at technosoft address 0x0271 range 0..32737 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?KPI
#- SFTKPI at technosoft address 0x0272 range 0..14 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?SFTKPI
#- Formula Kp=KPI/32767*2^SFTKPI
#- Kp=0.83 (from autotune in EasyMotionStudio)=>KPI=27375 (6AEF), SFTKPI=0
#- Write data KPI=6AEF (27375)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0271")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "6AEF")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- Write data SFTKPI=0x0(0dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0272")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "0000")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#-KI=1.0443
#- KII at technosoft address 0x0273 range 0..32737 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?KII
#- SFTKII at technosoft address 0x0274 range 0..14 (int). TML Command in Technosoft EasyMotionStudio "Command Interpreter": ?SFTKII
#- Formula Ki=KII/32767*2^SFTKII
#- Ki=0.261 (from autotune in EasyMotionStudio)=>KII=8555 (0x216b), SFTKII=0
#- Write data KII=216b (8555)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0273")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "216b")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- Write data SFTKII=0x0 (0dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0274")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "0000")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- ############ Max Current protection:
#- IMAXPROT at technosoft address 0x0295
#- IMAXPROT=Imax*1638=4.5*1638=7371dec (0x1CCB)
#- Write data IMAXPROT=0x1CCB (7371dec)
epicsEnvSet("ECMC_TECHNOSOFT_ADR_HEX" "0295")
epicsEnvSet("ECMC_TECHNOSOFT_DATA_HEX" "1CCB")
${SCRIPTEXEC} ${ecmccfg_DIR}technosoftWriteGenericCfg.cmd
#- ############ Speed controller:
#- KPS at technosoft address 0x0237 range 0..32737 (int)
#- SFTKPS at technosoft address 0x0238 range 0..14 (int)
#- Formula Kp=KPS/32767*2^SFTKPS
#- NOT IMPLEMENTED since not needed yet
#- KIS at technosoft address 0x0269 range 0..32737 (int)
#- SFTKIS at technosoft address 0x026A range 0..14 (int)
#- Formula Ki=KIS/32767*2^SFTKIS
#- NOT IMPLEMENTED since not needed yet
#- ###########################################################
#- ############ Save changes and reset (NOTE: only needs to be executed if number of steps is changed above):
#- ${SCRIPTEXEC} ${ecmccfg_DIR}technosoftSaveAndReset.cmd
#- ###########################################################
#- ############ Configure SDOS:
#- NOTE: SHOULD NOT BE USED. Already set above! Steps per rev 200poles, 256 levels of microstepping=>51200steps SHOULD NOT BE USED.
#- ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x2084,0x0,51200,4)"
#- Stepper current in open loop configuration 1A => 1638 (Isetting=2*Ipeak/65520*I, Ipeak=20A =>Isetting=1638*I)
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x2025,0x0,1638,2)"
#- Stepper current in standby (open loop) 0.2A=>3281638 (Isetting=2*Ipeak/65520*I, Ipeak=20A =>Isetting=1638*I)
ecmcConfigOrDie "Cfg.EcAddSdo(${ECMC_EC_SLAVE_NUM},0x2026,0x0,328,2)"

14
readme.md Normal file
View File

@@ -0,0 +1,14 @@
# Test of current control
These drives:
* ipos4808
* EL7041-0052
* EL7047
* EL7031
* Festo CMMT-ST
Current:
* MAX_CURR 1.0 A
* STD_CURR 0.2 A
# Drives