Skip to content

System Analysis

Luke edited this page Jun 29, 2026 · 1 revision

Sync Board Software Introduction

This firmware system adopts a modular design, balancing time synchronization accuracy, low-latency control, and ease of use, providing stable and flexible software support for multi-sensor fusion systems. The overall functionality is shown in the figure below:

image

Where the timestamp input comes from the host computer or GPS, and is then clocked in the local system board. The system time is then converted to PWM rising edges, PPS timestamps, and other formats according to different needs for time distribution to various sensors. Essentially, the Sync Board is a time distribution device that supports different devices and different formats.

Time Management Functionality

The internal system time of the Sync Board comes from the stable UTC (Coordinated Universal Time) time sent by the host computer. To achieve higher time synchronization accuracy, a PTP-like software synchronization mechanism is used for timestamp alignment between the host computer and the Sync Board.

$$ t_{pc} == t_{sys} $$

Another time source comes from GPS, which is unstable (indoor) and not equipped with GPS devices in all scenarios. Therefore, GPS timestamp data will only be collected and not used for the overall system time; instead, the time difference between GPS and the system is estimated in real time. Users can choose to use the provided system time or GPS time, and their conversion relationship is as follows:

$$ t_{sys} = t_{gps} + \Delta t $$

Homologous PWM Generation

Homologous PWM refers to PWM signals with different frequencies but the same phase, ensuring that the trigger times of external sensors are in a multiple relationship.

image2

For example, if a camera acquires at 10Hz and an external IMU acquires at 100Hz, homologous PWM ensures that the camera acquisition moment corresponds exactly to one frame of IMU data.

The Sync Board will capture the rising edge moment of PWM and record it for feedback to the host computer, so the host computer can accurately obtain the time of each trigger moment.

PPS+GPRMC Timestamp Output Functionality

Supports standard PPS+GPRMC timestamp output functionality:

image3

PPS signal and GPRMC signal timing output:

Parameter Description Valid Range Used Value
t0 Interval between two adjacent pulse-per-second rising edges 900 ms ~ 1100 ms 1000 ms
t1 High-level duration of the pulse-per-second signal 5 ms ~ 900 ms 10 ms ~ 200 ms
t2 GPRMC transmission time (baud rate: 9600bps) ≈ 70 ms 70 ms
t3 Delay of GPRMC data start relative to the pulse rising edge 0 ms ~ 900 ms 0 ms ~ 430 ms

Typical GPRMC data format output is:

image4

Communication Protocol

The communication between the Sync Board and the running node uses JSON format, divided into two types of information formats: configuration format and data transmission format.

Configuration Transmission

{"f":"cfg","port":8888,"ip":[192,168,1,188],"subnet":[255,255,255,0],"hz_cam_1":1,"hz_cam_2":2,"hz_cam_3":4,"hz_cam_4":8,"hz_imu_2":10,"xtal_diff":0,"uart_0_baud_rate":921600,"uart_1_baud_rate":9600,"uart_2_baud_rate":115200,"use_gps":true,"use_pps":true,"version":400}\n

Corresponding command descriptions:

  "f": "cfg",                 // Configuration file type identifier (fixed as "cfg")
  "port": 8888,               // Network communication port number
  "ip": [192,168,1,188],      // Device IP address
  "subnet": [255,255,255,0],  // Subnet mask configuration
  "hz_cam_1": 20,             // Camera 1 trigger frequency (unit: Hz, recommended ≤100Hz)
  "hz_cam_2": 30,             // Camera 2 trigger frequency (unit: Hz, recommended ≤100Hz)
  "hz_cam_3": 40,             // Camera 3 trigger frequency (unit: Hz, recommended ≤100Hz)
  "hz_cam_4": 50,             // Camera 4 trigger frequency (unit: Hz, recommended ≤100Hz)
  "hz_imu_2":1                // IMU2 trigger frequency (unit: Hz, recommended ≤100Hz)
  "uart_0_baud_rate": 921600, // Communication baud rate (Type-C) (high-speed mode, for time sync/sensor data)
  "uart_1_baud_rate": 9600,   // PPS baud rate (LiDAR) (low-speed mode, for LiDAR synchronization)
  "uart_2_baud_rate": 115200, // GPS baud rate (GPS/RTK) (medium-speed mode, for GPS data reading)
  "use_gps": true,            // GPS module enable flag
  "use_pps": true,            // PPS precise clock sync signal enable flag
  "xtal_diff":0,              // Crystal oscillator deviation correction
  "version": 400              // Firmware version number (V3/MINI: 300, V4: 400)

