JP2011035696A - Slave terminal, and method for correcting clock of the same - Google Patents

Slave terminal, and method for correcting clock of the same Download PDF

Info

Publication number
JP2011035696A
JP2011035696A JP2009180482A JP2009180482A JP2011035696A JP 2011035696 A JP2011035696 A JP 2011035696A JP 2009180482 A JP2009180482 A JP 2009180482A JP 2009180482 A JP2009180482 A JP 2009180482A JP 2011035696 A JP2011035696 A JP 2011035696A
Authority
JP
Japan
Prior art keywords
time
slave
correction
error
value
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
JP2009180482A
Other languages
Japanese (ja)
Inventor
Isato Motohashi
勇人 本橋
Tadahisa Ono
忠久 大野
Makoto Takahashi
誠 高橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Azbil Corp
Original Assignee
Azbil Corp
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 Azbil Corp filed Critical Azbil Corp
Priority to JP2009180482A priority Critical patent/JP2011035696A/en
Publication of JP2011035696A publication Critical patent/JP2011035696A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a slave terminal that facilitates synchronization with master time of a master terminal. <P>SOLUTION: The slave terminal includes: a subcounter 302 which adds tick rates together for each time interval to calculate subcount; a main counter 303 which increments main count when the subcount reaches a threshold; an error calculation unit 305 which calculates a time error between non-corrected slave time to be calculated from the main count and the master time of the master terminal when non-corrected tick rate is used; a correction value calculation unit 306 which calculates a value of a correction variable at which correction time difference between corrected slave time to be calculated from the main count and the non-corrected slave time becomes equal to the time error when the correction variable is added to the tick rate; and a clock correction unit 307 which adds the calculated value of the correction variable to the tick rate. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明はネットワーク技術に係り、スレーブ端末及びスレーブ端末のクロック補正方法に関する。   The present invention relates to a network technology, and relates to a slave terminal and a clock correction method for the slave terminal.

計測及び制御システムが複雑化し、多数のノードをサポートするようになった現在、分散型ネットワーク技術の必要性が高まっている。ここで、各ノードにローカル・クロックを保持させ、分散型ネットワーク全体において正確な時間を保持することが重要となっている(例えば、特許文献1参照。)。しかし、各ノードの電源を個別にオン/オフすると、個々のローカル・クロックにおいて、正確な時刻からのずれが生じる場合がある。そのため、分散型ネットワーク全体で正確なクロック・タイミングを維持するためには、正確なクロックに対して個々のローカル・クロックの同期をとる必要がある。   As measurement and control systems become more complex and support a large number of nodes, there is a growing need for distributed network technology. Here, it is important to maintain a local clock in each node and to maintain an accurate time in the entire distributed network (see, for example, Patent Document 1). However, when the power supply of each node is individually turned on / off, there may be a deviation from an accurate time in each local clock. Therefore, in order to maintain accurate clock timing throughout the distributed network, it is necessary to synchronize individual local clocks with respect to the accurate clock.

特開2006−319972号公報JP 2006-319972 A

しかし、正確なクロックに対するローカル・クロックの時刻差が大きい場合、同期をとるのが困難な場合がある。そこで本発明は、マスタ端末のマスタ時刻と容易に同期可能なスレーブ端末及びスレーブ端末のクロック補正方法を提供することを目的の一つとする。   However, when the time difference between the local clock and the accurate clock is large, it may be difficult to achieve synchronization. Therefore, an object of the present invention is to provide a slave terminal and a slave terminal clock correction method that can be easily synchronized with the master time of the master terminal.

本発明の態様によれば、伝送路を介してマスタ端末に接続可能なスレーブ端末であって、時間間隔毎にティックレートを加算してサブカウントを算出するサブカウンタと、サブカウントが閾値に達した場合に、メインカウントをインクリメントするメインカウンタと、未補正のティックレートを用いた場合にメインカウントから算出される未補正スレーブ時刻と、マスタ端末のマスタ時刻との時刻誤差を算出する誤差算出部と、ティックレートに補正変数を加えた場合にメインカウントから算出される補正スレーブ時刻と未補正スレーブ時刻との補正時刻差が時刻誤差と等しくなる補正変数の値を算出する補正値算出部と、算出された補正変数の値をティックレートに加えるクロック補正部と、を備える、スレーブ端末が提供される。   According to an aspect of the present invention, a slave terminal that can be connected to a master terminal via a transmission path, calculates a subcount by adding a tick rate at each time interval, and the subcount reaches a threshold value. In this case, a main counter that increments the main count, and an error calculation unit that calculates a time error between the uncorrected slave time calculated from the main count and the master time of the master terminal when an uncorrected tick rate is used. A correction value calculation unit that calculates a correction variable value at which a correction time difference between a correction slave time calculated from a main count and an uncorrected slave time is equal to a time error when a correction variable is added to the tick rate; A slave terminal is provided that includes a clock correction unit that adds the value of the calculated correction variable to the tick rate.

本発明の他の態様によれば、時間間隔毎にティックレートを加算してサブカウントを算出することと、サブカウントが閾値に達した場合に、メインカウントをインクリメントすることと、伝送路を介してマスタ端末からマスタ時刻を取得することと、未補正のティックレートを用いた場合にメインカウントから算出される未補正スレーブ時刻と、マスタ時刻との時刻誤差を算出することと、ティックレートに補正変数を加えた場合にメインカウントから算出される補正スレーブ時刻と未補正スレーブ時刻との補正時刻差が時刻誤差と等しくなる補正変数の値を算出することと、算出された補正変数の値をティックレートに加えることと、を含む、スレーブ端末のクロックの補正方法が提供される。   According to another aspect of the present invention, a subcount is calculated by adding a tick rate at each time interval, a main count is incremented when the subcount reaches a threshold, and a transmission path is used. To obtain the master time from the master terminal, to calculate the time error between the uncorrected slave time calculated from the main count and the master time when an uncorrected tick rate is used, and to correct the tick rate When a variable is added, calculate the value of the correction variable so that the correction time difference between the corrected slave time calculated from the main count and the uncorrected slave time is equal to the time error, and the calculated correction variable value is ticked. A method for correcting the clock of the slave terminal, including adding to the rate.

本発明によれば、マスタ端末のマスタ時刻と容易に同期可能なスレーブ端末及びスレーブ端末のクロック補正方法を提供可能である。   ADVANTAGE OF THE INVENTION According to this invention, the clock correction method of the slave terminal and slave terminal which can be easily synchronized with the master time of a master terminal can be provided.

本発明の第1の実施の形態に係るコンピュータネットワークの模式図である。1 is a schematic diagram of a computer network according to a first embodiment of the present invention. 本発明の第1の実施の形態に係るスレーブ端末の模式図である。It is a schematic diagram of the slave terminal which concerns on the 1st Embodiment of this invention. 本発明の第1の実施の形態に係るサブカウント及びメインカウントと時間との関係を模式的に示すグラフである。It is a graph which shows typically the relation of subcount and main count concerning the 1st embodiment of the present invention, and time. 本発明の第1の実施の形態に係るマスタ端末からスレーブ端末に送信されるメッセージと時刻との関係を示す模式図である。It is a schematic diagram which shows the relationship between the message transmitted to the slave terminal from the master terminal which concerns on the 1st Embodiment of this invention, and time. 本発明の第1の実施の形態に係るスレーブ端末のクロックの補正方法を示すフローチャートである。It is a flowchart which shows the correction method of the clock of the slave terminal which concerns on the 1st Embodiment of this invention. 本発明の第1の実施の形態の比較例に係るマスタ端末及びスレーブ端末のクロック時刻データの推移を示すグラフである。It is a graph which shows transition of the clock time data of the master terminal and slave terminal which concern on the comparative example of the 1st Embodiment of this invention. 本発明の第1の実施の形態に係るマスタ端末及びスレーブ端末のクロック時刻データの推移を示すグラフである。It is a graph which shows transition of the clock time data of the master terminal and slave terminal which concern on the 1st Embodiment of this invention. 本発明の第1の実施の形態の変形例に係るスレーブ端末のクロックの補正方法を示すフローチャートである。It is a flowchart which shows the correction method of the clock of the slave terminal which concerns on the modification of the 1st Embodiment of this invention. 本発明の第3の実施の形態に係るスレーブ端末の模式図である。It is a schematic diagram of the slave terminal which concerns on the 3rd Embodiment of this invention. 本発明の第3の実施の形態に係るマスタ端末及びスレーブ端末間で送信されるメッセージと時刻との関係を示す模式図である。It is a schematic diagram which shows the relationship between the message transmitted between the master terminal and slave terminal which concern on the 3rd Embodiment of this invention, and time. 本発明のその他の実施の形態に係るマスタ端末及びスレーブ端末のクロック時刻データの推移を示すグラフである。It is a graph which shows transition of the clock time data of the master terminal and slave terminal which concern on other embodiment of this invention.

以下に本発明の実施の形態を説明する。以下の図面の記載において、同一又は類似の部分には同一又は類似の符号で表している。但し、図面は模式的なものである。したがって、具体的な寸法等は以下の説明を照らし合わせて判断するべきものである。また、図面相互間においても互いの寸法の関係や比率が異なる部分が含まれていることは勿論である。   Embodiments of the present invention will be described below. In the following description of the drawings, the same or similar parts are denoted by the same or similar reference numerals. However, the drawings are schematic. Therefore, specific dimensions and the like should be determined in light of the following description. Moreover, it is a matter of course that portions having different dimensional relationships and ratios are included between the drawings.

(第1の実施の形態)
図1に示すように、第1の実施の形態に係るスレーブ端末10は、ネットワーク5の伝送路を介して、マスタ端末1に電気的に接続可能である。マスタ端末1は、全地球測位システム(GPS:Global Positioning System)や原子時計等の正確な時刻源に接続され、正確なマスタ時刻を提供可能なマスタクロックを有している。スレーブ端末10は、マスタ端末1とデータを送受信するための図2に示すポート301と、スレーブクロック201と、を含む中央演算処理装置(CPU)300を備える。スレーブクロック201は、時間間隔毎にティックレートを加算してサブカウントを算出するサブカウンタ302と、サブカウントが閾値に達した場合に、メインカウントをインクリメントするメインカウンタ303と、メインカウントに基づいてスレーブ時刻を算出する時刻算出部304と、を含む。
(First embodiment)
As shown in FIG. 1, the slave terminal 10 according to the first embodiment can be electrically connected to the master terminal 1 via the transmission path of the network 5. The master terminal 1 is connected to an accurate time source such as a global positioning system (GPS) or an atomic clock, and has a master clock capable of providing an accurate master time. The slave terminal 10 includes a central processing unit (CPU) 300 including a port 301 shown in FIG. 2 for transmitting / receiving data to / from the master terminal 1 and a slave clock 201. The slave clock 201 is based on a subcounter 302 that calculates a subcount by adding a tick rate at each time interval, a main counter 303 that increments the main count when the subcount reaches a threshold, and a main count. And a time calculation unit 304 for calculating the slave time.

さらにCPU300は、未補正のティックレートを用いた場合にメインカウントから算出される未補正スレーブ時刻と、図1に示すマスタ端末1のマスタ時刻との時刻誤差を算出する図2に示す誤差算出部305と、ティックレートに補正変数を加えた場合にメインカウントから算出される補正スレーブ時刻と未補正スレーブ時刻との補正時刻差が、誤差算出部305が算出した時刻誤差と等しくなる補正変数の値を算出する補正値算出部306と、算出された補正変数の値をサブカウンタ302のティックレートに加えるクロック補正部307と、を含む。   Further, the CPU 300 calculates the time error between the uncorrected slave time calculated from the main count when the uncorrected tick rate is used and the master time of the master terminal 1 shown in FIG. 305 and the value of the correction variable that makes the correction time difference between the corrected slave time calculated from the main count and the uncorrected slave time equal to the time error calculated by the error calculation unit 305 when the correction variable is added to the tick rate And a clock correction unit 307 that adds the calculated value of the correction variable to the tick rate of the sub-counter 302.

スレーブクロック201のサブカウンタ302において、図3に示すように、固定の時間間隔ωごとに所定のティックレートAが加算されて、サブカウントCsが算出される。固定の時間間隔ωは、例えば20ナノ秒である。ティックレートAの値は、時間間隔ωと後述するメインカウントCmの周期Ωとを考慮して、スレーブクロック201に対する分解能の要求に基づいて決定される。サブカウントCsが所定の閾値Rを超えると、図2に示すメインカウンタ303において、図3に示すように、メインカウントCmが1だけインクリメントされる。また、サブカウントCsが閾値Rを超えるたびに、サブカウントCsの値から閾値Rの値が引かれる。その後、サブカウントCsが閾値Rを超えるたびに、メインカウントCmが1ずつインクリメントされる。   In the sub-counter 302 of the slave clock 201, as shown in FIG. 3, a predetermined tick rate A is added every fixed time interval ω to calculate a sub-count Cs. The fixed time interval ω is, for example, 20 nanoseconds. The value of the tick rate A is determined based on the resolution requirement for the slave clock 201 in consideration of the time interval ω and the period Ω of the main count Cm described later. When the subcount Cs exceeds the predetermined threshold value R, the main counter Cm shown in FIG. 2 is incremented by 1 as shown in FIG. Each time the subcount Cs exceeds the threshold value R, the value of the threshold value R is subtracted from the value of the subcount Cs. Thereafter, every time the subcount Cs exceeds the threshold value R, the main count Cm is incremented by one.

サブカウンタ302のティックレートAには、補正変数Nを加えることが可能である。正の値の補正変数NをティックレートAに加えた場合、補正変数NをティックレートAに加えなかった場合と比較して、サブカウントCsが閾値Rを超えるまでの時間が短くなる。そのため、メインカウントCmがインクリメントする周期Ωも短くなる。また、負の値の補正変数NをティックレートAに加えた場合、補正変数NをティックレートAに加えなかった場合と比較して、サブカウントCsが閾値Rを超えるまでの時間が長くなる。そのため、メインカウントCmがインクリメントする周期Ωも長くなる。メインカウントCmがインクリメントする周期Ωは、下記(1)式に示すように、補正変数Nの関数として与えられる。なお、下記(1)式から算出されるメインカウントCmがインクリメントする周期Ωが小数点以下の端数を含む場合、端数を切り捨て等してもよい。
Ω(N) = Rω/ (A+N) ・・・(1)
A correction variable N can be added to the tick rate A of the sub-counter 302. When the correction variable N having a positive value is added to the tick rate A, the time until the subcount Cs exceeds the threshold value R is shorter than when the correction variable N is not added to the tick rate A. Therefore, the cycle Ω at which the main count Cm is incremented is also shortened. In addition, when the negative correction variable N is added to the tick rate A, the time until the subcount Cs exceeds the threshold R is longer than when the correction variable N is not added to the tick rate A. Therefore, the period Ω at which the main count Cm is incremented also becomes longer. The period Ω in which the main count Cm is incremented is given as a function of the correction variable N as shown in the following equation (1). In addition, when the period Ω in which the main count Cm calculated from the following equation (1) is incremented includes a fractional part, the fraction may be rounded down.
Ω (N) = Rω / (A + N) (1)

