SNLA465 January   2025 DP83TC817S-Q1 , DP83TC818S-Q1 , DP83TG721S-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1The Role of Time Sensitive Networking in Automotive Applications
  5. 2Generalized Precision Time Protocol Algorithm Overview
    1. 2.1 gPTP Timetamping Handshake Process
  6. 3Methods of Implementing gPTP: Timestamping Location
  7. 4Fixed Latency and Recovered Clock Modes
  8. 5Event Triggers and Monitors
  9. 6Simplified gPTP Integration
  10. 7Conclusion
  11. 8References

Generalized Precision Time Protocol Algorithm Overview

IEEE 802.1AS implementation in ECUs typically requires two components:

  • Timestamping of IEEE 802.1AS packets (also known as PTP packets)
  • Using timestamps generated by the first component for computing the path delay, countering the offset, and ppm drift compensation.

The first component is typically implemented in hardware for better synchronization accuracy while second component is typically implemented in software also known as gPTP.

The following section outlines how the gPTP algorithm achieves time synchronization with the reference clock of two ECUs, one leader and follower. In IEEE 802.1AS, this reference synchronized clock is also known as the Time of Day reference clock or Wall Clock. The Wall Clock (see Figure 2-1) can be modeled as a counter that toggles at a fixed increment.

 Wall Clock Model Figure 2-1 Wall Clock Model

There are three main tasks gPTP as to perform. The first task is to synchronize the Wall Clock of the follower ECU to the leader ECU, since each ECU can start at a different time. Figure 2-2 shows, for two wall clocks to be synced, the delay, Δt, must be the same.

  Delay Offset Between Two
                    Clocks Figure 2-2 Delay Offset Between Two Clocks

The second task of gPTP is to correct for the PPM drift of the Wall Clock source. Every clock has some PPM clock drift that causes the frequency to shift slightly so even if the delay is aligned, the clock ppm drift can introduce another delay, Δf, between cycles.

 Frequency Offset Between Two
                    Clocks Figure 2-3 Frequency Offset Between Two Clocks

To solve for this difference in counters (time offset) and frequency (clock drift) between two clock signals, the leader ECU and follower ECU can exchange a set of timestamps to calculate the difference. When calculating the delay between the two Wall Clocks, there is a path delay caused by the time the timestamps take to travel between leader and follower.

The third task of gPTP is to calculate and account for this path delay.

Figure 2-4 shows the set of timestamps exchanged between the leader and follower to calculate path delay, time offset, and clock drift compensation.

 gPTP Time Offset and Clock
                    Drift Equations in Two-Step Synchronization Figure 2-4 gPTP Time Offset and Clock Drift Equations in Two-Step Synchronization