This page describes profile-move / PVT motion in ecmccfg.
Here, PVT means the asyn motor-controller profile-move workflow where:
Use PVT when a single move should follow a precomputed trajectory instead of one target point at a time.
Typical cases:
PVT has two parts:
pvtControllerConfig.cmdPVT is enabled per axis in the motor-record block:
epics:
name: Axis1
precision: 3
motorRecord:
enable: true
pvt:
npoints: 20
nreadback: 20
Meaning:
epics.motorRecord.pvt.npoints: max number of target points for this axisepics.motorRecord.pvt.nreadback: max number of readback points for this axisWhen this block is present, the axis loader:
Axis1-PVT-UseAxis and Axis1-PVT-PositionsMinimal pattern:
require ecmccfg "ENG_MODE=1,MASTER_ID=0"
${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=1000,I_STDBY_MA=500,U_NOM_MV=48000,R_COIL_MOHM=1230,STEPS=400'"
${SCRIPTEXEC} ${ecmccfg_DIR}loadYamlAxis.cmd, "FILE=./cfg/axis.yaml,DEV=${IOC},DRV_SLAVE=${ECMC_EC_SLAVE_NUM}"
${SCRIPTEXEC} ${ecmccfg_DIR}pvtControllerConfig.cmd
This pattern is used in:
examples/PSI/best_practice/motion/pvt/el7041_0052/pvtControllerConfig.cmdpvtControllerConfig.cmd creates the shared controller-side PVT records and
allocates the profile buffers in the asyn motor driver.
Important macros:
NPOINTS: max number of profile pointsNREADBACK: max number of readback pointsNPULSES: max number of output pulsesNAXES: number of participating axesTRG_EC_ENTRY: optional EtherCAT entry linked to the PVT trigger outputTRG_DUR_S: optional pulse duration for the trigger outputSOFT_TRG_FLNK: optional forward link from PVT-SftTrgIf these sizes are not supplied explicitly, the script uses the largest values
collected from all axes with epics.motorRecord.pvt.
If PVT is enabled for one or more axes and pvtControllerConfig.cmd was not
called manually, setAppMode.cmd will run a default pvtControllerConfig.cmd
automatically.
Call pvtControllerConfig.cmd explicitly when you need to:
TRG_EC_ENTRYsetAppMode.cmdFor normal ecmccfg usage, the YAML loader and pvtControllerConfig.cmd
handle the required motor-record setup for you.
The underlying motor-record layer in ecmc also exposes direct iocsh commands:
ecmcCreateProfile(<controllerPort>, <maxPoints>)
ecmcEnablePVTForAxis(<controllerPort>, <axisId>, <enable>)
Use these only when working directly with the low-level motor-record controller
layer rather than the normal ecmccfg startup flow.
Meaning:
ecmcCreateProfile(...) allocates the shared profile buffer for the selected controllerecmcEnablePVTForAxis(...) enables or disables PVT support for one axis on that controllerIn a normal ecmccfg IOC:
pvtControllerConfig.cmd covers the controller-side allocationepics.motorRecord.pvt covers per-axis enablementThese PVs are created from ecmcProfileMoveController.template with prefix
$(P)PVT-....
Important PVs:
PVT-NumAxes: number of axes used in the profilePVT-NumPoints: number of profile pointsPVT-NumPulses: number of output pulsesPVT-StartPulses: point index where trigger pulses startPVT-EndPulses: point index where trigger pulses stopPVT-TimeMode: fixed time or array time modePVT-FixedTime: fixed time per pointPVT-Times: time arrayPVT-MoveMode: absolute or relative movePVT-Build: build/check the profilePVT-BuildState, PVT-BuildStatus, PVT-BuildMessage: build diagnosticsPVT-Execute: execute the built profilePVT-ExecuteState, PVT-ExecuteStatus, PVT-ExecuteMessage: execution diagnosticsPVT-Abort: abort profile executionPVT-Readback: request profile readback arraysPVT-ReadbackState, PVT-ReadbackStatus, PVT-ReadbackMessage: readback diagnosticsPVT-SftTrg: software trigger helper recordThese PVs are created for each PVT-enabled axis from
ecmcProfileMoveAxis.template.
Important PVs:
<Axis>-PVT-UseAxis: include this axis in the profile<Axis>-PVT-Positions: target positions for this axis<Axis>-PVT-Readbacks: actual readback positions after readback<Axis>-PVT-FollowingErrors: following-error array after readbackTypical sequence from EPICS:
PVT-NumPointsPVT-NumPulses and optionally PVT-StartPulses / PVT-EndPulsesPVT-TimeModePVT-Times<Axis>-PVT-UseAxis=1<Axis>-PVT-PositionsPVT-Build=1 and verify PVT-BuildStatusPVT-Execute=1PVT-Readback=1 and inspect <Axis>-PVT-ReadbacksExample:
caput IOC:PVT-NumPoints 7
caput IOC:PVT-NumPulses 5
caput IOC:PVT-MoveMode 0
caput IOC:Axis1-PVT-UseAxis 1
caput -a IOC:Axis1-PVT-Positions "0 360 720 1080 1440 1080 720"
caput -a IOC:PVT-Times "1 2 2 1 5 1 1"
caput IOC:PVT-Build 1
caput IOC:PVT-Execute 1
Notes:
PVT-MoveMode=0 means absolute mode.PVT-FixedTime is used instead of the PVT-Times array.If TRG_EC_ENTRY is configured in pvtControllerConfig.cmd, the PVT controller
can drive an EtherCAT output during the profile.
Use this when the motion profile must emit synchronized trigger pulses to external hardware.
Relevant settings:
TRG_EC_ENTRY: output bit or entry to link to the PVT trigger objectTRG_DUR_S: trigger pulse durationPVT-StartPulses, PVT-EndPulses, PVT-NumPulses: pulse placement/countPVT support exists in the codebase and templates, but it is still only lightly covered elsewhere in the manual.
The axis YAML keys epics.motorRecord.pvt.npoints and
epics.motorRecord.pvt.nreadback are documented in the YAML reference and
should be considered required for YAML-based PVT setup.
The preferred example to start from is:
examples/PSI/best_practice/motion/pvt/el7041_0052/