KR20170124213A - UTC Time Synchronization Method for a Device using GPS Module - Google Patents

UTC Time Synchronization Method for a Device using GPS Module Download PDF

Info

Publication number
KR20170124213A
KR20170124213A KR1020160053816A KR20160053816A KR20170124213A KR 20170124213 A KR20170124213 A KR 20170124213A KR 1020160053816 A KR1020160053816 A KR 1020160053816A KR 20160053816 A KR20160053816 A KR 20160053816A KR 20170124213 A KR20170124213 A KR 20170124213A
Authority
KR
South Korea
Prior art keywords
time
signal
value
module
received
Prior art date
Application number
KR1020160053816A
Other languages
Korean (ko)
Other versions
KR101965932B1 (en
Inventor
정한균
임기택
신대교
윤상훈
장수현
진성근
Original Assignee
전자부품연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 전자부품연구원 filed Critical 전자부품연구원
Priority to KR1020160053816A priority Critical patent/KR101965932B1/en
Publication of KR20170124213A publication Critical patent/KR20170124213A/en
Application granted granted Critical
Publication of KR101965932B1 publication Critical patent/KR101965932B1/en

Links

Images

Classifications

    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/02Setting the time according to the time information carried or implied by the radio signal the radio signal being sent by a satellite, e.g. GPS
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S19/00Satellite radio beacon positioning systems; Determining position, velocity or attitude using signals transmitted by such systems
    • G01S19/01Satellite radio beacon positioning systems transmitting time-stamped messages, e.g. GPS [Global Positioning System], GLONASS [Global Orbiting Navigation Satellite System] or GALILEO
    • GPHYSICS
    • G04HOROLOGY
    • G04GELECTRONIC TIME-PIECES
    • G04G7/00Synchronisation
    • G04G7/02Synchronisation by radio
    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/02Setting the time according to the time information carried or implied by the radio signal the radio signal being sent by a satellite, e.g. GPS
    • G04R20/04Tuning or receiving; Circuits therefor
    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/02Setting the time according to the time information carried or implied by the radio signal the radio signal being sent by a satellite, e.g. GPS
    • G04R20/06Decoding time data; Circuits therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Electric Clocks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

A UTC time synchronization method of a device using GPS is provided. A time synchronization method according to an embodiment of the present invention includes allowing a processor to use a first signal to set a time value in seconds of a system time, allowing the processor to use a second signal to set a time value in seconds or less of the system time. Accordingly, it is possible to synchronize with UTC time in nano-microseconds, thereby improving the accuracy and performance of a device/system.

Description

GPS를 이용하는 장치의 UTC 시간 동기 방법{UTC Time Synchronization Method for a Device using GPS Module}[0001] UTC Time Synchronization Method for a Device Using GPS [0002] UTC Time Synchronization Method for a Device using GPS Module [

본 발명은 시간 동기 방법에 관한 것으로, 더욱 상세하게는 GPS(Global Positioning System) 모듈을 장착하고 이를 기반으로 장치의 시간을 동기화하는 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a time synchronization method, and more particularly, to a method of synchronizing time of a device by mounting a Global Positioning System (GPS) module.

일반적으로 GPS 모듈은 GPS 위성으로부터 수신된 정보를 기반으로 UTC(Universal Time Coordinated) 시간 값을 획득(=GPS 모듈의 시계가 UTC 시간과 동기화됨)하며, 이를 UART(Universal Asynchronous Receiver/Transmitter) 등의 인터페이스를 통해 NMEA(National Marine Electronics Association) 메시지 형식으로 GPS 모듈에 연결된 장치의 CPU(Central Processing Unit) 등으로 전달한다.In general, the GPS module obtains a Universal Time Coordinated (UTC) time value based on the information received from the GPS satellite (= the GPS module clock is synchronized with the UTC time) and transmits it to a UART (Universal Asynchronous Receiver / Transmitter) Interface to a central processing unit (CPU) of a device connected to the GPS module in the form of a National Marine Electronics Association (NMEA) message.

일반적인 장치 및 시스템에서, 시간 동기 모듈(예: 시스템 시계를 UTC 시간에 동기화시키는 소프트웨어 모듈)은 GPS 모듈로부터 수신된 UTC 시간 값을 시스템 시간으로 설정함으로써 시스템 시계를 UTC 시간에 동기화할 수 있는데, 이러한 방법에는 다음과 같은 문제점이 있다.In common devices and systems, a time synchronization module (eg, a software module that synchronizes the system clock to UTC time) can synchronize the system clock to UTC time by setting the UTC time value received from the GPS module to system time, The method has the following problems.

- 낮은 분해능: GPS 모듈로부터 수신되는 UTC 시간 값은 초 단위의 값을 가지므로, 초 단위 미만(밀리초, 마이크로 초, 나노 초)의 동기화가 불가능하다.- Low resolution: The UTC time value received from the GPS module has a value in seconds, so it is impossible to synchronize less than a second (millisecond, microsecond, nanosecond).

- GPS 전송타이밍 오차: GPS 모듈이 "UTC 시간 값을 획득한 시점"과 "장치로 출력하는 시점" 사이에 시간 차가 존재할 수 있으며, 시간 동기 모듈은 이 시간차 및 시간 차들의 표준편차를 알지 못하므로, 정확한 동기화가 불가능하다.- GPS transmission timing error: There may be a time difference between the time when the GPS module acquires the UTC time value and the time when it outputs to the device. Since the time synchronization module does not know the standard deviation of these time differences and time differences , Precise synchronization is impossible.

- 전송 지연: GPS 모듈이 시간 동기 모듈에 데이터를 전송하는 데 전송 지연이 발생한다.- Transmission delay: Transmission delay occurs when the GPS module transmits data to the time synchronization module.

- 처리 지연: 시간 동기 모듈이 GPS 모듈로부터 전달받은 NMEA 메시지 데이터를 처리하여 UTC 시간 값을 뽑아내고 이를 시스템 시간으로 설정하는 절차 동안의 처리 지연이 발생한다. (선점형 운영체제 기반에서 동작 시, 프로세스 스케줄링으로 인해 예측할 수 없는 지연이 발생한다.)- Processing Delay: The time synchronization module processes the NMEA message data received from the GPS module to extract the UTC time value and a processing delay occurs during the procedure of setting it as the system time. (When running on a preemptive operating system, there is an unpredictable delay due to process scheduling.)

위와 같이, GPS 모듈이 제공하는 UTC 시간 값의 단위는 초 단위 수준이고, GPS 모듈이 "최초로 UTC 시간 값을 획득한 시점"과 최종적으로 "시스템 시간을 설정하는 시점" 사이에는 예측할 수 없는 오차가 존재하므로, 시스템 시계를 UTC 시간에 정확히 동기화하는 데 한계가 있다.As mentioned above, the unit of the UTC time value provided by the GPS module is in the order of seconds, and there is an unpredictable error between the time at which the GPS module acquires the UTC time value for the first time and finally the time at which the system time is set There is a limitation in accurately synchronizing the system clock with the UTC time.

본 발명은 상기와 같은 문제점을 해결하기 위하여 안출된 것으로서, 본 발명의 목적은, GPS 모듈이 장착된 특정 장치/시스템에서 나노~마이크로 초 단위의 UTC 시간에 동기화하는 UTC 시간 동기 방법을 제공함에 있다.It is an object of the present invention to provide a UTC time synchronization method of synchronizing UTC time in nano-microsecond time in a specific device / system equipped with a GPS module .

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른, 시간 동기 방법은, 프로세서가, 제1 신호를 이용하여 시스템 시간의 초 단위 시간 값을 설정하는 제1 설정 단계; 및 상기 프로세서가, 제2 신호를 이용하여 상기 시스템 시간의 초 단위 이하의 시간 값을 설정하는 제2 설정 단계;를 포함한다.According to an aspect of the present invention, there is provided a time synchronization method including: a first setting step of setting a time value of a system time in seconds using a first signal; And a second setting step in which the processor sets a time value less than a second of the system time using a second signal.

그리고, 상기 제2 신호는, 인터럽트 신호이고, 상기 제2 설정 단계는, 인터럽트 처리 루틴에서 수행될 수 있다.The second signal is an interrupt signal, and the second setting step may be performed in an interrupt processing routine.

또한, 상기 제1 신호는, GPS 모듈로부터 수신되는 NMEA 메시지이고, 상기 제2 신호는, 상기 GPS 모듈로부터 수신되는 PPS 신호일 수 있다.The first signal may be an NMEA message received from the GPS module, and the second signal may be a PPS signal received from the GPS module.

그리고, 상기 제2 설정 단계는, 상기 제2 신호 발생 시간을 저장하는 단계;를 더 포함하고, 상기 제1 설정 단계는, 상기 제1 신호가 수신된 시스템 시간과 저장된 상기 제2 신호 발생 시간의 차가 기준 값 보다 크면, 상기 제1 신호를 이용하여 시스템 시간의 초 단위 시간 값을 설정할 수 있다.The second setting step may further include the step of storing the second signal generation time, wherein the first setting step includes a step of setting the second signal generation time of the first signal, If the difference is greater than the reference value, the first signal may be used to set a time value in seconds of the system time.

또한, 상기 제1 설정 단계는, 상기 제1 신호로부터 추출한 초 단위 시간 값을 내부 변수에 저장하는 단계; 및 상기 제2 신호가 수신되면, 상기 내부 변수에 저장된 초 단위 시간 값 + 1을 상기 시스템 시간의 초 단위 시간 값으로 설정하는 단계;를 포함할 수 있다.In addition, the first setting step may include: storing a time unit value extracted from the first signal in an internal variable; And setting a second time value + 1 stored in the internal variable as a time unit value of the system time when the second signal is received.

그리고, 상기 제1 설정 단계는, 상기 제1 신호가 수신된 시스템 시간과 저장된 상기 제2 신호 발생 시간의 차가 기준 값 이하이면, 상기 제1 신호를 무시할 수 있다.The first setting step may ignore the first signal if the difference between the system time at which the first signal is received and the stored second signal generation time is less than a reference value.

또한, 상기 기준 값은, 상기 제1 신호를 처리함에 있어 발생하는 지연 시간을 기초로 결정될 수 있다.Also, the reference value may be determined based on a delay time occurring in processing the first signal.

한편, 본 발명의 다른 실시예에 따른, 시스템은, 시간 정보를 포함하고 있는 제1 신호와 제2 신호를 발생시키는 모듈; 및 상기 모듈로부터 수신한 제1 신호를 이용하여 시스템 시간의 초 단위 시간 값을 설정하고, 상기 모듈로부터 수신한 제2 신호를 이용하여 상기 시스템 시간의 초 단위 이하의 시간 값을 설정하는 프로세서;를 포함한다.According to another aspect of the present invention, there is provided a system including: a module for generating a first signal and a second signal including time information; And a processor for setting a time value in seconds of the system time using the first signal received from the module and setting a time value in seconds or less of the system time using the second signal received from the module .

이상 설명한 바와 같이, 본 발명의 실시예들에 따르면, GPS 모듈이 장착된 특정 장치/시스템에서 나노~마이크로 초 단위의 UTC 시간에 동기화하는 것이 가능해지며, 이에 의해 장치/시스템의 정확도와 성능 향상이 가능해진다.As described above, according to the embodiments of the present invention, it is possible to synchronize the UTC time in nano-microseconds in a specific device / system equipped with the GPS module, thereby improving the accuracy and performance of the device / It becomes possible.

도 1은 본 발명이 적용 가능한 시스템의 블럭도,
도 2는 정상 동작 타이밍 상황을 나타낸 도면,
도 3은 비정상 동작 타이밍 상황을 나타낸 도면,
도 4는 본 발명의 일 실시예에 따른 시간 동기 방법의 설명에 제공되는 흐름도, 그리고,
도 5는, 도 4에 도시된 시간 동기 방법에서의 구체적인 처리 과정을 예시한 도면이다.
1 is a block diagram of a system to which the present invention is applicable;
2 is a diagram showing a normal operation timing situation,
3 is a diagram showing an abnormal operation timing situation,
FIG. 4 is a flowchart illustrating a time synchronization method according to an embodiment of the present invention,
5 is a diagram illustrating a specific processing procedure in the time synchronization method shown in FIG.

이하에서는 도면을 참조하여 본 발명을 보다 상세하게 설명한다.Hereinafter, the present invention will be described in detail with reference to the drawings.

도 1은 본 발명이 적용 가능한 시스템의 블럭도이다. 도 1에 도시된 바와 같이, 본 발명이 적용 가능한 시스템은, CPU(Central Processing Unit)(120)에 GPS(Global Positioning System) 모듈(110)을 연결하여 구축한다. 구체적으로, GPS 모듈(110)의 NMEA(National Marine Electronics Association) 메시지 출력 핀과 PPS 신호 핀을 CPU(120)에 연결한다.1 is a block diagram of a system to which the present invention is applicable. As shown in FIG. 1, a system to which the present invention can be applied is constructed by connecting a Global Positioning System (GPS) module 110 to a CPU (Central Processing Unit) 120. Specifically, the NMEA (National Marine Electronics Association) message output pin of the GPS module 110 and the PPS signal pin are connected to the CPU 120.

이에, CPU(120)에서 실행되는 시스템 시계를 UTC(Universal Time Coordinated) 시간에 동기화시키는 소프트웨어 모듈인 시간 동기 모듈(130)이 NMEA 메시지를 수신 및 처리하여 UTC 시간 값을 얻을 수 있도록 한다.Accordingly, the time synchronization module 130, which is a software module that synchronizes the system clock executed by the CPU 120 in UTC (Universal Time Coordinated) time, receives and processes the NMEA message to obtain the UTC time value.

또한, GPS 모듈(110)의 PS 신호 핀을 CPU(120)의 인터럽트 입력으로 연결하여, PPS 신호 발생 시 인터럽트 처리 루틴이 호출될 수 있도록 한다. PPS는 GPS 모듈(110)이 정확한 UTC 1초 시점마다 출력하는 펄스로써, 실제 UTC 시간에서 수 나노 초 정도 수준의 오차를 가진다.Also, the PS signal pin of the GPS module 110 is connected to the interrupt input of the CPU 120 so that the interrupt processing routine can be called when the PPS signal is generated. The PPS is a pulse output by the GPS module 110 every 1 second of UTC, and has an error of about several nanoseconds from the actual UTC time.

도 1에 도시된 시스템의 기본 동작은 다음과 같다.The basic operation of the system shown in Fig. 1 is as follows.

- Phase1: 시간 동기 모듈(130)이 GPS 모듈(110)로부터 수신한 NMEA 메시지에서 획득한 초 단위 UTC 시간 값을 내부 변수(=utcTime)에 저장해 둔다.- Phase 1: The time synchronization module 130 stores the UTC time value in seconds acquired in the NMEA message received from the GPS module 110 in an internal variable (= utcTime).

- Phase2: 이후, 시간 동기 모듈(130)은 GPS 모듈(110)로부터 PPS 신호가 수신되면, 인터럽트 처리 루틴에서 내부 변수(=utcTime)에 저장해 둔 초 단위 UTC 시간 값을 시스템 시간으로 설정하고, 마이크로 초 단위 시간 값을 0으로 설정한다.- Phase 2: After receiving the PPS signal from the GPS module 110, the time synchronization module 130 sets the UTC time value in seconds stored in the internal variable (= utcTime) in the interrupt processing routine as the system time, Set the time value in seconds to zero.

이를 통해 앞서 기술된 문제점 중 아래 문제점들이 해결 가능하다.Thus, the following problems can be solved.

- 전송 지연: 전송 지연 자체는 그대로 존재하나, "전송 시점"과 "시스템 시간 설정 시점"이 각각 Phase1, Phase2로 분리되어 시스템 시간 설정 시점에 전송 지연이 누적되어 적용되지 않는다.- Transmission delay: Although the transmission delay itself is present, the transmission delay is accumulated and not applied since the transmission time and the system time setting time are separated into Phase 1 and Phase 2, respectively.

- 처리 지연: 처리 지연 자체는 그대로 존재하나, "NMEA 메시지 파싱 및 UTC 시간 값 획득시점"과 "시스템 시간 설정 시점"이 각각 Phase1, Phase2로 분리되어 시스템 시간 설정 시점에 처리 지연이 누적되어 적용되지 않으며, 시스템 시간 설정 동작을 인터럽트 처리 루틴에서 수행하므로, 타 프로세스에 의해 선점되지 않아 지연이 매우 작고 예측 가능하다.- Processing delay: The processing delay itself exists, but the processing delay is accumulated and accumulated at the time of setting the system time by separating "NMEA message parsing and UTC time value acquisition point" and "system time setting point" into Phase 1 and Phase 2 respectively Since the system time setting operation is performed in the interrupt processing routine, the delay is very small and predictable because it is not preempted by other processes.

- 낮은 분해능: PPS 인터럽트에서 마이크로 초 단위 시간을 0으로 설정하면, PPS 자체의 오차(수 나노 초 단위)와 인터럽트 처리 루틴의 지연(수~수십 나노 초 단위)을 고려하더라도 마이크로 초 단위의 시간을 동기화할 수 있다. 보다 높은 정확성을 위해서 0 마이크로 초 대신에 PPS 오차와 측정된 인터럽트 처리 루틴 지연을 적용한 나노 초 단위 값을 설정할 수 있다.- Low resolution: Setting the microsecond time to 0 in the PPS interrupt sets the time in microseconds, even if you take into account the error of the PPS itself (in nanoseconds) and the delay of the interrupt handling routine (in the range of several to several tens of nanoseconds) You can synchronize. For higher accuracy, you can set the nanosecond unit value by applying the PPS error and the measured interrupt processing routine delay instead of 0 microseconds.

위와 같은 방법을 통해 전송 지연, 처리 지연, 낮은 분해능 문제점을 해결할 수 있으며, GPS 타이밍 오차는 다음과 같이 해결된다.In this way, transmission delay, processing delay, and low resolution problems can be solved, and the GPS timing error can be solved as follows.

시간 동기 모듈(130)은 GPS 모듈(110)이 획득한 UTC 시간을 언제 출력하는지 알 수 없다. 또한 UTC 시간이 특정 타이밍에 출력되는 경우, 도 2에 도시된 바와 같이 정상 동작할 수 있지만, 도 3에 도시된 바와 같이 UTC 시간이 1초 단위로 틀어지는 현상이 발생할 수 있다.The time synchronization module 130 can not know when the GPS module 110 outputs the acquired UTC time. In addition, when the UTC time is output at a specific timing, it can operate normally as shown in FIG. 2. However, as shown in FIG. 3, the UTC time may be shifted by one second.

즉, GPS 모듈(110)이 UTC 시간 값을 획득한 후 이를 출력하는 도중에 UTC 초가 변경되면(비정상 동작 타이밍), 시간 동기 모듈(130)이 UTC 시간 값을 획득한 시점에는 '현재 UTC - 1'의 초 값을 가지게 된다.That is, when the UTC time value is acquired and the UTC time is changed during the output of the UTC time value, the time synchronization module 130 acquires the UTC time value, Lt; / RTI > seconds.

이를 위해, 도 4에 도시된 시간 동기 방법을 제시한다. 도 4는 본 발명의 일 실시예에 따른 시간 동기 방법의 설명에 제공되는 흐름도이다.To this end, the time synchronization method shown in FIG. 4 is presented. 4 is a flow chart provided in the description of the time synchronization method according to an embodiment of the present invention.

도 4에 도시된 바와 같이, 먼저 시간 동기 모듈(130)은 PPS 발생 시마다, 현재의 시스템 시간 기준으로 "PPS 발생 시각"을 내부 변수(=utcTime)에 저장한다(S210).As shown in FIG. 4, the time synchronization module 130 stores the "PPS occurrence time" in the internal variable (= utcTime) on the basis of the current system time each time the PPS is generated (S210).

그리고, GPS 모듈(110)로부터 UTC 시간 값이 포함된 NMEA 메시지를 수신하면(S220), 시간 동기 모듈(130)은 "UTC 시간 값이 포함된 NMEA 메시지를 수신 완료한 순간의 시스템 시각(Tcurrent)"과 내부 변수(=utcTime)에 저장해 둔 "PPS 발생 시각(Tpps)" 차이를 계산한다(S230).Upon receiving the NMEA message including the UTC time value from the GPS module 110 in step S220, the time synchronization module 130 determines whether the NMEA message including the UTC time value is received at the system time instant Tcurrent, PPS occurrence time (Tpps) "stored in the internal variable (= utcTime) (S230).

시간 차이를 계산하는 것은 다음과 같은 타이밍 오차(Tdiff)를 방지하기 위한 것이다.The calculation of the time difference is to prevent the following timing error (Tdiff).

Tdiff = Dmsg + Dgps Tdiff = Dmsg + Dgps

- Dmsg: NMEA 메시지가 GPS 모듈(110)로부터 시간 동기 모듈(130)까지 전달되는 데 소요되는 전송 지연- Dmsg: transmission delay required for the NMEA message to be transmitted from the GPS module 110 to the time synchronization module 130

- Dgps: GPS 모듈(110) 내부에서 발생하는 실제 시각과 메시지에 수납되는 시각의 차이- Dgps: Difference between the actual time inside the GPS module 110 and the time stored in the message

(Tcurrent - Tpps) ≤ Tdiff 이면(S240-N), 시간 동기 모듈(130)은 해당 NMEA 메시지를 무시한다(S260). 즉, 계산된 시간 차이가 타이밍 오차가 발생할 만큼 짧은 경우, 해당 NMEA 메시지 내의 UTC 시간을 무시하는 것이다.(Tcurrent - Tpps) < Tdiff (S240-N), the time synchronization module 130 ignores the NMEA message (S260). That is, if the computed time difference is short enough to cause a timing error, the UTC time in the NMEA message is ignored.

예를 들어, GPS 모듈(110)로부터 시리얼 포트를 통해 NMEA 메시지를 수신하며, baudrate가 9,600인 경우(가장 느린 속도), 약 30바이트 길이의 라인(대략적인 NMEA 라인 길이)을 수신한다고 가정하면, 전송 지연은 약 25msec 정도가 된다.For example, if it is assumed that a NMEA message is received from the GPS module 110 via the serial port and a line (approximately NMEA line length) of about 30 bytes long is received when the baud rate is 9,600 (the slowest rate) The transmission delay is about 25 msec.

이는, 시간 값이 전달되는 25msec + Dgps 사이에 PPS 인터럽트가 발생하면, 도 3에 도시된 비정상 동작 타이밍에 해당되게 된다. 따라서, 시간 동기 모듈(130)은 (Tcurrent - Tpps)가 (25msec(=Dmsg) + Dgps)보다 작으면 해당 메시지를 무시한다. 즉, 내부 변수인 utcTime을 업데이트 하지 않는다.This occurs when the PPS interrupt occurs between 25 msec + Dgps at which the time value is transmitted, which corresponds to the abnormal operation timing shown in FIG. Accordingly, the time synchronization module 130 ignores the message if (Tcurrent - Tpps) is less than (25 msec (= Dmsg) + Dgps). That is, it does not update the internal variable utcTime.

한편, baudrate가 115,200인 경우 전송 지연은 약 2msec 정도가 되므로, CPU(120)는 시리얼 포트의 baudrate를 기반으로 Dmsg를 다르게 계산할 수도 있다. Dgps는 제품의 데이터시트를 통해 확인 또는 추측할 수 있다. 예를 들어, 제품에 따라 5msec가 될 수도 있다.On the other hand, when the baud rate is 115,200, the transmission delay is about 2 msec, so the CPU 120 may calculate the Dmsg differently based on the baud rate of the serial port. Dgps can be verified or guessed through the product data sheet. For example, it may be 5msec depending on the product.

UTC 시간 값을 포함하는 NMEA 메시지는 최소 xxZDA, xxRMC, xxGLL, xxGGA 4가지이므로, 적어도 하나의 메시지는 PPS 발생시점으로부터 25msec 이후의 시점에 수신된다.Since the NMEA message including the UTC time value is at least four xxZDA, xxRMC, xxGLL and xxGGA messages, at least one message is received at a time point after 25 msec after the PPS occurrence.

반면, (Tcurrent - Tpps) > Tdiff 이면(S240-Y), 시간 동기 모듈(130)은 해당 NMEA 메시지를 사용하여, 시스템 시각을 설정한다(S250). 즉, 계산된 시간 차이가 타이밍 오차가 발생할 정도의 구간 보다 길면, 해당 NMEA 메시지 내의 UTC 시간을 사용하는 것이다.On the other hand, if (Tcurrent - Tpps)> Tdiff (S240-Y), the time synchronization module 130 sets the system time using the NMEA message (S250). That is, if the calculated time difference is longer than the interval in which the timing error occurs, the UTC time in the corresponding NMEA message is used.

구체적으로 S250단계에서는, 시간 동기 모듈(130)이 NMEA 메시지에서 UTC 시간 값을 추출하여 내부 변수(utcTime)에 해당 시각을 저장하고, 다음 번 PPS 인터럽트 처리 루틴에서 utcTime + 1초 값을 시스템 시각으로 설정한다.Specifically, in step S250, the time synchronization module 130 extracts the UTC time value from the NMEA message and stores the time in the internal variable (utcTime). In the next PPS interrupt processing routine, the value of utcTime + Setting.

도 5에는, 도 4에 도시된 시간 동기 방법에서 '(Tcurrent - Tpps) ≤ Tdiff'인 경우와 '(Tcurrent - Tpps) > Tdiff'인 경우의 처리 과정을 구체적으로 예시하였다.FIG. 5 illustrates a process of '(Tcurrent - Tpps) Tdiff' and '(Tcurrent - Tpps)> Tdiff' in the time synchronization method shown in FIG.

지금까지, GPS를 이용하는 장치의 UTC 시간 동기 방법에 대해 바람직한 실시예를 들어 상세히 설명하였다.Up to now, the UTC time synchronization method of a device using GPS has been described in detail with a preferred embodiment.

본 발명의 실시예에서는, GPS 모듈(110)이 장착된 시스템에서 시스템 시계를 UTC 시간에 나노~마이크로 초 단위로 동기화하는 기법을 제시하였다.In the embodiment of the present invention, a method of synchronizing the system clock in nano-microsecond units in UTC time in a system equipped with the GPS module 110 is proposed.

이 기법은 GPS 모듈을 이용하는 시스템이라면 제한 없이 적용 가능하다. GPS를 이용하는 WAVE 차량용 단말은 물론, 그 밖의 다른 시스템에도 본 발명의 기술적 사상이 적용될 수 있다.This technique can be applied to any system using a GPS module without limitation. The technical idea of the present invention can be applied not only to a WAVE vehicle terminal using GPS, but also to other systems.

한편, 본 실시예에 따른 장치와 방법의 기능을 수행하게 하는 컴퓨터 프로그램을 수록한 컴퓨터로 읽을 수 있는 기록매체에도 본 발명의 기술적 사상이 적용될 수 있음은 물론이다. 또한, 본 발명의 다양한 실시예에 따른 기술적 사상은 컴퓨터로 읽을 수 있는 기록매체에 기록된 컴퓨터로 읽을 수 있는 코드 형태로 구현될 수도 있다. 컴퓨터로 읽을 수 있는 기록매체는 컴퓨터에 의해 읽을 수 있고 데이터를 저장할 수 있는 어떤 데이터 저장 장치이더라도 가능하다. 예를 들어, 컴퓨터로 읽을 수 있는 기록매체는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광디스크, 하드 디스크 드라이브, 등이 될 수 있음은 물론이다. 또한, 컴퓨터로 읽을 수 있는 기록매체에 저장된 컴퓨터로 읽을 수 있는 코드 또는 프로그램은 컴퓨터간에 연결된 네트워크를 통해 전송될 수도 있다.It goes without saying that the technical idea of the present invention can also be applied to a computer-readable recording medium having a computer program for performing the functions of the apparatus and method according to the present embodiment. In addition, the technical idea according to various embodiments of the present invention may be embodied in computer-readable code form recorded on a computer-readable recording medium. The computer-readable recording medium is any data storage device that can be read by a computer and can store data. For example, the computer-readable recording medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical disk, a hard disk drive, or the like. In addition, the computer readable code or program stored in the computer readable recording medium may be transmitted through a network connected between the computers.

또한, 이상에서는 본 발명의 바람직한 실시예에 대하여 도시하고 설명하였지만, 본 발명은 상술한 특정의 실시예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 발명의 기술적 사상이나 전망으로부터 개별적으로 이해되어져서는 안될 것이다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but, on the contrary, It will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the present invention.

110 : GPS 모듈
120 : CPU
130 : 시간 동기 모듈
110: GPS module
120: CPU
130: Time synchronization module

Claims (8)

프로세서가, 제1 신호를 이용하여 시스템 시간의 초 단위 시간 값을 설정하는 제1 설정 단계; 및
상기 프로세서가, 제2 신호를 이용하여 상기 시스템 시간의 초 단위 이하의 시간 값을 설정하는 제2 설정 단계;를 포함하는 것을 특징으로 하는 시간 동기 방법.
A processor comprising: a first setting step of setting a time value in seconds of a system time using a first signal; And
And a second setting step wherein the processor sets a time value less than a second of the system time using a second signal.
청구항 1에 있어서,
상기 제2 신호는, 인터럽트 신호이고,
상기 제2 설정 단계는, 인터럽트 처리 루틴에서 수행되는 것을 특징으로 하는 시간 동기 방법.
The method according to claim 1,
The second signal is an interrupt signal,
And the second setting step is performed in an interrupt processing routine.
청구항 2에 있어서,
상기 제1 신호는, GPS 모듈로부터 수신되는 NMEA 메시지이고,
상기 제2 신호는, 상기 GPS 모듈로부터 수신되는 PPS 신호인 것을 특징으로 하는 시간 동기 방법.
The method of claim 2,
The first signal is an NMEA message received from the GPS module,
And the second signal is a PPS signal received from the GPS module.
청구항 1에 있어서,
상기 제2 설정 단계는,
상기 제2 신호 발생 시간을 저장하는 단계;를 더 포함하고,
상기 제1 설정 단계는,
상기 제1 신호가 수신된 시스템 시간과 저장된 상기 제2 신호 발생 시간의 차가 기준 값 보다 크면, 상기 제1 신호를 이용하여 시스템 시간의 초 단위 시간 값을 설정하는 것을 특징으로 하는 시간 동기 방법.
The method according to claim 1,
Wherein the second setting step comprises:
And storing the second signal generation time,
Wherein the first setting step comprises:
Wherein a time unit of a system time is set using the first signal if the difference between the system time at which the first signal is received and the stored second signal generation time is greater than a reference value.
청구항 4에 있어서,
상기 제1 설정 단계는,
상기 제1 신호로부터 추출한 초 단위 시간 값을 내부 변수에 저장하는 단계;
상기 제2 신호가 수신되면, 상기 내부 변수에 저장된 초 단위 시간 값 + 1을 상기 시스템 시간의 초 단위 시간 값으로 설정하는 단계;를 포함하는 것을 특징으로 하는 시간 동기 방법.
The method of claim 4,
Wherein the first setting step comprises:
Storing a time unit value extracted from the first signal in an internal variable;
And setting a second time value + 1 stored in the internal variable as a time unit value of the system time when the second signal is received.
청구항 4에 있어서,
상기 제1 설정 단계는,
상기 제1 신호가 수신된 시스템 시간과 저장된 상기 제2 신호 발생 시간의 차가 기준 값 이하이면, 상기 제1 신호를 무시하는 것을 특징으로 하는 시간 동기 방법.
The method of claim 4,
Wherein the first setting step comprises:
And ignoring the first signal if the difference between the system time at which the first signal is received and the stored second signal generation time is less than or equal to a reference value.
청구항 6에 있어서,
상기 기준 값은,
상기 제1 신호를 처리함에 있어 발생하는 지연 시간을 기초로 결정되는 것을 특징으로 하는 시간 동기 방법.
The method of claim 6,
Wherein,
Wherein the delay time is determined based on a delay time occurring in processing the first signal.
시간 정보를 포함하고 있는 제1 신호와 제2 신호를 발생시키는 모듈; 및
상기 모듈로부터 수신한 제1 신호를 이용하여 시스템 시간의 초 단위 시간 값을 설정하고, 상기 모듈로부터 수신한 제2 신호를 이용하여 상기 시스템 시간의 초 단위 이하의 시간 값을 설정하는 프로세서;를 포함하는 것을 특징으로 하는 시스템.
A module for generating a first signal and a second signal including time information; And
And a processor for setting a time value in seconds of the system time using the first signal received from the module and setting a time value in seconds or less of the system time using the second signal received from the module Lt; / RTI >
KR1020160053816A 2016-05-02 2016-05-02 UTC Time Synchronization Method for a Device using GPS Module KR101965932B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160053816A KR101965932B1 (en) 2016-05-02 2016-05-02 UTC Time Synchronization Method for a Device using GPS Module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160053816A KR101965932B1 (en) 2016-05-02 2016-05-02 UTC Time Synchronization Method for a Device using GPS Module

Publications (2)

Publication Number Publication Date
KR20170124213A true KR20170124213A (en) 2017-11-10
KR101965932B1 KR101965932B1 (en) 2019-04-03

Family

ID=60386822

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160053816A KR101965932B1 (en) 2016-05-02 2016-05-02 UTC Time Synchronization Method for a Device using GPS Module

Country Status (1)

Country Link
KR (1) KR101965932B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109799523A (en) * 2018-12-29 2019-05-24 中国电子科技集团公司第二十研究所 A kind of celestial combined navigation method, system time synchronization
CN114721249A (en) * 2022-03-17 2022-07-08 齐鲁空天信息研究院 Microsecond single chip microcomputer timing device and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006010638A (en) * 2004-06-29 2006-01-12 Seiko Precision Inc Time data acquisition device, computer program, and server
JP2011122983A (en) * 2009-12-11 2011-06-23 Toshiba Corp Time synchronization device and method for time synchronization correction
KR20130113247A (en) * 2012-04-05 2013-10-15 (주) 시스메이트 Apparatus and method for generating stable utc time data
KR20130134458A (en) * 2012-05-31 2013-12-10 주식회사 디에스텍 An apparatus for synchronizing measure time and a method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006010638A (en) * 2004-06-29 2006-01-12 Seiko Precision Inc Time data acquisition device, computer program, and server
JP2011122983A (en) * 2009-12-11 2011-06-23 Toshiba Corp Time synchronization device and method for time synchronization correction
KR20130113247A (en) * 2012-04-05 2013-10-15 (주) 시스메이트 Apparatus and method for generating stable utc time data
KR20130134458A (en) * 2012-05-31 2013-12-10 주식회사 디에스텍 An apparatus for synchronizing measure time and a method thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109799523A (en) * 2018-12-29 2019-05-24 中国电子科技集团公司第二十研究所 A kind of celestial combined navigation method, system time synchronization
CN114721249A (en) * 2022-03-17 2022-07-08 齐鲁空天信息研究院 Microsecond single chip microcomputer timing device and method
CN114721249B (en) * 2022-03-17 2024-01-23 齐鲁空天信息研究院 Microsecond level singlechip timing device and method

Also Published As

Publication number Publication date
KR101965932B1 (en) 2019-04-03

Similar Documents

Publication Publication Date Title
EP2683110A1 (en) Synchronization system, synchronization method, first synchronization device, second synchronization device, and computer program
CN110492965B (en) Method and device for synchronizing time of serial messages in master-slave system
CN111585682B (en) Sensor time synchronization method and device and terminal equipment
US20200127752A1 (en) Time synchronization device and time synchronization method
JP2002318276A (en) Method, apparatus, and system for gps time synchronization using cellular signal burst
EP3202062B1 (en) Distribution of dynamic accuracy information in a network of ieee 1588 clocks
EP2811672A1 (en) Communication apparatus, communication system, and communication method for time synchronization
CN109240159B (en) Multi-channel synchronous signal triggering method, terminal, data acquisition system and storage medium
CN110224778A (en) A kind of clock synchronizing method of distributed system
US20220248353A1 (en) Synchronization method and device
US11303376B2 (en) Information processing apparatus and time synchronization method
KR101965932B1 (en) UTC Time Synchronization Method for a Device using GPS Module
KR101967027B1 (en) Improved UTC Time Synchronization Method for a Device using GPS Module in Abnormal Operation Condition
CN113419598B (en) Clock synchronization system and method for multi-SOC (system on chip)
CN107800500A (en) A kind of method, apparatus and equipment for determining time synchronized message clock time
JP2001324584A (en) Time synchronizer, time synchronizing system, and method of controlling time synchronizer
US11675318B2 (en) Multi-interface GPS time synchronization
CN104935394A (en) Time signal generator and time tester
CN106647228B (en) Converter station master clock fault judgment system
WO2016000324A1 (en) Method and apparatus for implementing time synchronization
JP4080397B2 (en) Parallel computer
CN204697070U (en) Time signal generator and time tester
KR102093223B1 (en) Apparatus and method for synchronizing time of power control system
CN107846245B (en) Design method of synchronous double-star GPS original measurement data
EP2398173A1 (en) Remote I/O system and synchronization method in the same

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
E902 Notification of reason for refusal
AMND Amendment
E902 Notification of reason for refusal
AMND Amendment
E601 Decision to refuse application
AMND Amendment
X701 Decision to grant (after re-examination)