TW202321935A - Synchronization correction method, master device and slave device - Google Patents
Synchronization correction method, master device and slave device Download PDFInfo
- Publication number
- TW202321935A TW202321935A TW110142370A TW110142370A TW202321935A TW 202321935 A TW202321935 A TW 202321935A TW 110142370 A TW110142370 A TW 110142370A TW 110142370 A TW110142370 A TW 110142370A TW 202321935 A TW202321935 A TW 202321935A
- Authority
- TW
- Taiwan
- Prior art keywords
- time
- time point
- period
- signal
- phase compensation
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
- H04L7/0016—Arrangements for synchronising receiver with transmitter correction of synchronization errors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
Abstract
Description
本發明是有關於一種裝置間的同步機制,且特別是有關於一種同步校正方法、主控裝置及僕裝置。The present invention relates to a synchronization mechanism between devices, and in particular to a synchronization correction method, a master device and a slave device.
請參照圖1A,其是習知的同步機制示意圖。在圖1A中,主控(Master)裝置可透過3條信號傳輸線連接於僕(slave)裝置,而主控裝置可透過這些信號傳輸線分別傳送頻率資訊(例如10MHz)、相位資訊(例如一秒脈衝(a pulse per second,1PPS)信號)及日時間(Time of date,ToD)資訊至僕裝置,以讓僕裝置據以進行同步。Please refer to FIG. 1A , which is a schematic diagram of a conventional synchronization mechanism. In Figure 1A, the master (Master) device can be connected to the slave (slave) device through three signal transmission lines, and the master control device can transmit frequency information (such as 10MHz) and phase information (such as a second pulse) through these signal transmission lines. (a pulse per second, 1PPS) signal) and time of day (Time of date, ToD) information to the slave device, so that the slave device can synchronize accordingly.
然而,由於圖1A的方式需使用3條信號傳輸線,因此佈線上並不方便。However, since the method in FIG. 1A needs to use three signal transmission lines, it is not convenient for wiring.
請參照圖1B,其是習知的另一同步機制示意圖。在圖1B中,主控裝置可透過單一條信號傳輸線連接於僕裝置,並可透過脈衝寬度調變(pulse width modulation,PWM)來將同步信號(例如嵌入式PPS(embedded PPS,ePPS)信號)發送至僕裝置,藉以實現如靶場間儀器組-B(Inter-Range Instrumentation Group B,IRIG-B)的技術。Please refer to FIG. 1B , which is a schematic diagram of another conventional synchronization mechanism. In FIG. 1B , the master control device can be connected to the slave device through a single signal transmission line, and a synchronization signal (such as an embedded PPS (embedded PPS, ePPS) signal) can be transmitted through pulse width modulation (PWM). Sent to slave devices to implement technologies such as Inter-Range Instrumentation Group B (IRIG-B).
請參照圖1C,其是習知的PWM示意圖。在本實施例中,位元「0」例如可基於PWM的概念而調變為工作週期(duty cycle)為25%的脈波,而位元「1」例如可基於PWM的概念而調變為工作週期為75%的脈波。在圖1C中,信號「1011」例如可依上述原則而調變為所示的脈波序列,但可不限於此。Please refer to FIG. 1C , which is a schematic diagram of a conventional PWM. In this embodiment, the bit "0" can be modulated into a pulse wave with a duty cycle of 25% based on the concept of PWM, and the bit "1" can be modulated into a pulse wave based on the concept of PWM. The duty cycle is 75% of the pulse wave. In FIG. 1C , the signal "1011" can be modulated into the pulse sequence shown, for example, according to the above principles, but it is not limited thereto.
由圖1B可看出,其雖降低了佈線上的難度,但由於主控裝置係單向傳輸信號至僕裝置,故僕裝置無法得知因線長或其他因素所導致的延遲誤差。It can be seen from FIG. 1B that although it reduces the difficulty of wiring, since the master control device transmits signals to the slave device in one direction, the slave device cannot know the delay error caused by the line length or other factors.
有鑑於此,本發明提供一種同步校正方法、主控裝置及僕裝置,其可用於解決上述技術問題。In view of this, the present invention provides a synchronization correction method, a master control device and a slave device, which can be used to solve the above technical problems.
本發明提供一種同步校正方法,適於一主控裝置,包括:在第i秒鐘的第一期間中,發送一同步信號框至一僕裝置,其中同步信號框包括一同步標頭、一第一一秒脈衝(a pulse per second,1PPS)信號、第一日時間資訊及第一相位補償資訊,其中第一相位補償資訊用以要求僕裝置修正在所述第i秒鐘的第二期間中發送一第一參考1PPS信號的一發送時間點;在所述第i秒鐘的第二期間中從僕裝置接收第一參考1PPS信號;依據接收第一參考1PPS信號的一接收時間點決定在第i+1秒鐘的第一期間中發送至僕裝置的一第二相位補償資訊。The present invention provides a synchronous correction method suitable for a master control device, comprising: sending a synchronization signal frame to a slave device during the first period of the i-th second, wherein the synchronization signal frame includes a synchronization header, a first A pulse per second (a pulse per second, 1PPS) signal, first time of day information and first phase compensation information, wherein the first phase compensation information is used to request the slave device to correct during the second period of the ith second Send a sending time point of a first reference 1PPS signal; receive the first reference 1PPS signal from the slave device during the second period of the i second; determine the first reference 1PPS signal according to a receiving time point of receiving the first reference 1PPS signal A second phase compensation message sent to the slave device during the first period of i+1 seconds.
本發明提供一種主控裝置,包括處理電路及補償估計電路。處理電路經配置以:在第i秒鐘的第一期間中,發送一同步信號框至一僕裝置,其中同步信號框包括一同步標頭、一第一一秒脈衝(a pulse per second,1PPS)信號、第一日時間資訊及第一相位補償資訊,其中第一相位補償資訊用以要求僕裝置修正在所述第i秒鐘的第二期間中發送一第一參考1PPS信號的一發送時間點。補償估計電路耦接處理電路,並經配置以:在所述第i秒鐘的第二期間中從僕裝置接收第一參考1PPS信號;依據接收第一參考1PPS信號的一接收時間點決定在第i+1秒鐘的第一期間中發送至僕裝置的一第二相位補償資訊。The invention provides a master control device, which includes a processing circuit and a compensation estimation circuit. The processing circuit is configured to: send a synchronization signal frame to a slave device during a first period of the i-th second, wherein the synchronization signal frame includes a synchronization header, a first one-second pulse (a pulse per second, 1PPS ) signal, first day time information and first phase compensation information, wherein the first phase compensation information is used to request the slave device to correct a sending time of sending a first reference 1PPS signal during the second period of the i second point. The compensation estimation circuit is coupled to the processing circuit and is configured to: receive the first reference 1PPS signal from the slave device during the second period of the ith second; A second phase compensation message sent to the slave device during the first period of i+1 seconds.
本發明提供一種同步校正方法,適於一僕裝置,包括:在第i秒鐘的第一期間中,從一主控裝置接收一同步信號框,其中同步信號框包括一同步標頭、一第一一秒脈衝(a pulse per second,1PPS)信號、第一日時間資訊及第一相位補償資訊;依據第一相位補償資訊修正在所述第i秒鐘的第二期間中發送一第一參考1PPS信號的一發送時間點;在所述第i秒鐘的第二期間的發送時間點發送第一參考1PPS信號至主控裝置。The present invention provides a synchronization correction method suitable for a slave device, comprising: receiving a synchronization signal frame from a master control device during the first period of the i-th second, wherein the synchronization signal frame includes a synchronization header, a first A pulse per second (a pulse per second, 1PPS) signal, first day time information and first phase compensation information; according to the first phase compensation information, a first reference is sent during the second period of the i-th second A sending time point of the 1PPS signal: sending the first reference 1PPS signal to the main control device at the sending time point of the second period of the i-th second.
本發明提供一種僕裝置,包括接收器及處理電路。接收器經配置以:在第i秒鐘的第一期間中,從一主控裝置接收一同步信號框,其中同步信號框包括一同步標頭、一第一一秒脈衝(a pulse per second,1PPS)信號、第一日時間資訊及第一相位補償資訊。處理電路耦接於接收器,並經配置以:依據第一相位補償資訊修正在所述第i秒鐘的第二期間中發送一第一參考1PPS信號的一發送時間點;在所述第i秒鐘的第二期間的發送時間點發送第一參考1PPS信號至主控裝置。The invention provides a slave device, including a receiver and a processing circuit. The receiver is configured to: receive a synchronization signal frame from a master control device during a first period of the i-th second, wherein the synchronization signal frame includes a synchronization header, a first one-second pulse (a pulse per second, 1PPS) signal, first day time information and first phase compensation information. The processing circuit is coupled to the receiver and is configured to: modify a sending time point of sending a first reference 1PPS signal during the second period of the i-th second according to the first phase compensation information; The first reference 1PPS signal is sent to the master control device at the sending time point of the second period of seconds.
請參照圖2,其是依據本發明之一實施例繪示的同步系統示意圖。在圖2中,同步系統200包括主控裝置210及僕裝置220,其中主控裝置210及僕裝置220之間可透過一雙向傳輸介面(其例如是一種同步串列匯流排)連接。亦即,在一些實施例中,主控裝置210除了可將同步所需的資訊發送至僕裝置220之外,亦可從僕裝置220接收反饋的資訊,而主控裝置210及僕裝置220即可在此種雙向溝通的機制中進行同步的校正。Please refer to FIG. 2 , which is a schematic diagram of a synchronization system according to an embodiment of the present invention. In FIG. 2 , the
在一實施例中,主控裝置210包括補償估計電路211及處理電路212,其中處理電路212耦接於補償估計電路211。在一些實施例中,主控裝置210還可包括耦接於處理電路212的日時間電路213,但可不限於此。另外,僕裝置220包括彼此耦接的接收器221及處理電路222。In one embodiment, the
在本發明的實施例中,主控裝置210及僕裝置220可協同實現本發明的同步校正方法,其細節詳述如下。In an embodiment of the present invention, the
請參照圖3,其是依據本發明之一實施例繪示的同步校正方法流程圖。本實施例的方法可由圖2的主控裝置210及僕裝置220執行,以下即搭配圖2所示的元件說明圖3各步驟的細節。Please refer to FIG. 3 , which is a flowchart of a synchronous calibration method according to an embodiment of the present invention. The method of this embodiment can be executed by the
在本發明的實施例中,主控裝置210及僕裝置220在每秒鐘的時間區間內所執行的操作原則大致相同/相似,故以下暫以第i秒鐘內所執行的操作為例作說明,但可不限於此In the embodiment of the present invention, the principles of the operations performed by the
首先,在步驟S311中,在第i秒鐘的第一期間中,主控裝置210的處理電路212發送同步信號框F1至僕裝置220。相應地,在步驟S321中,在第i秒鐘的第一期間中,僕裝置220的接收器221從主控裝置210接收同步信號框F1。First, in step S311 , the
在本發明的實施例中,第i秒鐘至少可區分為第一期間及第二期間,其中第一期間例如是可讓主控裝置210發送信號至僕裝置220的期間,而第二期間例如是主控裝置210聆聽僕裝置220所發送信號的期間,但可不限於此。In an embodiment of the present invention, the i-th second can be at least divided into a first period and a second period, wherein the first period is, for example, a period during which the
請參照圖4,其是依據本發明之一實施例繪示的第i秒鐘的第一期間及第二期間示意圖。如圖4所示,主控裝置210在第i秒鐘的第一期間T1中發送的同步信號框F1例如可依序包括同步標頭411、第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414。在其他實施例中,設計者亦可依需求而調整第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414在同步信號框F1中的順序,但可不限於此。Please refer to FIG. 4 , which is a schematic diagram of the first period and the second period of the i-th second according to an embodiment of the present invention. As shown in FIG. 4, the synchronization signal frame F1 sent by the
在一實施例中,處理電路212可在取得同步標頭411、第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414的內容後,依先前提及的PWM機制將同步標頭411、第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414編碼為對應的PWM信號並進行發送,但可不限於此。In one embodiment, after the
在一實施例中,同步標頭411的內容可設計為某個特定位元組合,藉以讓僕裝置220可在偵測到此特定位元組合之後,判定已收到同步信號框F1,進而將後續的第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414取出並執行後續操作。在不同的實施例中,同步標頭411的長度及內容可依設計者的需求而決定。舉例而言,假設同步標頭411的長度為7位元,且其內容例如為「1011000」。在此情況下,當僕裝置220偵測到「1011000」的特定位元組合之後,僕裝置220即可依據第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414個別對應的預設信號長度而取得第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414。In one embodiment, the content of the
舉例而言,假設第一1PPS信號412、第一日時間資訊413及第一相位補償資訊414的預設信號長度分別為1位元、80位元及32位元,則在僕裝置220偵測到內容為「1011000」的同步標頭411之後,僕裝置220可經配置以:將同步標頭411的次一位元判定為第一1PPS信號412;將第一1PPS信號412後的80個位元判定為第一日時間資訊413;以及將第一日時間資訊413之後的32個位元判定為第一相位補償資訊414,但可不限於此。For example, assuming that the preset signal lengths of the
在一實施例中,主控裝置210可透過日時間電路213決定同步信號框F1中的第一日時間資訊413。在一實施例中,日時間電路213可在取得對應於第i秒鐘的外部日時間ET之後,據以決定第一日時間資訊413的第一成分413a。在一實施例中,所述外部日時間ET例如是紀元時間(epoch time),其可由日時間電路213從網路或其他類似的外部來源所取得,並用以作為第一日時間資訊413的第一成分413a。在本發明的實施例中,在第一日時間資訊413的預設信號長度假設為80位元的情況下,第一成分413a例如可佔第一日時間資訊413的前48個位元,但可不限於此。In one embodiment, the
在一實施例中,日時間電路213可基於系統時鐘信號SC1估計第一日時間資訊413的第二成分413b。在一實施例中,系統時鐘信號SC1可包括多個脈波,而這些脈波的週期例如可因應於系統時鐘信號SC1的頻率而決定。舉例而言,假設系統時鐘信號SC1的頻率為125MHz,則這些脈波的週期例如是8ns(即1/125M)。亦即,每8ns會出現一個脈波。In one embodiment, the time-of-
在此情況下,反應於日時間電路213偵測到系統時鐘信號SC1的脈波的其中之一,日時間電路214可遞增第一計數值。亦即,在系統時鐘信號SC1的頻率為125MHz的情況下,日時間電路214每8ns即會遞增第一計數值。在一實施例中,日時間電路214可以第一計數值作為第一日時間資訊413的第二成分413b。在本發明的實施例中,在第一日時間資訊413的預設信號長度假設為80位元且第一成分413a佔第一日時間資訊413的前48個位元的情況下,第二成分413b例如可佔第一日時間資訊413的後32個位元,但可不限於此。In this case, in response to the time-of-
簡言之,第一日時間資訊413的第一成分413a可由日時間電路413基於外部日時間ET(其精度僅為秒)決定,而第一日時間資訊413的第二成分413b(其精度可達ns)可由日時間電路413自行計數而得,但可不限於此。In short, the first component 413a of the first time of
在一實施例中,第一相位補償資訊414用以要求僕裝置220修正在所述第i秒鐘的第二期間T2中發送第一參考1PPS信號RS的發送時間點。In one embodiment, the first
概略而言,僕裝置220在每秒鐘的第二期間中都經配置以在一預設時間點發送第一參考1PPS信號RS。在一實施例中,第一參考1PPS信號RS例如是1,而第二期間中的其他位元例如是0。換言之,若第二期間的長度經設定為N個位元,則此N個位元中僅有1個位元為1,其他位元皆為0,但可不限於此。Roughly speaking, the
在一實施例中,若主控裝置210及僕裝置220雙方之間為完美同步,則主控裝置210將會在每秒鐘的第二期間中的預設時間點收到來自僕裝置220的第一參考1PPS信號RS。In one embodiment, if there is perfect synchronization between the
然而,由於主控裝置210及僕裝置220之間的同步一般並非完美,因此主控裝置210可能不會在第二期間的預設時間點收到來自僕裝置220的第一參考1PPS信號。例如,主控裝置210可能會在第i-1秒鐘的第二期間中的預設時間點之前/之後收到第一參考1PPS信號RS。亦即,主控裝置210在第i-1秒鐘的第二期間中接收第一參考1PPS信號RS的接收時間點與預設時間點之間可能存在特定時間差。在此情況下,主控裝置210的補償估計電路211可基於此特定時間差產生相應的第一相位補償資訊414,藉以在第i秒鐘的第一期間T1中透過同步信號框F1中將第一相位補償資訊414告知僕裝置220。However, since the synchronization between the
因應於第一相位補償資訊414的內容,僕裝置220可在第二期間T2中提前/延後發送第一參考1PPS信號RS,以試圖讓主控裝置210在第二期間T2的預設時間點接收到第一參考1PPS信號RS。According to the content of the first
在一實施例中,補償估計電路211可取得第i-1秒鐘的第二期間中的預設時間點。在一實施例中,補償估計電路211可取得第i-1秒鐘的同步信號框,並在此同步信號框的結束時間之後加上預設保護時間作為第i-1秒鐘的第二期間中的預設時間點。在不同的實施例中,上述預設保護時間可依設計者的需求而定。In an embodiment, the
在一實施例中,假設第二期間的長度經設定為N個位元,則預設保護時間例如可設定為N/2個位元,但可不限於此。舉例而言,假設N為240,則補償估計電路211例如可在第i-1秒鐘的同步信號框後加上長度為120個(即240/2)位元的預設保護時間作為第i-1秒鐘的第二期間中的預設時間點,但可不限於此。換言之,若主控裝置210與僕裝置220之間為完美同步,則在第i-1秒鐘的第二期間中,應只有第120個位元為1(即,第一參考1PPS信號RS),其他的位元皆為0。然而,若主控裝置210與僕裝置220之間不為完美同步,則第一參考1PPS信號RS出現的位置將不會位於第二期間中的第120個位元。In one embodiment, assuming that the length of the second period is set to be N bits, the preset protection time can be set to, for example, N/2 bits, but it is not limited thereto. For example, assuming that N is 240, the
因此,補償估計電路211可取得在第i-1秒鐘的第二期間中接收第一參考1PPS信號RS的接收時間點與上述預設時間點之間的特定時間差,並基於上述特定時間差決定第一相位補償資訊414。Therefore, the
在一實施例中,反應於判定上述接收時間點超前預設時間點達特定時間差,補償估計電路211可將第一相位補償資訊414設定為用於要求僕裝置220在第i秒鐘的第二期間T2中延後特定時間差發送第一參考1PPS信號RS。例如,假設第一參考1PPS信號RS出現的位置為第二期間的第118個位元,此即代表第一參考1PPS信號RS提前2個位元(即,特定時間差)被主控裝置210接收到。因此,補償估計電路211可將第一相位補償資訊414設定為用於要求僕裝置220在第i秒鐘的第二期間T2中延後2個位元發送第一參考1PPS信號RS。In one embodiment, in response to determining that the receiving time point is ahead of the preset time point by a certain time difference, the
另一方面,反應於判定上述接收時間點落後預設時間點達特定時間差,補償估計電路211可將第一相位補償資訊414設定為用於要求僕裝置220在第i秒鐘的第二期間T2中提前特定時間差發送第一參考1PPS信號RS。例如,假設第一參考1PPS信號RS出現的位置為第二期間的第123個位元,此即代表第一參考1PPS信號RS延後3個位元(即,特定時間差)被主控裝置210接收到。因此,補償估計電路211可將第一相位補償資訊414設定為用於要求僕裝置220在第i秒鐘的第二期間T2中提前3個位元發送第一參考1PPS信號RS。On the other hand, in response to determining that the receiving time point lags behind the preset time point by a certain time difference, the
在一實施例中,假設第一相位補償資訊414的預設信號長度為32個位元,則其最高有效位元(most significant bit,MSB)例如可用於指示僕裝置220應提前/延後發送第一參考1PPS信號RS,而剩餘的31個位元可用於表示上述特定時間差。例如,當第一相位補償資訊414的MSB為1時,第一相位補償資訊414例如可用於要求僕裝置220延後特定時間差發送第一參考1PPS信號RS。另外,當第一相位補償資訊414的MSB為0時,第一相位補償資訊414例如可用於要求僕裝置220提前特定時間差發送第一參考1PPS信號RS,但可不限於此。In one embodiment, assuming that the preset signal length of the first
基此,在步驟S322中,僕裝置220的處理電路222依據第一相位補償資訊414修正在第i秒鐘的第二期間T2中發送第一參考1PPS信號RS的發送時間點。Based on this, in step S322 , the
在一實施例中,僕裝置220的處理電路222取得在第i秒鐘的第二期間T2中發送第一參考1PPS信號RS的預設時間點。在一實施例中,僕裝置220的處理電路222可在同步信號框F1的結束時間之後加上預設保護時間GT作為預設時間點PT,但可不限於此。In one embodiment, the
之後,反應於判定第一相位補償資訊414指示延後特定時間差發送第一參考1PPS信號RS,處理電路222可將預設時間點GT延後特定時間差作為發送時間點PT’。例如,當第一相位補償資訊414的MSB為1時,處理電路222可依據第一相位補償資訊414剩餘的31個位元指示的特定時間差延後預設時間點PT。Afterwards, in response to determining that the first
另一方面,反應於判定第一相位補償資訊414指示提前特定時間差發送第一參考1PPS信號RS,處理器222可將預設時間點GT提前特定時間差作為發送時間點PT’。例如,當第一相位補償資訊414的MSB為0時,處理電路222可依據第一相位補償資訊414剩餘的31個位元指示的特定時間差提前預設時間點PT。On the other hand, in response to determining that the first
之後,在步驟S323中,僕裝置220的處理電路222在第i秒鐘的第二期間T2的發送時間點PT’發送第一參考1PPS信號RS至主控裝置210。相應地,在步驟S312中,主控裝置210的補償估計電路211在第i秒鐘的第二期間T2中從僕裝置220接收第一參考1PPS信號RS。After that, in step S323, the
之後,在步驟S313中,補償估計電路211依據接收第一參考1PPS信號RS的接收時間點決定在第i+1秒鐘的第一期間中發送至僕裝置220的第二相位補償資訊。Afterwards, in step S313 , the
在一實施例中,補償估計電路211決定第二相位補償資訊的方式與決定第一相位補償資訊414的方式類似。舉例而言,補償估計電路211取得第i秒鐘的第二期間T2中的預設時間點PT。例如,補償估計電路211可在同步信號框F1的結束時間之後加上預設保護時間GT作為第i秒鐘的第二期間T2中的預設時間點PT,但可不限於此。之後,補償估計電路211可取得此接收時間點與預設時間點PT之間的特定時間差,並基於此特定時間差決定第二相位補償資訊。In one embodiment, the method of determining the second phase compensation information by the
在一實施例中,反應於判定接收時間點超前預設時間點PT達特定時間差,補償估計電路211可將第二相位補償資訊設定為用於要求僕裝置220在所述第i+1秒鐘的第二期間中延後特定時間差發送第一參考1PPS信號RS。另一方面,反應於判定接收時間點落後預設時間點PT達特定時間差,補償估計電路211可將第二相位補償資訊設定為用於要求僕裝置220在所述第i+1秒鐘的第二期間中提前特定時間差發送第一參考1PPS信號RS。以上手段的細節可參照先前實施例的說明,於此不另贅述。In one embodiment, in response to determining that the receiving time point is ahead of the preset time point PT by a specific time difference, the
之後,主控裝置210即可再相應地產生對應於第i+1秒鐘的同步信號框F2,進而控制僕裝置220修正在第i+1秒鐘的第二期間中發送第一參考1PPS信號RS的發送時間點,但可不限於此。After that, the
由上可知,本發明的實施例可讓主控裝置210及僕裝置220在僅透過單一條信號傳輸線(其例如是一種同步串列匯流排)連接的情況下,仍能雙向地進行溝通。進一步而言,主控裝置210可依據僕裝置220在前一秒鐘反饋第一參考1PPS信號RS的情況,相應地決定下一秒鐘提供給僕裝置220的相位補償資訊。藉此,可讓僕裝置220依據相位補償資訊修正發送第一參考1PPS信號的時間點,進而使主控裝置210及僕裝置220彼此達到較佳的同步效果。As can be seen from the above, the embodiments of the present invention allow the
請參照圖5,其是依據圖2繪示的主控裝置示意圖。在圖5中,主控裝置210除了包括補償估計電路211、處理電路212及日時間電路213之外,還可包括振盪器511、鎖相迴路512及雙向傳輸控制器513。Please refer to FIG. 5 , which is a schematic diagram of the master control device shown in FIG. 2 . In FIG. 5 , besides the
在一實施例中,振盪器511例如是恆溫控制晶體振盪器(Oven Controlled Crystal Oscillator,OCXO)或是其他精準可控的時鐘信號產生器,並可用於提供本地時鐘信號LC1。In one embodiment, the
在一實施例中,鎖相迴路512耦接於振盪器511、補償估計電路211、處理電路212及日時間電路213,並可實現為數位鎖相迴路(digital phase lock loop,DPLL)。在一實施例中,鎖相迴路512可接收外部時鐘信號EC、外部1PPS信號EP及來自振盪器511的本地時鐘信號LC1,並可據以產生系統時鐘信號SC1及第一1PPS信號412。In one embodiment, the phase locked
在一實施例中,日時間電路213可從鎖相迴路512取得系統時鐘信號SC1及第一1PPS信號412,並依據先前的教示而決定日時間資訊413中的第二成分413b。In one embodiment, the time-of-
在一實施例中,補償估計電路211可依據在第i-1秒鐘的第二期間所收到的第一參考1PPS信號RS而決定第一相位補償資訊414,並將第一相位補償資訊414提供予處理電路212。In one embodiment, the
在一實施例中,處理電路212可在取得來自於日時間電路213的系統時鐘信號SC1及日時間資訊413、來自於鎖相迴路512的第一1PPS信號412及來自補償估計電路211的第一相位補償資訊414之後,透過例如PWM的機制而將上述資訊編碼為同步信號框F1。In one embodiment, the
在一實施例中,雙向傳輸控制器513例如可連接於僕裝置220,並可用於控制主控裝置210與僕裝置220之間的雙向傳輸。舉例而言,在第i秒鐘的第一期間T1中,雙向傳輸控制器513例如可將主控裝置210與僕裝置220之間的同步串列匯流排切換低阻抗狀態(即俗稱的low-Z狀態),藉以讓處理電路212將所產生的同步信號框F1發送至僕裝置220。In one embodiment, the
另外,在第i秒鐘的第二期間T2中,雙向傳輸控制器513例如可將主控裝置210與僕裝置220之間的同步串列匯流排切換高阻抗狀態(即俗稱的high-Z狀態),藉以讓補償估計電路211可聆聽來自僕裝置220的第一參考1PPS信號RS。之後,補償估計電路211可依據在第二期間T2收到的第一參考1PPS信號RS而產生第二相位補償資訊,以讓處理電路212可據以產生對應於第i+1秒鐘的同步信號框。相關細節可參照先前實施例中的說明,於此不另贅述。In addition, during the second period T2 of the i-th second, the
請參照圖6,其是依據圖2繪示的僕裝置示意圖。在圖6中,僕裝置220除了包括接收器221及處理電路222之外,還包括振盪器611及雙向傳輸控制器615。Please refer to FIG. 6 , which is a schematic diagram of the slave device shown in FIG. 2 . In FIG. 6 , the
在一實施例中,雙向傳輸控制器615可用於在每秒鐘的第一期間中從主控裝置210接收對應的同步信號框,並在第二期間中將處理電路222提供的第一參考1PPS信號RS發送至主控裝置210。In one embodiment, the two-
在一實施例中,接收器211可包括鎖相迴路612、解碼器613及日時間電路614。在一實施例中,在第i秒鐘的第一期間T1,解碼器613例如可在從雙向傳輸控制器615取得來自主控裝置210的同步信號框F1之後,解碼同步信號框F1以取得第一1PPS信號412、日時間資訊413、第一相位補償資訊414及對應於同步信號框F1的信號頻率FS。In one embodiment, the
在一實施例中,解碼器613可基於同步信號框F1中各個位元之間的時間差而估計同步信號框F1的信號頻率FS。舉例而言,假設同步信號框F1的位元之間的時間差為8ns,則解碼器613可經估計而得到同步信號框F1的信號頻率FS為125MHz(即1/8ns),但可不限於此。In one embodiment, the
在一實施例中,振盪器611例如是OCXO或是其他精準可控的時鐘信號產生器,並可用於提供本地時鐘信號LC2。In one embodiment, the oscillator 611 is, for example, an OCXO or other precisely controllable clock signal generators, and can be used to provide the local clock signal LC2.
在一實施例中,鎖相迴路612耦接於振盪器611及解碼器613,並可基於本地時鐘信號LC2及來自解碼器613的信號頻率FS及第一1PPS信號412而產生系統時鐘信號SC1及第一參考1PPS信號RS。In one embodiment, the phase-locked
在一實施例中,日時間電路614耦接於解碼器613及鎖相迴路612,並可從解碼器613接收日時間資訊413及第一相位補償資訊414,以及從鎖相迴路612接收系統時鐘信號SC1及第一參考1PPS信號RS。In one embodiment, the time-of-
在一實施例中,日時間電路614可將日時間資訊413的第一成分413a作為系統日時間ST的第一時間成分(其精度為秒),再基於系統時鐘信號SC1及日時間資訊413的第二成分413b估計系統日時間ST的第二時間成分(其精度達ns)。In one embodiment, the time of
舉例而言,依先前所言,第二成分413b係由日時間電路213經計數而得的第一計數值,而其數值(以K表示)即代表日時間電路213先前計數了幾個8ns。因此,日時間電路614可相應地藉由計數K個8ns而得到系統日時間ST的第二時間成分。之後,日時間電路614可結合(例如相加)上述第一時間成分及第二時間成分而得到系統日時間ST,但可不限於此。For example, as mentioned above, the
在一實施例中,日時間電路614可基於第一相位補償資訊414而修正第一參考1PPS信號RS的發送時間點。舉例而言,當第一相位補償資訊414的MSB為1時,日時間電路614可在取得在第二期間T2中發送第一參考1PPS信號RS的預設時間點及由第一相位補償資訊414剩餘的31個位元指示的特定時間差之後,將預設時間點延後此特定時間差來修正第一參考1PPS信號RS的發送時間點。另外,當第一相位補償資訊414的MSB為0時,日時間電路614可在取得在第二期間T2中發送第一參考1PPS信號RS的預設時間點及由第一相位補償資訊414剩餘的31個位元指示的特定時間差之後,將預設時間點提前此特定時間差來修正第一參考1PPS信號RS的發送時間點。In one embodiment, the time-of-
之後,處理電路222可依據日時間電路614提供的第一參考1PPS信號RS的修正後發送時間點來發送第一參考1PPS信號至主控裝置210。Afterwards, the
相應地,主控裝置210可再依據在第二期間T2中接收第一參考1PPS信號RS的情形而適應性地調整對應於第i+1秒鐘的同步信號框中的第二相位補償資訊的內容,其細節於此不另贅述。Correspondingly, the
在一實施例中,在僕裝置220取得第一1PPS信號412、信號頻率FS及系統日時間ST之後,僕裝置220可據以執行同步操作,以試圖同步於主控裝置210,但可不限於此。In one embodiment, after the
在一些實施例中,第i秒鐘還可更包括圖4所示的第三期間T3,而此第三期間T3位於第i秒鐘的第二期間T2與第i+1秒鐘的同步信號框F2的第一期間之間,而主控裝置210及僕裝置220可皆不在第三期間T3中進行傳送/接收,但可不限於此。此外,在一實施例中,主控裝置210可在第三期間T3中只傳送頻率訊號(例如是工作週期的50%)至僕裝置220,藉以讓僕裝置220據以與主控裝置210維持頻率同步。In some embodiments, the i-th second may further include a third period T3 shown in FIG. During the first period of frame F2, neither the
此外,在一些實施例中,雖主控裝置210在第二期間T2中未發送信號給僕裝置220,但僕裝置220的鎖相迴路612可進入維時(holdover)模式,藉以在第二期間T2中保持與主控裝置210的同步。In addition, in some embodiments, although the
綜上所述,本發明的實施例可讓主控裝置及僕裝置在僅透過單一同步串列匯流排連接的情況下,仍能雙向地進行溝通。例如,主控裝置可依據僕裝置在前一秒鐘反饋第一參考1PPS信號RS的情況,相應地決定下一秒鐘提供給僕裝置的相位補償資訊。藉此,可讓僕裝置依據相位補償資訊修正發送第一參考1PPS信號的時間點,進而使主控裝置及僕裝置彼此達到較佳的同步效果。To sum up, the embodiments of the present invention allow the master device and the slave device to communicate bidirectionally when only connected through a single synchronous serial bus. For example, the master device can determine the phase compensation information to be provided to the slave device in the next second according to the status of the first reference 1PPS signal RS fed back by the slave device in the previous second. In this way, the slave device can correct the time point of sending the first reference 1PPS signal according to the phase compensation information, so that the master device and the slave device can achieve a better synchronization effect with each other.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed above with the embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. The scope of protection of the present invention should be defined by the scope of the appended patent application.
200:同步系統
210:主控裝置
211:補償估計電路
212:處理電路
213:日時間電路
220:僕裝置
221:接收器
222:處理電路
411:同步標頭
412:第一1PPS信號
413:第一日時間資訊
413a:第一成分
413b:第二成分
414:第一相位補償資訊
511:振盪器
512:鎖相迴路
513:雙向傳輸控制器
611:振盪器
612:鎖相迴路
613:解碼器
614:日時間電路
615:雙向傳輸控制器
F1:同步信號框
RS:第一參考1PPS信號
SC1:系統時鐘信號
ET:外部日時間
T1:第一期間
T2:第二期間
T3:第三期間
GT:預設保護時間
PT:預設時間點
EC:外部時鐘信號
EP:外部1PPS信號
LC1:本地時鐘信號
ST:系統日時間
FS:信號頻率
S311~S313、S321~S323:步驟
200: synchronous system
210: master control device
211: compensation estimation circuit
212: processing circuit
213: day time circuit
220: slave device
221: Receiver
222: Processing circuit
411: Synchronization header
412: The first 1PPS signal
413: First day time information
413a:
圖1A是習知的同步機制示意圖。 圖1B是習知的另一同步機制示意圖。 圖1C是習知的PWM示意圖。 圖2是依據本發明之一實施例繪示的同步系統示意圖。 圖3是依據本發明之一實施例繪示的同步校正方法流程圖。 圖4是依據本發明之一實施例繪示的第i秒鐘的第一期間及第二期間示意圖。 圖5是依據圖2繪示的主控裝置示意圖。 圖6是依據圖2繪示的僕裝置示意圖。 FIG. 1A is a schematic diagram of a conventional synchronization mechanism. FIG. 1B is a schematic diagram of another conventional synchronization mechanism. FIG. 1C is a schematic diagram of a conventional PWM. FIG. 2 is a schematic diagram of a synchronization system according to an embodiment of the present invention. FIG. 3 is a flowchart of a synchronous calibration method according to an embodiment of the invention. FIG. 4 is a schematic diagram of a first period and a second period of the i-th second according to an embodiment of the present invention. FIG. 5 is a schematic diagram of the main control device shown in FIG. 2 . FIG. 6 is a schematic diagram of the slave device shown in FIG. 2 .
210:主控裝置 210: master control device
220:僕裝置 220: slave device
F1:同步信號框 F1: Sync signal box
RS:第一參考1PPS信號 RS: first reference 1PPS signal
S311~S313、S321~S323:步驟 S311~S313, S321~S323: steps
Claims (22)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110142370A TWI809564B (en) | 2021-11-15 | 2021-11-15 | Synchronization correction method, master device and slave device |
CN202111629144.XA CN116132010A (en) | 2021-11-15 | 2021-12-28 | Synchronization correction method, master control device and slave device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW110142370A TWI809564B (en) | 2021-11-15 | 2021-11-15 | Synchronization correction method, master device and slave device |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202321935A true TW202321935A (en) | 2023-06-01 |
TWI809564B TWI809564B (en) | 2023-07-21 |
Family
ID=86306889
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW110142370A TWI809564B (en) | 2021-11-15 | 2021-11-15 | Synchronization correction method, master device and slave device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116132010A (en) |
TW (1) | TWI809564B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201127028Y (en) * | 2007-12-19 | 2008-10-01 | 华东电网有限公司 | Time synchronization system transferring time through synchronous digital hierarchy optical communications network |
CN102420609B (en) * | 2011-11-22 | 2014-05-28 | 北京遥测技术研究所 | Novel IRIG (Inter Range Instrumentation Group)-B alternating current code intelligent decoding method |
US20170373881A1 (en) * | 2016-06-27 | 2017-12-28 | Qualcomm Incorporated | Systems and methods for controlling isochronous data streams |
TWM628940U (en) * | 2021-11-15 | 2022-07-01 | 優達科技股份有限公司 | Master device and slave device |
-
2021
- 2021-11-15 TW TW110142370A patent/TWI809564B/en active
- 2021-12-28 CN CN202111629144.XA patent/CN116132010A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
TWI809564B (en) | 2023-07-21 |
CN116132010A (en) | 2023-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11177896B2 (en) | Time synchronization device and time synchronization method | |
AU2014414438B2 (en) | Method of synchronising clocks of network devices | |
CN102577194B (en) | System and method of synchronizing clocks in a distributed network | |
WO2014083725A1 (en) | Synchronization apparatus, synchronization system, wireless communication apparatus and synchronization method | |
EP1324520A2 (en) | Synchronization in a distributed system | |
US20070260906A1 (en) | Clock synchronization method and apparatus | |
EP3531610B1 (en) | Frequency synchronization method and slave clock | |
JP2012222833A (en) | System and method to overcome wander accumulation to achieve precision clock distribution over large networks | |
JPH024172B2 (en) | ||
JP2007282093A (en) | Apparatus and method for clock signal generation | |
KR101730313B1 (en) | Network system, time master station, and time slave station | |
WO2018099375A1 (en) | Synchronization method, synchronization device, synchronization apparatus and communication system | |
TWM628940U (en) | Master device and slave device | |
CN111092713B (en) | Clock synchronization device and clock synchronization method | |
US20230164725A1 (en) | Synchronization correction method, master device and slave device | |
TWI809564B (en) | Synchronization correction method, master device and slave device | |
CN114520703B (en) | Clock drift compensation method and circuit for time synchronization between industrial network devices | |
CN113359948A (en) | Time synchronization device and synchronization method | |
JP6198075B2 (en) | Time synchronization apparatus, time synchronization method, and time synchronization program | |
CN115189796B (en) | Equipment master clock synchronization method and device based on IEEE1588 protocol | |
EP3972160A1 (en) | Time synchronization method, service board, and network device | |
CN114513273A (en) | Method and device for realizing PTP chip clock module | |
JP2022119409A (en) | Information processing device | |
CN117155507A (en) | Clock synchronization system and method | |
JP2766837B2 (en) | Time data transmission device |