図2に示す時刻算出部304は、下記(2)式に示すように、補正変数Nをサブカウンタ302のサブカウントのティックレートAに加えなかった場合にメインカウンタ303のメインカウントCmがインクリメントする周期Ω(0)に、メインカウントCmを乗じて、スレーブ時刻Tsを算出する。
Ts = Cm × Ω(0) ・・・(2)
The time calculation unit 304 shown in FIG. 2 increments the main count Cm of the main counter 303 when the correction variable N is not added to the tick rate A of the subcount of the subcounter 302 as shown in the following equation (2). The slave time Ts is calculated by multiplying the cycle Ω (0) by the main count Cm.
Ts = Cm × Ω (0) (2)

図1に示すマスタ端末1は、スレーブ端末10に、図4に示す「同期メッセージ」及び「フォローメッセージ」を定期的に送信する。「同期メッセージ」を送信する際、マスタ端末1内部の指示部が、マスタ端末1内部のポートに、「同期メッセージ」を送信するよう指示する。また、マスタ端末1内部の指示部は、ポートから実際に「同期メッセージ」が送信されたマスタ時刻Tm_t1をマスタクロックから取得する。さらに、マスタ端末1内部の指示部は、ポートに、マスタ時刻Tm_t1が付与された「フォローメッセージ」を送信するよう指示する。   The master terminal 1 illustrated in FIG. 1 periodically transmits the “synchronization message” and the “follow message” illustrated in FIG. 4 to the slave terminal 10. When transmitting the “synchronization message”, the instruction unit in the master terminal 1 instructs the port in the master terminal 1 to transmit the “synchronization message”. Further, the instruction unit inside the master terminal 1 acquires the master time Tm_t1 when the “synchronization message” is actually transmitted from the port from the master clock. Further, the instruction unit in the master terminal 1 instructs the port to transmit a “follow message” to which the master time Tm_t1 is given.

「同期メッセージ」及び「フォローメッセージ」は、図2に示すスレーブ端末10のポート301で受信される。スレーブクロック201のサブカウンタ302のティックレートAに補正変数Nが加えられていない状態において、誤差算出部305は、ポート301が「同期メッセージ」を受信した時の未補正スレーブ時刻Ts_r1をスレーブクロック201から取得する。さらに誤差算出部305は、「フォローメッセージ」から、マスタ時刻Tm_t1を取得する。   The “synchronization message” and “follow message” are received at the port 301 of the slave terminal 10 shown in FIG. In a state where the correction variable N is not added to the tick rate A of the sub-counter 302 of the slave clock 201, the error calculation unit 305 uses the slave clock 201 as the uncorrected slave time Ts_r1 when the port 301 receives the “synchronization message”. Get from. Further, the error calculation unit 305 acquires the master time Tm_t1 from the “follow message”.

図1に示すマスタ端末1が保持するマスタ時刻Tm_t1と、スレーブ端末10が保持する未補正スレーブ時刻Ts_r1との時刻誤差Eは、ネットワーク5におけるマスタ端末1からスレーブ端末10への伝送路遅延をDmsとして、下記(3)式で与えられる。
E = Ts_r1 - (Tm_t1 + Dms) ・・・(3)
第1の実施の形態において、図2に示す誤差算出部305は、下記(4)式に示すように、マスタ端末1からスレーブ端末10への伝送路遅延Dmsがないものとして、時刻誤差Eを算出する。
E = Ts_r1 - Tm_t1 ・・・(4)
The time error E between the master time Tm_t1 held by the master terminal 1 shown in FIG. 1 and the uncorrected slave time Ts_r1 held by the slave terminal 10 indicates the transmission path delay from the master terminal 1 to the slave terminal 10 in the network 5 as Dms. Is given by the following equation (3).
E = Ts_r1-(Tm_t1 + Dms) (3)
In the first embodiment, the error calculation unit 305 shown in FIG. 2 sets the time error E on the assumption that there is no transmission line delay Dms from the master terminal 1 to the slave terminal 10 as shown in the following equation (4). calculate.
E = Ts_r1-Tm_t1 (4)

CPU300は、判定部308をさらに備える。判定部308は、時刻誤差Eが許容範囲内にあるか否かを判定する。なお、許容範囲は、オペレータ等によって予め任意に設定される。ここで、所定の調整時間τの間において、サブカウンタ302のティックレートAに補正変数Nを加えなかった場合のメインカウントと、ティックレートAに補正変数Nを加えた場合のメインカウントとの差ΔCmは、下記(5)式で与えられる。
ΔCm = τ/Ω(0) - τ/Ω(N) ・・・(5)
上記(1)式より、(5)式は下記(6)式のように変形可能である。
ΔCm = τ/Ω(0) - τ/Ω(N)
= τ/(Rω/A) - τ/[Rω/(A+N)]
= [τ(A+N) - τA] / (Rω)
= (Nτ) / (Rω) ・・・(6)
The CPU 300 further includes a determination unit 308. The determination unit 308 determines whether or not the time error E is within an allowable range. The allowable range is arbitrarily set in advance by an operator or the like. Here, during a predetermined adjustment time τ, the difference between the main count when the correction variable N is not added to the tick rate A of the sub-counter 302 and the main count when the correction variable N is added to the tick rate A. ΔCm is given by the following equation (5).
ΔCm = τ / Ω (0)-τ / Ω (N) (5)
From the above equation (1), the equation (5) can be modified as the following equation (6).
ΔCm = τ / Ω (0)-τ / Ω (N)
= τ / (Rω / A)-τ / [Rω / (A + N)]
= [τ (A + N)-τA] / (Rω)
= (Nτ) / (Rω) (6)

また、所定の調整時間τの間において、ティックレートAに補正変数Nを加えなかった場合に算出される未補正スレーブ時刻と、ティックレートAに補正変数Nを加えた場合に算出される補正スレーブ時刻との補正時刻差ΔTsは、下記(7)式で与えられる。
ΔTs = ΔCm×Ω(0) ・・・(7)
上記(1)式及び(6)式より、(7)式は下記(8)式のように変形可能である。
ΔTs = ΔCm×Ω(0)
= (Nτ) / (Rω) × (Rω/A)
= Nτ/ A ・・・(8)
Further, during a predetermined adjustment time τ, the uncorrected slave time calculated when the correction variable N is not added to the tick rate A, and the corrected slave calculated when the correction variable N is added to the tick rate A The corrected time difference ΔTs from the time is given by the following equation (7).
ΔTs = ΔCm × Ω (0) (7)
From the above formulas (1) and (6), the formula (7) can be transformed into the following formula (8).
ΔTs = ΔCm × Ω (0)
= (Nτ) / (Rω) × (Rω / A)
= Nτ / A (8)

