​1. Overview

There are cameras, lasers, inertial navigation and other sensor equipment on the map collection vehicle. The collected data are images, laser point clouds, trajectories, etc. In the process of generating map data, these data need to be correlated, but these devices are their own It runs independently, and the one that can complete this task is the time synchronization system .

The time synchronization system is based on the time information of GPS (Global Positioning System) for time service. This article mainly describes GPS timing principle, timing method, timing process and abnormal situations in timing system.

2. GPS timing principle

GPS satellites are equipped with high-precision atomic clocks (cesium atoms), which can maintain high-precision time synchronization between various satellites, and their respective start times can also be very accurate. Due to the clock difference between the user receiver and the satellites, at least four satellites are required for the time reference system of the zero point to achieve navigation and positioning.

After the user has calculated the clock difference between himself and the satellite, he can correct his local clock and synchronize it with the precise clock of the satellite to the same time. This process is called timing .

The principle of the atomic clock: when the electrons in the atom transition from one energy level to another, the frequency is very stable, and using this as a pendulum can get a very precise time.

The principle of GPS timing is that the GPS receiver can simultaneously receive >=4 satellite signals within its field of view at any time, and extract and output two time signals from them after decoding and processing:

(1) The synchronization pulse signal PPS (Pulse Per Second) with a time interval of 1S, the synchronization error between the leading edge of the pulse and the international standard time is <1us.

(2) The information output by the serial port is the international standard time and date corresponding to the frontier of PPS. The most widely used protocol is NMEA-0183, such as $GPGGA, $GPRMC, etc.

GPRMC: Recommended Minimum SpeGPS / TRANSIT Data (RMC) recommended positioning information.

Protocol format:

$GPRMC,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>*hh<CR><LF>

Sample data:

$GPRMC,161229.487,A,3723.2475,N,12158.3416,W,0.13,309.62,120598,*10 

3. GPS timing method

3.1 Relationship between PPS and NMEA

To talk about the GPS timing method, you must first understand the relationship and function of PPS and NMEA. As shown in the figure below, in the case of GPS positioning, PPS will arrive first, and NMEA data will arrive later, but different GPS manufacturers set the difference between the two The time interval is not the same, some milliseconds, and some hundreds of milliseconds.

PPS and NMEA

Yellow: PPS, the rising edge is the zero time of the whole second.

Blue: NMEA, GPS time information, including year, month, day, hour, minute, and second.

3.2 Detailed explanation of GPS timing process

GPS timing system structure diagram

The GPS timing system structure diagram shown in the figure above:

(1) The GPS receiver generates and outputs PPS pulse signal and valid GPS time information in the case of positioning. This information is output by serial communication, TTL/RS232 signal type, ASCII code, baud rate 9600bps~460800bps, configurable , Follow the NMEA-0183 protocol, this protocol has more than a dozen kinds of data information, and the sentence for extracting GPS time information, usually RMC is sufficient to meet the requirements.

(2) The crystal oscillator can provide an accurate clock source for the MCU (Microcontroller Unit, Microcontroller Unit or SCM) to maintain system operation, which is greatly affected by the environment, especially temperature changes. OCXO-constant temperature crystal oscillator can be used, and the temperature characteristic can reach 3ppb.

(3) The specific approach is as follows:

  • By extracting the GPS time information in the RMC, the hour, minute, second, year, month, and day are obtained, and assigned to the system time with the crystal oscillator as the clock source, so that the MCU system time is corrected to UTC time.
  • MCU uses the interrupt mechanism of IO to obtain the pulse time of PPS, and clears the time of milliseconds and below based on this, so as to correct the zero time of the whole second of the system time.
  • Check the time, wait 3 seconds, and then compare the GPS time with the system time to see if it matches, and verify the +1 second or -1 second that may occur when the PPS time service is a whole second.

As shown in the figure above, it is a sample of data tested after the time service. Use the EVENT function of the GPS receiver and the MCU to record the same signal pulse at the same time, and then compare the time. The tested road sections have multiple scenes such as viaducts, shopping malls, loops, and streets. The test duration is 5 hours and 38 minutes, and the comparison result is: second difference=0, microsecond difference<=4us.

3.3 Time synchronization system application of camera synchronization

The source of image data is the sensor on the collection vehicle-camera. Our collection vehicle is equipped with multiple cameras, which are distributed in different positions on the roof platform and face in all directions to collect road signs, POIs, etc. These image information should be related to the location. Only the trajectory information can be used as map data, and the time synchronization system can uniquely match these data.

Camera time synchronization structure diagram of time synchronization system

As shown in the figure above, one of the applications of the time synchronization system is the camera time synchronization structure diagram. When the time system is timed, briefly describe the camera time synchronization method:

(1) The camera works in the external trigger mode, and the MCU provides the trigger source, which is the pulse signal, and records the pulse number.

(2) When the camera takes a photo, the pulse will be output at the time of exposure, which will be captured by the MCU, and the time and serial number of this time will be recorded.

(3) The recorded time information and serial number will be stored, and the storage of the photos will correspond to the serial numbers one by one, and the time information can also be matched with the location track, thus completing the association of the photo and the location.

4. GPS timing exception handling

The principle, method and process of GPS time service are introduced above, and time service can be completed. However, the actual application scenario is complicated and random. Because the GPS receiver is not locked to the positioning process at a fixed time, equipment and environmental factors All have an impact. The system time of the MCU with crystal oscillator as the clock source is in a free-running state before time service. These factors have brought unknown circumstances to GPS time service, here are some abnormal situations;

4.1 PPS and crystal

As shown in the figure above, there are three situations for the alignment of PPS and crystal oscillator clock:

(1) The rising edge of PPS is aligned with the crystal oscillator clock. This is an ideal state. The crystal oscillator provides a perfect 1 second duration for the MCU system time after frequency division and frequency multiplication, but this situation hardly exists.

(2) The system time of the MCU is slower than 1 second, the PPS arrival enters the next 1 second, and the system time has not ended the current second, special processing is needed at this time, the whole second of the system time is ended early, and the zero of the next 1 second is immediately entered For time, the unit of second and above of the time information corresponds to "+1".

(3) The system time of the MCU is faster than 1 second. Before the PPS comes, the system time has entered the next 1 second and has been running for a period of time. At this time, the system time should be reset to the zero time of this second, and the second of the time information is not required. "+1" or "-1".

4.2 PPS and GPS time information

Usually PPS and GPS time information NMEA data are relatively stable in time interval, but there are special cases. As shown in the figure above: the output time of the "GNRMC" sentence changes.

This situation will bring about the phenomenon of time "rebound": when the time information arrives at 0.999 seconds, the time information it contains is the current second, before the time information transmission and analysis are completed, the next 1 second PPS arrives, and the time Enter the next 1 second zero time, and then a certain amount of time (generally within 100ms), the time information time the system time, at this time the second information is the time of the previous 1 second, so that the second jump back occurs.

There are many ways to deal with it, so you can think about it yourself.

5. Summary

Understand the principles and methods of GPS time service, and be able to design a stable and high-precision time synchronization system. On this basis, you can try to use GPS equipment from different manufacturers to test in a complex environment to fill in the gaps and improve the timing method.

6. Appendix

PPS signal processing: anti-interference, filter out clutter interference

GPS time signal level conversion

Crystal processing signal: control clock voltage amplitude, DC blocking filter


高德技术
458 声望1.8k 粉丝

关于高德的技术创新内容将呈现于此