Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background &...

33
V0.1 | 2018-03-14 Mark Zurawski Time Synchronization – An Overview

Transcript of Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background &...

Page 1: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

V0.1 | 2018-03-14

Mark Zurawski

Time Synchronization – An Overview

Page 2: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

2

Background & Motivation

Demonstrator: Concept and Implementation

Different Methods for Time Synchronization

Summary

Agenda

Page 3: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

3

Why do we need Time Synchronzation?

Background & Motivation

➢ Measurement Device – Gives a timestamp to every measured value.

➢ Internal Time ≠ UTC Time18.254°C!

At 2017-09-25 16:58:21.254789,

it was 18.254°C outside!

Page 4: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

4

Why do we need Time Synchronzation?

Background & Motivation

➢ Measurement Device – Gives a timestamp to every measured value.

➢ Internal Time ≠ UTC Time

➢ Multiple Devices Multiple Independent Clocks

Page 5: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

5

Why do we need Time Synchronzation?

Background & Motivation

➢ Measurement Device – Gives a timestamp to every measured value.

➢ Internal Time ≠ UTC Time

➢ Multiple Devices Multiple Independent Clocks

➢ We need Time Synchronization!!!

Page 6: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

6

Use-Case

XCP - Gateway

XCP - Gateway

HV ECAT ADMM HSECAT ADMM HS

3-Phase Electric Motor

3-PhaseInverter

V1V2V3V4

I4

I3

I2

I1

EtherCAT

EtherCAT

AC (3~)

DC

Switch

XCP onEthernet

XCP onEthernet

Laptop with CANape

Background & Motivation

POD

XCP onEthernet

Page 7: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

7

Time Synchronization Demonstrator

Demonstrator: Concept and Implementation

t

Δt

XCP - Gateway XCP - Gateway

ECAT ADMM HS ECAT ADMM HS

Vector CANape

Page 8: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

8

Different methods of

Time Synchronization

Vector Software

Sync

XCP 1.0

Vector Hardware

Sync

XCP 1.0

Vector

SoftwareSync

XCP 1.3

Precision Time Protocol

Sync

XCP 1.3

Time Synchronisation Methods at Vector/CSM

Different Methods for Time Synchronization

Year 2003 Year 2015

Page 9: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

9

How to change XCP Protocol in CANape?

Different Methods for Time Synchronization

Vector software (CANape) fully supports all the features of XCP Version 1.0 and 1.3

The protocol version can be changed in the device configuration for each connected device, respectively.

Setting can be found under “protocol” in the device configuration

The used Hardware must support the XCP Version. It might not work otherwise. Check with the Manufacturer before using it!!!

Page 10: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

10

1. Vector Software Sync (XCP 1.0)

Different Methods for Time Synchronization

Switch

XCP onEthernet

Device 1Device 2

Laptop with CANape

Page 11: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

11

1. Vector Software Sync (XCP 1.0)

Different Methods for Time Synchronization

Page 12: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

12

1. Vector Software Sync (XCP 1.0)

Different Methods for Time Synchronization

Page 13: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

13

Proof of Concept (Trace Window)

Different Methods for Time Synchronization

Connect two XCP devices (here CSM396 and CSM397).

Look out for “GET_DAQ_CLOCK” commands. They are sent individually to both the devices every second (Time: 0.850604 s & 0.850649 s)

Each device responds individually with its time stamp. (Time:0.851037 s & 0.851052 s)

Typical communication using XCP 1.0 time synchronization

Page 14: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

14

Proof of Concept (Trace Window)

Different Methods for Time Synchronization

Page 15: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

15

Time Synchronization Demonstrator XCP 1.0 Software Sync (16uS offset)

Demonstrator: Concept and Implementation

Page 16: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

16

2. Vector Hardware Sync (XCP 1.0)

Different Methods for Time Synchronization

Switch

XCP onEthernet

Device 1

Device 2

Laptop with CANape

VN1630A

Multi SYNCboxexternal

XCP Master

1039 µs

1040 µs

1041 µs

1042 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs

1049 µs

1050 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

+13 µs

+13 µs

+13 µs

+13 µs

+13 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

+98 µs

+98 µs

+98 µs

+98 µs

+98 µs

1050 µs +13 µs+98 µs

Slave 1

940 µs

941 µs

942 µs

943 µs

944 µs

945 µs

946 µs

947 µs

948 µs

949 µs

950 µs

951 µs

951 µs

Slave 2

1026 µs

1027 µs

1028 µs

1029 µs

1030 µs

1031 µs

1032 µs

1033 µs

1034 µs

1035 µs

1036 µs

1037 µs

1038 µs

VN1630AUSB

Page 17: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

17

2. Vector Hardware Sync (XCP 1.0)

Different Methods for Time Synchronization

XCP Master

1039 µs

1040 µs

1041 µs

1042 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs

1049 µs

1050 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

+13 µs

+13 µs

+13 µs

+13 µs

+13 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

+98 µs

+98 µs

+98 µs

+98 µs

+98 µs

1050 µs +13 µs+98 µs

Slave 1

940 µs

941 µs

942 µs

943 µs

944 µs

945 µs

946 µs

947 µs

948 µs

949 µs

950 µs

951 µs

951 µs

Slave 2

1026 µs

1027 µs

1028 µs

1029 µs

1030 µs

1031 µs

1032 µs

1033 µs

1034 µs

1035 µs

1036 µs

1037 µs

1038 µs

VN1630A

Page 18: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

