JP4058870B2 - Electronic control device with floating point arithmetic function - Google Patents

Electronic control device with floating point arithmetic function Download PDF

Info

Publication number
JP4058870B2
JP4058870B2 JP36674199A JP36674199A JP4058870B2 JP 4058870 B2 JP4058870 B2 JP 4058870B2 JP 36674199 A JP36674199 A JP 36674199A JP 36674199 A JP36674199 A JP 36674199A JP 4058870 B2 JP4058870 B2 JP 4058870B2
Authority
JP
Japan
Prior art keywords
microcomputer
floating
data
storage area
point
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
Application number
JP36674199A
Other languages
Japanese (ja)
Other versions
JP2001184192A (en
Inventor
正人 矢野
光浩 河合
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP36674199A priority Critical patent/JP4058870B2/en
Priority to US09/739,335 priority patent/US6904543B2/en
Priority to DE10064787A priority patent/DE10064787A1/en
Publication of JP2001184192A publication Critical patent/JP2001184192A/en
Application granted granted Critical
Publication of JP4058870B2 publication Critical patent/JP4058870B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、浮動小数点演算機能を備えた電子制御装置に関するものである。
【0002】
【従来の技術】
一般に、自動車のエンジン制御などに適用される電子制御装置(ECU)では、従来より固定小数点型データを用いて各種演算を実施していたが、近年では浮動小数点演算プロセッサ(FPU:Floating-Point Unit )の導入により、浮動小数点型データによる演算が実施できるようになった。浮動小数点型データによれば、固定小数点型データに比べて非常に細かい精度で演算結果が得られる。
【0003】
浮動小数点型データは例えばIEEE754規格に従い構成され、図8(a)に示されるようにその内訳として、1ビットの符号部と、8ビットの指数部と、23ビットの仮数部とを有する。こうして仮数部が23ビットで構成される4バイト(単精度記憶形式)の浮動小数点型データの場合、7桁の分解能(0.0000001 の分解能)を持つ。
【0004】
また、図8(b)には、単精度記憶形式でのビットパターンが示され、浮動小数点型データは、指数部と仮数部の組み合わせにより正規化数、非正規化数、無限大、ゼロ及び非数に区別される。ここで、非数以外は数値を表し、非数は数値でないことを表す。例えば、0/0や+∞−∞といった数値として表現できない演算結果を表す場合に非数が用いられる。
【0005】
【発明が解決しようとする課題】
上記の通り浮動小数点型データには非数というデータ形式があり、電子制御装置内で非数が一つでも発生又は存在した場合、同装置内で非数が増殖してしまう可能性がある。更に非数を含む、例えば四則演算の結果は全て非数となり無効となる。例えば、比較演算において非数が1以上か以下かを比較した場合、その結果は何れも偽となる。そのため、電子制御装置内で非数が発生した場合、その演算結果(出力値)は全く保障できないという問題がある。
【0006】
エンジン制御において非数が発生する条件としては主に2つ考えられる。一つ目の条件は、電子制御装置の動作中やバッテリバックアップ中にノイズにより浮動小数点型のRAM値が書き換わってRAM値そのものが非数に変わる場合である。例えば、ノイズにより浮動小数RAM値がFFFFFFFFh(全1ビット)に書き換わる場合等である。二つ目の条件は、浮動小数点演算に用いられる引数がノイズ等によって書き換わり、0/0のような演算を行って二次的に非数が発生する場合である。図9に示すエンジン回転数の演算処理にてその事例を説明する。
【0007】
つまり、図9の処理では、エンジンの360°CA(クランク角)の回転に要した時間T360を算出してそれをFRO値として記憶し(ステップ501)、FRO=0でないことを条件に、「1sec」をFR1に、「60」をFR2にセットする(ステップ502〜504)。
【0008】
その後、演算式
FR0=FR1/FR0*FR2
により、FR0値を算出し(ステップ505)、FR0値をエンジン回転数Neとする(ステップ506)。
【0009】
上記図9の処理において、仮にステップ504の直後にノイズ等によりFR0,FR1値が各々0に変化した場合を想定する。この場合、ステップ505では「0/0」の演算が行われ、ステップ505の演算結果であるFR0値が非数となる。その結果、エンジン回転数が正しく算出できないこととなる。
【0010】
本発明は、上記問題に着目してなされたものであって、その目的とするところは、浮動小数点演算機能を有した電子制御装置において、非数の発生に伴う制御不良を未然に防止することができる電子制御装置を提供することである。
【0011】
【課題を解決するための手段】
請求項1に記載の電子制御装置では、マイクロコンピュータは、不揮発性メモリの浮動小数点型データの記憶領域のデータについて非数の有無を判定し(非数判定手段)、非数が有ると判定された時、前記不揮発性メモリの浮動小数点型データの記憶領域のデータを初期化する(データ初期化手段)。かかる場合、非数が存在するメモリデータが初期化されることで非数が一掃される。それ故、マイクロコンピュータによる各種制御において、非数を含むデータが存在することが原因となる種々の不都合が回避できる。その結果、非数の発生に伴う制御不良を未然に防止することができる。また、非数判定手段は、マイクロコンピュータへの電源投入に伴うシステムの初期化処理に際し、不揮発性メモリの浮動小数点型データの記憶領域について非数判定を実施する。この場合、仮にマイクロコンピュータの動作停止中にノイズ等が原因で不揮発性メモリの浮動小数点型データが破壊されて非数が発生したとしても、それが電源投入直後、すなわち制御開始前に適正に検出でき、制御への悪影響が未然に防止される。
なお、上記不揮発性メモリとしては、バッテリ電源からの給電によりデータ不揮発の状態となり記憶内容を保持するバックアップRAM(スタンバイRAMとも言う)や、EEPROM、フラッシュROM等を含む。
【0012】
特に、請求項2に記載したように、不揮発性メモリの浮動小数点型データの記憶領域のデータの初期化に際し、制御に支障のないデフォルト値を不揮発性メモリの浮動小数点型データの記憶領域に書き込むことで、このデフォルト値を用いて各種制御が実施できる。
【0015】
請求項に記載の発明では、マイクロコンピュータの通常動作時において各種制御の空き時間に非数判定を実施するので、大量の浮動小数点型データが存在し、その非数判定に時間を要する場合にも、他の制御に及ぶ影響が抑えられる。また本構成は、マイクロコンピュータの演算負荷の観点からも有効であると言える。
【0016】
請求項に記載の発明では、マイクロコンピュータは、その通常動作時において前記非数判定手段により非数有りの旨が判定されると、マイクロコンピュータをリセットする。従って、マイクロコンピュータのリセットに伴う初期化処理にて非数が一掃される。
【0017】
請求項に記載の発明では、マイクロコンピュータは、その通常動作時において前記非数判定手段により非数有りの旨が判定された時、ウォッチドッグクリア(WDC)信号の反転動作を中止する。つまり、ウォッチドッグクリア信号の反転動作を中止することで同信号の周期性が崩れ、ウォッチドッグ回路がマイクロコンピュータに対してリセット信号を出力する。これにより、マイクロコンピュータにリセットがかかり、そのリセットに伴う初期化処理にて非数が一掃される。
【0018】
かかる場合、請求項に記載したように、マイクロコンピュータの通常動作時において非数有りの旨が判定された時、全ての割り込みを禁止すると良い。これにより、非数の存在が確認されてから消去されるまでの間に非数が原因で制御性が悪化するといった不都合が確実に防止できる。
【0019】
【発明の実施の形態】
以下、この発明を具体化した一実施の形態を図面に従って説明する。図1は、エンジン制御システムの概略を示すブロック図である。本システムにおいて、車載エンジン1は、例えばガソリン噴射式の多気筒内燃機関として構成される。
【0020】
エンジン制御ECU10はマイクロコンピュータ(以下、マイコンという)11を備え、同マイコン11はCPU12、RAM13、ROM14、FPU(浮動小数点演算プロセッサ)15、I/O(入出力装置)16を備える。ここで、FPU15は浮動小数点形式の演算を実施し、CPU12は浮動小数点形式以外の演算を実施する。I/O16には周知のA/D変換器が含まれる。RAM13は、イグニッションスイッチのOFF時にも図示しない車載バッテリからの給電を受けて記憶内容を保持する記憶素子であり、本実施の形態ではこのRAM13が不揮発性メモリ(バックアップRAM)に該当する。但し、不揮発性メモリとして、EEPROMやフラッシュROM等を備える構成であっても良い。
【0021】
また、ECU10は、ウォッチドッグ回路としてのWDC(ウォッチドッグクリア)監視装置18を備える。このWDC監視装置18は、マイコン11から周期的に出力されるWDC信号を監視し、同WDC信号が途絶えるなど、その周期性が崩れる都度、マイコン11にリセット信号を出力する。なお、ウォッチドッグ回路がマイコン11内に内蔵される構成であっても良い。
【0022】
例えば図2に示されるように、WDC信号は4ms周期でH/Lを反転する信号として出力され、その反転エッジが所定時間(図では32ms)検出されないと、WDC監視装置18はリセット信号を立ち下げる。またその後、リセットが解除されると、4ms周期で反転するWDC信号が再びWDC監視装置18に取り込まれる。
【0023】
ECU10には、エンジン1に設けられたセンサ2からエンジン運転状態を表す各種情報が入力される。センサ2は、例えば吸入空気量を検出するためのエアフロメータ、冷却水温を検出するための水温センサ、スロットル開度を検出するためのスロットル開度センサなどからなる。そして、ECU10は、前記入力されるセンサ信号を基に、図示しないインジェクタによる燃料噴射の制御や燃料ガスのパージ制御などを実施する。
【0024】
FPU15により演算される浮動小数点型データは、既述の通り例えばIEEE754規格に従い構成され、単精度記憶形式であれば図8(a)に示すデータ形式を有する。また、図8(b)の如く、浮動小数点型データは、指数部と仮数部との組み合わせにより正規化数、非正規化数、無限大、ゼロ及び非数に区別される。
【0025】
一方、図3にはRAM13の構成例を示す。RAM13は、浮動小数RAM領域と、固定小数RAM領域と、スタック領域とに大別できる。浮動小数RAM領域は4バイトずつ区分され、その開始アドレスには”START”が付与され、終了アドレスには”END”が付与されている。なおこの場合、RAM13内では、固定小数RAM領域やスタック領域と分離して浮動小数RAM領域が固めて配置されると良い。
【0026】
本実施の形態では、ECU10への動作電源の投入前にノイズ等の影響によりRAM13にて保持されている浮動小数点型データが非数になったり、或いは、ECU10の通常動作中に浮動小数点型データが非数になったりした場合に、その旨を判定し、非数を除去するためのデータ初期化処理を実施する。非数チェックを行う対象は、ソフトウエアに定義されている定数及びRAMデータである。以下、CPU12により実行される図4〜図7の各処理に従い、本実施の形態の要旨を詳しく説明する。
【0027】
先ず始めに、ECU10への電源投入直後における非数のチェック手順を図4のフローチャートに従い説明する。図4は、電源投入直後に起動されるイニシャルルーチンであり、本ルーチンが「データ初期化手段」に相当する。
【0028】
ステップ101では、非数の有無を示す非数発生フラグを「0」にしておく。次に、ステップ102では、非数チェックルーチンを呼び出す。この非数チェックルーチンでは、浮動小数RAM領域において非数の有無が判定されるが、その詳細は図5にて後述する。
【0029】
続くステップ103では、非数発生フラグが「0」か否かを判別し、非数発生フラグが「0」であれば、非数がないのでそのままステップ106に進む。ステップ106では、その他の初期化処理を実行した後、本処理を終了する。
【0030】
また、浮動小数RAM領域の何れかに非数があれば非数発生フラグが「1」になるため、ステップ104に進み、浮動小数RAM領域を初期化する。すなわち、浮動小数RAM領域に、制御に支障のないデフォルト値を書き込み、非数を消去する。この初期化処理によって非数は存在しなくなるため、ステップ105では非数発生フラグを「0」とする。続くステップ106ではその他の初期化処理を実行し、その後、本処理を終了する。
【0031】
次に、図5のフローチャートに従い、非数チェックルーチンの詳細を説明する。なお、このルーチンが「非数判定手段」に相当する。本処理では、浮動小数RAMの開始アドレスSTARTから終了アドレスENDまでの各領域について、指数部(bit30〜23)が全て「1」で且つ、仮数部(bit22〜0)が全て「0」でない組み合わせかどうかにより、非数の有無を判定する。
【0032】
詳しくは、開始値STARTから終了値ENDまで変数R1を4バイト単位で順次変更してアドレスを設定しながら、以下のループ処理を実施する。このとき、ステップ201では、変数R1が示すアドレスの内容をR0値として取り込む。また、ステップ202では、R0値のbit30〜23が”11111111”であるか否かを判別し、ステップ203では、R0値のbit22〜0が全て0であるか否かを判別する。
【0033】
ステップ202がNOの場合、又はステップ202,203が共にYESの場合、その時該当するアドレスの浮動小数点型データは非数でなく、次の浮動小数点型データのアドレスに移行する。また、ステップ202がYESで且つ、ステップ203がNOの場合、浮動小数RAM領域に非数が存在するとみなし、ステップ204で非数発生フラグに「1」を入れて処理を終了する。
【0034】
一方、ECU10の通常動作時には、図6に示すアイドルルーチンにて非数の有無をチェックする。ここで、アイドルルーチンとは、時間周期や回転信号同期で処理される各種制御の空き時間に実行される処理であり、通常ECU10が扱う各種処理の中で最も優先度の低いタスク中で実行される処理である。
【0035】
図6のステップ301では、前記図5の非数チェックルーチンを呼び出し、非数の有無に応じて非数発生フラグを操作する。続くステップ302では、ROM14のチェックサムやマイコン11内のレジスタの確認処理等といった、各種制御を実施する。
【0036】
そして、図7に示す4ms処理では、上記図6のアイドルルーチンで実施した非数チェックの結果をモニタする。すなわち、図7のステップ401では、非数発生フラグが「1」であるか否かを判別する。非数発生フラグ=0であり、非数が存在しない場合はステップ402に進み、WDC信号を反転させる。かかる場合、WDC信号が4ms周期で反転するので、CPU12が正常動作していることをWDC監視装置18に知らしめることができる。続くステップ403では、各種センサ検出値のA/D変換処理等、4ms周期で処理される各種制御を実行し、その後、本処理を一旦終了する。
【0037】
また、非数発生フラグ=1であり、非数が存在する場合は、ステップ404に進んで全ての割り込みを禁止し、その後、無限ループに突入する。つまり、無限ループに突入することでそれ以降WDC信号が反転しなくなるため、同WDC信号の周期性が崩れ、所定期間後(32ms経過後)にWDC監視装置18からマイコン11にリセット信号が出力される。それ故、そのマイコン11のリセットに伴うイニシャルルーチン(図4の処理)において、改めて非数発生フラグが確認されると共に、同処理にて非数が一掃される。
【0038】
上記図7の処理では、非数が存在する場合、全ての割り込みを禁止して無限ループに突入するため、仮に非数有りの判定後、リセット信号が発行されるまでの間に非数により各種制御に悪影響が及ぶといった不都合が回避される。つまり、非数有りの判定後に割り込みが許可されていると、発生した割り込み処理の中で非数が用いられて制御が異常になるおそれがあるが、上記図7によればこうした不都合が生じない。
【0039】
以上詳述した本実施の形態によれば、以下に示す効果が得られる。
(イ)浮動小数RAM領域について非数の有無を判定し、非数が有ると判定された時、RAMデータを初期化することにより非数が一掃される。それ故、マイコン11による各種制御において、非数を含むデータが存在することが原因となる種々の不都合が回避できる。その結果、非数の発生に伴う制御不良を未然に防止することができる。
【0040】
(ロ)制御に支障のないデフォルト値をRAMデータとして書き込んで浮動小数RAM領域を初期化するので、このデフォルト値を用いて各種制御が実施できる。
【0041】
(ハ)マイコン11への電源投入に伴うシステムの初期化処理(イニシャルルーチン)に際し、RAM13の浮動小数RAM領域について非数判定を実施する。この場合、仮にマイコン11の動作停止中にノイズ等が原因でRAM13の浮動小数点型データが破壊されて非数が発生したとしても、それが電源投入直後、すなわち制御開始前に適正に検出でき、制御への悪影響が未然に防止される。
【0042】
(ニ)マイコン11の通常動作時において各種制御の空き時間に非数判定を実施するので、大量の浮動小数点型データが存在し、その非数判定に時間を要する場合にも、他の制御に影響が及ぶことはない。つまり、他の制御が既定のスケジューリング通りに実行されなくなるといった不都合が回避される。また本構成は、マイコン11の演算負荷の観点からも有効であると言える。
【0043】
(ホ)非数有りの旨が判定された時、WDC信号の反転動作を中止するので、マイコン11にリセットがかかり、そのリセットに伴う初期化処理にて非数を一掃することができる。
【0044】
(ヘ)非数有りの旨が判定された時、全ての割り込みを禁止し且つ無限ループに突入するので、非数の存在が確認されてから消去されるまでの間に非数が原因で制御性が悪化するといった不都合が確実に防止できる。
【0045】
なお本発明は、上記以外に次の形態にて実現できる。
非数判定手段を実現する構成として図5の非数チェックルーチンを説明したが、こうしたソフトウエアでの具体化以外に、マイコンのハード構成にて当該手段を具体化しても良い。
【0046】
上記実施の形態では、通常動作時においてWDC監視装置18を用いてマイコン11のリセットを操作したが、該リセットの操作は既述の構成に限定されない。マイコン11自身でソフト的にリセットする構成であっても良い。
【0047】
上記実施の形態では、単精度記憶形式の浮動小数点型データを扱う電子制御装置(ECU)について例示したが、倍精度記憶形式の浮動小数点型データを扱う電子制御装置にも適用できる。
【図面の簡単な説明】
【図1】発明の実施の形態におけるエンジン制御システムの概略を示すブロック図。
【図2】WDC信号の形態を示すタイムチャート。
【図3】RAMの構成例を示す図。
【図4】イニシャルルーチンを示すフローチャート。
【図5】非数チェックルーチンを示すフローチャート。
【図6】アイドルルーチンを示すフローチャート。
【図7】4ms処理を示すフローチャート。
【図8】浮動小数点型データの構成を示す図。
【図9】回転数演算処理を示すフローチャート。
【符号の説明】
1…エンジン、10…エンジン制御ECU(電子制御装置)、11…マイコン、12…非数判定手段,データ初期化手段を構成するCPU、13…RAM(メモリ)、15…FPU(浮動小数点演算プロセッサ)、18…WDC監視装置。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an electronic control device having a floating point arithmetic function.
[0002]
[Prior art]
In general, an electronic control unit (ECU) applied to automobile engine control or the like has conventionally performed various operations using fixed-point data, but in recent years, a floating-point arithmetic processor (FPU) is used. ) Has made it possible to perform operations on floating-point data. According to the floating-point type data, the operation result can be obtained with very fine accuracy compared to the fixed-point type data.
[0003]
The floating-point type data is configured in accordance with, for example, the IEEE 754 standard, and includes a 1-bit sign part, an 8-bit exponent part, and a 23-bit mantissa part as shown in FIG. Thus, in the case of 4-byte (single-precision storage format) floating-point data having a mantissa part of 23 bits, it has a resolution of 7 digits (0.0000001 resolution).
[0004]
FIG. 8B shows a bit pattern in a single precision storage format. Floating-point type data includes a normalized number, a denormalized number, an infinite number, zero, and a combination of an exponent part and a mantissa part. A distinction is made between numbers. Here, a non-numeric value represents a numerical value, and a non-numeric value represents not a numerical value. For example, when a calculation result that cannot be expressed as a numerical value such as 0/0 or + ∞−∞ is represented, a non-number is used.
[0005]
[Problems to be solved by the invention]
As described above, floating-point data has a data format of a non-number. If even one non-number is generated or exists in the electronic control device, the non-number may multiply in the device. Further, for example, the results of four arithmetic operations including non-numbers are all non-numbers and become invalid. For example, in the comparison operation, when comparing whether the non-number is 1 or more, the result is false. Therefore, when a non-number occurs in the electronic control unit, there is a problem that the calculation result (output value) cannot be guaranteed at all.
[0006]
There are mainly two conditions for generating non-numbers in engine control. The first condition is when the floating point type RAM value is rewritten due to noise during operation of the electronic control unit or during battery backup, and the RAM value itself changes to an innumerable number. For example, there is a case where the floating-point RAM value is rewritten to FFFFFFFFh (all 1 bits) due to noise. The second condition is a case where an argument used for floating-point arithmetic is rewritten due to noise or the like, and an arithmetic operation such as 0/0 is performed to generate a secondary number. The case will be described in the calculation processing of the engine speed shown in FIG.
[0007]
That is, in the process of FIG. 9, the time T360 required for the engine to rotate at 360 ° CA (crank angle) is calculated and stored as the FRO value (step 501). 1 sec "is set in FR1 and" 60 "is set in FR2 (steps 502 to 504).
[0008]
After that, the arithmetic expression FR0 = FR1 / FR0 * FR2
Thus, the FR0 value is calculated (step 505), and the FR0 value is set as the engine speed Ne (step 506).
[0009]
In the process of FIG. 9, it is assumed that the FR0 and FR1 values change to 0 due to noise or the like immediately after step 504. In this case, the calculation of “0/0” is performed in step 505, and the FR0 value that is the calculation result of step 505 becomes a non-number. As a result, the engine speed cannot be calculated correctly.
[0010]
The present invention has been made paying attention to the above-mentioned problem, and the object of the present invention is to prevent a control failure caused by the occurrence of a non-number in an electronic control device having a floating-point arithmetic function. It is to provide an electronic control device capable of
[0011]
[Means for Solving the Problems]
In the electronic control unit according to claim 1, the microcomputer determines whether or not the data in the storage area of the floating-point data in the nonvolatile memory is non -numeric (non-numeric judging means), and judges that there is a non-numeric. At this time, the data in the storage area of the floating point type data in the nonvolatile memory is initialized (data initialization means). In such a case, the non-number is cleared by initializing the memory data in which the non-number exists. Therefore, various inconveniences caused by the existence of non-numerical data can be avoided in various controls by the microcomputer. As a result, it is possible to prevent a control failure associated with the occurrence of a non-number. The non-numeric determination means performs non-numeric determination on the storage area of the floating-point type data in the nonvolatile memory at the time of system initialization processing associated with power-on of the microcomputer. In this case, even if the floating point type data in the non-volatile memory is destroyed due to noise, etc. while the microcomputer is stopped, it will be detected properly immediately after the power is turned on, that is, before the control is started. This can prevent adverse effects on the control.
The non-volatile memory includes a backup RAM (also referred to as a standby RAM) that stores data in a non-volatile state by supplying power from a battery power source, an EEPROM, a flash ROM, and the like.
[0012]
In particular, as described in claim 2, upon initialization of the data in the storage area of the floating-point data in the nonvolatile memory, and writes the default value does not hinder the control in the storage area of the floating-point data in the nonvolatile memory Thus, various controls can be performed using this default value.
[0015]
In the third aspect of the invention, since the non-numeric determination is performed in the idle time of various controls even during the normal operation of the microcomputer, there is a large amount of floating-point type data, and the non-numeric determination requires time. In addition, the influence on other controls can be suppressed. This configuration is also effective from the viewpoint of the computational load of the microcomputer.
[0016]
According to a fourth aspect of the present invention, the microcomputer resets the microcomputer when the non-number determination means determines that there is a non-number in its normal operation. Therefore, the non-number is cleared in the initialization process associated with the resetting of the microcomputer.
[0017]
In the fifth aspect of the invention, the microcomputer stops the inversion operation of the watchdog clear (WDC) signal when the non-number determination means determines that there is a non-number in the normal operation . That is, by stopping the inversion operation of the watchdog clear signal, the periodicity of the signal is lost, and the watchdog circuit outputs a reset signal to the microcomputer. As a result, the microcomputer is reset, and the non-number is cleared in the initialization process accompanying the reset.
[0018]
In such a case, as described in claim 6 , when it is determined that there is a non-number during normal operation of the microcomputer , it is preferable to prohibit all interruptions. As a result, it is possible to surely prevent the inconvenience that the controllability is deteriorated due to the non-number after the presence of the non-number is confirmed until the deletion.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing an outline of an engine control system. In this system, the vehicle-mounted engine 1 is configured as, for example, a gasoline injection type multi-cylinder internal combustion engine.
[0020]
The engine control ECU 10 includes a microcomputer (hereinafter referred to as a microcomputer) 11, and the microcomputer 11 includes a CPU 12, a RAM 13, a ROM 14, an FPU (floating point arithmetic processor) 15, and an I / O (input / output device) 16. Here, the FPU 15 performs a calculation in the floating point format, and the CPU 12 performs a calculation other than the floating point format. The I / O 16 includes a well-known A / D converter. The RAM 13 is a storage element that retains stored contents by receiving power from an in-vehicle battery (not shown) even when the ignition switch is OFF. In the present embodiment, the RAM 13 corresponds to a nonvolatile memory (backup RAM). However, the nonvolatile memory may include an EEPROM, a flash ROM, or the like.
[0021]
The ECU 10 also includes a WDC (watchdog clear) monitoring device 18 as a watchdog circuit. The WDC monitoring device 18 monitors a WDC signal periodically output from the microcomputer 11 and outputs a reset signal to the microcomputer 11 every time the periodicity is lost, such as when the WDC signal is interrupted. The watch dog circuit may be built in the microcomputer 11.
[0022]
For example, as shown in FIG. 2, the WDC signal is output as a signal that inverts H / L at a cycle of 4 ms, and if the inversion edge is not detected for a predetermined time (32 ms in the figure), the WDC monitoring device 18 sets a reset signal. Lower. After that, when the reset is released, the WDC signal that is inverted at a cycle of 4 ms is taken into the WDC monitoring device 18 again.
[0023]
Various information representing the engine operating state is input to the ECU 10 from the sensor 2 provided in the engine 1. The sensor 2 includes, for example, an air flow meter for detecting the intake air amount, a water temperature sensor for detecting the cooling water temperature, a throttle opening sensor for detecting the throttle opening, and the like. Then, the ECU 10 performs fuel injection control, fuel gas purge control, and the like by an injector (not shown) based on the input sensor signal.
[0024]
As described above, the floating-point data calculated by the FPU 15 is configured according to, for example, the IEEE 754 standard, and has a data format shown in FIG. Further, as shown in FIG. 8B, the floating point type data is classified into a normalized number, a denormalized number, an infinite number, zero, and a non-number according to the combination of the exponent part and the mantissa part.
[0025]
On the other hand, FIG. 3 shows a configuration example of the RAM 13. The RAM 13 can be roughly divided into a floating-point RAM area, a fixed-point RAM area, and a stack area. The floating-point RAM area is divided by 4 bytes, “START” is assigned to the start address, and “END” is assigned to the end address. In this case, in the RAM 13, it is preferable that the floating-point RAM area is separated from the fixed-point RAM area and the stack area.
[0026]
In the present embodiment, the floating point type data held in the RAM 13 becomes non-numbered due to the influence of noise or the like before the operation power supply to the ECU 10 is turned on, or the floating point type data during the normal operation of the ECU 10. When the number becomes a non-number, it is determined to that effect and a data initialization process is performed to remove the non-number. The objects to be subjected to the non-numeric check are constants and RAM data defined in the software. Hereinafter, the gist of the present embodiment will be described in detail according to each process of FIGS. 4 to 7 executed by the CPU 12.
[0027]
First, a non-numerical check procedure immediately after power-on to the ECU 10 will be described with reference to the flowchart of FIG. FIG. 4 shows an initial routine that is started immediately after power-on, and this routine corresponds to “data initialization means”.
[0028]
In step 101, a non-number occurrence flag indicating the presence or absence of a non-number is set to “0”. Next, in step 102, a non-number check routine is called. In this non-number check routine, it is determined whether or not there is a non-number in the floating-point RAM area, details of which will be described later with reference to FIG.
[0029]
In the next step 103, it is determined whether or not the non-number generation flag is “0”. If the non-number generation flag is “0”, there is no non-number and the process proceeds to step 106. In step 106, after performing other initialization processes, this process is terminated.
[0030]
If there is a non-number in any of the floating-point RAM areas, the non-number generation flag is set to “1”. Therefore, the process proceeds to step 104 to initialize the floating-point RAM area. That is, a default value that does not hinder control is written in the floating-point RAM area, and the non-number is erased. Since this initialization process eliminates non-numbers, the non-number generation flag is set to “0” in step 105. In the subsequent step 106, other initialization processing is executed, and then this processing is terminated.
[0031]
Next, details of the non-number check routine will be described with reference to the flowchart of FIG. This routine corresponds to “non-number determination means”. In this processing, for each area from the start address START to the end address END of the floating-point RAM, combinations in which the exponent parts (bits 30 to 23) are all “1” and the mantissa parts (bits 22 to 0) are not all “0”. Whether or not there is a non-number is determined by whether or not.
[0032]
Specifically, the following loop processing is performed while setting the address by sequentially changing the variable R1 in units of 4 bytes from the start value START to the end value END. At this time, in step 201, the contents of the address indicated by the variable R1 are captured as the R0 value. In step 202, it is determined whether or not the bits 30 to 23 of the R0 value are “11111111”. In step 203, it is determined whether or not all the bits 22 to 0 of the R0 value are 0.
[0033]
If step 202 is NO, or if both steps 202 and 203 are YES, the floating-point type data at the corresponding address is not a non-numeric value, and the address of the next floating-point type data is transferred. If step 202 is YES and step 203 is NO, it is assumed that there is a non-number in the floating-point RAM area, and in step 204, “1” is set in the non-number generation flag, and the process ends.
[0034]
On the other hand, during normal operation of the ECU 10, the idle routine shown in FIG. Here, the idle routine is a process that is executed during idle time of various controls that are processed in a time cycle or rotation signal synchronization, and is executed in a task that has the lowest priority among the various processes that are normally handled by the ECU 10. Process.
[0035]
In step 301 of FIG. 6, the non-number check routine of FIG. 5 is called, and the non-number generation flag is operated in accordance with the presence or absence of the number. In the subsequent step 302, various controls such as a checksum of the ROM 14 and a register confirmation process in the microcomputer 11 are performed.
[0036]
In the 4 ms processing shown in FIG. 7, the result of the non-number check performed in the idle routine of FIG. 6 is monitored. That is, in step 401 of FIG. 7, it is determined whether or not the non-number occurrence flag is “1”. If the non-number generation flag = 0 and there is no non-number, the process proceeds to step 402, and the WDC signal is inverted. In such a case, since the WDC signal is inverted at a cycle of 4 ms, the WDC monitoring device 18 can be informed that the CPU 12 is operating normally. In the subsequent step 403, various controls such as A / D conversion processing of various sensor detection values are performed at a cycle of 4 ms, and then this processing is temporarily terminated.
[0037]
If the non-number occurrence flag = 1 and there is a non-number, the process proceeds to step 404 to prohibit all interrupts, and then enters an infinite loop. In other words, since the WDC signal is not inverted after entering the infinite loop, the periodicity of the WDC signal is lost, and a reset signal is output from the WDC monitoring device 18 to the microcomputer 11 after a predetermined period (after 32 ms). The Therefore, in the initial routine (the process of FIG. 4) accompanying the resetting of the microcomputer 11, the non-number generation flag is confirmed again, and the non-number is cleared in the same process.
[0038]
In the process of FIG. 7 above, if there are non-numbers, all interrupts are prohibited and an infinite loop is entered. Therefore, after determining that there are non-numbers, there are various numbers depending on the number before the reset signal is issued. Inconveniences such as adverse effects on the control are avoided. That is, if interruption is permitted after determination that there is a non-number, the non-number may be used in the generated interrupt processing, and control may become abnormal, but such inconvenience does not occur according to FIG. .
[0039]
According to the embodiment described in detail above, the following effects can be obtained.
(A) Whether or not there is a non-number is determined for the floating-point RAM area, and when it is determined that there is a non-number, the non-number is cleared by initializing the RAM data. Therefore, in the various controls by the microcomputer 11, various inconveniences caused by the existence of data including non-numbers can be avoided. As a result, it is possible to prevent a control failure associated with the occurrence of a non-number.
[0040]
(B) Since a default value that does not hinder control is written as RAM data and the floating-point RAM area is initialized, various controls can be performed using this default value.
[0041]
(C) When the system is initialized (initial routine) when the power to the microcomputer 11 is turned on, the non-number determination is performed on the floating-point RAM area of the RAM 13. In this case, even if the floating point type data in the RAM 13 is destroyed due to noise or the like while the operation of the microcomputer 11 is stopped, it can be properly detected immediately after the power is turned on, that is, before the control is started. An adverse effect on the control is prevented.
[0042]
(D) Since the non-number determination is performed during the idle time of various controls during the normal operation of the microcomputer 11, a large amount of floating-point data exists, and even when the non-number determination requires time, other control is performed. There is no impact. That is, the inconvenience that other control is not executed according to the predetermined scheduling is avoided. This configuration can also be said to be effective from the viewpoint of the computational load of the microcomputer 11.
[0043]
(E) When it is determined that there is a non-number, the inversion operation of the WDC signal is stopped, so that the microcomputer 11 is reset, and the non-number can be cleared by an initialization process associated with the reset.
[0044]
(F) When it is determined that there is a non-number, all interrupts are prohibited and an infinite loop is entered, so control is performed due to the non-number between the confirmation of the existence of the non-number and the deletion. Inconveniences such as deterioration in performance can be reliably prevented.
[0045]
In addition to the above, the present invention can be realized in the following forms.
Although the non-number check routine of FIG. 5 has been described as a configuration for realizing the non-number determination means, the means may be embodied by a hardware configuration of a microcomputer in addition to such software implementation.
[0046]
In the above embodiment, the microcomputer 11 is reset using the WDC monitoring device 18 during normal operation. However, the reset operation is not limited to the configuration described above. The microcomputer 11 itself may be configured to be reset by software.
[0047]
In the above embodiment, the electronic control unit (ECU) that handles floating-point type data in the single-precision storage format is exemplified, but the present invention can also be applied to an electronic control unit that handles floating-point type data in the double-precision storage format.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an outline of an engine control system in an embodiment of the invention.
FIG. 2 is a time chart showing the form of a WDC signal.
FIG. 3 is a diagram illustrating a configuration example of a RAM.
FIG. 4 is a flowchart showing an initial routine.
FIG. 5 is a flowchart showing a non-number check routine.
FIG. 6 is a flowchart showing an idle routine.
FIG. 7 is a flowchart showing 4 ms processing.
FIG. 8 is a diagram showing a configuration of floating point type data.
FIG. 9 is a flowchart showing a rotational speed calculation process.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Engine, 10 ... Engine control ECU (electronic control apparatus), 11 ... Microcomputer, 12 ... CPU which comprises a non-number determination means, a data initialization means, 13 ... RAM (memory), 15 ... FPU (floating point arithmetic processor) 18) WDC monitoring device.

Claims (6)

浮動小数値を演算するための浮動小数点演算機能を有し、所定の制御プログラムに従い各種制御を実施するマイクロコンピュータと、マイクロコンピュータへの動作電源の遮断時にも記憶内容を保持し、且つ浮動小数点型データの記憶領域を有する不揮発性メモリとを備えた電子制御装置であって、
前記マイクロコンピュータは、前記不揮発性メモリの浮動小数点型データの記憶領域のデータについて非数の有無を判定する非数判定手段と、
前記非数判定手段により非数が有ると判定された時、前記不揮発性メモリの浮動小数点型データの記憶領域のデータを初期化するデータ初期化手段と、
を備え
前記非数判定手段は、マイクロコンピュータへの電源投入に伴うシステムの初期化処理に際し、前記不揮発性メモリの浮動小数点型データの記憶領域について非数判定を実施することを特徴とする電子制御装置。
A microcomputer that has a floating-point arithmetic function for calculating a floating-point value, performs various controls according to a predetermined control program , retains stored contents even when the operation power to the microcomputer is shut off, and is a floating-point type met electronic control device and a nonvolatile memory having a storage area of the data,
The microcomputer includes a non -numeric determination means for determining whether or not the data in the storage area of the floating-point data in the nonvolatile memory is non-numeric.
Data initialization means for initializing data in the storage area of the floating-point type data in the nonvolatile memory when the non-number determination means determines that there is a non-number;
Equipped with a,
The electronic control device according to claim 1, wherein the non-number determination means performs a non-number determination on a storage area of the floating point type data in the nonvolatile memory at the time of initialization of the system accompanying power-on of the microcomputer .
前記データ初期化手段は、前記不揮発性メモリの浮動小数点型データの記憶領域のデータの初期化に際し、制御に支障のないデフォルト値を前記不揮発性メモリの浮動小数点型データの記憶領域に書き込む請求項1に記載の電子制御装置。Said data initialization means, claim wherein upon initialization of the data in the storage area of the floating-point data in the nonvolatile memory, for writing the default value does not hinder the control in the storage area of the floating point data of the non-volatile memory The electronic control device according to 1. 前記非数判定手段は、マイクロコンピュータの通常動作時においても各種制御の空き時間に前記不揮発性メモリの浮動小数点型データの記憶領域について非数判定を実施する請求項1又は2に記載の電子制御装置。3. The electronic control according to claim 1, wherein the non-number determination means performs the non-number determination on the storage area of the floating-point type data in the nonvolatile memory during idle times of various controls even during normal operation of the microcomputer. apparatus. 前記非数判定手段は、マイクロコンピュータの通常動作時においても前記不揮発性メモリの浮動小数点型データの記憶領域について非数判定を実施し、前記マイクロコンピュータは、その通常動作時において前記非数判定手段により非数有りの旨が判定されると、マイクロコンピュータをリセットする請求項1〜3のいずれか一項に記載の電子制御装置。 The non-numeric determination means performs non-numeric determination on the storage area of the floating-point data in the nonvolatile memory even during normal operation of the microcomputer, and the microcomputer performs the non-numeric determination means during the normal operation. The electronic control device according to any one of claims 1 to 3 , wherein the microcomputer is reset when it is determined that there is a non-number . マイクロコンピュータから周期的に出力されるウォッチドッグクリア信号を監視し、このウォッチドッグクリア信号の反転の周期性が崩れる都度、マイクロコンピュータに対してリセット信号を出力するウォッチドッグ回路をさらに備え、
前記非数判定手段は、マイクロコンピュータの通常動作時においても前記不揮発性メモリの浮動小数点型データの記憶領域について非数判定を実施し、前記マイクロコンピュータは、その通常動作時において前記非数判定手段により非数有りの旨が判定された時、前記ウォッチドッグクリア信号の反転動作を中止する請求項1〜4のいずれか一項に記載の電子制御装置。
A watchdog circuit that monitors a watchdog clear signal periodically output from the microcomputer, and further outputs a reset signal to the microcomputer every time the periodicity of inversion of the watchdog clear signal is lost,
The non-numeric determination means performs non-numeric determination on the storage area of the floating-point data in the nonvolatile memory even during normal operation of the microcomputer, and the microcomputer performs the non-numeric determination means during the normal operation. The electronic control device according to any one of claims 1 to 4 , wherein when it is determined that there is a non-number, the inversion operation of the watchdog clear signal is stopped .
前記非数判定手段は、マイクロコンピュータの通常動作時においても前記不揮発性メモリの浮動小数点型データの記憶領域について非数判定を実施し、
前記マイクロコンピュータの通常動作時において、前記非数判定手段により非数有りの旨が判定された時、全ての割り込みを禁止する請求項1〜5のいずれか一項に記載の電子制御装置。
The non-number determination means performs non-number determination on the storage area of the floating point type data in the nonvolatile memory even during normal operation of the microcomputer,
The electronic control device according to any one of claims 1 to 5 , wherein during the normal operation of the microcomputer, when the non-number determination means determines that there is a non-number, all interrupts are prohibited .
JP36674199A 1999-12-24 1999-12-24 Electronic control device with floating point arithmetic function Expired - Fee Related JP4058870B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP36674199A JP4058870B2 (en) 1999-12-24 1999-12-24 Electronic control device with floating point arithmetic function
US09/739,335 US6904543B2 (en) 1999-12-24 2000-12-19 Electronic control having floating-point data check function
DE10064787A DE10064787A1 (en) 1999-12-24 2000-12-22 Electronic control unit for motor control system of vehicle, has CPU which carries out backup processing instead of floating point calculation if floating point data including non-numeric values

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP36674199A JP4058870B2 (en) 1999-12-24 1999-12-24 Electronic control device with floating point arithmetic function

