> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/configure-ios/time-synchronization-driver.md).

# Time Synchronization Driver

## Introduction to time synchronization

OPAL‑RT’s time synchronization solution enables accurate timestamping of simulation data, synchronization with external time references, and coordination of real‑time and hardware‑in‑the‑loop (HIL) systems. It is essential for applications requiring deterministic timing, including power system protection testing, substation automation, phasor measurement unit (PMU) validation, and distributed real‑time simulations.

The solution consists of a dedicated time synchronization kit and a software driver, supporting multiple industry‑standard time synchronization methods through specialized connectors, each supporting a specific synchronization function:

* External time source synchronization (IRIG‑B / 1PPS)
* Real‑Time Model Clock Signal Generation
* IEEE‑1588 Precision Time Protocol (PTP)

### External time source synchronization (IRIG‑B / 1PPS)

This connector allows the real‑time simulator to either:

* **Synchronize to an external precision time source**, or
* **Generate a time reference signal** for external equipment

Supported signals include:

* **IRIG‑B**
* **1 Pulse Per Second (1PPS)**

This configuration is commonly used when synchronizing simulations with:

* GPS clocks
* Substation time servers
* PMUs or protection relays
* SCADA and measurement systems

### Real‑time model clock signal generation

The second connector continuously generates a **clock signal derived from the real‑time model time step**.

Key characteristics:

* The signal frequency is directly linked to the simulator’s real‑time execution step
* Ensures deterministic timing alignment

This clock signal can be sent externally to synchronize:

* FPGA‑based simulations
* External controllers
* Data acquisition systems
* Custom hardware requiring cycle‑accurate timing

This connector is particularly valuable in **co‑simulation** and **hardware‑in‑the‑loop** environments.

### IEEE‑1588 Precision Time Protocol (PTP)

The third connector supports **IEEE‑1588 Precision Time Protocol (PTP)**, enabling synchronization over Ethernet networks.

Using PTP, the simulator can:

* Receive high‑precision time from a network‑based grandmaster clock
* Align its internal clock with distributed systems

This method is well suited for:

* Substation automation systems
* Distributed measurement and control architectures
* Network‑based real‑time test platforms

## Supported time synchronization standards

### IRIG‑B time code

**IRIG‑B (Inter‑Range Instrumentation Group – Format B)** is a widely adopted time code standard in the electrical power industry.

Key characteristics:

* 100 pulses per second
* 1‑second frame divided into 10 ms intervals
* Encodes:
  * Time‑of‑year
  * Year
  * Optional seconds‑of‑day (SBS)
* Uses Binary‑Coded Decimal (BCD) format

IRIG‑B is commonly used in:

* Substations
* Protection relay testing
* PMU and synchrophasor systems

### Pulse Per Second (1PPS)

A **1PPS** signal is a precise electrical pulse that occurs exactly once per second.

Characteristics:

* Very sharp rising or falling edge
* Pulse width less than one second
* Used as a timing reference rather than a data carrier

1PPS is often combined with another protocol (such as IRIG‑B or NMEA) to provide both **absolute time** and **precise alignment**.

### IEEE‑1588 Precision Time Protocol (PTP)

**IEEE‑1588** defines a network‑based protocol for synchronizing clocks across distributed systems.

Key features:

* Sub‑microsecond synchronization accuracy
* Ethernet‑based communication
* Supports master‑slave clock architectures
* Commonly used in measurement, control, and automation networks

PTP is increasingly adopted in modern digital substations and real‑time simulation environments.

## How the driver works

1. A time reference (IRIG‑B, 1PPS, or IEEE‑1588) is provided to or generated by the simulator.
2. The OPAL‑RT time **synchronization** driver aligns the simulator’s internal clock to the selected reference.
3. Real‑time models execute using a time‑aligned clock, enabling accurate timestamping.
4. Time or clock signals can be distributed externally to synchronize connected hardware or simulations.

## Example applications

* **Power System Protection Testing**\
  Real‑time simulations are synchronized with GPS‑based clocks to validate relay timing, fault response, and event sequencing.
* **Phasor Measurement Unit (PMU) Validation**\
  Accurate time stamping ensures compliance with synchrophasor standards and enables precise phase angle comparison.
* **Hardware‑in‑the‑Loop (HIL) Simulation**\
  External controllers and FPGA platforms remain cycle‑accurate with the simulator.
* **Distributed Real‑Time Simulation**\
  Multiple simulators and test systems operate under a common time reference using IEEE‑1588 PTP.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/configure-ios/time-synchronization-driver.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
