Principles of the oversampling function

The EL5101-0011 EtherCAT Terminal is an interface for direct connection of incremental encoders with differential inputs (RS422). Through the oversampling property the terminal can read the current counter value several times per bus cycle.

Oversampling

A conventional incremental encoder interface terminal reads a counter value with each bus cycle and passes it on to the higher-level controller in the next fieldbus cycle. The EL5101-0011 reads the current counter value at several configurable and equidistant times between two fieldbus communication cycles. The transfer of a packet of x position values of 32 bits each to the higher-level controller takes place in the next fieldbus communication cycle. This procedure is referred to as oversampling.

Distributed Clocks

Oversampling requires a clock generator in the terminal that triggers the individual data sampling events. The local clock in the terminal, referred to as distributed clock, is used for this purpose.

The distributed clock represents a local clock in the EtherCAT slave controller (ESC) with the following characteristics:

The EL5101-0011 offers 64-bit support.

Sample Oversampling with SYNC0 and SYNC1:

The fieldbus/EtherCAT master is operated with a cycle time (TSYNC1) of 1 ms to match the higher-level PLC cycle time of 1 ms, for example. This means that an EtherCAT frame is sent every 1 ms to the EL5101-0011 to collect the process data. Therefore, the local clock in the terminal triggers an interrupt every 1 ms (1 kHz) in the ESC (EtherCAT Slave Controller) that provides the process data promptly for the collecting EtherCAT frame. This first interrupt is called SYNC1.

The EL5101-0011 is set in the TwinCAT System Manager to an oversampling factor n = 100. This causes the ESC to generate a second interrupt in the terminal with an n-times higher frequency (FSYNC0), in this case 100 kHz or 10 µs period (TSYNC0). This interrupt is called SYNC0. The counter value is read on each SYNC0 signal; the values are stored in succession in a buffer. Generation of the SYNC0 pulse from the local synchronized clock within the distributed clock network ensures that the position values are sampled at highly equidistant intervals with the period of the SYNC1 pulse.

Principles of the oversampling function 1:

Maximum sampling frequency / minimum cycle time

A sampling time shorter than (TSYNC0) 10 µs is not permissible for the EL5101-0011!
The maximum sample frequency (FSYNC0) for the EL5101-0011 is thus 100 kSps (samples per second).
The cycle time (TSYNC1) may not be shorter than the minimum cycle time of 500 µs with an oversampling factor of n = 50.
Regarding the calculation of SYNC0 from the SYNC1 pulse based on manual specification of an oversampling factor, please note that for TSYNC0 only integer values are calculated at nanosecond intervals.
Sample: 187,500 ns are permissible, 333,333.3333 ns are not.

Sample permissible and impermissible oversampling factors:

For TSYNC1 = 1 ms oversampling factors such as 1, 2, 5 or 100 are permitted, but not 3! If implausible values are use the terminal will reach the OP state but will not supply any process data.
This may result in a working counter error.
The 32-bit measured values accumulated in the buffer are sent as a packet to the higher-level control system.

Summary:

Principles of the oversampling function 2:

Time-related cooperation with other terminals

The reading of the measured values in the EL5101-0011 is triggered by an interrupt generated by the local clock in the terminal. All local clocks in the supporting EtherCAT slaves are synchronized. This enables EtherCAT slaves (here: terminals) to sample measured values simultaneously (simultaneous interrupt generation), independent of the distance between them. This simultaneity is within the distributed clock precision range of < 100 ns.

Sample for Coordination of two EL5101-0011 terminals with each other:

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

Assumption: The EtherCAT bus cycle time is 500 µs. The SYNC1 is thus triggered in all EL5101-0011 terminals every 500 µs.

Timestamp of the process data

The EL5101-0011 offers a "timestamp" for each process data block. This process data is already activated as StartTimeNextLatch through the activation of 0x1A01 ENC NextSync1Time as a 64-bit value in default on the Process data tab (see chapter Process data).
The data block consisting of sample value + timestamp, which is transferred in each cycle, is not related. The relationship is shown in the figure below.

To explain in more detail:

Principles of the oversampling function 3:
Temporal relationship between SYNC signals and SyncManager interrupt