Documentation

IEEE 1588 Sync Execution

Synchronize model execution to Precision Time Protocol clock

  • Library:
  • IEEE 1588

Description

When the PTP time is a multiple of the fundamental step size of the model, this block causes a real-time interrupt.

Make measurements across multiple target computers at the same time step by using the IEEE 1588 Sync Execution block. The block uses a control loop to adjust the step size toward the synchronization objective. During this process, the control loop decreases or increases the step size. When the control loop decreases the step size, the CPU can become overloaded. You can decrease the maximum adjustment value by decreasing the Proportional gain parameter. The upper bound of the adjustment value is 10% of the model fundamental sample time, regardless of the Proportional gain value.

Use this block in every model that requires synchronized execution, whether it is a PTP master or slave model. To use this block, in the Simulink® Real-Time™ options, set the real-time interrupt source to Timer. As a best practice, for all models, use the same fundamental sample time. Set the sample time in this block to that fundamental sample time.

If you use the IEEE 1588 Sync Execution block in your model, configuring EtherCAT® distributed clocks in master shift mode in the same model produces a build error. To include IEEE® 1588 synchronized execution and EtherCAT distributed clocks in the same model, use EtherCAT bus shift mode.

Ports

Output

expand all

PTP time value at which the interrupt occurs, in seconds.

Data Types: double

Current difference, in seconds, between the PTP time at the interrupt and the nearest PTP time that is a multiple of the fundamental sample time.

Data Types: double

Parameters

expand all

The current value of output port Delta is multiplied by the proportional gain to get the first part of the controller output.

The low-pass filter is a discrete-time, first-order transfer function. The low-pass filter tracks the rate difference between the kernel and PTP clocks and provides the second part of the controller output.

The effect of this value depends on the PTP node state:

  • Slave node — The controller starts the kernel adjustment when the slave PTP clock offset from the master clock is less than or equal to this parameter.

  • Master node — The controller starts the kernel clock adjustment immediately after it enters the master state, regardless of the value of this parameter.

It is a best practice to start adjusting the kernel clock only when the PTP clock is stable. Keep this value less than or equal to a millisecond.

Enter the base sample time or a multiple of the base sample time.

Introduced in R2016a

Was this topic helpful?