Use this page for EL2252 timed-output behavior, especially when it is used as
the output terminal for axis positionCompare.
The EL2252 output schedule is loaded by writing the desired output value and DC start time, then pulsing the activate/control value for one EtherCAT cycle. For the ecmc position-compare implementation the tested convention is:
| Signal | Idle value | Schedule/load value |
|---|---|---|
activate | 3 | 0 |
This means the normal YAML settings for EL2252 are:
positionCompare:
output: ec0.s$(OUT_SLAVE).binaryOutput01
activate: ec0.s$(OUT_SLAVE).activate
startTime: ec0.s$(OUT_SLAVE).startTime
minLeadMs: 2.0
maxLeadMs: 4.0
activateIdle: 3
activateSchedule: 0
pulseWidthMs: 10.0
resetValue: 0
pulseWidthMs is optional. If it is greater than zero, ecmc schedules a second
EL2252 event that writes resetValue after the requested pulse width.
Fractional values such as 0.5 are allowed.
After the axis is configured, arm a one-shot compare at a target position:
AxisPositionCompareArm(axis,target,direction,outputValue)
direction is:
| Value | Meaning |
|---|---|
1 | positive crossing |
-1 | negative crossing |
0 | either direction |
Inspect the status with:
AxisPrintPositionCompare(axis)
The status includes the current state, reason, sequence number, selected target, scheduled DC time, lead time, pulse/reset settings and the last output/activate values written to the EL2252.
The EL2252 executes the queued DC start time in hardware. In practice, the larger error source is often the axis-side prediction used to decide which DC time to queue. Keep the lead window as short as the application can reliably support.
For a 1 kHz EtherCAT cycle, the position compare may need about two cycles of lead to observe the crossing early enough, write the EL2252 PDOs, and return the activate value to idle. A tested starting point is therefore:
positionCompare:
minLeadMs: 2.0
maxLeadMs: 4.0
In an EL2252 output tested against an EL7062/ED7062 touch probe, this setting gave approximately 13 to 18 microseconds error at constant velocity and about 20 microseconds in acceleration/deceleration zones. Larger maximum lead values scheduled farther ahead and produced larger systematic errors.
Adding more EtherCAT slaves changed the measured acceleration/deceleration
position result slightly in the same setup, but the result stayed repeatable.
This does not mean that the queued EL2252 DC startTime moved randomly. It
means that topology and frame timing can affect the software-side prediction
margin before the event is queued.
To calculate the actual position-compare output timing error from a touch-probe latch, use:
(latched_position - target_position) / velocity
A negative result means the output was early relative to the target position; a
positive result means it was late. This is different from the timing_us
diagnostic printed by the touch-probe reconstruction PLC, which checks the
timestamp-to-position reconstruction accuracy of the touch-probe measurement.
The EtherCAT/DC shift of the output and latch terminals can influence the available timing margin and repeatability. If the measured result is unstable, also check grounding, wiring and the DC/SYNC shift of the involved terminals.
The EL2252 start time is a 64-bit DC timestamp. Use a 64-bit integer record for
the startTime PV/link; converting the timestamp through a floating-point PV
can lose low-bit precision at normal DC time magnitudes.