Oversampling settings, distributed clocks (DC)

Sample: Setting 2-channel, 2 times oversampling

The oversampling factor can be set in the “DC” tab (see Fig. DC tab, sample setting 2-channel, 2 times oversampling, TwinCAT 2.10). If only one channel of the EL47xx is required, the corresponding operation mode can be selected as shown in Fig. DC tab, sample setting 2-channel, 2 times oversampling, TwinCAT 2.10, 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". Please refer to the notes at the bottom of this page.

Oversampling settings, distributed clocks (DC) 2:

Differences between TwinCAT version 2.10 and 2.11

Some of the following screenshots illustrate the differences between TwinCAT versions 2.10 and 2.11 in terms of distributed clock settings (e.g. Figs. (DC tab, sample setting 2-channel, 2 times oversampling, TwinCAT 2.10), (DC tab, sample setting operation mode 2-channel, TwinCAT 2.11) and (DC tab, sample setting, oversampling factor 2, TwinCAT 2.11))

Oversampling settings, distributed clocks (DC) 3:
DC tab, sample setting 2-channel, 2-times oversampling, TwinCAT 2.10
Oversampling settings, distributed clocks (DC) 4:
DC tab, sample setting operation mode 2-channel, TwinCAT 2.11
Oversampling settings, distributed clocks (DC) 5:
DC tab, sample setting, oversampling factor 2, TwinCAT 2.11

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

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

"StartTimeNextOutput" activation

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

Oversampling settings, distributed clocks (DC) 7:
Process data tab, activation of index 0x1A82, entry “StartTimeNextOutput”

The StartTimeNextOutput 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. This time is based on the terminal-specific local distributed clock time. The EL47xx 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 system based on the known oversampling factor.

Sample:

With an oversampling factor of n = 20 and a StartTimeNextOutput = 0x12345678, the next sample block of 20 samples therefore starts at the distributed clocks time of 0x123456678hex or 305,419,896 ns.

Oversampling settings, distributed clocks (DC) 8:
TwinCAT tree, entry "StartTimeNextOutput"

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. Open the "Advanced Settings" dialog in the DC tab (Fig. DC tab, activation „Advanced Settings…“, TwinCAT 2.10 and TwinCAT 2.11).
A local shift time for offsetting several EL47xx devices can also be set here (Fig. DC tab, activation „Advanced Settings…“, „Distributed clocks“).

Oversampling settings, distributed clocks (DC) 9:
DC tab, activation „Advanced Settings…“, TwinCAT 2.10
Oversampling settings, distributed clocks (DC) 10:
DC tab, activation „Advanced Settings…“, TwinCAT 2.11
Oversampling settings, distributed clocks (DC) 11:
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 DAC 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) 12:
Process Data tab, adaptation of process data in SM0
Oversampling settings, distributed clocks (DC) 13:
Process Data tab, adaptation of process data in SM1

Select SM0, then SM1 (Fig. Process data tab, adjusting the process data in SM0 and 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 0x164F (SM0) or 0x174F (SM1) have to be deactivated.

Oversampling settings, distributed clocks (DC) 14:

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.