判定部308が、時刻誤差Eが許容範囲外であると判定した場合、補正値算出部306は、下記(9)式に示すように、時刻誤差Eと、所定の調整時間τの間において生じる補正時刻差ΔTsと、が等しくなる補正変数Nの値を算出する。
E = ΔTs ・・・(9)
上記(8)式及び(9)式より、時刻誤差Eと、所定の調整時間τの間において生じる補正時刻差ΔTsと、が等しくなる補正変数Nの値は、下記(10)式を用いて算出可能である。なお、所定の調整時間τの値は、オペレータ等によって予め任意の値に設定される。
N = A×E / τ ・・・(10)
(10)式から算出される補正変数Nの値を、所定の調整時間τの間、サブカウンタ302のティックレートAに加えることにより、時刻誤差Eが0になりうる。具体的には、所定の調整時間τの間にマスタクロックが進む時間τmと、所定の調整時間τの間にメインカウンタの周期がΩ(0)のスレーブクロック201が進む時間τsとが等しい場合、(10)式から算出される補正変数Nの値をサブカウンタ302のティックレートAに加えると、時刻誤差Eが0になる。
When the determination unit 308 determines that the time error E is outside the allowable range, the correction value calculation unit 306 occurs between the time error E and a predetermined adjustment time τ as shown in the following equation (9). The value of the correction variable N that makes the correction time difference ΔTs equal is calculated.
E = ΔTs (9)
From the above formulas (8) and (9), the value of the correction variable N at which the time error E is equal to the correction time difference ΔTs generated between the predetermined adjustment time τ is expressed by the following formula (10). It can be calculated. Note that the value of the predetermined adjustment time τ is set to an arbitrary value in advance by an operator or the like.
N = A × E / τ (10)
By adding the value of the correction variable N calculated from the equation (10) to the tick rate A of the sub-counter 302 for a predetermined adjustment time τ, the time error E can be zero. Specifically, the time τm that the master clock advances during a predetermined adjustment time τ is equal to the time τs that the slave clock 201 whose main counter cycle is Ω (0) advances during the predetermined adjustment time τ. When the value of the correction variable N calculated from the equations (10) is added to the tick rate A of the sub-counter 302, the time error E becomes zero.

また、所定の調整時間τの間にマスタクロックが進む時間τmと、所定の調整時間τの間にスレーブクロック201が進む時間τsとは、厳密には等しくない場合がある。しかし、下記(11)式に示すように、時刻誤差Eと比較して、時間τmと時間τsとの差は、通常、非常に小さい。
E >> (τm - τs) + α ・・・(11)
したがって、所定の調整時間τの後に、時刻誤差Eは充分に減少しうる。なお、(11)式において、αは伝送路遅延の見積もり誤差等の誤差要因である。
In addition, the time τm that the master clock advances during the predetermined adjustment time τ may not be exactly equal to the time τs that the slave clock 201 advances during the predetermined adjustment time τ. However, as shown in the following equation (11), compared with the time error E, the difference between the time τm and the time τs is usually very small.
E >> (τm-τs) + α (11)
Therefore, the time error E can be sufficiently reduced after the predetermined adjustment time τ. In the equation (11), α is an error factor such as an estimation error of the transmission line delay.

さらに、図1に示すネットワーク5におけるマスタ端末1からスレーブ端末10への伝送路遅延Dmsが無視しえない値の場合は、算出される補正変数Nの値をティックレートAに加えても、時刻誤差Eが0にならない場合もある。しかし、算出される補正変数Nの値をティックレートAに加えることにより、補正変数Nの値をティックレートAに加えなかった場合と比較して、時刻誤差Eは減少しうる。   Further, when the transmission line delay Dms from the master terminal 1 to the slave terminal 10 in the network 5 shown in FIG. 1 is a value that cannot be ignored, the time value can be obtained even if the value of the calculated correction variable N is added to the tick rate A. The error E may not be zero. However, by adding the calculated value of the correction variable N to the tick rate A, the time error E can be reduced as compared with the case where the value of the correction variable N is not added to the tick rate A.

図2に示すクロック補正部307は、補正値算出部306が算出した補正変数Nの値を、所定の調整時間τの間、サブカウンタ302のティックレートAに加え、スレーブクロック201を補正する。所定の調整時間τを経過した後、クロック補正部307は、補正変数Nの値をサブカウンタ302のティックレートAに加えることを止める。すなわち、所定の調整時間τを経過した後、補正変数Nの値を0にする。   The clock correction unit 307 illustrated in FIG. 2 corrects the slave clock 201 by adding the value of the correction variable N calculated by the correction value calculation unit 306 to the tick rate A of the sub-counter 302 for a predetermined adjustment time τ. After a predetermined adjustment time τ has elapsed, the clock correction unit 307 stops adding the value of the correction variable N to the tick rate A of the subcounter 302. That is, after a predetermined adjustment time τ has elapsed, the value of the correction variable N is set to zero.

また、判定部308が、時刻誤差Eが許容範囲内にあると判定した場合は、補正値算出部306は、下記(12)式を用い、補正変数Nの値を算出してもよい。この場合、クロック補正部307は、(12)式を用いて算出された補正変数Nの値をサブカウンタ302のティックレートAに加える、比例―積分(PI)制御をおこなう。
N = E / P + Σ(E / I) ・・・(12)
ここで、Pは比例帯、Iは積分時間を表す。
When the determination unit 308 determines that the time error E is within the allowable range, the correction value calculation unit 306 may calculate the value of the correction variable N using the following equation (12). In this case, the clock correction unit 307 performs proportional-integral (PI) control by adding the value of the correction variable N calculated using equation (12) to the tick rate A of the sub-counter 302.
N = E / P + Σ (E / I) (12)
Here, P represents a proportional band, and I represents an integration time.

図2に示すCPU300には、パラメータ記憶装置350及び補正時刻差関数記憶装置351が接続されている。パラメータ記憶装置350は、オペレータ等によって設定された調整時間τの値を保存する。また、パラメータ記憶装置350は、オペレータ等によって設定された補正スレーブ時刻とマスタ時刻との時刻誤差の許容範囲のデータを保存する。さらに、補正時刻差関数記憶装置351は、上記(8)式を、補正時刻差関数として保存する。CPU300には、さらに入力装置312、出力装置313、プログラム記憶装置330、及び一時記憶装置331が接続されている。入力装置312としては、キーボード、マウス等が使用可能である。出力装置313としては液晶表示装置(LCD)、発光ダイオード(LED)等によるモニタ画面等が使用可能である。プログラム記憶装置330は、CPU300で実行されるプログラムを保存している。一時記憶装置331は、CPU300の演算過程でのデータを一時的に保存する。   A parameter storage device 350 and a corrected time difference function storage device 351 are connected to the CPU 300 shown in FIG. The parameter storage device 350 stores the value of the adjustment time τ set by an operator or the like. Further, the parameter storage device 350 stores data of an allowable range of time error between the corrected slave time and the master time set by an operator or the like. Further, the corrected time difference function storage device 351 stores the above equation (8) as a corrected time difference function. An input device 312, an output device 313, a program storage device 330, and a temporary storage device 331 are further connected to the CPU 300. As the input device 312, a keyboard, a mouse, or the like can be used. As the output device 313, a monitor screen using a liquid crystal display (LCD), a light emitting diode (LED), or the like can be used. The program storage device 330 stores a program executed by the CPU 300. The temporary storage device 331 temporarily stores data in the calculation process of the CPU 300.

次に、図5に示すフローチャートを用いて第1の実施の形態に係るスレーブ端末のクロックの補正方法について説明する。なお、図2に示すCPU300の演算結果は、一時記憶装置331に逐次保存されうる。   Next, a method of correcting the clock of the slave terminal according to the first embodiment will be described using the flowchart shown in FIG. Note that the calculation results of the CPU 300 shown in FIG. 2 can be sequentially stored in the temporary storage device 331.

(a)ステップS100で、図1に示すスレーブ端末10の電源がオンにされる。これにより、マスタ端末1に対するスレーブ端末10の同期処理が開始される。図2に示すサブカウンタ302は、図3に示すように、固定の時間間隔ωごとに所定のティックレートAを加算して、サブカウントCsを算出する。サブカウントCsが所定の閾値Rを超える度に、図2に示すメインカウンタ303は、図3に示すように、メインカウントCmを1だけインクリメントする。また、図2に示す時刻算出部304は、上記(2)式を用いて、未補正スレーブ時刻を算出する。   (A) In step S100, the power of the slave terminal 10 shown in FIG. 1 is turned on. Thereby, the synchronization process of the slave terminal 10 with respect to the master terminal 1 is started. The sub-counter 302 shown in FIG. 2 calculates a sub-count Cs by adding a predetermined tick rate A every fixed time interval ω as shown in FIG. Each time the subcount Cs exceeds a predetermined threshold R, the main counter 303 shown in FIG. 2 increments the main count Cm by 1 as shown in FIG. Also, the time calculation unit 304 shown in FIG. 2 calculates the uncorrected slave time using the above equation (2).

(b)ステップS101で、スレーブ端末10は、図1に示すマスタ端末1から「同期メッセージ」を受信するまで待機する。図2に示すポート301が「同期メッセージ」を受信した場合、ポート301は、「同期メッセージ」を誤差算出部305に伝送する。ステップS102で、誤差算出部305は、ポート301が「同期メッセージ」を受信した時の未補正スレーブ時刻Ts_r1をスレーブクロック201から取得する。   (B) In step S101, the slave terminal 10 stands by until it receives a “synchronization message” from the master terminal 1 shown in FIG. When the port 301 illustrated in FIG. 2 receives the “synchronization message”, the port 301 transmits the “synchronization message” to the error calculation unit 305. In step S102, the error calculation unit 305 acquires the uncorrected slave time Ts_r1 when the port 301 receives the “synchronization message” from the slave clock 201.

(c)ステップS103で、スレーブ端末10は、図1に示すマスタ端末1から「フォローメッセージ」を受信するまで待機する。図2に示すポート301が「フォローメッセージ」を受信した場合、ポート301は、「フォローメッセージ」を誤差算出部305に伝送する。ステップS104で、誤差算出部305は、「フォローメッセージ」から、マスタ時刻Tm_t1を取得する。次に、ステップS105で、誤差算出部305は、上記(4)式を用いて、図1に示すネットワーク5におけるマスタ端末1からスレーブ端末10への伝送路遅延Dmsがないものとして、マスタ時刻Tm_t1と、未補正スレーブ時刻Ts_r1との時刻誤差Eを算出する。その後、図2に示す誤差算出部305は、算出した時刻誤差Eを判定部308に伝送する。   (C) In step S103, the slave terminal 10 stands by until a “follow message” is received from the master terminal 1 shown in FIG. When the port 301 illustrated in FIG. 2 receives the “follow message”, the port 301 transmits the “follow message” to the error calculation unit 305. In step S104, the error calculation unit 305 acquires the master time Tm_t1 from the “follow message”. Next, in step S105, the error calculation unit 305 determines that there is no transmission path delay Dms from the master terminal 1 to the slave terminal 10 in the network 5 shown in FIG. Then, a time error E from the uncorrected slave time Ts_r1 is calculated. Thereafter, the error calculation unit 305 illustrated in FIG. 2 transmits the calculated time error E to the determination unit 308.

(d)ステップS106で判定部308は、パラメータ記憶装置350から許容範囲のデータを読みだし、時刻誤差Eが許容範囲内か否かを判定する。時刻誤差Eが許容範囲外である場合、ステップS107に進む。ステップS107で、補正値算出部306は、補正時刻差関数記憶装置351から、上記(8)式で与えられる、未補正スレーブ時刻と補正スレーブ時刻との補正時刻差ΔTsを与える補正時刻差関数を読みだす。また、補正値算出部306は、予めオペレータ等によって保存された調整時間τの値をパラメータ記憶装置350から読みだす。次に、補正値算出部306は、(8)式の補正時刻差関数の補正時刻差ΔTsの変数に、誤差算出部305が算出した時刻誤差Eの値を代入する。また、補正値算出部306は、補正時刻差関数の調整時間τの変数に、パラメータ記憶装置350から読みだした調整時間τの値を代入し、ティックレートAの変数に、サブカウンタ303に固有のティックレートAの値を代入して、補正変数Nの値を算出する。補正値算出部306は、算出した補正変数Nの値をクロック補正部307に伝送する。   (D) In step S106, the determination unit 308 reads the allowable range data from the parameter storage device 350, and determines whether the time error E is within the allowable range. If the time error E is outside the allowable range, the process proceeds to step S107. In step S107, the correction value calculation unit 306 generates a correction time difference function that gives a correction time difference ΔTs between the uncorrected slave time and the correction slave time, which is given by the above equation (8), from the correction time difference function storage device 351. Read it out. Further, the correction value calculation unit 306 reads out the value of the adjustment time τ previously stored by the operator or the like from the parameter storage device 350. Next, the correction value calculation unit 306 substitutes the value of the time error E calculated by the error calculation unit 305 for the variable of the correction time difference ΔTs of the correction time difference function of equation (8). Further, the correction value calculation unit 306 substitutes the value of the adjustment time τ read from the parameter storage device 350 for the variable of the adjustment time τ of the correction time difference function, and is specific to the subcounter 303 for the variable of the tick rate A. The value of the correction variable N is calculated by substituting the value of the tick rate A. The correction value calculation unit 306 transmits the calculated value of the correction variable N to the clock correction unit 307.

(e)ステップS108及びステップS109で、クロック補正部307は、調整時間τの間、補正値算出部306が算出した補正変数Nの値をサブカウンタ302のティックレートAに加える。サブカウンタ302は、時間間隔ωごとに補正変数Nの値を加えられたティックレートAを加算して、サブカウントCsを算出する。ティックレートAが補正されたことにより、メインカウンタ303は、補正された周期Ω(N)でメインカウントCmをインクリメントする。また、時刻算出部304は、補正された周期Ω(N)でインクリメントするメインカウントCmに基づいて、補正スレーブ時刻を算出する。調整時間τを経過した後、ステップS110で、クロック補正部307は、サブカウンタ302のティックレートAに加える補正変数Nの値を0にリセットする。その後、ステップS130で、マスタ端末1に対するスレーブ端末10の同期処理を継続するか判定し、同期処理を継続する場合は、ステップS101に戻る。   (E) In step S108 and step S109, the clock correction unit 307 adds the value of the correction variable N calculated by the correction value calculation unit 306 to the tick rate A of the subcounter 302 during the adjustment time τ. The subcounter 302 calculates the subcount Cs by adding the tick rate A to which the value of the correction variable N is added every time interval ω. When the tick rate A is corrected, the main counter 303 increments the main count Cm with the corrected period Ω (N). Further, the time calculation unit 304 calculates the corrected slave time based on the main count Cm that is incremented with the corrected period Ω (N). After the adjustment time τ has elapsed, the clock correction unit 307 resets the value of the correction variable N to be added to the tick rate A of the sub-counter 302 to 0 in step S110. Thereafter, in step S130, it is determined whether to continue the synchronization process of the slave terminal 10 with respect to the master terminal 1. If the synchronization process is continued, the process returns to step S101.

(f)ステップS106の判定結果が許容範囲内である場合、ステップS120に進み、補正値算出部306は、上記(12)式を用いて補正変数Nの値を算出し、クロック補正部307は、サブカウンタ302を、定常特性に優れたPI制御方法で補正する。その後、ステップS130で、マスタ端末1に対するスレーブ端末10の同期処理を継続するか判定し、同期処理を継続する場合は、ステップS101に戻る。スレーブ端末10の電源がオフにする場合等、同期処理を継続する必要がなくなった場合は、同期処理を終了する。   (F) When the determination result in step S106 is within the allowable range, the process proceeds to step S120, where the correction value calculation unit 306 calculates the value of the correction variable N using the above equation (12), and the clock correction unit 307 The sub-counter 302 is corrected by a PI control method having excellent steady characteristics. Thereafter, in step S130, it is determined whether to continue the synchronization process of the slave terminal 10 with respect to the master terminal 1. If the synchronization process is continued, the process returns to step S101. When it is not necessary to continue the synchronization process, such as when the slave terminal 10 is turned off, the synchronization process is terminated.

従来、図6に示すようにスレーブ端末の電源をオンした後、マスタ端末から1回目の同期メッセージ及びフォローメッセージを受信し、P−I制御方法のみによってマスタ時刻とスレーブ時刻との時刻誤差をなくすこころみがなされていた。しかし、電源をオンした直後の時刻誤差は大きいため、最初からP−I制御方法によって時刻誤差を補正しようとすると、時刻誤差が正負の間で発振し、時刻誤差が許容範囲内に収まるまで時間がかかるという問題があった。   Conventionally, after the slave terminal is turned on as shown in FIG. 6, the first synchronization message and the follow message are received from the master terminal, and the time error between the master time and the slave time is eliminated only by the PI control method. There was a willingness. However, since the time error immediately after the power is turned on is large, when trying to correct the time error by the PI control method from the beginning, the time error oscillates between positive and negative and it takes time until the time error falls within the allowable range. There was a problem that it took.

これに対し、第1の実施の形態に係るスレーブ端末のクロックの補正方法を用いれば、図7に示すように、マスタ端末から1回目の同期メッセージ及びフォローメッセージを受信した後、短時間でマスタ時刻とスレーブ時刻との時刻誤差を許容範囲内に減少させることが可能となる。また、P−I制御は、定常的な補正には優れているため、時刻誤差が許容範囲内になった後は、P−I制御により、時刻誤差の補正を継続してもよい。   On the other hand, if the slave terminal clock correction method according to the first embodiment is used, as shown in FIG. 7, after receiving the first synchronization message and follow message from the master terminal, It is possible to reduce the time error between the time and the slave time within an allowable range. In addition, since the PI control is excellent for regular correction, the correction of the time error may be continued by the PI control after the time error is within the allowable range.

なお、上記(3)式及び(4)式で説明したように、第1の実施の形態において、図2に示す誤差算出部305は、図1に示すネットワーク5におけるマスタ端末1からスレーブ端末10への伝送路遅延Dmsがないものとして、時刻誤差Eを算出する。ここで、ネットワーク5における双方向の伝送路遅延Dは、後述するように、マスタ時刻及びスレーブ時刻に基づいて算出可能である。しかし、マスタ時刻とスレーブ時刻との時刻誤差Eが大きい場合、マスタ時刻及びスレーブ時刻に基づいて算出される伝送路遅延Dも大きな誤差を含みうる。したがって、伝送路遅延Dを0として時刻誤差Eを算出したほうが、上記(10)式で算出される補正変数の値Nの精度が向上しうる。   Note that, as described in the above formulas (3) and (4), in the first embodiment, the error calculation unit 305 shown in FIG. 2 is connected to the slave terminal 10 from the master terminal 1 in the network 5 shown in FIG. The time error E is calculated on the assumption that there is no transmission line delay Dms. Here, the bidirectional transmission path delay D in the network 5 can be calculated based on the master time and the slave time, as will be described later. However, when the time error E between the master time and the slave time is large, the transmission line delay D calculated based on the master time and the slave time can also include a large error. Therefore, the accuracy of the value N of the correction variable calculated by the above equation (10) can be improved by calculating the time error E with the transmission line delay D set to 0.

また、図5のステップS108及びステップS109において、調整時間τの間に図2に示すスレーブ端末10が新たな同期メッセージを受信しても、調整時間τの間に受信した同期メッセージはスレーブクロック201の補正に利用されない。しかし、調整時間τを経過した後、ステップS101に戻った時に受信する新たな同期メッセージをその後のスレーブクロック201の補正に利用することで、正確なタイミングでスレーブクロック201を補正することが可能となる。   5, even if the slave terminal 10 shown in FIG. 2 receives a new synchronization message during the adjustment time τ, the synchronization message received during the adjustment time τ is the slave clock 201. It is not used for correction. However, it is possible to correct the slave clock 201 at an accurate timing by using a new synchronization message received when the process returns to step S101 after the adjustment time τ has elapsed, for the subsequent correction of the slave clock 201. Become.

(第1の実施の形態の変形例)
図5においては、ステップS108及びステップS109において、調整時間τの間に受信される同期メッセージを図2に示すスレーブクロック201の補正に利用しない例を説明した。これに対し、図8に示すように、ステップS108とステップS109との間に、「同期メッセージ」を受信したか否かを判定するステップを挿入してもよい。この場合、調整時間τの間にスレーブ端末10が新たな「同期メッセージ」を受信すると、ステップS102に戻り、調整時間τの経過を待つことなく、新たな補正変数Nの算出が開始される。
(Modification of the first embodiment)
In FIG. 5, the example in which the synchronization message received during the adjustment time τ is not used for the correction of the slave clock 201 shown in FIG. 2 in steps S108 and S109. On the other hand, as shown in FIG. 8, a step of determining whether or not a “synchronization message” has been received may be inserted between step S108 and step S109. In this case, when the slave terminal 10 receives a new “synchronization message” during the adjustment time τ, the process returns to step S102, and calculation of a new correction variable N is started without waiting for the adjustment time τ to elapse.

(第2の実施の形態)
第1の実施の形態において、図2に示す誤差算出部305が、図1に示すネットワーク5におけるマスタ端末1からスレーブ端末10への伝送路遅延Dmsがないものとして、上記(4)式に示すように時刻誤差Eを算出する例を説明した。しかし、ネットワーク5が、構内通信網(LAN:Local Area Network)のように小規模であり、接続ノードの数も限定的であれば、ネットワーク5における双方向の伝送路遅延Dの値が例えば20マイクロ秒程度で一定であり、変動が少ない場合がある。そこで、図2に示す第2の実施の形態に係るスレーブ端末10においては、例えば不揮発性のパラメータ記憶装置350に、オペレータ等によって入力された所定の伝送路遅延Dの値が保存されている。この場合、図2に示す誤差算出部305は、上記(3)式の伝送路遅延Dmsの変数に、パラメータ記憶装置350から読みだした伝送路遅延Dの値を代入して、時刻誤差Eを算出する。第2の実施の形態に係るスレーブ端末10のその他の構成要素は、第1の実施の形態に係るスレーブ端末10と同様であるので、説明は省略する。
(Second Embodiment)
In the first embodiment, the error calculation unit 305 shown in FIG. 2 assumes that there is no transmission path delay Dms from the master terminal 1 to the slave terminal 10 in the network 5 shown in FIG. Thus, the example of calculating the time error E has been described. However, if the network 5 is a small scale such as a local area network (LAN) and the number of connection nodes is limited, the value of the bidirectional transmission line delay D in the network 5 is, for example, 20 There are cases where it is constant in about microseconds and there is little fluctuation. Therefore, in the slave terminal 10 according to the second embodiment shown in FIG. 2, for example, a value of a predetermined transmission line delay D input by an operator or the like is stored in the nonvolatile parameter storage device 350. In this case, the error calculation unit 305 shown in FIG. 2 substitutes the value of the transmission line delay D read from the parameter storage device 350 for the variable of the transmission line delay Dms in the above equation (3), and calculates the time error E. calculate. Since the other components of the slave terminal 10 according to the second embodiment are the same as those of the slave terminal 10 according to the first embodiment, description thereof will be omitted.

(第3の実施の形態)
図9に示すように、第3の実施の形態に係るスレーブ端末10のCPU300は、遅延取得部309をさらに備える。遅延取得部309は、ポート301を介して、図1に示すマスタ端末1に図10に示す「要求メッセージ」を送信する。また、図9に示す遅延取得部309は、ポート301が「要求メッセージ」を送信した時の未補正スレーブ時刻Ts_t1をスレーブクロック201から取得する。図1に示すマスタ端末1は、ポートが「要求メッセージ」を受信したときのマスタ時刻Tm_r1をマスタクロックから取得する。さらに、マスタ端末1は、マスタ時刻Tm_r1が付与された「応答メッセージ」をスレーブ端末10に送信するよう指示する。
(Third embodiment)
As illustrated in FIG. 9, the CPU 300 of the slave terminal 10 according to the third embodiment further includes a delay acquisition unit 309. The delay acquisition unit 309 transmits the “request message” illustrated in FIG. 10 to the master terminal 1 illustrated in FIG. Also, the delay acquisition unit 309 illustrated in FIG. 9 acquires from the slave clock 201 the uncorrected slave time Ts_t1 when the port 301 transmits the “request message”. The master terminal 1 shown in FIG. 1 acquires the master time Tm_r1 when the port receives the “request message” from the master clock. Furthermore, the master terminal 1 instructs the slave terminal 10 to transmit a “response message” with the master time Tm_r1.

ネットワーク1におけるマスタ端末1からスレーブ端末10への伝送路遅延Dmsは、上記(3)式を変形して下記(13)式で与えられる。
Dms = (Ts_r1 -E) - Tm_t1 ・・・(13)
また、ネットワーク1におけるスレーブ端末10からマスタ端末1への伝送路遅延Dsmは、「要求メッセージ」及び「応答メッセージ」を用いて取得された未補正スレーブ時刻Ts_t1、マスタ時刻Tm_r1、及び時刻誤差Eを用いて、下記(14)式で与えられる。
Dsm = Tm_r1 - (Ts_t1 - E) ・・・(14)
図9に示す遅延取得部309は、ネットワーク1における伝送路遅延Dが対称的であるとみなしうる場合、下記(15)に示すように、マスタ端末1からスレーブ端末10への伝送路遅延Dmsと、スレーブ端末10からマスタ端末1への伝送路遅延Dsmとの平均値を、ネットワーク1における伝送路遅延Dとして算出する。
D = (Dms + Dsm) / 2
= [(Ts_r1 -E) - Tm_t1 + Tm_r1 - (Ts_t1 - E)] / 2
= (Ts_r1 - Tm_t1 + Tm_r1 - Ts_t1) / 2 ・・・(15)
そこで、第3の実施の形態においては、誤差算出部305は、遅延取得部309が算出した伝送路遅延Dの値を、上記(3)式の変数Dmsに代入して、時刻誤差Eを算出する。第3の実施の形態に係るスレーブ端末10のその他の構成要素は、第1の実施の形態に係るスレーブ端末10と同様であるので、説明は省略する。
The transmission line delay Dms from the master terminal 1 to the slave terminal 10 in the network 1 is given by the following equation (13) by modifying the above equation (3).
Dms = (Ts_r1 -E)-Tm_t1 (13)
Further, the transmission line delay Dsm from the slave terminal 10 to the master terminal 1 in the network 1 is the uncorrected slave time Ts_t1, the master time Tm_r1, and the time error E acquired using the “request message” and the “response message”. And is given by the following equation (14).
Dsm = Tm_r1-(Ts_t1-E) (14)
When the transmission line delay D in the network 1 can be considered to be symmetric, the delay acquisition unit 309 illustrated in FIG. 9 can perform transmission line delay Dms from the master terminal 1 to the slave terminal 10 as illustrated in (15) below. The average value of the transmission line delay Dsm from the slave terminal 10 to the master terminal 1 is calculated as the transmission line delay D in the network 1.
D = (Dms + Dsm) / 2
= [(Ts_r1 -E)-Tm_t1 + Tm_r1-(Ts_t1-E)] / 2
= (Ts_r1-Tm_t1 + Tm_r1-Ts_t1) / 2 ... (15)
Therefore, in the third embodiment, the error calculation unit 305 calculates the time error E by substituting the value of the transmission path delay D calculated by the delay acquisition unit 309 into the variable Dms in the above equation (3). To do. Since the other components of the slave terminal 10 according to the third embodiment are the same as those of the slave terminal 10 according to the first embodiment, description thereof will be omitted.

(その他の実施の形態)
上記のように、本発明は実施の形態によって記載したが、この開示の一部をなす記述及び図面はこの発明を限定するものであると理解するべきではない。この開示から当業者には様々な代替実施の形態、実施の形態及び運用技術が明らかになるはずである。
(Other embodiments)
As described above, the present invention has been described according to the embodiment. However, it should not be understood that the description and drawings constituting a part of this disclosure limit the present invention. From this disclosure, various alternative embodiments, embodiments, and operation techniques should be apparent to those skilled in the art.

例えば、図1に示すマスタ端末1は、スレーブ端末10と同様のサブカウンタ及びメインカウンタを有していてもよい。また、マスタ端末1と同期したスレーブ端末10は、他のスレーブ端末14,18に対して、マスタ端末として機能してもよい。また、図2において、スレーブクロック201等をCPU300のモジュールとして表現したが、スレーブクロック201等は独立したハードウェアであってもよいことはもちろんである。   For example, the master terminal 1 shown in FIG. 1 may have the same sub-counter and main counter as the slave terminal 10. The slave terminal 10 synchronized with the master terminal 1 may function as a master terminal for the other slave terminals 14 and 18. In FIG. 2, the slave clock 201 and the like are expressed as modules of the CPU 300, but the slave clock 201 and the like may be independent hardware.

なお、図11に示すように、調整時間τを経過し、時刻誤差Eが許容範囲内になった後も、1回目の同期メッセージ及びフォローメッセージに基づいて算出された補正変数Nの値を続けると、時刻誤差Eが再び拡大する場合がある。この場合、調整時間τを経過した後は、補正変数Nの値を0にリセットするか、あるいは、時刻誤差Eが許容範囲内になった後は、P−I制御方法等による補正に切り替えるとよい。ただし、マスタクロックとのティックレートと、スレーブクロックのティックレートとが十分に等しい場合は、時刻誤差Eが再び拡大することは生じない。この様に、本発明はここでは記載していない様々な実施の形態等を包含するということを理解すべきである。   As shown in FIG. 11, the value of the correction variable N calculated based on the first synchronization message and the follow message is continued even after the adjustment time τ has elapsed and the time error E is within the allowable range. In some cases, the time error E may increase again. In this case, after the adjustment time τ elapses, the value of the correction variable N is reset to 0, or after the time error E is within the allowable range, the correction is made by the PI control method or the like. Good. However, when the tick rate with the master clock and the tick rate with the slave clock are sufficiently equal, the time error E does not increase again. Thus, it should be understood that the present invention includes various embodiments and the like not described herein.

1 マスタ端末
5 ネットワーク
10 スレーブ端末
201 スレーブクロック
301 ポート
302 サブカウンタ
303 メインカウンタ
304 時刻算出部
305 誤差算出部
306 補正値算出部
307 クロック補正部
DESCRIPTION OF SYMBOLS 1 Master terminal 5 Network 10 Slave terminal 201 Slave clock 301 Port 302 Sub counter 303 Main counter 304 Time calculation part 305 Error calculation part 306 Correction value calculation part 307 Clock correction part

Claims (7)

