JP4123946B2 - Time synchronization system - Google Patents
Time synchronization system Download PDFInfo
- Publication number
- JP4123946B2 JP4123946B2 JP2003018921A JP2003018921A JP4123946B2 JP 4123946 B2 JP4123946 B2 JP 4123946B2 JP 2003018921 A JP2003018921 A JP 2003018921A JP 2003018921 A JP2003018921 A JP 2003018921A JP 4123946 B2 JP4123946 B2 JP 4123946B2
- Authority
- JP
- Japan
- Prior art keywords
- electronic control
- control unit
- value
- set value
- interrupt
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Computer And Data Communications (AREA)
- Programmable Controllers (AREA)
- Combined Controls Of Internal Combustion Engines (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、電子制御装置間で時刻同期を実現するシステムに関する。
【0002】
【従来の技術】
ネットワークで接続された複数の電子制御装置間で分散して各種制御を行うシステムがあるが、これらの電子制御装置はお互いに協調して動作するため、電子制御装置間の時刻同期が非常に重要である。このため、様々な時刻同期システムが開発されているが、近年、各々の電子制御装置の高機能化がなされ全体としてより高度な制御がなされるようになってきたため、従来に比べて時刻同期の精度がますます求められるようになってきた。
【0003】
従来は、統括的な役割を果たす主電子制御装置から同報送信されたフレームを各電子制御装置が受信し、そのフレームに含まれる時刻情報に基づいて電子制御装置の時刻を設定する方法が一般的に採られていた。
しかし、この方法では図1(a)の遅延時間の説明図に示すように、主電子制御装置以外の他の電子制御装置がフレームを受信した際、主電子制御装置が管理する基準時刻11に対して伝送遅延12、フレーム読み取り遅延13及びカウンタセット処理遅延14が生じる。そして、これらの遅延の総和が時刻同期における誤差となり、近年この誤差が無視できなくなってきた。尚、ここで言う伝送遅延12というのは、主電子制御装置から送信されたフレームが主電子制御装置以外の他の電子制御装置に到達するまでにかかる時間を意味する。また、フレーム読み取り遅延13というのは、シリアル化されてフレーム形式で送信されてくる時刻情報が含まれたフレームを、先頭ビットから順に1フレーム分読み取ることに必要な時間を意味する。また、カウンタセット処理遅延14は、受信したフレームに含まれる時刻情報に基づいてタイマカウンタを設定する処理にかかる時間を意味する。
【0004】
また、他にも特許文献1に示すような仕組みが考えられている。この仕組みは、まず中央装置が各端末に時刻情報を一斉送信する。そして、その時刻情報を受信した各端末が、正式な時刻として採用する前に受信した時刻情報を一旦記憶し、中央装置からの問い合わせに対して記憶しておいた時刻情報を確認のために中央装置へ送信する。そして、中央装置が、端末から受け取った時刻情報が正しいか否かを個別に判定し、正しければ端末に正式な時刻として採用する旨の指令を伝える。そして、その指令を受け取った端末が、時刻情報を記憶してから正式な時刻として採用する旨の指令を受け取るまでに要した時間を、記憶しておいた時刻情報に加算して正式な時刻として採用する仕組みである。
【0005】
【特許文献1】
特開平3−271959号公報
【0006】
【発明が解決しようとする課題】
しかし、特許文献1に示されている仕組みは、送信した時刻が正しいか否かの確認を端末毎に行うため、確実に同期処理が行われるという利点はあるものの、時刻同期が完了するまでに時間がかかるという問題がある。また、この仕組みも、図1(b)の遅延時間の説明図に示すように、端末側がフレームを受信した際、中央装置が管理する基準時刻15に対して伝送遅延16、フレーム読み取り遅延17及びカウンタセット処理遅延18が生じる。
【0007】
尚、この図1(b)の遅延時間の説明図は、上述した「正式な時刻として採用する旨の指令」を意味するフレームを受信した際に発生する遅延に関するものである。また、上述した通り、時刻情報を記憶してから正式な時刻として採用する旨の指令を受け取るまでに要した時間を、記憶しておいた時刻情報に加算する処理が必要であるため、カウンタセット処理遅延18は、図1(a)に示したカウンタセット処理遅延14よりも長い時間が必要となる。更に、時刻情報を記憶してから正式な時刻として採用する旨の指令を受け取るまでに要した時間についての精度は、各々のカウンタの精度により端末毎に誤差が生じるおそれがあることを付け加えておく。
【0008】
本発明は、このような時刻同期時に発生する遅延をできるだけ少なくし、これらの遅延の結果生じる誤差が低減された時刻同期システムを提供することを課題とする。
【0009】
【課題を解決するための手段及び発明の効果】
上記課題を解決するためになされた請求項1に記載の時刻同期システムは、時刻管理のためのタイマカウンタを有すると共に割り込み信号によって割り込み処理を実行する電子制御装置を複数備え、電子制御装置の何れか一つの主電子制御装置が、通信線を介して所定の信号を他の電子制御装置に送信する。そして、他の電子制御装置は、通信線を介して所定の信号を受信すると割り込み機能を有効にし、次に主電子制御装置によって同報送信された信号の受信を開始すると割り込み処理を実行し、その割り込み処理の中で所定の設定値を当該電子制御装置のタイマカウンタの値としてセットし、セットした後に割り込み機能を無効にする。尚、ここで言う「所定の値」というのは、例えば「0」のような予め決められた設定値を意味する。また、電子制御装置は、割り込み機能を有効と無効とに切り替えることができるように構成されている。
【0010】
従来の時刻同期システムでは、電子制御装置が主電子制御装置から同報送信された時刻情報が含まれるフレームを読み取って時刻をセットするようになっているため、図1(a)に示したような、伝送遅延12、フレーム読み取り遅延13及びカウンタセット処理遅延14が生じた。
【0011】
しかし、請求項1に記載の時刻同期システムでは、電子制御装置が主電子制御装置から同報送信された信号の受信の開始で割り込み処理を開始し、その割り込み処理の中で所定の設定値を時刻としてセットする。このため、時刻をセットするために用いられるフレームについては、そのフレームを先頭ビットから順に1フレーム分最後まで読みとる必要がなく、フレームの先頭を受信しただけで電子制御装置が割り込み処理を開始し、予め決められた設定値をタイマカウンタにセットする。したがって、フレームの読み取り処理にかかる時間分だけ時刻同期処理にかかる時間を短縮でき、従来に比べて時刻同期処理における誤差を抑えることができる。尚、この効果は、通信で用いられるフレームのフレーム長が長いほど得られやすい。
【0012】
このことを図1(c)に示す遅延時間の説明図を用いて説明する。本図は、タイマカウンタの値をセットする処理(割り込み処理)の起動トリガーとなるフレームを、主電子制御装置以外の他の電子制御装置が受信する際に発生する遅延に関するものである。図1(c)に示すように、伝送遅延22及びカウンタセット処理遅延23は発生するが、フレーム読み取り遅延は発生しない。また、伝送遅延22は図1(a)に示した従来方法の場合の伝送遅延12と同程度であり、カウンタセット処理遅延23も図1(a)に示した従来方法の場合のカウンタセット処理遅延14と同程度である。したがって、フレーム読み取り遅延の分だけ遅延が少なくなり、その結果、誤差が低減される。
【0013】
また、主電子制御装置の統括のもと、主電子制御装置以外の他の電子制御装置だけが時刻同期するようになっていてもよいが、請求項2に記載のように、主電子制御装置も同期するようになっていてもよい。つまり、主電子制御装置が、所定の信号を他の電子制御装置に送信した際に自らも割り込み機能を有効にし、次に当該主電子制御装置がデータの同報送信を開始したときに割り込み処理を実行し、その割り込み処理の中で、所定の設定値を当該主電子制御装置のタイマカウンタの値としてセットするのである。このようになっていれば、全ての電子制御装置の時刻を同期させることができる。
【0014】
ところで、請求項1又は請求項2に記載の時刻同期システムでは、時刻同期時には予め定められた設定値に設定されるようになっていた。すなわち、各電子制御装置のタイマカウンタの値は、時刻同期がなされる前と後とで不連続となってしまう可能性が高い。そこでタイマカウンタの値をある程度連続させて同期させることを考えた場合には、請求項3に記載のような時刻同期システムを用いるとよい。
【0015】
すなわち、時刻管理のためのタイマカウンタを有すると共に割り込み信号によって割り込み処理を実行する電子制御装置を複数備え、電子制御装置の何れか一つの主電子制御装置が、通信線を介して所定の設定値を他の電子制御装置に送信する。そして、他の電子制御装置は、通信線を介して所定の設定値を受信するとその所定の設定値を記憶するとともに割り込み機能を有効にし、次に主電子制御装置によって同報送信された信号の受信を開始すると割り込み処理を実行し、その割り込み処理の中で、記憶しておいた所定の設定値を当該電子制御装置のタイマカウンタの値としてセットし、セットした後に割り込み機能を無効にするのである。
【0016】
つまり、主電子制御装置が予め所定の設定値を他の電子制御装置に送信しておき、その後に信号を同報送信することによって、その信号の受信タイミングで他の電子制御装置は、予め受信し記憶しておいた設定値をタイマカウンタの値としてセットするのである。
【0017】
このため、請求項1に記載の時刻同期システムが奏する効果に加え、主電子制御装置が他の電子制御装置のタイマカウンタの値を指定することが可能になるという効果が得られる。そのため、例えば主電子制御装置が自身のタイマカウンタの値を設定値として時刻同期の度に送信するようにすれば、時刻同期の前後において各電子制御装置のタイマカウンタ値の連続性をある程度維持できる。
【0018】
また、主電子制御装置の統括のもと、主電子制御装置以外の他の電子制御装置だけが時刻同期するようになっていてもよいが、請求項4に記載のように、主電子制御装置も同期するようになっていてもよい。つまり、主電子制御装置が、所定の設定値を他の電子制御装置に送信した際に自らも割り込み機能を有効にし、次に当該主電子制御装置がデータの同報送信を開始したときに割り込み処理を実行し、その割り込み処理の中で、送信に用いた所定の設定値を当該主電子制御装置のタイマカウンタの値としてセットするのである。このようになっていれば、全ての電子制御装置の時刻を同期させることができる。
【0019】
また、主電子制御装置が送信する所定の設定値は主電子制御装置のタイマカウンタの値そのままでもよいが、主電子制御装置のタイマカウンタの値そのままであると、複数回の時刻同期を行うと時刻同期を行う毎に電子制御装置のタイマカウンタの値が時刻同期処理に要した時間分だけ戻ることになる。なぜなら、所定の設定値を受信してからその値をタイマカウンタの値としてセットするまでに時間を要し、その間も電子制御装置のタイマカウンタの値はカウントアップしているからである。このようなことを防止するためには、請求項5に記載のようになっているとよい。つまり、主電子制御装置が、他の電子制御装置に送信する所定の設定値を決定する際に、その所定の設定値を決定してからその所定の設定値を他の電子制御装置がタイマカウンタの値としてセットするまでに必要な時間を当該主電子制御装置のタイマカウンタの値に加えて所定の設定値を決定するようになっているとよい。
【0020】
このようになっていれば、時刻同期時のタイマカウンタの値とこれからセットしようとしている設定値とがほぼ同値となり、時刻同期を行う毎に電子制御装置のタイマカウンタの値が戻ることを防止することができる。つまり、時刻同期の前後における各電子制御装置のタイマカウンタ値の連続性をより維持できる。
【0021】
また、主電子制御装置は、予め電子制御装置の中から選択して決定しておいてもよいが、請求項6に記載のように、主電子制御装置は、複数の電子制御装置のうち、当該時刻同期システムへの電力が投入された際に最も早く処理可能になった何れか一つの電子制御装置がなるようになっていてもよい。尚、ここで言う「最も早く処理可能になった何れか一つの電子制御装置」というのは、時刻同期システムに電力が投入された後、各電子制御装置で初期化処理が終了して初期化処理以外の他の処理が最も早く実行可能になった何れか一つの電子制御装置のことを意味する。
【0022】
このようになっていれば、主電子制御装置が例えば故障で役割を果たせなくなったときでも次回のシステム起動時に別の電子制御装置が新たに主電子制御装置として機能するため、再び時刻同期を行うことができるようになる。つまり、時刻同期システムの耐故障性能が高まる。
【0023】
【発明の実施の形態】
以下、本発明が適用された実施例について図面を用いて説明する。尚、本発明の実施の形態は、下記の実施例に何ら限定されることはなく、本発明の技術的範囲に属する限り種々の形態を採りうることは言うまでもない。
【0024】
図2は、実施例の車両制御システム30である。車両制御システム30は、エンジンを制御するためのECUであるエンジンECU31と、オートマチックトランスミッションを制御するためのECUであるAT−ECU33と、VSC(Vehicle Stability Control)システムを制御するためのECUであるVSC−ECU35と、ACC(Auto Cruise Control)システムを制御するためのECUであるACC−ECU37と、これら各ECUを結ぶ通信線39とを備える。そして、車両制御システム30は、これらの各ECU間で時刻の同期がなされるよう時刻同期システムが構成されている。
【0025】
エンジンECU31は、トランシーバー31aと通信モジュール31bとマイコン31cとを備える。このうち、トランシーバー31aは、通信線39から受け取った電気信号に対してレベル変換やノイズ除去等の各種の信号処理を施してフレームを抽出し、逐次通信モジュール31bに渡すと共に後述するマイコン31cの外部割り込み端子31dに入力させる。また逆に、通信モジュールから受け取ったフレームに対してレベル変換等の信号処理を施して通信線39に送信する。
【0026】
通信モジュール31bは、トランシーバー31aから受け取ったフレームを分解し、ヘッダーデータ及び受信データ(受信本文)をマイコン31cに渡す。また逆に、マイコン31cからヘッダーデータ及び送信データ(送信本文)を受け取り、定められた通信プロトコルにしたがってフレームを形成し、トランシーバー31aに渡す。
【0027】
マイコン31cは、CPU、ROM、RAM、バス及びインタフェース等を備えた所謂ワンチップマイコンである。インタフェースの一つとして、外部割り込み端子31dを備えており、この端子に所定の信号が入力されるとCPUが割り込み処理を実行するようになっている。また、CPUは内部にカウントタイマを有しておりクロックに同期してカウントアップ動作をするようになっている。また、ROMにはエンジン制御プログラム等の各種プログラムが格納され、これらのプログラムがRAMに読み出され、CPUが実行する。
【0028】
AT−ECU33、VSC−ECU35及びACC−ECU37は、エンジンECU31と同様に、図示しないトランシーバーや通信モジュールやマイコンを備えており、特にマイコンについて言えば、格納されているプログラムや処理能力に違いはあるもののエンジンECU31のマイコン31cと同様に外部割り込み端子に信号が入力されると割り込み処理が実行されるように構成されている。
【0029】
通信線は、フレーム化されたデータや指令等をシリアル通信によって伝達可能となっている。
ここまでで車両制御システム30の概略構成を説明したが、エンジンECU31が特許請求の範囲に記載の主電子制御装置に相当し、AT−ECU33、VSC−ECU35及びACC−ECU37が他の電子制御装置に相当する。
【0030】
次に、エンジンECU31で定期的に実行される時刻情報配信処理及び、時刻情報配信処理が実行された結果、AT−ECU33、VSC−ECU35及びACC−ECU37で実行される時刻情報受信処理及び、全てのECUで実行される割り込み処理について順に説明する。
【0031】
(1)時刻情報配信処理
時刻情報配信処理について図3のフローチャートを用いて説明する。本処理は、車両制御システム30に電源が投入され、エンジンECU31のマイコン31cで各種の初期化処理の実行が終了した後に実行される。また、定期的(例えば10分毎)にも実行される。
【0032】
処理が開始されると、まずタイマカウンタの値を読み取る(S110)。次に、読み取ったタイマカウンタの値に所定の値を加算し、設定値としてメモリに記憶する(S115)。ここで言う「所定の値」は、設定値を決定してから、後述する割り込み処理でAT−ECU33、VSC−ECU35及びACC−ECU37が設定値をタイマカウンタの値として設定する(図5のS315参照)までにかかる時間を意味する。また、設定値を記憶するメモリは、本処理が終了した後も記憶され続けるようなメモリである。
【0033】
次に、設定値を通信モジュール31bに渡してAT−ECU33、VSC−ECU35及びACC−ECU37に対して送信させる(S210)。この送信は、一斉同報送信させてもよいし、個別に送信させてもよい。送信が完了すると(S125)、外部割り込みを許可する(S130)。このように外部割り込みを許可することにより、上述した外部割り込み端子31dの信号レベルが変化した際(例えばHIからLOWに変化した際)に、割り込み処理が開始されるようになる。
【0034】
そして、所定時間だけ待機する(S135)。この「所定時間」というのは、AT−ECU33、VSC−ECU35及びACC−ECU37で実行される、後述する時刻情報受信処理が終了する程度の時間を意味する。
そして、所定時間だけ待機した後、時刻同期のためのブロードキャストフレームを送信するように通信モジュール31bに指示し(S140)、本処理を終了する。
【0035】
(2)時刻情報受信処理
続いて、上述した時刻情報配信処理によって送信された、設定値を含むフレームが届くと実行される時刻情報受信処理について、図4のフローチャートを用いて説明する。本処理は、設定値の受信を開始したすべてのECU、すなわちAT−ECU33、VSC−ECU35及びACC−ECU37のマイコンで実行される。
【0036】
実行が開始されると、フレームを先頭ビットから順に最後まで受信する(S210)。フレームの受信を完了すると、そのフレームの中に含まれる設定値を保存し(S215)、外部割り込みを許可し(S220)、本処理を終了する。このように外部割り込みを許可することにより、図示しないマイコンに設けられた外部割り込み端子の信号レベルが変化した際(例えばHIからLOWに変化した際)に、割り込み処理が開始されるようになる。
【0037】
(3)割り込み処理
次に、図5のフローチャートを用いて割り込み処理について説明する。時刻情報配信処理及び時刻情報受信処理によって外部割り込みを許可する状態となっているエンジンECU31、AT−ECU33、VSC−ECU35及びACC−ECU37が、時刻情報配信処理のS140(図3参照)で送信されたブロードキャストフレームの先頭ビットの変化をトリガーにして割り込み処理を実行する。
【0038】
実行が開始されると、まず外部割り込みを禁止する(S310)。これは多重に割り込み処理が実行されて誤動作することを防止するためである。そして、事前に記憶しておいた設定値をタイマカウンタの値としてセットし(S315)、本処理を終了する。
【0039】
次に、図6のタイムチャートを用いて、上述した時刻情報配信処理、時刻情報受信処理及び割り込み処理の実行タイミングを説明する。図6に示すように、まずエンジンECU31で実行される時刻情報配信処理Aを基本とし、当該処理の中で実行される、設定値を含むフレームの送信ステップ(図3のS120参照)をトリガーにしてその他のECU(AT−ECU33、VSC−ECU35及びACC−ECU37)では時刻情報受信処理Bが開始される。そして時刻情報受信処理Bが終了した後、時刻情報配信処理Aの最終段階で実行されるブロードキャストフレームの送信開始(図3のS140参照)で、エンジンECU31では割り込み処理C1が実行され、その他のECU(AT−ECU33、VSC−ECU35及びACC−ECU37)では割り込み処理C2が実行される。この割り込み処理C1と割り込み処理C2は処理の実行主体が異なるだけであり処理内容は同じである。
【0040】
これまで説明したように、本実施例の車両制御システム30によれば、AT−ECU33、VSC−ECU35及びACC−ECU37が、エンジンECU31から同報送信されたフレームの受信の開始で割り込み処理を開始し、その割り込み処理の中で予め受信して記憶しておいた設定値を各ECUが備えるタイマカウンタの値としてセットする。
【0041】
このため、従来のようにフレームの先頭ビットから順に1フレーム分最後まで読みとった後にタイマカウンタに値をセットするという手順を踏む必要がなく、フレームの先頭ビットを受信しただけで各ECUが備えるマイコンが割り込み処理を開始し、記憶しておいた設定値をタイマカウンタにセットする。したがって、フレームの読み取り処理にかかる時間を短縮でき、従来に比べて時刻同期処理における誤差を抑えることができる。
【0042】
また、エンジンECU31が、他のECU(AT−ECU33、VSC−ECU35及びACC−ECU37)に送信する設定値を決定する際に、その決定からその設定値を他のECU(AT−ECU33、VSC−ECU35及びACC−ECU37)がタイマカウンタの値としてセットするまでに必要な時間をエンジンECU31のタイマカウンタの値に加えるようになっている。
【0043】
このように時刻同期にかかる時間の一部を考慮して設定値を決定するため、各ECUではタイマカウンタへの値のセット前後でタイマカウンタの値がほぼ同値となり、時刻同期の前後における各ECUのタイマカウンタ値の連続性をより維持できる。
【0044】
以下、他の実施例について述べる。
(イ)上記実施例では、エンジンECU31が設定値を算出して他のECU(AT−ECU33、VSC−ECU35及びACC−ECU37)に送信するようになっていたが、このように設定値を送らず、各々のECUが予め備える所定の設定値をセットするようになっていてもよい。このようになっていると、上述したような各ECUのタイマカウンタの連続性の維持は困難になるが、時刻同期の仕組みがシンプルとなり、時刻同期の確実性が高まる。
【0045】
(ロ)上記実施例では、エンジンECU31が固定的に特許請求の範囲に記載の主電子制御装置に相当していたが、主電子制御装置に相当するECUは動的に変化してもよい。例えば、車両制御システム30への電力が投入された際に最も早く処理可能になった何れか一つのECUが主電子制御装置として機能するようになっていてもよい。ここで言う「最も早く処理可能になった何れか一つのECU」というのは、車両制御システム30に電力が投入された後、各ECUで初期化処理が終了して初期化処理以外の他の処理が最も早く実行可能になった何れか一つのECUのことを意味する。
【0046】
このようになっていれば、例えばエンジンECU31が故障で役割を果たせなくなったときでも、次回、車両制御システム30が起動した際に別のECUが新たに主電子制御装置として機能するため、再び時刻同期を行うことができるようになる。つまり、時刻同期システムとしての耐故障性能が高まる。
【図面の簡単な説明】
【図1】 遅延時間について説明するための説明図である。
【図2】 実施例の車両制御システムの構成を示すブロック図である。
【図3】 時刻情報配信処理を説明するためのフローチャートである。
【図4】 時刻情報受信処理を説明するためのフローチャートである。
【図5】 割り込み処理を説明するためのフローチャートである。
【図6】 各処理の実行タイミングを説明するためのタイムチャートである。
【符号の説明】
30…車両制御システム、31…エンジンECU、31a…トランシーバー、31b…通信モジュール、31c…マイコン、31d…外部割り込み端子、33…AT−ECU、35…VSC−ECU、37…ACC−ECU、39…通信線[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a system for realizing time synchronization between electronic control devices.
[0002]
[Prior art]
There are systems that perform various types of control distributed among multiple electronic control units connected via a network, but these electronic control units operate in coordination with each other, so time synchronization between electronic control units is extremely important. It is. For this reason, various time synchronization systems have been developed. However, in recent years, each electronic control device has been enhanced to perform more advanced control as a whole. More and more accuracy is required.
[0003]
Conventionally, a method in which each electronic control unit receives a frame transmitted from the main electronic control unit that plays a central role and sets the time of the electronic control unit based on time information included in the frame is generally used. Was taken.
However, in this method, as shown in the explanatory diagram of the delay time in FIG. 1A, when the electronic control device other than the main electronic control device receives the frame, the reference time 11 managed by the main electronic control device is reached. On the other hand, a transmission delay 12, a frame reading delay 13, and a counter set processing delay 14 occur. Then, the sum of these delays becomes an error in time synchronization, and in recent years this error cannot be ignored. The transmission delay 12 referred to here means the time required for a frame transmitted from the main electronic control unit to reach another electronic control unit other than the main electronic control unit. The frame reading delay 13 means the time required to read one frame from the first bit in order of the frame including the time information serialized and transmitted in the frame format. Further, the counter set processing delay 14 means the time required for the process of setting the timer counter based on the time information included in the received frame.
[0004]
In addition, a mechanism as shown in Patent Document 1 is considered. In this mechanism, first, the central device transmits time information to each terminal simultaneously. Then, each terminal that has received the time information temporarily stores the time information received before adopting it as the official time, and the time information stored in response to the inquiry from the central device is centrally confirmed. Send to device. Then, the central device individually determines whether or not the time information received from the terminal is correct, and if it is correct, sends a command to the terminal to adopt as the official time. Then, the terminal that receives the command adds the time taken from the time information stored to the time when the command to adopt as the official time is received to the stored time information as the official time. It is a mechanism to adopt.
[0005]
[Patent Document 1]
JP-A-3-271959 [0006]
[Problems to be solved by the invention]
However, the mechanism disclosed in Patent Document 1 confirms whether or not the time of transmission is correct for each terminal, and although there is an advantage that the synchronization processing is surely performed, the time synchronization is completed. There is a problem that it takes time. In addition, as shown in the explanatory diagram of the delay time in FIG. 1B, this mechanism also has a transmission delay 16, a frame reading delay 17, and a reference time 15 managed by the central device when the terminal receives a frame. Counter set processing delay 18 occurs.
[0007]
The explanatory diagram of the delay time in FIG. 1B relates to the delay that occurs when the above-mentioned “meaning to adopt as a formal time” frame is received. In addition, as described above, since it is necessary to add the time required to receive the command to adopt as the official time after storing the time information to the stored time information, the counter set The processing delay 18 requires a longer time than the counter set processing delay 14 shown in FIG. Furthermore, it is added that the accuracy of the time required from the time information storage to the reception of the command to adopt as the official time may cause an error for each terminal due to the accuracy of each counter. .
[0008]
It is an object of the present invention to provide a time synchronization system that minimizes the delay that occurs during such time synchronization and that reduces errors resulting from these delays.
[0009]
[Means for Solving the Problems and Effects of the Invention]
The time synchronization system according to claim 1, which has been made to solve the above-described problem, includes a plurality of electronic control devices that have a timer counter for time management and execute interrupt processing by an interrupt signal. One main electronic control unit transmits a predetermined signal to another electronic control unit via a communication line. Then, the other electronic control unit activates the interrupt function when receiving a predetermined signal via the communication line, and then executes interrupt processing when starting reception of the signal broadcasted by the main electronic control unit, In the interrupt processing, a predetermined set value is set as the value of the timer counter of the electronic control device, and after setting, the interrupt function is invalidated. The “predetermined value” here means a predetermined set value such as “0”, for example. Further, the electronic control device is configured so that the interrupt function can be switched between enabled and disabled.
[0010]
In the conventional time synchronization system, the electronic control unit reads the frame including the time information broadcast from the main electronic control unit and sets the time, so as shown in FIG. In addition, a transmission delay 12, a frame reading delay 13, and a counter set processing delay 14 occurred.
[0011]
However, in the time synchronization system according to claim 1, the electronic control unit starts an interrupt process at the start of reception of a signal broadcast from the main electronic control unit, and sets a predetermined set value in the interrupt process. Set as time. Therefore, for the frame used to set the time, it is not necessary to read the frame from the first bit to the end of one frame in order, and the electronic control unit starts interrupt processing just by receiving the head of the frame, A predetermined set value is set in the timer counter. Therefore, the time required for the time synchronization process can be shortened by the time required for the frame reading process, and errors in the time synchronization process can be suppressed as compared with the conventional case. This effect is more easily obtained as the frame length of a frame used in communication is longer.
[0012]
This will be described with reference to the delay time explanatory diagram shown in FIG. This figure relates to a delay that occurs when an electronic control device other than the main electronic control device receives a frame that is a trigger for starting processing (interrupt processing) for setting a timer counter value. As shown in FIG. 1C, a transmission delay 22 and a counter set processing delay 23 occur, but a frame reading delay does not occur. The transmission delay 22 is almost the same as the transmission delay 12 in the conventional method shown in FIG. 1A, and the counter set processing delay 23 is also the counter set processing in the conventional method shown in FIG. It is about the same as the delay 14. Therefore, the delay is reduced by the frame reading delay, and as a result, the error is reduced.
[0013]
Further, only the electronic control device other than the main electronic control device may synchronize with the time under the supervision of the main electronic control device, but the main electronic control device as described in claim 2. May also be synchronized. That is, when the main electronic control unit transmits a predetermined signal to another electronic control unit, the main electronic control unit itself enables the interrupt function, and next time the main electronic control unit starts broadcast transmission of data, interrupt processing is performed. In the interruption process, a predetermined set value is set as the timer counter value of the main electronic control unit. If it becomes like this, the time of all the electronic control apparatuses can be synchronized.
[0014]
By the way, in the time synchronization system according to claim 1 or claim 2, it is set to a predetermined set value during time synchronization. That is, the value of the timer counter of each electronic control device is likely to be discontinuous before and after time synchronization. In view of this, it is preferable to use a time synchronization system such as that described in claim 3 when considering that the values of the timer counter are synchronized to some extent.
[0015]
That is, a plurality of electronic control devices having a timer counter for time management and executing interrupt processing by an interrupt signal are provided, and any one of the electronic control devices has a predetermined set value via a communication line. Is transmitted to another electronic control unit. When the other electronic control unit receives the predetermined set value via the communication line, it stores the predetermined set value and enables the interrupt function, and then the signal transmitted by the main electronic control unit is transmitted. When reception starts, interrupt processing is executed, and in that interrupt processing, the stored set value is set as the timer counter value of the electronic control unit, and after setting, the interrupt function is invalidated. is there.
[0016]
That is, the main electronic control unit transmits a predetermined set value in advance to another electronic control unit, and then broadcasts the signal, so that the other electronic control unit receives in advance at the reception timing of the signal. The stored setting value is set as the value of the timer counter.
[0017]
For this reason, in addition to the effect which the time synchronous system of Claim 1 produces | generates, the effect that the main electronic control apparatus becomes possible [designating the value of the timer counter of another electronic control apparatus] is acquired. Therefore, for example, if the main electronic control unit transmits its timer counter value as a set value every time synchronization, the continuity of the timer counter value of each electronic control unit can be maintained to some extent before and after the time synchronization. .
[0018]
Further, only the electronic control device other than the main electronic control device may synchronize with the time under the supervision of the main electronic control device. May also be synchronized. In other words, when the main electronic control unit transmits a predetermined set value to another electronic control unit, the main electronic control unit itself enables the interrupt function, and then interrupts when the main electronic control unit starts data broadcast transmission. Processing is executed, and in the interruption processing, a predetermined set value used for transmission is set as the value of the timer counter of the main electronic control unit. If it becomes like this, the time of all the electronic control apparatuses can be synchronized.
[0019]
Further, the predetermined setting value transmitted by the main electronic control unit may be the value of the timer counter of the main electronic control unit as it is, but if the value of the timer counter of the main electronic control unit is maintained as it is, the time synchronization is performed a plurality of times. Every time time synchronization is performed, the value of the timer counter of the electronic control device is returned by the time required for the time synchronization processing. This is because it takes time from receiving a predetermined set value to setting the value as the value of the timer counter, and the value of the timer counter of the electronic control device is counting up during that time. In order to prevent such a situation, it is preferable to be as described in claim 5. In other words, when the main electronic control unit determines a predetermined set value to be transmitted to another electronic control unit, the predetermined set value is determined after the other electronic control unit determines the predetermined set value by the timer counter. It is preferable that a predetermined setting value is determined by adding a time required to set the value to the value of the timer counter of the main electronic control unit.
[0020]
If it becomes like this, the value of the timer counter at the time synchronization and the set value to be set are almost the same value, and the value of the timer counter of the electronic control device is prevented from returning every time the time synchronization is performed. be able to. That is, the continuity of the timer counter value of each electronic control device before and after time synchronization can be further maintained.
[0021]
Further, the main electronic control unit may be selected and determined in advance from among the electronic control units. However, as described in claim 6, the main electronic control unit is a plurality of electronic control units. Any one of the electronic control units that can be processed earliest when power is supplied to the time synchronization system may be provided. Note that "one of the electronic control devices that can be processed earliest" here means that the initialization processing is completed in each electronic control device after power is supplied to the time synchronization system. It means any one of the electronic control devices that can execute the process other than the process first.
[0022]
If this is the case, even when the main electronic control unit can no longer play a role due to a failure, for example, another electronic control unit functions as the main electronic control unit at the next system start-up, so time synchronization is performed again. Will be able to. That is, the fault tolerance performance of the time synchronization system is increased.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments to which the present invention is applied will be described below with reference to the drawings. The embodiments of the present invention are not limited to the following examples, and it goes without saying that various forms can be adopted as long as they belong to the technical scope of the present invention.
[0024]
FIG. 2 shows a
[0025]
The
[0026]
The
[0027]
The
[0028]
Like the
[0029]
The communication line can transmit framed data, commands, and the like by serial communication.
The schematic configuration of the
[0030]
Next, as a result of the time information distribution process periodically executed by the
[0031]
(1) Time information distribution process The time information distribution process will be described with reference to the flowchart of FIG. This process is executed after the
[0032]
When the process is started, the value of the timer counter is first read (S110). Next, a predetermined value is added to the read value of the timer counter and stored in the memory as a set value (S115). Here, the “predetermined value” is determined by the AT-
[0033]
Next, the set value is passed to the
[0034]
Then, it waits for a predetermined time (S135). This “predetermined time” means a time to the extent that a time information reception process (described later) executed by the AT-
Then, after waiting for a predetermined time, the
[0035]
(2) Time Information Receiving Process Subsequently, the time information receiving process that is executed when the frame including the setting value transmitted by the time information distributing process described above arrives will be described with reference to the flowchart of FIG. This process is executed by the microcomputers of all ECUs that start receiving the set values, that is, the AT-
[0036]
When the execution is started, frames are received from the first bit to the last (S210). When the reception of the frame is completed, the setting value included in the frame is saved (S215), the external interrupt is permitted (S220), and this process is terminated. By permitting external interrupts in this way, interrupt processing is started when the signal level of an external interrupt terminal provided in a microcomputer (not shown) changes (for example, when it changes from HI to LOW).
[0037]
(3) Interrupt processing Next, interrupt processing will be described with reference to the flowchart of FIG. The
[0038]
When the execution is started, external interrupts are first prohibited (S310). This is to prevent malfunctions caused by multiple interrupt processing. Then, the set value stored in advance is set as the value of the timer counter (S315), and this process is terminated.
[0039]
Next, the execution timing of the above-described time information distribution process, time information reception process, and interrupt process will be described with reference to the time chart of FIG. As shown in FIG. 6, first, based on the time information distribution process A executed by the
[0040]
As described so far, according to the
[0041]
For this reason, there is no need to take the procedure of setting a value in the timer counter after reading from the first bit of the frame sequentially to the end of the frame as in the prior art, and the microcomputer included in each ECU only by receiving the first bit of the frame Starts interrupt processing and sets the stored setting value in the timer counter. Therefore, the time required for the frame reading process can be shortened, and errors in the time synchronization process can be suppressed as compared with the prior art.
[0042]
Further, when the
[0043]
Since the set value is determined in consideration of a part of the time required for time synchronization in this way, in each ECU, the value of the timer counter becomes almost the same before and after setting the value in the timer counter, and each ECU before and after time synchronization The continuity of the timer counter value can be further maintained.
[0044]
Other embodiments will be described below.
(B) In the above embodiment, the
[0045]
(B) In the above embodiment, the
[0046]
If this is the case, for example, even when the
[Brief description of the drawings]
FIG. 1 is an explanatory diagram for explaining a delay time;
FIG. 2 is a block diagram illustrating a configuration of a vehicle control system according to an embodiment.
FIG. 3 is a flowchart for explaining time information distribution processing;
FIG. 4 is a flowchart for explaining time information reception processing;
FIG. 5 is a flowchart for explaining interrupt processing;
FIG. 6 is a time chart for explaining the execution timing of each process.
[Explanation of symbols]
DESCRIPTION OF
Claims (6)
前記電子制御装置の何れか一つの主電子制御装置が、通信線を介して所定の信号を他の電子制御装置に送信し、
前記他の電子制御装置は、前記通信線を介して前記所定の信号を受信すると割り込み機能を有効にし、次に前記主電子制御装置によって同報送信された信号の受信を開始すると割り込み処理を実行し、その割り込み処理の中で所定の設定値を当該電子制御装置のタイマカウンタの値としてセットし、セットした後に割り込み機能を無効にすることを特徴とする時刻同期システム。A plurality of electronic control devices that have a timer counter for time management and execute interrupt processing by an interrupt signal,
Any one main electronic control unit of the electronic control unit transmits a predetermined signal to another electronic control unit via a communication line,
The other electronic control unit activates the interrupt function when it receives the predetermined signal via the communication line, and then executes interrupt processing when it starts receiving the broadcast signal transmitted by the main electronic control unit In the interrupt processing, a predetermined set value is set as a value of a timer counter of the electronic control device, and the interrupt function is disabled after the set value.
前記主電子制御装置は、前記所定の信号を前記他の電子制御装置に送信した際に自らも割り込み機能を有効にし、次に当該主電子制御装置がデータの同報送信を開始したときに割り込み処理を実行し、その割り込み処理の中で、所定の設定値を当該主電子制御装置のタイマカウンタの値としてセットすることを特徴とする時刻同期システム。The time synchronization system according to claim 1,
The main electronic control unit itself enables the interrupt function when transmitting the predetermined signal to the other electronic control unit, and then interrupts when the main electronic control unit starts broadcasting data. A time synchronization system characterized by executing a process and setting a predetermined set value as a timer counter value of the main electronic control unit in the interrupt process.
前記電子制御装置の何れか一つの主電子制御装置が、通信線を介して所定の設定値を他の電子制御装置に送信し、
前記他の電子制御装置は、前記通信線を介して前記所定の設定値を受信するとその所定の設定値を記憶するとともに割り込み機能を有効にし、次に前記主電子制御装置によって同報送信された信号の受信を開始すると割り込み処理を実行し、その割り込み処理の中で、記憶しておいた前記所定の設定値を当該電子制御装置のタイマカウンタの値としてセットし、セットした後に割り込み機能を無効にすることを特徴とする時刻同期システム。A plurality of electronic control devices that have a timer counter for time management and execute interrupt processing by an interrupt signal,
Any one main electronic control unit of the electronic control unit transmits a predetermined set value to another electronic control unit via a communication line,
When the other electronic control unit receives the predetermined set value via the communication line, the other electronic control unit stores the predetermined set value and enables the interrupt function, and is then broadcasted by the main electronic control unit When signal reception starts, interrupt processing is executed. During the interrupt processing, the stored preset value is set as the value of the timer counter of the electronic control unit, and then the interrupt function is disabled. A time synchronization system characterized by that.
前記主電子制御装置は、前記所定の設定値を前記他の電子制御装置に送信した際に自らも割り込み機能を有効にし、次に当該主電子制御装置がデータの同報送信を開始したときに割り込み処理を実行し、その割り込み処理の中で、前記送信に用いた所定の設定値を当該主電子制御装置のタイマカウンタの値としてセットすることを特徴とする時刻同期システム。The time synchronization system according to claim 3,
The main electronic control unit itself enables an interrupt function when transmitting the predetermined set value to the other electronic control unit, and then when the main electronic control unit starts broadcasting data. A time synchronization system characterized by executing an interrupt process and setting a predetermined set value used for the transmission as a value of a timer counter of the main electronic control unit in the interrupt process.
前記主電子制御装置は、前記他の電子制御装置に送信する前記所定の設定値を決定する際に、その所定の設定値を決定してからその所定の設定値を前記他の電子制御装置がタイマカウンタの値としてセットするまでに必要な時間を当該主電子制御装置のタイマカウンタの値に加えて前記所定の設定値を決定することを特徴とする時刻同期システム。In the time synchronization system according to claim 3 or claim 4,
When the main electronic control unit determines the predetermined set value to be transmitted to the other electronic control unit, the main electronic control unit determines the predetermined set value and then the other electronic control unit determines the predetermined set value. A time synchronization system characterized in that the predetermined set value is determined by adding a time required for setting as a timer counter value to a timer counter value of the main electronic control unit.
前記主電子制御装置は、前記複数の電子制御装置のうち、当該時刻同期システムへの電力が投入された際に最も早く処理可能になった何れか一つの前記電子制御装置がなることを特徴とする時刻同期システム。In the time synchronous system in any one of Claims 1-5,
The main electronic control device may be any one of the plurality of electronic control devices that can be processed earliest when power is supplied to the time synchronization system. Time synchronization system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003018921A JP4123946B2 (en) | 2003-01-28 | 2003-01-28 | Time synchronization system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003018921A JP4123946B2 (en) | 2003-01-28 | 2003-01-28 | Time synchronization system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004234098A JP2004234098A (en) | 2004-08-19 |
JP4123946B2 true JP4123946B2 (en) | 2008-07-23 |
Family
ID=32948927
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003018921A Expired - Fee Related JP4123946B2 (en) | 2003-01-28 | 2003-01-28 | Time synchronization system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4123946B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9883474B2 (en) | 2013-07-19 | 2018-01-30 | Mitsubishi Electric Corporation | Ring-shaped synchronous network system and time slave station |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7730250B2 (en) | 2006-12-27 | 2010-06-01 | Seiko Epson Corporation | Interrupt control circuit, circuit board, electro-optic device, and electronic apparatus |
US7865290B2 (en) * | 2007-10-09 | 2011-01-04 | Ford Global Technologies, Llc | Valve control synchronization and error detection in an electronic valve actuation engine system |
JP5626589B2 (en) * | 2011-03-31 | 2014-11-19 | 横河電機株式会社 | Network device and time synchronization method in the same device |
JP6665632B2 (en) * | 2016-03-30 | 2020-03-13 | 株式会社デンソー | Electronic control unit |
WO2022009497A1 (en) * | 2020-07-06 | 2022-01-13 | 日立Astemo株式会社 | Electronic control device |
CN116880339B (en) * | 2023-09-07 | 2023-11-28 | 北京控达科技有限公司 | Data period synchronization method and system based on double MCUs |
-
2003
- 2003-01-28 JP JP2003018921A patent/JP4123946B2/en not_active Expired - Fee Related
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9883474B2 (en) | 2013-07-19 | 2018-01-30 | Mitsubishi Electric Corporation | Ring-shaped synchronous network system and time slave station |
Also Published As
Publication number | Publication date |
---|---|
JP2004234098A (en) | 2004-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9331838B2 (en) | Method for synchronizing clocks in nodes of a vehicle network and node designed to perform the method | |
US9594709B2 (en) | Time and event based message transmission | |
US20160080168A1 (en) | Can fd | |
JP4766160B2 (en) | Communication system and communication node | |
CN113271169B (en) | Vehicle time service method and system based on wireless communication terminal | |
US11010328B2 (en) | Communication apparatus, communication method, program, and communication system | |
JP4123946B2 (en) | Time synchronization system | |
CN112787742B (en) | Clock synchronization method and device, wireless earphone and readable storage medium | |
JP5141377B2 (en) | Program rewriting system | |
KR20200141206A (en) | Apparatus for management network of a vehicle, system having the same and method thereof | |
US7428608B2 (en) | Communication system, communication circuit and communication method | |
WO2024183770A1 (en) | Inter-ecu vehicle identification number synchronization method and apparatus, and electronic device | |
WO2006051003A1 (en) | Concurrent flashing of data processing units in hierarchical networks | |
CN108885575B (en) | Control device and restoration processing method for control device | |
CN117639991A (en) | Time synchronization method and device for vehicle | |
JP4013592B2 (en) | Vehicle communication system | |
CN116126769A (en) | Isolation circuit and device isolation method for serial bus | |
JP4862521B2 (en) | Communication network system and startup method thereof | |
JP7225740B2 (en) | repeater | |
JP7446517B2 (en) | Electronic device and communication control method | |
JP5078857B2 (en) | Real-time control network system | |
JP2821091B2 (en) | Remote monitoring control device and time synchronization device | |
JP2009288953A (en) | Electronic control device | |
KR101705005B1 (en) | Network management method for avb in vehicle | |
JP2006033490A (en) | Data communication device, and communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050603 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080331 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20080415 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080428 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110516 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120516 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120516 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130516 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140516 Year of fee payment: 6 |
|
LAPS | Cancellation because of no payment of annual fees |