JP3645576B2 - Calculation method of engine rotation time - Google Patents

Calculation method of engine rotation time Download PDF

Info

Publication number
JP3645576B2
JP3645576B2 JP04557493A JP4557493A JP3645576B2 JP 3645576 B2 JP3645576 B2 JP 3645576B2 JP 04557493 A JP04557493 A JP 04557493A JP 4557493 A JP4557493 A JP 4557493A JP 3645576 B2 JP3645576 B2 JP 3645576B2
Authority
JP
Japan
Prior art keywords
job
crank
time
engine
input
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
JP04557493A
Other languages
Japanese (ja)
Other versions
JPH06257503A (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.)
Subaru Corp
Original Assignee
Fuji Jukogyo KK
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 Fuji Jukogyo KK filed Critical Fuji Jukogyo KK
Priority to JP04557493A priority Critical patent/JP3645576B2/en
Publication of JPH06257503A publication Critical patent/JPH06257503A/en
Application granted granted Critical
Publication of JP3645576B2 publication Critical patent/JP3645576B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
本発明は、クランク位置を表すクランクパルスの入力毎に、エンジン回転当たりの最新の時間を算出するエンジンの回転時間算出方法に関する。
【0002】
【従来の技術】
近年、自動車などの車輌にマイクロコンピュータが導入され、エンジン、パワートレインなどを高精度に制御することが可能となった。これにより、車輌制御システムの開発においては、マイクロコンピュータのソフトウエア開発が大きな比重を占めるようになり、制御アルゴリスム上の処理の効率化が重要な課題となっている。
【0003】
上記マイクロコンピュータによるエンジン制御システムにおいては、燃料噴射量の設定、点火時期の設定などのように、エンジン回転数を基本パラメータの1つとして演算を行なう処理が多く、周知のように、クランク角センサから出力されるクランク位置を表すクランクパルス情報に基づいてエンジン回転数を算出するようにしている。(特開平4−171253号公報参照)
この場合、上記クランク角センサは、例えば、クランク軸に連接されたロータ外周に対向して設置され、ロータ外周の所定クランク位置を示す複数の突起あるいはスリットなどを検出し、クランクパルスとして出力するようになっており、このクランクパルスの入力間隔時間をタイマで計測してエンジンの回転当たりの経過時間に換算することにより、エンジン回転数を算出することができる。
【0004】
【発明が解決しようとする課題】
しかしながら、従来、クランクパルスの入力間隔時間をタイマで計測してエンジン回転当たりの時間を算出する際には、特定のクランク角で計測したクランクパルスの入力間隔時間に基づいて算出するシステムが多く、このエンジン回転当たりの時間を算出するときには、実際のクランク位置が進んで必ずしも現在の運転状況に基づく回転当たりの時間とならず、エンジンの制御量に僅かな誤差が生じて緻密な制御を行なう上での妨げとなる。
【0005】
本発明は、上記事情に鑑み、クランク位置を表すクランクパルスの入力毎に最新のデータに基づいてエンジン回転当たりの時間を算出し、現在の運転状況を迅速に把握して精密な制御を可能とするエンジンの回転時間算出方法を提供することを目的とする。
【0006】
【課題を解決するための手段】
上記目的を達成するため、請求項1記載の発明は、エンジン半回転毎に予め設定された複数のクランク角度位置に対応してクランクパルスを出力構成し、該クランクパルスが入力する都度、前回クランクパルスが入力してからのクランクパルス入力間隔時間を計測すると共に、該時間値を含めエンジン半回転当たりに入力されるクランクパルスと同数個のクランクパルス入力間隔時間を経時的に記憶し、これら時間値を加算してエンジン回転当たりの時間を算出することを特徴とする。
【0007】
請求項2記載の発明は、請求項1記載の発明において、上記エンジンの回転当たりに入力されるクランクパルスと同数であってこれら各クランクパルス毎のクランク位置情報に対応付けたアドレスを有するテーブルを備えて、クランクパルスの入力毎に、上記テーブルの対応アドレスに前回クランクパルス入力から今回クランクパルス入力までの時間をストアし、上記テーブルの各アドレスにストアされている時間を加算してエンジン回転当たりの時間を算出することを特徴とする。
【0008】
【作用】
請求項1記載の発明は、エンジン半回転毎に予め設定された複数のクランク角度位置に対応してクランクパルスを出力構成し、該クランクパルスが入力する都度、前回クランクパルスが入力してからのクランクパルス入力間隔時間を計測すると共に、該時間値を含めエンジン半回転当たりに入力されるクランクパルスと同数個のクランクパルス入力間隔時間を経時的に記憶し、これら時間値を加算してエンジン回転当たりの時間を算出する。
【0009】
請求項2記載の発明は、エンジンの回転当たりに入力されるクランクパルスと同数であってこれら各クランクパルス毎のクランク位置情報に対応付けたアドレスを有するテーブルを備える。そして、クランクパルスの入力毎に、テーブルの対応アドレスに前回クランクパルス入力から今回クランクパルス入力までの時間をストアする。そして、テーブルの各アドレスにストアされている時間を加算してエンジン回転当たりの時間を算出する。
【0010】
【実施例】
以下、図面を参照して本発明の実施例を説明する。図面は本発明の一実施例に係り、図1はクランク位置算出サブルーチンのフローチャート、図2は0.5ms毎の定期割込み処理のフローチャート、図3はクラセン割込み処理のフローチャート、図4はジョブ優先処理のフローチャート、図5はジョブ実行サブルーチンの部分フローチャート1、図6はジョブ実行サブルーチンの部分フローチャート2、図7はジョブ実行サブルーチンの部分フローチャート3、図8はジョブ実行サブルーチンの部分フローチャート4、図9は半回転時間推定サブルーチンのフローチャート、図10はCCAS・RCAS判別サブルーチンのフローチャート、図11はクラセンタイマのオーバーフロー割込み処理のフローチャート、図12はジョブの実行状態を示す説明図、図13はジョブフラグの説明図、図14はクランク位置変数の説明図、図15はジョブ実行中フラグとオーバーラップカウンタの変化を示す説明図、図16はシステムシフトバッファの説明図、図17はクラセン間隔テーブルの説明図、図18は気筒・クランク位置状態マップの説明図、図19はクランク位置とエンジンの行程を示すタイムチャート、図20はエンジン系の概略構成図、図21はクランクロータとクランク角センサの正面図、図22はカムロータとカム角センサの正面図、図23は電子制御系の回路構成図である。
【0011】
本実施例のエンジン制御システムでは、図23に示すマイクロコンピュータを中核とした電子制御装置(ECU)50により図20に示すエンジン系が制御され、燃料噴射制御、点火時期制御などが行なわれる。上記ECU50のマイクロコンピュータには、新しい概念に基づくオペレーティングシステム(OS)が搭載され、このOSにより、各センサ類からの信号入力処理、エンジン回転数算出処理、吸入空気量算出処理、燃料噴射量設定処理、点火時期設定処理などといった各制御項目毎のジョブが管理されて効率的に実行されるようになっている。
【0012】
まず、上記ECU50によって制御されるエンジン系の機器構成について説明する。
【0013】
図20に示すように、エンジン1(図においては水平対向4気筒型エンジンを示す)は、シリンダヘッド2の吸気ポート2aにインテークマニホルド3が連通され、このインテークマニホルド3の上流にエアチャンバ4を介してスロットル通路5が連通されている。このスロットル通路5の上流側には、吸気管6を介してエアクリーナ7が取付けられ、このエアクリーナ7が吸入空気の取り入れ口であるエアインテークチャンバ8に連通されている。
【0014】
また、上記排気ポート2bにエキゾーストマニホルド9を介して排気管10が連通され、この排気管10に触媒コンバータ11が介装されてマフラ12に連通されている。一方、上記スロットル通路5にスロットルバルブ5aが設けられ、このスロットル通路5の直上流の上記吸気管6にインタークーラ13が介装され、さらに、上記吸気管6の上記エアクリーナ7の下流側にレゾネータチャンバ14が介装されている。
【0015】
また、上記レゾネータチャンバ14と上記インテークマニホルド3とを連通して上記スロットルバルブ5aの上流側と下流側とをバイパスするバイパス通路15に、アイドルスピードコントロールバルブ(ISCV)16が介装されている。さらに、このISCV16の直下流側に、吸気圧が負圧のとき開弁し、またターボチャージャ18によって過給されて吸気圧が正圧になったとき閉弁するチェックバルブ17が介装されている。
【0016】
上記ターボチャージャ18は、上記吸気管6の上記レゾネータチャンバ14の下流側にコンプレッサが介装され、タービンが上記排気管10に介装されている。さらに、上記ターボチャージャ18のタービンハウジング流入口には、ウエストゲート弁19が介装され、このウエストゲート弁19には、ウエストゲート弁作動用アクチュエータ20が連設されている。
【0017】
上記ウエストゲート弁作動用アクチュエータ20は、ダイヤフラムにより2室に仕切られ、一方がウエストゲート弁制御用デューティソレノイド弁21に連通される圧力室を形成し、他方が上記ウエストゲート弁19を閉方向に付勢するスプリングを収納したスプリング室を形成している。
【0018】
上記ウエストゲート弁制御用デューティソレノイド弁21は、上記レゾネータチャンバ14と上記吸気管6の上記ターボチャージャ18のコンプレッサ下流とを連通する通路に介装されており、ECU50から出力される制御信号のデューティ比に応じて、上記レゾネータチャンバ14側の圧力と上記コンプレッサ下流側の圧力とを調圧し、上記ウエストゲート弁作動用アクチュエータ20の圧力室に供給する。
【0019】
すなわち、上記ECU50によって上記ウエストゲート弁制御用デューティソレノイド弁21を制御し、上記ウエストゲート弁作動用アクチュエータ20を作動させて上記ウエストゲート弁19による排気ガスリリーフを調整することにより、上記ターボチャージャ18による過給圧を制御するようになっている。
【0020】
また、上記インテークマニホルド3に絶対圧センサ22が通路23を介して連通され、この通路23に、上記絶対圧センサ22と上記インテークマニホルド3あるいは大気とを選択的に連通する吸気管圧力/大気圧切換ソレノイド弁24が介装されている。
【0021】
さらに、上記インテークマニホルド3の各気筒の各吸気ポート2aの直上流側にインジェクタ25が臨まされ、また、上記シリンダヘッド2の各気筒毎に、その先端を燃焼室に露呈する点火プラグ26aが取付けられ、この点火プラグ26aに連設する点火コイル26bにイグナイタ27が接続されている。
【0022】
上記インジェクタ25には、燃料タンク28内に設けたインタンク式の燃料ポンプ29から燃料フィルタ30を経て燃料が圧送され、プレッシャレギュレータ31にて調圧される。
【0023】
また、上記吸気管6の上記エアークリーナ7の直下流に、ホットワイヤ式あるいはホットフィルム式などの吸入空気量センサ32が介装され、上記スロットルバルブ5aに、スロットル開度センサ33aとアイドルスイッチ33bとを内蔵したスロットルセンサ33が連設されている。
【0024】
さらに、上記エンジン1のシリンダブロック1aにノックセンサ34が取付けられるとともに、このシリンダブロック1aの左右両バンクを連通する冷却水通路35に冷却水温センサ36が臨まされ、上記排気管10の上記エキゾーストマニホルド9の集合部にO2 センサ37が臨まされている。
【0025】
また、上記シリンダブロック1aに支承されたクランクシャフト1bにクランクロータ38が軸着され、このクランクロータ38の外周に、電磁ピックアップなどからなるクランク角センサ39が対設されている。さらに、上記エンジン1のカムシャフト1cに連設するカムロータ40に、電磁ピックアップなどからなる気筒判別用のカム角センサ41が対設されている。尚、上記クランク角センサ39及び上記カム角センサ41は、電磁ピックアップなどの磁気センサに限らず、光センサなどでも良い。
【0026】
上記クランクロータ38は、図21に示すように、その外周に突起38a,38b,38cが形成され、これらの各突起38a,38b,38cが、各気筒(#1,#2と#3,#4)の圧縮上死点前(BTDC)θ1,θ2,θ3 の位置に形成されており、本実施例においては、θ1 =97°CA、θ2 =65°CA、θ3 =10°CAである。
【0027】
上記クランクロータ38の各突起は、上記クランク角センサ39によって検出され、図19に示すように、BTDC97°,65°,10°のクランクパルスがエンジン1/2回転毎(180°CA毎)に出力される。そして、上記クランク角センサ39からのクランク位置検出信号の入力間隔時間がタイマによって計時され、エンジン半回転当たりの経過時間すなわち半回転時間に換算されてエンジン回転数が算出される。
【0028】
尚、突起38bは、点火時期設定の際の基準クランク角となり、また、突起38cは、始動時噴射開始時期の基準クランク角となるとともに始動時の固定点火時期を示すクランク角となる。
【0029】
また、図22に示すように、上記カムロータ40の外周には、気筒判別用の突起40a,40b,40cが形成され、突起40aが#3,#4気筒の圧縮上死点後(ATDC)θ4 の位置に形成され、突起40bが3個の突起で構成されて最初の突起が#1気筒のATDCθ5 の位置に形成されている。さらに、突起40cが2個の突起で形成され、最初の突起が#2気筒のATDCθ6 の位置に形成されている。本実施例においては、θ4 =20°CA、θ5 =5°CA、θ6 =20°CAである。
【0030】
そして、上記カムロータ40の各突起が上記カム角センサ41によって検出され、各気筒の燃焼行程順を#1→#3→#2→#4とした場合、この燃焼行程順と、上記カム角センサ41からのカムパルスをカウンタによって計数した値とのパターン(図19参照)に基づいて、気筒判別がなされる。
【0031】
一方、図23に示すECU50は、燃料噴射制御、点火時期制御などを行なうメインコンピュータ51と、ノック検出処理を行なう専用のサブコンピュータ52との2つのコンピュータを中心として構成され、各部に所定の安定化電源を供給する定電圧回路53や各種の周辺回路が組込まれている。
【0032】
上記定電圧回路53は、ECUリレー54のリレー接点を介してバッテリ55に接続され、このバッテリ55に、上記ECUリレー54のリレーコイルがイグニッションスイッチ56を介して接続されている。また、上記バッテリ55には、上記定電圧回路53が直接接続され、さらに、燃料ポンプリレー57のリレー接点を介して燃料ポンプ29が接続されている。
【0033】
すなわち、上記定電圧回路53は、上記イグニッションスイッチ56がONされ、上記ECUリレー54のリレー接点が閉となったとき、制御用電源を供給し、また、上記イグニッションスイッチ56がOFFされたとき、バックアップ用の電源を供給する。
【0034】
上記メインコンピュータ51は、CPU58(以下、メインCPU58と称する)、ROM59、RAM60、上記イグニッションスイッチ56がOFFされたときにも上記定電圧回路53からバックアップ電源が供給されてデータを保持するバックアップRAM61、カウンタ・タイマ群62、シリアル通信インターフェースであるSCI63、及び、I/Oインターフェース64がバスライン65を介して接続されたマイクロコンピュータである。
【0035】
尚、上記カウンタ・タイマ群62は、フリーランカウンタ、カム角センサ(以下、適宜、カムセンと略記する)信号の入力計数用カムセンカウンタなどの各種カウンタ、燃料噴射タイマ、点火タイマ、後述する0.5ms毎の定期割込みを発生させるための定期割込みタイマ、クランク角センサ(以下、適宜、クラセンと略記する)信号の入力間隔計時用クラセンタイマ、及び、システム異常監視用のウオッチドッグタイマなどの各種タイマを便宜上総称するものであり、上記メインコンピュータ51においては、その他、各種のソフトウエアカウンタ・タイマが用いられる。
【0036】
また、上記サブコンピュータ52も、上記メインコンピュータ51と同様、CPU71(以下、サブCPU71と称する)、ROM72、RAM73、カウンタ・タイマ群74、SCI75、及び、I/Oインターフェース76がバスライン77を介して接続されたマイクロコンピュータであり、上記メインコンピュータ51とサブコンピュータ52とは、上記SCI63,75を介してシリアル通信ラインにより互いに接続されている。
【0037】
上記メインコンピュータ51のI/Oインターフェース64には、入力ポートに、吸入空気量センサ32、スロットル開度センサ33a、水温センサ36、O2 センサ37、絶対圧センサ22、車速センサ42、及び、バッテリ55が、8チャンネル入力のA/D変換器66を介して接続されるとともに、アイドルスイッチ33b、クランク角センサ39、カム角センサ41が接続されており、さらに、始動状態を検出するためにスタータスイッチ43が接続されている。
【0038】
尚、本実施例においては、上記A/D変換器66は、7チャンネル分の入力が使用され、残りの1チャンネルは予備となっている。
【0039】
また、上記I/Oインターフェース64の出力ポートには、イグナイタ27が接続され、さらに、駆動回路67を介して、ISCV16、インジェクタ25、燃料ポンプリレー57のリレーコイル、および、ウエストゲート弁制御用デューティソレノイド弁21、吸気管圧力/大気圧切換ソレノイド弁24が接続されている。
【0040】
一方、上記サブコンピュータ52のI/Oインターフェース76は、入力ポートに、クランク角センサ39、カム角センサ41が接続されるとともに、A/D変換器78、周波数フィルタ79、アンプ80を介してノックセンサ34が接続されており、上記ノックセンサ34からのノック検出信号が上記アンプ80で所定のレベルに増幅された後に上記周波数フィルタ79により必要な周波数成分が抽出され、上記A/D変換器78にてデジタル信号に変換されて入力されるようになっている。
【0041】
上記メインコンピュータ51では、各センサ類からの検出信号を処理し、燃料噴射パルス幅、点火時期などを演算する。すなわち、吸入空気量センサ32の出力信号から吸入空気量を算出し、RAM60及びバックアップRAM61に記憶されている各種データに基づき、吸入空気量に見合った燃料噴射量を演算し、また、点火時期などを算出する。
【0042】
そして、上記燃料噴射量に相応する駆動パルス幅信号を、駆動回路67を介して所定のタイミングで該当気筒のインジェクタ25に出力して燃料を噴射し、また、所定のタイミングでイグナイタ27に点火信号を出力し、該当気筒の点火プラグ26aを点火する。
【0043】
その結果、該当気筒に供給された混合気が爆発燃焼し、エキゾーストマニホルド9の集合部に臨まされたO2 センサ37により排気ガス中の酸素濃度が検出され、この検出信号が波形整形された後、上記メインCPU58で基準電圧(スライスレベル)と比較され、エンジンの空燃比状態が目標空燃比に対し、リッチ側にあるか、リーン側にあるかが判別され、空燃比が目標空燃比となるようフィードバック制御される。
【0044】
一方、上記サブコンピュータ52では、エンジン回転数とエンジン負荷とに基づいてノックセンサ34からの信号のサンプル区間を設定し、このサンプル区間でノックセンサ34からの信号を高速にA/D変換して振動波形を忠実にデジタルデータに変換し、ノック発生の有無を判定する。
【0045】
上記サブコンピュータ52のI/Oインターフェース76の出力ポートは、上記メインコンピュータ51のI/Oインターフェース64の入力ポートに接続されており、上記サブコンピュータ52でのノック判定結果がI/Oインターフェース76に出力される。そして、上記メインコンピュータ51では、上記サブコンピュータ52からノック発生有りの判定結果が出力されると、SCI63を介してシリアル通信ラインよりノックデータを読込み、このノックデータに基づいて直ちに該当気筒の点火時期を遅らせ、ノックを回避する。
【0046】
このようなエンジン制御において、上記メインコンピュータ51では、各センサ類からの信号入力処理、エンジン回転数算出、吸入空気量算出、燃料噴射量算出、点火時期算出といった各項目毎の各種プログラムが、一つのOSの管理下で効率的に実行される。このOSは、車輌制御のための各種マネジメント機能、及び、このマネジメント機能に密着した内部ストラテジーを有し、各種ジョブを体系的に結合する。
【0047】
上記OSのマネジメント機能としては、
(1-1)ジョブの優先処理
(1ー2)セクション定義による各ジョブの分割ファイル対応
(1-3)スタックの使用状況モニタ機能
(1-4)異常割込み動作のモニタ機能
(1-5)ジョブ毎に固有の制約を作らない標準マップ・標準ワークメモリ設定
などの機能があり、制御ストラテジーの開発環境を向上させるとともに、限られたCPU能力を最大限に発揮させ、デジタル制御理論の基本である等時間間隔処理を可能な限り達成することができる。
【0048】
等時間間隔処理としては、0.5ms毎の定期割込みを基本として、2,4,10,50,250ms毎の5種類の等間隔割込みジョブが用意されており、また、エンジン回転に同期した処理として、クランク角信号入力により即割込み実行される高優先クラセンジョブ(以下、単にクラセンジョブと称する)と、より優先順位が高い他のジョブがないときにクランク角信号入力により割込み実行される比較的緊急度の低い低優先クラセンジョブとが用意されている。
【0049】
これらの各ジョブには、クラセンジョブ>2msジョブ>4msジョブ>10msジョブ>低優先クラセンジョブ>50msジョブ>250msジョブの順で、7〜1の優先レベルが高位側から低位側に向かって付けられており、図12に示すように、高速ジョブに対し低速ジョブが分割して処理されるとともに、各ジョブの多重待ち処理が行なわれる。
【0050】
また、上記OSの下で働く各プログラムは、機能別の管理領域すなわちセクション領域毎に順番に配列されており、各セクション領域には機能毎にセクション宣言によって名前が付けられている。各ストラテジーファイル側で使用する主なセクション領域は、
○変数宣言領域
○自己ファイル名、ファイル制作時の自動記録領域
○セッティングデータ領域
○クラセンジョブ領域
○2msジョブ領域
○4msジョブ領域
○10msジョブ領域
○低優先クラセンジョブ領域
○50msジョブ領域
○250msジョブ領域
○リセット時初期化ジョブ領域
○エンスト時初期化ジョブ領域
○バックグランドジョブ領域
○プログラム本体の領域
であり、機能毎にファイルを分割してプログラム開発が可能になるとともに、プログラムの構造化記述を可能にする。
【0051】
また、上記OSには、以上のマネジメント機能に密着した内部ストラテジーとして、
(2-1)A/D変換処理
(2-2)クランク位置に係る各種情報の算出
(2-3)デバッグ用シミュレーション機能(エンジン回転及びA/D変換)
(2-4)点火タイマのセット
(2-5)燃料噴射タイマのセット
などの機能を備えており、さらに、これらの機能に係る各種サービスルーチンが各ジョブ中に用意されている。
【0052】
従来、このような機能は各ジョブレベルで達成するようになっていたが、本システムにおいては、すべてOS側に用意され、OS側で処理したA/D変換結果、クランク位置情報、エンジン回転数などに基づいて、ユーザー側の各ジョブで、燃料噴射量、点火時期などを設定すると、これらの指示値がOSによって燃料噴射タイマ、点火タイマにセットされるようになっている。
【0053】
次に、上記メインコンピュータ51におけるジョブ処理の機能を、図1〜図11のフローチャートに基づいて説明する。尚、サブコンピュータ52はノック検出処理専用のコンピュータであるため、その動作説明を省略する。
【0054】
まず、イグニッションスイッチ56がONされてシステムに電源が投入されると、リセットに伴うリセット割込みが起動し、各種イニシャライズが行なわれるとともに、0.5ms毎に定期割込みを起動するための定期割込みタイマが起動され、クランク角センサ39からの信号入力毎(BTDC97°,65°,10°CA毎のエンジン1回転に6回)に起動されるクラセン割込みが許可され、その後、バックグランドジョブの実行状態となる。
【0055】
そして、このバックグランドジョブの上で、0.5ms毎の定期割込みと、エンジン1回転に6回のクラセン割込みとにより、7レベルのジョブが優先処理される。この2つの割込みにおいては、各自の処理を実行後、共通のアドレスにジャンプし、ジョブ優先処理を実行する。
【0056】
尚、上記リセット割込みは、内部演算において0による除算を実行した場合や、無限ループが発生した場合など、正常時には発生しない要因によっても、起動される。
【0057】
まず、図2に示す0.5ms毎の定期割込みについて説明する。この定期割込みでは、ステップS100で、OS用ワークエリアを設定し、ステップS101で、ウオッチドッグタイマを初期化すると、ステップS102へ進んで、P−RUNフラグを20回に1回すなわち10ms毎に反転する。このP−RUNフラグは、図示しない保護回路によってシステムが自動的にリセットされないようにするためのフラグであり、システムが正常に動作して一定時間毎(10ms毎)に反転される限り、上記保護回路の作動が阻止される。
【0058】
次いで、ステップS103へ進み、スイッチ出力の転写を行なう。このスイッチ出力は、各ジョブ中でメモリに書き込んだビットのON,OFF値であり、各ジョブからは直接I/Oインターフェース64の出力ポートに出力せず、OS側で0.5ms毎にメモリの値を出力ポートに転写する。
【0059】
次に、ステップS104へ進むと、A/D変換サブルーチンを実行してA/D変換に係る各種設定を行ない、ステップS105で、ジョブフラグ作成サブルーチンを実行して、2,4,10,50,250ms毎の各ジョブ割込み要求を示すジョブフラグJB_FLGを作成した後、ステップS106で、A/D変換をスタートする。
【0060】
上記A/D変換は、基本的に、A/D変換器66の8チャンネル入力が0.5ms毎に所定の変換順番毎に処理され、4ms周期で全入力の変換が行なわれる。但し、特定の1つのチャンネルは、回転脈動が発生する吸入管圧力などをA/D変換するためクランク角90°毎に(0.5msの時間精度で)同期し、変換順番に対して割込んだ形で処理が行なわれ、その後の入力の順番を1つ遅れにする。
【0061】
尚、エンジン回転数3750rpm以上では、A/D変換の最後の順番の入力が完全に停止し、7500rpm以上では、最後から2番目の入力も停止するが、A/D変換の順番は、スロットル開度、吸入空気量など変化の速いものを先として、冷却水温、電圧など比較的変化の遅いものが後になるように設定してあり、且つ、最後のA/D変換順番をクランク同期入力に設定してあるため、特に支障は生じない。
【0062】
また、図13に示すように、上記ジョブフラグJB_FLGは、1バイト変数の各ビットを各ジョブに対応するフラグとして割当てたものであり、複数のジョブ要求が同時に可能なようになっている。この1バイト変数のビット1〜ビット7は優先レベル1〜7に対応し、それぞれ、250msジョブ、50msジョブ、低優先クラセンジョブ、10msジョブ、4msジョブ、2msジョブ、クラセンジョブのフラグに割当てられている。そして、所定のビットが立てられたとき、対応する優先レベルのジョブ割込み要求がなされる。尚、ビット0はバックグランドジョブのフラグに割当てられて通常は参照されない。
【0063】
そして、上記ステップS105でジョブフラグ作成サブルーチンによりジョブフラグJB_FLGを作成し、上記ステップS106でA/D変換をスタートした後は、ステップS107へ進み、ジョブフラグJB_FLGのいずれかのジョブに対応するビットが立っているか否かを調べる。
【0064】
その結果、ジョブフラグJB_FLGのビットが一つも立っていないときには、どのジョブからも要求がないため割込みを終了し、ジョブフラグJB_FLGのいずれかのビットが立っているときには、ステップS108へ進んで、現状レベル(この定期割込みが実行される時点で所定の優先レベルのジョブが実行されていた状態)以下のフラグがないか否かを調べる。
【0065】
上記ステップS108で、現状レベル以下のフラグがないときには、ラベルWAR_JBで示される図4のジョブ優先処理にジャンプし、現状レベル以下のフラグがあるときには、ステップS109で、現状レベル以下のレベルのオーバーラップカウンタOLCを1増加させる。
【0066】
上記オーバーラップカウンタOLCは、ジョブ要求を記憶するためのカウンタであり、各優先レベル毎に1バイト割当てられ、上記ジョブフラグJB_FLGによるジョブ要求時にインクリメント、ジョブ終了時にデクリメントされる。すなわち、カウンタによってジョブ要求を記憶することによりジョブの多重要求に対応することができるのである。
【0067】
次いで、上記ステップS109からステップS110へ進み、現状レベルより高いフラグがないか否かを調べ、現状レベルより高いフラグがないときには、ルーチンを抜けて割込みを終了し、現状レベルより高いフラグがあるときには、ラベルWAR_JBのジョブ優先処理へジャンプする。
【0068】
一方、この0.5ms毎の定期割込みに対し、図3のクラセンによる割込みでは、ステップS200で、OS用ワークエリアを設定すると、ステップS201で、後述するクランク位置・半回転時間算出のサブルーチンを実行し、現在のクランク位置を判別するためのクランク位置変数、及び、最新の3つのクラセン間隔の和である半回転時間を算出する。
【0069】
上記クランク位置変数は、OS中で用意されるシステム変数であり、図14に示すように、#1〜#4気筒に対するクランク位置を、97°,65°,10°CAによって12の状態に区分し、現在のクランク位置を表わす。
【0070】
すなわち、各気筒毎に、0,1,2の数値でクラセン入力順を示すクランク位置情報変数S_CCAS、#1気筒を0、#3気筒を1、#2気筒を2、#4気筒を3として気筒の燃焼順を示す気筒情報変数S_RCAS、及び、0〜11の数値でクラセン順序及び気筒順序を総合的に表わす総合位置変数S_ACASの3変数によって現在のクランク位置を表わし、さらに、クランク位置が確証をもって正常に判別されたときを0、判別結果がつじつまが合わず不安の残る推定状態を1、不明な状態を2とするエラーレベルS_ECASにより、クランク位置の判別状況を表わすようになっている。尚、図14においては、システム変数であることを示すS_を省略している。
【0071】
次いで、上記ステップS201からステップS202へ進むと、クランク位置・半回転時間算出のサブルーチンにおいてクランク位置判定が正常に終了したかあるいは判定不能であったかを、アキュムレータAにストアされているコードを読み出すことにより調べる(エラーコード1、正常終了コード0)。
【0072】
そして、上記ステップS202で、アキュムレータAの値が1であり、クランク位置が判定不能であったときには、割込みを終了し、アキュムレータAの値が0であり、クランク位置が正常に判定されているときには、ステップS203へ進み、エンストフラグを解除する。
【0073】
尚、上記エンストフラグは、エンジンがエンスト状態であることを示すフラグであり、クラセン間隔が0.5sec以上の時間(約30rpm以下)のとき、50msジョブに用意されているエンスト処理ルーチンによりセットされ、このクラセン割込みによりクリアされてエンスト状態が解除される。
【0074】
次に、ステップS204へ進むと、点火タイマセットのサブルーチンを実行し、ユーザージョブ側で設定した点火時期の指示値に基づいて作成された点火スケジュールに従って点火タイマをセットする。この点火スケジュールは、ドエル開始時期、ドエルオン待ち時間、ドエルオフ待ち時間などをメンバーとする構造体変数であり、10msジョブ中に作成ルーチンが用意され、この点火スケジュールに従って点火シーケンスが決定される。
【0075】
次いで、ステップS205で、燃料噴射タイマセットのサブルーチンを実行し、ユーザージョブ側で設定した燃料噴射量の指示値(各気筒毎の噴射幅)に対し、燃料噴射開始時期などを燃料噴射タイマにセットしてステップS206へ進む。
【0076】
ステップS206では、このクラセンが実行された現状のジョブレベルが自身のジョブレベルであるか否かを判別し、現状がクラセンジョブ自身のレベルであるときには、ステップS207、S208で、クラセンジョブ、低優先クラセンジョブのオーバーラップカウンタOLCを、それぞれ1増加させて割込みを終了し、現状のジョブレベルがクラセンジョブのレベルでないときには、ステップS209で、現状のジョブレベルが低優先クラセンジョブのレベル以上であるか否かを調べる。
【0077】
そして、現状のジョブレベルが低優先クラセンジョブ以上であるときには、上記ステップS209からステップS210へ進んで、低優先クラセンジョブのオーバーラップカウンタOLCを1増加させると、ステップS211で、クラセンジョブのジョブフラグをセットし、ラベルWAR_JBのジョブ優先処理へジャンプする。
【0078】
一方、上記ステップS209で、現状のジョブレベルが低優先クラセンジョブ以上でないときには、上記ステップS209からステップS212へ進み、クラセンジョブのジョブフラグをセットすると、ステップS213で、低優先クラセンジョブのジョブフラグをセットし、ラベルWAR_JBのジョブ優先処理へジャンプする。
【0079】
このジョブ優先処理では、ステップS300で、ジョブの優先レベルを示す1バイト変数であるジョブレベルJB_LEVを1つ上げると、ステップS301へ進んで、この優先レベルに対応するジョブフラグが立っていないか調べる。そして、ジョブフラグが立っていないときには、ステップS300へ戻ってさらにジョブレベルJB_LEVを1つ上げ、ジョブフラグが立っているときには、ステップS302へ進み、ジョブフラグの立っているジョブのオーバーラップカウンタOLCを初期値の0から1にし、ステップS303へ進む。
【0080】
ステップS303では、より上のジョブフラグがあるか否かを調べ、より上のジョブがあるときには、ステップS300へ戻って前述の処理を繰り返し、より上のジョブがないときには、ステップS304へ進んで、ジョブ実行中フラグJB_RUNをセットすると、ステップS305で、後述するジョブ実行サブルーチンにより最上位のジョブを実行する。
【0081】
上記ジョブ実行中フラグJB_RUNは、ジョブの実行開始時にセットされ、終了時にクリアされるフラグであり、このフラグにより、処理の途中で、より優先度の高いジョブによって割込まれたジョブを識別することができる。
【0082】
例えば、図15に示すように、JB_LEV=4の10msジョブを実行中、JB_LEV=6の2msジョブの割込み要求がなされると、10msジョブの処理が中断され、より優先度の高い2msジョブが、JB_RUN=1、OLC=1にセットされ、実行される。そして、この2msジョブの処理中に、JB_LEV=5の4msジョブの割込み要求が発生すると、この4msジョブは、JB_RUN=0、OLC=1とされて割込みが受付けられるが、実行はされず待機状態となる。
【0083】
その後、ジョブ実行サブルーチンによるジョブの実行が終了すると、上記ステップS305からステップS306へ進んでオーバーラップカウンタOLCを1減らし、ステップS307で、オーバーラップカウンタOLCがゼロになったか否かを調べる。その結果、オーバラップカウンタOLCがゼロになっておらず、同じ優先レベルでジョブ割込み要求が複数回あるときには、ステップS305へ戻ってジョブを繰返し実行し、オーバラップカウンタOLCがゼロになったとき、ステップS307からステップS308へ進んで、ジョブ実行中フラグJB_RUNをクリアする。
【0084】
次に、ステップS309へ進み、ジョブレベルJB_LEVを1つ下げて次のジョブレベルに移ると、ステップS310で、このジョブレベルJB_LEVがゼロになったか否かを調べる。そして、ジョブレベルJB_LEVがゼロのときには、この割込みを終了し、ジョブレベルJB_LEVがゼロでないときには、ステップS311へ進んで、オーバーラップカウンタOLCがゼロか否かを調べる。
【0085】
上記ステップS311で、オーバーラップカウンタOLCがゼロのときには、このレベルではジョブ要求はないため、上記ステップS311からステップS309へ戻って、ジョブレベルJB_LEVをさらに1つ下げて同様の処理を繰返し、オーバーラップカウンタOLCがゼロでないときには、ステップS312へ進んで、このジョブレベルにおいて、ジョブ実行中フラグJB_RUNがセットされているか否かを調べる。
【0086】
上記ステップS312で、ジョブ実行中フラグJB_RUNがセットされているときには、割込み前にジョブを実行中であったため、割込みを終了して割込み前のジョブへ戻り、ジョブ実行中フラグJB_RUNがセットされていなければ、ステップS304へ戻って、このレベルのジョブを実行し、同様の処理を繰返す。
【0087】
すなわち、図15において、JB_LEV=6の2msジョブが終了し、OLC=0、JB_RUN=0になると、ジョブレベルが1つ下げられ、JB_LEV=5の4msジョブが、JB_RUN=0、OLC=1の待機状態からJB_RUN=1にセットされ、実行される。さらに、4msジョブが終了すると、JB_LEV=4に移り、JB_RUN=1(ジョブ実行中)の状態から、2msジョブ及び4msジョブによって中断されていた10msジョブの処理が再開される。
【0088】
このように、0.5ms毎の定期割込み、クラセン割込みを基本タイミングとして、各ジョブの優先レベル及び実行タイミングを知らせるジョブフラグJB_FLGを作成するため、可能な限り正確に、等時間間隔処理、エンジン回転同期処理を実現し、各ジョブを効率良く処理することができる。さらに、基本タイミングとなる各割込み毎に更新されるジョブフラグJB_FLGによらず、オーバーラップカウンタOLCによってジョブの多重要求を記憶するため、あるジョブの処理時間が長引き、再度、同じジョブを実行すべきタイミングとなった場合においても、処理を途中で放棄することなく、可能な限り最後まで処理を継続することができる。
【0089】
次に、図5〜図8のジョブ実行サブルーチンについて説明する。
【0090】
まず、ステップS500で、ジョブフラグJB_FLGを参照して実行すべきジョブがクラセンジョブでないか否かを調べ、クラセンジョブでないときには、ラベルALJ10へ分岐し、クラセンジョブのときには、ステップS501へ進んで、気筒判別がついているか否かを調べる。
【0091】
そして、気筒判別がついていないときには、そのままルーチンを抜けてジョブを実行せず、気筒判別がついているとき、上記ステップS501からステップS502へ進んで、オーバーラップカウンタOLCの値を参照して多重待ち状態であるか否かを調べる。
【0092】
上記ステップS502では、多重待ち状態でないとき、ステップS503へ進んで、クラセン割込み毎に算出されるシステム変数S_ACAS(クランク総合位置変数)をユーザー変数ACASとし、一方、多重待ち状態のときには、ステップS504へ分岐し、ユーザー変数ACASを一つ増やして12で割った剰余をとって新たなユーザー変数ACASとし、このユーザー変数ACASを0,1,2,…,11,0,1,…とソフトウエア的に更新してゆく。
【0093】
すなわち、クラセンジョブ及び低優先クラセンジョブは、自身または優先度の高いジョブに邪魔されて遅れることがあるが、クラセン割込みは正確にクランク角センサ信号に同期して実行され、システム変数S_ACASはジョブの遅れに関係なく更新される。
【0094】
従って、ジョブ中でシステム変数S_ACASを参照して気筒及びクランク位置に係る情報を知り、この情報に応じた仕事を行なおうとしても、自身が他のジョブに邪魔されて遅れた場合には、自身の仕事に対応した気筒及びクランク位置に係る情報を知ることができなくなる。このため、クラセンジョブ及び低優先クラセンジョブ中では、多重待ち状態でないときにOS用のシステム変数S_ACASをユーザー用変数ACASとして取込み、このユーザー変数ACASをジョブ実行毎に更新して多重要求の場合にも、自身に対応した気筒及びクランク位置に係る情報を得て適正な処理がなされるようにするのである。
【0095】
その後、上記ステップS503あるいは上記ステップS504からステップS505へ進み、ジョブのワークエリアを設定すると、ステップS506で、レベルゼロの割込みを許可し、ステップS507で、クラセンジョブのセクションに移る。そして、このクラセンジョブセクションにリンクされた処理を実行し、ステップS508で、割込みを禁止してルーチンを抜ける。
【0096】
次に、ステップS500で、これから実行すべきジョブがクラセンジョブでないときには、ラベルALJ10のステップS510で、2msジョブでないか否か調べ、2msジョブのとき、ステップS511で、ジョブのワークエリアを設定すると、ステップS512で、レベルゼロの割込みを許可し、ステップS513で、2msジョブのセクションに移る。そして、このセクションにリンクされているジョブ本体(ユーザー側の制御ストラテジーに基づくルーチン、あるいは、OS側で用意したサービスルーチン)を実行し、ステップS514で、割込みを禁止してルーチンを抜ける。
【0097】
一方、上記ステップS510で、実行すべきジョブが2msジョブでないときには、ステップS510からステップS520へ分岐し、実行すべきジョブが4msジョブか否かを調べる。そして、4msジョブでないときには、ラベルALJ30へ分岐し、4msジョブのときには、ステップS521で、ジョブのワークエリアを設定すると、ステップS522へ進む。尚、この4msジョブは、A/D変換利用ジョブであり、後述するシステムシフトバッファSSHBを介してA/D変換データを利用する。
【0098】
ステップS522では、レベルゼロの割込みを許可し、次いで、ステップS523へ進むと、スイッチ入力を読み込み、ステップS524で、4msジョブのセクションに移って、リンクされているジョブ本体を実行する。その後、4msジョブのセクションから抜けると、ステップS525で、割込みを禁止し、ステップS526へ進んで、システムシフトバッファSSHBをシフトしてルーチンを抜ける。
【0099】
上記システムシフトバッファSSHBは、図16に示すように、8チャンネルの各A/D変換結果がストアされる先頭オフセットアドレス0,+8,+16,+24,+32,+34,+36,+38番の各メモリ、及び、4ms毎のクランク同期のA/D変換結果がストアされる先頭オフセットアドレス−2番地の1ワードのメモリからなり、0.5ms毎に実行される1回のA/D変換結果が1ワード(2バイト)でストアされる。
【0100】
先頭オフセットアドレス0番地からは、4段のシフトメモリとなっており、90°CA毎のA/D変換結果がストアされ、最新4データ(1回転分)をジョブから参照することができる。また、先頭オフセットアドレス+32,+34,+36,+38番地は、各1ワードのメモリであり、なまし処理機能が選択されたとき、A/D変換結果を加重平均した値がストアされてノイズ除去と精度向上を図ることができるようになっており、これらのメモリのデータは、低速ジョブで利用できる。
【0101】
また、各先頭オフセットアドレス+8,+16,+24番地からは、各4ワードのメモリであり、4msジョブで利用するようになっている。これらの各メモリは、最新のA/D変換結果が先頭から数えて、4msジョブのオーバーラップカウンタOLCの値だけ後のワードにストアされ、4msジョブ実行に際し先頭ワードからデータが読出され、ジョブの終了に伴って後の各ワードのデータが順に先頭方向のワードにシフトされるので、先にストアしたデータから読出されるFIFOバッファとなっている。
【0102】
すなわち、A/D変換は、0.5ms毎の定期割込みにより4ms周期で正確に行なわれるが、4msジョブは優先度の高いジョブに邪魔されて遅れることがある。従って、A/D変換の受渡しにFIFOバッファを用い、4msジョブで+8,+16,+24番地の各FIFOバッファのデータを参照後、上記ステップS526で、各FIFOバッファのデータを順にシフトするのである。
【0103】
一方、上記ステップS520で、実行すべきジョブが4msジョブでなく、ラベルALJ30へ分岐したときには、ステップS530で、実行すべきジョブが10msジョブか否かを調べ、10msジョブのとき、ステップS531で、ジョブのワークエリアを設定し、ステップS532で、レベルゼロの割込みを許可すると、ステップS533で、10msジョブのセクションに移って、ジョブ本体を実行し、ステップS534で割込みを禁止してルーチンを抜ける。
【0104】
尚、上記10msジョブのセクションには、半回転時間からエンジン回転数を算出するサービスルーチン、前述した点火スケジュールを作成するサービスルーチンなどがOS側で用意されている。
【0105】
また、上記ステップS530で、実行すべきジョブが10msジョブでないときには、上記ステップS530からステップS540へ分岐し、実行すべきジョブが低優先クラセンジョブであるか否かを調べる。そして、低優先クラセンジョブでないときには、上記ステップS540からラベルALJ50へ分岐し、実行すべきジョブが低優先クラセンジョブのときは、上記ステップS540からステップS541へ進んで、現在の状態が多重待ち状態であるか否かを調べる。
【0106】
そして、現在の状態が多重待ち状態でないときには、上記ステップS541からステップS542へ進んで、システム変数S_ACAS(クランク総合位置変数)をユーザー変数ACASとしてステップS544へ進み、多重待ち状態のときには、上記ステップS541からステップS543へ分岐し、ユーザー変数ACASを一つ増やして12で割った剰余をとった後、ステップS544へ進む。
【0107】
ステップS544では、ジョブのワークエリアを設定し、ステップS545で、レベルゼロの割込みを許可すると、ステップS546で、低優先クラセンジョブのセクションに移り、ジョブ本体を実行した後、ステップS547で割込みを禁止し、ルーチンを抜ける。
【0108】
さらに、ラベルALJ50では、ステップS550で実行すべきジョブが50msジョブであるか否かを調べ、50msジョブのときには、ステップS551へ進んでジョブのワークエリアを設定し、ステップS552へ進む。
【0109】
ステップS552では、レベルゼロの割込みを許可すると、ステップS553で、50msジョブのセクションに移り、OS側で用意したエンスト処理ルーチン、気筒別の点火時期リタードルーチン、燃料噴射開始時期設定ルーチンなどを実行し、また、ユーザ側の制御ストラテジーに基づくルーチンを実行する。そして、ジョブの終了後、ステップS554で割込みを禁止し、ルーチンを抜ける。
【0110】
一方、上記ステップS550で実行すべきジョブが50msジョブではないときには、上記ステップS550からステップS560へ分岐し、ジョブのワークエリアを設定すると、ステップS561で、レベルゼロの割込みを許可し、ステップS562へ進んで、250msジョブのセクション領域へ移行し、ジョブ本体を実行後、ステップS563で割込みを禁止してルーチンを抜ける。
【0111】
以上のジョブ優先処理においては、クランク位置を常に的確に把握しておく必要があり、クラセン割込み毎に、図1に示すクランク位置算出サブルーチンが実行されて前述したクランク位置変数S_CCAS,S_RCAS,S_ACAS,S_ECASが算出され、半回転時間が算出される。尚、以下の説明においては、システム変数であることを示すS_をクランク位置変数から省略する。
【0112】
このクランク位置算出サブルーチンでは、まず、ステップS600で、クラセンタイマの下2バイトをソフトタイマの下2バイトにストアする。このクラセンタイマはECU50に備えられたハードウエアタイマであり、本実施例においては、16ビットタイマで最大255msまで計数が可能であるが、メモリ上に3バイトの連続した領域を確保して下2バイトにクラセンタイマの2バイトを転写し、クラセンタイマのオーバーフローにより発生する割込みで3バイト目をカウントアップすることによりソフトタイマとして使用する。
【0113】
すなわち、クラセンタイマにオーバーフローが発生したとき、図11のオーバーフロー割込みが発生し、ステップS900で、ソフトタイマの3バイト目を1増やすと、ステップS901で、ソフトタイマの3バイト目が255を越えていないかを判別する。そして、255を越えていないときには、ステップS901からステップS903へジャンプし、255を越えているときには、ステップS901からステップS902へ進んでソフトタイマの3バイト目を255で止め、ステップS903へ進む。
【0114】
ステップS903では、ソフトタイマの3バイト目が2でないか否か、すなわち、クラセン間隔が0.5sec(255ms×2)を越えてエンスト状態であるか否かを調べる。そして、ソフトタイマの3バイト目が2でないときには割込みを終了し、ソフトタイマの3バイト目が2のときには、上記ステップS903からステップS904へ進んで、エンストフラグが立っているか否かを調べる。
【0115】
上記ステップS904では、エンストフラグが立っているときには割込みを終了し、エンストフラグが立っていないときには、ステップS905で、前述した50msジョブに用意されているエンスト処理ルーチンを起動させるエンスト処理要求フラグを立てて割込みを終了する。
【0116】
これにより、クラセン間隔を最大64sec(255ms×256)まで計数することが可能となり、16ビット以上の特別なハードウエアタイマを使用することなく、クランキング時などクラセン間隔が極めて長い場合にも容易に対応することができる。
【0117】
一方、クランク位置算出のサブルーチンでは、ステップS600からステップS601へ進むと、クラセン間隔が設定時間以下か否かを調べる。この設定時間は、最大エンジン回転数に対応するクラセン間隔としての時間、例えば0.3msであり、上記ステップS601でクラセン間隔が設定時間以下のときには、ノイズの混入などによるクラセンタイマの計数エラーとしてステップS602でアキュムレータAにエラーコード1を格納し、上記ステップS601で、クラセン間隔が設定時間より長いときには、クラセンタイマの計数が正常であるとしてステップS603へ進む。
【0118】
ステップS603では、後述するCCAS・RCAS判別サブルーチンを実行してクランク位置を判別し、ステップS604で、エラーレベルECASが2であるか否か、すなわち、クランキング時などのように気筒判別がなされていない状態であるか否かを調べ、ECAS=2のときには、ステップS605へ分岐してアキュムレータAにエラーコード1を格納し、ルーチンを抜ける。
【0119】
一方、上記ステップS604で、ECAS≠2のときには、ステップS606へ進み、ソフトタイマの3バイト目を0とする。そしてステップS607へ進み、クランク位置情報変数CCASが1であるか否か、すなわち、現在のクランク位置がBTDC65°CA〜10°CAの間(図14参照)であるか否かを調べ、CCAS=1のときには、ステップS607からステップS609へジャンプし、CCAS≠1のときには、ステップS607からステップS608へ進んで、A/D変換リクエストを1増加させ、ステップS609へ進む。
【0120】
このA/D変換リクエストは、クランク角90°毎にクランク同期A/D変換を指示するためのフラグ的な変数であり、0、1の値をとり、値が1のときクランク同期A/D変換を指示する。すなわち、前述したように、8チャンネルのA/D変換のうち1チャンネルのA/D変換はクランク角90°毎に行なわれるが、CCASが0になったとき(BTDC97°)と、CCASが2になったとき(BTDC10°)、クランク同期のA/D変換リクエストをセットし、0.5ms毎のA/D変換順番に対してクランク角90°毎のA/D変換を割込ませるのである。
【0121】
その後、ステップS609では、気筒情報変数RCASを3倍してクランク位置情報変数CCASを加算することにより総合位置変数ACASを算出すると(ACAS=RCAS×3+CCAS)、ステップS610で、ソフトタイマを2バイトでリミットし、クラセンタイマがオーバーフローしている場合には下2バイトをFFFF(255ms)としてステップS611へ進む。
【0122】
ステップS611では、総合位置変数ACAS=0,1,2,…,11を添字とする配列TCAS[ACAS](配列の要素)にクラセン間隔データをストアし、ステップS612で、クランク位置情報変数CCAS=0,1,2を添字とする配列MTCSX[CCAS](配列の要素)にクラセン間隔データをストアする。
【0123】
配列TCASは、図17(a)に示すように、ACAS=0,1,2,…、11に対応するエンジン2回転分のクラセン間隔データがストアされた12ワードのクラセン間隔テーブルであり、配列MTCSXは、図17(b)に示すように、CCAS=0,1,2に対応する3ヶのクラセン間隔データがストアされた3ワードのクラセン間隔テーブルである。
【0124】
すなわち、上記ステップS603のCCAS・RCAS判別サブルーチン(詳細は後述する)及び、ステップS609により各情報変数CCAS,RCAS,ACASが更新され、例えば、CCAS=1、RCAS=1、ACAS=4に更新されて、現在、クランク位置が#3気筒のBTDC65゜〜10゜CAのとき、クラセンマイマによって計時された#3気筒のBTDC97゜CAにおけるクラセン信号入力から#3気筒のBTDC65゜CAにおけるクラセン信号入力までの時間(クラセン間隔データ)を、ステップS611で総合位置変数ACASをパラメータとして配列TCASのACAS=3のアドレスにストアすると共に、ステップS612でクランク位置情報変数CCASをパラメータとして配列MTCSXのCCAS=0のアドレスにストアする。
【0125】
従って、クラセン入力によるクラセン割込み毎に総合位置変数ACAS、クランク位置情報変数CCASが更新される都度、配列TCAS、MTCSX内のデータが順次更新されるので、配列TCASを参照することにより、各気筒の各クランク位置におけるクラセン間隔の変化(回転速度の変化)を知ることができ、各気筒の失火の有無、燃焼状態などを判断することができ、全気筒の運転状況を把握することができる。また、配列MTCSXを参照することにより、常に最新のクラセン間隔を得ることができ、現在の運転状況を迅速に把握することができる。
【0126】
次いで、ステップS613へ進むと、再び、エラーレベルECASの値を調べる。ここでは、前述のステップS604においてECAS≠2であることを既に確認してあるため、エラーレベルECASが1か否か、すなわち、クランク位置の判別が不安の残る推定状態であるか否かを調べる。
【0127】
上記ステップS613でECAS≠1(すなわちECAS=0)であり、クランク位置が確証をもって判別されているときには、上記ステップS613からステップS614へ進んで、最新3ヶのクラセン間隔データの和(配列MTCSXにストアされているクラセン間隔データの和)を、3バイトの半回転時間MTCS18として算出する(MTCS18=ΣMTCSX)。
【0128】
すなわち、半回転時間MTCS18は、クラセン割込み毎にクランク位置情報変数CCASが更新されて配列MTCSX内のデータが更新される毎に算出され、BTDC97°,65°,10°の各位置毎にクラセン間隔の移動和を取ることにより常に最新のデータが得られるため、現在の運転状況に基づいてエンジン回転数などを算出することができ、より精密な制御が可能となる。
【0129】
一方、上記ステップS613で、ECAS=1であり、クランク位置の判別が不安の残る推定状態であるときには、配列MTCSXから半回転時間MTCS18を算出せず、ステップS615で半回転時間推定のサブルーチンを実行して半回転時間MTCS18を推定する。
【0130】
この半回転時間MTCS18の推定について説明すると、まず、図9のステップS700で、クランク位置情報変数CCASが1か否か、すなわち、現在のクランク位置がBTDC65°〜10°の間か否かを調べ、CCAS=1のときには、ステップS701で、BTDC97°〜65°間の角度32°から、前回のクラセン間隔×180/32を半回転時間MTCS18と推定してリターンする。
【0131】
一方、上記ステップS700で、CCAS≠1のときには、上記ステップS700からステップS702へ進んで、クランク位置情報変数CCASが2か否か、すなわち、現在のクランク位置がBTDC10°からATDC83°(次の気筒のBTDC97°)の間か否かを調べ、CCAS≠2のとき(CCAS=0のとき)には、ステップS703へ進んで、BTDC10°〜ATDC83°間の角度93°から前回のクラセン間隔×180/93を半回転時間MTCS18と推定してリターンする。また、上記ステップS702で、CCAS=2のときには、上記ステップS702からステップS704へ分岐し、BTDC65°〜10°間の角度55°から前回のクラセン間隔×180/55を半回転時間MTCS18と推定してリターンする。
【0132】
そして、クランク位置算出サブルーチンでは、ステップS614で半回転時間MTCS18を算出した後、あるいは、以上説明したステップS615のサブルーチンにより半回転時間MTCS18を推定した後は、ステップS616へ進み、3バイトの半回転時間MTCS18を2バイトにリミットして所定の変数MTCSKにストアすると、ステップS617で、この変数MTCSKを2倍して変数MTCSK4にストアし、ステップS618で、正常終了コード0をアキュムレータAに格納してルーチンを抜ける。
【0133】
そして、前述のジョブ実行サブルーチンにおいて10ms毎にエンジン回転数が算出され、このエンジン回転数は、3バイトの半回転時間MTCS18を2バイトにリミットした変数MTCSKの逆数から算出される。
【0134】
詳述すると、毎分回転数rpmの単位時間(1min)の半分の時間30secを半回転時間MTCSKで割算することにより、1rpmを単位とする2バイト単位の変数NRPM、すなわち、エンジン回転数が算出され(NRPM=30sec/MTCSK)、このエンジン回転数が基本パラメータの1つとして各種の制御量演算処理に用いられるのである。
【0135】
次に、図10に示されるCCAS・RCAS判別サブルーチンについて説明する。このサブルーチンでは、まず最初に、ステップS800で、カムセンカウンタを0〜4にリミットする。このカムセンカウンタで計数されるカム角センサ41からのカムパルス(クラセン信号入力間のカムパルスの数)の数は、図19に示すように、正常状態の場合0〜3であるが、ノイズなどの影響により4以上の異常な計数値となるおそれがあるため、カムセンカウンタを0〜4にリミットして異常な状態を4で代表するのである。
【0136】
次に、ステップS801へ進み、カムセンカウンタ(の計数値)、気筒情報変数RCAS、クランク位置情報変数CCASから、5×4×2の組合わせ(カムセンカウンタが0〜4の5種類、気筒情報変数RCASが0〜3の4種類、クランク位置情報変数CCASが0,1と2の場合の2種類)に対する状態データがストアされている気筒・クランク位置状態マップCCHMAPを読む。
【0137】
この気筒・クランク位置状態マップCCHMAPは、図18(a)及び(b)に示すように、クランク位置情報変数CCASが0あるいは1の場合と、気筒情報変数RCASの変化点であるクランク位置情報変数CCASが2の場合とに分け、カムセンカウンタと気筒情報変数RCASの各組合わせの起こり得る全ての状態に対し、正常か異常か、確定して良いか推定すべきかを示す状態データがストアされており、現在の状態を評価し、次にとるべき状態を知ることができる。
【0138】
すなわち、通常の条件判断による処理に比較して大幅にプログラムを簡略化することができ、メモリ容量の節約、処理速度の向上を図ることができるとともに、仕様変更に対しても柔軟に対処することができる。
【0139】
この状態データは2ビットのデータであり、ビット0の値により確定か推定かを表わし、ビット1の値により正常か異常かを表わす。ビット0の値は、0のとき確定、1のとき推定を示し、図19からわかるように、カムセンカウンタが2,3の場合にのみ確定であって、それ以外は推定せざるを得ない状態である。また、ビット1の値は、0のとき正常、1のとき異常を示し、カムセンカウンタが3以下で、且つ、図14及び図19による組合せに合致する場合のみ正常であって、それ以外は異常な状態である。
【0140】
例えば、CCAS=0あるいは1、すなわち、ある気筒のBTDC97°〜10°に対し、カムセンカウンタが0で気筒情報変数RCASが0となる組合せは、図14及び図19からもわかるように、クランク位置を正常に推定すれば良い状態であるため、気筒・クランク位置状態マップCCHMAPの該当領域に2進数で01(正常推定)の状態データがストアされており、さらに、カムセンカウンタが1で気筒情報変数RCASが0となる組合せは、明らかに異常であって推定するしかない状態であるため、気筒・クランク位置状態マップCCHMAPの該当領域に2進数で11(異常推定)の状態データがストアされている。
【0141】
また、CCAS=2、すなわち、ある気筒のBTDC10°〜ATDC83°に対し、カムセンカウンタが3で気筒情報変数RCASが0となる組合せは、#1気筒のTDCを挟んだクランク位置と正常に確定できるため、気筒・クランク位置状態マップCCHMAPの該当領域に2進数で00(正常確定)の状態データがストアされており、さらに、カムセンカウンタが2で気筒情報変数RCASが0となる組合せは、明らかに異常ではあるがカムセン入力が2ヶある以上確定せざるを得ない状態であるため、気筒・クランク位置状態マップCCHMAPの該当領域に2進数で10(異常確定)の状態データがストアされている。
【0142】
そして、上記ステップS801で気筒・クランク位置状態マップCCHMAPから状態データを読込むと、ステップS802へ進み、エラーレベルECASが2でないか否か、すなわち、現在の状態が気筒判別のなされていない不明な状態であるか否かを調べ、ECAS=2のときには、ステップS803で気筒・クランク位置状態マップCCHMAPから読込んだ状態データのビット0が0か否か、すなわち確定状態か否かを調べ、確定状態のときにはステップS804へ進み、確定状態でなく推定状態であるときにはルーチンを抜けて確定状態となるまで待つ。
【0143】
一方、上記ステップS802でECAS≠2のときにはステップS804へ進んで、推定状態か否かを調べ、確定状態、推定状態に応じてステップS805以降の処理あるいはステップS812以降の処理へ進む。また、上記ステップS803において確定状態でステップS804へ進んだときには、ステップS805以降の処理へ進む。
【0144】
まず、ステップS805以降の処理について説明すると、このステップS805へ進んだときには、正常、異常に拘らず気筒判別がなされた確定状態であるため、図19のタイムチャートからもわかるように、今回のクラセン割込みはカムパルスが3ヶあるいは2ヶ入力された後のBTDC97°の割込みであるため、クランク位置情報変数CCASを0にする。
【0145】
次いで、ステップS806へ進んでカムセンカウンタが3でないか否かを調べ、カムセンカウンタが3でないとき、すなわちカムセンカウンタが2のときには、#2気筒の点火後であるため、ステップS807で気筒情報変数RCASを3にしてステップS809へ進み、カムセンカウンタが3のときには、#1気筒の点火後であるため、ステップS808で気筒情報変数RCASを1にしてステップS809へ進む。
【0146】
ステップS809では、更新したクランク位置情報変数CCAS、気筒情報変数RCAS、及び、カムセンカウンタをパラメータとして再び気筒・クランク位置状態マップCCHMAPから状態データを読込み、この状態データのビット1が1であるか、すなわち異常状態であるか否かを調べる。
【0147】
その結果、上記ステップS809において、状態データのビット1が1で異常状態と判定されるときには、クランク位置情報変数CCAS、気筒情報変数RCASの更新結果は不安の残る推定であるとしてステップS810でエラーレベルECASを1にしてルーチンを抜け、状態データのビット1が0であり正常状態であるときには、ステップS811でエラーレベルECASを0としてルーチンを抜ける。
【0148】
一方、ステップS812以降の処理では、ステップS812で、現在のクランク位置情報変数CCAS(前回のクラセン割込みで算出されたクランク位置情報変数CCAS)が2、すなわち、気筒情報変数RCASの変化点であるか否かを調べ、CCAS=2のときには、ステップS812からステップS813へ進んで、気筒情報変数RCASを1増加させ、ステップS814でクランク位置情報変数CCAS=0にしてステップS817へ進む。
【0149】
一方、上記ステップS812で、CCAS≠2のときには、上記ステップS812からからステップS815へ進んでカムセンカウンタが0でないか否かを調べ、カムセンカウンタが0でないときには、前述のステップS813へ分岐し、カムセンカウンタが0のときには、ステップS816でクランク位置情報変数CCASを1増加させ、ステップS817へ進む。
【0150】
ステップS817では、更新したクランク位置情報変数CCAS、気筒情報変数RCAS、及び、カムセンカウンタをパラメータとして再び気筒・クランク位置状態マップCCHMAPから状態データを読込んで異常状態であるか否かを調べ、状態データのビット1が0であり、正常状態であるときには、そのまま(現在のエラーレベルECAS=0のまま)ルーチンを抜ける。また、上記ステップS817で、状態データのビット1が1で異常状態のときには、ステップS818へ進み、クランク位置情報変数CCAS、気筒情報変数RCASの更新結果は不安の残る推定であるとしてエラーレベルECASを1にし、ルーチンを抜ける。
【0151】
【発明の効果】
以上説明したように請求項1記載の発明によれば、エンジン半回転毎に予め設定された複数のクランク角度位置に対応してクランクパルスを出力構成し、該クランクパルスが入力する都度、前回クランクパルスが入力してからのクランクパルス入力間隔時間を計測すると共に、該時間値を含めエンジン半回転当たりに入力されるクランクパルスと同数個のクランクパルス入力間隔時間を経時的に記憶し、これら時間値を加算してエンジン回転当たりの時間を算出するので、遅れなく常に最新のエンジン回転当たりの時間値を得ることができ、この時間値により現在の運転状況を迅速に把握することができて、エンジン回転当たりの時間値を用いて算出されるエンジン運転状況を表すデータが、常に遅れなく現在の運転状況を示すデータとして得られ、このデータにより現在の運転状況に基づいてより精密な制御を行うことができる。
請求項2記載の発明によれば、エンジンの回転当たりに入力されるクランクパルスと同数であってこれら各クランクパルス毎のクランク位置情報に対応付けたアドレスを有するテーブルを備える。そして、クランクパルスの入力毎に、テーブルの対応アドレスに前回クランクパルス入力から今回クランクパルス入力までの時間をストアする。そして、テーブルの各アドレスにストアされている時間を加算してエンジン回転当たりの時間を算出するので、上記請求項1記載の発明の効果に加え、非常に簡単な処理で各クランクパルスの入力毎に各クランクパルス間の時間の加算値を得ることができ、演算負担を軽減して実現できる。
【図面の簡単な説明】
【図1】クランク位置算出サブルーチンのフローチャート
【図2】0.5ms毎の定期割込み処理のフローチャート
【図3】クラセン割込み処理のフローチャート
【図4】ジョブ優先処理のフローチャート
【図5】ジョブ実行サブルーチンの部分フローチャート1
【図6】ジョブ実行サブルーチンの部分フローチャート2
【図7】ジョブ実行サブルーチンの部分フローチャート3
【図8】ジョブ実行サブルーチンの部分フローチャート4
【図9】半回転時間推定サブルーチンのフローチャート
【図10】CCAS・RCAS判別サブルーチンのフローチャート
【図11】クラセンタイマのオーバーフロー割込み処理のフローチャート
【図12】ジョブの実行状態を示す説明図
【図13】ジョブフラグの説明図
【図14】クランク位置変数の説明図
【図15】ジョブ実行中フラグとオーバーラップカウンタの変化を示す説明図
【図16】システムシフトバッファの説明図
【図17】クラセン間隔テーブルの説明図
【図18】気筒・クランク位置状態マップの説明図
【図19】クランク位置とエンジンの行程を示すタイムチャート
【図20】エンジン系の概略構成図
【図21】クランクロータとクランク角センサの正面図
【図22】カムロータとカム角センサの正面図
【図23】電子制御系の回路構成図
【符号の説明】
50 ECU
MTCSX クラセン間隔テーブル
MTCS18 半回転時間
CCAS クランク位置情報変数
[0001]
The present invention provides an engine for each input of a crank pulse representing a crank position. Half The present invention relates to an engine rotation time calculation method for calculating the latest time per rotation.
[0002]
[Prior art]
In recent years, microcomputers have been introduced into vehicles such as automobiles, and it has become possible to control engines, power trains and the like with high precision. As a result, in the development of vehicle control systems, the development of microcomputer software occupies a great deal of importance, and the efficiency of processing on the control algorithm has become an important issue.
[0003]
In the engine control system using the microcomputer described above, there are many processes for calculating the engine speed as one of the basic parameters, such as setting the fuel injection amount and setting the ignition timing. The engine speed is calculated based on crank pulse information representing the crank position output from the engine. (See Japanese Patent Laid-Open No. 4-171253)
In this case, the crank angle sensor is installed, for example, facing the outer periphery of the rotor connected to the crankshaft, and detects a plurality of protrusions or slits indicating a predetermined crank position on the outer periphery of the rotor and outputs them as crank pulses. The input interval time of this crank pulse is measured with a timer and the engine Half By converting the elapsed time per rotation, the engine speed can be calculated.
[0004]
[Problems to be solved by the invention]
However, conventionally, the input interval time of the crank pulse is measured by a timer and the engine Half When calculating the time per revolution, there are many systems that calculate based on the input interval time of the crank pulse measured at a specific crank angle. Half When calculating the time per revolution, the actual crank position will advance and it will not necessarily be based on the current driving situation. Half It does not become the time per rotation, and a slight error occurs in the engine control amount, which hinders precise control.
[0005]
In view of the above circumstances, the present invention provides an engine based on the latest data for each input of a crank pulse representing a crank position. Half An object of the present invention is to provide an engine rotation time calculation method that calculates the time per rotation, quickly grasps the current operation state, and enables precise control.
[0006]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 A crank pulse is output corresponding to a plurality of crank angle positions set in advance for each half rotation of the engine, and each time the crank pulse is input, the crank pulse input interval time since the previous crank pulse is input is measured. In addition, the crank pulse input interval time equal to the number of crank pulses input per half engine revolution including the time value is memorized over time, and these time values are added together. engine Half The time per rotation is calculated.
[0007]
The invention according to claim 2 is the invention according to claim 1, wherein Half A table having an address corresponding to the crank position information for each crank pulse, which is the same as the number of crank pulses input per revolution, is provided at the corresponding address in the table for each crank pulse input. Stores the time from input to the current crank pulse input and adds the time stored in each address of the above table to the engine Half The time per rotation is calculated.
[0008]
[Action]
The invention described in claim 1 A crank pulse is output corresponding to a plurality of crank angle positions set in advance for each half rotation of the engine, and each time the crank pulse is input, the crank pulse input interval time since the previous crank pulse is input is measured. In addition, the crank pulse input interval time equal to the number of crank pulses input per half engine revolution including the time value is memorized over time, and these time values are added together. engine Half Calculate the time per revolution.
[0009]
The invention according to claim 2 is an engine Half There is provided a table having the same number of crank pulses input per rotation and having an address associated with the crank position information for each crank pulse. And , Ku For each rank pulse input, the time from the previous crank pulse input to the current crank pulse input is stored in the corresponding address of the table. And add the time stored in each address of the table and engine Half Calculate the time per revolution.
[0010]
【Example】
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a flowchart of a crank position calculation subroutine, FIG. 2 is a flowchart of periodic interrupt processing every 0.5 ms, FIG. 3 is a flowchart of classene interrupt processing, and FIG. 4 is job priority processing. 5 is a partial flowchart 1 of the job execution subroutine, FIG. 6 is a partial flowchart 2 of the job execution subroutine, FIG. 7 is a partial flowchart 3 of the job execution subroutine, FIG. 8 is a partial flowchart 4 of FIG. FIG. 10 is a flowchart of a CCAS / RCAS discrimination subroutine, FIG. 11 is a flowchart of an overflow interrupt process of a classen timer, FIG. 12 is an explanatory diagram showing a job execution state, and FIG. 13 is an explanation of a job flag. Figure, 14 is an explanatory diagram of a crank position variable, FIG. 15 is an explanatory diagram showing changes in a job execution flag and an overlap counter, FIG. 16 is an explanatory diagram of a system shift buffer, FIG. 17 is an explanatory diagram of a classen interval table, and FIG. FIG. 19 is a time chart showing the crank position and the stroke of the engine, FIG. 20 is a schematic configuration diagram of the engine system, FIG. 21 is a front view of the crank rotor and the crank angle sensor, and FIG. The front view of a cam rotor and a cam angle sensor, FIG. 23 is a circuit block diagram of an electronic control system.
[0011]
In the engine control system of this embodiment, an engine system shown in FIG. 20 is controlled by an electronic control unit (ECU) 50 having a microcomputer shown in FIG. 23 as a core, and fuel injection control, ignition timing control, and the like are performed. An operating system (OS) based on a new concept is installed in the microcomputer of the ECU 50, and by this OS, signal input processing from each sensor, engine speed calculation processing, intake air amount calculation processing, fuel injection amount setting Jobs for each control item such as processing and ignition timing setting processing are managed and executed efficiently.
[0012]
First, the engine system equipment configuration controlled by the ECU 50 will be described.
[0013]
As shown in FIG. 20, the engine 1 (showing a horizontally opposed four-cylinder engine in the figure) has an intake manifold 3 communicated with an intake port 2 a of a cylinder head 2, and an air chamber 4 is disposed upstream of the intake manifold 3. The throttle passage 5 is communicated with each other. An air cleaner 7 is attached to the upstream side of the throttle passage 5 via an intake pipe 6, and the air cleaner 7 communicates with an air intake chamber 8 that is an intake air intake port.
[0014]
An exhaust pipe 10 communicates with the exhaust port 2b via an exhaust manifold 9, and a catalytic converter 11 is interposed in the exhaust pipe 10 and communicates with a muffler 12. On the other hand, a throttle valve 5 a is provided in the throttle passage 5, an intercooler 13 is interposed in the intake pipe 6 immediately upstream of the throttle passage 5, and a resonator is provided downstream of the air cleaner 7 in the intake pipe 6. A chamber 14 is interposed.
[0015]
Further, an idle speed control valve (ISCV) 16 is interposed in a bypass passage 15 that connects the resonator chamber 14 and the intake manifold 3 to bypass the upstream side and the downstream side of the throttle valve 5a. Further, a check valve 17 is provided immediately downstream of the ISCV 16 and is opened when the intake pressure is negative, and is supercharged by the turbocharger 18 and closed when the intake pressure becomes positive. Yes.
[0016]
In the turbocharger 18, a compressor is interposed downstream of the resonator chamber 14 in the intake pipe 6, and a turbine is interposed in the exhaust pipe 10. Further, a wastegate valve 19 is interposed at the turbine housing inlet of the turbocharger 18, and a wastegate valve actuating actuator 20 is connected to the wastegate valve 19.
[0017]
The waste gate valve actuating actuator 20 is divided into two chambers by a diaphragm, one of which forms a pressure chamber communicating with the waste gate valve control duty solenoid valve 21, and the other opens the waste gate valve 19 in the closing direction. A spring chamber is formed in which an urging spring is stored.
[0018]
The waste gate valve control duty solenoid valve 21 is interposed in a passage communicating the resonator chamber 14 and the compressor downstream of the turbocharger 18 of the intake pipe 6, and the duty of the control signal output from the ECU 50. In accordance with the ratio, the pressure on the resonator chamber 14 side and the pressure on the downstream side of the compressor are adjusted and supplied to the pressure chamber of the actuator 20 for operating the wastegate valve.
[0019]
That is, the ECU 50 controls the waste gate valve controlling duty solenoid valve 21 and operates the waste gate valve actuating actuator 20 to adjust the exhaust gas relief by the waste gate valve 19, whereby the turbocharger 18. The supercharging pressure by is controlled.
[0020]
An absolute pressure sensor 22 communicates with the intake manifold 3 via a passage 23, and the intake pipe pressure / atmospheric pressure selectively communicates the absolute pressure sensor 22 with the intake manifold 3 or the atmosphere. A switching solenoid valve 24 is interposed.
[0021]
Further, an injector 25 is provided immediately upstream of each intake port 2a of each cylinder of the intake manifold 3, and an ignition plug 26a is attached to each cylinder of the cylinder head 2 to expose the tip of the cylinder 25 in the combustion chamber. An igniter 27 is connected to an ignition coil 26b that is connected to the ignition plug 26a.
[0022]
Fuel is pumped into the injector 25 from an in-tank type fuel pump 29 provided in the fuel tank 28 through a fuel filter 30 and is regulated by a pressure regulator 31.
[0023]
Further, an intake air amount sensor 32 such as a hot wire type or a hot film type is interposed immediately downstream of the air cleaner 7 of the intake pipe 6, and a throttle opening sensor 33a and an idle switch 33b are connected to the throttle valve 5a. Are continuously provided.
[0024]
Further, a knock sensor 34 is attached to the cylinder block 1a of the engine 1, and a cooling water temperature sensor 36 is exposed to a cooling water passage 35 communicating with both the left and right banks of the cylinder block 1a, whereby the exhaust manifold 10 of the exhaust pipe 10 is exposed. The O2 sensor 37 is exposed to the nine gathering parts.
[0025]
A crank rotor 38 is mounted on the crankshaft 1b supported by the cylinder block 1a, and a crank angle sensor 39 made of an electromagnetic pickup or the like is provided on the outer periphery of the crank rotor 38. Further, a cam angle sensor 41 for discriminating a cylinder made up of an electromagnetic pickup or the like is provided on the cam rotor 40 connected to the camshaft 1c of the engine 1. The crank angle sensor 39 and the cam angle sensor 41 are not limited to magnetic sensors such as electromagnetic pickups, but may be optical sensors.
[0026]
As shown in FIG. 21, the crank rotor 38 has protrusions 38a, 38b, and 38c formed on the outer periphery thereof. The protrusions 38a, 38b, and 38c are connected to the cylinders (# 1, # 2, and # 3, # 3). 4) before compression top dead center (BTDC) θ1, θ2, θ3. In this embodiment, θ1 = 97 ° CA, θ2 = 65 ° CA, and θ3 = 10 ° CA.
[0027]
Each protrusion of the crank rotor 38 is detected by the crank angle sensor 39, and as shown in FIG. 19, crank pulses of BTDC 97 °, 65 °, and 10 ° are generated every 1/2 engine rotation (every 180 ° CA). Is output. Then, the input interval time of the crank position detection signal from the crank angle sensor 39 is timed by a timer, and the engine half rotation Hit The engine speed is calculated in terms of the elapsed time, i.e., half rotation time.
[0028]
The projection 38b serves as a reference crank angle for setting the ignition timing, and the projection 38c serves as a reference crank angle for the start-up injection start timing and a crank angle indicating the fixed ignition timing at the start-up.
[0029]
Further, as shown in FIG. 22, projections 40a, 40b, and 40c for cylinder discrimination are formed on the outer periphery of the cam rotor 40, and the projection 40a is after compression top dead center (ATDC) θ4 of the # 3 and # 4 cylinders. The protrusion 40b is formed of three protrusions, and the first protrusion is formed at the position of ATDCθ5 of the # 1 cylinder. Further, the protrusion 40c is formed by two protrusions, and the first protrusion is formed at the position of ATDCθ6 of the # 2 cylinder. In this embodiment, θ4 = 20 ° CA, θ5 = 5 ° CA, and θ6 = 20 ° CA.
[0030]
Then, when each projection of the cam rotor 40 is detected by the cam angle sensor 41 and the combustion stroke order of each cylinder is set to # 1 → # 3 → # 2 → # 4, this combustion stroke order and the cam angle sensor Cylinder discrimination is performed based on a pattern (see FIG. 19) with a value obtained by counting the cam pulses from 41 with a counter.
[0031]
On the other hand, the ECU 50 shown in FIG. 23 is composed mainly of two computers: a main computer 51 that performs fuel injection control, ignition timing control, and the like, and a dedicated sub-computer 52 that performs knock detection processing. A constant voltage circuit 53 for supplying a power source and various peripheral circuits are incorporated.
[0032]
The constant voltage circuit 53 is connected to a battery 55 via a relay contact of an ECU relay 54, and a relay coil of the ECU relay 54 is connected to the battery 55 via an ignition switch 56. The constant voltage circuit 53 is directly connected to the battery 55, and the fuel pump 29 is connected via a relay contact of the fuel pump relay 57.
[0033]
That is, the constant voltage circuit 53 supplies the control power when the ignition switch 56 is turned on and the relay contact of the ECU relay 54 is closed, and when the ignition switch 56 is turned off. Supply power for backup.
[0034]
The main computer 51 includes a CPU 58 (hereinafter referred to as a main CPU 58), a ROM 59, a RAM 60, and a backup RAM 61 that retains data by being supplied with backup power from the constant voltage circuit 53 even when the ignition switch 56 is turned off. The microcomputer includes a counter / timer group 62, a serial communication interface SCI 63, and an I / O interface 64 connected via a bus line 65.
[0035]
The counter / timer group 62 includes various counters such as a free-run counter, a cam angle sensor (hereinafter, abbreviated as “camsen” as appropriate) signal input counting counter, a fuel injection timer, an ignition timer, and a 0 described later. Various timers such as a periodic interrupt timer for generating a periodic interrupt every 5 ms, a crank angle sensor (hereinafter, abbreviated as “classane” as appropriate) signal input timing timer, and a watchdog timer for system abnormality monitoring The timers are generically referred to for convenience, and various other software counters / timers are used in the main computer 51.
[0036]
Similarly to the main computer 51, the sub computer 52 includes a CPU 71 (hereinafter referred to as sub CPU 71), a ROM 72, a RAM 73, a counter / timer group 74, an SCI 75, and an I / O interface 76 via a bus line 77. The main computer 51 and the sub computer 52 are connected to each other via a serial communication line via the SCIs 63 and 75.
[0037]
The I / O interface 64 of the main computer 51 includes, as input ports, an intake air amount sensor 32, a throttle opening sensor 33a, a water temperature sensor 36, an O2 sensor 37, an absolute pressure sensor 22, a vehicle speed sensor 42, and a battery 55. Are connected via an 8-channel input A / D converter 66, and an idle switch 33b, a crank angle sensor 39, and a cam angle sensor 41 are connected, and a starter switch for detecting a start state 43 is connected.
[0038]
In this embodiment, the A / D converter 66 uses inputs for seven channels, and the remaining one channel is reserved.
[0039]
An igniter 27 is connected to the output port of the I / O interface 64, and further, via the drive circuit 67, the ISCV 16, the injector 25, the relay coil of the fuel pump relay 57, and the duty for controlling the wastegate valve A solenoid valve 21 and an intake pipe pressure / atmospheric pressure switching solenoid valve 24 are connected.
[0040]
On the other hand, the I / O interface 76 of the sub-computer 52 is connected to the input port with a crank angle sensor 39 and a cam angle sensor 41, and knocks via an A / D converter 78, a frequency filter 79, and an amplifier 80. A sensor 34 is connected, and after the knock detection signal from the knock sensor 34 is amplified to a predetermined level by the amplifier 80, a necessary frequency component is extracted by the frequency filter 79, and the A / D converter 78 is extracted. Is converted into a digital signal and input.
[0041]
The main computer 51 processes detection signals from the sensors and calculates the fuel injection pulse width, ignition timing, and the like. That is, the intake air amount is calculated from the output signal of the intake air amount sensor 32, the fuel injection amount corresponding to the intake air amount is calculated based on various data stored in the RAM 60 and the backup RAM 61, the ignition timing, etc. Is calculated.
[0042]
A drive pulse width signal corresponding to the fuel injection amount is output to the injector 25 of the corresponding cylinder via the drive circuit 67 at a predetermined timing to inject fuel, and an ignition signal is sent to the igniter 27 at a predetermined timing. Is output to ignite the ignition plug 26a of the corresponding cylinder.
[0043]
As a result, the air-fuel mixture supplied to the corresponding cylinder explodes and burns, and the oxygen concentration in the exhaust gas is detected by the O2 sensor 37 facing the assembly portion of the exhaust manifold 9, and this detection signal is waveform-shaped. The main CPU 58 compares with the reference voltage (slice level) to determine whether the engine air-fuel ratio is on the rich side or the lean side with respect to the target air-fuel ratio, so that the air-fuel ratio becomes the target air-fuel ratio. Feedback controlled.
[0044]
On the other hand, the sub-computer 52 sets a sample section of the signal from the knock sensor 34 based on the engine speed and the engine load, and performs A / D conversion of the signal from the knock sensor 34 at a high speed in this sample section. The vibration waveform is faithfully converted into digital data, and the presence or absence of knocking is determined.
[0045]
The output port of the I / O interface 76 of the sub computer 52 is connected to the input port of the I / O interface 64 of the main computer 51, and the knock determination result at the sub computer 52 is sent to the I / O interface 76. Is output. When the determination result that knocking has occurred is output from the sub-computer 52, the main computer 51 reads knock data from the serial communication line via the SCI 63, and immediately determines the ignition timing of the corresponding cylinder based on the knock data. Delay and avoid knocks.
[0046]
In such engine control, the main computer 51 has various programs for each item such as signal input processing from each sensor, engine speed calculation, intake air amount calculation, fuel injection amount calculation, and ignition timing calculation. It is efficiently executed under the control of two OSs. This OS has various management functions for vehicle control and an internal strategy closely attached to this management function, and systematically combines various jobs.
[0047]
As the management function of the OS,
(1-1) Job priority processing
(1-2) Split file support for each job by section definition
(1-3) Stack usage monitoring function
(1-4) Abnormal interrupt operation monitoring function
(1-5) Standard map and standard work memory settings that do not create unique restrictions for each job
In addition to improving the development environment of the control strategy, the limited CPU capability can be maximized, and the equal time interval processing that is the basis of the digital control theory can be achieved as much as possible.
[0048]
Equal time interval processing is based on periodic interrupts every 0.5 ms, and five types of equal interval interrupt jobs are prepared every 2, 4, 10, 50, and 250 ms, and processing synchronized with engine rotation As an example, a high-priority classen job (hereinafter simply referred to as a classen job) that is immediately interrupted by crank angle signal input and an interrupt that is executed by crank angle signal input when there is no other job with a higher priority. A low-priority classen job with low urgency is available.
[0049]
Each of these jobs is given a priority level of 7 to 1 from the high side to the low side in the order of classel job> 2 ms job> 4 ms job> 10 ms job> low priority classen job> 50 ms job> 250 ms job. As shown in FIG. 12, the low-speed job is divided and processed for the high-speed job, and multiple wait processing for each job is performed.
[0050]
In addition, each program working under the OS is arranged in order for each function-specific management area, ie, a section area, and each section area is named by a section declaration for each function. The main section area used on each strategy file side is
○ Variable declaration area
○ Self-file name, automatic recording area when creating a file
○ Setting data area
○ Classen job area
○ 2ms job area
○ 4ms job area
○ 10ms job area
○ Low priority classen job area
○ 50ms job area
○ 250ms job area
○ Reset initialization job area
○ Initialization initialization job area
○ Background job area
○ Program body area
It is possible to develop a program by dividing a file for each function, and to make a structured description of the program possible.
[0051]
In addition, the above OS has an internal strategy closely related to the above management functions.
(2-1) A / D conversion processing
(2-2) Calculation of various information related to crank position
(2-3) Simulation function for debugging (engine rotation and A / D conversion)
(2-4) Setting the ignition timer
(2-5) Set fuel injection timer
In addition, various service routines related to these functions are prepared in each job.
[0052]
Conventionally, such a function has been achieved at each job level, but in this system, all the A / D conversion results, crank position information, and engine speeds prepared on the OS side and processed on the OS side are provided. Based on the above, when the fuel injection amount, the ignition timing, etc. are set in each job on the user side, these instruction values are set in the fuel injection timer and the ignition timer by the OS.
[0053]
Next, the job processing function in the main computer 51 will be described with reference to the flowcharts of FIGS. Since the sub computer 52 is a computer dedicated to knock detection processing, the description of its operation is omitted.
[0054]
First, when the ignition switch 56 is turned on and the system is powered on, a reset interrupt associated with the reset is started, various initializations are performed, and a periodic interrupt timer for starting a periodic interrupt every 0.5 ms is provided. It is started, and a classen interrupt that is started every time a signal is input from the crank angle sensor 39 (6 times per engine revolution for BTDC 97 °, 65 °, 10 ° CA) is permitted. Become.
[0055]
Then, on this background job, a 7-level job is preferentially processed by a periodic interrupt every 0.5 ms and a classen interrupt of 6 times per engine revolution. In these two interrupts, each process is executed and then jumped to a common address to execute the job priority process.
[0056]
The reset interrupt is also triggered by a factor that does not occur during normal operation, such as when division by zero is performed in an internal operation or when an infinite loop occurs.
[0057]
First, the periodic interruption every 0.5 ms shown in FIG. 2 will be described. In this periodic interrupt, the OS work area is set in step S100, the watchdog timer is initialized in step S101, the process proceeds to step S102, and the P-RUN flag is inverted once every 20 times, that is, every 10 ms. To do. The P-RUN flag is a flag for preventing the system from being automatically reset by a protection circuit (not shown). As long as the system operates normally and is reversed every predetermined time (every 10 ms), the above protection is performed. Circuit operation is blocked.
[0058]
Next, the process proceeds to step S103, and the switch output is transferred. This switch output is the ON / OFF value of the bit written in the memory in each job. Each job does not directly output to the output port of the I / O interface 64, and the OS side stores the memory every 0.5 ms. Transfer the value to the output port.
[0059]
In step S104, an A / D conversion subroutine is executed to make various settings related to A / D conversion. In step S105, a job flag creation subroutine is executed to execute 2, 4, 10, 50, After creating a job flag JB_FLG indicating each job interrupt request every 250 ms, A / D conversion is started in step S106.
[0060]
In the A / D conversion, basically, the 8-channel input of the A / D converter 66 is processed in a predetermined conversion order every 0.5 ms, and all inputs are converted in a cycle of 4 ms. However, one specific channel synchronizes every 90 ° crank angle (with a time accuracy of 0.5 ms) in order to A / D-convert the suction pipe pressure that generates rotational pulsation, and interrupts the conversion order. The process is performed in the form of an oval, and the subsequent input order is delayed by one.
[0061]
When the engine speed is 3750 rpm or higher, the last input in the A / D conversion is completely stopped, and when the engine speed is 7500 rpm or higher, the second input from the last is also stopped. Faster changes such as air temperature and intake air amount are set first, and cooling water temperature and voltage are set so that later changes are later, and the last A / D conversion order is set to crank synchronization input. Therefore, there is no particular problem.
[0062]
As shown in FIG. 13, the job flag JB_FLG is assigned with each bit of a 1-byte variable as a flag corresponding to each job, and a plurality of job requests can be made simultaneously. Bits 1 to 7 of this 1-byte variable correspond to priority levels 1 to 7, and are assigned to flags of 250 ms job, 50 ms job, low priority classen job, 10 ms job, 4 ms job, 2 ms job and classen job, respectively. Yes. When a predetermined bit is set, a corresponding job interrupt request with a priority level is made. Bit 0 is assigned to a background job flag and is not normally referred to.
[0063]
In step S105, the job flag JB_FLG is created by the job flag creation subroutine. After the A / D conversion is started in step S106, the process proceeds to step S107, and the bit corresponding to any job in the job flag JB_FLG is set. Find out if you are standing.
[0064]
As a result, when no bit of the job flag JB_FLG is set, there is no request from any job, the interrupt is terminated, and when any bit of the job flag JB_FLG is set, the process proceeds to step S108, It is checked whether or not there is a flag below the level (a state in which a job of a predetermined priority level is being executed when this periodic interrupt is executed).
[0065]
If there is no flag below the current level in step S108, the process jumps to the job priority processing of FIG. 4 indicated by the label WAR_JB. If there is a flag below the current level, the overlap of the level below the current level is found in step S109. Increase the counter OLC by one.
[0066]
The overlap counter OLC is a counter for storing job requests, and is assigned 1 byte for each priority level. The overlap counter OLC is incremented when a job is requested by the job flag JB_FLG and decremented when a job is completed. In other words, by storing job requests with a counter, it is possible to cope with multiple requests for jobs.
[0067]
Next, the process proceeds from step S109 to step S110 to check whether or not there is a flag higher than the current level. When there is no flag higher than the current level, the routine is terminated and the interrupt is terminated. , Jump to the job priority processing of the label WAR_JB.
[0068]
On the other hand, in contrast to the periodic interrupt every 0.5 ms, when the OS work area is set in step S200, the subroutine for calculating the crank position and half rotation time described later is executed in step S201. Then, a crank position variable for determining the current crank position and a half rotation time which is the sum of the latest three classane intervals are calculated.
[0069]
The crank position variable is a system variable prepared in the OS. As shown in FIG. 14, the crank positions for the cylinders # 1 to # 4 are divided into 12 states by 97 °, 65 °, and 10 ° CA. Represents the current crank position.
[0070]
That is, for each cylinder, a crank position information variable S_CCAS indicating the order of classane input with numerical values of 0, 1, 2 is assumed to be 0 for # 1, # 1 for cylinder # 2, 2 for cylinder # 2, and 3 for cylinder # 4. The current crank position is represented by three variables: a cylinder information variable S_RCAS indicating the combustion order of the cylinders, and an overall position variable S_ACAS that comprehensively represents the classene order and the cylinder order with numerical values of 0 to 11, and the crank position is confirmed. The crank position discriminating state is represented by an error level S_ECAS where 0 is a normal discriminating state, 1 is an inferred estimated state where the discriminating result is not consistent, and 2 is an unknown state. In FIG. 14, S_ indicating a system variable is omitted.
[0071]
Next, when the process proceeds from step S201 to step S202, the code stored in the accumulator A is read to determine whether the crank position determination is normally completed or cannot be determined in the crank position / half rotation time calculation subroutine. Check (error code 1, normal end code 0).
[0072]
In step S202, when the value of the accumulator A is 1 and the crank position cannot be determined, the interruption is terminated, and when the value of the accumulator A is 0 and the crank position is normally determined. In step S203, the engine stall flag is canceled.
[0073]
The engine stall flag is a flag indicating that the engine is in an engine stall state, and is set by an engine stall routine prepared for a 50 ms job when the time interval is 0.5 sec or more (approximately 30 rpm or less). The engine is cleared by this classene interrupt to cancel the engine stall state.
[0074]
Next, in step S204, an ignition timer setting subroutine is executed, and the ignition timer is set according to the ignition schedule created based on the ignition timing instruction value set on the user job side. This ignition schedule is a structure variable whose members are a dwell start time, a dwell on waiting time, a dwell off waiting time, and the like. A creation routine is prepared during a 10 ms job, and an ignition sequence is determined according to this ignition schedule.
[0075]
Next, in step S205, a fuel injection timer setting subroutine is executed, and the fuel injection start timing and the like are set in the fuel injection timer for the fuel injection amount instruction value (injection width for each cylinder) set on the user job side. Then, the process proceeds to step S206.
[0076]
In step S206, it is determined whether or not the current job level at which this classen is executed is the own job level. If the current job level is the classen job's own level, in steps S207 and S208, the classen job, low priority If the current job level is not the Krasen job level, whether or not the current job level is equal to or higher than the low-priority classen job level is determined in step S209. Check for no.
[0077]
When the current job level is equal to or higher than the low-priority class job, the process proceeds from step S209 to step S210. When the overlap counter OLC of the low-priority class job is incremented by 1, the job flag of the clasen job is displayed in step S211. And jump to the job priority processing of the label WAR_JB.
[0078]
On the other hand, if the current job level is not equal to or higher than the low-priority class job at step S209, the process proceeds from step S209 to step S212. When the job flag of the class job is set, the job flag of the low-priority class job is set at step S213. Set and jump to the job priority processing of the label WAR_JB.
[0079]
In this job priority process, when the job level JB_LEV, which is a 1-byte variable indicating the job priority level, is incremented by 1 in step S300, the process proceeds to step S301 to check whether a job flag corresponding to this priority level is set. . When the job flag is not set, the process returns to step S300 to further increase the job level JB_LEV by one. When the job flag is set, the process proceeds to step S302, and the overlap counter OLC of the job with the job flag is set. The initial value is changed from 0 to 1, and the process proceeds to step S303.
[0080]
In step S303, it is checked whether or not there is a higher job flag. When there is a higher job, the process returns to step S300 and the above processing is repeated, and when there is no higher job, the process proceeds to step S304. When the job execution flag JB_RUN is set, in step S305, the highest-level job is executed by a job execution subroutine described later.
[0081]
The job execution flag JB_RUN is a flag that is set at the start of job execution and cleared at the end of execution. By this flag, a job interrupted by a job having a higher priority is identified in the middle of processing. Can do.
[0082]
For example, as shown in FIG. 15, when a 10 ms job with JB_LEV = 4 is executed and an interrupt request for a 2 ms job with JB_LEV = 6 is made, the processing of the 10 ms job is interrupted, and the 2 ms job with a higher priority is JB_RUN = 1 and OLC = 1 are set and executed. If an interrupt request for a 4 ms job with JB_LEV = 5 occurs during the processing of this 2 ms job, the 4 ms job is accepted with JB_RUN = 0 and OLC = 1, but is not executed but is in a standby state. It becomes.
[0083]
Thereafter, when the job execution by the job execution subroutine is completed, the process proceeds from step S305 to step S306, the overlap counter OLC is decremented by 1, and it is checked in step S307 whether or not the overlap counter OLC has become zero. As a result, when the overlap counter OLC is not zero and there are multiple job interrupt requests at the same priority level, the process returns to step S305 to repeatedly execute the job, and when the overlap counter OLC becomes zero, Proceeding from step S307 to step S308, the job execution flag JB_RUN is cleared.
[0084]
Next, proceeding to step S309, when the job level JB_LEV is lowered by 1 and moved to the next job level, it is checked in step S310 whether the job level JB_LEV has become zero. When the job level JB_LEV is zero, this interrupt is terminated. When the job level JB_LEV is not zero, the process proceeds to step S311 to check whether or not the overlap counter OLC is zero.
[0085]
When the overlap counter OLC is zero in step S311, there is no job request at this level, so the process returns from step S311 to step S309, the job level JB_LEV is further lowered by 1 and the same processing is repeated, and the overlap is repeated. When the counter OLC is not zero, the process proceeds to step S312 to check whether or not the job execution flag JB_RUN is set at this job level.
[0086]
When the job execution flag JB_RUN is set in step S312, the job is being executed before the interruption, so the interruption is ended and the process returns to the job before the interruption, and the job execution flag JB_RUN must be set. For example, the process returns to step S304, the job at this level is executed, and the same processing is repeated.
[0087]
That is, in FIG. 15, when a 2 ms job with JB_LEV = 6 is completed and OLC = 0 and JB_RUN = 0, the job level is lowered by one, and a 4 ms job with JB_LEV = 5 becomes JB_RUN = 0, OLC = 1. From the standby state, JB_RUN = 1 is set and executed. Further, when the 4 ms job is completed, the process proceeds to JB_LEV = 4, and the processing of the 10 ms job suspended by the 2 ms job and the 4 ms job is resumed from the state of JB_RUN = 1 (during job execution).
[0088]
In this way, the job flag JB_FLG that informs the priority level and execution timing of each job is created using periodic interrupts and classene interrupts every 0.5 ms as the basic timing, so that it is possible to perform processing at equal intervals and engine rotation as accurately as possible. Synchronous processing is realized and each job can be processed efficiently. Furthermore, since the multiple request of the job is stored by the overlap counter OLC regardless of the job flag JB_FLG that is updated for each interrupt as the basic timing, the processing time of a certain job should be prolonged and the same job should be executed again. Even when the timing comes, it is possible to continue the process as much as possible without giving up the process halfway.
[0089]
Next, the job execution subroutine of FIGS. 5 to 8 will be described.
[0090]
First, in step S500, it is checked whether or not the job to be executed is a classen job by referring to the job flag JB_FLG. If it is not a classen job, the process branches to the label ALJ10. If it is a classen job, the process proceeds to step S501. Check whether or not there is a discrimination.
[0091]
When the cylinder discrimination is not performed, the routine is directly exited and the job is not executed. When the cylinder discrimination is performed, the process proceeds from step S501 to step S502, and the multiple wait state is made with reference to the value of the overlap counter OLC. It is examined whether or not.
[0092]
In the above step S502, when not in the multiple wait state, the process proceeds to step S503, and the system variable S_ACAS (crank total position variable) calculated for each classen interrupt is set as the user variable ACAS. Branch, the user variable ACAS is incremented by one and the remainder divided by 12 is taken as a new user variable ACAS, and this user variable ACAS is set to 0, 1, 2,..., 11, 0, 1,. Will be updated.
[0093]
That is, the classen job and the low-priority classen job may be delayed by being disturbed by the job or the high-priority job, but the classen interrupt is executed accurately in synchronization with the crank angle sensor signal, and the system variable S_ACAS is set in the job. Updated regardless of delay.
[0094]
Therefore, even if you know information related to the cylinder and crank position by referring to the system variable S_ACAS in the job and try to work according to this information, if you are delayed by other jobs, It becomes impossible to know information related to the cylinder and the crank position corresponding to his / her work. For this reason, in the case of a class request job and a low-priority class job, the system variable S_ACAS for OS is taken as a user variable ACAS when not in a multiple waiting state, and this user variable ACAS is updated every time a job is executed. In addition, information related to the cylinder and the crank position corresponding to itself is obtained so that proper processing is performed.
[0095]
Thereafter, the process proceeds from step S503 or step S504 to step S505. When the work area of the job is set, level zero interruption is permitted in step S506, and the process proceeds to the classen job section in step S507. Then, the processing linked to this classen job section is executed, and in step S508, interrupts are prohibited and the routine is exited.
[0096]
Next, in step S500, when the job to be executed is not a class job, it is checked in step S510 of label ALJ10 whether it is not a 2ms job. If it is a 2ms job, the work area of the job is set in step S511. In step S512, a zero level interrupt is permitted, and in step S513, the process moves to the 2 ms job section. Then, the job body (routine based on the control strategy on the user side or service routine prepared on the OS side) linked to this section is executed, and in step S514, the interrupt is prohibited and the routine is exited.
[0097]
On the other hand, if the job to be executed is not a 2 ms job in step S510, the process branches from step S510 to step S520 to check whether the job to be executed is a 4 ms job. If the job is not a 4 ms job, the process branches to the label ALJ30. If the job is a 4 ms job, the job work area is set in step S521, and the process proceeds to step S522. The 4 ms job is an A / D conversion use job, and uses A / D conversion data via a system shift buffer SSHB described later.
[0098]
In step S522, a zero level interrupt is permitted, and then in step S523, the switch input is read, and in step S524, the section moves to the 4 ms job to execute the linked job body. Thereafter, when exiting from the 4 ms job section, interrupt is prohibited in step S525, and the process proceeds to step S526 to shift the system shift buffer SSHB and exit the routine.
[0099]
As shown in FIG. 16, the system shift buffer SSHB includes each memory of head offset addresses 0, +8, +16, +24, +32, +34, +36, and +38 in which each A / D conversion result of 8 channels is stored. And 1 word of memory at the first offset address -2 address where the A / D conversion result of crank synchronization every 4 ms is stored, and one A / D conversion result executed every 0.5 ms is 1 word Stored at (2 bytes).
[0100]
From the first offset address 0, it is a four-stage shift memory, and the A / D conversion results for every 90 ° CA are stored, and the latest four data (one rotation) can be referred to from the job. The head offset addresses +32, +34, +36, and +38 are each one-word memory, and when the smoothing function is selected, a value obtained by weighted averaging of the A / D conversion results is stored to eliminate noise. The accuracy can be improved, and the data in these memories can be used for low-speed jobs.
[0101]
Also, from each head offset address +8, +16, +24, it is a memory of 4 words each and is used in a 4 ms job. Each of these memories stores the latest A / D conversion result from the beginning and stores it in the word after the overlap counter OLC value of the 4 ms job. When the 4 ms job is executed, the data is read from the beginning word and the job As the data ends, the data of each subsequent word is sequentially shifted to the word in the head direction, so that the FIFO buffer is read from the previously stored data.
[0102]
In other words, the A / D conversion is accurately performed at a cycle of 4 ms by a periodic interrupt every 0.5 ms, but the 4 ms job may be delayed due to a high priority job. Therefore, the FIFO buffer is used for A / D conversion delivery, and the data in each FIFO buffer is sequentially shifted in step S526 after referring to the data in each of the +8, +16, and +24 FIFO buffers in a 4 ms job.
[0103]
On the other hand, when the job to be executed is not a 4 ms job and branches to the label ALJ30 in step S520, it is checked in step S530 whether the job to be executed is a 10 ms job. If it is a 10 ms job, in step S531. If the work area of the job is set and level zero interruption is permitted in step S532, in step S533, the section moves to the 10 ms job, the job body is executed, and interruption is disabled in step S534 and the routine is exited.
[0104]
In the section of the 10 ms job, a service routine for calculating the engine speed from the half rotation time, a service routine for creating the ignition schedule described above, and the like are prepared on the OS side.
[0105]
If the job to be executed is not a 10 ms job in step S530, the process branches from step S530 to step S540 to check whether the job to be executed is a low-priority classen job. If it is not a low priority classen job, the process branches from step S540 to the label ALJ50. If the job to be executed is a low priority classen job, the process proceeds from step S540 to step S541. Check if there is any.
[0106]
When the current state is not the multiple wait state, the process proceeds from step S541 to step S542, and the system variable S_ACAS (crank total position variable) is set as the user variable ACAS, and the process proceeds to step S544. From step S543, the user variable ACAS is incremented by one, and the remainder obtained by dividing by 12 is taken. Then, the processing proceeds to step S544.
[0107]
In step S544, the job work area is set, and in step S545, level zero interrupts are enabled. In step S546, the section moves to the low-priority classen job section. After executing the job itself, interrupts are disabled in step S547. And exit the routine.
[0108]
Further, at label ALJ50, it is checked whether or not the job to be executed in step S550 is a 50 ms job. If the job is a 50 ms job, the process proceeds to step S551, the work area of the job is set, and the process proceeds to step S552.
[0109]
In step S552, if level zero interrupt is permitted, in step S553, the process moves to the 50 ms job section, and the engine prepared engine processing routine, cylinder specific ignition timing retard routine, fuel injection start timing setting routine, etc. are executed. In addition, a routine based on the control strategy on the user side is executed. Then, after completion of the job, interrupt is prohibited in step S554, and the routine is exited.
[0110]
On the other hand, when the job to be executed in step S550 is not a 50 ms job, the process branches from step S550 to step S560, and when the work area of the job is set, in step S561, a level zero interrupt is permitted, and the process proceeds to step S562. The process proceeds to the section area of the 250 ms job, and after executing the job body, interrupt is disabled in step S563 and the routine is exited.
[0111]
In the above-described job priority processing, it is necessary to accurately grasp the crank position at all times. For each classene interrupt, the crank position calculation subroutine shown in FIG. 1 is executed, and the crank position variables S_CCAS, S_RCAS, S_ACAS, S_ECAS is calculated, and a half rotation time is calculated. In the following description, S_ indicating a system variable is omitted from the crank position variable.
[0112]
In this crank position calculation subroutine, first, in step S600, the lower 2 bytes of the classene timer are stored in the lower 2 bytes of the soft timer. This classen timer is a hardware timer provided in the ECU 50. In this embodiment, the 16-bit timer can count up to 255 ms. However, a continuous area of 3 bytes is secured on the memory. 2 bytes of the classen timer are transferred to the byte, and the third byte is counted up by the interrupt generated by the overflow of the classen timer, and used as a soft timer.
[0113]
That is, when an overflow occurs in the classen timer, the overflow interrupt of FIG. 11 occurs, and when the third byte of the soft timer is incremented by 1 in step S900, the third byte of the soft timer exceeds 255 in step S901. Determine if there is any. If it does not exceed 255, the process jumps from step S901 to step S903. If it exceeds 255, the process proceeds from step S901 to step S902, the third byte of the soft timer is stopped at 255, and the process proceeds to step S903.
[0114]
In step S903, it is checked whether or not the third byte of the soft timer is not 2, that is, whether or not the classene interval exceeds 0.5 sec (255 ms × 2) and the engine is in the stalled state. When the third byte of the soft timer is not 2, the interrupt is terminated. When the third byte of the soft timer is 2, the process proceeds from step S903 to step S904 to check whether the engine flag is set.
[0115]
In step S904, the interrupt is terminated when the engine stall flag is set. When the engine stall flag is not set, the engine stall request flag for starting the engine stall routine prepared for the 50 ms job is set in step S905. End the interrupt.
[0116]
This makes it possible to count up to 64 seconds (255 ms x 256), and without using a special hardware timer of 16 bits or more, it is easy even when the time interval is very long, such as during cranking. Can respond.
[0117]
On the other hand, in the crank position calculation subroutine, when the process proceeds from step S600 to step S601, it is checked whether the classene interval is equal to or shorter than the set time. This set time is a time as a classen interval corresponding to the maximum engine speed, for example, 0.3 ms. If the classen interval is equal to or shorter than the set time in step S601, a step error is detected as a classen timer counting error due to noise contamination. In step S602, error code 1 is stored in the accumulator A. In step S601, if the classen interval is longer than the set time, the count of the classen timer is normal and the process proceeds to step S603.
[0118]
In step S603, a CCAS / RCAS determination subroutine, which will be described later, is executed to determine the crank position. In step S604, whether or not the error level ECAS is 2 is determined, i.e., at the time of cranking or the like. If ECAS = 2, the process branches to step S605 to store the error code 1 in the accumulator A, and exits the routine.
[0119]
On the other hand, if ECAS ≠ 2 in step S604, the process proceeds to step S606, where the third byte of the soft timer is set to zero. Then, the process proceeds to step S607 to check whether or not the crank position information variable CCAS is 1, that is, whether or not the current crank position is between BTDC 65 ° CA to 10 ° CA (see FIG. 14). When 1, the process jumps from step S607 to step S609. When CCAS ≠ 1, the process proceeds from step S607 to step S608, the A / D conversion request is incremented by 1, and the process proceeds to step S609.
[0120]
This A / D conversion request is a flag-like variable for instructing crank synchronous A / D conversion every 90 ° of crank angle, and takes a value of 0 or 1. When the value is 1, crank synchronous A / D Direct conversion. That is, as described above, of the 8 channels of A / D conversion, 1 channel of A / D conversion is performed every 90 ° of crank angle, but when CCAS becomes 0 (BTDC 97 °), CCAS is 2 When it becomes (BTDC 10 °), an A / D conversion request for crank synchronization is set, and the A / D conversion at every 90 ° of crank angle is interrupted with respect to the A / D conversion order every 0.5 ms. .
[0121]
Thereafter, in step S609, the total position variable ACAS is calculated by multiplying the cylinder information variable RCAS by 3 and adding the crank position information variable CCAS (ACAS = RCAS × 3 + CCAS). In step S610, the soft timer is set to 2 bytes. When the limit is reached and the classen timer overflows, the lower 2 bytes are set to FFFF (255 ms), and the process proceeds to step S611.
[0122]
In step S611, the classen interval data is stored in an array TCAS [ACAS] (element of the array) having the overall position variable ACAS = 0, 1, 2,... 11 as a subscript, and in step S612, the crank position information variable CCAS = Classane interval data is stored in an array MTCSX [CCAS] (element of the array) with subscripts 0, 1, and 2.
[0123]
As shown in FIG. 17A, the array TCAS is a 12-word classane interval table storing classane interval data for two engine revolutions corresponding to ACAS = 0, 1, 2,... As shown in FIG. 17B, MTCSX is a 3-word classen interval table in which 3 classen interval data corresponding to CCAS = 0, 1, and 2 are stored.
[0124]
That is, the information variables CCAS, RCAS, and ACAS are updated by the CCAS / RCAS determination subroutine (described later in detail) in step S603 and in step S609, for example, CCAS = 1, RCAS = 1, and ACAS = 4. Thus, when the crank position is BTDC 65 ° to 10 ° CA of the # 3 cylinder, from the clasen signal input at the BTDC 97 ° CA of the # 3 cylinder counted by the clasen mimer to the clasen signal input at the BTDC 65 ° CA of the # 3 cylinder The time (classane interval data) is stored at the address of ACAS = 3 in the array TCAS using the total position variable ACAS as a parameter in step S611, and the address of CCAS = 0 in the array MTCSX using the crank position information variable CCAS as a parameter in step S612. Store The
[0125]
Therefore, every time the overall position variable ACAS and the crank position information variable CCAS are updated every time a classene interrupt is input by the classene input, the data in the arrays TCAS and MTCSX are sequentially updated. By referring to the array TCAS, each cylinder It is possible to know the change in the distance between the clanes at each crank position (change in the rotational speed), to determine the presence or absence of misfire in each cylinder, the combustion state, etc., and to understand the operating conditions of all the cylinders. Further, by referring to the array MTCSX, the latest classene interval can always be obtained, and the current operation status can be quickly grasped.
[0126]
Next, when proceeding to step S613, the value of the error level ECAS is checked again. Here, since it has already been confirmed in step S604 that ECAS ≠ 2, whether or not the error level ECAS is 1 is checked, that is, whether or not the determination of the crank position is an estimated state that remains uneasy. .
[0127]
If ECAS ≠ 1 (ie, ECAS = 0) in step S613 and the crank position is determined with certainty, the process proceeds from step S613 to step S614, and the sum of the latest three classen interval data (in the array MTCSX). The sum of the stored classen interval data) is calculated as a 3-byte half rotation time MTCS18 (MTCS18 = ΣMTCSX).
[0128]
That is, the half rotation time MTCS18 is calculated every time the crank position information variable CCAS is updated for each classene interrupt and the data in the array MTCSX is updated, and the classen interval is set for each position of BTDC 97 °, 65 °, and 10 °. Since the latest data can always be obtained by taking the moving sum of, the engine speed and the like can be calculated based on the current driving situation, and more precise control becomes possible.
[0129]
On the other hand, when ECAS = 1 in the above step S613 and the estimation of the crank position remains uncertain, the half rotation time MTCS18 is not calculated from the array MTCSX, and the half rotation time estimation subroutine is executed in step S615. Then, the half rotation time MTCS18 is estimated.
[0130]
The estimation of the half rotation time MTCS 18 will be described. First, in step S700 of FIG. 9, it is checked whether or not the crank position information variable CCAS is 1, that is, whether or not the current crank position is between BTDC 65 ° and 10 °. When CCAS = 1, in step S701, from the angle 32 ° between BTDC 97 ° and 65 °, the previous classene interval × 180/32 is estimated as the half rotation time MTCS18 and the process returns.
[0131]
On the other hand, when CCAS is not equal to 1 in step S700, the process proceeds from step S700 to step S702 to determine whether or not the crank position information variable CCAS is 2, that is, the current crank position is BTDC 10 ° to ATDC 83 ° (next cylinder BTDC 97 °), and if CCAS ≠ 2 (CCAS = 0), the process proceeds to step S703, and the previous classene interval × 180 from the angle 93 ° between BTDC 10 ° and ATDC 83 °. / 93 is estimated as a half rotation time MTCS18 and the process returns. If CCAS = 2 in step S702, the process branches from step S702 to step S704, and the previous classene interval x 180/55 is estimated as the half rotation time MTCS18 from the angle 55 ° between BTDC 65 ° and 10 °. And return.
[0132]
In the crank position calculation subroutine, after calculating the half rotation time MTCS18 in step S614, or after estimating the half rotation time MTCS18 by the subroutine of step S615 described above, the process proceeds to step S616, and the half rotation of 3 bytes. When the time MTCS18 is limited to 2 bytes and stored in the predetermined variable MTCSK, the variable MTCSK is doubled and stored in the variable MTCSK4 in step S617, and the normal end code 0 is stored in the accumulator A in step S618. Exit the routine.
[0133]
Then, the engine speed is calculated every 10 ms in the above-described job execution subroutine, and this engine speed is calculated from the reciprocal of the variable MTCSK in which the 3-byte half-rotation time MTCS18 is limited to 2 bytes.
[0134]
Specifically, by dividing the time 30 sec, which is half the unit time (1 min) of the rpm per minute, by the half revolution time MTCSK, the variable NRPM in units of 1 rpm, that is, the engine speed is It is calculated (NRPM = 30 sec / MTCSK), and this engine speed is used as one of basic parameters for various control amount calculation processes.
[0135]
Next, the CCAS / RCAS discrimination subroutine shown in FIG. 10 will be described. In this subroutine, first, in step S800, the Camsen counter is limited to 0-4. The number of cam pulses from the cam angle sensor 41 (the number of cam pulses between Krasen signal inputs) counted by the camsen counter is 0 to 3 in the normal state as shown in FIG. Since there is a possibility of an abnormal count value of 4 or more due to influence, the Camsen counter is limited to 0 to 4 and the abnormal state is represented by 4.
[0136]
Next, the process proceeds to step S801, and a 5 × 4 × 2 combination (5 types of camsen counters 0 to 4 and cylinders) from the camsen counter (count value thereof), cylinder information variable RCAS, and crank position information variable CCAS. The cylinder / crank position state map CCHMAP in which the state data for the information variable RCAS is stored in four types of 0 to 3 and the crank position information variable CCAS is 0, 1 and 2 is read.
[0137]
As shown in FIGS. 18 (a) and 18 (b), this cylinder / crank position state map CCHMAP is obtained when the crank position information variable CCAS is 0 or 1, and when the crank position information variable RCAS is a change point of the cylinder position information variable RCAS. State data indicating whether normal or abnormal conditions should be determined or not should be estimated for all possible states of each combination of the Camsen counter and the cylinder information variable RCAS. You can evaluate the current state and know the next state to take.
[0138]
In other words, the program can be greatly simplified compared to the processing based on the normal condition judgment, the memory capacity can be saved, the processing speed can be improved, and the specification change can be flexibly dealt with. Can do.
[0139]
This status data is 2-bit data, which indicates whether it is fixed or estimated by the value of bit 0, and whether it is normal or abnormal by the value of bit 1. The value of bit 0 is fixed when 0 and indicates when 1 and as can be seen from FIG. 19, it is determined only when the Camsen counter is 2 or 3, and must be estimated otherwise. State. The value of bit 1 is normal when 0 and abnormal when 1 and is normal only when the Camsen counter is 3 or less and matches the combination shown in FIGS. 14 and 19, and otherwise. It is an abnormal condition.
[0140]
For example, the combination of CCAS = 0 or 1, ie, BTDC 97 ° to 10 ° of a certain cylinder, in which the Camsen counter is 0 and the cylinder information variable RCAS is 0, as can be seen from FIG. 14 and FIG. Since it is sufficient to estimate the position normally, state data of 01 (normal estimation) is stored in the corresponding area of the cylinder / crank position state map CCHMAP, and the camsen counter is 1 and the cylinder Since the combination in which the information variable RCAS is 0 is clearly abnormal and can only be estimated, state data of 11 (abnormality estimation) in binary is stored in the corresponding region of the cylinder / crank position state map CCHMAP. ing.
[0141]
Also, CCAS = 2, that is, a combination in which the camsen counter is 3 and the cylinder information variable RCAS is 0 with respect to BTDC 10 ° to ATDC 83 ° of a certain cylinder, is normally determined as the crank position sandwiching the TDC of the # 1 cylinder Therefore, 00 (normally determined) binary state data is stored in the corresponding area of the cylinder / crank position state map CCHMAP, and the camsen counter is 2 and the cylinder information variable RCAS is 0. Since there is obviously an abnormality, but there are two or more Camsen inputs, the state data of 10 (abnormal confirmation) is stored in the corresponding area of the cylinder / crank position state map CCHMAP. Yes.
[0142]
When the state data is read from the cylinder / crank position state map CCHMAP in step S801, the process proceeds to step S802, whether or not the error level ECAS is not 2, that is, an unknown state in which the current state is not discriminated. If ECAS = 2, it is checked in step S803 whether bit 0 of the state data read from the cylinder / crank position state map CCHMAP is 0, that is, whether it is a fixed state. If YES in step S804, the flow advances to step S804.
[0143]
On the other hand, when ECAS ≠ 2 in step S802, the process proceeds to step S804, where it is determined whether or not the estimated state is established, and the process proceeds to step S805 and subsequent processes or step S812 and subsequent processes depending on the determined state and estimated state. Further, when the process proceeds to step S804 in the confirmed state in step S803, the process proceeds to step S805 and subsequent steps.
[0144]
First, the processing after step S805 will be described. When the process proceeds to step S805, the cylinder is determined regardless of whether it is normal or abnormal. As can be seen from the time chart of FIG. Since the interrupt is an interrupt of BTDC 97 ° after three or two cam pulses are input, the crank position information variable CCAS is set to zero.
[0145]
Next, the process proceeds to step S806 to check whether the Camsen counter is 3 or not. When the Camsen counter is not 3, that is, when the Camsen counter is 2, it is after the ignition of the # 2 cylinder. The information variable RCAS is set to 3 and the process proceeds to step S809. When the Camsen counter is 3, since the # 1 cylinder is after ignition, the cylinder information variable RCAS is set to 1 in step S808 and the process proceeds to step S809.
[0146]
In step S809, state data is read again from the cylinder / crank position state map CCHMAP using the updated crank position information variable CCAS, cylinder information variable RCAS, and Camsen counter as parameters, and bit 1 of this state data is 1? That is, it is checked whether or not there is an abnormal state.
[0147]
As a result, when bit 1 of the state data is 1 and it is determined that the state is abnormal in step S809, it is determined that the update result of the crank position information variable CCAS and the cylinder information variable RCAS is an unreliable estimation, and an error level is determined in step S810. If ECAS is set to 1 and the routine is exited, and bit 1 of the status data is 0 and is normal, the error level ECAS is set to 0 in step S811 and the routine is exited.
[0148]
On the other hand, in the processing after step S812, whether or not the current crank position information variable CCAS (crank position information variable CCAS calculated in the previous classene interrupt) is 2, that is, the change point of the cylinder information variable RCAS, in step S812. If CCAS = 2, the flow advances from step S812 to step S813 to increase the cylinder information variable RCAS by 1. In step S814, the crank position information variable CCAS = 0 is set, and the flow advances to step S817.
[0149]
On the other hand, if CCAS ≠ 2 in step S812, the process proceeds from step S812 to step S815 to check whether the Camsen counter is not 0. If the Camsen counter is not 0, the process branches to the above-described Step S813. When the Camsen counter is 0, the crank position information variable CCAS is incremented by 1 in step S816, and the process proceeds to step S817.
[0150]
In step S817, using the updated crank position information variable CCAS, cylinder information variable RCAS, and Camsen counter as parameters, the state data is read again from the cylinder / crank position state map CCHMAP to check whether or not there is an abnormal state. When bit 1 of the data is 0 and is in a normal state, the routine is exited as it is (with the current error level ECAS = 0). If bit 1 of the status data is 1 and the status is abnormal in step S817, the process proceeds to step S818, and the error level ECAS is set on the assumption that the update results of the crank position information variable CCAS and cylinder information variable RCAS are uncertain. Set to 1 and exit the routine.
[0151]
【The invention's effect】
As described above, according to the invention described in claim 1, A crank pulse is output corresponding to a plurality of crank angle positions set in advance for each half rotation of the engine, and each time the crank pulse is input, the crank pulse input interval time since the previous crank pulse is input is measured. In addition, the crank pulse input interval time equal to the number of crank pulses input per half engine revolution including the time value is memorized over time, and these time values are added together. engine Half Since the time per revolution is calculated, the latest engine is always available without delay. Half The time value per revolution can be obtained, and the current driving situation can be quickly grasped by this time value. Half Data representing the engine operating status calculated using the time value per revolution is always obtained without delay as data indicating the current operating status, and this data enables more precise control based on the current operating status. Can do.
According to the invention of claim 2, the engine Half There is provided a table having the same number of crank pulses input per rotation and having an address associated with the crank position information for each crank pulse. And , Ku For each rank pulse input, the time from the previous crank pulse input to the current crank pulse input is stored in the corresponding address of the table. And add the time stored in each address of the table and engine Half Since the time per revolution is calculated, in addition to the effect of the invention of claim 1, the time between each crank pulse is calculated for each input of each crank pulse by a very simple process. Addition value Can be obtained and the calculation burden can be reduced.
[Brief description of the drawings]
FIG. 1 is a flowchart of a crank position calculation subroutine.
FIG. 2 is a flowchart of periodic interrupt processing every 0.5 ms.
FIG. 3 is a flowchart of classene interrupt processing.
FIG. 4 is a flowchart of job priority processing.
FIG. 5 is a partial flowchart 1 of a job execution subroutine.
FIG. 6 is a partial flowchart 2 of a job execution subroutine.
FIG. 7 is a partial flowchart 3 of a job execution subroutine.
FIG. 8 is a partial flowchart 4 of a job execution subroutine.
FIG. 9 is a flowchart of a half rotation time estimation subroutine.
FIG. 10 is a flowchart of a CCAS / RCAS discrimination subroutine.
FIG. 11 is a flowchart of an overflow interrupt process of a classen timer.
FIG. 12 is an explanatory diagram showing a job execution state
FIG. 13 is an explanatory diagram of a job flag.
FIG. 14 is an explanatory diagram of a crank position variable.
FIG. 15 is an explanatory diagram showing changes in a job execution flag and an overlap counter;
FIG. 16 is an explanatory diagram of a system shift buffer.
FIG. 17 is an explanatory diagram of a classene interval table.
FIG. 18 is an explanatory diagram of a cylinder / crank position state map.
FIG. 19 is a time chart showing crank positions and engine strokes.
FIG. 20 is a schematic configuration diagram of an engine system.
FIG. 21 is a front view of a crank rotor and a crank angle sensor.
FIG. 22 is a front view of a cam rotor and a cam angle sensor.
FIG. 23 is a circuit configuration diagram of an electronic control system.
[Explanation of symbols]
50 ECU
MTCSX Classen interval table
MTCS18 half rotation time
CCAS crank position information variable

Claims (2)

エンジン半回転毎に予め設定された複数のクランク角度位置に対応してクランクパルスを出力構成し、
該クランクパルスが入力する都度、前回クランクパルスが入力してからのクランクパルス入力間隔時間を計測すると共に、該時間値を含めエンジン半回転当たりに入力されるクランクパルスと同数個のクランクパルス入力間隔時間を経時的に記憶し、これら時間値を加算してエンジン回転当たりの時間を算出することを特徴とするエンジンの回転時間算出方法。
A crank pulse is output corresponding to a plurality of crank angle positions set in advance for each half rotation of the engine,
Each time the crank pulse is input, the crank pulse input interval time from the previous crank pulse input is measured, and the same number of crank pulse input intervals as the crank pulses input per half engine revolution including the time value are measured. over time storing time, rotation time calculation method for an engine and calculates the time per adds these time values engines a half rotation.
上記エンジンの回転当たりに入力されるクランクパルスと同数であってこれら各クランクパルス毎のクランク位置情報に対応付けたアドレスを有するテーブルを備えて、
クランクパルスの入力毎に、上記テーブルの対応アドレスに前回クランクパルス入力から今回クランクパルス入力までの時間をストアし、
上記テーブルの各アドレスにストアされている時間を加算してエンジン回転当たりの時間を算出することを特徴とする請求項1記載のエンジンの回転時間算出方法。
A table having the same number of crank pulses input per half rotation of the engine and having an address associated with crank position information for each of the crank pulses,
For each crank pulse input, the time from the previous crank pulse input to the current crank pulse input is stored in the corresponding address in the above table,
2. The engine rotation time calculation method according to claim 1, wherein the time per half rotation of the engine is calculated by adding the time stored in each address of the table.
JP04557493A 1993-03-05 1993-03-05 Calculation method of engine rotation time Expired - Fee Related JP3645576B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04557493A JP3645576B2 (en) 1993-03-05 1993-03-05 Calculation method of engine rotation time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04557493A JP3645576B2 (en) 1993-03-05 1993-03-05 Calculation method of engine rotation time

Publications (2)

Publication Number Publication Date
JPH06257503A JPH06257503A (en) 1994-09-13
JP3645576B2 true JP3645576B2 (en) 2005-05-11

Family

ID=12723125

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04557493A Expired - Fee Related JP3645576B2 (en) 1993-03-05 1993-03-05 Calculation method of engine rotation time

Country Status (1)

Country Link
JP (1) JP3645576B2 (en)

Also Published As

Publication number Publication date
JPH06257503A (en) 1994-09-13

Similar Documents

Publication Publication Date Title
JP3645576B2 (en) Calculation method of engine rotation time
JP3337149B2 (en) Engine crank position determination method
US4690122A (en) Ignition control system for internal combustion engines
JP3324818B2 (en) How to use engine crank position information
JP3555689B2 (en) Fuel injection control method for multi-cylinder engine
JP3617847B2 (en) How to integrate jobs
JP3455243B2 (en) How to use analog / digital conversion results
JP3294366B2 (en) Method for discriminating energization state of ignition coil in engine ignition control
JP3294365B2 (en) Engine ignition control method
JP3530549B2 (en) Fuel injection control method for multi-cylinder engine
JPH06249053A (en) Analog/digital conversion method
JP3331237B2 (en) Injection start section setting method for each cylinder of a multi-cylinder engine
JPH06257500A (en) Grasping method for engine operation condition
JPH06257501A (en) Engine half rotation time estimating method
JP3530551B2 (en) Fuel injection control method for multi-cylinder engine
JP3442806B2 (en) Job priority processing method
JP3384498B2 (en) Method of eliminating processing delay in engine ignition control
JPH06257502A (en) Calculation of engine speed
JPH06200819A (en) Work area setting method of microcomputer
JPH06249054A (en) Method to read switch input data in vehicle control computer
JP3530550B2 (en) Fuel injection control method for multi-cylinder engine
JPH06231004A (en) Simulating method for analog/digital conversion
JPH07103052A (en) Fuel injection control method for multicylinder engine
JPH0719100A (en) Method for setting injection starting internal for each cylinder of multi-cylinder engine
JPH06272651A (en) Current-carrying sequence setting method in ignition control for engine

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041221

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050204

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees