Principles of the oversampling function

The EL5031-0011 EtherCAT Terminal is an interface for the direct connection of an EnDat 2.2 encoder. Thanks to the oversampling property, the terminal can read out the current position of the encoder several times per bus cycle.

Oversampling

A conventional encoder interface terminal records a position value ("position") with each bus cycle and passes it on to the higher-level controller in the next fieldbus cycle. The EL5031-0011 records the current position value several times between two fieldbus communication cycles in a configurable and time-equidistant manner.

The transfer of a package of n position values of 64 bits each (32 bits each in compact mode) to the higher-level controller takes place in the next fieldbus communication cycle. This procedure is referred to as oversampling.

Distributed Clocks (DC)

Oversampling requires a clock generator in the terminal that triggers the individual data sampling events. The local clock in the terminal, called Distributed Clock (DC), is used for this purpose (see Chapter Distributed Clock). In the EL5031-0011, the distributed clock is realized with a scope of 64 bits (sufficient for the next 584 years)

SYNC0 interrupt

Depending on the cycle time, an interrupt is triggered by the local clock in the terminal. This interrupt is called SYNC0. For each SYNC0 signal, the position value is recorded according to the set oversampling factor n. The values are stored one after the other in a buffer. By generating the SYNC0 pulse from the local synchronized clock in the distributed clock network, it is ensured that the position value is recorded at highly constant intervals.

All local clocks in the supporting EtherCAT slaves are synchronized. This enables EtherCAT slaves (here: terminals) to record measured values simultaneously, independent of the distance between them. The EtherCAT master, e.g. Beckhoff TwinCAT, configures the EL5031-0011 Terminals such that their SYNC0 pulses occur at the same time. This simultaneity is within the distributed clock precision range of < 100 ns.

Timestamp of the process data

With the "StartTimeNextLatch" process date, the EL5031-0011 provides a 64-bit timestamp for each process data block. This is already enabled in the "Process data" tab via the PDO assignment of 0x1A01 "FB Inputs NextSyncTime" in the factory setting (see chapter "Process data and configuration"). The data block consisting of sample value + timestamp, which is transferred in each cycle, is not related.

The temporal relationship is shown in the following example.

Example: Two EL5031-0011 Terminals with the same oversampling factor (n = 50)

The EtherCAT master, e.g. Beckhoff TwinCAT, configures both EL5031-0011 terminals such that their SYNC0 pulses occur at the same time.

Assumption: the EtherCAT bus cycle time TSYNC0 = 2 ms. This means that SYNC0 is triggered every 2 ms in all EL5031-0011.

Principles of the oversampling function 1:
EL5031-0011 – Temporal relationship between SYNC0 signal and SyncManager interrupt
Principles of the oversampling function 2:

Maximum sampling frequency, minimum cycle time

Minimum sampling time (TSYNC0  / n), maximum sampling frequency (FSYNC0 * n)
A sampling time (TSYNC0 / n) of less than 25 μs is not permitted for the EL5031-0011!
The maximum sampling frequency (FSYNC0 * n) for the EL5031-0011 is therefore 40 ksps (samples per second).

Minimum cycle time (TSYNC0)
The minimum cycle time of 500 µs with an oversampling factor of n = 20 must not be undershot.