18

2. Vector Hardware Sync (XCP 1.0)

Different Methods for Time Synchronization

XCP Master

1039 µs

1040 µs

1041 µs

1042 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs

1049 µs

1050 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

+13 µs

+13 µs

+13 µs

+13 µs

+13 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

0 µs

+98 µs

+98 µs

+98 µs

+98 µs

+98 µs

1050 µs +13 µs+98 µs

Slave 1

940 µs

941 µs

942 µs

943 µs

944 µs

945 µs

946 µs

947 µs

948 µs

949 µs

950 µs

951 µs

951 µs

Slave 2

1026 µs

1027 µs

1028 µs

1029 µs

1030 µs

1031 µs

1032 µs

1033 µs

1034 µs

1035 µs

1036 µs

1037 µs

1038 µs

VN1630A

Page 19: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

19

What is new in XCP 1.3 with Respect to Time Synchronization?

Different Methods for Time Synchronization

XCP 1.3

BroadcastCommands

Hardware-based

time sampling

Support for

external clocks

Page 20: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

20

3. Vector Software Sync (XCP 1.3)

Different Methods for Time Synchronization

Switch

XCP onEthernet

Device 1Device 2

Laptop with CANape

Page 21: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

21

3. Vector Software Sync (XCP 1.3)

Different Methods for Time Synchronization

Page 22: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

22

3. Vector Software Sync (XCP 1.3)

Different Methods for Time Synchronization

Page 23: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

23

Proof of Concept (Trace Window)

Different Methods for Time Synchronization

Connect two XCP devices (here CSM396 and CSM397).

Look out for the “GET_DAQ_CLOCK_MULTICAST” Command sent as a broadcast to all the XCP devices every second. (Time: 0.850333s)

Each device responds individually with its time stamp inside a Time Synchronization Event (Time:0.850784 s & 0.850807 s)

Typical communication using XCP 1.3 time synchronization

Page 24: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

24

Proof of Concept (Trace Window)

Different Methods for Time Synchronization

Page 25: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

25

Time Synchronization Demonstrator XCP 1.3 Software Sync (431 nS offset)

Demonstrator: Concept and Implementation

Page 26: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

26

4. Precision Time Protocol Sync (XCP 1.3)

Different Methods for Time Synchronization

PTPv2 Switch

XCP onEthernet

Device 1Device 2

Laptop with CANape

Master(PTP Switch)

1039 µs

1040 µs

1041 µs

1042 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs

1049 µs

1050 µs

Slave

940 µs

941 µs

942 µs

943 µs

944 µs

945 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs!! Not Synchronized Yet !!

Page 27: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

27

4. Precision Time Protocol Sync (XCP 1.3)

Different Methods for Time Synchronization

Master(PTP Switch)

1039 µs

1040 µs

1041 µs

1042 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs

1049 µs

1050 µs

Slave

940 µs

941 µs

942 µs

943 µs

944 µs

945 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs!! Not Synchronized Yet!!

Page 28: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

28

4. Precision Time Protocol Sync (XCP 1.3)

Different Methods for Time Synchronization

Master(PTP Switch)

1039 µs

1040 µs

1041 µs

1042 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs

1049 µs

1050 µs

Slave

940 µs

941 µs

942 µs

943 µs

944 µs

945 µs

1043 µs

1044 µs

1045 µs

1046 µs

1047 µs

1048 µs!! Not Synchronized Yet!!

Page 29: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

29

4. Precision Time Protocol Sync (XCP 1.3)

Different Methods for Time Synchronization

Master(PTP Switch)

1051 µs

1052 µs

1053 µs

1054 µs

1055 µs

1056 µs

1057 µs

1058 µs

1059 µs

1060 µs

Slave

1049 µs

1050 µs

1051 µs

1052 µs

1053 µs

1054 µs

1055 µs

1056 µs

1059 µs

1060 µs

Delay = 2 µs

!! Synchronized !!

Page 30: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

30

Proof of Concept (Write Window)

Different Methods for Time Synchronization

Connect two XCP devices (here CSM396 and CSM397).

Both devices are synchronized with Precision Time Protocol switch (Grand Master Clock).

Information of the clock inside the XCP device can be seen in the write window.

Information of the Grandmaster clock to the clock in the XCP device can also be seen.

The UUID of both the Grandmaster clocks are same → both devices are synchronized to the

same Grandmaster Clock.

Clock 1

Grandmaster Clock to Clock 1

Clock 2

Grandmaster Clock to Clock 2

Page 31: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

31

Time Synchronization Demonstrator XCP 1.3 PTP Sync (0 uS offset)

Demonstrator: Concept and Implementation

Page 32: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

32

Summary

XCP 1.0

Software Sync

XCP 1.3

Software Sync

XCP 1.3

PTP Sync

Page 33: Time Synchronization An Overview - Vector...Time Synchronization –An Overview. 2 Background & Motivation Demonstrator: Concept and Implementation Different Methods for Time Synchronization

33

Summary

Summary

➢ Need for time synchronization

➢ Comparison – Time synchronization mechanisms

➢ Software Synchronization (XCP 1.0) 16 uS offset

➢ Vector Hardware Synchronization (XCP 1.0)

➢ Software Synchronization (XCP 1.3) 431 nS offset

➢ Precision Time Protocol (XCP 1.3) Synchronized

SW-Sync (XCP1.0) < HW-Sync (XCP 1.0) < SW-Sync (XCP1.3) < PTP = A Measuring Device