伝送路を介してマスタ端末に接続可能なスレーブ端末であって、
時間間隔毎にティックレートを加算してサブカウントを算出するサブカウンタと、
前記サブカウントが閾値に達した場合に、メインカウントをインクリメントするメインカウンタと、
未補正の前記ティックレートを用いた場合に前記メインカウントから算出される未補正スレーブ時刻と、前記マスタ端末のマスタ時刻との時刻誤差を算出する誤差算出部と、
前記ティックレートに補正変数を加えた場合に前記メインカウントから算出される補正スレーブ時刻と前記未補正スレーブ時刻との補正時刻差が前記時刻誤差と等しくなる前記補正変数の値を算出する補正値算出部と、
前記算出された補正変数の値を前記ティックレートに加えるクロック補正部と、
を備える、スレーブ端末。
A slave terminal that can be connected to a master terminal via a transmission line,
A sub-counter that calculates a sub-count by adding a tick rate for each time interval;
A main counter that increments the main count when the subcount reaches a threshold;
An error calculating unit that calculates a time error between the uncorrected slave time calculated from the main count when the uncorrected tick rate is used and the master time of the master terminal;
Correction value calculation for calculating a value of the correction variable such that a correction time difference between the correction slave time calculated from the main count and the uncorrected slave time becomes equal to the time error when a correction variable is added to the tick rate And
A clock correction unit for adding the value of the calculated correction variable to the tick rate;
A slave terminal comprising:
前記誤差算出部が、前記伝送路における伝送路遅延がないものとして、前記時刻誤差を算出する、請求項1に記載のスレーブ端末。   The slave terminal according to claim 1, wherein the error calculation unit calculates the time error on the assumption that there is no transmission line delay in the transmission line. あらかじめ取得された、前記伝送路における伝送路遅延の値を保存する、伝送路遅延記憶装置を更に備える、請求項1に記載のスレーブ端末。   The slave terminal according to claim 1, further comprising a transmission path delay storage device that stores a transmission path delay value acquired in advance in the transmission path. 前記誤差算出部が、前記伝送路遅延の値を用いて、前記時刻誤差を算出する、請求項3に記載のスレーブ端末。   The slave terminal according to claim 3, wherein the error calculation unit calculates the time error using the value of the transmission line delay. 時間間隔毎にティックレートを加算してサブカウントを算出することと、
前記サブカウントが閾値に達した場合に、メインカウントをインクリメントすることと、
伝送路を介してマスタ端末からマスタ時刻を取得することと、
未補正の前記ティックレートを用いた場合に前記メインカウントから算出される未補正スレーブ時刻と、前記マスタ時刻との時刻誤差を算出することと、
前記ティックレートに補正変数を加えた場合に前記メインカウントから算出される補正スレーブ時刻と前記未補正スレーブ時刻との補正時刻差が前記時刻誤差と等しくなる前記補正変数の値を算出することと、
前記算出された補正変数の値を前記ティックレートに加えることと、
を含む、スレーブ端末のクロックの補正方法。
Adding a tick rate for each time interval to calculate a subcount,
Incrementing the main count when the subcount reaches a threshold;
Obtaining the master time from the master terminal via the transmission line;
Calculating an uncorrected slave time calculated from the main count when the uncorrected tick rate is used, and a time error between the master time;
Calculating a value of the correction variable such that a correction time difference between the correction slave time calculated from the main count and the uncorrected slave time is equal to the time error when a correction variable is added to the tick rate;
Adding the value of the calculated correction variable to the tick rate;
A method for correcting the clock of a slave terminal, including:
前記伝送路における伝送路遅延がないものとして、前記時刻誤差を算出する、請求項5に記載のスレーブ端末のクロックの補正方法。   6. The slave terminal clock correction method according to claim 5, wherein the time error is calculated on the assumption that there is no transmission line delay in the transmission line. あらかじめ取得された、前記伝送路における伝送路遅延の値を用いて、前記時刻誤差を算出する、請求項5に記載のスレーブ端末のクロックの補正方法。   6. The slave terminal clock correction method according to claim 5, wherein the time error is calculated using a transmission path delay value in the transmission path acquired in advance.
JP2009180482A 2009-08-03 2009-08-03 Slave terminal, and method for correcting clock of the same Pending JP2011035696A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009180482A JP2011035696A (en) 2009-08-03 2009-08-03 Slave terminal, and method for correcting clock of the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009180482A JP2011035696A (en) 2009-08-03 2009-08-03 Slave terminal, and method for correcting clock of the same

Publications (1)

Publication Number Publication Date
JP2011035696A true JP2011035696A (en) 2011-02-17

Family

ID=43764318

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009180482A Pending JP2011035696A (en) 2009-08-03 2009-08-03 Slave terminal, and method for correcting clock of the same

Country Status (1)

Country Link
JP (1) JP2011035696A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014041592A1 (en) * 2012-09-11 2014-03-20 三菱電機株式会社 Correction parameter calculation device and system, correction parameter calculation method, and computer program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014041592A1 (en) * 2012-09-11 2014-03-20 三菱電機株式会社 Correction parameter calculation device and system, correction parameter calculation method, and computer program
JP5911584B2 (en) * 2012-09-11 2016-04-27 三菱電機株式会社 Correction parameter calculation apparatus and system, correction parameter calculation method, and computer program
JPWO2014041592A1 (en) * 2012-09-11 2016-08-12 三菱電機株式会社 Correction parameter calculation apparatus and system, correction parameter calculation method, and computer program
US10197974B2 (en) 2012-09-11 2019-02-05 Mitsubishi Electric Corporation Correction parameter calculation system and method
US10353346B2 (en) 2012-09-11 2019-07-16 Mitsubishi Electric Corporation Correction parameter calculation device, system, correction parameter calculation method, and computer program

Similar Documents

Publication Publication Date Title
US20210288736A1 (en) Method, device, and computer program for improving synchronization of clocks in devices linked according to a daisy-chain topology
JP5911584B2 (en) Correction parameter calculation apparatus and system, correction parameter calculation method, and computer program
JP5377663B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND TIME SYNCHRONIZATION METHOD
JP6834642B2 (en) Time correction method
JP2016123009A (en) Semiconductor device, electronic device module, and network system
KR101550552B1 (en) Apparatus for adjusting time synchronization period and method for determinating time synchronization period
KR20090032306A (en) Time synchronization system and method on the network
US20210328698A1 (en) Clock synchronization method and apparatus, and storage medium
WO2019003320A1 (en) Communication system, master device and slave device
JP6707209B1 (en) Time synchronization system, master device, slave device and program
JP6605863B2 (en) Electronic device, method, program, and protection system
JP2002368670A (en) Radio communication equipment and method for estimating reception timing therefor
JP2007214670A (en) Client device and program
Leva et al. High-precision low-power wireless nodes’ synchronization via decentralized control
JP2011035696A (en) Slave terminal, and method for correcting clock of the same
US11949767B2 (en) Communication apparatus, method of controlling communication apparatus, and storage medium
JP2012195840A (en) Communication apparatus and communication control method
KR101176798B1 (en) Method for clock synchronization between slave and master
JP6581254B1 (en) Clock adjustment apparatus and program
JP2018110326A (en) Synchronizer, synchronization method, synchronous program, and synchronous system
US20100083024A1 (en) Electronics Device Having Timekeeping Function and Computer-Readable Record Medium Storing Program for Timekeeping Function
JP2013015417A (en) Electronic apparatus, current time calibration method and program
JP2020053737A (en) Information communication system
JP4703102B2 (en) Time stamp system and method and program for correcting time progress
JP2013168884A (en) Time synchronization system, time transmission apparatus, time reception apparatus, time synchronization method and program