JP2004029992A - Electronic control unit - Google Patents
Electronic control unit Download PDFInfo
- Publication number
- JP2004029992A JP2004029992A JP2002182424A JP2002182424A JP2004029992A JP 2004029992 A JP2004029992 A JP 2004029992A JP 2002182424 A JP2002182424 A JP 2002182424A JP 2002182424 A JP2002182424 A JP 2002182424A JP 2004029992 A JP2004029992 A JP 2004029992A
- Authority
- JP
- Japan
- Prior art keywords
- cpu
- electronic control
- task
- counter
- abnormality
- 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.)
- Granted
Links
- 230000005856 abnormality Effects 0.000 claims abstract description 71
- 238000000034 method Methods 0.000 claims abstract description 47
- 230000000737 periodic effect Effects 0.000 claims description 16
- 230000006854 communication Effects 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 claims description 2
- 230000001960 triggered effect Effects 0.000 claims 1
- 238000012544 monitoring process Methods 0.000 description 27
- 230000002159 abnormal effect Effects 0.000 description 11
- 101000649167 Xenopus laevis Zinc finger protein Xfin Proteins 0.000 description 9
- 238000001514 detection method Methods 0.000 description 9
- 101150079125 DCN1 gene Proteins 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000002618 waking effect Effects 0.000 description 1
Images
Landscapes
- Testing And Monitoring For Control Systems (AREA)
- Debugging And Monitoring (AREA)
- Multi Processors (AREA)
- Programmable Controllers (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、2つ以上のCPUを有する電子制御装置にかかり、特に各CPUに供給されるクロック信号の異常や処理抜け異常を好適に検出するための電子制御装置に関するものである。
【0002】
【従来の技術】
車両制御等を実施する電子制御装置として、複数のCPUを備え、各CPU間で相互に異常を監視する機能を持つものがある。その一つとして、所定周期で反転するウオッチドッグパルス(WDパルス)をモニタしてCPUの動作状態を監視する方法がある。これは、一方のCPUが、他方のCPUよりWDパルスを入力し、該WDパルスが停止すると当該他方のCPUが異常である(暴走している)と判定するものである。
【0003】
【発明が解決しようとする課題】
この種の電子制御装置に関わる異常として、発振器等から各CPUに供給されるクロック信号の異常がある。この場合、発振器の異常等によりクロック信号の周波数が大小変化すると、そのクロック異常の状態によってはその異常が検出できないことが考えられる。
【0004】
例えば、クロック信号の周波数が正常時よりも大きくなる場合、それに起因してCPU内での時間演算の精度が低下する。そのため、定期的に実施されるべき各種の演算処理が所定の周期で実施されなくなるという不都合が生じる。かかる場合、上記の如くWDパルスによりCPUの異常検出を実施しても、WDパルスは定期的に発行されているため、クロック異常を判定することができない。
【0005】
また、優先度の異なる複数のタスクを起床するCPUでは、CPUの処理負荷が高まると低優先度のタスクで処理抜けが発生する場合が考えられる。この場合、通常WDパルスの発行は高優先度の処理であるため、低優先度処理が抜けたときでも正常にWDパルスが発行される。そのため、処理抜けが発生してもWDパルスには影響が出ず、処理抜けを検出することができない。最悪の場合、そのまま処理を継続する可能性が考えられる。
【0006】
本発明は上記問題に着目してなされたものであって、その目的とするところは、クロック異常や処理抜け異常を適正に検出し、ひいてはCPUの信頼性の確保を図ることができる電子制御装置を提供することである。
【0007】
【課題を解決するための手段】
請求項1に記載の発明では、第1CPUと第2CPUとを備え、これら各CPUに個別のクロック信号が入力されると共に該クロック信号を基に各CPUで定期的な演算処理が実施される。前記第2CPUは自身に入力されるクロック信号を基に一定周期の時間情報を前記第1CPUに通知する。また特に、前記第1CPUは、自身に入力されるクロック信号を基に一定周期で主カウンタをカウントすると共に、前記第2CPUより入力される一定周期の時間情報を基に副カウンタをカウントする。そして、これら主副両カウンタの差分を、前後する2つのタイミングで比較し、その比較結果から前記クロック信号の異常を検出する。
【0008】
仮に第2CPU側のクロック信号が異常となり、その周波数が正常時よりも小さくなる場合、第2CPUから第1CPUへ通知される時間情報の時間間隔が広がり、結果として副カウンタのカウント動作が遅くなる。この場合、主副両カウンタの差分が正常時とは相違し、更に前後する差分を比較することで、クロック信号が異常である旨判定できる。つまり、クロック信号の周期が変化するような異常を検出することができる。その結果、クロック異常を適正に検出し、ひいてはCPUの信頼性の確保を図ることができるようになる。
【0009】
請求項2に記載の発明では、前記第1CPUは、一定周期でタスクAを起床し、当該タスクAにて主カウンタをカウントすると共に、前記第2CPUからの時間情報をトリガとしてタスクBを起床し、当該タスクBにて副カウンタをカウントする。この場合、タスクA及びタスクBが適宜起床されることで主副両カウンタのカウント動作を行わせることができる。
【0010】
上記の如く第1CPUは、第2CPUから時間情報の通知を受けて副カウンタを動作させるが、かかる場合において、時間情報の通知を以下の形態で実現すると良い。
・請求項3に記載の発明では、前記第2CPUは、クロック信号に基づく定期処理にて一定周期でトリガ信号を出力し、前記第1CPUは、該トリガ信号の入力の都度、副カウンタをカウントする。
・請求項4に記載の発明では、前記第2CPUは、クロック信号に基づく定期の通信処理にて一定周期でデータ送信を行い、前記第1CPUは、第2CPUからのデータ受信の都度、副カウンタをカウントする。
・請求項5に記載の発明では、前記第2CPUより所定周期で反転するウオッチドッグパルスを入力し、そのウオッチドッグパルスが所定時間以上反転しないと第2CPUに対してリセット信号を出力する監視回路を更に備え、前記第1CPUは、前記ウオッチドッグパルスを第2CPUより入力し、その入力の都度、副カウンタをカウントする。
【0011】
上記何れの場合にも、第1CPUにおいて一定周期で副カウンタがカウントされ、その副カウンタと主カウンタとの差分によりクロック異常が適正に検出できる。
【0012】
請求項6に記載の発明では、前記第1CPUは、前後2つのタイミングの主副両カウンタの差分を比較して差分変化量を求め、その差分変化量が毎回同一である場合に、クロック異常である旨判定する。これにより、クロック異常が精度良く検出できる。
【0013】
請求項7に記載の発明では、前記第1CPUは、前後2つのタイミングの主副両カウンタの差分を比較して差分変化量を求め、その差分変化量が一方のカウンタのカウント分相当である場合に、何れかのカウンタが停止している旨判定する。これにより、カウンタ停止の異常が精度良く検出できる。請求項2のように、タスクAで主カウンタがカウントされ、タスクBで副カウンタがカウントされる場合、何れかのタスクが停止したことが精度良く検出できる。
【0014】
請求項8に記載したように、主副両カウンタの周期が同一である場合、それら両カウンタが共に正常であれば、差分が常に一致する。それ故、主副両カウンタの差分の比較が容易に実施できる。
【0015】
請求項9に記載の発明では、前記第1CPUは、前記第2CPUより通知される時間情報をトリガとして所定のタスクを起床し、当該タスク内において規定の処理単位で処理終了の履歴を残す。そして、次回のタスク起床時に前記履歴から処理抜け異常を検出する。この場合、前記タスクが最後まで実施されれば、全処理について処理終了の履歴が残るが、途中までしか実施されなければ未実施分については処理終了の履歴が残らない。従って、当該タスクについて処理抜けを検出することができる。また、履歴を確認することにより、処理抜けが発生した位置を特定することができる。
【0016】
上記請求項9の発明では請求項10に記載したように、前記第1CPUは、優先度の異なる複数のタスクを起床し、そのうち優先度の低いタスクにて規定の処理単位で処理終了の履歴を残すと良い。優先度の異なる複数のタスクが存在する場合、優先度の低いタスクは、その実施途中で高優先度のタスクが割り込むことで処理抜け(処理の中断)が生じるおそれがあるが、かかる場合に処理抜けの発生やその発生場所の特定が可能となる。
【0017】
また、請求項11に記載したように、前記第1CPUは、前記第2CPUからの時間情報にて起床される所定のタスクの最後に、前記副カウンタをカウントすると良い。これにより、処理抜けが発生した場合に副カウンタがカウントされなくなり、主副両カウンタの差分から異常発生の判定が可能となる。
【0018】
一方、請求項12に記載の発明でも、上記請求項9と同様に、前記タスクが最後まで実施されれば、全処理について処理終了の履歴が残るが、途中までしか実施されなければ未実施分については処理終了の履歴が残らない。従って、当該タスクについて処理抜けを検出することができる。また、履歴を確認することにより、処理抜けが発生した位置を特定することができる。
【0019】
更に、請求項13に記載したように、前記第1CPUは、優先度の異なる複数のタスクを起床し、そのうち優先度の低いタスクにて規定の処理単位で処理終了の履歴を残すことで、高優先度のタスクが割り込んで処理抜け(処理の中断)が発生しても、当該処理抜けの発生やその発生場所の特定が可能となる。
【0020】
また、請求項14に記載の発明は、前記第1CPUは電子スロットル制御を実施し、前記第2CPUは電子スロットル制御に関するフェイルセーフ処理を実施する車両用電子制御装置として適用される。そして、前記第1CPUは、クロック異常又は処理抜け異常である旨を検出した時にそれを第2CPUに通知し、第2CPUは、第1CPUからの異常情報に基づきフェイルセーフ処理を実施する。この場合、クロック異常や処理抜け異常が発生しても、その適正なフェイルセーフ処理が実施できる。
【0021】
【発明の実施の形態】
以下、本発明を具体化した一実施の形態を図面に従って説明する。本実施の形態では、車両に搭載されるエンジンECUとして本発明の電子制御装置を具体化している。図1は、本実施の形態におけるエンジンECUの構成を示すブロック図である。
【0022】
図1において、エンジンECU10は、エンジンの噴射制御、点火制御及び電子スロットル制御を実施するための制御CPU11と、電子スロットル制御に関するフェイルセーフ処理や制御CPU11の監視を実施するための監視CPU12とを備える。これらの各CPU11,12は相互に通信可能に接続されている。制御CPU11には発振器13よりクロックCK1(クロック信号)が入力され、監視CPU12には発振器14よりクロックCK2(クロック信号)が入力される。なお本実施の形態では、制御CPU11が「第1CPU」に相当し、監視CPU12が「第2CPU」に相当する。
【0023】
制御CPU11は、発振器13からのクロックCK1に基づき一定周期でタスクAを起床し、そのタスクA内にて毎回カウンタCAをカウントアップする。タスクAは高優先度のタスクであり、本実施の形態では2ms毎に起床されるようになっている。また、制御CPU11には監視CPU12からトリガ信号が取り込まれる。制御CPU11はこのトリガ信号に基づきタスクBを起床し、そのタスクB内にて毎回カウンタCBをカウントアップする。
【0024】
一方、監視CPU12は、発振器14からのクロックCK2に基づき2ms毎に定期処理を起床し、その定期処理にて一定周期のトリガ信号を生成し出力する。このトリガ信号が制御CPU11に取り込まれる。本実施の形態では、カウンタCAが「主カウンタ」に、カウンタCBが「副カウンタ」に相当し、トリガ信号が「一定周期の時間情報」に相当する。
【0025】
また、監視CPU12は「監視回路」としてのWD回路15に対してWDパルスを出力し、WD回路15は監視CPU12からのWDパルスが所定時間以上反転しなかった場合に監視CPU12に対してリセット信号を出力する。
【0026】
ここで、カウンタCA及びCBの動作を図2にて説明する。カウンタCA及びCBが共に正常動作する場合、図2の(a)に示すように、各カウンタが何れも2ms毎にカウントアップされる。この場合、カウンタCA及びCBの差分をΔCn (=CA−CB)とすると、タイミングt1ではその差分がΔC1 、タイミングt2ではその差分がΔC2 となる。図2の(a)は正常動作を表すためΔC1 =ΔC2 となる。
【0027】
これに対し、図2の(b)〜(d)はカウンタCBが異常動作となる場合を示す。(b)〜(d)を詳しく説明する。(b)は、カウンタCBの周期が正常時よりも大きくなっている。これは監視CPU12側のクロックCK2が異常(クロック異常)となり、それが原因で定期処理の起床周期(トリガ信号の周期)が変わり、更にはカウンタCBの周期が変化したと考えられる。この場合、タイミングt1,t2での差分ΔC1 ,ΔC2 はΔC1 <ΔC2 となる。
【0028】
また、(c)は、カウンタCBが停止する異常を示し、(d)は、監視CPU12での定期処理が抜けてしまう異常(処理抜け異常)を示す。なお、処理抜けは不定期に発生し、この処理抜けによりカウンタCBが一定周期でカウントアップされない事態が生じる。これら(c),(d)の場合にもやはり、タイミングt1,t2での差分ΔC1 ,ΔC2 がΔC1 <ΔC2 となる。
【0029】
本実施の形態では、上記図2の(b)〜(d)の各異常について何れも検出可能であって、更に各異常の形態を特定できる異常検出手法を提案する。上記図2の(b)の場合、カウンタCA及びCBのカウントアップの周期が相違するため各カウンタ値の差分ΔCn は毎回相違するが、同ΔCn の変化は一律であり、一定の時間間隔で前後する2つのΔCn を比較すると、その変化量は一定である。つまり、前後する差分の変化量をDCn (以下、差分変化量DCn )とすると、その差分変化量DCn は毎回同じ値となる(DCn =DCn−1 となる)。それ故、その差分変化量DCn によりクロック異常が特定できる。勿論、カウンタCBの周期が小さくなる場合や、カウンタCAの周期が大きくなる(又は小さくなる)場合にも同様にクロック異常が特定できる。
【0030】
また、上記図2の(c)の場合、一方のカウンタCAは正常にカウントアップし、他方のカウンタCBは停止しているため、各カウンタCA及びCBの差分変化量DCn はカウンタCAのカウントアップ分に相当する。この場合、差分変化量DCn は、t1−t2間の時間間隔DTn をカウンタ1周期分の時間T(2ms)で除算した値(DTn /T)に一致する(DCn =DTn /Tとなる)。これにより、タスクB停止の異常が特定できる。
【0031】
また、上記図2の(d)の場合、上記(b),(c)と同様にΔC1 ≠ΔC2 (すなわち、DCn ≠0)であるが、差分ΔCn の変化は不定期なものとなる。よって、ΔC1 ≠ΔC2 であり、且つ上記図2の(b),(c)に該当しなければ、処理抜け異常であると特定できる。
【0032】
次に、各CPU11,12で起床される演算処理について図3〜図6のフローチャートを参照しながら詳しく説明する。先ずはじめに、図3はタスクAの手順を示すフローチャートであり、このタスクAは制御CPU11により2ms毎に起床される。
【0033】
図3において、先ずステップ101では、カウンタCA及びCBに基づいて異常検出処理を実施する。但しその詳細(図4の処理)は後述する。また、ステップ102では、タスクAに関して通常処理を実施し、続くステップ103では、カウンタCAを1インクリメントする。このタスクAにより、2ms毎にカウンタCAがカウントアップされるようになる。
【0034】
図4の異常検出処理では、8ms毎に一連の異常検出を実施することとしており、ステップ201がYESであることを条件に後続のステップ202に進む(つまり、タスクA起床の4回に1回の割合で異常検出が実施される)。
【0035】
ステップ202に進むと、カウンタCA及びCBの差分ΔCn がどれだけ変化したかを示す差分変化量DCn を算出する。具体的には、カウンタCA及びCBの差分の今回値ΔCn と前回値ΔCn−1 との差を取り、差分変化量DCn を算出する(DCn =ΔCn −ΔCn−1 )。
【0036】
その後、ステップ203では、差分変化量DCn が0であるか否かを判別する。前記図2の(a)で説明した通りカウンタCA及びCBが何れも正常の場合、DCn =0(ΔCn =ΔCn−1 )となる。DCn =0の場合、ステップ204に進み、各種の異常カウンタErrCk,ErrF,ErrStを何れも0にクリアする。そしてその後、本処理を一旦終了する。
【0037】
また、DCn≠0の場合、ステップ205に進み、差分変化量の今回値DCn と前回値DCn−1 とを比較する。そして、DCn =DCn−1 であれば、クロック異常であると推定し、ステップ206でクロック異常カウンタErrCkを1インクリメントする。これは、前記図2の(b)の場合に該当する。
【0038】
また、DCn ≠DCn−1 の場合、ステップ207で時間間隔DTn (前回の異常検出から今回の異常検出までの時間幅)を算出し、続くステップ208でDCn =DTn /Tであるか否かを判別する。そして、YESの場合、タスクBの停止異常であると推定し、ステップ209でタスクB停止カウンタErrStを1インクリメントする。また、NOの場合、処理抜け異常であると推定し、ステップ210で処理抜け異常カウンタErrFを1インクリメントする。ステップ208がYESであることは前記図2の(c)の場合に該当し、同ステップ208がNOであることは前記図2の(d)の場合に該当する。
【0039】
その後、ステップ211〜213では、各異常カウンタErrCk,ErrSt,ErrFが所定の判定値Lmtよりも小さいか否かを判別する。そして、何れも判定値Lmt未満であれば、そのまま本処理を終了する。また、判定値Lmt以上となる異常については、それに対応する異常フラグ(XErrCk,XErrSt,XErrFの何れか)をONする(ステップ214〜216)。なお、判定値Lmtは、何れも同一にする必要はなく、各異常カウンタErrCk,ErrSt,ErrF毎に個別に設定することも可能である。また、同一の異常が所定回連続して検出された場合にのみ、異常フラグをONする構成としても良い。
【0040】
また、図5はタスクBの手順を示すフローチャートであり、このタスクBは、監視CPU12からトリガ信号を入力する都度制御CPU11により起床される。実際には、トリガ信号は2ms周期のパルス信号であり、タスクAと同じ周期でこのタスクBが実施されるようになっている。因みに、トリガ信号は、図6に示す定期処理にて生成される。つまり、監視CPU12は、定期処理内の通常処理(ステップ401,403)の途中でトリガ信号を生成し出力する(ステップ402)。
【0041】
タスクBでは、n個の処理(処理1〜処理n)が順次実施され、各処理が実施される都度、処理完了を表す処理完了フラグXfinがONされる。つまりこのとき、処理1〜処理nが規定の処理単位であり、その処理終了の履歴が処理完了フラグXfinとして残される。そして、次回のタスクB起床時においてこの処理完了フラグXfinに基づき、処理抜け場所が特定されるようになっている。
【0042】
図5において、先ずステップ301では、処理番号を示すiを0にクリアし、続くステップ302では、処理iの処理完了フラグxfin(i)がONしているか否かを判別する。フラグONであれば、前回のタスクBで当該処理iが処理完了したと判断される。この場合、ステップ303でi=nであるか否かを判別する。そして、i=nが成立するまで、ステップ304でiを1ずつ加算しつつ、フラグxfin(i)がONしているか否かを繰り返し判別する。
【0043】
フラグxfin(i)=OFFの場合には、その該当する処理iで処理抜けが発生したと判断できる。そのため、ステップ305に進み、その時の処理iを処理抜け発生位置としてメモリに記憶する。
【0044】
その後、ステップ306では、処理完了フラグxfinを全てクリアする。ステップ307〜312では、処理1〜処理nを順次実施すると共に、各処理の実施直後に、各々に対応する処理完了フラグXfinをONしていく。最後に、ステップ313では、カウンタCBを1インクリメントする。
【0045】
上記図4の異常検出処理にて異常である旨検出されると(前記異常フラグがONされると)、それが制御CPU11から監視CPU12に通知され、監視CPU12では、電子スロットル制御の通電カットなど、所定のフェイルセーフ処理が実施される。この場合、クロック異常や処理抜け異常が発生しても、その適正なフェイルセーフ処理が実施でき、エンジンECU10としての信頼性が確保される。
【0046】
以上詳述した本実施の形態によれば、以下に示す効果が得られる。
クロック異常が発生すると、カウンタCA及びCBの差分ΔCn が正常時とは相違するため、前後する2つの差分ΔCn を比較することでクロック異常である旨判定できる。つまり、クロックの周期が変化するような異常を検出することができる。その結果、クロック異常を適正に検出し、ひいてはCPUの信頼性の確保を図ることができるようになる。
【0047】
カウンタCA及びCBの差分変化量DCn が毎回同一である場合にクロック異常である旨判定するため、クロック異常が精度良く検出できる。
また、カウンタCA及びCBの差分変化量DCn が一方のカウンタのカウント分相当である場合に何れかのカウンタが停止している旨判定するため、カウンタ停止の異常が精度良く検出できる。またこれは、何れかのタスクが停止したことが精度良く検出できることと同意である。
【0048】
タスクB内において規定の処理単位で処理終了の履歴(処理完了フラグxfin)を残し、次回のタスク起床時に前記履歴から処理抜け異常を検出するため、処理抜けが発生した位置を確実に特定することができる。
【0049】
なお本発明は、上記以外に次の形態にて具体化できる。
上記実施の形態では、制御CPU11は、監視CPU12からトリガ信号を入力し、そのトリガ信号にてタスクBを起床したが、この構成を変更しても良い。例えば、
(1)制御CPU11は、監視CPU12から定期的にデータを受信する都度、タスクBを起床する。但しこの場合、上記2つのCPU間で定期的な通信が行われることが前提条件となる。
(2)制御CPU11は、監視CPU12からWDパルスを入力し、その入力の都度、タスクBを起床する。この場合、前記図1の構成において、監視CPU12からWD回路15へのWDパルスを分岐させ、当該WDパルスを制御CPU11にも入力する構成とすれば良い。
【0050】
これら何れの場合にも、制御CPU11において一定周期でカウンタCBがカウントされ、そのカウンタCA及びCBの差分によりクロック異常が適正に検出できる。
【0051】
上記実施の形態では、カウンタCA及びCBの周期(すなわち、タスクA及びタスクBの起床周期)が同一である場合を例示したが、その周期が相違するものであっても良い。カウンタCA及びCBの周期が相違しても、各カウンタが何れも正常であればその差分ΔCn はある規則性を保つ。そのため、やはり前後する2つのタイミングで差分ΔCn を比較し、その比較結果からクロック異常が検出できる。
【0052】
本発明は、エンジンECU以外にも他のECUに適用でき、更に車両用電子制御装置以外の用途に具体化することも可能である。要は、2つ以上のCPUを備え、各CPUに個別のクロック信号が入力されると共に該クロック信号を基に各CPUで定期的な演算処理が実施される構成の電子制御装置であれば本発明が適用できる。
【図面の簡単な説明】
【図1】発明の実施の形態におけるエンジンECUの構成を示すブロック図。
【図2】(a)〜(d)はカウンタ動作を示すタイムチャート。
【図3】制御CPUによるタスクAの手順を示すフローチャート。
【図4】制御CPUによる異常検出処理を示すフローチャート。
【図5】制御CPUによるタスクBの手順を示すフローチャート。
【図6】監視CPUによる定期処理を示すフローチャート。
【符号の説明】
10…ECU、11…制御CPU、12…監視CPU、13,14…発振器、15…監視回路。[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an electronic control device having two or more CPUs, and more particularly to an electronic control device for suitably detecting an abnormality in a clock signal supplied to each CPU or an abnormality in a process omission.
[0002]
[Prior art]
2. Description of the Related Art As an electronic control device that performs vehicle control and the like, there is an electronic control device that includes a plurality of CPUs and has a function of mutually monitoring abnormalities among the CPUs. As one of the methods, there is a method of monitoring the operation state of the CPU by monitoring a watchdog pulse (WD pulse) which is inverted at a predetermined cycle. This means that one CPU inputs a WD pulse from the other CPU, and when the WD pulse stops, determines that the other CPU is abnormal (runaway).
[0003]
[Problems to be solved by the invention]
An abnormality related to this type of electronic control unit includes an abnormality in a clock signal supplied from an oscillator or the like to each CPU. In this case, if the frequency of the clock signal changes due to an abnormality of the oscillator or the like, it is considered that the abnormality cannot be detected depending on the state of the clock abnormality.
[0004]
For example, if the frequency of the clock signal is higher than normal, the accuracy of time calculation in the CPU is reduced. For this reason, there arises a problem that various arithmetic processes that should be performed periodically are not performed at a predetermined cycle. In such a case, even if the CPU abnormality is detected by the WD pulse as described above, the clock abnormality cannot be determined because the WD pulse is issued periodically.
[0005]
Further, in a CPU that wakes up a plurality of tasks having different priorities, when the processing load on the CPU increases, a process may be missed in a low-priority task. In this case, the issuance of the normal WD pulse is a high-priority process, so that the WD pulse is normally issued even when the low-priority process is exited. Therefore, even if a processing omission occurs, the WD pulse is not affected, and the processing omission cannot be detected. In the worst case, there is a possibility that the processing is continued as it is.
[0006]
SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and an object of the present invention is to provide an electronic control apparatus capable of appropriately detecting a clock abnormality or a processing omission abnormality and thereby ensuring the reliability of a CPU. It is to provide.
[0007]
[Means for Solving the Problems]
According to the first aspect of the present invention, a first CPU and a second CPU are provided, and an individual clock signal is input to each of the CPUs, and each CPU performs periodic arithmetic processing based on the clock signals. The second CPU notifies the first CPU of time information of a fixed period based on a clock signal input thereto. In particular, the first CPU counts the main counter at a constant cycle based on a clock signal input thereto, and counts a sub-counter based on time information at a constant cycle input from the second CPU. Then, the difference between the main and sub counters is compared at two timings before and after, and an abnormality in the clock signal is detected from the comparison result.
[0008]
If the clock signal on the side of the second CPU becomes abnormal and its frequency becomes lower than normal, the time interval of the time information notified from the second CPU to the first CPU increases, and as a result, the count operation of the sub-counter becomes slow. In this case, the difference between the main and sub counters is different from the normal case, and by comparing the preceding and following differences, it can be determined that the clock signal is abnormal. That is, it is possible to detect an abnormality in which the cycle of the clock signal changes. As a result, the clock abnormality can be properly detected, and the reliability of the CPU can be ensured.
[0009]
In the invention described in
[0010]
As described above, the first CPU operates the sub-counter in response to the notification of the time information from the second CPU. In such a case, the notification of the time information may be realized in the following manner.
In the invention described in claim 3, the second CPU outputs a trigger signal at a constant cycle in a periodic process based on a clock signal, and the first CPU counts the sub-counter every time the trigger signal is input. .
In the invention described in claim 4, the second CPU performs data transmission at a constant cycle in a periodic communication process based on a clock signal, and the first CPU sets a sub-counter every time data is received from the second CPU. Count.
According to the fifth aspect of the present invention, there is provided a monitoring circuit which inputs a watchdog pulse which is inverted at a predetermined cycle from the second CPU and outputs a reset signal to the second CPU if the watchdog pulse is not inverted for a predetermined time or more. Further, the first CPU inputs the watchdog pulse from the second CPU, and counts the sub-counter each time the input is performed.
[0011]
In any of the above cases, the first CPU counts the sub-counter at a fixed cycle, and the clock abnormality can be properly detected based on the difference between the sub-counter and the main counter.
[0012]
In the invention described in claim 6, the first CPU compares the difference between the main and sub counters at the two timings before and after to determine a difference change amount, and when the difference change amount is the same each time, the first CPU determines that the clock is abnormal. It is determined that there is. As a result, a clock abnormality can be accurately detected.
[0013]
In the invention described in claim 7, the first CPU compares a difference between the main and sub counters at two timings before and after to determine a difference change amount, and the difference change amount corresponds to the count of one counter. Then, it is determined that one of the counters is stopped. Thereby, the abnormality of the stop of the counter can be accurately detected. When the main counter is counted in the task A and the sub-counter is counted in the task B, it is possible to accurately detect that any task has stopped.
[0014]
As described in claim 8, when the periods of the main and sub counters are the same, if both counters are normal, the difference always coincides. Therefore, the difference between the main and sub counters can be easily compared.
[0015]
According to the ninth aspect of the present invention, the first CPU wakes up a predetermined task using time information notified from the second CPU as a trigger, and leaves a history of processing completion in a specified processing unit in the task. Then, the next time the task wakes up, a process omission abnormality is detected from the history. In this case, if the task is performed to the end, a history of processing completion remains for all processes, but if the task is only performed halfway, a history of processing completion does not remain for unexecuted portions. Therefore, a processing omission can be detected for the task. Further, by checking the history, it is possible to identify the position where the processing omission has occurred.
[0016]
According to the ninth aspect of the present invention, as set forth in the tenth aspect, the first CPU wakes up a plurality of tasks having different priorities, and among the tasks having the lower priority, records the processing end history in a prescribed processing unit. Good to leave. When there are a plurality of tasks having different priorities, a task with a low priority may be interrupted by a high-priority task during its execution. Occurrence of the omission and the location of the omission can be specified.
[0017]
Further, as described in
[0018]
On the other hand, in the twelfth aspect of the invention, as in the ninth aspect, if the task is performed to the end, a history of processing completion remains for all the processing. Does not have a history of processing completion. Therefore, a processing omission can be detected for the task. Further, by checking the history, it is possible to identify the position where the processing omission has occurred.
[0019]
Further, as set forth in
[0020]
The invention according to
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described below with reference to the drawings. In the present embodiment, the electronic control device of the present invention is embodied as an engine ECU mounted on a vehicle. FIG. 1 is a block diagram illustrating a configuration of an engine ECU according to the present embodiment.
[0022]
In FIG. 1, an
[0023]
The
[0024]
On the other hand, the monitoring
[0025]
Further, the monitoring
[0026]
Here, the operation of the counters CA and CB will be described with reference to FIG. When both the counters CA and CB operate normally, as shown in FIG. 2A, each counter counts up every 2 ms. In this case, assuming that the difference between the counters CA and CB is ΔCn (= CA−CB), the difference is ΔC1 at the timing t1, and the difference is ΔC2 at the timing t2. In FIG. 2A, ΔC1 = ΔC2 to indicate a normal operation.
[0027]
On the other hand, FIGS. 2B to 2D show cases where the counter CB operates abnormally. (B) to (d) will be described in detail. In (b), the period of the counter CB is longer than in the normal state. It is considered that this is because the clock CK2 on the
[0028]
Further, (c) shows an abnormality in which the counter CB stops, and (d) shows an abnormality in which the periodic processing in the
[0029]
In the present embodiment, an abnormality detection method that can detect any of the abnormalities shown in FIGS. 2B to 2D and can further specify the form of each abnormality is proposed. In the case of FIG. 2B, the difference ΔCn between the counter values differs every time because the count-up periods of the counters CA and CB differ, but the change of the same ΔCn is uniform, and the change ΔCn is constant at regular time intervals. When the two ΔCn are compared, the amount of change is constant. That is, assuming that the change amount of the difference before and after is DCn (hereinafter, the difference change amount DCn), the difference change amount DCn has the same value every time (DCn = DCn−1). Therefore, the clock abnormality can be specified by the difference change amount DCn. Of course, when the cycle of the counter CB is reduced or when the cycle of the counter CA is increased (or decreased), the clock abnormality can be similarly specified.
[0030]
In the case of FIG. 2C, one counter CA normally counts up and the other counter CB is stopped. Therefore, the difference change amount DCn between each counter CA and CB is counted up by the counter CA. Equivalent to a minute. In this case, the difference change amount DCn is equal to the value (DTn / T) obtained by dividing the time interval DTn between t1 and t2 by the time T (2 ms) for one cycle of the counter (DCn = DTn / T). Thereby, the abnormality of the task B stop can be specified.
[0031]
Further, in the case of FIG. 2D, ΔC1 ≠ ΔC2 (that is, DCn ≠ 0) as in (b) and (c) above, but the change of the difference ΔCn is irregular. Therefore, if ΔC1 ≠ ΔC2, and if it does not correspond to (b) or (c) in FIG. 2, it can be specified that the processing is missing.
[0032]
Next, the arithmetic processing woken up by each of the
[0033]
In FIG. 3, first, at step 101, abnormality detection processing is performed based on the counters CA and CB. However, the details (the processing of FIG. 4) will be described later. In
[0034]
In the abnormality detection process of FIG. 4, a series of abnormality detections is performed every 8 ms, and the process proceeds to the
[0035]
In
[0036]
Thereafter, in
[0037]
If DCn ≠ 0, the routine proceeds to step 205, where the present value DCn of the difference change amount and the previous value DCn−1 are compared. If DCn = DCn−1, it is estimated that the clock is abnormal, and in
[0038]
If DCn ≠ DCn−1, the time interval DTn (the time width from the previous abnormality detection to the current abnormality detection) is calculated in
[0039]
Thereafter, in
[0040]
FIG. 5 is a flowchart showing the procedure of task B. This task B is woken up by the
[0041]
In the task B, n processes (
[0042]
In FIG. 5, first, in
[0043]
When the flag xfin (i) = OFF, it can be determined that a process omission has occurred in the corresponding process i. Therefore, the process proceeds to step 305, and the process i at that time is stored in the memory as the process omission occurrence position.
[0044]
Thereafter, in step 306, all the processing completion flags xfin are cleared. In steps 307 to 312, the
[0045]
When the abnormality is detected in the abnormality detection processing of FIG. 4 (when the abnormality flag is turned ON), the abnormality is notified from the
[0046]
According to the embodiment described in detail above, the following effects can be obtained.
When a clock abnormality occurs, the difference ΔCn between the counters CA and CB is different from the normal state. Therefore, it can be determined that the clock is abnormal by comparing the two preceding and following differences ΔCn. That is, it is possible to detect an abnormality in which the clock cycle changes. As a result, the clock abnormality can be properly detected, and the reliability of the CPU can be ensured.
[0047]
Since it is determined that the clock is abnormal when the difference change amount DCn between the counters CA and CB is the same each time, the clock abnormality can be accurately detected.
In addition, when the difference change amount DCn between the counters CA and CB is equivalent to the count of one of the counters, it is determined that one of the counters is stopped, so that abnormality in stopping the counters can be accurately detected. This also means that the stoppage of any task can be accurately detected.
[0048]
In the task B, a history of processing completion (processing completion flag xfin) is left in a prescribed processing unit, and a processing omission abnormality is detected from the history at the next task wake-up, so that the position where the processing omission has occurred is reliably specified. Can be.
[0049]
The present invention can be embodied in the following modes other than the above.
In the above embodiment, the
(1) The
(2) The
[0050]
In any of these cases, the
[0051]
In the above-described embodiment, the case where the periods of the counters CA and CB (that is, the wake-up periods of the task A and the task B) are the same is illustrated, but the periods may be different. Even if the counters CA and CB have different periods, if each counter is normal, the difference ΔCn maintains a certain regularity. Therefore, the difference ΔCn is also compared at two timings before and after, and a clock abnormality can be detected from the comparison result.
[0052]
The present invention can be applied to other ECUs besides the engine ECU, and can be embodied in applications other than the vehicle electronic control device. The point is that an electronic control device having two or more CPUs, each of which is configured to receive an individual clock signal and perform periodic arithmetic processing by each CPU based on the clock signal. The invention is applicable.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an engine ECU according to an embodiment of the present invention.
FIGS. 2A to 2D are time charts showing a counter operation.
FIG. 3 is a flowchart showing a procedure of a task A by a control CPU.
FIG. 4 is a flowchart showing an abnormality detection process by a control CPU.
FIG. 5 is a flowchart showing a procedure of a task B by a control CPU.
FIG. 6 is a flowchart illustrating periodic processing by a monitoring CPU.
[Explanation of symbols]
10 ECU, 11 control CPU, 12 monitoring CPU, 13, 14 oscillator, 15 monitoring circuit.
Claims (14)
前記第1CPUは、自身に入力されるクロック信号を基に一定周期で主カウンタをカウントすると共に、前記第2CPUより入力される一定周期の時間情報を基に副カウンタをカウントし、これら主副両カウンタの差分を、前後する2つのタイミングで比較し、その比較結果から前記クロック信号の異常を検出することを特徴とする電子制御装置。A first CPU and a second CPU, each of which receives an individual clock signal, performs periodic arithmetic processing on each of the CPUs based on the clock signal, and outputs a clock signal to the second CPU; An electronic control unit for notifying the first CPU of time information of a fixed cycle based on a signal,
The first CPU counts the main counter at a fixed cycle based on a clock signal input thereto, and counts a sub-counter based on time information at a fixed cycle input from the second CPU. An electronic control device, wherein a difference between counters is compared at two timings before and after, and an abnormality in the clock signal is detected from the comparison result.
前記第1CPUは、前記第2CPUより通知される時間情報をトリガとして所定のタスクを起床し、当該タスク内において規定の処理単位で処理終了の履歴を残し、次回のタスク起床時に前記履歴から処理抜け異常を検出することを特徴とする電子制御装置。A first CPU and a second CPU, each of which receives an individual clock signal, performs periodic arithmetic processing on each of the CPUs based on the clock signal, and outputs a clock signal to the second CPU; An electronic control unit for notifying the first CPU of time information of a fixed cycle based on a signal,
The first CPU wakes up a predetermined task by using time information notified from the second CPU as a trigger, leaves a history of processing completion in a specified processing unit in the task, and skips processing from the history when the next task wakes up. An electronic control device for detecting an abnormality.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002182424A JP3991782B2 (en) | 2002-06-24 | 2002-06-24 | Electronic control unit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002182424A JP3991782B2 (en) | 2002-06-24 | 2002-06-24 | Electronic control unit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2004029992A true JP2004029992A (en) | 2004-01-29 |
| JP3991782B2 JP3991782B2 (en) | 2007-10-17 |
Family
ID=31178929
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002182424A Expired - Fee Related JP3991782B2 (en) | 2002-06-24 | 2002-06-24 | Electronic control unit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3991782B2 (en) |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2005105646A1 (en) * | 2004-04-27 | 2005-11-10 | Mitsubishi Denki Kabushiki Kaisha | Control device of elevator |
| KR100727197B1 (en) * | 2005-12-27 | 2007-06-13 | 미쓰비시덴키 가부시키가이샤 | Elevator control |
| JP2008117390A (en) * | 2006-10-25 | 2008-05-22 | Rockwell Automation Technologies Inc | Safety timer cross-check diagnosis in a dual CPU safety system |
| JP2010128942A (en) * | 2008-11-28 | 2010-06-10 | Denso Corp | Electronic control device |
| JP2014157554A (en) * | 2013-02-18 | 2014-08-28 | Denso Corp | Communication slave |
| JP2014155979A (en) * | 2013-02-15 | 2014-08-28 | Makita Corp | Device for electric tool |
| JP2015229467A (en) * | 2014-06-06 | 2015-12-21 | 本田技研工業株式会社 | Electronic control system |
| KR102384977B1 (en) * | 2020-12-07 | 2022-04-07 | 현대오토에버 주식회사 | Synchronization system and method for maintaining real-time between multi-core |
| JP2023097977A (en) * | 2021-12-28 | 2023-07-10 | 株式会社デンソー | electronic controller |
| CN117215874A (en) * | 2023-09-21 | 2023-12-12 | 北京英创汇智汽车技术有限公司 | Electronic control system monitoring method of multiple micro control units |
| JP2024040716A (en) * | 2022-09-13 | 2024-03-26 | 株式会社日立ハイテクフィールディング | Failure prediction device and failure prediction method |
-
2002
- 2002-06-24 JP JP2002182424A patent/JP3991782B2/en not_active Expired - Fee Related
Cited By (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4664288B2 (en) * | 2004-04-27 | 2011-04-06 | 三菱電機株式会社 | Elevator control device |
| JPWO2005105646A1 (en) * | 2004-04-27 | 2007-09-13 | 三菱電機株式会社 | Elevator control device |
| WO2005105646A1 (en) * | 2004-04-27 | 2005-11-10 | Mitsubishi Denki Kabushiki Kaisha | Control device of elevator |
| US7549513B2 (en) | 2004-04-27 | 2009-06-23 | Mitsubishi Denki Kabushiki Kaisha | Control device of elevator for detecting abnormalities in a clock signal |
| KR100727197B1 (en) * | 2005-12-27 | 2007-06-13 | 미쓰비시덴키 가부시키가이샤 | Elevator control |
| JP2008117390A (en) * | 2006-10-25 | 2008-05-22 | Rockwell Automation Technologies Inc | Safety timer cross-check diagnosis in a dual CPU safety system |
| JP2010128942A (en) * | 2008-11-28 | 2010-06-10 | Denso Corp | Electronic control device |
| JP2014155979A (en) * | 2013-02-15 | 2014-08-28 | Makita Corp | Device for electric tool |
| JP2014157554A (en) * | 2013-02-18 | 2014-08-28 | Denso Corp | Communication slave |
| JP2015229467A (en) * | 2014-06-06 | 2015-12-21 | 本田技研工業株式会社 | Electronic control system |
| KR102384977B1 (en) * | 2020-12-07 | 2022-04-07 | 현대오토에버 주식회사 | Synchronization system and method for maintaining real-time between multi-core |
| JP2023097977A (en) * | 2021-12-28 | 2023-07-10 | 株式会社デンソー | electronic controller |
| JP7605099B2 (en) | 2021-12-28 | 2024-12-24 | 株式会社デンソー | Electronic Control Unit |
| JP2024040716A (en) * | 2022-09-13 | 2024-03-26 | 株式会社日立ハイテクフィールディング | Failure prediction device and failure prediction method |
| CN117215874A (en) * | 2023-09-21 | 2023-12-12 | 北京英创汇智汽车技术有限公司 | Electronic control system monitoring method of multiple micro control units |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3991782B2 (en) | 2007-10-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4609381B2 (en) | Abnormality monitoring program, recording medium, and electronic device | |
| JP3991782B2 (en) | Electronic control unit | |
| US9335183B2 (en) | Method for reliably operating a sensor | |
| US20040093508A1 (en) | Method for monitoring a microprocessor and circuit arrangement having a microprocessor | |
| US7496800B2 (en) | Malfunction monitoring method and system | |
| US8943303B2 (en) | Monitoring circuit with a window watchdog | |
| US20080282248A1 (en) | Electronic computing device capable of specifying execution time of task, and program therefor | |
| CN118312342B (en) | Method, device, electronic device and readable storage medium for storing diagnostic events | |
| JP3901987B2 (en) | Electronic control device for vehicle | |
| CN118210646B (en) | Fault information de-jittering method, device, electronic device and readable storage medium | |
| US10514970B2 (en) | Method of ensuring operation of calculator | |
| JP2002091802A (en) | Runaway monitoring device for electronic control system | |
| JP2002196948A (en) | Operation control device | |
| CN116431377A (en) | Watchdog circuit | |
| JP2007026028A (en) | Device for detecting abnormality in microcomputer | |
| JP2870250B2 (en) | Microprocessor runaway monitor | |
| US20030093725A1 (en) | Method and circuit for monitoring microcomputer for onboard electronic control device | |
| JP3163904B2 (en) | CPU device with runaway monitoring function | |
| JP2005293164A (en) | Task monitoring method | |
| JP2536789Y2 (en) | Device for preventing malfunction of microcomputer system | |
| JPS622685Y2 (en) | ||
| JP2019120441A (en) | Facility monitoring device and facility monitoring method | |
| KR102158773B1 (en) | Pulse Width Modulator and method for PWM signal monitoring using the same | |
| JPS63280345A (en) | Detection of program abnormality | |
| JP2003120411A (en) | Signal interval measuring device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20041228 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070313 |
|
| 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: 20070703 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070716 |
|
| 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: 20100803 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110803 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120803 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130803 Year of fee payment: 6 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |