JP3384498B2 - Method of eliminating processing delay in engine ignition control - Google Patents
Method of eliminating processing delay in engine ignition controlInfo
- Publication number
- JP3384498B2 JP3384498B2 JP06071693A JP6071693A JP3384498B2 JP 3384498 B2 JP3384498 B2 JP 3384498B2 JP 06071693 A JP06071693 A JP 06071693A JP 6071693 A JP6071693 A JP 6071693A JP 3384498 B2 JP3384498 B2 JP 3384498B2
- Authority
- JP
- Japan
- Prior art keywords
- ignition
- job
- time
- cylinder
- crank
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 title claims description 117
- 238000000034 method Methods 0.000 title claims description 80
- 230000001360 synchronised effect Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 description 76
- 238000006243 chemical reaction Methods 0.000 description 35
- IHKWXDCSAKJQKM-SRQGCSHVSA-N n-[(1s,6s,7r,8r,8ar)-1,7,8-trihydroxy-1,2,3,5,6,7,8,8a-octahydroindolizin-6-yl]acetamide Chemical compound O[C@H]1[C@H](O)[C@@H](NC(=O)C)CN2CC[C@H](O)[C@@H]21 IHKWXDCSAKJQKM-SRQGCSHVSA-N 0.000 description 27
- 239000000446 fuel Substances 0.000 description 24
- 101710116822 Atrochrysone carboxylic acid synthase Proteins 0.000 description 22
- 238000010586 diagram Methods 0.000 description 20
- 230000000737 periodic effect Effects 0.000 description 15
- 238000004364 calculation method Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 14
- 238000002347 injection Methods 0.000 description 14
- 239000007924 injection Substances 0.000 description 14
- 230000015654 memory Effects 0.000 description 12
- 230000008859 change Effects 0.000 description 11
- 230000002159 abnormal effect Effects 0.000 description 10
- 230000003111 delayed effect Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000002485 combustion reaction Methods 0.000 description 6
- 238000001514 detection method Methods 0.000 description 5
- 238000007726 management method Methods 0.000 description 5
- WBWWGRHZICKQGZ-HZAMXZRMSA-M taurocholate Chemical compound C([C@H]1C[C@H]2O)[C@H](O)CC[C@]1(C)[C@@H]1[C@@H]2[C@@H]2CC[C@H]([C@@H](CCC(=O)NCCS([O-])(=O)=O)C)[C@@]2(C)[C@@H](O)C1 WBWWGRHZICKQGZ-HZAMXZRMSA-M 0.000 description 5
- 238000011144 upstream manufacturing Methods 0.000 description 5
- 230000005856 abnormality Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000011217 control strategy Methods 0.000 description 3
- 239000000498 cooling water Substances 0.000 description 3
- 230000001934 delay Effects 0.000 description 3
- 239000007789 gas Substances 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 241000375392 Tana Species 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 238000001816 cooling Methods 0.000 description 2
- 238000010304 firing Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 241001279686 Allium moly Species 0.000 description 1
- 240000000736 Amomum maximum Species 0.000 description 1
- 208000019901 Anxiety disease Diseases 0.000 description 1
- 244000235756 Microcos paniculata Species 0.000 description 1
- 229910017435 S2 In Inorganic materials 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 230000036506 anxiety Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- QVGXLLKOCUKJST-UHFFFAOYSA-N atomic oxygen Chemical compound [O] QVGXLLKOCUKJST-UHFFFAOYSA-N 0.000 description 1
- 230000003197 catalytic effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000011109 contamination Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000002542 deteriorative effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000002828 fuel tank Substances 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 229910052760 oxygen Inorganic materials 0.000 description 1
- 239000001301 oxygen Substances 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000010349 pulsation Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000007858 starting material Substances 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Ignition Installations For Internal Combustion Engines (AREA)
- Electrical Control Of Ignition Timing (AREA)
- Combined Controls Of Internal Combustion Engines (AREA)
Description
【発明の詳細な説明】
【0001】
【産業上の利用分野】本発明は、点火タイマセットの際
の処理遅れの影響を解消するエンジンの点火制御におけ
る処理遅れ解消方法に関する。
【0002】
【従来の技術】近年、自動車などの車輌にマイクロコン
ピュータが導入され、エンジン、パワートレインなどを
高精度に制御することが可能となった。このマイクロコ
ンピュータは、定電圧回路や各種周辺回路を加えた電子
制御装置(ECU)として車輌に搭載され、車輌の運転
状態を検出する各種センサ類からの信号に基づいてエン
ジンの燃料噴射制御や点火制御などを実行する。
【0003】上記ECUによる点火制御は、通常、所定
クランク角毎の割込み処理で実行され、例えば特開昭6
2−159747号公報には、所定クランク角毎の割込
みルーチンにおいて、吸入空気量及びエンジン回転数に
基づくマップの補間計算から基本点火時期を計算し、こ
の基本点火時期に、ノッキング、冷却水温などによる遅
角補正を加えて最終的な点火時期(角度)を算出した
後、この最終的な点火時期(角度)を時間に換算して点
火コイルの通電終了時刻、通電開始時刻を点火時期制御
用カウンタ(タイマ)にセットする技術が開示されてい
る。
【0004】
【発明が解決しようとする課題】しかしながら、所定の
クランク角割込みが起動されてから点火タイマにデータ
がセットされるまでには処理遅れ時間があり、この処理
遅れ時間の分だけ実際の点火時期がずれることになっ
て、エンジン出力性能を十分に発揮させることができな
いばかりでなく、排気ガスエミッションの悪化を招くお
それがある。
【0005】本発明は上記事情に鑑みてなされたもの
で、点火タイマセットの際の処理遅れの影響を解消し、
常に最適なタイミングで点火を行なうことのできるエン
ジンの点火制御における処理遅れ解消方法を提供するこ
とを目的としている。
【0006】
【課題を解決するための手段】請求項1記載の発明は、
規定された複数のクランク位置を表すクランクパルスを
入力し、複数のクランクパルスのうち、特定のクランク
パルス間で気筒判別用の所定数のカムパルスを入力し
て、これらパルスの入力パターンに基づいてクランク位
置を把握すると共に気筒判別を行い、上記クランクパル
スの入力毎に区間を設定し、点火に係る区間の開始位置
からの時間を点火タイマにセットして点火コイルの通電
・遮断を行い点火制御を行うエンジンの点火制御におい
て、エンジン回転に同期するクランクパルス入力毎の処
理で、現在の気筒及びクランク位置を表す区間が、予め
設定した点火に係る区間となったか否かを判断し、点火
に係る区間となったとき、エンジン運転状態に基づいて
設定した点火コイルの通電・遮断時間から、クランクパ
ルス入力から実際に点火タイマがセットされるまでの処
理遅れ時間を差し引いた値を点火タイマにセットして、
点火を行うと共に、上記点火コイルの通電・遮断時間か
ら処理遅れ時間を差し引いた値が負となったとき、現在
の処理遅れ時間が処理遅れ時間記録値を超えているか否
かを判断し、現在の処理遅れ時間が記録値を越えている
時、現在の処理遅れ時間により処理遅れ時間記録値を更
新し、該記録値を次回の点火タイマセットの際に処理遅
れ時間として用いることを特徴とする。
【0007】
【0008】
【作用】請求項1記載の発明は、規定された複数のクラ
ンク位置を表すクランクパルスを入力し、複数のクラン
クパルスのうち、特定のクランクパルス間で気筒判別用
の所定数のカムパルスを入力して、これらパルスの入力
パターンに基づいてクランク位置を把握すると共に気筒
判別を行い、上記クランクパルスの入力毎に区間を設定
し、点火に係る区間の開始位置からの時間を点火タイマ
にセットして点火コイルの通電・遮断を行い点火制御を
行うに際し、エンジン回転に同期するクランクパルス入
力毎の処理で、現在の気筒及びクランク位置を表す区間
が、予め設定した点火に係る区間となったか否かを判断
する。そして、点火に係る区間となったとき、エンジン
運転状態に基づいて設定した点火コイルの通電・遮断時
間から、クランクパルス入力から実際に点火タイマがセ
ットされるまでの処理遅れ時間を差し引いた値を点火タ
イマにセットして、点火を行うと共に、点火コイルの通
電・遮断時間から処理遅れ時間を差し引いた値が負とな
ったとき、現在の処理遅れ時間が処理遅れ時間記録値を
超えているか否かを判断する。そして、現在の処理遅れ
時間が記録値を越えている時、現在の処理遅れ時間によ
り処理遅れ時間記録値を更新し、該記録値を次回の点火
タイマセットの際に処理遅れ時間として用いる。
【0009】
【0010】
【実施例】以下、図面を参照して本発明の実施例を説明
する。図面は本発明の一実施例に係り、図1は点火タイ
マセットサブルーチンの部分フローチャート1、図2は
点火タイマセットサブルーチンの部分フローチャート
2、図3は0.5ms毎の定期割込み処理のフローチャ
ート、図4はクラセン割込み処理のフローチャート、図
5はジョブ優先処理のフローチャート、図6はジョブ実
行サブルーチンの部分フローチャート1、図7はジョブ
実行サブルーチンの部分フローチャート2、図8はジョ
ブ実行サブルーチンの部分フローチャート3、図9はジ
ョブ実行サブルーチンの部分フローチャート4、図10
はクランク位置算出サブルーチンのフローチャート、図
11はCCAS・RCAS判別サブルーチンのフローチ
ャート、図12は点火スケジュール作成サブルーチンの
部分フローチャート1、図13は点火スケジュール作成
サブルーチンの部分フローチャート2、図14は点火ス
ケジュール作成サブルーチンの部分フローチャート3、
図15は点火スケジュール作成サブルーチンの部分フロ
ーチャート4、図16は点火終了時割込み処理のフロー
チャート、図17はジョブの実行状態を示す説明図、図
18はジョブフラグの説明図、図19はクランク位置変
数の説明図、図20はジョブ実行中フラグとオーバーラ
ップカウンタの変化を示す説明図、図21はシステムシ
フトバッファの説明図、図22はクラセン間隔テーブル
の説明図、図23は気筒・クランク位置状態マップの説
明図、図24は点火シーケンスと点火区間変数の説明
図、図25は点火スケジュールの説明図、図26はスケ
ジュールポインタテーブルの説明図、図27は点火タイ
マセットの説明図、図28は通電状態マップの説明図、
図29は通電気筒情報と点火気筒情報との関係を示す説
明図、図30はクランク位置とエンジンの行程を示すタ
イムチャート、図31はエンジン系の概略構成図、図3
2はクランクロータとクランク角センサの正面図、図3
3はカムロータとカム角センサの正面図、図34は電子
制御系の回路構成図である。
【0011】本実施例のエンジン制御システムでは、図
34に示すマイクロコンピュータを中核とした電子制御
装置(ECU)50により図31に示すエンジン系が制
御され、燃料噴射制御、点火時期制御などが行なわれ
る。上記ECU50のマイクロコンピュータには、新し
い概念に基づくオペレーティングシステム(OS)が搭
載され、このOSにより、各センサ類からの信号入力処
理、エンジン回転数算出処理、吸入空気量算出処理、燃
料噴射量設定処理、点火時期設定処理などといった各制
御項目毎のジョブが管理されて効率的に実行されるよう
になっている。
【0012】まず、上記ECU50によって制御される
エンジン系の機器構成について説明する。
【0013】図31に示すように、エンジン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に、アイドルスピードコントロールバルブ(IS
CV)16が介装されている。さらに、このISCV1
6の直下流側に、吸気圧が負圧のとき開弁し、またター
ボチャージャ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を介して連通され、この通路2
3に、上記絶対圧センサ22と上記インテークマニホル
ド3あるいは大気とを選択的に連通する吸気管圧力/大
気圧切換ソレノイド弁24が介装されている。
【0021】さらに、上記インテークマニホルド3の各
気筒の各吸気ポート2aの直上流側にインジェクタ25
が臨まされ、また、上記シリンダヘッド2の各気筒毎
に、その先端を燃焼室に露呈する点火プラグ26が取付
けられ、この点火プラグ26に各気筒毎に配設された点
火コイル26aを介してイグナイタ27が接続されてい
る。
【0022】上記インジェクタ25には、燃料タンク2
8内に設けたインタンク式の燃料ポンプ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は、図32に示す
ように、その外周に突起38a,38b,38cが形成
され、これらの各突起38a,38b,38cが、各気
筒(#1,#2と#3,#4)の圧縮上死点前(BTD
C)θ1,θ2,θ3 の位置に形成されており、本実施例に
おいては、θ1 =97°CA、θ2 =65°CA、θ3
=10°CAである。
【0027】上記クランクロータ38の各突起は、上記
クランク角センサ39によって検出され、図30のタイ
ムチャートに示すように、BTDC97°,65°,1
0°のクランクパルスがエンジン1/2回転毎(180
°CA毎)に出力される。そして、各信号の入力間隔時
間がタイマによって計時され、エンジン回転数が算出さ
れる。
【0028】尚、突起38bは、点火時期設定の際の基
準クランク角となり、また、突起38cは、始動時噴射
開始時期の基準クランク角となるとともに始動時の固定
点火時期を示すクランク角となる。
【0029】また、図33に示すように、上記カムロー
タ40の外周には、気筒判別用の突起40a,40b,
40cが形成され、突起40aが#3,#4気筒の圧縮
上死点後(ATDC)θ4 の位置に形成され、突起40
bが3個の突起で構成されて最初の突起が#1気筒のA
TDCθ5 の位置に形成されている。さらに、突起40
cが2個の突起で形成され、最初の突起が#2気筒のA
TDCθ6 の位置に形成されている。本実施例において
は、θ4 =20°CA、θ5 =5°CA、θ6=20°
CAである。
【0030】そして、上記カムロータ40の各突起が上
記カム角センサ41によって検出され、各気筒の燃焼行
程順を#1→#3→#2→#4とした場合、この燃焼行
程順と、上記カム角センサ41からのカムパルスをカウ
ンタによって計数した値とのパターン(図30のタイム
チャート参照)に基づいて、気筒判別がなされる。
【0031】一方、図34に示す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は、CPU5
8(以下、メインCPU58と称する)、ROM59、
RAM60、上記イグニッションスイッチ56がOFF
されたときにも上記定電圧回路53からバックアップ電
源が供給されてデータを保持するバックアップRAM6
1、カウンタ・タイマ群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,7
5を介してシリアル通信ラインにより互いに接続されて
いる。
【0037】上記メインコンピュータ51のI/Oイン
ターフェース64には、入力ポートに、吸入空気量セン
サ32、スロットル開度センサ33a、水温センサ3
6、O2 センサ37、絶対圧センサ22、車速センサ4
2、及び、バッテリ55が、8チャンネル入力のA/D
変換器66を介して接続されるとともに、アイドルスイ
ッチ33b、クランク角センサ39、カム角センサ41
が接続されており、さらに、始動状態を検出するために
スタータスイッチ43が接続されている。
【0038】尚、本実施例においては、上記A/D変換
器66は、7チャンネル分の入力が使用され、残りの1
チャンネルは予備となっている。
【0039】また、上記I/Oインターフェース64の
出力ポートには、イグナイタ27が接続され、さらに、
駆動回路67を介して、ISCV16、インジェクタ2
5、燃料ポンプリレー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に点火信
号を出力し、該当気筒の点火プラグ26を点火する。
【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,250
ms毎の5種類の等間隔割込みジョブが用意されてお
り、また、エンジン回転に同期した処理として、クラン
ク角信号入力により即割込み実行される高優先クラセン
ジョブ(以下、単にクラセンジョブと称する)と、より
優先順位が高い他のジョブがないときにクランク角信号
入力により割込み実行される比較的緊急度の低い低優先
クラセンジョブとが用意されている。
【0049】これらの各ジョブには、クラセンジョブ>
2msジョブ>4msジョブ>10msジョブ>低優先
クラセンジョブ>50msジョブ>250msジョブの
順で、7〜1の優先レベルが高位側から低位側に向かっ
て付けられており、図17に示すように、高速ジョブに
対し低速ジョブが分割して処理されるとともに、各ジョ
ブの多重待ち処理が行なわれる。
【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〜図
16のフローチャートに従って説明する。尚、サブコン
ピュータ52はノック検出処理専用のコンピュータであ
るため、その動作説明を省略する。
【0054】まず、イグニッションスイッチ56がON
されてシステムに電源が投入されると、リセットに伴う
リセット割込みが起動し、各種イニシャライズが行なわ
れるとともに、0.5ms毎に定期割込みを起動するた
めの定期割込みタイマが起動され、クランク角センサ3
9からの信号入力毎(BTDC97°,65°,10°
CA毎のエンジン1回転に6回)に起動されるクラセン
割込みが許可され、その後、バックグランドジョブの実
行状態となる。
【0055】そして、このバックグランドジョブの上
で、0.5ms毎の定期割込みと、エンジン1回転に6
回のクラセン割込みとにより、7レベルのジョブが優先
処理される。この2つの割込みにおいては、各自の処理
を実行後、共通のアドレスにジャンプし、ジョブ優先処
理を実行する。
【0056】尚、上記リセット割込みは、内部演算にお
いて0による除算を実行した場合や、無限ループが発生
した場合など、正常時には発生しない要因によっても、
起動される。
【0057】まず、図3に示す0.5ms毎の定期割込
みについて説明する。この定期割込みでは、ステップS1
00で、OS用ワークエリアを設定し、ステップS101で、
ウオッチドッグタイマを初期化すると、ステップS102へ
進んで、P−RUNフラグを20回に1回すなわち10
ms毎に反転する。この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変換の最後の順番の入力が完全に停止し、7
500rpm以上では、最後から2番目の入力も停止す
るが、A/D変換の順番は、スロットル開度、吸入空気
量など変化の速いものを先として、冷却水温、電圧など
比較的変化の遅いものが後になるように設定してあり、
且つ、最後のA/D変換順番をクランク同期入力に設定
してあるため、特に支障は生じない。
【0062】また、図18に示すように、上記ジョブフ
ラグ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_F
LGのいずれかのビットが立っているときには、ステッ
プS108へ進んで、現状レベル(この定期割込みが実行さ
れる時点で所定の優先レベルのジョブが実行されていた
状態)以下のフラグがないか否かを調べる。
【0065】上記ステップS108で、現状レベル以下のフ
ラグがないときには、ラベルWAR_JBで示される図
5のジョブ優先処理にジャンプし、現状レベル以下のフ
ラグがあるときには、ステップS109で、現状レベル以下
のレベルのオーバーラップカウンタOLCを1増加させ
る。
【0066】上記オーバーラップカウンタOLCは、ジ
ョブ要求を記憶するためのカウンタであり、各優先レベ
ル毎に1バイト割当てられ、上記ジョブフラグJB_F
LGによるジョブ要求時にインクリメント、ジョブ終了
時にデクリメントされる。すなわち、カウンタによって
ジョブ要求を記憶することによりジョブの多重要求に対
応することができるのである。
【0067】次いで、上記ステップS109からステップS1
10へ進み、現状レベルより高いフラグがないか否かを調
べ、現状レベルより高いフラグがないときには、ルーチ
ンを抜けて割込みを終了し、現状レベルより高いフラグ
があるときには、ラベルWAR_JBのジョブ優先処理
へジャンプする。
【0068】一方、この0.5ms毎の定期割込みに対
し、図4のクラセンによる割込みでは、ステップS200
で、OS用ワークエリアを設定すると、ステップS201
で、後述するクランク位置・半回転時間算出のサブルー
チンを実行し、現在のクランク位置を判別するためのク
ランク位置変数、及び、最新の3つのクラセン間隔の和
である半回転時間を算出する。
【0069】上記クランク位置変数は、OS中で用意さ
れるシステム変数であり、図19に示すように、#1〜
#4気筒に対するクランク位置を、97°,65°,1
0°CAによって12の状態の区間に区分し、現在のク
ランク位置を表わす。
【0070】すなわち、各気筒毎に、0,1,2の数値
でクラセン入力順を示すクランク位置情報変数S_CC
AS、#1気筒を0、#3気筒を1、#2気筒を2、#
4気筒を3として気筒の燃焼順を示す気筒情報変数S_
RCAS、及び、0〜11の数値でクラセン順序及び気
筒順序を総合的に表わすクランク総合位置変数S_AC
ASの3変数によって現在のクランク位置を表わし、さ
らに、クランク位置が確証をもって正常に判別されたと
きを0、判別結果がつじつまが合わず不安の残る推定状
態を1、不明な状態を2とするエラーレベルS_ECA
Sにより、クランク位置の判別状況を表わすようになっ
ている。尚、図19においては、システム変数であるこ
とを示すS_を省略している。
【0071】次いで、上記ステップS201からステップS2
02へ進むと、クランク位置・半回転時間算出のサブルー
チンにおいてクランク位置判定が正常に終了したかある
いは判定不能であったかを、アキュムレータAにストア
されているコードを読み出すことにより調べる(エラー
コード1、正常終了コード0)。
【0072】そして、上記ステップS202で、アキュムレ
ータAの内容が1であり、クランク位置が判定不能であ
ったときには、割込みを終了し、アキュムレータAの内
容が0であり、クランク位置が正常に判定されていると
きには、ステップS203へ進み、エンストフラグを解除す
る。
【0073】尚、上記エンストフラグは、エンジンがエ
ンスト状態であることを示すフラグであり、クラセン間
隔が0.5sec以上の時間(約30rpm以下)のと
き、50msジョブに用意されているエンスト処理ルー
チンによりセットされ、このクラセン割込みによりクリ
アされてエンスト状態が解除される。
【0074】次に、ステップS204へ進むと、後述する点
火タイマセットのサブルーチンを実行し、点火シーケン
ス決定のための後述する点火スケジュールに従って点火
タイマをセットする。次いで、ステップS205で、燃料噴
射タイマセットのサブルーチンを実行し、ユーザージョ
ブ側で設定した燃料噴射量の指示値(各気筒毎の噴射
幅)に対し、燃料噴射開始時期などを燃料噴射タイマに
セットしてステップS206へ進む。
【0075】ステップS206では、このクラセンが実行さ
れた現状のジョブレベルが自身のジョブレベルであるか
否かを判別し、現状がクラセンジョブ自身のレベルであ
るときには、ステップS207、S208で、クラセンジョブ、
低優先クラセンジョブのオーバーラップカウンタOLC
を、それぞれ1増加させて割込みを終了し、現状のジョ
ブレベルがクラセンジョブのレベルでないときには、ス
テップS209で、現状のジョブレベルが低優先クラセンジ
ョブのレベル以上であるか否かを調べる。
【0076】そして、現状のジョブレベルが低優先クラ
センジョブ以上であるときには、上記ステップS209から
ステップS210へ進んで、低優先クラセンジョブのオーバ
ーラップカウンタOLCを1増加させると、ステップS2
11で、クラセンジョブのジョブフラグをセットし、ラベ
ルWAR_JBのジョブ優先処理へジャンプする。
【0077】一方、上記ステップS209で、現状のジョブ
レベルが低優先クラセンジョブ以上でないときには、上
記ステップS209からステップS212へ進み、クラセンジョ
ブのジョブフラグをセットすると、ステップS213で、低
優先クラセンジョブのジョブフラグをセットし、ラベル
WAR_JBのジョブ優先処理へジャンプする。
【0078】このジョブ優先処理では、ステップS300
で、ジョブの優先レベルを示す1バイト変数であるジョ
ブレベルJB_LEVを1つ上げると、ステップS301へ
進んで、この優先レベルに対応するジョブフラグが立っ
ていないか調べる。そして、ジョブフラグが立っていな
いときには、ステップS300へ戻ってさらにジョブレベル
JB_LEVを1つ上げ、ジョブフラグが立っていると
きには、ステップS302へ進み、ジョブフラグの立ってい
るジョブのオーバーラップカウンタOLCを初期値の0
から1にし、ステップS303へ進む。
【0079】ステップS303では、より上のジョブフラグ
があるか否かを調べ、より上のジョブがあるときには、
ステップS300へ戻って前述の処理を繰り返し、より上の
ジョブがないときには、ステップS304へ進んで、ジョブ
実行中フラグJB_RUNをセットすると、ステップS3
05で、後述するジョブ実行サブルーチンにより最上位の
ジョブを実行する。
【0080】上記ジョブ実行中フラグJB_RUNは、
ジョブの実行開始時にセットされ、終了時にクリアされ
るフラグであり、このフラグにより、処理の途中で、よ
り優先度の高いジョブによって割込まれたジョブを識別
することができる。
【0081】例えば、図20に示すように、JB_LE
V=4の10msジョブを実行中、JB_LEV=6の
2msジョブの割込み要求がなされると、10msジョ
ブの処理が中断され、より優先度の高い2msジョブ
が、JB_RUN=1、OLC=1にセットされ、実行
される。そして、この2msジョブの処理中に、JB_
LEV=5の4msジョブの割込み要求が発生すると、
この4msジョブは、JB_RUN=0、OLC=1と
されて割込みが受付けられるが、実行はされず待機状態
となる。
【0082】その後、ジョブ実行サブルーチンによるジ
ョブの実行が終了すると、上記ステップS305からステッ
プS306へ進んでオーバーラップカウンタOLCを1減ら
し、ステップS307で、オーバーラップカウンタOLCが
ゼロになったか否かを調べる。その結果、オーバラップ
カウンタOLCがゼロになっておらず、同じ優先レベル
でジョブ割込み要求が複数回あるときには、ステップS3
05へ戻ってジョブを繰返し実行し、オーバラップカウン
タOLCがゼロになったとき、ステップS307からステッ
プS308へ進んで、ジョブ実行中フラグJB_RUNをク
リアする。
【0083】次に、ステップS309へ進み、ジョブレベル
JB_LEVを1つ下げて次のジョブレベルに移ると、
ステップS310で、このジョブレベルJB_LEVがゼロ
になったか否かを調べる。そして、ジョブレベルJB_
LEVがゼロのときには、この割込みを終了し、ジョブ
レベルJB_LEVがゼロでないときには、ステップS3
11へ進んで、オーバーラップカウンタOLCがゼロか否
かを調べる。
【0084】上記ステップS311で、オーバーラップカウ
ンタOLCがゼロのときには、このレベルではジョブ要
求はないため、上記ステップS311からステップS309へ戻
って、ジョブレベルJB_LEVをさらに1つ下げて同
様の処理を繰返し、オーバーラップカウンタOLCがゼ
ロでないときには、ステップS312へ進んで、このジョブ
レベルにおいて、ジョブ実行中フラグJB_RUNがセ
ットされているか否かを調べる。
【0085】上記ステップS312で、ジョブ実行中フラグ
JB_RUNがセットされているときには、割込み前に
ジョブを実行中であったため、割込みを終了して割込み
前のジョブへ戻り、ジョブ実行中フラグJB_RUNが
セットされていなければ、ステップS304へ戻って、この
レベルのジョブを実行し、同様の処理を繰返す。
【0086】すなわち、図20において、JB_LEV
=6の2msジョブが終了し、OLC=0、JB_RU
N=0になると、ジョブレベルが1つ下げられ、JB_
LEV=5の4msジョブが、JB_RUN=0、OL
C=1の待機状態からJB_RUN=1にセットされ、
実行される。さらに、4msジョブが終了すると、JB
_LEV=4に移り、JB_RUN=1(ジョブ実行
中)の状態から、2msジョブ及び4msジョブによっ
て中断されていた10msジョブの処理が再開される。
【0087】このように、0.5ms毎の定期割込み、
クラセン割込みを基本タイミングとして、各ジョブの優
先レベル及び実行タイミングを知らせるジョブフラグJ
B_FLGを作成するため、可能な限り正確に、等時間
間隔処理、エンジン回転同期処理を実現し、各ジョブを
効率良く処理することができる。さらに、基本タイミン
グとなる各割込み毎に更新されるジョブフラグJB_F
LGによらず、オーバーラップカウンタOLCによって
ジョブの多重要求を記憶するため、あるジョブの処理時
間が長引き、再度、同じジョブを実行すべきタイミング
となった場合においても、処理を途中で放棄することな
く、可能な限り最後まで処理を継続することができる。
【0088】次に、図6〜図9のジョブ実行サブルーチ
ンについて説明する。
【0089】まず、ステップS500で、ジョブフラグJB
_FLGを参照して実行すべきジョブがクラセンジョブ
でないか否かを調べ、クラセンジョブでないときには、
ラベルALJ10へ分岐し、クラセンジョブのときに
は、ステップS501へ進んで、気筒判別がついているか否
かを調べる。
【0090】そして、気筒判別がついていないときに
は、そのままルーチンを抜けてジョブを実行せず、気筒
判別がついているとき、上記ステップS501からステップ
S502へ進んで、オーバーラップカウンタOLCの値を参
照して多重待ち状態であるか否かを調べる。
【0091】上記ステップS502では、多重待ち状態でな
いとき、ステップS503へ進んで、クラセン割込み毎に算
出されるシステム変数S_ACAS(クランク総合位置
変数)をユーザー変数ACASとし、一方、多重待ち状
態のときには、ステップS504へ分岐し、ユーザー変数A
CASを一つ増やして12で割った剰余をとって新たな
ユーザー変数ACASとし、このユーザー変数ACAS
を0,1,2,…,11,0,1,…とソフトウエア的
に更新してゆく。
【0092】すなわち、クラセンジョブ及び低優先クラ
センジョブは、自身または優先度の高いジョブに邪魔さ
れて遅れることがあるが、クラセン割込みは正確にクラ
ンク角センサ信号に同期して実行され、システム変数S
_ACASはジョブの遅れに関係なく更新される。
【0093】従って、ジョブ中でシステム変数S_AC
ASを参照して気筒及びクランク位置に係る情報を知
り、この情報に応じた仕事を行なおうとしても、自身が
他のジョブに邪魔されて遅れた場合には、自身の仕事に
対応した気筒及びクランク位置に係る情報を知ることが
できなくなる。このため、クラセンジョブ及び低優先ク
ラセンジョブ中では、多重待ち状態でないときにOS用
のシステム変数S_ACASをユーザー用変数ACAS
として取込み、このユーザー変数ACASをジョブ実行
毎に更新して多重要求の場合にも、自身に対応した気筒
及びクランク位置に係る情報を得て適正な処理がなされ
るようにするのである。
【0094】その後、上記ステップS503あるいは上記ス
テップS504からステップS505へ進み、ジョブのワークエ
リアを設定すると、ステップS506で、レベルゼロの割込
みを許可し、ステップS507で、クラセンジョブのセクシ
ョンに移る。そして、このクラセンジョブセクションに
リンクされた処理を実行し、ステップS508で、割込みを
禁止してルーチンを抜ける。
【0095】次に、ステップS500で、これから実行すべ
きジョブがクラセンジョブでないときには、ラベルAL
J10のステップS510で、2msジョブでないか否か調
べ、2msジョブのとき、ステップS511で、ジョブのワ
ークエリアを設定すると、ステップS512で、レベルゼロ
の割込みを許可し、ステップS513で、2msジョブのセ
クションに移る。そして、このセクションにリンクされ
ているジョブ本体(ユーザー側の制御ストラテジーに基
づくルーチン、あるいは、OS側で用意したサービスル
ーチン)を実行し、ステップS514で、割込みを禁止して
ルーチンを抜ける。
【0096】一方、上記ステップS510で、実行すべきジ
ョブが2msジョブでないときには、ステップS510から
ステップS520へ分岐し、実行すべきジョブが4msジョ
ブか否かを調べる。そして、4msジョブでないときに
は、ラベルALJ30へ分岐し、4msジョブのときに
は、ステップS521で、ジョブのワークエリアを設定する
と、ステップS522へ進む。尚、この4msジョブは、A
/D変換利用ジョブであり、後述するシステムシフトバ
ッファSSHBを介してA/D変換データを利用する。
【0097】ステップS522では、レベルゼロの割込みを
許可し、次いで、ステップS523へ進むと、スイッチ入力
を読み込み、ステップS524で、4msジョブのセクショ
ンに移って、リンクされているジョブ本体を実行する。
その後、4msジョブのセクションから抜けると、ステ
ップS525で、割込みを禁止し、ステップS526へ進んで、
システムシフトバッファSSHBをシフトしてルーチン
を抜ける。
【0098】上記システムシフトバッファSSHBは、
図21に示すように、8チャンネルの各A/D変換結果
がストアされる先頭オフセットアドレス0,+8,+1
6,+24,+32,+34,+36,+38番の各メ
モリ、及び、4ms毎のクランク同期のA/D変換結果
がストアされる先頭オフセットアドレス−2番地の1ワ
ードのメモリからなり、0.5ms毎に実行される1回
のA/D変換結果が1ワード(2バイト)でストアされ
る。
【0099】先頭オフセットアドレス0番地からは、4
段のシフトメモリとなっており、90°CA毎のA/D
変換結果がストアされ、最新4データ(1回転分)をジ
ョブから参照することができる。また、先頭オフセット
アドレス+32,+34,+36,+38番地は、各1
ワードのメモリであり、なまし処理機能が選択されたと
き、A/D変換結果を加重平均した値がストアされてノ
イズ除去と精度向上を図ることができるようになってお
り、これらのメモリのデータは、低速ジョブで利用でき
る。
【0100】また、各先頭オフセットアドレス+8,+
16,+24番地からは、各4ワードのメモリであり、
4msジョブで利用するようになっている。これらの各
メモリは、最新のA/D変換結果が先頭から数えて、4
msジョブのオーバーラップカウンタOLCの値だけ後
のワードにストアされ、4msジョブ実行に際し先頭ワ
ードからデータが読出され、ジョブの終了に伴って後の
各ワードのデータが順に先頭方向にシフトされるので、
先にストアしたデータから読出されるFIFOバッファ
となっている。
【0101】すなわち、A/D変換は、0.5ms毎の
定期割込みにより4ms周期で正確に行なわれるが、4
msジョブは優先度の高いジョブに邪魔されて遅れるこ
とがある。従って、A/D変換の受渡しにFIFOバッ
ファを用い、4msジョブで+8〜,+16〜,+24
〜番地の各FIFOバッファのデータを参照後、上記ス
テップS526で、各FIFOバッファのデータを順にシフ
トするのである。
【0102】一方、上記ステップS520で、実行すべきジ
ョブが4msジョブでなく、ラベルALJ30へ分岐し
たときには、ステップS530で、実行すべきジョブが10
msジョブか否かを調べ、10msジョブのとき、ステ
ップS531で、ジョブのワークエリアを設定し、ステップ
S532で、レベルゼロの割込みを許可すると、ステップS5
33で、10msジョブのセクションに移って、ジョブ本
体を実行し、ステップS534で割込みを禁止してルーチン
を抜ける。
【0103】尚、上記10msジョブのセクションに
は、半回転時間からエンジン回転数を算出するエンジン
回転数算出サブルーチン、後述する点火スケジュール作
成サブルーチンなどがサービスルーチンとしてOS側で
用意されている。
【0104】また、上記ステップS530で、実行すべきジ
ョブが10msジョブでないときには、上記ステップS5
30からステップS540へ分岐し、実行すべきジョブが低優
先クラセンジョブであるか否かを調べる。そして、低優
先クラセンジョブでないときには、上記ステップS540か
らラベルALJ50へ分岐し、実行すべきジョブが低優
先クラセンジョブのときは、上記ステップS540からステ
ップS541へ進んで、現在の状態が多重待ち状態であるか
否かを調べる。
【0105】そして、現在の状態が多重待ち状態でない
ときには、上記ステップS541からステップS542へ進ん
で、システム変数S_ACAS(クランク総合位置変
数)をユーザー変数ACASとしてステップS544へ進
み、多重待ち状態のときには、上記ステップS541からス
テップS543へ分岐し、ユーザー変数ACASを一つ増や
して12で割った剰余をとった後、ステップS544へ進
む。
【0106】ステップS544では、ジョブのワークエリア
を設定し、ステップS545で、レベルゼロの割込みを許可
すると、ステップS546で、低優先クラセンジョブのセク
ションに移り、ジョブ本体を実行した後、ステップS547
で割込みを禁止し、ルーチンを抜ける。
【0107】さらに、ラベルALJ50では、ステップ
S550で実行すべきジョブが50msジョブであるか否か
を調べ、50msジョブのときには、ステップS551へ進
んでジョブのワークエリアを設定し、ステップS552へ進
む。
【0108】ステップS552では、レベルゼロの割込みを
許可すると、ステップS553で、50msジョブのセクシ
ョンに移り、OS側で用意したエンスト処理ルーチン、
気筒別の点火時期リタードルーチン、燃料噴射開始時期
設定ルーチンなどを実行し、また、ユーザ側の制御スト
ラテジーに基づくルーチンを実行する。そして、ジョブ
の終了後、ステップS554で割込みを禁止し、ルーチンを
抜ける。
【0109】一方、上記ステップS550で実行すべきジョ
ブが50msジョブではないときには、上記ステップS5
50からステップS560へ分岐し、ジョブのワークエリアを
設定すると、ステップS561で、レベルゼロの割込みを許
可し、ステップS562へ進んで、250msジョブのセク
ション領域へ移行し、ジョブ本体を実行後、ステップS5
63で割込みを禁止してルーチンを抜ける。
【0110】以上のジョブ優先処理においては、クラン
ク位置を常に的確に把握しておく必要があり、クラセン
割込み毎に、図10に示すクランク位置算出サブルーチ
ンが実行されて前述したクランク位置変数S_CCA
S,S_RCAS,S_ACAS,S_ECASが算出
される。尚、以下の説明においては、システム変数であ
ることを示すS_をクランク位置変数から省略する。
【0111】このクランク位置算出サブルーチンでは、
まず、ステップS600で、クラセンタイマの下2バイトを
ソフトタイマの下2バイトにストアする。このクラセン
タイマはECU50に備えられたハードウエアタイマで
あり、本実施例においては、16ビットタイマで最大2
55msまで計数が可能であるが、メモリ上に3バイト
の連続した領域を確保し、ソフトタイマとして使用す
る。
【0112】すなわち、ソフトタイマの下2バイトにク
ラセンタイマの2バイトを転写し、クラセンタイマのオ
ーバーフローにより発生する割込みで3バイト目をカウ
ントアップすることにより、クラセン間隔を最大64s
ec(255ms×256)まで計数することが可能と
なり、16ビット以上の特別なハードウエアタイマを使
用することなく、クランキング時などクラセン間隔が極
めて長い場合にも容易に対応することができる。
【0113】次に、上記ステップS600からステップS601
へ進むと、クラセン間隔が設定時間以下か否かを調べ
る。この設定時間は、最大エンジン回転数に対応するク
ラセン間隔としての時間、例えば0.3msであり、上
記ステップS601でクラセン間隔が設定時間以下のときに
は、ノイズの混入などによるクラセンタイマの計数エラ
ーとしてステップS602でアキュムレータAにエラーコー
ド1を格納し、ルーチンを抜ける。また、上記ステップ
S601で、クラセン間隔が設定時間より長いときには、ク
ラセンタイマの計数が正常であるとしてステップS603へ
進む。
【0114】ステップS603では、後述するCCAS・R
CAS判別サブルーチンを実行してクランク位置を判別
し、ステップS604で、エラーレベルECASが2である
か否か、すなわち、クランキング時などのようにクラン
ク位置が不明の状態であるか否かを調べ、ECAS=2
のときには、ステップS605へ分岐してアキュムレータA
にエラーコード1を格納し、ルーチンを抜ける。
【0115】一方、上記ステップS604で、ECAS≠2
のときには、ステップS606へ進み、ソフトタイマの3バ
イト目を0とする。そしてステップS607へ進み、クラン
ク位置情報変数CCASが1であるか否か、すなわち、
現在のクランク位置がBTDC65°CA〜10°CA
の間(図19参照)であるか否かを調べ、CCAS=1
のときには、ステップS607からステップS609へジャンプ
し、CCAS≠1のときには、ステップS607からステッ
プS608へ進んで、A/D変換リクエストを1増加させ、
ステップS609へ進む。
【0116】このA/D変換リクエストは、クランク角
90°毎にクランク同期A/D変換を指示するためのフ
ラグ的な変数であり、0、1の値をとり、値が1のとき
クランク同期A/D変換を指示する。すなわち、前述し
たように、8チャンネルのA/D変換のうち1チャンネ
ルのA/D変換はクランク角90°毎に行なわれるが、
CCASが0になったとき(BTDC97°)と、CC
ASが2になったとき(BTDC10°)、クランク同
期のA/D変換リクエストをセットし、0.5ms毎の
A/D変換順番に対してクランク角90°毎のA/D変
換を割込ませるのである。
【0117】その後、ステップS609では、気筒情報変数
RCASを3倍してクランク位置情報変数CCASを加
算することによりクランク総合位置変数ACASを算出
すると(ACAS=RCAS×3+CCAS)、ステッ
プS610で、ソフトタイマを2バイトでリミットし、クラ
センタイマがオーバーフローしている場合には下2バイ
トをFFFF(255ms)としてステップS611へ進
む。
【0118】ステップS611では、クランク総合位置変数
ACAS=0,1,2,…,11を添字とする配列(の
要素)TCAS[ACAS]にクラセン間隔データをス
トアし、ステップS612で、クランク位置情報変数CCA
S=0,1,2を添字とする配列(の要素)MTCSX
[CCAS]にクラセン間隔データをストアする。
【0119】配列TCASは、図22(a)に示すよう
に、ACAS=0,1,2,…、11に対応するエンジ
ン2回転分のクラセン間隔データがストアされた12ワ
ードのクラセン間隔テーブルであり、配列MTCSX
は、図22(b)に示すように、CCAS=0,1,2
に対応する3ヶのクラセン間隔データがストアされた3
ワードのクラセン間隔テーブルである。
【0120】すなわち、上記ステップS603のCCAS・
RCAS判別サブルーチン(詳細は後述する)及びステ
ップS609により各情報変数CCAS,RCAS,ACA
Sが更新され、例えば、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のアドレスにストアする。
【0121】従って、クラセン入力によるクラセン割込
み毎に総合位置変数ACAS、クランク位置情報変数C
CASが更新される都度、配列TCAS,MTCSX内
のデータが順次更新されるので、配列TCASを参照す
ることにより、各気筒の各クランク位置におけるクラセ
ン間隔の変化(回転速度の変化)を知ることができ、各
気筒の失火の有無、燃焼状態などを判断することがで
き、全気筒の運転状況を把握することができる。また、
配列MTCSXを参照することにより、常に最新のクラ
セン間隔を得ることができ、現在の運転状況を迅速に把
握することができる。
【0122】次いで、ステップS613へ進むと、再び、エ
ラーレベルECASの値を調べる。ここでは、前述のス
テップS604においてECAS≠2であることを既に確認
してあるため、エラーレベルECASが1か否か、すな
わち、クランク位置の判別が不安の残る推定状態である
か否かを調べる。
【0123】上記ステップS613でECAS≠1(すなわ
ちECAS=0)であり、クランク位置が確証をもって
判別されているときには、上記ステップS613からステッ
プS614へ進んで、最新3ヶのクラセン間隔データの和
(配列MTCSXにストアされているクラセン間隔デー
タの和)を、3バイトの半回転時間MTCS18として
算出する(MTCS18=ΣMTCSX)。すなわち、
半回転時間MTCS18は、クラセン割込み毎にクラン
ク位置情報変数CCASが更新されて配列MTCSX内
のデータが更新される毎に算出され、BTDC97°,
65°,10°の各位置毎にクラセン間隔の移動和を取
ることにより常に最新のデータが得られるようになって
いる。
【0124】一方、上記ステップS613で、ECAS=1
であり、クランク位置の判別が不安の残る推定状態であ
るときには、配列MTCSXから半回転時間MTCS1
8を算出せず、ステップS615で半回転時間推定のサブル
ーチンを実行し、クランク位置情報変数CCASの値に
応じて半回転時間MTCS18を推定する。
【0125】すなわち、CCAS=0のとき、BTDC
10°〜ATDC83°(次の気筒のBTDC97゜)
間の角度93°から前回のクラセン間隔×180/93
を半回転時間MTCS18と推定し、CCAS=1のと
き、BTDC97°〜65°間の角度32°から、前回
のクラセン間隔×180/32を半回転時間MTCS1
8と推定する。さらに、CCAS=2のとき、BTDC
65°〜10°間の角度55°から前回のクラセン間隔
×180/55を半回転時間MTCS18と推定する。
【0126】そして、上記ステップS614で半回転時間M
TCS18を算出した後、あるいは、上記ステップS615
で半回転時間MTCS18を推定した後は、ステップS6
16へ進み、3バイトの半回転時間MTCS18を2バイ
トにリミットして所定の変数MTCSKにストアする
と、ステップS617で、この変数MTCSKを2倍して変
数MTCSK4にストアし、ステップS618で、正常終了
コード0をアキュムレータAに格納してルーチンを抜け
る。
【0127】そして、前述のジョブ実行サブルーチンに
おいて10ms毎にエンジン回転数が算出され、このエ
ンジン回転数は、3バイトの半回転時間MTCS18を
2バイトにリミットした変数MTCSKの逆数から算出
される。
【0128】詳述すると、毎分回転数rpmの単位時間
(1min)の半分の時間30secを半回転時間MT
CSKで割算することにより、1rpmを単位とする2
バイト単位の変数NRPM、すなわち、エンジン回転数
が算出され(NRPM=30sec/MTCSK)、こ
のエンジン回転数が基本パラメータの1つとして各種の
制御量演算処理に用いられるのである。
【0129】次に、図11に示されるCCAS・RCA
S判別サブルーチンについて説明する。このサブルーチ
ンでは、まず最初に、ステップS800で、カム角センカウ
ンタを0〜4にリミットする。このカムセンカウンタで
計数されるカム角センサ41からのカムパルスの数(ク
ラセン信号入力間のカムパルス数)は、図30に示すよ
うに、正常状態の場合0〜3であるが、ノイズなどの影
響により4以上の異常な計数値となるおそれがあるた
め、カムセンカウンタを0〜4にリミットして異常な状
態を4で代表するのである。
【0130】次に、ステップS801へ進み、カムセンカウ
ンタ(の計数値)、気筒情報変数RCAS、クランク位
置情報変数CCASから、5×4×2の組合わせ(カム
センカウンタが0〜4の5種類、気筒情報変数RCAS
が0〜3の4種類、クランク位置情報変数CCASが
0,1と2の場合の2種類)に対する状態データがスト
アされている気筒・クランク位置状態マップCCHMA
Pを読む。
【0131】この気筒・クランク位置状態マップCCH
MAPは、図23(a)及び(b)に示すように、クラ
ンク位置情報変数CCASが0あるいは1の場合と、気
筒情報変数RCASの変化点であるクランク位置情報変
数CCASが2の場合とに分け、カムセンカウンタと気
筒情報変数RCASの各組合わせの起こり得る全ての状
態に対し、正常か異常か、確定して良いか推定すべきか
を示す状態データがストアされており、現在の状態を評
価し、次にとるべき状態を知ることができる。
【0132】上記状態データは2ビットのデータであ
り、ビット0の値により確定か推定かを表わし、ビット
1の値により正常か異常かを表わす。ビット0の値は、
0のとき確定、1のとき推定を示し、図30からわかる
ように、カムセンカウンタが2,3の場合にのみ確定で
あって、それ以外は推定せざるを得ない状態である。ま
た、ビット1の値は、0のとき正常、1のとき異常を示
し、カムセンカウンタが3以下で、且つ、図19及び図
30による組合せに合致する場合のみ正常であって、そ
れ以外は異常な状態である。
【0133】例えば、CCAS=0あるいは1、すなわ
ち、ある気筒のBTDC97°〜10°に対し、カムセ
ンカウンタが0で気筒情報変数RCASが0となる組合
せは、図19及び図30からもわかるように、クランク
位置を正常に推定すれば良い状態であるため、気筒・ク
ランク位置状態マップCCHMAPの該当領域に2進数
で01(正常推定)の状態データがストアされており、
さらに、カムセンカウンタが1で気筒情報変数RCAS
が0となる組合せは、明らかに異常であって推定するし
かない状態であるため、気筒・クランク位置状態マップ
CCHMAPの該当領域に2進数で11(異常推定)の
状態データがストアされている。
【0134】また、CCAS=2、すなわち、ある気筒
のBTDC10°〜ATDC83°に対し、カムセンカ
ウンタが3で気筒情報変数RCASが0となる組合せ
は、#1気筒のTDCを挟んだクランク位置と正常に確
定できるため、気筒・クランク位置状態マップCCHM
APの該当領域に2進数で00(正常確定)の状態デー
タがストアされており、さらに、カムセンカウンタが2
で気筒情報変数RCASが0となる組合せは、明らかに
異常ではあるがカムセン入力が2ヶある以上確定せざる
を得ない状態であるため、気筒・クランク位置状態マッ
プCCHMAPの該当領域に2進数で10(異常確定)
の状態データがストアされている。
【0135】そして、上記ステップS801で気筒・クラン
ク位置状態マップCCHMAPから状態データを読込む
と、ステップS802へ進み、エラーレベルECASが2で
ないか否か、すなわち、現在の状態が気筒判別のなされ
ていない不明な状態であるか否かを調べ、ECAS=2
のときには、ステップS803で気筒・クランク位置状態マ
ップCCHMAPから読込んだ状態データのビット0が
0か否か、すなわち確定状態か否かを調べ、確定状態の
ときにはステップS804へ進み、確定状態でなく推定状態
であるときにはルーチンを抜けて確定状態となるまで待
つ。
【0136】一方、上記ステップS802でECAS≠2の
ときにはステップS804へ進んで、推定状態か否かを調
べ、確定状態、推定状態に応じてステップS805以降の処
理あるいはステップS812以降の処理へ進む。また、上記
ステップS803において確定状態でステップS804へ進んだ
ときには、ステップS805以降の処理へ進む。
【0137】まず、ステップS805以降の処理について説
明すると、このステップS805へ進んだときには、正常、
異常に拘らず気筒判別がなされた確定状態であるため、
図30のタイムチャートからもわかるように、今回のク
ラセン割込みはカムパルスが3ヶあるいは2ヶ入力され
た後のBTDC97°の割込みであるため、クランク位
置情報変数CCASを0にする。
【0138】次いで、ステップS806へ進んでカムセンカ
ウンタが3でないか否かを調べ、カムセンカウンタが3
でないとき、すなわちカムセンカウンタが2のときに
は、#2気筒の点火後であるため、ステップS807で気筒
情報変数RCASを3にしてステップS809へ進み、カム
センカウンタが3のときには、#1気筒の点火後である
ため、ステップS808で気筒情報変数RCASを1にして
ステップS809へ進む。
【0139】ステップS809では、更新したクランク位置
情報変数CCAS、気筒情報変数RCAS、及び、カム
センカウンタをパラメータとして再び気筒・クランク位
置状態マップCCHMAPから状態データを読込み、こ
の状態データのビット1が1であるか、すなわち異常状
態であるか否かを調べる。
【0140】その結果、上記ステップS809において、状
態データのビット1が1で異常状態と判定されるときに
は、クランク位置情報変数CCAS、気筒情報変数RC
ASの更新結果は不安の残る推定であるとしてステップ
S810でエラーレベルECASを1にしてルーチンを抜
け、状態データのビット1が0であり正常状態であると
きには、ステップS811でエラーレベルECASを0とし
てルーチンを抜ける。
【0141】一方、ステップS812以降の処理では、ステ
ップS812で、現在のクランク位置情報変数CCAS(前
回のクラセン割込みで算出されたクランク位置情報変数
CCAS)が2、すなわち、気筒情報変数RCASの変
化点であるか否かを調べ、CCAS=2のときには、ス
テップS812からステップS813へ進んで、気筒情報変数R
CASを1増加させ、ステップS814でクランク位置情報
変数CCAS=0にしてステップS817へ進む。
【0142】一方、上記ステップS812で、CCAS≠2
のときには、上記ステップS812からからステップS815へ
進んでカムセンカウンタが0でないか否かを調べ、カム
センカウンタが0でないときには、前述のステップS813
へ分岐し、カムセンカウンタが0のときには、ステップ
S816でクランク位置情報変数CCASを1増加させ、ス
テップS817へ進む。
【0143】ステップS817では、更新したクランク位置
情報変数CCAS、気筒情報変数RCAS、及び、カム
センカウンタをパラメータとして再び気筒・クランク位
置状態マップCCHMAPから状態データを読込んで異
常状態であるか否かを調べ、状態データのビット1が0
であり、正常状態であるときには、そのまま(現在のエ
ラーレベルECAS=0のまま)ルーチンを抜ける。ま
た、上記ステップS817で、状態データのビット1が1で
異常状態のときには、ステップS818へ進み、クランク位
置情報変数CCAS、気筒情報変数RCASの更新結果
は不安の残る推定であるとしてエラーレベルECASを
1にし、ルーチンを抜ける。
【0144】以上の0.5ms毎の定期割込み処理とク
ラセン割込み処理により、ユーザー側の制御ストラテジ
ーに基づく各ジョブが優先処理され、例えば10msジ
ョブ中の点火時期設定ルーチンにより、吸入空気量、エ
ンジン回転数などのエンジン運転状態に応じて点火時期
の指示値(角度)IG_DEGが設定されると、この指
示点火時期IG_DEGに基づいて、OS側で用意した
点火スケジュール作成サブルーチンで点火スケジュール
が作成され、点火シーケンスが決定される。
【0145】上記指示点火時期IG_DEGは、圧縮上
死点より遅角側を負として−60°〜+97°の範囲で
設定可能であり、点火シーケンスの決定に際しては、ク
ランク位置変数を用いて点火区間変数を設定し、この点
火区間変数によって示される区間を基準として上記点火
スケジュールを作成する。
【0146】上記点火区間変数は、図24に示すよう
に、気筒情報変数RCASを用いて点火コイル26aへ
の通電、点火のシーケンスを行なう対象気筒を示す点火
気筒情報変数IGRCAS、クランク位置情報変数CC
ASを用いて通電終了すなわち点火が行なわれる区間を
示す点火クランク位置情報変数IGCCAS、クランク
位置情報変数CCASを用いて点火コイル26aへの通
電が開始されるべき区間を示すドエル開始クランク位置
情報変数DWCCASであり、上記点火クランク位置情
報変数IGCCASは、0,1,2の値をとり、上記ド
エル開始クランク位置情報変数DWCCASは、ドエル
が点火に先立って前の行程に入り込むことがあるため、
−3,−2,−1,0,1,2の値をとる(但し、点火
クランク位置情報変数IGCCASより大きな値はとれ
ない)。
【0147】さらに、上記ドエル開始クランク位置情報
変数DWCCASによって示される区間の中で、どの程
度待ってから通電を開始すべきかの通電開始待ち時間、
すなわち通電を開始する区間となってから点火コイルへ
の通電を開始するまでの時間をドエルオン待ち時間TD
W_ONで示し、上記点火クランク位置情報変数IGC
CASによって示される区間の中で、どの程度待ってか
ら通電を終了すべきかの通電終了待ち時間、すなわち点
火を実行する区間となってから点火コイルへの通電を遮
断するまでの時間をドエルオフ待ち時間TDW_OFで
示す。
【0148】そして、通電開始及び通電終了の区間デー
タと、通電開始待ち時間及び通電終了待ち時間の時間デ
ータとを点火スケジュールとして10ms毎に作成す
る。すなわち、図25に示すように、1バイトの上記ド
エル開始クランク位置情報変数DWCCAS、2バイト
の上記ドエルオン待ち時間TDW_ON、1バイトの上
記点火クランク位置情報変数IGCCAS、2バイトの
上記ドエルオフ待ち時間TDW_OFをメンバーとする
構造体変数を点火スケジュールとして所定のメモリ領域
に記録する。
【0149】この場合、上記点火スケジュールは、先頭
オフセットアドレス+0,+6,+12からの各6バイ
トのメモリ領域に、3枚の点火スケジュールIGSCD
L1,IGSCDL2,IGSCDL3がストアされる
ようになっており、後述するスケジュールポインタに従
って、10msジョブ中の点火スケジュール作成サブル
ーチンで書込みが行なわれるとともに、クラセン割込み
の点火タイマセットで使用される。尚、この場合、1つ
の点火シーケンスの途中ではスケジュール変更は行なわ
ず、後述する点火終了時割込みで最新のスケジュールが
採用される。
【0150】従来では、点火時期の指示値を設定し、こ
の指示値に基づいて点火シーケンスを決定して点火タイ
マにセットするという一連の処理は、全てクラセン割込
み時に行なっており、負荷が重いためエンジン高回転時
に支障をきたすおそれがあったが、本発明では、10m
s毎に点火スケジュールを作成し、この点火スケジュー
ルに従ってクラセン割込みで点火タイマにセットするた
め、エンジン高回転においても負荷が増大することな
く、正確に点火制御を行なうことができるのである。
【0151】次に、上記点火スケジュールの作成につい
て、図12〜図15のフローチャートに従って説明す
る。
【0152】この点火スケジュール作成サブルーチンで
は、まず、ステップS1200で、ユーザージョブ側で設定
した指示ドエル時間ITDWLを半回転時間MTCS1
8でリミットすることにより、各気筒に配設した点火コ
イル26aに対して同時に2つの点火コイルには通電し
ないようにし、リミットした値を実ドエル時間TDWL
とし、点火コイル26aに対する通電継続時間のデータ
としてRAM60の所定アドレスにストアする。
【0153】次いで、ステップS1201へ進み、処理遅れ
時間を含めたドエル時間を見かけ上のドエル時間D_T
DWLとし、ステップS1202で、処理遅れ時間に相当す
るむだ角度をDM_DEGとする。この処理遅れ時間
は、クラセン割込みが入ってから実際に点火タイマがセ
ットされるまでの処理遅れ時間であり、後述する点火タ
イマセットサブルーチンにおいて処理遅れ時間の最大値
が記録される。
【0154】次に、上記ステップS1202からステップS12
03へ進むと、エラーレベルECASがゼロでないか否
か、すなわち気筒及びクランク位置が判別されているか
否かをを調べ、ECAS≠0で気筒及びクランク位置が
判別されていないときにはルーチンを抜け、ECAS=
0のとき、ステップS1204へ進んで、新しいスケジュー
ルポインタをXレジスタに保存する。
【0155】上記スケジュールポインタは、10msジ
ョブで使用するスケジュールポインタIGSCUSと、
クラセン割込みで使用するスケジュールポインタIGS
CPTとがあり、いずれも、0,6,12の値をとる。
そして、クラセン割込みで採用されて現在実行中の点火
スケジュールを示すスケジュールポインタIGSCPT
と、前回、点火スケジュールを作成したときのスケジュ
ールポインタIGSCUSとの論理和をとり、この論理
和の値をパラメータとして図26に示すスケジュールポ
インタテーブルIGSTBLを検索し、3枚の点火スケ
ジュールIGSCDL1,IGSCDL2,IGSCD
L3のうち、新たに書込みを行なう点火スケジュールを
選択する。
【0156】例えば、現在実行されている点火スケジュ
ールへのポインタIGSCPTが0(点火スケジュール
IGSCDL1)であり、前回作成した点火スケジュー
ルへのポインタIGSCUSが6(点火スケジュールI
GSCDL2)である場合、0と6の論理和6に対応す
るスケジュールポインタテーブルIGSTBLのアドレ
スには、次にデータを書込むべき点火スケジュールIG
SCDL3を指定するポインタの値12がストアされて
おり、この12が新しいスケジュールポインタとしてX
レジスタにストアされ、点火スケジュールIGSCDL
3に書込みが行なわれた後、Xレジスタからスケジュー
ルポインタIGSCUSに保存される。
【0157】すなわち、点火スケジュールが2枚である
と、エンジン高回転においてはクラセン割込みが頻繁に
発生するため、使用していない点火スケジュールのデー
タを10msジョブで書換え中に次のクラセン割込みが
発生し、新たな点火スケジュールを採用することができ
なくなる。また、エンジン低回転では、使用していない
点火スケジュールのデータの書換えが完了してもクラセ
ン割込みが入らずに次のデータ書換え対象スケジュール
が採用中のスケジュールとなってしまう。このため、点
火スケジュールを3枚とし、10ms毎に作成した点火
スケジュールデータを非同期のクラセン割込みに対して
円滑に渡すことができるようにするのである。
【0158】その後、上記ステップS1204からステップS
1205へ進むと、BTDC10°より前に点火が指示され
ているか否かを調べるため、10から指示点火時期IG
_DEGを減算して差をアキュムレータAにストアし、
ステップS1206で、アキュムレータAの内容と処理遅れ
時間に相当するむだ角度DM_DEGとを比較する。そ
の結果、A<DM_DEGであり、処理遅れ時間を含ん
でBTDC10°より前の点火であるときには、ラベル
IGS10で示されるステップS1300以降の処理へ進
み、A≧DM_DEGであり、処理遅れ時間を含んでB
TDC10°〜ATDC83°の間の点火であるときに
は、ステップS1207へ進む。
【0159】ステップS1207では、アキュムレータAの
内容を70でリミットしてATDC60°以降では点火
が行なわれないようにし、ステップS1208で、半回転前
のクラセン間隔に基づいてドエルオフ待ち時間TDW_
OFを算出する。具体的には、クラセン間隔テーブルM
TCSXからBTDC10°〜ATDC83°の区間を
示すクランク位置情報変数CCASの値2に対応するク
ラセン間隔を読出し、アキュムレータAの内容をCCA
S=2の区間のクランク角の値93で割った値を、読出
したクラセン間隔に掛け、この値を新たなアキュムレー
タAの内容とする。そして、この新たなアキュムレータ
Aの内容をドエルオフ待ち時間TDW_OFとするので
ある。
【0160】すなわち、エンジンの回転は、大局的には
半回転周期で変動するため、同じ測定区間の最新のクラ
セン間隔を用いてドエルオフ待ち時間TDW_OFを算
出することにより、定常的なクランク角度毎の回転変動
誤差を取り除いて、燃焼の強さ、フライホイール重量、
変速比、ピストン重量などの影響を受けなくすることが
でき、正確な点火設定が可能となる。
【0161】次に、上記ステップS1208からステップS12
09へ進むと、BTDC10°〜ATDC83°の区間を
示すCCAS=2の値をアキュムレータBにストアし
て、このアキュムレータBの内容を点火クランク位置情
報変数IGCCASの値とし、ステップS1210で、アキ
ュムレータAの内容すなわちドエルオフ待ち時間TDW
_OFと見かけ上のドエル時間D_TDWLとを比較す
る。
【0162】そして、A>D_TDWLであり、同じ区
間でドエル開始が可能なとき、上記ステップS1210から
ラベルIGS90で示されるステップS1460以降の処理
へ分岐し、A≦D_TDWLであり、同じ区間でドエル
を開始できないときには、ステップS1211へ進んでアキ
ュムレータBの内容を1減算すると、ステップS1212
で、アキュムレータAの内容を、IGCCAS=1に対
応する1つ前の区間のクラセン間隔を加算した値とし、
ラベルIGS15で示されるステップS1350以降の処理
へ進む。
【0163】一方、上記ステップS1206で、A<DM_
DEGであり、処理遅れ時間を含んでBTDC10°よ
り前の点火が指示されてラベルIGS10以降の処理へ
進んだときには、ステップS1300で、BTDC65°よ
り前に点火が指示されているか否かを調べるため、65
から指示点火時期IG_DEGを減算して差をアキュム
レータAにストアし、ステップS1301で、アキュムレー
タAの内容と処理遅れ時間に相当するむだ角度DM_D
EGとを比較し、A<DM_DEGであり、処理遅れ時
間を含んでBTDC65°より前の点火であるときに
は、BTDC97°より前の点火か否かを調べるため、
さらにラベルIGS20で示されるステップS1400以降
の処理へ進み、A≧DM_DEGであり、処理遅れ時間
を含んでBTDC65°〜BTDC10°の間の点火で
あるときには、ステップS1302へ進む。
【0164】ステップS1302では、BTDC65°〜1
0°の区間を示すクランク位置情報変数CCASの値1
に対応してクラセン間隔テーブルMTCSXから読出し
たクラセン間隔に、アキュムレータAの内容をCCAS
=1の区間のクランク角の値55で割った値を掛けて新
たなアキュムレータAの内容とし、この新たなアキュム
レータAの内容をドエルオフ待ち時間TDW_OFとす
る。そして、ステップS1303で、CCAS=1の値をア
キュムレータBにストアし、このアキュムレータBの内
容を点火クランク位置情報変数IGCCASの値として
ステップS1350へ進む。
【0165】ステップS1350,S1351,S1352は、前述した
ステップS1210,S1211,1212と同様の処理であり、同じ区
間でドエル開始が可能か否かを判定して、同じ区間でド
エルを開始できるときには、ラべルIGS90以降の処
理へ分岐し、同じ区間でドエルを開始できないときに
は、ドエルオフ待ち時間TDW_OFを1つ前の区間の
クラセン間隔を加算した値とする処理である。
【0166】すなわち、ステップS1350で、アキュムレ
ータAの内容すなわちドエルオフ待ち時間TDW_OF
と見かけ上のドエル時間D_TDWLとを比較し、A>
D_TDWLのとき、ステップS1350からラベルIGS
90以降の処理へ分岐し、A≦D_TDWLのとき、ス
テップS1351でアキュムレータBの内容を1減算し(B
=0)、ステップS1352で、アキュムレータAの内容
を、点火クランク位置情報変数IGCCAS=0に対応
する区間のクラセン間隔を加算した値としてラベルIG
S25で示されるステップS1450以降の処理へ進む。
【0167】一方、ラベルIGS20で示されるステッ
プS1400以降の処理では、ステップS1400で、BTDC9
7°より前に点火が指示されているか否かを調べるた
め、97から指示点火時期IG_DEGを減算して差を
アキュムレータAにストアし、ステップS1401で、アキ
ュムレータAの内容と処理遅れ時間に相当するむだ角度
DM_DEGとを比較する。
【0168】そして、上記ステップS1401で、A<DM
_DEGであり、処理遅れ時間を含んでBTDC97°
より前の点火であるときには、上記ステップS1401から
ステップS1402へ分岐してアキュムレータAの内容を処
理遅れ時間に相当するむだ角度DM_DEGとして最大
進角を制限してステップS1403へ進み、上記ステップS14
01で、A≧DM_DEGであり、処理遅れ時間を含んで
BTDC97°〜BTDC65°の間の点火であるとき
には、ステップS1403へ進む。
【0169】ステップS1403では、BTDC97°〜6
5°の区間を示すクランク位置情報変数CCASの値0
に対応してクラセン間隔テーブルMTCSXから読出し
たクラセン間隔に、アキュムレータAの内容をCCAS
=0の区間のクランク角の値32で割った値を掛けて新
たなアキュムレータAの内容とし、この新たなアキュム
レータAの内容をドエルオフ待ち時間TDW_OFとす
る。
【0170】次いで、ステップS1404へ進み、CCAS
=0の値をアキュムレータBにストアし、このアキュム
レータBの内容を点火クランク位置情報変数IGCCA
Sの値としてステップS1450へ進む。ステップS1450以降
の処理は、先のステップS1210,S1211,S1212及びステッ
プS1350,S1351,S1352と同様、同じ区間でドエル開始が
可能か否かを判定して、同じ区間でドエルを開始できる
ときには、ラべルIGS90以降の処理へ分岐し、同じ
区間でドエルを開始できないときには、ドエルオフ待ち
時間TDW_OFを1つ前の区間のクラセン間隔を加算
した値とする処理の繰返しである。
【0171】すなわち、ステップS1450,S1451,S1452の
処理、ステップS1453,S1454,S1455の処理、ステップS14
56,S1457,S1458の処理で、A≦D_TWDLであり、ラ
べルIGS90へ分岐しないとき、アキュムレータBの
内容を、B=−1、B=−2、B=−3と順に減らして
区間を1つずつ前にし、ドエルオフ待ち時間TDW_O
Fを次々に延長してゆく。
【0172】そして、ステップS1456〜S1458を経てアキ
ュムレータBの内容が−3に達し、ステップS1459でA
>D_TDWLとなったとき、ステップS1459からラベ
ルIGS90のステップS1460へ進み、依然としてA≦
D_TDWLのときには、ステップS1459からステップS
1461へ進んで、アキュムレータAの内容を処理遅れ時間
としてステップS1462へ進む。
【0173】ラベルIGS90のステップS1460では、
ドエルオフ待ち時間TDW_OFから逆算してドエルオ
ン待ち時間TDW_ONを算出するため、アキュムレー
タAの内容すなわちドエルオフ待ち時間TDW_OFか
ら実ドエル時間TDWLを減算して新たなアキュムレー
タAの内容とし、ステップS1462へ進む。
【0174】そして、ステップS1462で、アキュムレー
タAの内容をドエルオン待ち時間TDW_ONとし、ま
た、ステップS1463で、アキュムレータBの内容をドエ
ル開始クランク位置情報変数DWCCASの値として点
火スケジュールの書換えを終了すると、ステップS1464
へ進んで、Xレジスタの値をスケジュールポインタIG
SCUSに保存し、ルーチンを抜ける。
【0175】以上の点火スケジュールが10ms毎に作
成されると、クラセン割込み時に、点火タイマがセット
される。この点火タイマは、図27に示すように、モー
ドM1の出力パターン、あるいは、モードM2の出力パ
ターンで動作し、モードM1では、初期値T1、リロー
ド値T2をタイマにセットしてスタートさせると、時間
T1が経過したとき、出力がローレベル(点火コイル非
通電)からハイレベル(点火コイル通電)となり、時間
T2経過後にローレベルとなる一方、モードM2では、
初期値T3、リロード値FFFF(時間規定せず)をタ
イマにセットして出力がハイレベルの状態でタイマをス
タートさせると、時間T3経過後に出力がローレベルと
なる。
【0176】この場合、通常のクラセン割込みでは、モ
ードM1でドエル開始時間及びドエル時間をセットする
通常の通電シーケンスが採用され、エンジン高回転時な
ど、点火の時間間隔が短くなり、クラセン割込み時に既
に点火コイル26aへの通電が行なわれている状態で点
火区間となったとき、モードM2でドエルオフ時間をセ
ットする通電シーケンスが採用される。
【0177】この通電シーケンスは、エンジン回転数の
高低、ドエル時間の大小、回転数の急変、点火時期の急
変などによって決まり、後述する点火終了時の割込み処
理において最新の点火スケジュールから現在の通電状態
が調べられ、直ちに次のドエルを開始すべきどうかを判
別することにより、2種類の通電シーケンスのいずれか
が選択される。そして、クラセン割込み時の点火タイマ
セットサブルーチンにおいて通電シーケンスが判別さ
れ、通電シーケンスに応じて点火タイマがセットされ
る。
【0178】以下、まず、点火タイマセットサブルーチ
ンについて図1及び図2のフローチャートに従って説明
する。
【0179】この点火タイマセットサブルーチンでは、
ステップS1500で、エラーレベルECASが2であるか
否か、すなわち、気筒及びクランク位置の判別がなされ
ていない不明の状態であるか否かを調べ、ECAS=2
のときには、そのままルーチンを抜け、ECAS≠2の
とき、ステップS1501へ進んで、点火時期未設定フラグ
IGTMNSがセットされているか否かを調べる。
【0180】上記点火時期未設定フラグIGTMNS
は、後述する点火終了割込みにおいて点火タイマにドエ
ルオンの時間のみがセットされ、ドエルオフの時間がセ
ットされずにドエルが開始されて点火のタイミングが未
設定の状態にあることを示すフラグであり、上記ステッ
プS1501で、点火時期未設定フラグがセットされてお
り、点火コイル26aへ通電中であるときには、ラベル
TENS30で示されるステップS1530以降の処理へ分
岐してドエルオフ待ち時間→点火のモードM2による通
電シーケンスを点火タイマに設定し、点火時期未設定フ
ラグがセットされていないときには、上記ステップS150
1からステップS1502へ進む。
【0181】ステップS1502では、後述する点火終了時
割込みにおいて採用された最新の点火スケジュールから
読出したドエル開始クランク位置情報変数DWCCAS
の指示値によるドエル開始区間を横軸、クランク総合位
置変数ACASを縦軸として通電状態マップIGCTB
Lを参照する。
【0182】上記通電状態マップIGCTBLは、点火
スケジュールが各気筒共通の点火シーケンスを表わすも
のであるに対し、図28に示すように、クランク総合位
置変数ACASと、ドエル開始クランク位置情報変数D
WCCASあるいは点火クランク位置情報変数IGCC
ASの指示値とに基づいて、ある時点での気筒毎の点火
コイル26aへの通電状態を1バイトのマップ値で表わ
したものである。
【0183】上記通電状態マップIGCTBLのマップ
値は、上位4ビットが、値0で今現在、値Fで一回遅
れ、値Eで2回遅れの遅れ状況を表わし、下位4ビット
が通電対象気筒を示すデータとして気筒情報変数RCA
Sを表わし、点火気筒情報変数IGRCASとして採用
される。例えば、ドエル開始クランク位置情報変数DW
CCASが−1で現在のクランク位置総合変数ACAS
が3であれば、マップ値はF1であり、これは、RCA
S=1すなわち#3気筒に対するドエルが1つ前の区間
で始まっているべきであったことを表わす。また、例え
ば、点火クランク位置情報変数IGCCASが2で現在
のクランク位置総合変数ACASが11であれば、マッ
プ値は03であり、これは、RCAS=3すなわち#4
気筒に対する点火が今の区間で行なわれるべきであるこ
とを表わす。
【0184】これにより、現在の区間に対してあるべき
通電状態を効率的に判別することができ、条件判断の繁
雑化によるメモリ容量の増大や処理速度の低下を抑えて
精密且つ高速な点火制御を可能とすることができるので
ある。
【0185】その後、上記ステップS1502からステップS
1503へ進むと、上記通電状態マップIGCTBLの参照
結果から今ドエル開始区間でないか否かを判断し、ドエ
ル開始区間でないときにはルーチンを抜け、ドエル開始
区間であるときには、ステップS1504へ進んで、点火タ
イマが作動中であることを示すタイマ作動中フラグFL
G_IGを参照してタイマが終了しているか否かを調
べ、タイマが終了していないときにはルーチンを抜け、
タイマが終了しているとき、ステップS1505で点火気筒
情報変数IGRCASを決定し、ラベルTENS70で
示されるステップS1570以降の処理へ進んで、待ち時間
→ドエルオン→ドエル時間→点火のモードM1による通
電シーケンスを点火タイマに設定する。
【0186】次に、ラベルTENS30以降のモードM
2による点火タイマのセット、及び、ラベルTENS7
0以降のモードM1による点火タイマのセットについて
説明する。
【0187】まず、ラベルTENS30以降では、ステ
ップS1530で、点火スケジュールの点火クランク位置情
報変数IGCCASの指示値による点火区間を横軸、ク
ランク総合位置変数ACASを縦軸として通電状態マッ
プIGCTBLを参照し、ステップS1531で、今点火区
間でないか否かを調べる。そして、点火区間でないとき
にはルーチンを抜け、点火区間のとき、ステップS1531
からステップS1532へ進んで、アキュムレータBに値F
FFFをストアし、ステップS1533で、点火タイマの出
力パターンをモードM2とする。
【0188】次に、ステップ1534へ進み、点火スケジュ
ールから読出したドエルオフ待ち時間TDW_OFに対
して現在の処理遅れ時間を減算し、その値をアキュムレ
ータAにストアすると、ステップS1535で、アキュムレ
ータAの内容が正の値であり、正常であるか否かを調べ
る。
【0189】上記ステップS1535において、A>0であ
り、正常であるときには、上記ステップS1535からステ
ップS1580へ進んで、アキュムレータAの内容を気筒別
のリタード時間を加算した新たな内容とする。この気筒
別のリタード時間は、50msジョブにおいて、気筒別
のリタード角度からリタード時間に変換されたものであ
り、このクラセン割込み時の点火タイマセットの際に加
算することにより、極めて容易に気筒別にリタードを行
なうことができる。
【0190】その後、ステップS1581へ進み、新たなア
キュムレータAの内容、すなわち気筒別のリタード時間
を加算したドエルオフ時間をタイマ初期値とし、ステッ
プS1582で、アキュムレータBの内容をタイマリロード
値として、ステップS1595で、点火タイマをスタートさ
せる。
【0191】すなわち、点火コイル通電中で点火区間と
なったクラセン割込みから、点火スケジュールのドエル
オフ待ち時間TDW_OFから現在の処理遅れ時間を減
算して気筒別のリタード時間を加算した時間に達したと
き、点火タイマの出力がハイレベルからローレベルとな
って点火(ドエルオフ)が行なわれる。尚、この場合、
点火タイマの出力がローレベルとなってからは、タイマ
リロード値がFFFFにセットされているため、ローレ
ベルの状態をそのまま継続する。
【0192】そして、点火タイマをスタートさせた後、
ステップS1596へ進み、タイマ作動中であることを示す
ためタイマ作動中フラグFLG_IGをセットすると、
ステップS1597で、点火時期未設定フラグIGTMNS
をクリアしてルーチンを抜ける。
【0193】一方、上記ステップS1535において、アキ
ュムレータAの内容すなわちドエルオフ待ち時間TDW
_OFから現在の処理遅れ時間を減算した値が、通常起
こり得ないA≦0の状態となったときには、点火タイマ
には負の時間はセットできないため、上記ステップS153
5からステップS1590へ分岐してタイマ初期値を0とし、
ステップS1591で、アキュムレータBの内容をタイマリ
ロード値としてステップS1592へ進む。
【0194】ステップS1592では、現在の処理遅れ時間
が記録値ICTIMEを越えたか否かを調べ、記録値I
CTIMEを越えていないときには、ステップS1594で
エラーフラグをセットし、記録値ICTIMEを越えて
いるときには、ステップS1593で、処理遅れ記録を更新
して記録値ICTIMEの最大値を書換えた後、ステッ
プS1594でエラーフラグをセットし、前述のステップ159
5〜S1597を経てルーチンを抜ける。
【0195】上記記録値ICTIMEは、次の点火スケ
ジュール作成の際に用いられ、この記録値ICTIME
による処理遅れ時間を見込んでおくことにより、次の点
火タイマセットで二度とエラーが生じないようにするこ
とができる。
【0196】次に、ラベルTENS70以降の処理につ
いて説明すると、ステップS1570で、モードM1の出力
パターンを設定し、ステップS1571で、各気筒の点火コ
イル26aに対応するイグナイタ27内の駆動回路を選
択するためのロジック上のデストリビュータを選択す
る。
【0197】次いで、ステップS1572へ進み、点火スケ
ジュールから読出したドエルオン待ち時間TDW_ON
に対して現在の処理遅れ時間を減算し、その値をアキュ
ムレータAにストアすると、ステップS1573へ進んで、
アキュムレータBに実ドエル時間TDWLをストアす
る。
【0198】そして、上記ステップS1573からステップS
1574へ進み、アキュムレータAの内容すなわちドエルオ
ン時間TDW_ONが正の値で正常であるか否かを調
べ、A>0のとき、前述のステップS1580以降へ進み、
ステップS1580,S1581,S1582を経て、アキュムレータA
の内容を気筒別のリタード時間を加算した新たな内容と
してタイマ初期値とし、アキュムレータBの内容すなわ
ち実ドエル時間TDWLをタイマリロード値として点火
タイマをスタートさせ、前述のステップS1595,S1596,S1
597を経てルーチンを抜ける。
【0199】すなわち、クラセン割込み時に、点火時期
未設定フラグIGTMNSがセットされておらず点火コ
イル26aが通電されていないときには、通電状態マッ
プIGCTBLから今回のクラセン割込みの状態を判別
し、今回のクラセン割込みがドエル開始区間のとき、点
火スケジュールのドエルオン待ち時間TDW_ONから
現在の処理遅れ時間を減算して気筒別のリタード時間を
加算した時間を点火タイマにセットし、設定時間経過後
に点火タイマの出力をローレベルからハイレベルとして
点火コイル26aへの通電を開始し、実ドエル時時間T
DWLが経過した後に通電を終了して点火を行なうので
ある。
【0200】また、上記ステップS1574において、A≦
0のときには、上記ステップS1574から前述のステップS
1590以降へ進み、同様に、タイマ初期値を0、アキュム
レータBの内容をタイマリロード値として、現在の処理
遅れ時間が記録値ICTIMEを越えているとき、処理
遅れ記録を更新する。
【0201】以上の点火タイマセットサブルーチンによ
り点火タイマがセットされ、点火が行なわれると、図1
6に示す点火終了時割込みが発生する。
【0202】この点火終了時割込みでは、まず最初に、
ステップS1600でドエルオフ時であるか否かを調べ、ド
エルオフ時でないときには割込みを終了し、ドエルオフ
時のみ、ステップS1601以降へ進んで、所定の処理を行
なう。
【0203】すなわち、ステップS1601で、点火タイマ
の停止・クリアを行ない、ステップS1602で、タイマ作
動中フラグFLG_IGをクリアすると、ステップS160
3へ進み、前述の点火スケジュール作成サブルーチンに
おいて使用した最新の点火スケジュールを指示するスケ
ジュールポインタIGSCUSの値を、スケジュールポ
インタIGSCPTにコピーし、このスケジュールポイ
ンタIGSCPTによって指定されるアドレスの最新の
点火スケジュールを採用する。
【0204】次いで、ステップS1604へ進み、点火スケ
ジュールのドエル開始クランク位置情報変数DWCCA
Sと現在のクランク総合位置変数ACASとをパラメー
タとして、通電状態マップIGCTBLからマップ値を
読出して下位4ビットから現在の点火気筒情報変数IG
RCASを調査し、ステップS1605で、現在の点火気筒
情報変数IGRCASが今までと同じ値であるか否かを
調べる。
【0205】その結果、現在の点火気筒情報変数IGR
CASが今までと同じときには、同じ気筒にもう一度点
火する必要がないため、割込みを終了し、現在の点火気
筒情報変数IGRCASが今までと異なるときには、上
記ステップS1605からステップS1606へ進んで、点火気筒
情報変数IGRCASを更新し、ステップS1607へ進
む。
【0206】ステップS1607では、点火気筒情報変数I
GRCASの値をドエルの観点から見た値と点火の観点
から見た値が同じか否かを調べることにより、現在の状
況が即座にドエルを開始しなければならない状況か否か
を判別する。ここで、ドエルの観点から見た気筒情報を
RCASDWL(=IGRCAS)で示し、点火の観点で
見た気筒情報をRCASIGで示すと、図29に示すよう
な関係となり、ドエルの観点から見た気筒情報RCAS
DWL(=IGRCAS)は通電開始区間となってから次
の通電開始区間となるまで点火対象気筒を一定の値で示
すデータであり、点火の観点から見た気筒情報RCAS
IGは同一気筒に対して気筒情報RCASDWLと同じ値を
取り、通電終了区間となってから次の通電終了区間とな
るまで点火対象気筒を一定の値で示すデータである。そ
して、点火が終了したままドエルを開始する必要のない
区間でのみ両者が一致する。
【0207】すなわち、この点火終了割込みが発生した
点火終了時に、RCASDWL≠RCASIGとなり、点火
コイルの通電終了と通電開始とが同一区間の場合には、
エンジン回転数の急変、点火時期の急変などにより、あ
る気筒の点火が終了すると直ちに次の気筒のドエルを開
始しなければならない区間であることがわかる。
【0208】従って、上記ステップS1607で、点火気筒
情報変数IGRCAS(=RCASDWL)が点火から見
た値RCASIGと同じときには、点火コイルの通電終了
と通電開始とが同一区間内でなく、通常の点火終了と判
別して割込みを終了し、前述したように、クラセン割込
み毎に次のドエル開始区間を待ち、ドエル開始区間とな
ったとき、待ち時間→ドエルオン→ドエル時間→点火の
通電シーケンスを点火タイマにセットする。
【0209】また、上記ステップS1607で、点火気筒情
報変数IGRCASが点火から見た値RCASIGと異な
るときには、点火コイルの通電終了と通電開始とが同一
区間内であり即座にドエルを開始しなければならない状
況であると判別してステップS1608以降の点火タイマセ
ットの処理へ進み、待ち時間→ドエルオンのみの通電シ
ーケンスを点火タイマにセットする。
【0210】すなわち、ステップS1608で、ロジック上
のデストリビュータを選択し、ステップS1609で、タイ
マ初期値を256にすると、ステップS1610で、タイマ
リロード値をFFFFとする。尚、タイマ初期値の25
6は、点火コイル26aの一次側端子から回転信号をピ
ックアップするタコメータを採用した場合に確実な計数
を可能とする1msのオフ期間であり、他の形式のタコ
メータを採用する場合には、点火コイル26aの特性な
どに応じて設定しても良い。
【0211】そして、上記ステップS1610からステップS
1611へ進み、点火タイマの出力パターンをモードM1と
してステップS1612で点火タイマをスタートさせ、ステ
ップS1613で、タイマ作動中フラグFLG_IGをセッ
トすると、ステップS1614で、ドエルが開始されている
にも拘らずドエルオフすなわち点火のタイミングが設定
されていないことを示す点火時期未設定フラグIGTM
NSをセットし、割込みを終了する。
【0212】これにより、点火終了後、1msのオフ期
間をおいてドエルが開始され、クラセン割込み毎に点火
をすべき区間となるのを待って点火区間となったとき、
ドエルオフ時間→点火の通電シーケンスが点火タイマに
セットされる。
【0213】
【発明の効果】以上説明したように請求項1記載の発明
によれば、規定された複数のクランク位置を表すクラン
クパルスを入力し、複数のクランクパルスのうち、特定
のクランクパルス間で気筒判別用の所定数のカムパルス
を入力して、これらパルスの入力パターンに基づいてク
ランク位置を把握すると共に気筒判別を行い、上記クラ
ンクパルスの入力毎に区間を設定し、点火に係る区間の
開始位置からの時間を点火タイマにセットして点火コイ
ルの通電・遮断を行い点火制御を行うに際し、エンジン
回転に同期するクランクパルス入力毎の処理で、現在の
気筒及びクランク位置を表す区間が、予め設定した点火
に係る区間となったか否かを判断する。そして、点火に
係る区間となったとき、エンジン運転状態に基づいて設
定した点火コイルの通電・遮断時間から、クランクパル
ス入力から実際に点火タイマがセットされるまでの処理
遅れ時間を差し引いた値を点火タイマにセットして、点
火を行うと共に、点火コイルの通電・遮断時間から処理
遅れ時間を差し引いた値が負となったとき、現在の処理
遅れ時間が処理遅れ時間記録値を超えているか否かを判
断する。そして、現在の処理遅れ時間が記録値を越えて
いる時、現在の処理遅れ時間により処理遅れ時間記録値
を更新し、該記録値を次回の点火タイマセットの際に処
理遅れ時間として用いるので、クランクパルス入力から
実際に点火タイマがセットされるまでの処理遅れ時間が
通常よりも長くなったときにも、このときの処理遅れ時
間により処理遅れ時間記録値を更新して次回の点火タイ
マセットの際に用い、処理遅れの影響を解消して常に最
適なタイミングで点火を行うことができ、エンジン出力
性能の向上、排気ガスエミッションの改善を図ることが
できるなど優れた効果が得られる。DETAILED DESCRIPTION OF THE INVENTION
[0001]
BACKGROUND OF THE INVENTION The present invention relates to an ignition timer set.
In engine ignition control to eliminate the effects of processing delays
And a method for eliminating a processing delay.
[0002]
2. Description of the Related Art In recent years, microcontrollers have been used in vehicles such as automobiles.
Computer, engine, powertrain, etc.
It became possible to control with high accuracy. This microco
The computer is an electronic device with a constant voltage circuit and various peripheral circuits.
Installed in the vehicle as a control unit (ECU), driving the vehicle
Based on signals from various sensors that detect the status,
It performs gin fuel injection control and ignition control.
[0003] The ignition control by the ECU is usually performed at a predetermined level.
This is executed by an interrupt process for each crank angle.
Japanese Patent Application Laid-Open No. 2-159747 discloses an interrupt at every predetermined crank angle.
The intake air flow rate and engine speed
The basic ignition timing is calculated from the interpolation calculation of the map based on
The basic ignition timing of the engine due to knocking, cooling water temperature, etc.
Calculated final ignition timing (angle) with angle correction
Then, convert this final ignition timing (angle) to time
Ignition timing control of energization end time and energization start time of fire coil
The technology for setting the counter (timer) is disclosed.
You.
[0004]
SUMMARY OF THE INVENTION However, certain
Data is stored in the ignition timer after the crank angle interrupt is activated.
There is a processing delay before is set.
The actual ignition timing will be shifted by the delay time.
Engine output performance cannot be fully demonstrated.
Not only worsening, but also deteriorating exhaust emissions.
There is it.
The present invention has been made in view of the above circumstances.
In order to eliminate the effect of processing delay when setting the ignition timer,
An engine that can always ignite at the optimal timing
To provide a method for eliminating processing delay in ignition control of gin.
And for the purpose.
[0006]
[Means for Solving the Problems]The invention according to claim 1 is
A crank pulse representing a plurality of specified crank positions
Enter a specific crank out of multiple crank pulses
Input a predetermined number of cam pulses for cylinder discrimination between pulses.
Based on the input pattern of these pulses
The cylinder position is determined and the cylinder
Section is set for each input of the engine, and the start position of the section related to ignition
To the ignition timer by setting the time from
・ Ignition control of an engine that shuts off and performs ignition control
Process for each crank pulse input synchronized with the engine speed.
The section representing the current cylinder and crank position is
It is determined whether or not the section related to the set ignition has come
When the section pertains to
From the set ignition coil energization / interruption time,
From the input of the pulse until the ignition timer is actually set.
Set the value obtained by subtracting the delay time in the ignition timer,
Perform ignition and check whether the ignition coil is
When the value obtained by subtracting the processing delay time from
Whether the processing delay time exceeds the processing delay time record value
The current processing delay time exceeds the recorded value
Time, the processing delay time record value is updated according to the current processing delay time.
Newly, the recorded value will be delayed when the next ignition timer is set.
Use as timeIt is characterized by the following.
[0007]
[0008]
[Action]According to the first aspect of the present invention, a plurality of specified
Input a crank pulse representing the
Cylinder discrimination between specific crank pulses
Input a predetermined number of cam pulses
Crank position is grasped based on the pattern and cylinder
Performs discrimination and sets a section for each input of the above crank pulse
The time from the start position of the section related to ignition
To turn on and off the ignition coil to control ignition.
When performing a crank pulse input synchronized with the engine rotation
Section indicating the current cylinder and crank position in the processing for each force
Is determined to be a preset ignition section
I do. Then, when it comes to the section related to ignition, the engine
When turning on / off the ignition coil set based on the operating state
In the meantime, the ignition timer is actually set from the crank pulse input.
The value obtained by subtracting the processing delay time until
Set the ignition coil to ignite and set the ignition coil
The value obtained by subtracting the processing delay time from the
When the current processing delay time is
It is determined whether or not it is exceeded. And the current processing delay
When the time exceeds the recorded value, the current processing delay time
Update the recorded value of the processing delay time and use the recorded value for the next ignition.
Used as the processing delay time when setting the timer.
[0009]
[0010]
Embodiments of the present invention will be described below with reference to the drawings.
I do. The drawings relate to an embodiment of the present invention, and FIG.
The partial flowchart 1 and 2 of the Masset subroutine
Partial flowchart of ignition timer set subroutine
2, Figure 3 is a flowchart of the periodic interrupt processing every 0.5ms
FIG. 4 is a flowchart and diagram of classain interrupt processing.
5 is a flowchart of the job priority process, and FIG.
Partial flow chart 1 of line subroutine, FIG. 7 shows job
Partial flow chart 2 of the execution subroutine, FIG.
3 and FIG.
Partial flowchart of job execution subroutine 4, FIG.
Is the flowchart of the crank position calculation subroutine,
11 is a flowchart of the CCAS / RCAS discrimination subroutine.
FIG. 12 shows an ignition schedule creation subroutine.
Partial flow chart 1 and Fig. 13 create ignition schedule
Partial flowchart 2 of the subroutine, FIG.
Partial flowchart 3 of the schedule creation subroutine,
FIG. 15 is a partial flowchart of the ignition schedule creation subroutine.
Charts 4 and 16 show the flow of interrupt processing at the end of ignition.
FIG. 17 is an explanatory diagram showing the execution state of a job.
18 is an explanatory diagram of a job flag, and FIG.
FIG. 20 shows job execution flags and overlays.
FIG. 21 is an explanatory diagram showing a change in the top counter, and FIG.
FIG. 22 is an illustration of the shift buffer, and FIG.
FIG. 23 is an illustration of a cylinder / crank position state map.
FIG. 24 shows the ignition sequence and ignition interval variables.
FIG. 25 is an explanatory diagram of the ignition schedule, and FIG.
Explanatory drawing of the Joule pointer table, FIG.
FIG. 28 is an explanatory diagram of a masset, FIG.
FIG. 29 is a view showing the relationship between the electrical cylinder information and the ignition cylinder information.
FIG. 30 shows the crank position and the stroke of the engine.
FIG. 31 is a schematic diagram of an engine system, and FIG.
2 is a front view of a crank rotor and a crank angle sensor, FIG.
3 is a front view of the cam rotor and the cam angle sensor, and FIG.
FIG. 3 is a circuit configuration diagram of a control system.
In the engine control system of the present embodiment,
Electronic control centered on the microcomputer shown in 34
The engine system shown in FIG.
Control of fuel injection, ignition timing, etc.
You. The microcomputer of the ECU 50 has a new
Operating system (OS) based on the new concept
The OS is used to process the signal input from each sensor.
Processing, engine speed calculation processing, intake air amount calculation processing, fuel
Control such as fuel injection amount setting processing, ignition timing setting processing, etc.
Jobs for each item are managed and executed efficiently
It has become.
First, it is controlled by the ECU 50.
The configuration of the engine system will be described.
As shown in FIG. 31, the engine 1 (shown in FIG.
And a horizontally opposed 4-cylinder engine)
An intake manifold 3 is provided at the intake port 2a of the head 2.
The air manifold is connected upstream of the intake manifold 3.
A throttle passage 5 is communicated via the chamber 4.
Upstream of the throttle passage 5, via an intake pipe 6
The air cleaner 7 is attached, and the air cleaner 7
In the air intake chamber 8, which is the intake of the incoming air
Are in communication.
An exhaust port 2b is connected to an exhaust port.
An exhaust pipe 10 is communicated via a manifold 9,
A catalytic converter 11 is interposed in the pipe 10 and is
Are in communication. On the other hand, the throttle passage 5
A throttle valve 5a is provided.
An intercooler 13 is interposed in the upstream intake pipe 6,
Further, on the downstream side of the air cleaner 7 of the intake pipe 6,
A resonator chamber 14 is provided.
Also, the resonator chamber 14 and the resonator
The intake manifold 3 communicates with the throttle
Bypass for bypassing the upstream and downstream sides of the lube 5a
Road 15 has an idle speed control valve (IS
CV) 16 is interposed. Furthermore, this ISCV1
Directly downstream of the valve 6 when the intake pressure is negative,
When the intake pressure becomes positive due to supercharging by the
Check valve 17 that closes when
You.
The turbocharger 18 is connected to the intake pipe.
6, a compressor is provided downstream of the resonator chamber 14.
And the turbine is interposed in the exhaust pipe 10
I have. Furthermore, the turbocharger 18
A wastegate valve 19 is interposed at the housing inlet.
The wastegate valve 19 includes a wastegate valve.
An actuating actuator 20 is provided in series.
Actuator for operating the wastegate valve
Is divided into two chambers by a diaphragm, one of which is
For duty solenoid valve 21 for wastegate valve control
Forming a pressure chamber that communicates with the other,
A split housing a spring for urging the valve 19 in the closing direction
To form a cooling chamber.
The wastegate valve control duty saw
The solenoid valve 21 is connected to the resonator chamber 14 and the
Under the compressor of the turbocharger 18 of the intake pipe 6
It is interposed in the passage that communicates with the flow
Depending on the duty ratio of the output control signal,
The pressure on the side of the generator chamber 14 and the downstream side of the compressor
And actuate the above wastegate valve actuation
The pressure is supplied to the pressure chamber of the heater 20.
That is, the above-mentioned c is controlled by the ECU 50.
Controls duty solenoid valve 21 for est gate valve control
The actuator 20 for operating the wastegate valve
To operate the exhaust gas by the waste gate valve 19.
By adjusting the relief, the turbocharger
The supercharging pressure by the control unit 18 is controlled.
In addition, the intake manifold 3 is absolutely required.
The pressure sensor 22 is communicated via a passage 23 and the passage 2
3, the absolute pressure sensor 22 and the intake manifold
Inlet pipe pressure / large for selectively communicating with air port 3 or atmosphere
An air pressure switching solenoid valve 24 is interposed.
Further, each of the intake manifolds 3
The injector 25 is located immediately upstream of each intake port 2a of the cylinder.
And for each cylinder of the cylinder head 2
And a spark plug 26 whose tip is exposed to the combustion chamber.
The ignition plug 26 is provided with a point provided for each cylinder.
The igniter 27 is connected via the fire coil 26a.
You.
The injector 25 has a fuel tank 2
8 through an in-tank type fuel pump 29
The fuel is pumped through the filter 30 and the pressure is regulated.
The pressure is adjusted by the data 31.
The air cleaner of the intake pipe 6
Hot wire or hot film immediately downstream of 7
The intake air amount sensor 32 of a type or the like is interposed,
A throttle opening sensor 33a and an eye
Throttle sensor 33 with dollar switch 33b
Are connected.
Further, the cylinder block of the engine 1 is
The knock sensor 34 is attached to the
Cooling that connects both left and right banks of the cylinder block 1a
A cooling water temperature sensor 36 faces the water passage 35, and
O2 is added to the collecting portion of the exhaust manifold 9 of the pipe 10.
A sensor 37 is exposed.
The cylinder block 1a is supported by
Crank rotor 38 is attached to the crankshaft 1b
An electromagnetic pick-up is provided around the outer periphery of the crank rotor 38.
A crank angle sensor 39 made up of
You. Furthermore, it is connected to the camshaft 1c of the engine 1.
A magnetic rotor or the like on the cam rotor 40
A cam angle sensor 41 for cylinder identification is provided in opposition. still,
The crank angle sensor 39 and the cam angle sensor 41
Is not limited to magnetic sensors such as electromagnetic pickups, but also optical sensors.
May be a sensor.
The crank rotor 38 is shown in FIG.
As described above, the protrusions 38a, 38b, 38c are formed on the outer periphery.
These projections 38a, 38b, 38c are
Before compression top dead center of cylinders (# 1, # 2 and # 3, # 4) (BTD
C) It is formed at the positions of θ1, θ2, θ3.
Where θ1 = 97 ° CA, θ2 = 65 ° CA, θ3
= 10 ° CA.
Each of the protrusions of the crank rotor 38 is
30 detected by the crank angle sensor 39.
BTDC 97 °, 65 °, 1
A crank pulse of 0 ° is output every 1/2 rotation of the engine (180 °).
° CA). And at the input interval of each signal
Time is measured by a timer, and the engine speed is calculated.
It is.
The projection 38b is used as a base for setting the ignition timing.
It becomes a quasi-crank angle, and the projection 38c
It becomes the reference crank angle at the start time and fixed at the start.
The crank angle indicates the ignition timing.
Further, as shown in FIG.
On the outer periphery of the cylinder 40, projections 40a, 40b,
40c are formed, and the projections 40a compress the # 3 and # 4 cylinders.
Formed at the position of θ4 after the top dead center (ATDC),
b is composed of three protrusions, and the first protrusion is A of the # 1 cylinder.
It is formed at the position of TDCθ5. Further, the protrusion 40
c is formed by two projections, and the first projection is A of the # 2 cylinder.
It is formed at the position of TDCθ6. In this embodiment
Are θ4 = 20 ° CA, θ5 = 5 ° CA, θ6 = 20 °
CA.
Then, each projection of the cam rotor 40 is raised.
The combustion angle of each cylinder is detected by the cam angle sensor 41.
When the order is # 1 → # 3 → # 2 → # 4, this combustion line
The sequence and the cam pulse from the cam angle sensor 41 are counted.
Pattern with the value counted by the counter (the time in FIG. 30).
Cylinder discrimination is performed based on the chart).
On the other hand, the ECU 50 shown in FIG.
Main computer for firing control, ignition timing control, etc.
51 and a dedicated subcomputer for performing knock detection processing.
It is configured around two computers with the
A constant voltage circuit 53 for supplying a predetermined stabilized power to
Various kinds of peripheral circuits are incorporated.
The constant voltage circuit 53 includes an ECU relay 54
Connected to the battery 55 through the relay contact of
In the battery 55, a relay coil of the ECU relay 54 is provided.
It is connected via an ignition switch 56.
The constant voltage circuit 53 is directly connected to the battery 55.
Connected to the fuel pump relay 57.
A fuel pump 29 is connected via a point.
That is, the above-mentioned constant voltage circuit 53
When the ignition switch 56 is turned on, the ECU
-54, the control power supply is
And the ignition switch 56 is turned off.
When power is supplied, supply power for backup.
The main computer 51 includes a CPU 5
8 (hereinafter, referred to as main CPU 58), ROM 59,
RAM 60, ignition switch 56 is OFF
The backup voltage from the constant voltage circuit 53
Backup RAM 6 supplied with source and holding data
1, counter / timer group 62, serial communication interface
SCI63 and I / O interface
Microcontroller connected via a bus line 65
Computer.
The counter / timer group 62 has a free
-Run counter, cam angle sensor (hereinafter referred to as Cam
Abbreviated as a signal input)
Various counters, fuel injection timer, ignition timer, described later
Periodic interrupt to generate a periodic interrupt every 0.5ms
Timer, crank angle sensor (hereinafter referred to as class
Abbreviated) signal input interval clocking timer, and
And a watchdog timer for system abnormality monitoring
Various timers are collectively referred to for convenience.
In the computer 51, various other software
An account timer is used.
The sub-computer 52 is also
As with the main computer 51, the CPU 71 (hereinafter referred to as
CPU 72), ROM 72, RAM 73,
Counter / timer group 74, SCI 75, and I / O in
Interface 76 is connected via bus line 77
A microcomputer, the main computer being
51 and the subcomputer 52 are the SCIs 63 and 7
5 connected to each other by a serial communication line
I have.
I / O in of the main computer 51
The interface 64 has an input port with an intake air amount sensor.
C, throttle opening sensor 33a, water temperature sensor 3
6. O2 sensor 37, absolute pressure sensor 22, vehicle speed sensor 4.
2, and the battery 55 is an 8-channel input A / D
While connected via the converter 66, the idle switch
Switch 33b, crank angle sensor 39, cam angle sensor 41
Is connected, and to detect the starting condition
The starter switch 43 is connected.
In this embodiment, the A / D conversion
The device 66 uses the inputs of 7 channels, and the remaining 1
The channel is reserved.
The I / O interface 64
An igniter 27 is connected to the output port.
ISCV16, injector 2 via drive circuit 67
5. The relay coil of the fuel pump relay 57 and c.
Est gate valve control duty solenoid valve 21, suction
The tracheal pressure / atmospheric pressure switching solenoid valve 24 is connected.
You.
On the other hand, the I / O of the subcomputer 52
The interface 76 has a crank angle
Sensor 39 and the cam angle sensor 41 are connected.
Via a / D converter 78, a frequency filter 79, and an amplifier 80
The knock sensor 34 is connected to the
The knock detection signal from the sensor 34 is predetermined by the amplifier 80.
After being amplified to the level of
Required frequency components are extracted, and the A / D converter 78
Is converted to a digital signal and input
I have.
In the main computer 51, each sensor
Process the detection signals from
Calculate the timing. That is, the intake air amount sensor 32
The amount of intake air is calculated from the output signal of
Based on various data stored in the backup RAM 61.
Calculate the fuel injection amount corresponding to the intake air amount.
Further, the ignition timing and the like are calculated.
Then, a drive path corresponding to the fuel injection amount
The pulse width signal is transmitted to the drive circuit 67 at a predetermined timing.
Output to the injector 25 of the corresponding cylinder to inject fuel
The ignition signal is sent to the igniter 27 at a predetermined timing.
And the ignition plug 26 of the corresponding cylinder is ignited.
As a result, the mixture supplied to the corresponding cylinder is
Explodes and burns, and faces the manifold of exhaust manifold 9
O2 sensor 37 detects the oxygen concentration in the exhaust gas.
After this detection signal has been waveform-shaped,
It is compared with the reference voltage (slice level) by the CPU 58,
The engine's air-fuel ratio state is richer than the target air-fuel ratio.
It is determined whether the air-fuel ratio is on the lean side.
Feedback control is performed to obtain the fuel ratio.
On the other hand, in the sub-computer 52,
Knock sensor based on engine speed and engine load
Set the sample interval of the signal from
A / D conversion of signal from knock sensor 34 at high speed in section
To accurately convert the vibration waveform to digital data,
The presence or absence of occurrence is determined.
The I / O interface of the subcomputer 52
Interface 76 is connected to the main computer
Connected to the input port of the I / O interface 64 of the
The knock determination in the sub-computer 52 has been continued.
The fixed result is output to the I / O interface 76. So
In the main computer 51, the sub-computer
The determination result indicating that knocking has occurred is output from the computer 52.
Then, knock from the serial communication line via SCI63.
Data is read, and immediately based on this knock data
The ignition timing of the corresponding cylinder is delayed to avoid knocking.
In such an engine control,
In the in-computer 51, signal input from each sensor
Processing, engine speed calculation, intake air amount calculation, fuel injection
Various programs for each item such as quantity calculation and ignition timing calculation
System is executed efficiently under the control of one OS. this
The OS has various management functions for vehicle control and
And internal strategies closely related to this management function
And systematically combine various jobs.
The management functions of the OS include:
(1-1) Job priority processing
(1-2) Split file pairs for each job by section definition
Yes
(1-3) Stack usage monitoring function
(1-4) Monitor function of abnormal interrupt operation
(1-5) Standard maps and markers that do not create unique constraints for each job
Semi-work memory setting
And other functions to improve the control strategy development environment.
As well as maximize limited CPU capabilities
To perform equal time interval processing, which is the basis of digital control theory.
It can be achieved as much as possible.
As an equal time interval process, every 0.5 ms
2, 4, 10, 50, 250 based on periodic interrupts
There are five types of equally-spaced interrupt jobs for each ms.
In addition, as processing synchronized with engine rotation,
High-priority classene that is immediately executed by a click angle signal input
Jobs (hereinafter simply referred to as Classen jobs) and more
Crank angle signal when there is no other job with higher priority
Low priority, relatively low urgency, interrupted by input
Classen job and are prepared.
Each of these jobs is a class job>
2ms job> 4ms job> 10ms job> low priority
Class job> 50 ms job> 250 ms job
In order, the priority level of 7-1 is changed from higher to lower.
As shown in FIG. 17, high-speed jobs
On the other hand, low-speed jobs are divided and processed.
A multi-waiting process is performed.
Each program that operates under the OS described above
Indicates the order of management area by function, that is, section area.
Are arranged in each section area.
It is named by the application declaration. Each strate
The main section area used on the G-file side is
○ Variable declaration area
○ Self-file name, automatic recording area when creating files
○ Setting data area
○ Class job area
○ 2ms job area
○ 4ms job area
○ 10ms job area
○ Low priority class job area
○ 50ms job area
○ 250ms job area
○ Reset initialization job area
○ Initialization job area at engine stall
○ Background job area
○ Program body area
The program is developed by dividing the file for each function.
Enables structured description of programs
I do.
The above-mentioned OS has the above management.
As an internal strategy close to the function,
(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) Set ignition timer
(2-5) Set fuel injection timer
And other functions.
Various service routines are provided in each job.
Conventionally, such a function is provided at each job level.
Was achieved, but in this system,
A / D conversion prepared by the OS and processed by the OS
Results, crank position information, engine speed, etc.
In each job on the user side, the fuel injection amount, ignition timing, etc.
When these settings are made, these indicated values are
The firing timer and ignition timer are set
You.
Next, the ignition of the main computer 51
The control functions are described in FIGS.
This will be described with reference to the flowchart of FIG. In addition,
The computer 52 is a computer dedicated to knock detection processing.
Therefore, the description of the operation is omitted.
First, the ignition switch 56 is turned on.
Power is turned on and the system is reset.
A reset interrupt is activated and various initializations are performed.
And a periodic interrupt is started every 0.5 ms.
The periodic interrupt timer is started and the crank angle sensor 3
9 (BTDC 97 °, 65 °, 10 °)
Classen which is activated 6 times per engine revolution per CA)
Interrupts are allowed, and then the background job
It becomes a line state.
Then, on this background job
Therefore, a periodic interrupt every 0.5 ms and 6
7th-level jobs are prioritized due to the number of class interrupts
It is processed. In these two interrupts, their own processing
After jumping to the common address,
Execute the process.
Note that the above-mentioned reset interrupt is transmitted to the internal operation.
When performing division by 0 or an infinite loop
Due to factors that do not occur during normal times,
Is activated.
First, a periodic interrupt every 0.5 ms shown in FIG.
Only the following will be described. In this periodic interrupt, step S1
At 00, an OS work area is set, and at step S101,
When the watchdog timer is initialized, go to step S102
Then, the P-RUN flag is set once every 20 times, that is, 10 times.
Invert every ms. This P-RUN flag is not shown.
Protection system does not automatically reset the system.
This flag is used to prevent the system from operating properly.
As long as it is turned over at regular intervals (every 10 ms)
The operation of the protection circuit is blocked.
Next, the process proceeds to step S103, and the switch is turned off.
Perform force transfer. This switch output is
These are the ON and OFF values of the bits written to the memory.
The output port of the I / O interface 64 directly from the job
The value of the memory every 0.5ms on the OS side
Transfer to output port.
Next, when the process proceeds to step S104, A / D conversion is performed.
Execute the subroutine to make various settings related to A / D conversion
No, in step S105, a job flag creation subroutine
Is executed, and each time interval of 2, 4, 10, 50, and 250 ms is executed.
Create job flag JB_FLG indicating job interrupt request
After that, in step S106, A / D conversion is started.
The above A / D conversion is basically performed by A / D conversion
8 channel input of the unit 66 is converted every 0.5 ms.
It is processed for each order, and all inputs are converted every 4 ms
It is. However, one specific channel has rotational pulsation.
Crank angle for A / D conversion of generated suction pipe pressure
Synchronized every 90 ° (with 0.5ms time accuracy), conversion order
Process is performed in the form of interrupting the turn, and subsequent input
Is delayed by one.
When the engine speed is 3750 rpm or more,
Indicates that the last input of the A / D conversion is completely stopped, and
Above 500rpm, the penultimate input also stops
However, the order of A / D conversion is throttle opening, intake air
Cooling water temperature, voltage, etc.
The one that changes relatively slowly is set to come later,
And the last A / D conversion order is set to crank synchronization input.
There is no particular problem.
Further, as shown in FIG.
The lag JB_FLG indicates that each bit of the 1-byte variable is
Is assigned as a flag corresponding to the
Job requests can be made at the same time. This one bar
Bits 1 to 7 of the site variable correspond to priority levels 1 to 7.
Corresponding to a 250 ms job, a 50 ms job,
Low priority classa job, 10ms job, 4ms job
, 2ms job, and class job flag
Have been. When a predetermined bit is set,
A corresponding priority level job interrupt request is made. still,
Bit 0 is assigned to the background job flag
Not normally referenced.
Then, in step S105, the job flag
Create job flag JB_FLG by creation subroutine
After starting the A / D conversion in step S106,
Proceeds to step S107, and sets the job flag JB_FLG.
Whether the bit corresponding to any job is set
Find out.
As a result, the job flag JB_FLG
When no job is standing, any job
Since there is no request, the interrupt is terminated and the job flag JB_F
If any bit of LG is set,
Proceeding to step S108, the current level (this periodic interrupt is executed
Job at a given priority level was running at the time
(State) Check whether the following flags are present.
In the above step S108, the files below the current level are
When there is no lag, the figure indicated by the label WAR_JB
Jump to the job priority processing of No. 5
If there is a lag, in step S109, it is lower than the current level
The overlap counter OLC of the level of
You.
The overlap counter OLC is
This is a counter for storing job requests.
One byte is allocated for each job, and the job flag JB_F
Increment when job request by LG, end of job
Sometimes decremented. That is, by the counter
By storing job requests, multiple requests
We can respond.
Next, from step S109 to step S1
Go to 10 and check if there are any flags higher than the current level.
If there are no flags higher than the current level,
Exits the interrupt after exiting the
If there is, the job priority processing of the label WAR_JB
Jump to
On the other hand, in response to the periodic interrupt every 0.5 ms,
However, in the interrupt by the class of FIG.
In step S201, when the work area for the OS is set.
The subroutine for calculating the crank position and half-turn time described later
To determine the current crank position.
Rank position variable and the sum of the last three classen intervals
Is calculated.
The above crank position variables are prepared in the OS.
Are system variables # 1 to # 1 as shown in FIG.
The crank position for # 4 cylinder is 97 °, 65 °, 1
It is divided into 12 state sections by 0 ° CA, and the current
Indicates the rank position.
That is, numerical values of 0, 1, and 2 are set for each cylinder.
Is a crank position information variable S_CC indicating the order of class input.
AS, # 1 cylinder is 0, # 3 cylinder is 1, # 2 cylinder is 2, #
Cylinder information variable S_ indicating the combustion order of the cylinders, where four is three cylinders
The class order and energy are shown by RCAS and numerical values from 0 to 11.
Crank overall position variable S_AC comprehensively representing cylinder order
The current crank position is represented by three AS variables.
Furthermore, it was confirmed that the crank position was correctly determined with confirmation.
0, the discrimination result is inconsistent, and anxiety remains
Error level S_ECA with status 1 and unknown status 2
S indicates the determination status of the crank position.
ing. Note that, in FIG.
Are omitted from S_.
Next, from step S201 to step S2
Proceed to 02, subroutine for calculating crank position and half rotation time
Check that crank position judgment has been completed normally
Is stored in accumulator A
By reading the code that is
Code 1, normal completion code 0).
Then, in step S202, the accumulate
Data A is 1 and the crank position cannot be determined.
Interrupt, the interrupt is terminated and the accumulator A
Is 0 and the crank position is determined to be normal
To the step S203 to release the engine stall flag.
You.
It should be noted that the engine stall flag indicates that the engine
Flag indicating that the
When the interval is 0.5 sec or more (about 30 rpm or less)
The engine processing routine prepared for the 50 ms job
The interrupt is set by the
And the engine stall state is released.
Next, proceeding to step S204, the following points will be described.
Execute the fire timer set subroutine and set the ignition sequence
Ignition according to the ignition schedule described below
Set the timer. Next, in step S205, the fuel injection
Execute the shooting timer set subroutine and
The command value of the fuel injection amount set on the valve side (injection for each cylinder
Width), the fuel injection start time, etc.
Set and go to step S206.
In step S206, this class is executed.
Whether the current job level is your own job level
The current situation is at the level of the Classen job itself.
In steps S207 and S208, the class job
Low priority class job overlap counter OLC
Is incremented by one, the interrupt is terminated, and the current job
When the sub-level is not the level of the class job,
In step S209, the current job level is changed to a low priority class
Find out if you are above the job level.
Then, the current job level is changed to the low priority class.
If it is equal to or greater than the send job,
Proceed to step S210 to overrun the low priority class job.
When the lap counter OLC is incremented by 1, the step S2
In 11, set the job flag of the class job and
Jump to the job priority process of WAR_JB.
On the other hand, in step S209, the current job
When the level is not higher than the low priority class job,
The process proceeds from step S209 to step S212,
When the job flag of the job is set,
Set the job flag of the priority class job and set the label
The process jumps to the WAR_JB job priority process.
In this job priority process, step S300
Is a 1-byte variable indicating the priority level of the job.
When the level JB_LEV is increased by one, the process proceeds to step S301.
The job flag corresponding to this priority level is set
Check if it is not. And the job flag is not standing
If not, return to step S300 and continue at the job level.
When JB_LEV is increased by one and the job flag is set
To the step S302, the job flag is set.
The overlap counter OLC of the job to be initialized to 0
From 1 to 1 and proceeds to step S303.
In step S303, the upper job flag
Check if there is a job, and if there is a higher job,
Returning to step S300, the above processing is repeated, and
If there is no job, the process proceeds to step S304, where the job
When the running flag JB_RUN is set, step S3
05, the top-level job execution subroutine
Execute the job.
The job execution flag JB_RUN is
Set at the start of job execution and cleared at the end
This flag is used by the
Jobs interrupted by higher priority jobs
can do.
For example, as shown in FIG. 20, JB_LE
While running a 10 ms job with V = 4, JB_LEV = 6
When a 2 ms job interrupt request is made, a 10 ms job
2ms job with higher priority
Is set to JB_RUN = 1, OLC = 1 and executed
Is done. During the processing of this 2 ms job, JB_
When an interrupt request of 4 ms job of LEV = 5 occurs,
This 4 ms job has JB_RUN = 0, OLC = 1
Interrupt is accepted but is not executed and waits
Becomes
Thereafter, the job execution subroutine
When the execution of the job is completed, the process proceeds from step S305.
Proceed to step S306 to decrease the overlap counter OLC by one.
Then, in step S307, the overlap counter OLC
Check if it is zero. As a result, the overlap
Counter OLC is not zero, same priority level
If there are multiple job interrupt requests in step S3
Return to 05 and execute the job repeatedly,
When the data OLC becomes zero, the process proceeds from step S307.
Proceeding to step S308, the job execution flag JB_RUN is cleared.
Rear.
Next, the process proceeds to step S309, where the job level
When JB_LEV is decremented by one and moved to the next job level,
In step S310, the job level JB_LEV is zero.
Check to see if it has become And the job level JB_
When the LEV is zero, this interrupt is terminated and the job
If the level JB_LEV is not zero, step S3
Proceed to 11 to check if the overlap counter OLC is zero
Find out what.
In step S311, the overlap cow
When the job OLC is zero, the job
Return from step S311 to step S309
Therefore, lower the job level JB_LEV by one
Is repeated, and the overlap counter OLC
If not, the process proceeds to step S312, where the job
At the level, the job execution flag JB_RUN
To see if it has been set.
In step S312, the job execution flag is set.
When JB_RUN is set,
Since the job was being executed, the interrupt was terminated and interrupted
Return to the previous job, and the job execution flag JB_RUN
If not set, return to step S304 and
Executes the job of the level and repeats the same processing.
That is, in FIG. 20, JB_LEV
= 6 completed 2ms job, OLC = 0, JB_RU
When N = 0, the job level is reduced by one, and JB_
4 ms job with LEV = 5, JB_RUN = 0, OL
JB_RUN = 1 is set from the standby state of C = 1,
Be executed. Furthermore, when the 4 ms job is completed, JB
_LEV = 4, JB_RUN = 1 (job execution
From the state of (middle), the 2 ms job and the 4 ms job
The processing of the suspended 10 ms job is resumed.
Thus, the periodic interruption every 0.5 ms,
Using the classroom interrupt as the basic timing,
Job flag J that informs the destination level and execution timing
As accurate as possible to create B_FLG, isochronous
Realizes interval processing and engine rotation synchronization processing,
Processing can be performed efficiently. In addition, basic timing
Job flag JB_F updated for each interrupt
Not by LG but by overlap counter OLC
When processing a job to store job multiplex requests
Time is long and the same job should be executed again
Should not be abandoned in the middle
In addition, the processing can be continued as far as possible.
Next, the job execution subroutine shown in FIGS.
Will be described.
First, in step S500, the job flag JB
The job to be executed with reference to _FLG is the class job
Check if it is not, and if it is not a class job,
Branch to label ALJ10, for class job
Proceeds to step S501, and determines whether or not cylinder discrimination is on.
Find out what.
Then, when cylinder discrimination is not performed,
Exits the routine and does not execute the job.
When the judgment is made, the steps from the above step S501 are performed.
Proceed to S502 and refer to the value of the overlap counter OLC.
To determine whether or not it is in a multiple waiting state.
In the above step S502, no multiplex wait state is set.
If not, proceed to step S503, and calculate
System variable S_ACAS issued (total crank position
Variable) as the user variable ACAS, while the multiple waiting list
If it is in the state, the process branches to step S504, and the user variable A
Add one CAS and divide by 12 to get a new
User variable ACAS, and this user variable ACAS
Are software like 0, 1, 2, ..., 11, 0, 1, ...
Update to.
That is, the class job and the low priority class
Sen jobs are disturbed by themselves or higher priority jobs.
Class interrupts are not
Is executed in synchronization with the link angle sensor signal, and the system variable S
_ACAS is updated regardless of job delay.
Therefore, during the job, the system variable S_AC
Refer to AS for information on cylinder and crank position.
Even if you try to work according to this information,
If you are delayed by another job,
Knowing information on the corresponding cylinder and crank position
become unable. For this reason, class jobs and low priority
For OS when in a helical job and not in multiple wait state
System variable S_ACAS for user variable ACAS
And execute this user variable ACAS as a job
Cylinder corresponding to itself even if it is updated every time
And information on the crank position is obtained and appropriate processing is performed.
To do so.
Thereafter, the above step S503 or the above step S503 is performed.
Proceeding from step S504 to step S505, the work
After setting the rear, in step S506, the level zero interrupt
Only, and in step S507,
Move on to And in this Klasen job section
Execute the linked process, and in step S508, generate an interrupt.
Prohibit and exit the routine.
Next, in step S500, the process to be executed now
If the current job is not a class job, the label AL
In step S510 of J10, check whether the job is not a 2 ms job.
In the case of a 2 ms job, the job
After setting the work area, in step S512, level zero
Is permitted, and in step S513, a 2 ms job
Move on to action. And linked to this section
Job body (based on the user's control strategy)
Routines or service routines prepared on the OS side
And interrupts are disabled in step S514.
Exit the routine.
On the other hand, in step S510, the
If the job is not a 2 ms job, from step S510
Branching to step S520, the job to be executed is
Check if it is active. And when it ’s not a 4ms job
Branches to the label ALJ30 and in the case of a 4 ms job
Sets the work area of the job in step S521
Then, the process proceeds to step S522. Note that this 4 ms job is A
/ D conversion use job, and a system shift
The A / D conversion data is used via the buffer SSHB.
In step S522, a level zero interrupt is generated.
Allow, then proceed to step S523, switch input
Is read, and in step S524, the section of the 4 ms job is read.
Then, execute the linked job body.
Then, when you leave the section of the 4ms job,
In step S525, the interrupt is prohibited, and the process proceeds to step S526.
Routine by shifting system shift buffer SSHB
Through.
The system shift buffer SSHB is
As shown in FIG. 21, each A / D conversion result of 8 channels
Is stored at the head offset address 0, +8, +1
6, +24, +32, +34, +36, +38
Moly and A / D conversion result of crank synchronization every 4ms
Is stored at the head offset address-2 address
Once every 0.5ms
A / D conversion result is stored in one word (2 bytes)
You.
From the head offset address 0, 4
It is a stage shift memory, and A / D for every 90 ° CA
The conversion result is stored, and the latest four data (for one rotation) are
Job. Also, the head offset
Addresses +32, +34, +36, and +38 are each 1
It is a word memory, and if the smoothing function is selected
In this case, the weighted average of the A / D conversion result is stored and stored.
Noise can be removed and the accuracy can be improved.
Data in these memories is available for slow jobs.
You.
Each head offset address +8, +
From addresses 16 and +24, a 4-word memory is used.
It is used for a 4 ms job. Each of these
The memory stores the latest A / D conversion result, counting from the top, 4
After the value of the overlap counter OLC of the ms job
Is stored in the first word when the 4ms job is executed.
Data is read from the
Since the data of each word is shifted in order toward the beginning,
FIFO buffer read from previously stored data
It has become.
That is, A / D conversion is performed every 0.5 ms.
It is performed accurately at a period of 4 ms by a periodic interrupt.
ms jobs are delayed by high-priority jobs
There is. Therefore, the FIFO buffer is used for A / D conversion delivery.
+ 8 ~, + 16 ~, +24 for 4ms job
After referring to the data of each FIFO buffer at address
At step S526, the data of each FIFO buffer is shifted in order.
To do that.
On the other hand, in step S520, the
Job branches to label ALJ30 instead of 4ms job
In step S530, the number of jobs to be executed is 10
Check whether it is a ms job or not, and if it is a 10 ms job,
In step S531, set the work area for the job and
In step S532, if an interrupt of level zero is permitted, step S5
At 33, go to the section on 10ms job
Execute the routine and disable the interrupt in step S534 and execute the routine.
Through.
In the section of the above 10 ms job,
Is an engine that calculates the engine speed from half a revolution
RPM calculation subroutine, ignition schedule
The execution subroutine is a service routine on the OS side.
It is prepared.
In step S530, the job to be executed is
If the job is not a 10 ms job, the above step S5
Branching from 30 to step S540, the job to be executed is low
Check whether it is the first class job. And low
If the job is not the first class job, go to step S540 above.
Branch to label ALJ50, and the job to be executed is low.
If it is a first class job, start from step S540.
Proceed to step S541 to check if the current state is
Check whether or not.
Then, the current state is not the multiplex wait state.
Sometimes, the process proceeds from step S541 to step S542.
The system variable S_ACAS (Crank total position change)
Number) as the user variable ACAS and proceed to step S544
In the multiplex wait state, the process proceeds from step S541.
Branch to step S543 to increase the user variable ACAS by one.
After taking the remainder divided by 12, proceed to step S544
No.
In step S544, the work area of the job
Is set, and in step S545, a level 0 interrupt is enabled.
Then, in step S546, the section of the low priority class job
After executing the job body, go to step S547.
To disable the interrupt and exit the routine.
Further, at the label ALJ50, the step
Whether the job to be executed in S550 is a 50 ms job
And if it is a 50 ms job, go to step S551
To set the work area for the job, and proceed to step S552.
No.
In step S552, a level zero interrupt is generated.
If permitted, in step S553, the section of the 50 ms job is
To the option, and the engine stall processing routine prepared on the OS side,
Cylinder-specific ignition timing retard routine, fuel injection start timing
Executes setting routines, etc.
Executes a routine based on the strategy. And the job
After the end of step, interrupts are disabled in step S554, and the routine
Exit.
On the other hand, the job to be executed in step S550
If the job is not a 50 ms job, the above step S5
Branches from 50 to step S560, and sets the job work area
Once set, a level zero interrupt is allowed in step S561.
Yes, proceeding to step S562, the section of the 250 ms job
After moving to the job area and executing the job body, step S5
In 63, interrupt is prohibited and the routine exits.
In the job priority processing described above,
It is necessary to always know the position of the
For each interruption, the crank position calculation subroutine shown in FIG.
Is executed and the crank position variable S_CCA described above is executed.
S, S_RCAS, S_ACAS, S_ECAS calculated
Is done. Note that in the following description, system variables are used.
Is omitted from the crank position variable.
In this crank position calculation subroutine,
First, in step S600, the lower 2 bytes of the classa timer are
Store in the lower 2 bytes of the soft timer. This classen
The timer is a hardware timer provided in the ECU 50.
Yes, in this embodiment, a maximum of 2
Counting is possible up to 55ms, but 3 bytes in memory
To secure a continuous area and use it as a soft timer.
You.
That is, the lower two bytes of the soft timer are
Transfer the 2 bytes of the spiral timer and
The third byte by an interrupt generated by
Up to 64 seconds at maximum.
ec (255 ms x 256)
Use a special hardware timer of 16 bits or more.
The distance between classes is extremely small, such as during cranking, without using
It can easily cope with a long case.
Next, steps S600 to S601 are performed.
Check to see if the classen interval is less than the set time
You. This set time is the clock corresponding to the maximum engine speed.
Time as helix interval, for example, 0.3 ms,
When the classen interval is less than the set time in step S601
Is the counting error of the classa timer due to noise contamination.
As an error code in accumulator A in step S602.
Store the code 1 and exit the routine. Also, the above steps
If the classen interval is longer than the set time in S601,
Assuming that the spiral timer count is normal, proceed to step S603
move on.
In step S603, CCAS R
Execute the CAS determination subroutine to determine the crank position
Then, in step S604, the error level ECAS is 2.
Or not, i.e.,
Check whether the lock position is unknown or not, and ECAS = 2
In the case of, the process branches to step S605 and accumulator A
Is stored in the error code 1 and the routine exits.
On the other hand, in step S604, ECAS6042
In step S606, the process proceeds to step S606,
The eye is set to 0. Then, the process proceeds to step S607, where the clan
Whether the position information variable CCAS is 1,
Current crank position is BTDC 65 ° CA to 10 ° CA
(See FIG. 19), and CCAS = 1
Jumps from step S607 to step S609
However, when CCAS ≠ 1, the process proceeds from step S607.
Proceed to step S608, increment the A / D conversion request by 1,
Proceed to step S609.
This A / D conversion request is based on the crank angle.
A signal for instructing crank synchronous A / D conversion every 90 °
A lag-like variable that takes values 0 and 1, when the value is 1.
Instruct crank synchronous A / D conversion. That is,
As described above, one channel out of eight channels of A / D conversion is used.
A / D conversion is performed every 90 degrees of crank angle.
When CCAS becomes 0 (BTDC 97 °), CC
When AS reaches 2 (BTDC 10 °), the crank
A / D conversion request is set, and every 0.5 ms
A / D conversion for every 90 ° crank angle with respect to A / D conversion order
It is made to interrupt.
Then, in step S609, the cylinder information variable
RCAS is tripled and the crank position information variable CCAS is added.
To calculate the crank overall position variable ACAS
Then (ACAS = RCAS × 3 + CCAS),
In step S610, the soft timer is limited to 2 bytes and the
If the send timer overflows, the lower 2 bytes
To FFFF (255 ms) and proceed to step S611.
No.
In step S611, the crank total position variable
ACAS = 0, 1, 2,..., 11
Element) Place classen interval data in TCAS [ACAS].
In step S612, the crank position information variable CCA
Array (element of) MTCSX with S = 0, 1, 2 as a subscript
Store classen interval data in [CCAS].
The sequence TCAS is as shown in FIG.
, The engine corresponding to ACAS = 0, 1, 2,...
12-Way that stores classen interval data for two rotations
Is the classen spacing table of the code, and the array MTCSX
Is CCAS = 0, 1, 2, as shown in FIG.
3 where three classen interval data corresponding to are stored
It is a word classen interval table.
That is, the CCAS.
RCAS determination subroutine (details will be described later) and step
Each information variable CCAS, RCAS, ACA by step S609
S is updated, for example, CCAS = 1, RCAS = 1,
ACAS = 4 and the crank position is currently # 3
When the cylinder BTDC is 65 to 10 CA,
# 3 cylinder BTDC97 @ CA timed by Ima
BTDC65 of # 3 cylinder from class signal input at
時間 Time until class signal input in CA (class
The interval data) is converted to the total position variable ACAS in step S611.
ACAS = 3 add of array TCAS using
And store the crank position in step S612.
Array MTCSX using information variable CCAS as a parameter
Store at the address of CCAS = 0.
Therefore, classen interrupt by classen input
Total position variable ACAS, crank position information variable C
Each time CAS is updated, it is stored in the arrays TCAS and MTCSX.
Are sequentially updated, so the array TCAS is referred to.
By this, the class at each crank position of each cylinder is
Change in rotation interval (change in rotation speed)
It is possible to determine whether a cylinder has misfired, the combustion state, etc.
The operating conditions of all cylinders can be grasped. Also,
By referring to the array MTCSX, the latest class
The interval can be obtained and the current driving situation can be quickly grasped.
Can be grasped.
Next, when the flow advances to step S613, the process returns to step S613.
Check the value of the error level ECAS. Here, the aforementioned
Already confirmed that ECASA2 at step S604
The error level ECAS is 1 or not.
That is, it is an estimated state in which the determination of the crank position remains uneasy.
Check whether or not.
In the above step S613, ECAS # 1 (snaw
ECAS = 0), and the crank position is confirmed
If it is determined, the process proceeds from step S613.
Proceeding to step S614, sum of the latest three classen interval data
(Classen interval data stored in array MTCSX
Is the half-turn time MTCS18 of 3 bytes
It is calculated (MTCS18 = ΣMTCSX). That is,
The half-rotation time MTCS 18 is
The position information variable CCAS is updated in the array MTCSX.
Is calculated every time the data of BTDC is 97 °,
For each of the 65 ° and 10 ° positions, calculate the moving sum of classen intervals.
So that you can always get the latest data
I have.
On the other hand, in the above step S613, ECAS = 1
In the estimated state where the determination of the crank position remains uneasy.
The half rotation time MTCS1 from the array MTCSX
In step S615, the half rotation time estimation subroutine is not performed.
Execute the routine and change the value of the crank position information variable CCAS to
Accordingly, half rotation time MTCS 18 is estimated.
That is, when CCAS = 0, BTDC
10 ° to ATDC 83 ° (BTDC 97 ° for the next cylinder)
From the angle 93 ° between the previous classen interval x 180/93
Is estimated to be a half rotation time MTCS18, and CCAS = 1
From the angle of 32 ° between BTDC 97 ° and 65 °
Half rotation time MTCS1
Estimate to be 8. Further, when CCAS = 2, BTDC
From the angle 55 ° between 65 ° and 10 ° to the previous classen interval
X180 / 55 is estimated as the half rotation time MTCS18.
Then, in the above step S614, the half rotation time M
After calculating the TCS 18, or in the above step S615
After estimating the half rotation time MTCS18 in step S6,
Proceed to 16 for 2 bytes of 3-byte half-turn time MTCS18.
And store in the specified variable MTCSK
In step S617, the variable MTCSK is doubled and changed.
Stored in several MTCSK4, normal end in step S618
Store code 0 in accumulator A and exit the routine
You.
Then, the above-described job execution subroutine
The engine speed is calculated every 10 ms.
Engine rotation speed is 3 bytes half rotation time MTCS18
Calculated from the reciprocal of the variable MTCSK limited to 2 bytes
Is done.
More specifically, the unit time of the number of revolutions per minute rpm
30 sec, which is half of (1 min), is a half rotation time MT
By dividing by CSK, 2 in units of 1 rpm
Variable NRPM in bytes, ie engine speed
Is calculated (NRPM = 30 sec / MTCSK).
Engine speed is one of the basic parameters
It is used for the control amount calculation process.
Next, the CCAS / RCA shown in FIG.
The S determination subroutine will be described. This subroutine
First, in step S800, the cam angle
Limit to 0-4. With this Camsen counter
The number of cam pulses from the cam angle sensor 41 to be counted
The number of cam pulses between spiral signal inputs) is shown in FIG.
As described above, the value is 0 to 3 in the normal state.
Could cause an abnormal count of 4 or more
Limit the Camcen counter to 0 to 4
The state is represented by 4.
Next, the process proceeds to step S801, where
Counter value, cylinder information variable RCAS, crank position
5 × 4 × 2 combination (cam
Five types of sen counters 0 to 4, cylinder information variable RCAS
Are 0 to 3 and the crank position information variable CCAS is
0, 1, and 2).
CCHMA Cylinder / Crank Position Status Map
Read P.
This cylinder / crank position state map CCH
As shown in FIGS. 23 (a) and (b), the MAP
Link position information variable CCAS is 0 or 1,
Crank position information change which is a change point of cylinder information variable RCAS
When the number CCAS is 2, it is divided into
All possible states of each combination of cylinder information variables RCAS
Whether the condition is normal or abnormal and whether it can be determined or not
Status data indicating the current status is stored.
Value and know what to do next.
The status data is 2-bit data.
The value of bit 0 indicates whether it is determined or estimated.
A value of 1 indicates normal or abnormal. The value of bit 0 is
When 0, it is determined and when 1, it indicates the estimation, which can be seen from FIG.
Thus, only when the Camcen counter is 2, 3
Otherwise, it is in a state where it has to be estimated. Ma
The value of bit 1 is normal when it is 0 and abnormal when it is 1.
And the Camsen counter is 3 or less, and FIG. 19 and FIG.
30 is normal only when the combination of
Other than this is abnormal.
For example, CCAS = 0 or 1, ie,
For BTDC 97 ° to 10 ° of a certain cylinder,
Where the counter value is 0 and the cylinder information variable RCAS is 0
As can be seen from FIGS. 19 and 30,
Since it is sufficient to estimate the position normally, cylinder /
Binary number in the corresponding area of the rank position status map CCHMAP
The state data of 01 (normal estimation) is stored in
Further, when the Camsen counter is 1 and the cylinder information variable RCAS is
The combination where is 0 is obviously abnormal and is estimated.
Cylinder and crank position status map
In the corresponding area of CCHMAP, 11 (abnormality estimation) in binary
State data is stored.
In addition, CCAS = 2, that is, a certain cylinder
BTDC10 ° to ATDC83 °
Combination where counter is 3 and cylinder information variable RCAS is 0
Is correctly established with the crank position across the TDC of cylinder # 1.
Cylinder / crank position state map CCHM
State data of binary 00 (normally determined) in the corresponding area of the AP
Data is stored, and the Cam
Combination where the cylinder information variable RCAS becomes 0
Although it is abnormal, it can not be confirmed if there are two Camsen inputs
Cylinder and crank position
10 In binary number in the corresponding area of CCHMAP (abnormality determined)
State data is stored.
In step S801, the cylinder / clan
Reads status data from the lock position status map CCHMAP
And proceeds to step S802, where the error level ECAS is 2
Whether or not the current state is the cylinder discrimination.
Check if the status is unknown and ECAS = 2
In step S803, the cylinder / crank position status
Bit 0 of the status data read from the CCHMAP
0, that is, whether it is in the final state.
Sometimes, the process proceeds to step S804, and the estimated state is used instead of the final state.
If it is, wait until the program exits the routine and is settled.
One.
On the other hand, in step S802, ECAS # 2
In some cases, the process proceeds to step S804 to check whether the state is the estimation state.
The processing after step S805 is performed according to the
The process proceeds to the process after step S812. Also,
Proceeded to step S804 in the confirmed state in step S803
In some cases, the process proceeds to step S805 and subsequent steps.
First, the processing after step S805 will be described.
That is, when the process proceeds to step S805, the normal
Because the cylinder is determined regardless of the abnormality,
As can be seen from the time chart of FIG.
For spiral interrupt, three or two cam pulses are input.
BTDC interrupt after 97 °
The location information variable CCAS is set to 0.
Next, the routine proceeds to step S806, where
Check if the counter is 3
When not, that is, when the Cam Seng counter is 2,
Is after the ignition of the # 2 cylinder, so the cylinder
Set the information variable RCAS to 3 and proceed to step S809,
When the sen counter is 3, it is after the ignition of the # 1 cylinder.
Therefore, in step S808, the cylinder information variable RCAS is set to 1
Proceed to step S809.
In step S809, the updated crank position
Information variable CCAS, cylinder information variable RCAS, and cam
Cylinder / crank position again using the Sen counter as a parameter
The status data is read from the location status map CCHMAP, and
Bit 1 of the status data is 1
To see if it is.
As a result, in step S809, the state
When bit 1 of the status data is 1 and the status is determined to be abnormal
Are the crank position information variable CCAS and the cylinder information variable RC
Assuming that the update result of the AS is an estimation that remains uneasy
In S810, set the error level ECAS to 1 and exit the routine.
If bit 1 of the status data is 0, indicating that the status is normal,
In step S811, the error level ECAS is set to 0.
Exit the routine.
On the other hand, in the processing after step S812, the step
In step S812, the current crank position information variable CCAS (previous
Crank position information variable calculated by the number of classen interrupts
CCAS) is 2, that is, the change of the cylinder information variable RCAS
Check whether the current point is a transition point, and when CCAS = 2,
Proceeding from step S812 to step S813, the cylinder information variable R
CAS is incremented by 1, and the crank position information is obtained in step S814.
After setting the variable CCAS = 0, the process proceeds to step S817.
On the other hand, in the above step S812, CCAS ≠ 2
In the case of, from step S812 to step S815
Check whether the Cam Sen counter is not 0,
If the sen counter is not 0, the above-mentioned step S813 is executed.
Branch to the step when the Cam Seng counter is 0
In S816, the crank position information variable CCAS is incremented by one,
Proceed to Step S817.
In the step S817, the updated crank position
Information variable CCAS, cylinder information variable RCAS, and cam
Cylinder / crank position again using the Sen counter as a parameter
The status data is read from the
It is checked whether the status is normal or not.
And if it is in the normal state,
(The error level ECAS = 0) and exits the routine. Ma
In step S817, bit 1 of the status data is 1
If it is abnormal, the process proceeds to step S818, where the crank position
Update results of the position information variable CCAS and the cylinder information variable RCAS
Estimates error level ECAS as anxious estimate
Set to 1 and exit the routine.
The above-described periodic interrupt processing every 0.5 ms and
Control strategy on the user side by spiral interrupt processing
-Based jobs are prioritized, for example, 10 ms
The ignition timing setting routine during the
Ignition timing according to engine operating conditions such as engine speed
When the indicated value (angle) IG_DEG is set,
Prepared on the OS side based on the indicated ignition timing IG_DEG
Ignition schedule in ignition schedule creation subroutine
Is created, and the ignition sequence is determined.
The above indicated ignition timing IG_DEG
In the range of -60 ° to + 97 ° with the retard side negative from the dead point
It can be set, and when determining the ignition sequence,
Set the ignition interval variable using the rank position variable, and
The ignition based on the section indicated by the fire section variable
Create a schedule.
The ignition section variables are as shown in FIG.
To the ignition coil 26a using the cylinder information variable RCAS.
Ignition indicating the target cylinder to be energized and ignited
Cylinder information variable IGRCAS, crank position information variable CC
The end of energization, that is, the section where ignition is performed using AS
Indicating ignition crank position information variable IGCCAS, crank
The position information variable CCAS is used to communicate with the ignition coil 26a.
Dwell start crank position indicating the section where power should start
The information variable DWCCAS is the ignition crank position information.
The report variable IGCCAS takes the values 0, 1, and 2,
L start crank position information variable DWCCAS is Dwell
May enter the previous stroke prior to ignition,
-3, -2, -1, 0, 1, 2 (however, ignition
The value larger than the crank position information variable IGCCAS
Absent).
Furthermore, the dwell start crank position information
In the section indicated by the variable DWCCAS,
Power supply start waiting time whether to start power supply after waiting for
That is, after the section where the energization starts,
Is the dwell-on wait time TD
W_ON, the ignition crank position information variable IGC
How long to wait in the section indicated by CAS
End wait time, that is, the point
After the section where the fire is executed, turn off the power to the ignition coil.
The time until disconnection is determined by the dwell-off wait time TDW_OF.
Show.
The section data of the start and end of energization
Data and the time data of the energization start wait time and energization end wait time.
Data and create an ignition schedule every 10 ms
You. That is, as shown in FIG.
L start crank position information variable DWCCAS, 2 bytes
Dwell time TDW_ON above 1 byte
The ignition crank position information variable IGCCAS, 2 bytes
The dwell-off waiting time TDW_OF as a member
Predetermined memory area using structure variables as ignition schedule
To record.
In this case, the ignition schedule
6 bytes each from offset address +0, +6, +12
Three ignition schedules IGSCD in the memory area
L1, IGSCDL2 and IGSCDL3 are stored
According to the schedule pointer described later.
What is the schedule for creating an ignition schedule during a 10 ms job
And the classend interrupt
Used in the ignition timer set. In this case, one
Schedule change during the ignition sequence
The latest schedule will be
Adopted.
Conventionally, an instruction value of the ignition timing is set, and
The ignition sequence is determined based on the
A series of processing of setting to Ma
At high engine speed due to heavy load
However, in the present invention, 10 m
Create an ignition schedule for each ignition schedule.
Set the ignition timer at the class interrupt according to the
The load does not increase even at high engine speeds.
Therefore, accurate ignition control can be performed.
Next, the preparation of the ignition schedule will be described.
The description will be made according to the flowcharts of FIGS.
You.
In this ignition schedule creation subroutine,
First, in step S1200, set on the user job side
The indicated dwell time ITDWL for half rotation time MTCS1
8 limit the ignition plugs assigned to each cylinder.
The two ignition coils are energized at the same time for the
And limit the value to the actual dwell time TDWL
And data on the duration of energization of the ignition coil 26a.
At a predetermined address of the RAM 60.
Next, the process proceeds to step S1201, and the processing is delayed.
Apparent dwell time D_T including time
DWL, and corresponds to the processing delay time in step S1202.
Let the waste angle be DM_DEG. This processing delay time
The ignition timer is actually set after the class interrupt occurs.
This is the processing delay time until the ignition
Maximum value of processing delay time in Imaset subroutine
Is recorded.
Next, steps S1202 to S12 are performed.
Proceed to 03 and check if error level ECAS is not zero
That is, whether the cylinder and crank positions have been determined
Check if the cylinder and crank position are ECAS ≠ 0
If not determined, the routine exits and ECAS =
If it is 0, the process proceeds to step S1204, where a new schedule
The pointer to the X register.
The schedule pointer has a 10 ms interval.
Job schedule pointer IGSCUS,
Schedule pointer IGS used for classain interrupt
There are CPTs, and all take values of 0, 6, and 12.
And the currently running ignition adopted by Classen Interrupt
Schedule pointer IGSCPT indicating the schedule
And the schedule when the ignition schedule was created last time
Logical OR with the pointer IGSCUS
The schedule value shown in FIG.
Search the inter-table IGSTBL and find the three ignition schedules
Joule IGSCDL1, IGSCDL2, IGSCD
Of L3, the ignition schedule for newly writing
select.
For example, the currently executed ignition schedule
Pointer IGSCPT is 0 (ignition schedule
IGSCDL1) and the ignition schedule created last time
Pointer IGSCUS is 6 (ignition schedule I
GSCDL2) corresponds to the logical sum 6 of 0 and 6.
Of the schedule pointer table IGSTBL
The ignition schedule IG where the data should be written next
Pointer value 12 specifying SCDL3 is stored
And 12 is X as a new schedule pointer.
Stored in register, ignition schedule IGSCDL
3 is written, then the schedule
Is stored in the pointer IGSCUS.
That is, the ignition schedule is two.
And at high engine speeds, classan interruptions are frequent
Data for ignition schedules that are not
Next class interrupt while rewriting data in 10ms job
Can occur and adopt new ignition schedule
Disappears. Not used at low engine speed
Even after rewriting the ignition schedule data,
Schedule for next data rewrite without interrupt
Becomes the schedule being adopted. Because of this,
Ignition created every 10ms with 3 fire schedules
Schedule data for asynchronous classene interrupt
It allows them to pass smoothly.
Thereafter, the steps S1204 to S1204 are repeated.
Proceeding to 1205, ignition is commanded before BTDC 10 °
In order to check whether or not the ignition timing IG
_DEG is subtracted and the difference is stored in accumulator A,
In step S1206, the contents of accumulator A and the processing delay
A comparison is made with the dead angle DM_DEG corresponding to time. So
As a result, A <DM_DEG, and the processing delay time is included.
If the ignition is before BTDC10 °, the label
Proceed to the processing of step S1300 and subsequent steps indicated by IGS10
A, DM ≧ DEG, and B including processing delay time
When the ignition is between TDC10 ° and ATDC83 °
Proceeds to step S1207.
In the step S1207, the accumulator A
Limit the content at 70 and ignite after ATDC 60 °
Is performed, and in step S1208, before half a rotation
Dwell time TDW_ based on the classen interval of
Calculate OF. Specifically, the classen interval table M
The section from TCSX to BTDC10 ° to ATDC83 °
Crank value corresponding to the value 2 of the crank position information variable CCAS
Reads the spiral interval and stores the contents of accumulator A as CCA
The value obtained by dividing by the crank angle value 93 in the section of S = 2 is read out.
And multiply it by the new Accumley interval.
The contents of data A. And this new accumulator
Since the content of A is the dwell-off waiting time TDW_OF,
is there.
That is, the rotation of the engine is globally
Because it fluctuates in a half rotation cycle, the latest class in the same measurement section
Calculates dwell-off waiting time TDW_OF using sen interval
To achieve steady rotation fluctuations at each crank angle.
Eliminate the errors, combustion intensity, flywheel weight,
Being unaffected by gear ratio, piston weight, etc.
It is possible to set an accurate ignition.
Next, steps S1208 to S12 are performed.
Going to 09, the section between BTDC10 ° and ATDC83 °
The value of CCAS = 2 is stored in accumulator B.
The contents of this accumulator B are
Report variable IGCCAS, and in step S1210,
Of the accumulator A, that is, the dwell-off waiting time TDW
_OF and apparent dwell time D_TDWL
You.
A> D_TDWL and the same section
When dwell start is possible between steps S1210 and
Processing after step S1460 indicated by label IGS90
Branch to A ≦ D_TDWL, and dwell in the same section
If it is not possible to start
When the content of the accumulator B is subtracted by 1, step S1212
Then, the contents of the accumulator A are set to IGCCAS = 1.
A value obtained by adding the classen interval of the corresponding previous section,
Processing after step S1350 indicated by label IGS15
Proceed to.
On the other hand, in step S1206, A <DM_
DEG, BTDC 10 ° including processing delay time
The previous ignition is instructed and the process proceeds to label IGS10 and later.
If it has proceeded, at step S1300, BTDC 65 °
65 to check if ignition has been commanded before
Accumulate the difference by subtracting the instruction ignition timing IG_DEG from
And store it in the accumulator in step S1301.
Data A and the dead angle DM_D corresponding to the processing delay time
EG, A <DM_DEG, processing delay
When the ignition before BTDC 65 ° including the interval
Is to check if the ignition is before BTDC 97 °
Further, after step S1400 indicated by the label IGS20
And then A ≧ DM_DEG, processing delay time
Including between BTDC 65 ° and BTDC 10 °
If there is, the process proceeds to step S1302.
In step S1302, BTDC 65 ° -1
Value 1 of crank position information variable CCAS indicating 0 ° section
Read from classen interval table MTCSX corresponding to
CCAS contents of accumulator A
= 1 divided by the crank angle value 55 in the section
The contents of Tana Accumulator A and this new accumulator
Let the contents of the radiator A be a dwell-off waiting time TDW_OF.
You. Then, in step S1303, the value of CCAS = 1 is added.
Store in accumulator B, and in this accumulator B
As the value of the ignition crank position information variable IGCCAS
Proceed to step S1350.
Steps S1350, S1351, and S1352 are as described above.
This is the same process as steps S1210, S1211, 1212,
Judge whether dwell start is possible between
If you can start the Lell,
Branching to the next section and cannot start dwelling in the same section
Is the dwell-off waiting time TDW_OF of the section immediately before
This is a process of adding the classen interval to a value.
That is, in step S1350, the accumulate
Data A, that is, dwell-off waiting time TDW_OF
And the apparent dwell time D_TDWL, and A>
In the case of D_TDWL, the label IGS starts from step S1350.
The processing branches to processing after 90, and when A ≦ D_TDWL,
In step S1351, the content of accumulator B is subtracted by 1 (B
= 0), in step S1352, the contents of accumulator A
Corresponds to the ignition crank position information variable IGCCAS = 0
Label IG as the value obtained by adding the classen interval of the section
The process proceeds to the process after step S1450 shown in S25.
On the other hand, the step indicated by the label IGS20
In the processing after step S1400, in step S1400, the BTDC 9
Check if ignition is commanded before 7 °
Therefore, subtract the instruction ignition timing IG_DEG from 97 to obtain the difference.
Stored in accumulator A, and in step S1401,
Of the accumulator A and the dead angle corresponding to the processing delay time
Compare with DM_DEG.
In step S1401, A <DM
_DEG, BTDC 97 ° including processing delay time
If the ignition is earlier than the above, from step S1401
The process branches to step S1402 to process the contents of the accumulator A.
Maximum as the dead angle DM_DEG corresponding to the delay time
After restricting the advance angle, proceed to step S1403, and proceed to step S14.
01, A ≧ DM_DEG, including processing delay time
When ignition is between BTDC 97 ° and BTDC 65 °
To step S1403.
In step S1403, BTDC 97 ° -6
Value 0 of crank position information variable CCAS indicating a 5 ° section
Read from classen interval table MTCSX corresponding to
CCAS contents of accumulator A
= 0 and multiplied by the value obtained by dividing the crank angle value by 32.
The contents of Tana Accumulator A and this new accumulator
Let the contents of the radiator A be a dwell-off waiting time TDW_OF.
You.
Next, the flow advances to step S1404, where CCAS
= 0 is stored in accumulator B, and this accumulator
The content of the radiator B is used as the ignition crank position information variable IGCCA.
The process advances to step S1450 as the value of S. Step S1450 or later
The processing of step S1210, S1211, S1212 and step S1210
As in S1350, S1351, and S1352, dwell starts in the same section.
Judge whether it is possible or not and start dwell in the same section
Sometimes, the process branches to the process after Label IGS90, and
Wait for dwell off if dwell cannot be started in section
Add the classen interval of the previous section to the time TDW_OF
It is the repetition of the process of setting the calculated value.
That is, in steps S1450, S1451, and S1452,
Processing, processing of steps S1453, S1454, S1455, step S14
In the processing of 56, S1457, and S1458, A ≦ D_TWDL and
When not branching to the bell IGS 90, the accumulator B
The contents are reduced in order of B = -1, B = -2, B = -3
The section is moved forward one by one, and the dwell-off waiting time TDW_O
Extend F one after another.
After steps S1456 to S1458, the space
The content of the accumulator B reaches -3, and in step S1459, A
> D_TDWL, the label is read from step S1459.
Proceed to step S1460 of the IGS90, and A ≦
In the case of D_TDWL, from step S1459 to step S1459
Proceeding to 1461, processing the contents of accumulator A to delay time
To step S1462.
In the step S1460 of the label IGS90,
Calculate back from the dwell time TDW_OF
Accumulation time to calculate the waiting time TDW_ON
The contents of data A, that is, dwell-off waiting time TDW_OF
Subtract the actual dwell time TDWL from the
Then, the process proceeds to step S1462.
Then, in step S1462, the accumulate
The contents of data A are set as dwell-on wait time TDW_ON,
In step S1463, the contents of accumulator B are deleted.
As the value of the start crank position information variable DWCCAS
After rewriting the fire schedule, step S1464
To the schedule pointer IG
Save to SCUS and exit the routine.
The above ignition schedule is set every 10 ms.
When set, the ignition timer is set during classen interrupt.
Is done. This ignition timer operates as shown in FIG.
Output pattern of mode M1 or output pattern of mode M2.
It operates in a turn, and in the mode M1, the initial value T1 and the reload
When the timer value is set to T2 and started, the time
When T1 has elapsed, the output goes low (ignition coil non-
High) (ignition coil energization)
It goes low after the passage of T2, while in mode M2,
The initial value T3 and the reload value FFFF (time not specified)
Set the timer to timer when the output is high level.
Output, the output goes low after the time T3 has elapsed.
Become.
[0176] In this case, in a normal classene interrupt,
Set dwell start time and dwell time in mode M1
The normal energizing sequence is adopted,
The ignition time interval becomes shorter,
While the ignition coil 26a is energized,
When a fire zone is reached, the dwell-off time is set in mode M2.
An energizing sequence to cut power is adopted.
This energizing sequence is based on the engine speed.
Height, dwell time, sudden change in rotation speed, sudden ignition timing
Interrupt processing at the end of ignition described later.
From the latest ignition schedule to the current energization state
Is checked to determine if the next dwell should be started immediately.
Separately, one of two types of energizing sequences
Is selected. And the ignition timer at classen interruption
The energizing sequence is determined in the set subroutine.
And the ignition timer is set according to the energization sequence.
You.
First, the ignition timer set subroutine
Will be described according to the flowcharts of FIGS. 1 and 2.
I do.
In this ignition timer setting subroutine,
In step S1500, whether the error level ECAS is 2
No, that is, the cylinder and crank positions are determined.
It is checked whether the state is unknown and ECAS = 2
In the case of, the routine exits as it is and ECAS $ 2
When the process proceeds to step S1501, the ignition timing non-setting flag
Check whether IGTMNS is set.
The ignition timing non-setting flag IGTMNS
Does not affect the ignition timer in the ignition end interrupt described later.
Time is set, and dwell-off time is set.
The dwell is started without being set and the ignition timing is not
This is a flag that indicates the setting status.
In step S1501, the ignition timing unset flag is set
When the ignition coil 26a is energized, the label
The process proceeds to step S1530 and subsequent steps indicated by TENS30.
Waiting for dwell-off time → communication by ignition mode M2
Set the ignition sequence to the ignition timer, and set the ignition timing
If the lag is not set, the above step S150
The process proceeds from step 1 to step S1502.
In step S1502, at the time of ignition
From the latest ignition schedule adopted in the interrupt
Dwell start crank position information variable DWCCAS read out
The horizontal axis indicates the dwell start section based on the indicated value, and the crank overall position
Energization state map IGCTB with the variable ACAS as the vertical axis
L.
The energization state map IGCTBL indicates that the ignition
The schedule represents a common ignition sequence for each cylinder.
On the other hand, as shown in FIG.
Variable ACAS and dwell start crank position information variable D
WCCAS or ignition crank position information variable IGCC
Ignition for each cylinder at a certain point in time based on the indicated value of AS
The energization state of the coil 26a is represented by a 1-byte map value.
It was done.
A map of the above-mentioned energization state map IGCTBL
As for the value, the upper 4 bits are now delayed by the value F and once by the value F.
The value E indicates a delay situation of two delays, and the lower 4 bits
Is a cylinder information variable RCA as data indicating the cylinder to be energized.
S, adopted as ignition cylinder information variable IGRCAS
Is done. For example, the dwell start crank position information variable DW
CCAS is -1 and the current crank position comprehensive variable ACAS
Is 3, the map value is F1, which is the RCA
S = 1, that is, the section in which the dwell for cylinder # 3 is immediately before
Indicates that it should have started with Also, for example
If the ignition crank position information variable IGCCAS is 2 and
If the total crank position variable ACAS of 11 is 11,
The loop value is 03, which is RCAS = 3, ie, # 4
Cylinder ignition should take place in the current section
And
As a result, the current section should be
The energized state can be determined efficiently, and
Suppress increase in memory capacity and decrease in processing speed due to complication
Because accurate and high-speed ignition control can be performed
is there.
Thereafter, the steps S1502 to S1502 are repeated.
When proceeding to 1503, refer to the above-mentioned energization state map IGCTBL
From the result, it is determined whether it is the current dwell start section or not.
If it is not the start section, exit the routine and start dwell
If it is a section, the process proceeds to step S1504, where the ignition
Timer operation flag FL indicating that the timer is operating
Refers to G_IG to determine whether the timer has expired.
If the timer has not expired, exit the routine,
When the timer has expired, in step S1505, the ignition cylinder
Determine the information variable IGRCAS and label it with TENS70
Proceed to the processing after step S1570 shown, and wait time
→ Dwell on → Dwell time → Communication by ignition mode M1
Set the ignition sequence to the ignition timer.
Next, the mode M after the label TENS30
Set the ignition timer according to 2 and the label TENS7
Set ignition timer in mode M1 after 0
explain.
First, after the label TENS30, the steps
In step S1530, the ignition crank position
The horizontal axis indicates the ignition interval according to the indicated value of the
The energization state map is set with the rank total position variable ACAS as the vertical axis.
With reference to the IGCTBL, in step S1531, the current ignition
Check if it is not between. And when it is not the ignition section
Exits the routine, and during the ignition interval, step S1531
From step S1532, and stores the value F in the accumulator B.
The FFF is stored, and in step S1533, the ignition timer is output.
The force pattern is set to mode M2.
Next, the routine proceeds to step 1534, where the ignition schedule
Against the dwell-off waiting time TDW_OF read from the
Subtract the current processing delay time and accumulate the value.
Stored in data A, the accumulative
Check that the contents of data A are positive and normal.
You.
In step S1535, if A> 0,
If it is normal, the process proceeds from step S1535.
Proceed to step S1580, and accumulator A contents are sorted by cylinder.
The new content is obtained by adding the retard time of. This cylinder
Another retard time is cylinder specific for a 50ms job
Is converted from retard angle to retard time.
When the ignition timer is set during this classen interrupt,
Calculating the retard for each cylinder very easily.
Can be.
Thereafter, the flow advances to step S1581 to add a new address.
Contents of accumulator A, that is, retard time for each cylinder
The dwell-off time obtained by adding
In step S1582, the contents of accumulator B are reloaded by timer
As the value, the ignition timer is started in step S1595.
Let
That is, when the ignition coil is energized,
From the interrupted classen interruption, the dwell of the ignition schedule
Reduce the current processing delay time from the off wait time TDW_OF
Calculated that the retard time for each cylinder has been added.
The output of the ignition timer changes from high level to low level.
Thus, ignition (dwell-off) is performed. In this case,
After the ignition timer output goes low,
Since the reload value is set to FFFF,
Continue the bell state.
After starting the ignition timer,
Proceed to step S1596 to indicate that the timer is running
Therefore, if the flag FLG_IG during the timer operation is set,
In step S1597, an ignition timing non-setting flag IGTMNS
And exit the routine.
On the other hand, in step S1535,
Of the accumulator A, that is, the dwell-off waiting time TDW
The value obtained by subtracting the current processing delay time from _OF
When the condition of A ≦ 0 is reached, the ignition timer
Cannot be set to a negative time, the above step S153
Branching from 5 to step S1590, the timer initial value is set to 0,
In step S1591, the contents of accumulator B are reset by timer.
The process proceeds to step S1592 as the load value.
At step S1592, the current processing delay time
To determine whether or not exceeds the recorded value ICTIME.
If not exceeding CTIME, in step S1594
Set the error flag and exceed the recorded value ICTIME
If yes, update the processing delay record in step S1593
After rewriting the maximum value of the recorded value ICTIME,
The error flag is set in step S1594, and the
Exit the routine after 5 to S1597.
The above recorded value ICTIME is determined by the following ignition schedule.
This recorded value ICTIME is used when creating joules.
By taking into account the processing delay time due to
Make sure that no errors occur again with the fire timer set.
Can be.
Next, the processing after the label TENS70 will be described.
In step S1570, the output of the mode M1 is described.
The pattern is set, and in step S1571, the ignition
The drive circuit in the igniter 27 corresponding to the file 26a is selected.
Select distributor on logic to select
You.
Next, the routine proceeds to step S1572, where the ignition schedule
Dwell-on waiting time TDW_ON read from Joule
The current processing delay time is subtracted from the
When stored in the murator A, the process proceeds to step S1573,
Store actual dwell time TDWL in accumulator B
You.
Then, steps S1573 to S
Proceed to 1574, and the contents of accumulator A,
The TDW_ON is a positive value and checks if it is normal.
When A> 0, the process proceeds to step S1580 described above,
After steps S1580, S1581, and S1582, accumulator A
New contents that add retard time for each cylinder
To the timer initial value, and the contents of accumulator B
Ignition using actual dwell time TDWL as timer reload value
The timer is started, and the above steps S1595, S1596, S1
Exit the routine via 597.
That is, at the time of classan interruption, the ignition timing
Unset flag IGTMNS is not set and ignition
When the coil 26a is not energized, the energized state map
Judgment of the current classen interrupt status from IGCTBL
If the current classen interrupt is in the dwell start section,
Dwell-on waiting time TDW_ON of fire schedule
Subtract the current processing delay time to get the retard time for each cylinder.
Set the added time in the ignition timer, and after the set time elapses
The output of the ignition timer from low to high
The energization of the ignition coil 26a is started, and the actual dwell time T
After the DWL has elapsed, the energization is terminated and ignition is performed.
is there.
In step S1574, if A ≦
When the value is 0, the above-described steps S1574 to S
Proceed to 1590 or later. Similarly, set the timer initial value to 0, accumulate
Current processing using the contents of the lator B as the timer reload value
Process when the delay time exceeds the recorded value ICTIME
Update the delay record.
According to the ignition timer setting subroutine described above,
When the ignition timer is set and ignition is performed,
The interruption at the end of ignition shown in FIG. 6 occurs.
In this ignition end interruption, first,
In step S1600, it is checked whether or not the dwell is off.
When not in the off-state, the interrupt ends and the dwell-off
Only when the process proceeds to step S1601 and thereafter, a predetermined process is performed.
Now.
That is, in step S1601, the ignition timer
Is stopped and cleared, and in step S1602, the timer
When the moving flag FLG_IG is cleared, step S160 is performed.
Go to 3 and go to the ignition schedule creation subroutine
To indicate the latest ignition schedule used in
The value of the joule pointer IGSCUS
Copy to the Inter IGSCPT
Address of the address specified by the IGSCPT
Adopt an ignition schedule.
Next, the process proceeds to step S1604, and the ignition schedule
Joule dwell start crank position information variable DWCCA
S and the current crank overall position variable ACAS
From the energization state map IGCTBL
Read out the lower 4 bits from the current ignition cylinder information variable IG
The RCAS is examined, and in step S1605, the current ignition cylinder is
Check whether the information variable IGRCAS has the same value as before
Find out.
As a result, the current ignition cylinder information variable IGR
When the CAS is the same as before, the same cylinder is pointed again
Since there is no need to fire, the interrupt is terminated and the current ignition
When the cylinder information variable IGRCAS is different from before,
The process proceeds from step S1605 to step S1606, where the ignition cylinder
Update the information variable IGRCAS and proceed to step S1607.
No.
In step S1607, the ignition cylinder information variable I
GRCAS value from dwell point of view and ignition point of view
By checking whether the values seen from
Whether the situation requires immediate dwelling
Is determined. Here, the cylinder information from Dwell's point of view
RCAS DWL (= IGRCAS), from the viewpoint of ignition
When the viewed cylinder information is represented by RCASIG, as shown in FIG.
Cylinder information RCAS from a dwell perspective
DWL (= IGRCAS) becomes the next
The ignition target cylinder is indicated by a constant value until the
Cylinder data RCAS from the viewpoint of ignition
IG has the same value as the cylinder information RCASDWL for the same cylinder.
The current supply end section and then the next power supply end section.
This is data indicating the cylinder to be ignited at a constant value until the ignition is stopped. So
No need to start dwell with ignition off
Both match only in the section.
That is, this ignition end interrupt has occurred.
At the end of ignition, RCASDWL ≠ RCASIG
If the end of coil energization and the start of energization are in the same section,
Abrupt changes in engine speed, ignition timing, etc.
Immediately after the ignition of one cylinder ends, the dwell of the next cylinder is opened.
It can be seen that the section has to start.
Therefore, in step S1607, the ignition cylinder
Information variable IGRCAS (= RCASDWL)
If the same value as RCASIG, the ignition coil is turned off.
And the start of energization are not in the same section,
Terminate the interrupt separately and, as described above,
Wait for the next dwell start section every time
Wait time → dwell on → dwell time → ignition
Set the energization sequence to the ignition timer.
[0209] In step S1607, the ignition cylinder information is set.
Report variable IGRCAS is different from the value RCASIG seen from ignition.
When the ignition coil is turned off,
A condition in which the dwell must start immediately
Condition and the ignition timer set after step S1608.
Waiting time → energizing only dwell-on
Set the sequence to the ignition timer.
That is, in step S1608, the logic
Select the distributor in step S1609.
When the initial value is set to 256, in step S1610, the timer
Let the reload value be FFFF. Note that the initial value of the timer is 25.
Reference numeral 6 indicates a rotation signal from the primary terminal of the ignition coil 26a.
Reliable counting when using a tachometer that backs up
Off period of 1 ms to allow
When a meter is used, the characteristics of the ignition coil 26a
Any setting may be made.
Then, steps S1610 to S
Proceed to 1611 and change the output pattern of the ignition timer to mode M1.
Then, in step S1612, the ignition timer is started.
In step S1613, the timer operation flag FLG_IG is set.
Then, in step S1614, dwell has started
Nevertheless, dwell-off, that is, ignition timing is set
Ignition timing unset flag IGTM indicating that ignition has not been performed
NS is set and the interrupt is terminated.
Thus, the off period of 1 ms after the end of ignition
Dwell starts after a while, and fires every classen interruption
When the ignition section is reached after waiting for the section to be
Dwell off time → ignition energization sequence is set to ignition timer
Set.
[0213]
As described above,Claim 1invention
According toClan representing multiple specified crank positions
Input a pulse to specify
A certain number of cam pulses for cylinder discrimination between crank pulses
Input based on the input pattern of these pulses.
As well as grasping the rank position and performing cylinder discrimination,
The interval is set for each input of the link pulse, and the interval
Set the time from the start position to the ignition timer and set the ignition coil
When performing ignition control by turning on and off the engine, the engine
The process for each crank pulse input synchronized with the rotation
The section that indicates the cylinder and crank position is the preset ignition
It is determined whether or not the section according to. And for ignition
When this section is reached, the setting is made based on the engine operating condition.
From the specified ignition coil energization / interruption time,
Processing from input of input to actual setting of ignition timer
Set the value obtained by subtracting the delay time in the ignition timer, and
Fires and treats from ignition coil energization / interruption time
The current processing when the value obtained by subtracting the delay time is negative
Determines whether the delay time exceeds the processing delay time record value.
Refuse. And the current processing delay time exceeds the recorded value
, The processing delay time record value according to the current processing delay time
Is updated and the recorded value is processed at the next ignition timer setting.
Since it is used as the delay time,
Until the ignition timer is actually setProcessing delay time
When it becomes longer than usual,SometimesWhen processing is delayed
whileUpdate the processing delay time record value byNext ignition tie
Used for masset,Eliminate the effects of processing delays and always
Ignition can be performed at the right time, and the engine output
Improving performance and improving exhaust gas emissions
Excellent effects can be obtained.
【図面の簡単な説明】
【図1】点火タイマセットサブルーチンの部分フローチ
ャート1
【図2】点火タイマセットサブルーチンの部分フローチ
ャート2
【図3】0.5ms毎の定期割込み処理のフローチャー
ト
【図4】クラセン割込み処理のフローチャート
【図5】ジョブ優先処理のフローチャート
【図6】ジョブ実行サブルーチンの部分フローチャート
1
【図7】ジョブ実行サブルーチンの部分フローチャート
2
【図8】ジョブ実行サブルーチンの部分フローチャート
3
【図9】ジョブ実行サブルーチンの部分フローチャート
4
【図10】クランク位置算出サブルーチンのフローチャ
ート
【図11】CCAS・RCAS判別サブルーチンのフロ
ーチャート
【図12】点火スケジュール作成サブルーチンの部分フ
ローチャート1
【図13】点火スケジュール作成サブルーチンの部分フ
ローチャート2
【図14】点火スケジュール作成サブルーチンの部分フ
ローチャート3
【図15】点火スケジュール作成サブルーチンの部分フ
ローチャート4
【図16】点火終了時割込み処理のフローチャート
【図17】ジョブの実行状態を示す説明図
【図18】ジョブフラグの説明図
【図19】クランク位置変数の説明図
【図20】ジョブ実行中フラグとオーバーラップカウン
タの変化を示す説明図
【図21】システムシフトバッファの説明図
【図22】クラセン間隔テーブルの説明図
【図23】気筒・クランク位置状態マップの説明図
【図24】点火シーケンスと点火区間変数の説明図
【図25】点火スケジュールの説明図
【図26】スケジュールポインタテーブルの説明図
【図27】点火タイマセットの説明図
【図28】通電状態マップの説明図
【図29】通電気筒情報と点火気筒情報との関係を示す
説明図
【図30】クランク位置とエンジンの行程を示すタイム
チャート
【図31】エンジン系の概略構成図
【図32】クランクロータとクランク角センサの正面図
【図33】カムロータとカム角センサの正面図
【図34】電子制御系の回路構成図
【符号の説明】
1 エンジン
50 ECU
26a 点火コイル
TDW_ON ドエルオン待ち時間(通電時間)
TDW_OF ドエルオフ待ち時間(遮断時間)
ICTIME 処理遅れ時間の記録値(最大値)BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a partial flowchart 1 of an ignition timer set subroutine. FIG. 2 is a partial flowchart 2 of an ignition timer set subroutine. FIG. 3 is a flowchart of a periodic interruption process every 0.5 ms. FIG. 5 is a flowchart of a job priority subroutine. FIG. 6 is a partial flowchart 1 of a job execution subroutine. FIG. 7 is a partial flowchart 2 of a job execution subroutine. FIG. 8 is a partial flowchart 3 of a job execution subroutine. FIG. 10 is a flowchart of a crank position calculation subroutine. FIG. 11 is a flowchart of a CCAS / RCAS determination subroutine. FIG. 12 is a partial flowchart 1 of an ignition schedule creation subroutine. FIG. 14 is a partial flowchart 3 of the ignition schedule creation subroutine. FIG. 15 is a partial flowchart 4 of the ignition schedule creation subroutine. FIG. 16 is a flowchart of an ignition end interruption process. FIG. 18 is an explanatory diagram showing an execution state. FIG. 18 is an explanatory diagram of a job flag. FIG. 19 is an explanatory diagram of a crank position variable. FIG. 20 is an explanatory diagram showing changes in a job execution flag and an overlap counter. FIG. 22 is an explanatory diagram of a classen interval table. FIG. 23 is an explanatory diagram of a cylinder / crank position state map. FIG. 24 is an explanatory diagram of an ignition sequence and an ignition section variable. 26: Description of the schedule pointer table [FIG. 27] FIG. 28 is an explanatory diagram of a fire timer set. FIG. 28 is an explanatory diagram of an energization state map. FIG. 29 is an explanatory diagram showing a relationship between power-carrying cylinder information and ignition cylinder information. 31: Schematic configuration diagram of an engine system. FIG. 32: Front view of a crank rotor and a crank angle sensor. FIG. 33: Front view of a cam rotor and a cam angle sensor. FIG. 34: Circuit configuration diagram of an electronic control system. Engine 50 ECU 26a Ignition coil TDW_ON Dwell-on waiting time (energization time) TDW_OF Dwell-off waiting time (cutoff time) ICTIME Recorded value of processing delay time (maximum value)
フロントページの続き (58)調査した分野(Int.Cl.7,DB名) F02P 5/15 F02D 45/00 F02D 43/00 Continuation of front page (58) Field surveyed (Int.Cl. 7 , DB name) F02P 5/15 F02D 45/00 F02D 43/00
Claims (1)
ンクパルスを入力し、複数のクランクパルスのうち、特
定のクランクパルス間で気筒判別用の所定数のカムパル
スを入力して、これらパルスの入力パターンに基づいて
クランク位置を把握すると共に気筒判別を行い、上記ク
ランクパルスの入力毎に区間を設定し、点火に係る区間
の開始位置からの時間を点火タイマにセットして点火コ
イルの通電・遮断を行い点火制御を行うエンジンの点火
制御において、 エンジン回転に同期するクランクパルス入力毎の処理
で、現在の気筒及びクランク位置を表す区間が、予め設
定した点火に係る区間となったか否かを判断し、 点火に
係る区間となったとき、エンジン運転状態に基づいて設
定した点火コイルの通電・遮断時間から、クランクパル
ス入力から実際に点火タイマがセットされるまでの処理
遅れ時間を差し引いた値を点火タイマにセットして、点
火を行うと共に、 上記点火コイルの通電・遮断時間から処理遅れ時間を差
し引いた値が負となったとき、現在の処理遅れ時間が処
理遅れ時間記録値を超えているか否かを判断し、現在の
処理遅れ時間が記録値を越えている時、現在の処理遅れ
時間により処理遅れ時間記録値を更新し、該記録値を次
回の点火タイマセットの際に処理遅れ時間として用いる
ことを特徴とするエンジンの点火制御における処理遅れ
解消方法。(57) [Claim 1] A class representing a plurality of specified crank positions.
Input a crank pulse, and
A certain number of cam pallets for cylinder discrimination between certain crank pulses
Input, and based on the input pattern of these pulses,
As well as grasping the crank position and performing cylinder discrimination,
A section is set for each rank pulse input, and a section related to ignition
Set the time from the start position of the ignition
Ignition of an engine that controls ignition by turning on and off the oil
In control, processing for each crank pulse input synchronized with engine rotation
The section indicating the current cylinder and crank position is set in advance.
It is determined whether the section has reached the set ignition
When this section is reached, the setting is made based on the engine operating condition.
From the specified ignition coil energization / interruption time,
Processing from input of input to actual setting of ignition timer
Set the value obtained by subtracting the delay time in the ignition timer, and
Fire is performed, and the processing delay time is subtracted from the ignition coil energization / cutoff time.
When the subtracted value becomes negative, the current processing delay time is processed.
Judge whether or not it exceeds the record
When the processing delay time exceeds the recorded value, the current processing delay
Update the processing delay time record value according to the time, and
A method for eliminating a processing delay in ignition control of an engine , wherein the processing delay is used as a processing delay time at the time of setting an ignition timer .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP06071693A JP3384498B2 (en) | 1993-03-19 | 1993-03-19 | Method of eliminating processing delay in engine ignition control |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP06071693A JP3384498B2 (en) | 1993-03-19 | 1993-03-19 | Method of eliminating processing delay in engine ignition control |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06272650A JPH06272650A (en) | 1994-09-27 |
| JP3384498B2 true JP3384498B2 (en) | 2003-03-10 |
Family
ID=13150300
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP06071693A Expired - Fee Related JP3384498B2 (en) | 1993-03-19 | 1993-03-19 | Method of eliminating processing delay in engine ignition control |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3384498B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112268135B (en) * | 2020-11-06 | 2022-11-15 | 中国兵器装备集团自动化研究所 | Control method and device applied to three-position five-way electromagnetic valve |
-
1993
- 1993-03-19 JP JP06071693A patent/JP3384498B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH06272650A (en) | 1994-09-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4373489A (en) | Spark timing control system | |
| GB2209191A (en) | Engine ingition timing control system | |
| JP3384498B2 (en) | Method of eliminating processing delay in engine ignition control | |
| US4640253A (en) | Electronic fuel injection control with variable injection timing | |
| 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 | |
| JP3337149B2 (en) | Engine crank position determination method | |
| JP3530551B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JPH06272651A (en) | Current-carrying sequence setting method in ignition control for engine | |
| JP3530550B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JP3645576B2 (en) | Calculation method of engine rotation time | |
| JP3324818B2 (en) | How to use engine crank position information | |
| JP3331237B2 (en) | Injection start section setting method for each cylinder of a multi-cylinder engine | |
| 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 | |
| JPH06249053A (en) | Analog/digital conversion method | |
| JPH06257500A (en) | Grasping method for engine operation condition | |
| JPH06257501A (en) | Engine half rotation time estimating method | |
| JPH07103052A (en) | Fuel injection control method for multicylinder engine | |
| JPH0719100A (en) | Method for setting injection starting internal for each cylinder of multi-cylinder engine | |
| JP3064606B2 (en) | Engine ISC valve control method | |
| JP2000248980A (en) | Engine start control device | |
| JP3196902B2 (en) | Engine ISC valve control method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |