This page covers motion topics related to the EPICS motor record in ecmccfg.
Read this page when:
For YAML configuration of the motor record itself, see yaml configuration. For example-driven setups, see motion best practice.
Open-loop stepper systems with incremental encoders often use auto save restore through the motor record.
Important note:
encoder.type: 0At PSI, this is commonly done by adding a file ending in _pos.req in the
local cfg/ directory and listing the DVAL fields that should be restored.
Example:
MTEST04-MTN-ASM:Axis1.DVAL
If the request file does not end with _pos.req, then restore pass 2 must be
enabled explicitly:
#ENABLE-PASS=2
MTEST04-MTN-ASM:Axis1.DVAL
Another common use case is open-loop motion with retries based on an absolute encoder or another EPICS readback source.
Typical setup:
This is the pattern used in the open-loop retry examples.
These fields are often relevant in retry-based setups:
RTRY: max retry countRMOD: retry modeUEIP: use encoder if presentRDBD: retry deadbandURIP: use RDBL link if presentRDBL: readback linkRTRYMaximum retry count. Must be greater than zero to enable retry behavior.
RMODRetry mode:
0: Unity1: Arithmetic2: Geometric3: In-PositionFor retry tests, modes 1 and 2 are the normal choices.
UEIPUse encoder if present. In the retry example this is normally set to 0.
RDBDRetry deadband. If the readback is outside this band, another move is started.
URIPUse RDBL if present. Set this to 1 when the retry logic should use the
linked readback PV.
RDBLReadback link used by the motor record retry logic. This can be any EPICS PV. In practice it is often linked to another encoder readback.
Additional motor-record fields can be set through
epics.motorRecord.fieldInit.
Example:
epics:
name: ${AX_NAME=M1}
precision: 3
description: Test cfg
unit: mm
motorRecord:
fieldInit: 'FOFF=Frozen,RRES=1.0,RTRY=2,RMOD=1,UEIP=0,RDBD=0.1,URIP=1,RDBL=$(IOC):${AX_NAME=M1}-Enc${RTRY_ENC_CH=01}-PosAct'
Do not use CP on the RDBL link in this workflow.
Typical sequence:
Example:
dbpf IOC_TEST:Axis1 10
Expected result in the retry example:
Jogging is generally not supported in this retry-based setup.
Most ecmccfg users do not need to call the low-level motor-record iocsh
commands directly, because the startup scripts and YAML loaders do that work.
The underlying motor layer in ecmc also registers:
ecmcMotorRecordCreateController(<port>, <not_used>, <not_used>, <movingPollMs>, <idlePollMs>, <options>)
ecmcMotorRecordCreateAxis(<controllerPort>, <axisNo>, <axisFlags>, <axisOptions>)
These are relevant mainly when:
ecmc without the normal ecmccfg startup flowFor PVT/profile-move specific direct commands, see PVT.
RDBLIf the RDBL PV goes into MAJOR or INVALID alarm, the motor record stops
motion independent of severity propagation settings.
This is useful for protective interlocking, but it also means that badly chosen alarm limits on the linked readback can stop motion unexpectedly.
This is especially relevant if the linked value is derived from an incremental encoder or a calculated signal that can leave the normal operating range during homing or switch events.
RDBL interlockIf motion is blocked by the RDBL alarm path, the retry link can be disabled by
setting URIP to 0:
dbpf IOC_TEST:Axis1.URIP 0
Motion can then continue, but retries based on RDBL are disabled while this
setting is active.
examples/PSI/best_practice/motion/stepper_openloop_asr/examples/PSI/best_practice/motion/stepper_openloop_mr_rtry_bissc/examples/PSI/best_practice/motion/stepper_bissc_no_mr/