After configuration, the serial port assistant prints the following information:

{"f":"log","t":11320243,"l":"INFO","msg":"Config file received!"}
{"f":"log","t":11321532,"l":"INFO","msg":"Config set ok"}
{"f":"cfg","port":8888,"ip":[192,168,1,188],"subnet":[255,255,255,0],"hz_cam_1":1,"hz_cam_2":2,"hz_cam_3":4,"hz_cam_4":8,"hz_imu_2":10,"xtal_diff":0,"uart_0_baud_rate":921600,"uart_1_baud_rate":9600,"uart_2_baud_rate":115200,"use_gps":true,"use_pps":true,"version":400}
{"f":"log","t":11325745,"l":"INFO","msg":"Port parsed: 8888"}
{"f":"log","t":11326439,"l":"INFO","msg":"IP array set: 192.168.1.188"}
{"f":"log","t":11327234,"l":"INFO","msg":"Subnet array set: 255.255.255.0"}
{"f":"log","t":11328054,"l":"INFO","msg":"Device frequencies parsed: [1, 2, 4, 8, 10]"}
{"f":"log","t":11329034,"l":"INFO","msg":"UART baud rates parsed: [921600, 9600, 115200]"}
{"f":"log","t":11329939,"l":"INFO","msg":"GPS and PPS flags parsed: use_gps:1, use_pps:1"}
{"f":"log","t":11330800,"l":"INFO","msg":"Xtal diff set: 0"}
{"f":"log","t":11331380,"l":"INFO","msg":"Version set: 400"}
{"f":"log","t":11331935,"l":"INFO","msg":"Version parsed: 400"}
{"f":"log","t":1003932,"l":"INFO","msg":"[USB-TYPC] Configuration complete! baudrate:921600"}
{"f":"cfg","port":8888,"ip":[192,168,1,188],"subnet":[255,255,255,0],"hz_cam_1":1,"hz_cam_2":2,"hz_cam_3":4,"hz_cam_4":8,"hz_imu_2":10,"xtal_diff":0,"uart_0_baud_rate":921600,"uart_1_baud_rate":9600,"uart_2_baud_rate":115200,"use_gps":true,"use_pps":true,"version":400}

Data Transmission

1. IMU Data

{
  "f": "imu",            # Data type
  "t": 1745767254869878, # Timestamp
  "c": 920480,           # Acquisition frame count
  "d": [                 # IMU raw data
    0.416606,            # Accelerometer x-axis
    -0.181966,           # Accelerometer y-axis
    9.993754,            # Accelerometer z-axis
    0.003141,            # Gyroscope x-axis
    0.001038,            # Gyroscope y-axis
    0.000016,            # Gyroscope z-axis
    28.50241             # Temperature
  ],
  "q": [                 # Orientation calculated by the onboard IMU
    0.999765,            # Quaternion w
    -0.009251,           # Quaternion x
    -0.021048,           # Quaternion y
    -0.013569            # Quaternion z
  ]
}

2. GPS Data

Sync system time is the synchronized host time, i.e., host time.

{
  "f": "GNGGA",          # Data type
  "g": false,            # Whether it was a PPS-triggered acquisition
  "t": 21664068,         # Sync system timestamp when GPS data was received (us)
  "d": "$GNGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47\r",
  "pps": 21664010        # GPS pulse-per-second trigger, corresponding sync system timestamp (us)
}

GPS received data interpretation:

$GNGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
    Time (123519): UTC time 12:35:19
    Latitude (4807.038,N): Latitude 48°07.038' N (i.e., 48 degrees 7.038 minutes North latitude)
    Longitude (01131.000,E): Longitude 11°31.000' E (i.e., 11 degrees 31.000 minutes East longitude)
    Positioning status (1): Indicates GPS positioning is valid
    Number of satellites (08): 8 satellites used for positioning
    HDOP (0.9): Horizontal dilution of precision is 0.9, good accuracy
    Altitude (545.4): Elevation 545.4 meters
    Unit (M): Altitude unit is meters
    Geoidal separation (46.9,M): Separation from geoid is 46.9 meters
    Age of differential correction data: No differential correction data, therefore empty
    Checksum (*47): Checksum is 47

3. PWM Device Rising Edge Trigger Time

{
  "f": "t",                     # Data type
  "s": 32,                      # (uint8_t) Status bits
  "t": 1745767200873878,        # Timestamp
  "c": 893482                   # Acquisition frame count
} 

📝 中文页面 (Chinese Page)

Clone this wiki locally