Time synchronization

This section describes how to perform time synchronization of HIL device(s).

IRIG-B

IRIG-B is a serial date-time format consisting of a 1-second frame that contains 100 pulses divided into fields. The time-synchronized device decodes the second, minute, hour and day fields and sets its internal time clock upon detecting the valid time data in the IRIG time mode.

HIL devices support unmodulated IRIG-B input. The unmodulated IRIG-B time-code is IRIG-B00x. The last digit, either 2 or 0, indicates the coded expression(s).

The time-code format IRIG-B002 is a binary-coded decimal (BCD) timecode (HH, MM, SS, DDD). This format represents the traditional, or legacy IRIG-B.

The time-code format IRIG-B000 consists of a BCD timecode (HH, MM, SS, DDD), plus straight binary seconds (SBS) of the day (0-86400 s), and also contains control function extensions that include data for: year, leap seconds, daylight time, UTC time offset, time quality and parity (odd).

When using the IRIG-B000 time-code format, the HIL device will only parse timecode data.

Time synchronization can be achieved with a precision of 100th of a second. This means that the HIL device will decode the tens of seconds, second, minute, hour and day fields and will set the internal time clock upon detecting the valid time data in the IRIG time mode at the resolution of 10 ms.

PTP

The Precision Time Protocol (PTP) is a protocol used to synchronize clocks throughout a computer network. On a local area network, it achieves clock accuracy in the sub-microsecond range, making it suitable for measurement and control systems. PTP is described in the IEE 1588 standard.

The IEEE 1588 standards describe a hierarchical master–slave architecture for clock distribution. Under this architecture, a time distribution system consists of one or more communication media (network segments), and one or more clocks. An ordinary clock is a device with a single network connection and is either the source of (master or leader) or destination for (slave or follower) a synchronization reference. A boundary clock has multiple network connections and can accurately synchronize one network segment to another. A synchronization master is selected for each of the network segments in the system. The root timing reference is called the grandmaster. The grandmaster transmits synchronization information to the clocks residing on its network segment.

An example of a PTP network architecture is shown in Figure 1.

Figure 1. PTP network architecture [1]

IEEE 1588 includes a profile concept defining PTP operating parameters and options. Several profiles have been defined for applications including telecommunications, electric power distribution and audiovisual.

HIL devices are capable of working only as an Ordinary Clock.

The default profile that is used is the one defined by the IEC 61850 standard. The options are defined as:
  • measurement of the link delay is performed by peer-to-peer (Pdelay) message exchange
  • domainNumber: 0 (default), 93 (when a conflict exist with another PTP time distribution)
  • Announce interval: 1 s (fixed)
  • Sync interval: 1 s (fixed)
  • Pdelay interval: 1 s (fixed)
  • Announce receipt time-out: 3 s (fixed)
  • priority1: 255 for slave-only
  • priority2: 255 for slave-only
PTP implementation on a HIL device is based on the Linux ptp4l library, and the options are defined as:
  • time_stamping=software
  • network_transport=L2
  • slaveOnly=1
  • delay_mechanism=P2P
  • domainNumber=0
  • logAnnounceInterval=0 (equals to 1 s)
  • logSyncInterval=0 (equals to 1 s)
  • logMinPdelayReqInterval=0 (equals to 1 s)
  • announceReceiptTimeout=3
  • priority1=255
  • priority2=255

In order to enable PTP on a HIL device, you need to enable the option in the HIL INI file. Once, the option is enabled, you can view, and if necessary, edit the PTP options as shown in Figure 2.

Figure 2. Enabling PTP protocol on HIL devices

Time synchronization usage

IRIG-B and PTP are used only for setting the internal time clock of a HIL Device, which is mandatory for various communication protocols in which data packets are timestamped.

To better understand the usage of time synchronization, three cases will be described:
  • HIL working in standalone mode (without synchronization)
  • HIL connected to PC (without synchronization)
  • HIL with IRIG-B/PTP connection
Table 1. Time synchronization usage explained
HIL Configuration Description

HIL working in standalone mode

When HIL is tuning in standalone boot, without the connection to PC, the HIL time will start counting from 1st of January 1970. All the network messages (coming from the communication protocols) will be stamped with this time value.

HIL connected to PC

When HIL is connected to the PC the current time is read from the PC and that time is applied to the HIL.

HIL with IRIG-B/PTP connection

When IRIG-B/PTP is connected, the exact time information is received every second and the HIL time is updated constantly, ensuring that all network messages have the correct time stamp.
Note: If both IRIG-B and PTP are present on a HIL device, PTP will have greater priority and IRIG-B will be ignored. If the PTP master clock is lost, IRIG-B will take over synchronization.

Time synchronization status component

To monitor the status of time synchronization on a HIL device, the Time Synchronization Status component is used. The component has two outputs GPS and PTP that output the status. A value of 1 represents the active status, and 0 represents the inactive status. This is shown in Figure 3.

Figure 3. Time Synchronization Status component usage

Multi HIL Setup

Using a multi HIL setup, every HIL Device has to be connected to the IRIG-B unmodulated signal. Please consult the documentation of your IRIG-B time-code generator for multi-device connection.

References

  1. Industrial Ethernet Book, Safeguarding PTP Protocol with Parallel Redundancy Protocol, September 20, 2021