Oversampling settings, distributed clocks (DC)

Sample: Setting 2-channel, 2 times oversampling

The oversampling factor can be set in the “DC” tab (see Fig. Process data tab, sample setting 2-channel, 2 times oversampling). If only one channel of the EL37x2 is required, the corresponding operating mode can be selected as shown in Fig. Process data tab, example setting two-channel, 2 x oversampling, in order to reduce the process data. When an entry is selected in the dialog, the correct sampling ratio at distributed clock level and the correct number of process data to be transferred are set automatically.

Oversampling settings, distributed clocks (DC) 1:

Sampling frequency

If an oversampling factor is required that does not appear in the list, the user has to specify the ratio between the SYNC0 pulse and the SYNC1 pulse within the permitted limits, based on the information found in "Basic Function Principles". See the example.

Oversampling settings, distributed clocks (DC) 2:
Process Data tab, example setting two-channel, 2 x oversampling

An oversampling setting of n = 2 with two channels in use results in the process image shown in Fig. TwinCAT tree, example setting two-channel, 2 x oversampling.

Oversampling settings, distributed clocks (DC) 3:
TwinCAT tree, sample setting 2-channel, 2-times oversampling

"StartTimeNextLatch" activation

The assigned process record "StartTimeNextLatch" for transfer to the EtherCAT bus can be enabled by entering 0x1B10 in the field below, after selecting Sync Manager 2 (Fig. Process Data tab, activation of index 0x1B10, entry “StartTimeNextLatch”, top left).

Oversampling settings, distributed clocks (DC) 4:
Process Data tab, activation of index 0x1b10, entry “StartTimeNextLatch”

The StartTimeNextlatch process data is 32 bits wide. During each process data cycle the time is specified at which the next SYNC1 pulse and therefore the next block of sample values begins. StartTimeNextLatch thus changes in each cycle by the amount of that task cycle time with which this terminal is operated. This time specification is based on the terminal’s local Distributed Clocks time. The EL37x2 only maps the lower 32 bits of the generally 64-bit distributed clock time.

In this way all samples can be synchronized with other time data within the EtherCAT bus based on the known oversampling factor.

Sample:

With a cycle time of 1 ms (= 1,000,000 ns) and an oversampling factor of 20 in the regarded cycle, the EL37x2 supplies a StartTimeNextLatch = 7,777,216dec and 2 x 20 measured values at 16 bits each as process data. The time of measurement of the 5th supplied sample is now to be determined, i.e. the Distributed Clocks time at which the 5th sample was determined.

The currently supplied set of 20 samples was started at the time
7,777,216 – 1,000,000 (cycle time) = 6,777,216 ns.
The time interval between the samples is 1,000,000/20 = 50,000 ns.
Hence, the 5th sample was determined at the time 6,777,216 + ((5 - 1) * 50,000) = 6,977,216 ns.

Oversampling settings, distributed clocks (DC) 5:
TwinCAT tree, entry "StartTimeNextLatch"

Special oversampling factor and Shift Time for the SYNC0 pulse

CAUTION

CAUTION! Risk of device damage!

If these settings are changed in the System Manager, no plausibility checks are carried out on the software side.
Correct function of the terminal with all conceivable setting options cannot be guaranteed.

To set an oversampling factor that is not listed in the dialog, the ratio between SYNC0 and SYNC1 pulse can be set manually. To this end open the dialog "Advanced Settings" on the DC tab (Fig. DC tab, activation “Advanced Settings…”).
A local shift time for offsetting several EL37x2 devices can also be set here (Fig. DC tab, activation „Advanced Settings…“, „Distributed clocks“).

Oversampling settings, distributed clocks (DC) 6:
DC tab, activation "Advanced Settings..."
Oversampling settings, distributed clocks (DC) 7:
DC tab, activation “Advanced Settings...”, “Distributed Clocks”

Sample:

Setting the new oversampling factor:

In Fig. DC tab, activation „Advanced Settings…“, „Distributed Clocks“, TwinCAT is in Config mode with 4 ms cycle time (4000 µs). The SYNC1 pulse is triggered every 4000 µs. The oversampling factor should be set to 80. This requires a SYNC0 interval of 50 µs. To this end either select a suitable factor for SYNC0 Cycle Time, or manually enter 50 µs via User Defined. The ADC is now triggered at the required interval.

In addition, the number of transferred process data has to be adjusted to the new factor. In this example 80 values are required for each channel.

Oversampling settings, distributed clocks (DC) 8:
Process Data tab, adaptation of process data in SM0
Oversampling settings, distributed clocks (DC) 9:
Process Data tab, adaptation of process data in SM1

Select SM0 and SM1 one after another (Fig. Process data tab, adjusting the process data in SM0 + SM1), and in the field below (PDO assignment) select the number of process data corresponding to the oversampling factor, in this example 80dec.
In the PDO list on the right compare the PDO index with the last PDO to be activated under PDO Assignment. In this case all PDOs greater than 0x1A4F (SM0) or 0x1ACF (SM1) have to be deactivated.

Oversampling settings, distributed clocks (DC) 10:

Matching of oversampling factor/process data

If the number of process data does not match the oversampling factor n, the terminal will reach the OP state, but no process data will be created.

Sample:

Sample for setting a Shift Time:

Under SYNC0 Shift Time User-defined (Fig. DC tab, activation „Advanced Settings…“, „Distributed Clocks“), enter a time as required. Any value that may have been created automatically by the EtherCAT master can be overwritten; Although it should be taken into account in the calculation.
Sample: A value of "-5" is preset. An additional shift of +10 µs is required. -5 + 10 = +5 is entered as new value.
All time-based/distributed clock-based interrupts (SYNC0/SYNC1) are now offset by this amount relative to other EtherCAT slaves.