Publications (2)

Publication Number Publication Date
JP2001184192A JP2001184192A (en) 2001-07-06
JP4058870B2 true JP4058870B2 (en) 2008-03-12

Family

ID=18487555

Family Applications (1)

Application Number Title Priority Date Filing Date
JP36674199A Expired - Fee Related JP4058870B2 (en) 1999-12-24 1999-12-24 Electronic control device with floating point arithmetic function

Country Status (1)

Country Link
JP (1) JP4058870B2 (en)

Also Published As

Publication number Publication date
JP2001184192A (en) 2001-07-06

Similar Documents

Publication Publication Date Title
US7765392B2 (en) Method and apparatus for establishing processor as core root of trust for measurement
JP2006323776A (en) Information processor
JP4058870B2 (en) Electronic control device with floating point arithmetic function
US6904543B2 (en) Electronic control having floating-point data check function
JP2000112837A (en) Memory checking device and method therefor
JP7027857B2 (en) Control device
JP4158566B2 (en) Electronic control device having floating point arithmetic function
JP3463322B2 (en) Memory check device for vehicle control device
JP5158030B2 (en) Electronic control device for vehicle
JP2001195233A (en) Electronic controller having floating point arithmetic function
JP3644350B2 (en) Automotive electronic control device with floating point arithmetic function
JP4329332B2 (en) Electronic control device and control program
JP4645519B2 (en) Arithmetic processing device, control device and program
JP5379712B2 (en) In-vehicle control device
JP3314458B2 (en) Microcomputer system
JP3729133B2 (en) Electronic control device for vehicle and control program
JP6877475B2 (en) Electronic control device and stack usage
JP7091853B2 (en) Electronic control device
JP5042766B2 (en) Control device and memory initialization method for control device
JP2010266976A (en) Built-in controller using floating point operation
JP4453762B2 (en) Electronic control unit having floating point arithmetic function
JP2001202256A (en) Microcomputer
JPH07281912A (en) Stack abnormality detecting device
JP3612248B2 (en) Fixed-point arithmetic circuit
JP2022045239A (en) Electronic controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060316

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070918

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071101

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: 20071127

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071210

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101228

Year of fee payment: 3

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111228

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121228

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees