JP3331237B2 - Injection start section setting method for each cylinder of a multi-cylinder engine - Google Patents
Injection start section setting method for each cylinder of a multi-cylinder engineInfo
- Publication number
- JP3331237B2 JP3331237B2 JP16263893A JP16263893A JP3331237B2 JP 3331237 B2 JP3331237 B2 JP 3331237B2 JP 16263893 A JP16263893 A JP 16263893A JP 16263893 A JP16263893 A JP 16263893A JP 3331237 B2 JP3331237 B2 JP 3331237B2
- Authority
- JP
- Japan
- Prior art keywords
- injection
- job
- cylinder
- injection start
- section
- 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
- 238000002347 injection Methods 0.000 title claims description 399
- 239000007924 injection Substances 0.000 title claims description 399
- 238000000034 method Methods 0.000 title description 107
- 239000000446 fuel Substances 0.000 claims description 88
- 238000012545 processing Methods 0.000 claims description 68
- 238000004364 calculation method Methods 0.000 claims description 19
- 238000002485 combustion reaction Methods 0.000 claims description 12
- 230000006835 compression Effects 0.000 claims description 9
- 238000007906 compression Methods 0.000 claims description 9
- 230000007423 decrease Effects 0.000 claims description 2
- 238000006243 chemical reaction Methods 0.000 description 31
- 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 28
- 101710116822 Atrochrysone carboxylic acid synthase Proteins 0.000 description 22
- 238000010586 diagram Methods 0.000 description 18
- 230000002159 abnormal effect Effects 0.000 description 16
- 230000006870 function Effects 0.000 description 15
- 230000000737 periodic effect Effects 0.000 description 14
- 230000015654 memory Effects 0.000 description 10
- 230000001360 synchronised effect Effects 0.000 description 9
- 238000011217 control strategy Methods 0.000 description 7
- 230000001186 cumulative effect Effects 0.000 description 7
- 238000001514 detection method Methods 0.000 description 6
- 230000003111 delayed effect Effects 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
- 239000002699 waste material Substances 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 239000000498 cooling water Substances 0.000 description 3
- 238000012937 correction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 208000019901 Anxiety disease Diseases 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 2
- 230000036506 anxiety Effects 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 239000007789 gas Substances 0.000 description 2
- 238000002360 preparation method Methods 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 125000002066 L-histidyl group Chemical group [H]N1C([H])=NC(C([H])([H])[C@](C(=O)[*])([H])N([H])[H])=C1[H] 0.000 description 1
- 229910017435 S2 In Inorganic materials 0.000 description 1
- 230000003213 activating effect 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
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000003197 catalytic effect Effects 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000002828 fuel tank Substances 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000001301 oxygen Substances 0.000 description 1
- 229910052760 oxygen Inorganic materials 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000010349 pulsation Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000007858 starting material Substances 0.000 description 1
- 238000009834 vaporization Methods 0.000 description 1
- 230000008016 vaporization Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Landscapes
- Electrical Control Of Air Or Fuel Supplied To Internal-Combustion Engine (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、各気筒の1サイクルを
8区間に区分して噴射開始区間を指定する多気筒エンジ
ンの気筒別噴射開始区間設定方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for setting an injection start section for each cylinder of a multi-cylinder engine in which one cycle of each cylinder is divided into eight sections and an injection start section is designated.
【0002】[0002]
【従来の技術】近年、自動車などの車輛にマイクロコン
ピュータが導入され、エンジン、パワートレイン等を高
精度に制御することが可能になった。これにより、車輛
制御システムの開発においては、マイクロコンピュータ
のソフトウエア開発が大きな比重を占めるようになり、
制御アルゴリズム上の処理の効率化が重要な課題となっ
ている。特に、最近のエンジン制御系では制御内容が複
雑化しており、CPUの効率的な活用はエンジン制御性
の向上を図る上でも重要である。2. Description of the Related Art In recent years, microcomputers have been introduced into vehicles such as automobiles, and it has become possible to control engines, power trains and the like with high accuracy. As a result, in the development of vehicle control systems, the software development of microcomputers has become a major player,
It is important to improve the efficiency of the processing on the control algorithm. In particular, in recent engine control systems, the control contents are complicated, and efficient utilization of the CPU is important in improving engine controllability.
【0003】一般に、上記マイクロコンピュータによる
エンジン制御システムにおける燃料の噴射開始時期は所
定クランク角毎の割込み処理で設定される。例えば特開
昭61−160545号公報では、一定クランク角毎に
入力するクランクパルスをカウントしてエンジンの回転
角位置を検出し、その検出値に基づいて噴射開始時期を
割出す(いわゆる角度制御)、あるいは所定クランク角
度間で計時した間隔時間に基づき噴射開始時期を割出す
もの(いわゆる時間制御)などがある。Generally, the fuel injection start timing in the engine control system by the microcomputer is set by an interruption process at every predetermined crank angle. For example, in Japanese Patent Application Laid-Open No. SHO 61-160545, the number of crank pulses input at every constant crank angle is counted to detect the rotational angle position of the engine, and the injection start timing is determined based on the detected value (so-called angle control). Alternatively, an injection start timing is calculated based on an interval time measured between predetermined crank angles (so-called time control).
【0004】[0004]
【発明が解決しようとする課題】ところで、多気筒エン
ジンにおいてシーケンシャル制御を行う場合、従来は、
吸気行程開始前何度から噴射開始せよと言う指示に従
い、エンジン回転に同期する割込み処理の中で現在のク
ランク角が吸気行程前何度かを演算し、この結果を指示
値と比較して燃料噴射を開始すべきかの判定を全気筒に
ついて繰返し行っている。By the way, when performing sequential control in a multi-cylinder engine, conventionally,
According to the instruction to start the injection several times before the start of the intake stroke, in the interrupt processing synchronized with the engine rotation, the current crank angle is calculated several times before the intake stroke, and the result is compared with the indicated value to compare the fuel value. The determination of whether to start the injection is repeated for all cylinders.
【0005】また、噴射エンドを制御するエンジンで
は、現在のエンジン回転数から噴射終了時期を割出し、
この終了時期から噴射開始時期を逆算して求める手順を
上述したクランク角度毎の割込み処理中で行っている。In an engine for controlling the injection end, the injection end timing is determined from the current engine speed.
The procedure for calculating the injection start timing back from the end timing is performed during the interrupt processing for each crank angle described above.
【0006】その結果、燃料噴射制御ではエンジン回転
に同期する割込み処理が複雑で重くなり、高回転時にシ
ーケンシャル制御を行おうとすれば、他の制御処理に支
障を来す為、充分な噴射制御を行うことができなかっ
た。As a result, in the fuel injection control, the interrupt processing synchronized with the engine rotation becomes complicated and heavy, and if the sequential control is performed at a high rotation speed, other control processing is hindered. Could not do.
【0007】本発明は上記事情に鑑みてなされたもの
で、エンジン回転に同期して実行する割込み処理の負担
を軽減し、高回転時であっても良好な制御性を得ること
のできる多気筒エンジンの気筒別噴射開始区間設定方法
を提供することを目的としている。SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and reduces the load of interrupt processing executed in synchronization with engine rotation so that a multi-cylinder can obtain good controllability even at high rotation. It is an object of the present invention to provide a method for setting an injection start section for each cylinder of an engine.
【0008】[0008]
【課題を解決するための手段】上記目的を達成するため
本発明は、気筒及びクランク位置を示す気筒別クランク
位置区間を総合的に表すクランク総合位置変数をパラメ
ータとして、各気筒毎に1サイクルを、吸気行程後半、
吸気行程前半、排気行程後半、排気行程前半、燃焼行程
後半、燃焼行程前半、圧縮行程後半、圧縮行程前半の8
区間に区分し、この各区間を固有の数値で表した各気筒
毎の噴射開始区間テーブルを備え、設定された噴射開始
セット時間を、予め設定された時間周期で実行されるコ
ンピュータ割込み処理により、上記区間の起点クランク
角を示すクランク角センサ信号入力から該区間の終点ク
ランク角を示すクランク角センサ信号入力までの間隔時
間で順次ゼロ或いは負になるまで減算して、燃料噴射を
行う噴射開始区間を特定し、該特定された噴射開始区間
を表す変数を噴射開始区間設定フラグにセットし、クラ
ンク角センサ信号入力によるエンジン回転同期により実
行されるコンピュータ割込み処理により、現在の気筒及
びクランク位置を表す上記クランク位置総合変数により
該当気筒の上記噴射開始区間テーブルを参照し、該テー
ブル参照により得た数値により表される区間と上記噴射
開始区間設定フラグにセットされた変数により指定され
ている区間とを比較して、これら両区間の一致により燃
料噴射開始区間を決定することを特徴とする。 [MEANS FOR SOLVING THE PROBLEMS] To achieve the above object
The present invention relates to a cylinder-specific crank indicating a cylinder and a crank position.
Parameterize the overall crank position variable that comprehensively represents the position section.
One cycle for each cylinder, the second half of the intake stroke,
First half of intake stroke, second half of exhaust stroke, first half of exhaust stroke, combustion stroke
8 in the second half, the first half of the combustion stroke, the second half of the compression stroke, and the first half of the compression stroke
Each cylinder is divided into sections and each section is represented by a unique numerical value.
Each injection start section table is provided, and the set injection start
The set time is set to a value that is executed at a preset time period.
Start interrupt of the above section by computer interrupt processing
From the input of the crank angle sensor indicating the angle
When the interval until the crank angle sensor signal indicating the rank angle is input
Between fuel injections until it becomes zero or negative.
The injection start section to be performed is specified, and the specified injection start section is specified.
Is set in the injection start section setting flag, and the
The engine rotation is synchronized by inputting the link angle sensor signal.
The current cylinder and current
And the crank position comprehensive variable representing the crank position
Referring to the injection start section table for the relevant cylinder,
Section and the above-mentioned injection
Specified by the variable set in the start section setting flag
Compared to the section with
The fuel injection start section is determined.
【0009】[0009]
【作用】本発明は、気筒別に噴射開始区間を設定するに
際し、気筒及びクランク位置を示す気筒別クランク位置
区間を総合的に表すクランク総合位置変数をパラメータ
として、各気筒毎に1サイクルを、吸気行程後半、吸気
行程前半、排気行程後半、排気行程前半、燃焼行程後
半、燃焼行程前半、圧縮行程後半、圧縮行程前半の8区
間に区分し、この各区間を固有の数値で表した各気筒毎
の噴射開始区間テーブルを備える。そして、設定された
噴射開始セット時間を、予め設定された時間周期で実行
される割込み処理において、上記区間の起点クランク角
を示すクランク角センサ信号入力から該区間の終点クラ
ンク角を示すクランク角センサ信号入力までの間隔時間
で順次ゼロ或いは負になるまで減算して、燃料噴射を行
う噴射開始区間を特定し、該特定された噴射開始区間を
表す変数を噴射開始区間設定フラグにセットする。そし
て、クランク角センサ信号入力によるエンジン回転同期
により実行される割込み処理において、現在の気筒及び
クランク位置を表す上記クランク位置総合変数により該
当気筒の上記噴射開始区間テーブルを参照し、該テーブ
ル参照により得た数値により表される区間と上記噴射開
始区間設定フラグにセットされた変数により指定されて
いる区間とを比較して、これら両区間の一致により燃料
噴射開始区間を決定する。従って、エンジン回転同期の
割込み処理においてはテーブル参照と、該テーブル参照
により得た数値により表される区間と上記噴射開始区間
設定フラグにセットされた変数により指定されている区
間との一致判断とで、噴射開始区間が決定されるため、
処理が簡素化してエンジン回転に同期して実行する割込
み処理の負担が軽減する。 According to the present invention, an injection start section is set for each cylinder.
Crank position by cylinder indicating cylinder and crank position
Parameterize the overall crank position variable that comprehensively represents the section
One cycle for each cylinder, the second half of the intake stroke,
The first half of the stroke, the second half of the exhaust stroke, the first half of the exhaust stroke, after the combustion stroke
8 sections: half, first half of combustion stroke, second half of compression stroke, first half of compression stroke
Between the cylinders, and this section is represented by a unique numerical value for each cylinder.
Is provided. And set
Executes the injection start set time at a preset time cycle
In the interrupt processing performed, the starting crank angle of the above section
From the crank angle sensor signal input indicating
Interval time until crank angle sensor signal indicating link angle
And then subtract until the value becomes zero or negative, and perform fuel injection.
To determine the injection start section, and the specified injection start section
Is set in the injection start section setting flag. Soshi
And engine rotation synchronization by inputting crank angle sensor signal
In the interrupt processing executed by the
The above crank position general variable representing the crank position
Referring to the injection start section table of the cylinder, the table
The interval indicated by the numerical value obtained by
Specified by the variable set in the start section setting flag
Compared to the section where
Determine the injection start section. Therefore, the engine rotation
In interrupt processing, refer to a table and refer to the table.
And the above-mentioned injection start section
The zone specified by the variable set in the configuration flag
Since the injection start section is determined by determining the match with the interval,
Interrupt that simplifies processing and executes in synchronization with engine rotation
The burden of processing is reduced.
【0010】[0010]
【実施例】以下、図面に基づいて本発明の実施例を説明
する。Embodiments of the present invention will be described below with reference to the drawings.
【0011】図面は本発明の一実施例に係り、図1は
0.5ms毎の定期割込み処理を示すフローチャート、
図2はクラセン割込み処理を示すフローチャート、図3
はジョブ優先処理を示すフローチャート、図4〜図7は
ジョブ実行サブルーチンを示すフローチャート、図8は
クランク位置算出サブルーチンを示すフローチャート、
図9はCCAS・RCAS判別サブルーチンを示すフロ
ーチャート、図10、図11は燃料噴射開始時期の算出
ルーチンを示すフローチャート、図12は噴射タイマセ
ットサブルーチンを示すフローチャート、図13、図1
4は噴射タイマセットマクロ1ルーチンを示すフローチ
ャート、図15、図16は噴射タイマセットマクロ2ル
ーチンを示すフローチャート、図17はジョブの実行状
態を示す説明図、図18はジョブフラグの説明図、図1
9はジョブ実行中フラグとオーバーラップカウンタの変
化を示す説明図、図20はシステムシフトバッファの説
明図、図21はクラセン間隔テーブルの説明図、図22
は気筒・クランク位置状態マップの説明図、図23はク
ランク位置、カム位置とクランク位置変数、噴射開始区
間テーブル及び気筒別行程順のタイムチャート、図24
は噴射開始区間、及び噴射開始区間設定フラグの説明
図、図25は噴射タイマコントロールを示すタイムチャ
ート、図26はエンジン系の概略構成図、図27はクラ
ンクロータとクランク角センサの正面図、図28はカム
ロータとカム角センサの正面図、図29は電子制御系の
回路構成図である。The drawings relate to an embodiment of the present invention, and FIG. 1 is a flowchart showing a periodic interruption process every 0.5 ms.
FIG. 2 is a flow chart showing the class interrupt processing, and FIG.
4 to 7 are flowcharts showing a job execution subroutine, FIG. 8 is a flowchart showing a crank position calculation subroutine,
9 is a flowchart showing a CCAS / RCAS determination subroutine, FIGS. 10 and 11 are flowcharts showing a routine for calculating a fuel injection start timing, FIG. 12 is a flowchart showing an injection timer setting subroutine, FIGS.
4 is a flowchart showing an injection timer set macro 1 routine, FIGS. 15 and 16 are flowcharts showing an injection timer set macro 2 routine, FIG. 17 is an explanatory diagram showing a job execution state, and FIG. 18 is an explanatory diagram of a job flag. 1
9 is an explanatory diagram showing changes in the job execution flag and the overlap counter, FIG. 20 is an explanatory diagram of the system shift buffer, FIG. 21 is an explanatory diagram of the classen interval table, and FIG.
FIG. 23 is an explanatory diagram of a cylinder / crank position state map, FIG. 23 is a time chart of a crank position, a cam position and a crank position variable, an injection start section table, and a stroke order for each cylinder, FIG.
Is an explanatory diagram of an injection start section and an injection start section setting flag, FIG. 25 is a time chart showing an injection timer control, FIG. 26 is a schematic configuration diagram of an engine system, and FIG. 27 is a front view of a crank rotor and a crank angle sensor. 28 is a front view of a cam rotor and a cam angle sensor, and FIG. 29 is a circuit configuration diagram of an electronic control system.
【0012】本実施例のエンジン制御システムでは、図
29に示すマイクロコンピュータを中核とした電子制御
装置(ECU)50によって図26に示すエンジン系が
制御され、燃料噴射制御、点火時期制御などが行われ
る。このECU50のマイクロコンピュータには、新し
い概念に基づくオペレーティングシステム(OS)が搭
載されており、このOSの管理下で、各制御ストラテジ
ーに基づく各ジョブが、それぞれの優先レベルに従って
実行される。In the engine control system of this embodiment, an engine system shown in FIG. 26 is controlled by an electronic control unit (ECU) 50 having a microcomputer shown in FIG. 29 as a core, and fuel injection control, ignition timing control and the like are performed. Will be The microcomputer of the ECU 50 is equipped with an operating system (OS) based on a new concept, and under the control of the OS, each job based on each control strategy is executed according to its priority level.
【0013】まず、エンジン系の機器構成について説明
する。First, the configuration of the engine system will be described.
【0014】図26において、符号1はエンジン(本実
施例においては水平対向4気筒エンジン)であり、右バ
ンクR側に#1,#3気筒を、左バンクL側に#2,#
4気筒を備える。そして、シリンダブロック1aの左右
両バンクに併設するシリンダヘッド2の吸気ポート2a
にインテークマニホルド3が連通され、このインテーク
マニホルド3の上流にエアチャンバ4を介してスロット
ル通路5が連通されている。このスロットル通路5の上
流側には、吸気管6を介してエアクリーナ7が取付けら
れ、このエアクリーナ7が吸入空気の取入れ口であるエ
アインテークチャンバ8に連通されている。In FIG. 26, reference numeral 1 denotes an engine (in this embodiment, a horizontally opposed four-cylinder engine), which includes # 1 and # 3 cylinders on the right bank R side, and # 2 and # 3 on the left bank L side.
It has four cylinders. The intake port 2a of the cylinder head 2 provided in both left and right banks of the cylinder block 1a.
An intake manifold 3 is communicated with the intake manifold 3, and a throttle passage 5 is communicated upstream of the intake manifold 3 via an air chamber 4. An air cleaner 7 is mounted on the upstream side of the throttle passage 5 via an intake pipe 6, and the air cleaner 7 is communicated with an air intake chamber 8, which is an intake port for intake air.
【0015】また、上記排気ポート2bにエキゾースト
マニホルド9を介して排気管10が連通され、この排気
管10に触媒コンバータ11が介装されてマフラ12に
連通されている。一方、上記スロットル通路5にスロッ
トルバルブ5aが設けられ、このスロットル通路5の直
上流の上記吸気管6にインタークーラ13が介装され、
さらに、上記吸気管6の上記エアクリーナ7の下流側に
レゾネータチャンバ14が介装されている。An exhaust pipe 10 communicates with the exhaust port 2b via an exhaust manifold 9, and a catalytic converter 11 is interposed in the exhaust pipe 10 and communicates with a muffler 12. On the other hand, a throttle valve 5a is provided in the throttle passage 5, and an intercooler 13 is interposed in the intake pipe 6 immediately upstream of the throttle passage 5,
Further, a resonator chamber 14 is provided downstream of the air cleaner 7 in the intake pipe 6.
【0016】また、上記レゾネータチャンバ14と上記
インテークマニホルド3とを連通して上記スロットルバ
ルブ5aの上流側と下流側とをバイパスするバイパス通
路15に、アイドルスピードコントロールバルブ(IS
CV)16が介装されている。さらに、このISCV1
6の直下流側に、吸気圧が負圧のとき開弁し、またター
ボチャージャ18によって過給されて吸気圧が正圧にな
ったとき閉弁するチェックバルブ17が介装されてい
る。An idle speed control valve (IS) is connected to a bypass passage 15 which communicates the resonator chamber 14 with the intake manifold 3 and bypasses the upstream and downstream sides of the throttle valve 5a.
CV) 16 is interposed. Furthermore, this ISCV1
Immediately downstream of 6, a check valve 17 that opens when the intake pressure is negative and closes when the intake pressure becomes positive due to supercharging by the turbocharger 18 is interposed.
【0017】上記ターボチャージャ18は、上記吸気管
6の上記レゾネータチャンバ14の下流側にコンプレッ
サが介装され、タービンが上記排気管10に介装されて
いる。さらに、上記ターボチャージャ18のタービンハ
ウジング流入口には、ウエストゲート弁19が介装さ
れ、このウエストゲート弁19には、ウエストゲート弁
作動用アクチュエータ20が連設されている。In the turbocharger 18, a compressor is provided downstream of the resonator chamber 14 of the intake pipe 6, and a turbine is provided in the exhaust pipe 10. Furthermore, a wastegate valve 19 is interposed at the turbine housing inlet of the turbocharger 18, and a wastegate valve operating actuator 20 is connected to the wastegate valve 19.
【0018】上記ウエストゲート弁作動用アクチュエー
タ20は、ダイヤフラムにより2室に仕切られ、一方が
ウエストゲート弁制御用デューティソレノイド弁21に
連通される圧力室を形成し、他方が上記ウエストゲート
弁19を閉方向に付勢するスプリングを収納したスプリ
ング室を形成している。The wastegate valve actuating actuator 20 is divided into two chambers by a diaphragm, one of which forms a pressure chamber which communicates with a wastegate valve control duty solenoid valve 21, and the other of which forms the wastegate valve 19. A spring chamber containing a spring biased in the closing direction is formed.
【0019】上記ウエストゲート弁制御用デューティソ
レノイド弁21は、上記レゾネータチャンバ14と上記
吸気管6の上記ターボチャージャ18のコンプレッサ下
流とを連通する通路に介装されており、ECU50から
出力される制御信号のデューティ比に応じて、上記レゾ
ネータチャンバ14側の圧力と上記コンプレッサ下流側
の圧力とを調圧し、上記ウエストゲート弁作動用アクチ
ュエータ20の圧力室に供給する。The waste gate valve control duty solenoid valve 21 is interposed in a passage communicating between the resonator chamber 14 and the compressor of the intake pipe 6 downstream of the turbocharger 18, and a control output from the ECU 50. The pressure on the resonator chamber 14 side and the pressure on the downstream side of the compressor are adjusted in accordance with the duty ratio of the signal, and are supplied to the pressure chamber of the wastegate valve actuating actuator 20.
【0020】すなわち、上記ECU50によって上記ウ
エストゲート弁制御用デューティソレノイド弁21を制
御し、上記ウエストゲート弁作動用アクチュエータ20
を作動させて上記ウエストゲート弁19による排気ガス
リリーフを調整することにより、上記ターボチャージャ
18による過給圧を制御するようになっている。That is, the waste gate valve control duty solenoid valve 21 is controlled by the ECU 50, and the waste gate valve operation actuator 20 is controlled.
Is operated to adjust the exhaust gas relief by the wastegate valve 19, so that the supercharging pressure by the turbocharger 18 is controlled.
【0021】また、上記インテークマニホルド3に絶対
圧センサ22が通路23を介して連通され、この通路2
3に、上記絶対圧センサ22と上記インテークマニホル
ド3或は大気とを選択的に連通する吸気管圧力/大気圧
切換ソレノイド弁24が介装されている。An absolute pressure sensor 22 is connected to the intake manifold 3 through a passage 23,
3, an intake pipe pressure / atmospheric pressure switching solenoid valve 24 for selectively communicating the absolute pressure sensor 22 with the intake manifold 3 or the atmosphere is provided.
【0022】さらに、上記インテークマニホルド3の各
気筒の各吸気ポート2aの直上流側にインジェクタ25
が臨まされ、また、上記シリンダヘッド2の各気筒毎
に、その先端を燃焼室に露呈する点火プラグ26aが取
付けられ、この点火プラグ26aに連設された点火コイ
ル26bにイグナイタ27が接続されている。Further, an injector 25 is located immediately upstream of each intake port 2a of each cylinder of the intake manifold 3.
In addition, an ignition plug 26a whose tip is exposed to the combustion chamber is attached to each cylinder of the cylinder head 2, and an igniter 27 is connected to an ignition coil 26b connected to the ignition plug 26a. I have.
【0023】上記インジェクタ25には、燃料タンク2
8内に設けたインタンク式の燃料ポンプ29から燃料フ
ィルタ30を経て燃料が圧送され、プレッシャレギュレ
ータ31にて調圧される。The injector 25 has a fuel tank 2
Fuel is pressure-fed from an in-tank type fuel pump 29 provided in 8 via a fuel filter 30, and the pressure is regulated by a pressure regulator 31.
【0024】また、上記吸気管6の上記エアークリーナ
7の直下流に吸入空気量センサ32が介装され、上記ス
ロットルバルブ5aに、スロットル開度センサ33aと
アイドルスイッチ33bとを内蔵したスロットルセンサ
33が連設されている。An intake air amount sensor 32 is disposed immediately downstream of the air cleaner 7 in the intake pipe 6, and a throttle sensor 33 having a throttle opening sensor 33a and an idle switch 33b built in the throttle valve 5a. Are connected.
【0025】さらに、上記エンジン1のシリンダブロッ
ク1aにノックセンサ34が取付けられるとともに、こ
のシリンダブロック1aの左右両バンクを連通する冷却
水通路35に冷却水温センサ36が臨まされ、上記排気
管10の上記エキゾーストマニホルド9の集合部にO2
センサ37が臨まされている。Further, a knock sensor 34 is attached to the cylinder block 1a of the engine 1, and a cooling water temperature sensor 36 is exposed to a cooling water passage 35 communicating both left and right banks of the cylinder block 1a. O2 is added to the collecting part of the exhaust manifold 9
A sensor 37 is exposed.
【0026】また、上記シリンダブロック1aに支承さ
れたクランクシャフト1bにクランクロータ38が軸着
され、このクランクロータ38の外周に、電磁ピックア
ップなどからなるクランク角センサ39が対設されてい
る。さらに、上記エンジン1のカムシャフト1cに連設
するカムロータ40に、電磁ピックアップなどからなる
気筒判別用のカム角センサ41が対設されている。尚、
上記クランク角センサ39及び上記カム角センサ41
は、電磁ピックアップなどの磁気センサに限らず、光セ
ンサなどでも良い。A crank rotor 38 is axially mounted on a crankshaft 1b supported by the cylinder block 1a. A crank angle sensor 39 such as an electromagnetic pickup is provided on the outer periphery of the crank rotor 38. Further, a cam angle sensor 41 for discriminating cylinders, such as an electromagnetic pickup, is provided opposite the cam rotor 40 connected to the camshaft 1c of the engine 1. still,
The crank angle sensor 39 and the cam angle sensor 41
Is not limited to a magnetic sensor such as an electromagnetic pickup, but may be an optical sensor or the like.
【0027】上記クランクロータ38は、図27に示す
ように、その外周に突起38a,38b,38cが形成
され、これらの各突起38a,38b,38cが、各気
筒(#1,#2と#3,#4)の圧縮上死点前(BTD
C)θ1,θ2,θ3 の位置に形成されている。尚、本実施
例においては、θ1 =97°CA、θ2 =65°CA、
θ3 =10°CAである。As shown in FIG. 27, the crank rotor 38 has projections 38a, 38b, 38c formed on its outer periphery, and these projections 38a, 38b, 38c are connected to the cylinders (# 1, # 2 and # 2). 3, # 4) before compression top dead center (BTD
C) It is formed at the positions of θ1, θ2, θ3. In this embodiment, θ1 = 97 ° CA, θ2 = 65 ° CA,
θ3 = 10 ° CA.
【0028】上記クランクロータ38の各突起は、上記
クランク角センサ39によって検出され、図23に示す
ようにBTDC97°,65°,10°CAのクランク
角信号(クラセン信号)がエンジン1/2回転毎(18
0°CA毎)に出力される。そして、各信号の入力間隔
時間がタイマによって計時され、エンジン回転数が算出
される。上記突起38bは、点火時期設定の際の基準ク
ランク角となり、また、突起38cは、始動時噴射開始
時期の基準クランク角となるとともに始動時の固定点火
時期を示すクランク角となる。Each protrusion of the crank rotor 38 is detected by the crank angle sensor 39. As shown in FIG. 23, BTDC 97 °, 65 °, and 10 ° CA crank angle signals (classen signals) are rotated by one-half engine revolution. Every (18
0 ° CA). Then, the input interval time of each signal is measured by a timer, and the engine speed is calculated. The protrusion 38b serves as a reference crank angle at the time of setting the ignition timing, and the protrusion 38c serves as a reference crank angle of the injection start timing at the start and a crank angle indicating a fixed ignition timing at the start.
【0029】また、図28に示すように、上記カムロー
タ40の外周には、気筒判別用の突起40a,40b,
40cが形成され、突起40aが#3,#4気筒の圧縮
上死点後(ATDC)θ4 の位置に形成され、突起40
bが3個の突起で構成されて最初の突起が#1気筒のA
TDCθ5 の位置に形成されている。さらに、突起40
cが2個の突起で形成され、最初の突起が#2気筒のA
TCDθ6 の位置に形成されている。尚、本実施例にお
いては、θ4 =20°CA、θ5 =5°CA、θ6 =2
0°CAである。As shown in FIG. 28, on the outer periphery of the cam rotor 40, protrusions 40a, 40b,
A projection 40a is formed at a position θ4 after the top dead center (ATDC) of compression of the # 3 and # 4 cylinders.
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 TCDθ6. In this embodiment, .theta.4 = 20 DEG CA, .theta.5 = 5 DEG CA, .theta.6 = 2.
0 ° CA.
【0030】そして、上記カムロータ40の各突起が上
記カム角センサ41によって検出され、各気筒の燃焼行
程順を#1→#3→#2→#4とした場合、この燃焼行
程順と、上記カム角センサ41の検出信号をカウンタに
よって計数した値とのパターン(図23のタイムチャー
ト参照)に基づいて、気筒判別がなされる。When each of the protrusions of the cam rotor 40 is detected by the cam angle sensor 41, and the order of the combustion strokes of the cylinders is # 1, # 3, # 2, # 4, the order of the combustion strokes and Cylinder discrimination is performed based on a pattern of the detection signal of the cam angle sensor 41 and the value counted by the counter (see the time chart of FIG. 23).
【0031】一方、図29に示すように、ECU50
は、燃料噴射制御、点火時期制御などを行なうメインコ
ンピュータ51と、ノック検出処理を行なう専用のサブ
コンピュータ52との2つのコンピュータを中心として
構成され、各部に所定の安定化電源を供給する定電圧回
路53や各種の周辺回路が組込まれている。On the other hand, as shown in FIG.
Is composed mainly of two computers, a main computer 51 for performing fuel injection control, ignition timing control, etc., and a dedicated sub-computer 52 for performing knock detection processing, and a constant voltage for supplying a predetermined stabilized power to each unit. The circuit 53 and various peripheral circuits are incorporated.
【0032】上記定電圧回路53は、ECUリレー54
のリレー接点を介してバッテリ55に接続され、このバ
ッテリ55に、上記ECUリレー54のリレーコイルが
イグニッションスイッチ56を介して接続されている。
また、上記バッテリ55には、上記定電圧回路53が直
接接続され、さらに、燃料ポンプリレー57のリレー接
点を介して燃料ポンプ29が接続されている。The constant voltage circuit 53 includes an ECU relay 54
, And a relay coil of the ECU relay 54 is connected to the battery 55 via an ignition switch 56.
The constant voltage circuit 53 is directly connected to the battery 55, and the fuel pump 29 is connected to the battery 55 via a relay contact of a fuel pump relay 57.
【0033】すなわち、上記定電圧回路53は、上記イ
グニッションスイッチ56がONされ、上記ECUリレ
ー54のリレー接点が閉となったとき、制御用電源を供
給し、また、上記イグニッションスイッチ56がOFF
されたとき、バックアップ用の電源を供給する。That is, the constant voltage circuit 53 supplies control power when the ignition switch 56 is turned on and the relay contact of the ECU relay 54 is closed, and the ignition switch 56 is turned off.
When power is supplied, supply power for backup.
【0034】上記メインコンピュータ51は、CPU5
8(以下、メインCPU58と称する)、ROM59、
RAM60、上記イグニッションスイッチ56がOFF
されたときにも上記定電圧回路53からバックアップ電
源が供給されてデータを保持するバックアップRAM6
1、カウンタ・タイマ群62、シリアル通信インターフ
ェースであるSCI63、及び、I/Oインターフェー
ス64がバスライン65を介して接続されたマイクロコ
ンピュータである。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 RAM 6 that is supplied with backup power from the constant voltage circuit 53 and retains data even when the
1. A microcomputer in which a counter / timer group 62, an SCI 63 which is a serial communication interface, and an I / O interface 64 are connected via a bus line 65.
【0035】尚、上記カウンタ・タイマ群62は、フリ
ーランニングカウンタ、カム角センサ(以下、適宜、カ
ムセンと略記する)信号の入力計数用カムセンカウンタ
などの各種カウンタ、噴射タイマ、点火タイマ、後述す
る0.5ms毎の定期割込みを発生させるための定期割
込みタイマ、クランク角センサ(以下、適宜、クラセン
と略記する)信号の入力間隔計時用クラセンタイマ、及
び、システム異常監視用のウオッチドッグタイマなどの
各種タイマを便宜上総称するものであり、上記メインコ
ンピュータ51においては、その他、各種のソフトウエ
アカウンタ・タイマが用いられる。The counter / timer group 62 includes various counters such as a free running counter, a cam angle counter for counting the input of a cam angle sensor (hereinafter, abbreviated as cam angle) signal, an injection timer, an ignition timer, and the like. A periodic interrupt timer for generating a periodic interrupt every 0.5 ms, a class time timer for measuring an input interval of a crank angle sensor (hereinafter abbreviated as classene) signal, a watchdog timer for monitoring a system abnormality, etc. These various timers are collectively referred to for convenience. In the main computer 51, various other software counters and timers are used.
【0036】また、上記サブコンピュータ52も、上記
メインコンピュータ51と同様、CPU71(以下、サ
ブCPU71と称する)、ROM72、RAM73、カ
ウンタ・タイマ群74、SCI75、及び、I/Oイン
ターフェース76がバスライン77を介して接続された
マイクロコンピュータであり、上記メインコンピュータ
51とサブコンピュータ52とは、上記SCI63,7
5を介してシリアル通信ラインにより互いに接続されて
いる。Similarly to the main computer 51, the sub computer 52 includes a CPU 71 (hereinafter referred to as a sub CPU 71), a ROM 72, a RAM 73, a counter / timer group 74, an SCI 75, and an I / O interface 76. The main computer 51 and the sub-computer 52 are connected to each other via the SCIs 63 and 7.
5 are connected to each other by a serial communication line.
【0037】上記メインコンピュータ51のI/Oイン
ターフェース64には、入力ポートに、吸入空気量セン
サ32、スロットル開度センサ33a、水温センサ3
6、O2 センサ37、絶対圧センサ22、車速センサ4
2、及び、バッテリ55が、8チャンネル入力のA/D
変換器66を介して接続されるとともに、アイドルスイ
ッチ33b、クランク角センサ39、カム角センサ41
が接続されており、さらに、始動状態を検出するために
スタータスイッチ43が接続されている。The input port of the I / O interface 64 of the main computer 51 includes an intake air amount sensor 32, a throttle opening sensor 33a, and a water temperature sensor 3 as input ports.
6. O2 sensor 37, absolute pressure sensor 22, vehicle speed sensor 4.
2, and the battery 55 is an 8-channel input A / D
Connected via a converter 66, the idle switch 33b, the crank angle sensor 39, the cam angle sensor 41
Are connected, and a starter switch 43 is connected to detect a start state.
【0038】尚、本実施例においては、上記A/D変換
器66は、7チャンネル分の入力が使用され、残りの1
チャンネルは予備となっている。In this embodiment, the A / D converter 66 uses inputs for seven channels, and the remaining one is used.
The channel is reserved.
【0039】また、上記I/Oインターフェース64の
出力ポートには、イグナイタ27が接続され、さらに、
駆動回路67を介して、ISCV16、インジェクタ2
5、燃料ポンプリレー57のリレーコイル、および、ウ
エストゲート弁制御用デューティソレノイド弁21、吸
気管圧力/大気圧切換ソレノイド弁24が接続されてい
る。An igniter 27 is connected to an output port of the I / O interface 64.
ISCV16, injector 2 via drive circuit 67
5. The relay coil of the fuel pump relay 57, the waste gate valve control duty solenoid valve 21, and the intake pipe pressure / atmospheric pressure switching solenoid valve 24 are connected.
【0040】一方、上記サブコンピュータ52のI/O
インターフェース76は、入力ポートに、クランク角セ
ンサ39、カム角センサ41が接続されるとともに、A
/D変換器78、周波数フィルタ79、アンプ80を介
してノックセンサ34が接続されており、上記ノックセ
ンサ34からのノック検出信号が上記アンプ80で所定
のレベルに増幅された後に上記周波数フィルタ79によ
り必要な周波数成分が抽出され、上記A/D変換器78
にてデジタル信号に変換されて入力されるようになって
いる。On the other hand, the I / O of the subcomputer 52
The interface 76 has an input port to which the crank angle sensor 39 and the cam angle sensor 41 are connected.
A knock sensor 34 is connected via a / D converter 78, a frequency filter 79, and an amplifier 80. After the knock detection signal from the knock sensor 34 is amplified to a predetermined level by the amplifier 80, the frequency filter 79 A required frequency component is extracted by the A / D converter 78
Is converted into a digital signal and input.
【0041】上記メインコンピュータ51では、各セン
サ類からの検出信号を処理し、燃料噴射パルス幅、点火
時期などを演算する。すなわち、吸入空気量センサ32
の出力信号から吸入空気量を算出し、RAM60及びバ
ックアップRAM61に記憶されている各種データに基
づき、吸入空気量に見合った燃料噴射量を演算し、ま
た、点火時期などを算出する。The main computer 51 processes the detection signals from the sensors and calculates the fuel injection pulse width, ignition timing, and the like. That is, the intake air amount sensor 32
The amount of intake air is calculated from the output signal of, the amount of fuel injection corresponding to the amount of intake air is calculated based on various data stored in the RAM 60 and the backup RAM 61, and the ignition timing and the like are calculated.
【0042】そして、上記燃料噴射量に相応する駆動パ
ルス幅信号を、駆動回路67を介して所定のタイミング
で該当気筒のインジェクタ25に出力して燃料を噴射
し、また、所定のタイミングでイグナイタ27に点火信
号を出力し、該当気筒の点火プラグ26aを点火する。Then, a drive pulse width signal corresponding to the above-mentioned fuel injection amount is output to the injector 25 of the corresponding cylinder at a predetermined timing via the drive circuit 67 to inject fuel, and the igniter 27 is output at a predetermined timing. To output an ignition signal to ignite the ignition plug 26a of the corresponding cylinder.
【0043】その結果、該当気筒に供給された混合気が
爆発燃焼し、エキゾーストマニホルド9の集合部に臨ま
されたO2 センサ37により排気ガス中の酸素濃度が検
出され、この検出信号が波形整形された後、上記メイン
CPU58で基準値(スライスレベル)と比較され、エ
ンジンの空燃比状態が目標空燃比に対し、リッチ側にあ
るか、リーン側にあるかが判別され、空燃比が目標空燃
比となるようフィードバック制御される。As a result, the air-fuel mixture supplied to the corresponding cylinder explodes and burns, and the oxygen concentration in the exhaust gas is detected by the O2 sensor 37 facing the collecting portion of the exhaust manifold 9, and the detection signal is shaped. After that, the main CPU 58 compares the air-fuel ratio with a reference value (slice level) to determine whether the air-fuel ratio state of the engine is rich or lean with respect to the target air-fuel ratio. Feedback control is performed so that
【0044】一方、上記サブコンピュータ52では、エ
ンジン回転数とエンジン負荷とに基づいてノックセンサ
34からの信号のサンプル区間を設定し、このサンプル
区間でノックセンサ34からの信号を高速にA/D変換
して振動波形を忠実にデジタルデータに変換し、ノック
発生の有無を判定する。On the other hand, the sub-computer 52 sets a sample period of the signal from the knock sensor 34 based on the engine speed and the engine load, and A / D converts the signal from the knock sensor 34 at high speed in this sample period. Then, the vibration waveform is faithfully converted into digital data to determine whether knock has occurred.
【0045】上記サブコンピュータ52のI/Oインタ
ーフェース76の出力ポートは、上記メインコンピュー
タ51のI/Oインターフェース64の入力ポートに接
続されており、上記サブコンピュータ52でのノック判
定結果がI/Oインターフェース76に出力される。そ
して、上記メインコンピュータ51では、上記サブコン
ピュータ52からノック発生有りの判定結果が出力され
ると、SCI63を介してシリアル通信ラインよりノッ
クデータを読込み、このノックデータに基づいて直ちに
該当気筒の点火時期を遅らせ、ノックを回避する。The output port of the I / O interface 76 of the sub-computer 52 is connected to the input port of the I / O interface 64 of the main computer 51. It is output to the interface 76. When the main computer 51 outputs the knocking determination result from the sub-computer 52, the knocking data is read from the serial communication line via the SCI 63, and the ignition timing of the corresponding cylinder is immediately determined based on the knocking data. Delay and avoid knocking.
【0046】このようなエンジン制御において、上記メ
インコンピュータ51では、各センサ類からの信号入力
処理、エンジン回転数算出、吸入空気量算出、燃料噴射
量算出、点火時期算出といった各項目毎の各種プログラ
ムが、一つのOSの管理下で効率的に実行される。この
OSは、車輌制御のための各種マネジメント機能、及
び、このマネジメント機能に密着した内部ストラテジー
を有し、各種ジョブを体系的に結合する。In such an engine control, the main computer 51 executes various programs for each item such as signal input processing from each sensor, engine speed calculation, intake air amount calculation, fuel injection amount calculation, and ignition timing calculation. Is efficiently executed under the control of one OS. The OS has various management functions for vehicle control and an internal strategy closely related to the management functions, and systematically combines various jobs.
【0047】上記OSのマネジメント機能としては、 (1-1)ジョブの優先処理 (1ー2)セクション定義による各ジョブの分割ファイル対
応 (1-3)スタックの使用状況モニタ機能 (1-4)異常割込み動作のモニタ機能 (1-5)ジョブ毎に固有の制約を作らない標準マップ・標
準ワークメモリ設定などの機能があり、制御ストラテジ
ーの開発環境を向上させるとともに、限られたCPU能
力を最大限に発揮させ、デジタル制御理論の基本である
等時間間隔処理を可能な限り達成することができる。The management functions of the OS include (1-1) job priority processing (1-2) support of divided files of each job according to section definitions (1-3) stack usage monitoring function (1-4) Monitoring function of abnormal interrupt operation (1-5) There are functions such as standard map and standard work memory settings that do not create unique restrictions for each job, which improves the development environment for control strategies and maximizes the limited CPU capacity. It is possible to achieve as much as possible the equal time interval processing that is the basis of digital control theory.
【0048】等時間間隔処理としては、0.5ms毎の
定期割込みを基本として、2,4,10,50,250
ms毎の5種類の等間隔割込みジョブが用意されてお
り、また、エンジン回転に同期した処理として、クラン
ク角信号入力により即割込み実行される高優先クラセン
ジョブ(以下、単にクラセンジョブと称する)と、より
優先順位が高い他のジョブがないときにクランク角信号
入力により割込み実行される比較的緊急度の低い低優先
クラセンジョブとが用意されている。The processing at equal time intervals is based on periodic interruption every 0.5 ms, and is based on 2, 4, 10, 50, 250
There are provided five types of equally-spaced interrupt jobs for every ms, and a high-priority classa job (hereinafter simply referred to as a class job) which is immediately executed by a crank angle signal input as a process synchronized with the engine rotation. And a low priority classene job with a relatively low urgency that is interrupted by the input of a crank angle signal when there is no other job with a higher priority.
【0049】これらの各ジョブには、クラセンジョブ>
2msジョブ>4msジョブ>10msジョブ>低優先
クラセンジョブ>50msジョブ>250msジョブの
順で、7〜1の優先レベルが高位側から低位側に向かっ
て付けられており、図17に示すように、高速ジョブに
対し低速ジョブが分割して処理されるとともに、各ジョ
ブの多重待ち処理が行なわれる。Each of these jobs is a class job>
In the order of 2 ms job> 4 ms job> 10 ms job> low priority class job> 50 ms job> 250 ms job, the priority levels of 7 to 1 are assigned from the higher side to the lower side, as shown in FIG. A low-speed job is divided and processed for a high-speed job, and multiple waiting processing for each job is performed.
【0050】また、上記OSの下で働く各プログラム
は、機能別の領域毎に順番に配列されており、各機能毎
にセクション宣言によって名前が付けられている。上記
OS下で働く数々のストラテジーファイル(ユーザ側フ
ァイル)は、各機能毎にOSと同じ名前のセクション宣
言を用いることにより、開発段階において、例えば、初
期値設定処理、10ms毎の処理、バックグランド処理
等を別々のファイルに記述しても、各ファイルがリンク
されたとき、同じ処理は連続した1つの領域に集めら
れ、OSと融合し一体となって動作する。The programs operating under the OS are arranged in order in each area for each function, and each function is named by a section declaration. Various strategy files (user-side files) working under the OS use, for each function, a section declaration having the same name as the OS, for example, in the development stage, for example, initial value setting processing, processing every 10 ms, background processing, and the like. Even if the processes and the like are described in separate files, when the files are linked, the same processes are collected in one continuous area and integrated with the OS to operate integrally.
【0051】各ストラテジーファイル側で使用する主な
セクション領域は、 ○変数宣言領域 ○自己ファイル名、ファイル制作時の自動記録領域 ○セッティングデータ領域 ○クラセンジョブ領域 ○2msジョブ領域 ○4msジョブ領域 ○10msジョブ領域 ○低優先クラセンジョブ領域 ○50msジョブ領域 ○250msジョブ領域 ○リセット時初期化ジョブ領域 ○エンスト時初期化ジョブ領域 ○バックグランドジョブ領域 ○プログラム本体の領域 であり、機能毎にファイルを分割してプログラム開発が
可能になるとともに、プログラムの構造化記述を可能に
する。The main section areas used on each strategy file side are: a variable declaration area; a self-file name; an automatic recording area when creating a file; a setting data area; a classen job area; a 2 ms job area; a 4 ms job area; Job area ○ Low priority classa job area ○ 50ms job area ○ 250ms job area ○ Initialization job area at reset ○ Initialization job area at stalling ○ Background job area ○ Program main area Program development and structured description of programs.
【0052】また、上記OSには、以上のマネジメント
機能に密着した内部ストラテジーとして、 (2-1)A/D変換処理 (2-2)クランク位置に係る各種情報の算出 (2-3)デバッグ用シミュレーション機能(エンジン回転
及びA/D変換) (2-4)点火タイマのセット (2-5)噴射タイマのセット などの機能を備えており、さらに、これらの機能に係る
各種サービスルーチンが各ジョブ中に用意されている。The above OS has the following internal strategies closely related to the management functions: (2-1) A / D conversion processing (2-2) Calculation of various information related to crank position (2-3) Debugging Simulation functions (engine rotation and A / D conversion) (2-4) Set ignition timer (2-5) Set injection timer, etc. In addition, various service routines related to these functions are provided. Prepared during the job.
【0053】従来、このような機能は各ジョブレベルで
達成するようになっていたが、本システムにおいては、
すべてOS側に用意され、OS側で処理したA/D変換
結果、クランク位置情報、エンジン回転数などに基づい
て、ユーザ側の各ジョブで、燃料噴射量、点火時期など
を設定すると、これらの指示値がOSによって噴射タイ
マ、点火タイマにセットされるようになっている。Conventionally, such a function has been achieved at each job level. However, in this system,
When the fuel injection amount, ignition timing, and the like are set in each job on the user side based on the A / D conversion result, crank position information, engine speed, and the like, all of which are prepared on the OS side and processed on the OS side, The instruction value is set in the injection timer and the ignition timer by the OS.
【0054】次に、上記メインコンピュータ51におけ
る燃料噴射制御の機能を、ジョブ処理の説明を基本とし
て、図1〜図16に示すフローチャートに従って説明す
る。尚、サブコンピュータ52はノック検出処理専用の
コンピュータであるため、その動作説明を省略する。Next, the function of the fuel injection control in the main computer 51 will be described with reference to the flowcharts shown in FIGS. Since the sub-computer 52 is a computer dedicated to knock detection processing, its operation will not be described.
【0055】まず、イグニッションスイッチ56がON
されてシステムに電源が投入されると、リセットに伴う
リセット割込みが起動し、各種イニシャライズが行なわ
れるとともに、0.5ms毎に定期割込みを起動するた
めの定期割込みタイマが起動され、クランク角センサ3
9からの信号入力毎(BTDC97°,65°,10°
CA毎のエンジン1回転に6回)に起動されるクラセン
割込みが許可され、その後、バックグランドジョブの実
行状態となる。First, the ignition switch 56 is turned on.
Then, when the system is turned on, a reset interrupt associated with the reset is activated, various initializations are performed, a periodic interrupt timer for activating a periodic interrupt every 0.5 ms is activated, and the crank angle sensor 3 is activated.
9 (BTDC 97 °, 65 °, 10 °)
Classen interruption started six times per engine revolution per CA) is permitted, and then the background job execution state is set.
【0056】そして、このバックグランドジョブの上
で、0.5ms毎の定期割込みと、エンジン1回転に6
回のクラセン割込みとにより、7レベルのジョブが優先
処理される。この2つの割込みにおいては、各自の処理
を実行後、共通のアドレスにジャンプし、ジョブ優先処
理を実行する。Then, on this background job, a periodic interruption every 0.5 ms, and 6
The 7th-level job is prioritized by the first class interrupt. In these two interrupts, after executing their own processing, they jump to a common address and execute the job priority processing.
【0057】尚、上記リセット割込みは、内部演算にお
いて0による除算を実行した場合や、無限ループが発生
した場合など、正常時には発生しない要因によっても、
起動される。Note that the reset interrupt may be caused by a factor that does not occur in a normal state, such as when division by 0 is performed in an internal operation or when an infinite loop occurs.
Is activated.
【0058】まず、図1に示す0.5ms毎の定期割込
みについて説明する。この定期割込みでは、ステップS1
00で、OS用ワークエリアを設定し、ステップS101で、
ウオッチドッグタイマを初期化すると、ステップS102へ
進んで、P−RUNフラグを20回に1回すなわち10
ms毎に反転する。このP−RUNフラグは、図示しな
い保護回路によってシステムが自動的にリセットされな
いようにするためのフラグであり、システムが正常に動
作して一定時間毎(10ms毎)に反転される限り、上
記保護回路の作動が阻止される。First, the periodic interruption every 0.5 ms shown in FIG. 1 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, the process proceeds to step S102, and the P-RUN flag is set once every 20 times, that is, 10 times.
Invert every ms. The P-RUN flag is a flag for preventing the system from being automatically reset by a protection circuit (not shown). The P-RUN flag is used as long as the system operates normally and is inverted every predetermined time (every 10 ms). The operation of the circuit is blocked.
【0059】次いで、ステップS103へ進み、スイッチ出
力の転写を行なう。このスイッチ出力は、各ジョブ中で
メモリに書き込んだビットのON,OFF値であり、各
ジョブからは直接I/Oインターフェース64の出力ポ
ートに出力せず、OS側で0.5ms毎にメモリの値を
出力ポートに転写する。Then, the process proceeds to a step S103 to transfer the switch output. This switch output is the ON / OFF value of the bit written in the memory in each job. The output from the job is not output directly to the output port of the I / O interface 64, but is output to the memory every 0.5 ms on the OS side. Transfer the value to the output port.
【0060】次に、ステップS104へ進むと、A/D変換
サブルーチンを実行してA/D変換に係る各種設定を行
ない、ステップS105で、ジョブフラグ作成サブルーチン
を実行して、2,4,10,50,250ms毎の各ジ
ョブ割込み要求を示すジョブフラグJB_FLGを作成
した後、ステップS106で、A/D変換をスタートする。Next, in step S104, an A / D conversion subroutine is executed to make various settings relating to A / D conversion, and in step S105, a job flag creation subroutine is executed to execute 2, 4, 10 , 50, and 250 ms, the job flag JB_FLG indicating each job interrupt request is created, and in step S106, A / D conversion is started.
【0061】上記A/D変換は、基本的に、A/D変換
器66の8チャンネル入力が0.5ms毎に所定の変換
順番毎に処理され、4ms周期で全入力の変換が行なわ
れる。但し、特定の1つのチャンネルは、回転脈動が発
生する吸入管圧力などをA/D変換するためクランク角
90°毎に(0.5msの時間精度で)同期し、変換順
番に対して割込んだ形で処理が行なわれ、その後の入力
の順番を1つ遅れにする。In the A / D conversion, basically, the eight channel inputs of the A / D converter 66 are processed in a predetermined conversion order every 0.5 ms, and all the inputs are converted in a cycle of 4 ms. However, one specific channel is synchronized (with a time accuracy of 0.5 ms) at every crank angle of 90 ° in order to A / D convert the suction pipe pressure at which rotational pulsation occurs, and interrupts the conversion order. The processing is performed in the form of an ellipse, and the order of subsequent input is delayed by one.
【0062】尚、エンジン回転数3750rpm以上で
は、A/D変換の最後の順番の入力が完全に停止し、7
500rpm以上では、最後から2番目の入力も停止す
るが、A/D変換の順番は、スロットル開度、吸入空気
量など変化の速いものを先として、冷却水温、電圧など
比較的変化の遅いものが後になるように設定してあり、
且つ、最後のA/D変換順番をクランク同期入力に設定
してあるため、特に支障は生じない。When the engine speed is 3750 rpm or more, the input of the last order of the A / D conversion is completely stopped, and
At 500 rpm or more, the second to last input also stops, but the order of A / D conversion is relatively slow changes such as cooling water temperature, voltage, etc., with the fastest change in throttle opening, intake air amount, etc. Is set to be later,
In addition, since the last A / D conversion order is set to the crank synchronization input, there is no particular problem.
【0063】また、図18に示すように、上記ジョブフ
ラグJB_FLGは、1バイト変数の各ビットを各ジョ
ブに対応するフラグとして割当てたものであり、複数の
ジョブ要求が同時に可能なようになっている。この1バ
イト変数のビット1〜ビット7は優先レベル1〜7に対
応し、それぞれ、250msジョブ、50msジョブ、
低優先クラセンジョブ、10msジョブ、4msジョ
ブ、2msジョブ、クラセンジョブのフラグに割当てら
れている。そして、所定のビットが立てられたとき、対
応する優先レベルのジョブ割込み要求がなされる。尚、
ビット0はバックグランドジョブのフラグに割当てられ
て通常は参照されない。As shown in FIG. 18, the job flag JB_FLG assigns each bit of a 1-byte variable as a flag corresponding to each job, so that a plurality of job requests can be made simultaneously. I have. Bits 1 to 7 of this 1-byte variable correspond to priority levels 1 to 7, respectively, and represent a 250 ms job, a 50 ms job,
Allocated to flags of low priority classa job, 10 ms job, 4 ms job, 2 ms job, and class job. When a predetermined bit is set, a job interrupt request of a corresponding priority level is made. still,
Bit 0 is assigned to the background job flag and is not normally referenced.
【0064】そして、上記ステップS105でジョブフラグ
作成サブルーチンによりジョブフラグJB_FLGを作
成し、上記ステップS106でA/D変換をスタートした後
は、ステップS107へ進み、ジョブフラグJB_FLGの
いずれかのジョブに対応するビットが立っているか否か
を調べる。Then, the job flag JB_FLG is created by the job flag creation subroutine in step S105, and after the A / D conversion is started in step S106, the process proceeds to step S107, where the job flag JB_FLG is processed. Check whether the bit to be set is set.
【0065】その結果、ジョブフラグJB_FLGのビ
ットが一つも立っていないときには、どのジョブからも
要求がないため割込みを終了し、ジョブフラグJB_F
LGのいずれかのビットが立っているときには、ステッ
プS108へ進んで、現状レベル(この定期割込みが実行さ
れる時点で所定の優先レベルのジョブが実行されていた
状態)以下のフラグがないか否かを調べる。As a result, when no bit of the job flag JB_FLG is set, the interrupt is terminated because there is no request from any job, and the job flag JB_F
If any bit of the LG is set, the process proceeds to step S108, and there is no flag lower than the current level (a state in which a job of a predetermined priority level is being executed at the time of execution of this periodic interrupt). Find out what.
【0066】上記ステップS108で、現状レベル以下のフ
ラグがないときには、ラベルWAR_JBで示される図
3のジョブ優先処理にジャンプし、現状レベル以下のフ
ラグがあるときには、ステップS109で、現状レベル以下
のレベルのオーバーラップカウンタOLCを1増加させ
る。In step S108, when there is no flag below the current level, the process jumps to the job priority process shown in FIG. 3 indicated by the label WAR_JB. When there is a flag below the current level, in step S109, the level below the current level is reached. Is incremented by one.
【0067】上記オーバーラップカウンタOLCは、ジ
ョブ要求を記憶するためのカウンタであり、各優先レベ
ル毎に1バイト割当てられ、上記ジョブフラグJB_F
LGによるジョブ要求時にインクリメント、ジョブ終了
時にデクリメントされる。すなわち、カウンタによって
ジョブ要求を記憶することによりジョブの多重要求に対
応することができるのである。The overlap counter OLC is a counter for storing job requests. One byte is assigned to each priority level, and the job flag JB_F
It is incremented when a job is requested by the LG, and decremented when the job ends. That is, by storing the job request by the counter, it is possible to cope with the multiplex request of the job.
【0068】次いで、上記ステップS109からステップS1
10へ進み、現状レベルより高いフラグがないか否かを調
べ、現状レベルより高いフラグがないときには、ルーチ
ンを抜けて割込みを終了し、現状レベルより高いフラグ
があるときには、ラベルWAR_JBのジョブ優先処理
へジャンプする。Next, from step S109 to step S1
The process proceeds to step 10 to check whether there is a flag higher than the current level. If there is no flag higher than the current level, the process exits the routine and terminates the interrupt. If there is a flag higher than the current level, the job priority processing of the label WAR_JB is performed. Jump to
【0069】一方、この0.5ms毎の定期割込みに対
し、図2のクラセンによる割込みでは、ステップS200
で、OS用ワークエリアを設定すると、ステップS201
で、後述するクランク位置算出のサブルーチンを実行
し、現在のクランク位置を判別するためのクランク位置
変数、及び、最新の3つのクラセン間隔の和であるエン
ジン半回転の経過時間すなわち半回転時間を算出する。On the other hand, in contrast to the periodic interrupt every 0.5 ms, in the interrupt by the class shown in FIG.
In step S201, when the work area for the OS is set.
Then, a subroutine for calculating the crank position, which will be described later, is executed to calculate a crank position variable for determining the current crank position and the elapsed time of the engine half rotation, that is, the half rotation time, which is the sum of the latest three classen intervals. I do.
【0070】上記クランク位置変数は、OS中で用意さ
れるシステム変数であり、図23に示すように、#1〜
#4気筒に対するクランク位置を、クランク角センサ3
9からの信号入力によるBTDC97°,65°,10
°CAによって12の状態に区分し、現在のクランク位
置を表わす。The above crank position variables are system variables prepared in the OS, and as shown in FIG.
The crank position for the # 4 cylinder is determined by the crank angle sensor 3
BTDC 97 °, 65 °, 10 by signal input from 9
Twelve states are classified according to ° CA, and the current crank position is represented.
【0071】すなわち、各気筒毎に、0,1,2の数値
でクラセン入力順を示すクランク位置情報変数S_CC
AS、#1気筒を0、#3気筒を1、#2気筒を2、#
4気筒を3として気筒の燃焼順を示す気筒情報変数S_
RCAS、及び、0〜11の数値でクラセン順序及び気
筒順序を総合的に表わす総合位置変数S_ACASの3
変数によって現在のクランク位置を表わし、さらに、ク
ランク位置が確証をもって正常に判別されたときを0、
判別結果がつじつまが合わず不安の残る推定状態を1、
不明な状態を2とするエラーレベルS_ECASによ
り、クランク位置の判別状況を表わすようになってい
る。尚、図23においては、システム変数であることを
示すS_を省略している。That is, for each cylinder, a crank position information variable S_CC indicating the class input order by numerical values of 0, 1, and 2
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
RCAS and 3 of the total position variable S_ACAS which comprehensively represent the classen order and the cylinder order by numerical values from 0 to 11
The current crank position is represented by a variable, and 0 indicates that the crank position is normally determined with certainty.
The estimated state where the discrimination result is inconsistent and anxiety remains 1,
An error level S_ECAS in which the unknown state is set to 2 indicates the determination state of the crank position. In FIG. 23, S_, which indicates a system variable, is omitted.
【0072】次いで、上記ステップS201からステップS2
02へ進むと、クランク位置算出のサブルーチンにおいて
クランク位置判定が正常に終了したか或は判定不能であ
ったかを、アキュムレータAにストアされているコード
を読み出すことにより調べる(エラーコード1、正常終
了コード0)。Next, from step S201 to step S2
In step 02, it is checked whether the crank position determination has been normally completed or not determined in the subroutine for calculating the crank position by reading the code stored in the accumulator A (error code 1, normal end code 0). ).
【0073】そして、上記ステップS202で、アキュムレ
ータAの値が1であり、クランク位置が判定不能であっ
たときには、割込みを終了し、アキュムレータAの値が
0であり、クランク位置が正常に判定されているときに
は、ステップS203へ進み、エンストフラグを解除する。When the value of the accumulator A is 1 and the crank position cannot be determined in step S202, the interrupt is terminated, the value of the accumulator A is 0, and the crank position is determined normally. If so, the process proceeds to step S203, and the engine stall flag is released.
【0074】尚、上記エンストフラグは、エンジンがエ
ンスト状態であることを示すフラグであり、クラセン間
隔が0.5sec以上の時間(約30rpm以下)のと
き、50msジョブに用意されているエンスト処理ルー
チンによりセットされ、このクラセン割込みによりクリ
アされてエンスト状態が解除される。The engine stall flag is a flag indicating that the engine is in an engine stall state. When the classen interval is 0.5 sec or more (about 30 rpm or less), an engine stall routine prepared for a 50 ms job is performed. , And the engine is cleared by this classen interrupt and the engine stall state is released.
【0075】次に、ステップS204へ進むと、点火タイマ
セットのサブルーチンを実行し、ユーザジョブ側で設定
した点火時期の指示値に基づいて作成された点火スケジ
ュールに従って点火タイマをセットする。この点火スケ
ジュールは、ドエル開始時期、ドエルオン待ち時間、ド
エルオフ待ち時間などをメンバーとする構造体変数であ
り、10msジョブ中に作成ルーチンが用意され、この
点火スケジュールに従って点火シーケンスが決定され
る。Next, in step S204, an ignition timer setting subroutine is executed, and an ignition timer is set in accordance with an ignition schedule created based on an instruction value of ignition timing set on the user job side. The ignition schedule is a structural variable having dwell start time, dwell-on waiting time, dwell-off waiting time, and the like as members. A creation routine is prepared during a 10 ms job, and an ignition sequence is determined according to the ignition schedule.
【0076】次いで、ステップS205で、後述する噴射タ
イマセットサブルーチンを実行し、ユーザジョブ側で設
定した気筒毎の要求燃料噴射幅に対応する噴射時間を、
1回噴射或は複数回噴射に応じた1回当りの有効噴射幅
として算出し、噴射タイマにセットしてステップS206へ
進む。Next, in step S205, an injection timer setting subroutine, which will be described later, is executed to set the injection time corresponding to the required fuel injection width for each cylinder set on the user job side.
It is calculated as an effective injection width per injection according to one injection or a plurality of injections, set to an injection timer, and proceeds to step S206.
【0077】ステップS206では、このクラセンが実行さ
れた現状のジョブレベルが自身のジョブレベルであるか
否かを判別し、現状がクラセンジョブ自身のレベルであ
るときには、ステップS207、S208で、クラセンジョブ、
低優先クラセンジョブのオーバーラップカウンタOLC
を、それぞれ1増加させて割込みを終了し、現状のジョ
ブレベルがクラセンジョブのレベルでないときには、ス
テップS209で、現状のジョブレベルが低優先クラセンジ
ョブのレベル以上であるか否かを調べる。In step S206, it is determined whether or not the current job level at which this class is executed is its own job level. If the current job level is its own job level, in steps S207 and S208, the class job is executed. ,
Low priority class job overlap counter OLC
Are incremented by one, and the interruption is terminated. If the current job level is not the level of the class job, it is checked in step S209 whether the current job level is equal to or higher than the level of the low priority class job.
【0078】そして、現状のジョブレベルが低優先クラ
センジョブ以上であるときには、上記ステップS209から
ステップS210へ進んで、低優先クラセンジョブのオーバ
ーラップカウンタOLCを1増加させると、ステップS2
11で、クラセンジョブのジョブフラグをセットし、ラベ
ルWAR_JBのジョブ優先処理へジャンプする。If the current job level is equal to or higher than the low-priority classa job, the process proceeds from step S209 to step S210, where the overlap counter OLC of the low-priority classa job is incremented by one.
At 11, the job flag of the class job is set, and the process jumps to the job priority processing of the label WAR_JB.
【0079】一方、上記ステップS209で、現状のジョブ
レベルが低優先クラセンジョブ以上でないときには、上
記ステップS209からステップS212へ進み、クラセンジョ
ブのジョブフラグをセットすると、ステップS213で、低
優先クラセンジョブのジョブフラグをセットし、ラベル
WAR_JBのジョブ優先処理へジャンプする。On the other hand, if the current job level is not equal to or higher than the low-priority class job in step S209, the process proceeds from step S209 to step S212, and the job flag of the class job is set. The job flag is set, and the process jumps to the job priority processing for the label WAR_JB.
【0080】図3に示すジョブ優先処理では、ステップ
S300で、ジョブの優先レベルを示す1バイト変数である
ジョブレベルJB_LEVを1つ上げると、ステップS3
01へ進んで、この優先レベルに対応するジョブフラグが
立っていないか調べる。そして、ジョブフラグが立って
いないときには、ステップS300へ戻ってさらにジョブレ
ベルJB_LEVを1つ上げ、ジョブフラグが立ってい
るときには、ステップS302へ進み、ジョブフラグの立っ
ているジョブのオーバーラップカウンタOLCを初期値
の0から1にし、ステップS303へ進む。In the job priority process shown in FIG.
In S300, when the job level JB_LEV, which is a one-byte variable indicating the priority level of the job, is increased by one, step S3
The process proceeds to 01 to check whether a job flag corresponding to this priority level is set. If the job flag is not set, the process returns to step S300 to further increase the job level JB_LEV by one. The initial value is changed from 0 to 1, and the process proceeds to step S303.
【0081】ステップS303では、より上のジョブフラグ
があるか否かを調べ、より上のジョブがあるときには、
ステップS300へ戻って前述の処理を繰り返し、より上の
ジョブがないときには、ステップS304へ進んで、ジョブ
実行中フラグJB_RUNをセットすると、ステップS3
05で、後述するジョブ実行サブルーチンにより最上位の
ジョブを実行する。In step S303, it is checked whether or not there is an upper job flag.
Returning to step S300, the above processing is repeated. If there is no higher job, the process proceeds to step S304, where the job execution flag JB_RUN is set.
At 05, the highest-level job is executed by a job execution subroutine described later.
【0082】上記ジョブ実行中フラグJB_RUNは、
ジョブの実行開始時にセットされ、終了時にクリアされ
るフラグであり、このフラグにより、処理の途中で、よ
り優先度の高いジョブによって割込まれたジョブを識別
することができる。The above-mentioned job execution flag JB_RUN is
This flag is set at the start of the execution of a job and cleared at the end of the job. With this flag, a job interrupted by a higher priority job can be identified during the processing.
【0083】例えば、図19に示すように、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と
されて割込みが受付けられるが、実行はされず待機状態
となる。For example, as shown in FIG. 19, JB_LE
If a 10 ms job with V = 4 is being executed and an interrupt request for a 2 ms job with JB_LEV = 6 is made, the processing of the 10 ms job is interrupted and the 2 ms job with higher priority is set to JB_RUN = 1 and OLC = 1 Is executed. During the processing of this 2 ms job, JB_
When an interrupt request of 4 ms job of LEV = 5 occurs,
The 4 ms job is set to JB_RUN = 0 and OLC = 1 and an interrupt is accepted, but is not executed and enters a standby state.
【0084】その後、ジョブ実行サブルーチンによるジ
ョブの実行が終了すると、上記ステップS305からステッ
プS306へ進んでオーバーラップカウンタOLCを1減ら
し、ステップS307で、オーバーラップカウンタOLCが
ゼロになったか否かを調べる。その結果、オーバラップ
カウンタOLCがゼロになっておらず、同じ優先レベル
でジョブ割込み要求が複数回あるときには、ステップS3
05へ戻ってジョブを繰返し実行し、オーバラップカウン
タOLCがゼロになったとき、ステップS307からステッ
プS308へ進んで、ジョブ実行中フラグJB_RUNをク
リアする。Thereafter, when the execution of the job by the job execution subroutine is completed, the process proceeds from step S305 to step S306, in which the overlap counter OLC is decremented by 1. In step S307, it is checked whether or not the overlap counter OLC has become zero. . As a result, if the overlap counter OLC has not become zero and there are multiple job interrupt requests at the same priority level, step S3
Returning to step 05, the job is repeatedly executed, and when the overlap counter OLC becomes zero, the process proceeds from step S307 to step S308 to clear the job execution flag JB_RUN.
【0085】次に、ステップS309へ進み、ジョブレベル
JB_LEVを1つ下げて次のジョブレベルに移ると、
ステップS310で、このジョブレベルJB_LEVがゼロ
になったか否かを調べる。そして、ジョブレベルJB_
LEVがゼロのときには、この割込みを終了し、ジョブ
レベルJB_LEVがゼロでないときには、ステップS3
11へ進んで、オーバーラップカウンタOLCがゼロか否
かを調べる。Next, the flow advances to step S309 to lower the job level JB_LEV by one and shift to the next job level.
In step S310, it is checked whether or not the job level JB_LEV has become zero. And the job level JB_
When the LEV is zero, this interrupt is terminated, and when the job level JB_LEV is not zero, the step S3
Proceeding to 11, it is checked whether the overlap counter OLC is zero.
【0086】上記ステップS311で、オーバーラップカウ
ンタOLCがゼロのときには、このレベルではジョブ要
求はないため、上記ステップS311からステップS309へ戻
って、ジョブレベルJB_LEVをさらに1つ下げて同
様の処理を繰返し、オーバーラップカウンタOLCがゼ
ロでないときには、ステップS312へ進んで、このジョブ
レベルにおいて、ジョブ実行中フラグJB_RUNがセ
ットされているか否かを調べる。In step S311, when the overlap counter OLC is zero, there is no job request at this level. Therefore, the process returns from step S311 to step S309 to lower the job level JB_LEV by one and repeat the same processing. If the overlap counter OLC is not zero, the flow advances to step S312 to check whether the job execution flag JB_RUN is set at this job level.
【0087】上記ステップS312で、ジョブ実行中フラグ
JB_RUNがセットされているときには、割込み前に
ジョブを実行中であったため、割込みを終了して割込み
前のジョブへ戻り、ジョブ実行中フラグJB_RUNが
セットされていなければ、ステップS304へ戻って、この
レベルのジョブを実行し、同様の処理を繰返す。In step S312, when the job execution flag JB_RUN is set, since the job was being executed before the interruption, the interruption is terminated, the process returns to the job before the interruption, and the job execution flag JB_RUN is set. If not, the flow returns to step S304 to execute the job at this level and repeat the same processing.
【0088】すなわち、図19において、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ジョブの処理が再開される。That is, in FIG. 19, 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
The processing shifts to _LEV = 4, and the processing of the 10 ms job interrupted by the 2 ms job and the 4 ms job is resumed from the state of JB_RUN = 1 (job execution).
【0089】このように、0.5ms毎の定期割込み、
クラセン割込みを基本タイミングとして、各ジョブの優
先レベル及び実行タイミングを知らせるジョブフラグJ
B_FLGを作成するため、可能な限り正確に、等時間
間隔処理、エンジン回転同期処理を実現し、各ジョブを
効率良く処理することができる。さらに、基本タイミン
グとなる各割込み毎に更新されるジョブフラグJB_F
LGによらず、オーバーラップカウンタOLCによって
ジョブの多重要求を記憶するため、あるジョブの処理時
間が長引き、再度、同じジョブを実行すべきタイミング
となった場合においても、処理を途中で放棄することな
く、可能な限り最後まで処理を継続することができる。As described above, the periodic interruption every 0.5 ms,
A job flag J that notifies the priority level and the execution timing of each job, using the class interrupt as the basic timing.
Since the B_FLG is created, equal time interval processing and engine rotation synchronization processing can be realized as accurately as possible, and each job can be processed efficiently. Further, a job flag JB_F updated for each interrupt serving as a basic timing
Regardless of the LG, the multiplexing request of the job is stored by the overlap counter OLC. Therefore, even if the processing time of a certain job is prolonged and the timing for executing the same job comes again, the processing is abandoned. Instead, the processing can be continued as far as possible.
【0090】次に、図4〜図7のジョブ実行サブルーチ
ンについて説明する。Next, the job execution subroutine of FIGS. 4 to 7 will be described.
【0091】まず、ステップS500で、ジョブフラグJB
_FLGを参照して実行すべきジョブがクラセンジョブ
でないか否かを調べ、クラセンジョブでないときには、
ラベルALJ10へ分岐し、クラセンジョブのときに
は、ステップS501へ進んで、気筒判別がついているか否
かを調べる。First, in step S500, the job flag JB
_FLG is checked to see if the job to be executed is not a casen job.
The process branches to label ALJ10, and in the case of a class job, the process proceeds to step S501 to check whether or not cylinder discrimination has been performed.
【0092】そして、気筒判別がついていないときに
は、そのままルーチンを抜けてジョブを実行せず、気筒
判別がついているとき、上記ステップS501からステップ
S502へ進んで、オーバーラップカウンタOLCの値を参
照して多重待ち状態であるか否かを調べる。If the cylinder discrimination has not been performed, the routine does not go out of the routine and the job is not executed.
Proceeding to S502, it is checked whether or not it is in the multiplex waiting state by referring to the value of the overlap counter OLC.
【0093】上記ステップS502では、多重待ち状態でな
いとき、ステップS503へ進んで、クラセン割込み毎に算
出されるシステム変数S_ACAS(クランク総合位置
変数)をユーザ変数ACASとし、一方、多重待ち状態
のときには、ステップS504へ分岐し、ユーザ変数ACA
Sを一つ増やして12で割った剰余をとって新たなユー
ザ変数ACASとし、このユーザ変数ACASを0,
1,2,…11,0,1,…とソフトウエア的に更新し
てゆく。In step S502, when the state is not the multiplex wait state, the process proceeds to step S503, in which the system variable S_ACAS (crank total position variable) calculated for each class interrupt is set as the user variable ACAS. Branching to step S504, the user variable ACA
S is incremented by 1, and the remainder obtained by dividing by 12 is taken as a new user variable ACAS.
The software is updated as 1, 2,..., 11, 0, 1,.
【0094】すなわち、クラセンジョブ及び低優先クラ
センジョブは、自身または優先度の高いジョブに邪魔さ
れて遅れることがあるが、クラセン割込みは正確にクラ
ンク角センサ信号に同期して実行され、システム変数S
_ACASはジョブの遅れに関係なく更新される。That is, the classen job and the low-priority classen job may be delayed by being interrupted by themselves or a high-priority job. However, the classen interrupt is executed exactly in synchronization with the crank angle sensor signal, and the system variable S
_ACAS is updated regardless of job delay.
【0095】従って、ジョブ中でシステム変数S_AC
ASを参照して気筒及びクランク位置に係る情報を知
り、この情報に応じた仕事を行なおうとしても、自身が
他のジョブに邪魔されて遅れた場合には、自身の仕事に
対応した気筒及びクランク位置に係る情報を知ることが
できなくなる。このため、クラセンジョブ及び低優先ク
ラセンジョブ中では、多重待ち状態でないときにOS用
のシステム変数S_ACASをユーザ用変数ACASと
して取込み、このユーザ変数ACASをジョブ実行毎に
更新して多重要求の場合にも、自身に対応した気筒及び
クランク位置に係る情報を得て適正な処理がなされるよ
うにするのである。Therefore, during the job, the system variable S_AC
If the user refers to the AS and obtains information related to the cylinder and the crank position, and tries to perform a job in accordance with the information, if the user himself is delayed by another job, the cylinder corresponding to his / her job is delayed. And information on the crank position cannot be known. For this reason, in a class job and a low-priority class job, the system variable S_ACAS for the OS is fetched as the user variable ACAS when the job is not in the multiplex wait state, and the user variable ACAS is updated each time a job is executed and a multiplex request is issued. In addition, the information relating to the cylinder and the crank position corresponding to itself is obtained so that appropriate processing is performed.
【0096】その後、上記ステップS503或は上記ステッ
プS504からステップS505へ進み、ジョブのワークエリア
を設定すると、ステップS506で、レベルゼロの割込みを
許可し、ステップS507で、クラセンジョブのセクション
に移る。そして、このクラセンジョブセクションにリン
クされた処理を実行し、ステップS508で、割込みを禁止
してルーチンを抜ける。Thereafter, the process proceeds from step S503 or step S504 to step S505, where a work area for the job is set. In step S506, a level-zero interrupt is permitted. In step S507, the process proceeds to the section of a class job. Then, the process linked to the class job section is executed, and in step S508, the interruption is prohibited and the routine exits.
【0097】次に、ステップS500で、これから実行すべ
きジョブがクラセンジョブでないときには、ラベルAL
J10のステップS510で、2msジョブでないか否か調
べ、2msジョブのとき、ステップS511で、ジョブのワ
ークエリアを設定すると、ステップS512で、レベルゼロ
の割込みを許可し、ステップS513で、2msジョブのセ
クションに移る。そして、このセクションにリンクされ
ているジョブ本体(ユーザ側の制御ストラテジーに基づ
くルーチン、或は、OS側で用意したサービスルーチ
ン)を実行し、ステップS514で、割込みを禁止してルー
チンを抜ける。Next, in step S500, if the job to be executed is not a class job, the label AL
In step S510 of J10, it is checked whether the job is not a 2 ms job. If the job is a 2 ms job, a work area for the job is set in step S511. In step S512, a level zero interrupt is permitted. Go to section. Then, the job main body (a routine based on the control strategy on the user side or a service routine prepared on the OS side) linked to this section is executed, and in step S514, the interruption is prohibited and the routine exits.
【0098】一方、上記ステップS510で、実行すべきジ
ョブが2msジョブでないときには、ステップS510から
ステップS520へ分岐し、実行すべきジョブが4msジョ
ブか否かを調べる。そして、4msジョブでないときに
は、ラベルALJ30へ分岐し、4msジョブのときに
は、ステップS521で、ジョブのワークエリアを設定する
と、ステップS522へ進む。尚、この4msジョブは、A
/D変換利用ジョブであり、後述するシステムシフトバ
ッファSSHBを介してA/D変換データを利用する。On the other hand, if the job to be executed is not a 2 ms job at step S510, the process branches from step S510 to step S520 to check whether the job to be executed is a 4 ms job. If the job is not a 4 ms job, the process branches to the label ALJ30. If the job is a 4 ms job, the process proceeds to step S522 after setting the work area of the job in step S521. Note that this 4 ms job is A
This job is a / D conversion utilization job, and uses A / D conversion data via a system shift buffer SSHB described later.
【0099】ステップS522では、レベルゼロの割込みを
許可し、次いで、ステップS523へ進むと、スイッチ入力
を読込み、ステップS524で、4msジョブのセクション
に移って、リンクされているジョブ本体を実行する。そ
の後、4msジョブのセクションから抜けると、ステッ
プS525で、割込みを禁止し、ステップS526へ進んで、シ
ステムシフトバッファSSHBをシフトしてルーチンを
抜ける。In step S522, a level zero interrupt is permitted. Then, when the flow advances to step S523, the switch input is read, and in step S524, the section shifts to a 4 ms job section to execute the linked job body. Thereafter, when exiting from the section of the 4 ms job, the interruption is prohibited in step S525, and the process proceeds to step S526 to shift the system shift buffer SSHB and exit from the routine.
【0100】上記システムシフトバッファSSHBは、
図20に示すように、8チャンネルの各A/D変換結果
がストアされる先頭オフセットアドレス0,+8,+1
6,+24,+32,+34,+36,+38番の各メ
モリ、及び、4ms毎のクランク同期のA/D変換結果
がストアされる先頭オフセットアドレス−2番地の1ワ
ードのメモリからなり、0.5ms毎に実行される1回
のA/D変換結果が1ワード(2バイト)でストアされ
る。The system shift buffer SSHB is
As shown in FIG. 20, the head offset addresses 0, +8, +1 where the respective A / D conversion results of eight channels are stored.
Each memory of Nos. 6, +24, +32, +34, +36, and +38, and a one-word memory at the head offset address -2 where crank-synchronous A / D conversion results are stored every 4 ms, and 0.5 ms One A / D conversion result executed every time is stored in one word (2 bytes).
【0101】先頭オフセットアドレス0番地からは、4
段のシフトメモリとなっており、90°CA毎のA/D
変換結果がストアされ、最新4データ(1回転分)をジ
ョブから参照することができる。また、先頭オフセット
アドレス+32,+34,+36,+38番地は、各1
ワードのメモリであり、なまし処理機能が選択されたと
き、A/D変換結果を加重平均した値がストアされてノ
イズ除去と精度向上を図ることができるようになってお
り、これらのメモリのデータは、低速ジョブで利用でき
る。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) can be referred to from the job. The head offset addresses +32, +34, +36, and +38 are each 1
When a smoothing function is selected, a value obtained by weighted averaging of A / D conversion results is stored so that noise removal and accuracy can be improved. Data is available for slow jobs.
【0102】また、各先頭オフセットアドレス+8,+
16,+24番地からは、各4ワードのメモリであり、
4msジョブで利用するようになっている。これらの各
メモリは、最新のA/D変換結果が先頭から数えて、4
msジョブのオーバーラップカウンタOLCの値だけ後
のワードにストアされ、4msジョブ実行に際し、先頭
方向からデータが読出され、ジョブの終了に伴って、後
の各ワードのデータが順に先頭方向にシフトされるの
で、先にストアしたデータから読出されるFIFOバッ
ファとなっている。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 memories stores the latest A / D conversion result in 4
The data is stored in the next word by the value of the overlap counter OLC of the ms job, and when the 4 ms job is executed, the data is read from the leading direction, and with the end of the job, the data of each subsequent word is sequentially shifted to the leading direction. Therefore, it is a FIFO buffer that is read from previously stored data.
【0103】すなわち、A/D変換は、0.5ms毎の
定期割込みにより4ms周期で正確に行なわれるが、4
msジョブは優先度の高いジョブに邪魔されて遅れるこ
とがある。従って、A/D変換の受渡しにFIFOバッ
ファを用い、4msジョブで+8〜,+16〜,+24
〜番地の各FIFOバッファのデータを参照後、上記ス
テップS526で、各FIFOバッファのデータを順にシフ
トするのである。That is, A / D conversion is accurately performed at a period of 4 ms by a periodic interrupt every 0.5 ms.
The ms job may be delayed by being interrupted by a high-priority job. Therefore, the FIFO buffer is used for the transfer of the A / D conversion, and +8 to +16 to +24 for a 4 ms job.
After referring to the data of each FIFO buffer at the address (1) to (5), the data of each FIFO buffer is sequentially shifted in step S526.
【0104】一方、上記ステップS520で、実行すべきジ
ョブが4msジョブでなく、ラベルALJ30へ分岐し
たときには、ステップS530で、実行すべきジョブが10
msジョブか否かを調べ、10msジョブのとき、ステ
ップS531で、ジョブのワークエリアを設定し、ステップ
S532で、レベルゼロの割込みを許可すると、ステップS5
33で、10msジョブのセクションに移って、ジョブ本
体を実行し、ステップS534で割込みを禁止してルーチン
を抜ける。On the other hand, if the job to be executed is not a 4 ms job at step S520 but branches to label ALJ30, then at step S530, the job to be executed is
Check whether the job is a ms job, and if the job is a 10 ms job, set the work area of the job in step S531,
In step S532, if an interrupt of level zero is permitted, step S5
At 33, the process moves to the section of the 10 ms job, the job body is executed, and the interruption is prohibited at step S534 and the routine exits.
【0105】尚、上記10msジョブのセクションに
は、半回転時間からエンジン回転数を算出するサービス
ルーチン、前述した点火スケジュールを作成するサービ
スルーチンなどがOS側で用意されている。In the section of the 10 ms job, the OS provides a service routine for calculating the number of revolutions of the engine from the half rotation time, a service routine for creating the above-described ignition schedule, and the like.
【0106】また、上記ステップS530で、実行すべきジ
ョブが10msジョブでないときにはステップS540へ分
岐し、実行すべきジョブが低優先クラセンジョブである
か否かを調べる。そして、低優先クラセンジョブでない
ときには、上記ステップS540からラベルALJ50へ分
岐し、実行すべきジョブが低優先クラセンジョブのとき
は、上記ステップS540からステップS541へ進んで、現在
の状態が多重待ち状態であるか否かを調べる。If it is determined in step S530 that the job to be executed is not a 10 ms job, the flow branches to step S540 to check whether or not the job to be executed is a low priority class job. When the job is not the low priority classa job, the process branches from the step S540 to the label ALJ50. When the job to be executed is the low priority class job, the process proceeds from the step S540 to the step S541. Check if there is.
【0107】そして、現在の状態が多重待ち状態でない
ときには、上記ステップS541からステップS542へ進ん
で、システム変数S_ACAS(クランク総合位置変
数)をユーザ変数ACASとしてステップS544へ進み、
多重待ち状態のときには、上記ステップS541からステッ
プS543へ分岐し、ユーザ変数ACASを一つ増やして1
2で割った剰余をとった後、ステップS544へ進む。If the current state is not the multiplex wait state, the process proceeds from step S541 to step S542, where the system variable S_ACAS (crank total position variable) is set as a user variable ACAS, and the process proceeds to step S544.
In the multiplex wait state, the process branches from step S541 to step S543, and the user variable ACAS is incremented by one to 1
After taking the remainder divided by 2, the process proceeds to step S544.
【0108】ステップS544では、ジョブのワークエリア
を設定し、ステップS545で、レベルゼロの割込みを許可
すると、ステップS546で、低優先クラセンジョブのセク
ションに移り、ジョブ本体を実行した後、ステップS547
で割込みを禁止し、ルーチンを抜ける。In step S544, the work area of the job is set, and in step S545, the interrupt of level zero is permitted. In step S546, the process moves to the section of the low-priority classa job, and after executing the job body, the process proceeds to step S547.
To disable the interrupt and exit the routine.
【0109】さらに、ラベルALJ50では、ステップ
S550で、実行すべきジョブが50msジョブであるか否
かを調べ、50msジョブのときには、ステップS551へ
進んでジョブのワークエリアを設定し、ステップS552へ
進む。Further, at the label ALJ50, the step
In step S550, it is determined whether the job to be executed is a 50 ms job. If the job is a 50 ms job, the process proceeds to step S551 to set a work area for the job, and then proceeds to step S552.
【0110】ステップS552では、レベルゼロの割込みを
許可すると、ステップS553で、50msジョブのセクシ
ョンに移り、OS側で用意したエンスト処理ルーチン、
気筒別の点火時期リタードルーチン、燃料噴射開始時期
算出ルーチンなどを実行し、また、ユーザ側の制御スト
ラテジーに基づくルーチンを実行する。そして、ジョブ
の終了後、ステップS554で割込みを禁止し、ルーチンを
抜ける。In step S552, when the interrupt of level zero is permitted, in step S553, the process proceeds to the section of the 50 ms job, and the engine stop processing routine prepared on the OS side is executed.
It executes an ignition timing retard routine for each cylinder, a fuel injection start timing calculation routine, and the like, and also executes a routine based on a control strategy on the user side. Then, after the end of the job, the interruption is prohibited in step S554, and the routine exits.
【0111】一方、上記ステップS550で実行すべきジョ
ブが50msジョブではないときにはステップS560へ分
岐し、ジョブのワークエリアを設定し、ステップS561で
レベルゼロの割込みを許可し、ステップS562へ進んで、
250msジョブのセクション領域へ移行し、ジョブ本
体を実行後、ステップS563で割込みを禁止してルーチン
を抜ける。On the other hand, if the job to be executed in step S550 is not a 50 ms job, the flow branches to step S560 to set the work area of the job, permit interruption of level zero in step S561, and proceed to step S562.
After shifting to the section area of the 250 ms job and executing the job body, the interrupt is prohibited in step S563, and the routine exits.
【0112】以上のジョブ優先処理においては、クラン
ク位置を常に的確に把握しておく必要があり、クラセン
割込み毎に、図8に示すクランク位置算出サブルーチン
が実行されて前述したクランク位置変数S_CCAS,
S_RCAS,S_ACAS,S_ECASが算出され
る。尚、以下の説明においては、システム変数であるこ
とを示すS_をクランク位置変数から省略する。In the job priority processing described above, it is necessary to always accurately grasp the crank position. For each classen interrupt, the crank position calculation subroutine shown in FIG. 8 is executed, and the crank position variable S_CCAS,
S_RCAS, S_ACAS, S_ECAS are calculated. In the following description, S_, which is a system variable, is omitted from the crank position variable.
【0113】このクランク位置算出サブルーチンでは、
まず、ステップS600で、クラセンタイマの下2バイトを
ソフトタイマの下2バイトにストアする。このクラセン
タイマはECU50に備えられたハードウエアタイマで
あり、本実施例においては、16ビットタイマで最大2
55msまで計数が可能であるが、メモリ上に3バイト
の連続した領域を確保して下2バイトにクラセンタイマ
の2バイトを転写し、クラセンタイマのオーバーフロー
により発生する割込みで3バイト目をカウントアップす
ることによりソフトタイマとして使用する。これによ
り、クランク角センサ39からの信号入力間隔時間(以
下「クラセン間隔」と略記する)を最大64sec(2
55ms×256)まで計数することが可能となり、1
6ビット以上の特別なハードウエアタイマを使用するこ
となく、クランキング時などクラセン間隔が極めて長い
場合にも容易に対応することができる。In this crank position calculation subroutine,
First, in step S600, the lower two bytes of the classa timer are stored in the lower two bytes of the soft timer. The classa timer is a hardware timer provided in the ECU 50. In the present embodiment, the 16-bit timer is a maximum of 2
Although counting is possible up to 55 ms, a continuous area of 3 bytes is secured in the memory, the 2 bytes of the classen timer are transferred to the lower 2 bytes, and the 3rd byte is counted up by an interrupt generated by overflow of the classen timer. By doing so, it is used as a soft timer. As a result, the signal input interval time from the crank angle sensor 39 (hereinafter abbreviated as “classen interval”) is set to a maximum of 64 seconds (2
It is possible to count up to 55 ms x 256)
Without using a special hardware timer of 6 bits or more, it is possible to easily cope with an extremely long classen interval such as during cranking.
【0114】次いで、ステップS601へ進むと、クラセン
間隔が設定時間以下か否かを調べる。この設定時間は、
最大エンジン回転数に対応するクラセン間隔としての時
間、例えば0.3msであり、上記ステップS601でクラ
セン間隔が設定時間以下のときには、ノイズの混入など
によるクラセンタイマの計数エラーとしてステップS602
でアキュムレータAにエラーコード1を格納してルーチ
ンを抜け、また、上記ステップS601で、クラセン間隔が
設定時間より長いときには、クラセンタイマの計数が正
常であるとしてステップS603へ進む。Next, when the flow advances to step S601, it is checked whether or not the classen interval is equal to or less than a set time. This setting time is
The time as the classen interval corresponding to the maximum engine speed is, for example, 0.3 ms. When the classen interval is equal to or less than the set time in step S601, a count error of the classen timer due to noise or the like is caused in step S602.
Then, the error code 1 is stored in the accumulator A, and the process exits the routine. If it is determined in step S601 that the classen interval is longer than the set time, the count of the classen timer is determined to be normal and the process proceeds to step S603.
【0115】ステップS603では、後述するCCAS・R
CAS判別サブルーチンを実行してクランク位置を判別
し、ステップS604で、エラーレベルECASが2である
か否か、すなわち、クランキング時などのように気筒判
別がなされていない状態であるか否かを調べ、ECAS
=2のときには、ステップS605へ分岐してアキュムレー
タAにエラーコード1を格納し、ルーチンを抜ける。In step S603, CCAS R
The crank position is determined by executing a CAS determination subroutine. In step S604, it is determined whether or not the error level ECAS is 2, that is, whether or not the cylinder determination is not performed such as during cranking. Research, ECAS
If = 2, the flow branches to step S605 to store the error code 1 in the accumulator A, and exits the routine.
【0116】一方、上記ステップS604で、ECAS≠2
のときには、ステップS606へ進み、ソフトタイマの3バ
イト目を0とする。そしてステップS607へ進み、クラン
ク位置情報変数CCASが1であるか否か、すなわち、
現在のクランク位置がBTDC65°CA〜10°CA
の間(図23参照)であるか否かを調べ、CCAS=1
のときには、ステップS607からステップS609へジャンプ
し、CCAS≠1のときには、ステップS607からステッ
プS608へ進んで、A/D変換リクエストを1増加させ、
ステップS609へ進む。On the other hand, in step S604, ECAS6042
In the case of, the process proceeds to step S606, and the third byte of the soft timer is set to 0. Then, the process proceeds to step S607 to determine whether or not the crank position information variable CCAS is 1, ie,
Current crank position is BTDC 65 ° CA to 10 ° CA
(See FIG. 23), and CCAS = 1
In step S607, the process jumps from step S607 to step S609. When CCAS ≠ 1, the process proceeds from step S607 to step S608 to increment the A / D conversion request by one.
Proceed to step S609.
【0117】このA/D変換リクエストは、クランク角
90°CA毎にクランク同期A/D変換を指示するため
のフラグ的な変数であり、0、1の値をとり、値が1の
ときクランク同期A/D変換を指示する。すなわち、前
述したように、8チャンネルのA/D変換のうち1チャ
ンネルのA/D変換はクランク角90°CA毎に行なわ
れるが、CCASが0になったとき(BTDC97°C
A)と、CCASが2になったとき(BTDC10°C
A)、クランク同期のA/D変換リクエストをセット
し、0.5ms毎のA/D変換順番に対してクランク角
90°毎(正確には、87゜,93゜毎)のA/D変換
を割込ませるのである。This A / D conversion request is a flag-like variable for instructing crank synchronous A / D conversion at every crank angle of 90 ° CA, and takes a value of 0 or 1; Instructs synchronous A / D conversion. That is, as described above, one of the eight channels of A / D conversion is performed at every crank angle 90 ° CA, but when CCAS becomes 0 (BTDC 97 ° C.).
A) and when CCAS becomes 2 (BTDC 10 ° C
A), a crank synchronous A / D conversion request is set, and A / D conversion at every 90 ° crank angle (more precisely, every 87 °, 93 °) with respect to the A / D conversion order every 0.5 ms. Is interrupted.
【0118】その後、ステップS609では、気筒情報変数
RCASを3倍してクランク位置情報変数CCASを加
算することにより総合位置変数ACASを算出すると
(ACAS=RCAS×3+CCAS)、ステップS610
で、ソフトタイマを2バイトでリミットし、クラセンタ
イマがオーバーフローしている場合には下2バイトをF
FFF(255ms)としてステップS611へ進む。Thereafter, in step S609, the total position variable ACAS is calculated by multiplying the cylinder information variable RCAS by 3 and adding the crank position information variable CCAS (ACAS = RCAS × 3 + CCAS).
Then, the soft timer is limited to 2 bytes, and if the classa timer overflows, the lower 2 bytes are F
The process advances to step S611 as FFF (255 ms).
【0119】ステップS611では、総合位置変数ACAS
=0,1,2,…11を添字とする配列TCAS[AC
AS](配列の要素)にクラセン間隔データをストア
し、ステップS612で、クランク位置情報変数CCAS=
0,1,2を添字とする配列MTCSX[CCAS]
(配列の要素)にクラセン間隔データをストアする。In step S611, the total position variable ACAS
= 0, 1, 2,... 11 as subscripts TCAS [AC
AS] (array element), and in step S612, the crank position information variable CCAS =
Array MTCSX [CCAS] with subscripts 0, 1, 2
Store the classen interval data in (array element).
【0120】配列TCASは、図21(a)に示すよう
に、ACAS=0,1,2,…11に対応するエンジン
2回転分のクラセン間隔データがストアされた12ワー
ドのクラセン間隔テーブルであり、配列MTCSXは、
同図(b)に示すように、CCAS=0,1,2に対応
する3ヶのクラセン間隔データがストアされた3ワード
のクラセン間隔テーブルである。As shown in FIG. 21A, the array TCAS is a 12-word classen interval table storing classen interval data for two engine revolutions corresponding to ACAS = 0, 1, 2,... , The sequence MTCSX,
As shown in FIG. 6B, a three-word classen interval table in which three classen interval data corresponding to CCAS = 0, 1, and 2 are stored.
【0121】すなわち、上記ステップS603のCCAS・
RCAS判別サブルーチン(詳細は後述する)、及びス
テップS609により各情報変数CCAS,RCAS,AC
ASが更新され、例えば、CCAS=1、RCAS=
1、ACAS=4に更新されて、現在、クランク位置が
#3気筒のBTDC65゜〜10゜CAのとき、クラセ
ンタイマによって計時された#3気筒のBTDC97゜
CAにおけるクラセン信号入力から#3気筒のBTDC
65゜CAにおけるクラセン信号入力までの時間(クラ
セン間隔データ)を、ステップS611で総合位置変数AC
ASをパラメータとして配列TCASのACAS=3の
アドレスにストアすると共に、ステップS612でクランク
位置情報変数CCASをパラメータとして配列MTCS
XのCCAS=0のアドレスにストアする。That is, the CCAS ·
The RCAS determination subroutine (details will be described later) and each information variable CCAS, RCAS, AC
AS is updated, for example, CCAS = 1, RCAS =
1. When ACAS = 4 is updated and the crank position is currently BTDC 65 ° to 10 ° CA of the # 3 cylinder, the # 3 cylinder BTDC of the # 3 cylinder is counted from the input of the class signal at the BTDC 97 ° CA measured by the classen timer. BTDC
At step S611, the time until classan signal input at 65 ° CA (classen interval data) is calculated by the total position variable AC.
AS is stored as a parameter at the address of ACAS = 3 in the array TCAS, and in step S612, the crank position information variable CCAS is stored as a parameter in the array MTCS.
X is stored at the address of CCAS = 0.
【0122】従って、クラセン入力によるクラセン割込
み毎に総合位置変数ACAS、クランク位置情報変数C
CASが更新される都度、配列TCAS,MTCSX内
のデータが順次更新されるので、配列TCASを参照す
ることにより、各気筒の各クランク位置におけるクラセ
ン間隔の変化(回転速度の変化)を知ることができ、各
気筒の失火の有無、燃焼状態などを判断することがで
き、全気筒の運転状況を把握することができる。また、
配列MTCSXを参照することにより、常に最新のクラ
セン間隔を得ることができ、現在の運転状況を迅速に把
握することができる。Therefore, the total position variable ACAS and the crank position information variable C
Each time the CAS is updated, the data in the arrays TCAS and MTCSX is sequentially updated. Therefore, by referring to the array TCAS, it is possible to know the change in the classen interval (change in rotational speed) at each crank position of each cylinder. It is possible to determine the presence or absence of a misfire in each cylinder, the combustion state, and the like, and to grasp the operation status of all cylinders. Also,
By referring to the array MTCSX, the latest classene interval can always be obtained, and the current driving situation can be quickly grasped.
【0123】次いで、ステップS613へ進むと、再び、エ
ラーレベルECASの値を調べる。ここでは、前述のス
テップS604においてECAS≠2であることを既に確認
してあるため、エラーレベルECASが1か否か、すな
わち、クランク位置の判別が不安の残る推定状態である
か否かを調べる。Next, in step S613, the value of the error level ECAS is checked again. Here, since it is already confirmed in step S604 that ECAS ≠ 2, it is checked whether or not the error level ECAS is 1, that is, whether or not the determination of the crank position is an estimated state in which anxiety remains. .
【0124】上記ステップS613でECAS≠1(すなわ
ちECAS=0)であり、クランク位置が確証をもって
判別されているときには、上記ステップS613からステッ
プS614へ進んで、最新3ヶのクラセン間隔データの和
(配列MTCSXにストアされているクラセン間隔デー
タの和)を、3バイトの半回転時間MTCS18として
算出する(MTCS18=ΣMTCSX)。すなわち、
半回転時間MTCS18は、クラセン割込み毎にクラン
ク位置情報変数CCASが更新されて配列MTCSX内
のデータが更新される毎に算出され、BTDC97°,
65°,10°CAの各位置毎にクラセン間隔の移動和
を取ることにより常に最新のデータが得られるようにな
っている。If ECAS ≠ 1 (that is, ECAS = 0) in step S613 and the crank position has been determined with certainty, the process proceeds from step S613 to step S614, where the sum of the three latest classen interval data ( The sum of classen interval data stored in the array MTCSX) is calculated as a 3-byte half-rotation time MTCS18 (MTCS18 = ΣMTCSX). That is,
The half-rotation time MTCS18 is calculated every time the crank position information variable CCAS is updated every classan interrupt and the data in the array MTCSX is updated.
The latest data can always be obtained by taking the moving sum of the classen interval for each position of 65 ° and 10 ° CA.
【0125】一方、上記ステップS613で、ECAS=1
であり、クランク位置の判別が不安の残る推定状態であ
るときには、配列MTCSXから半回転時間MTCS1
8を算出せず、ステップS615で半回転時間推定のサブル
ーチンを実行して半回転時間MTCS18を推定する。On the other hand, in the above step S613, ECAS = 1
When it is in the estimated state where the determination of the crank position remains uneasy, the half rotation time MTCS1 is determined from the array MTCSX.
In step S615, a half rotation time estimation subroutine is executed to estimate the half rotation time MTCS18.
【0126】この半回転時間MTCS18の推定は、前
回のクラセン間隔時間から今回の半回転時間を推定する
ものである。すなわち、図23に示すように、現在のク
ランク位置情報変数CCASが1であれば、前回のクラ
ンク角間角度は32゜CA(BTDC97゜〜65゜C
A間の角度)であり、このクランク角間角度と前回のク
ラセン間隔データとから、次式に基づき半回転時間MT
CS18を算出する。MTCS18=前回のクラセン間
隔×180/32また、CCAS=2のときには、BT
DC65゜〜10゜CA間の角度55゜CAと前回のク
ラセン間隔データから、前回のクラセン間隔×180/
55により半回転時間MTCS18を算出し、さらに、
CCAS=0のときには、BTDC10゜CA〜ATD
C83゜CA(次の気筒のBTDC97゜CA)間の角
度93゜CAと前回のクラセン間隔データとから、前回
のクラセン間隔×180/93により半回転時間MTC
S18を算出する。The estimation of the half rotation time MTCS 18 is to estimate the current half rotation time from the previous classen interval time. That is, as shown in FIG. 23, if the current crank position information variable CCAS is 1, the previous crank angle angle is 32 ° CA (BTDC 97 ° to 65 ° C.).
A), and from the crank angle angle and the previous classen interval data, the half rotation time MT is calculated based on the following equation.
Calculate CS18. MTCS18 = previous classen interval × 180/32 Also, when CCAS = 2, BT
From the angle 55 ° CA between DC 65 ° to 10 ° CA and the previous classen interval data, the previous classen interval × 180 /
The half rotation time MTCS18 is calculated by 55, and
When CCAS = 0, BTDC10 ゜ CA to ATD
Based on the angle 93 ° CA between C83 ° CA (BTDC 97 ° CA of the next cylinder) and the previous classen interval data, the half-rotation time MTC is calculated by the previous classen interval × 180/93.
S18 is calculated.
【0127】そして、上記ステップS614で半回転時間M
TCS18を算出した後、或は、上記ステップS615で半
回転時間MTCS18を推定した後は、ステップS616へ
進み、3バイトの半回転時間MTCS18を2バイトに
リミットして所定の変数MTCSKにストアすると、ス
テップS617で、この変数MTCSKを2倍して変数MT
CSK4にストアし、ステップS618で、正常終了コード
0をアキュムレータAに格納してルーチンを抜ける。Then, in the above step S614, the half rotation time M
After calculating the TCS18 or after estimating the half-rotation time MTCS18 in step S615, the process proceeds to step S616, where the half-rotation time MTCS18 of 3 bytes is limited to 2 bytes and stored in a predetermined variable MTCSK. In step S617, this variable MTCSK is doubled to obtain a variable MT
The result is stored in CSK4, and in step S618, the normal end code 0 is stored in accumulator A, and the routine exits.
【0128】そして、前述のジョブ実行サブルーチンに
おいて10ms毎にエンジン回転数が算出され、このエ
ンジン回転数は、3バイトの半回転時間MTCS18を
2バイトにリミットした変数MTCSKの逆数から算出
される。In the above-described job execution subroutine, the engine speed is calculated every 10 ms, and the engine speed is calculated from the reciprocal of the variable MTCSK in which the 3-byte half-rotation time MTCS18 is limited to 2 bytes.
【0129】詳述すると、毎分回転数rpmの単位時間
(1min)の半分の時間30secを半回転時間MT
CSKで割算することにより、1rpmを単位とする2
バイト単位の変数NRPM、すなわち、エンジン回転数
が算出され(NRPM=30sec/MTCSK)、こ
のエンジン回転数が基本パラメータの1つとして各種の
制御量演算処理に用いられるのである。More specifically, half the time 30 sec, which is a half of the unit time (1 min) of the number of revolutions per minute, is a half revolution time MT.
By dividing by CSK, 2 in units of 1 rpm
A variable NRPM in byte units, that is, the engine speed is calculated (NRPM = 30 sec / MTCSK), and this engine speed is used as one of the basic parameters in various control amount calculation processes.
【0130】次に、図9に示すフローチャートに従っ
て、上記クランク位置算出サブルーチンのステップS603
で実行されるCCAS・RCAS判別サブルーチンにつ
いて説明する。Next, according to the flowchart shown in FIG. 9, step S603 of the above-described crank position calculation subroutine is performed.
Will be described.
【0131】このサブルーチンでは、まず最初に、ステ
ップS800で、カムセンカウンタを0〜4にリミットす
る。このカムセンカウンタで計数されるカム角センサ4
1からのカムパルスの数(クラセン信号入力間のカムパ
ルス数)は、図23に示すように、正常状態の場合0〜
3であるが、ノイズなどの影響により4以上の異常な計
数値となるおそれがあるため、カムセンカウンタを0〜
4にリミットして異常な状態を4で代表するのである。In this subroutine, first, the Camcen counter is limited to 0 to 4 in step S800. Cam angle sensor 4 counted by this cam center counter
As shown in FIG. 23, the number of cam pulses from 1 (the number of cam pulses between classene signal inputs) is 0 to 0 in a normal state.
However, since there is a possibility that an abnormal count value of 4 or more may occur due to the influence of noise or the like,
The limit is set to four, and the abnormal state is represented by four.
【0132】次に、ステップS801へ進み、カムセンカウ
ンタ(の計数値)、気筒情報変数RCAS、クランク位
置情報変数CCASから、5×4×2の組合わせ(カム
センカウンタが0〜4の5種類、気筒情報変数RCAS
が0〜3の4種類、クランク位置情報変数CCASが
0,1と2の場合の2種類)に対する状態データがスト
アされている気筒・クランク位置状態マップCCHMA
Pを読む。Then, the flow advances to step S801 to determine a combination of 5 × 4 × 2 (the Camsen counter is 0 to 4 and 5) based on the (count value of) the Camsen counter, the cylinder information variable RCAS, and the crank position information variable CCAS. Type, cylinder information variable RCAS
CCHMA in which the state data is stored for four types 0 to 3 and two types when the crank position information variable CCAS is 0, 1 and 2.)
Read P.
【0133】この気筒・クランク位置状態マップCCH
MAPは、図22(a)及び(b)に示すように、クラ
ンク位置情報変数CCASが0或は1の場合と、気筒情
報変数RCASの変化点であるクランク位置情報変数C
CASが2の場合とに分け、カムセンカウンタと気筒情
報変数RCASとの各組合わせの起こり得る全ての状態
に対し、正常か異常か、確定して良いか推定すべきかを
示す状態データがストアされており、現在の状態を評価
し、次にとるべき状態を知ることができる。This cylinder / crank position state map CCH
As shown in FIGS. 22 (a) and 22 (b), the MAP determines whether the crank position information variable CCAS is 0 or 1, and determines whether the crank position information variable CCAS is a change point of the cylinder information variable RCAS.
State data indicating whether the combination of the Camsen counter and the cylinder information variable RCAS may occur is stored as normal or abnormal, and whether the determination is OK or not is stored for all possible states of the CASCEN counter and the cylinder information variable RCAS. It is possible to evaluate the current state and know the next state to be taken.
【0134】この状態データは2ビットのデータであ
り、ビット0の値により確定か推定かを表わし、ビット
1の値により正常か異常かを表わす。ビット0の値は、
0のとき確定、1のとき推定を示し、図22からわかる
ように、カムセンカウンタが2,3の場合にのみ確定で
あって(図23に示すカムセン信号パターン参照)、そ
れ以外は推定せざるを得ない状態である。また、ビット
1の値は、0のとき正常、1のとき異常を示し、カムセ
ンカウンタが3以下で、且つ、図23によるクランク位
置変数の組合せに合致する場合のみ正常であって、それ
以外は異常な状態である。The state data is 2-bit data, and the value of bit 0 indicates whether the state is determined or estimated, and the value of bit 1 indicates whether the state is normal or abnormal. The value of bit 0 is
As shown in FIG. 22, it is determined only when the Camcen counter is 2 or 3 (see the Camcen signal pattern shown in FIG. 23). It is inevitable. The value of bit 1 is normal when 0, abnormal when 1 and normal only when the Camcen counter is 3 or less and matches the combination of crank position variables shown in FIG. Is in an abnormal state.
【0135】例えば、CCAS=0或は1、すなわち、
ある気筒のBTDC97°〜10°CAに対し、カムセ
ンカウンタが0で気筒情報変数RCASが0となる組合
せは、図23からもわかるように、クランク位置を正常
に推定すれば良い状態であるため、図22に示す気筒・
クランク位置状態マップCCHMAPの該当領域に2進
数で01(正常推定)の状態データがストアされてお
り、さらに、カムセンカウンタが1で気筒情報変数RC
ASが0となる組合せは、明らかに異常であって推定す
るしかない状態であるため、気筒・クランク位置状態マ
ップCCHMAPの該当領域に2進数で11(異常推
定)の状態データがストアされている。For example, CCAS = 0 or 1, that is,
As can be seen from FIG. 23, the combination in which the Camsen counter is 0 and the cylinder information variable RCAS is 0 with respect to BTDC 97 ° to 10 ° CA of a certain cylinder is a state in which it is sufficient to estimate the crank position normally. , The cylinder shown in FIG.
State data of binary 01 (normal estimation) is stored in a corresponding area of the crank position state map CCHMAP.
Since the combination in which AS is 0 is clearly abnormal and can only be estimated, state data of 11 (abnormal estimation) is stored in the corresponding area of the cylinder / crank position state map CCHMAP in binary. .
【0136】また、CCAS=2、すなわち、ある気筒
のBTDC10°CA〜ATDC83°CAに対し、カ
ムセンカウンタが3で気筒情報変数RCASが0となる
組合せは、#1気筒のTDCを挟んだクランク位置と正
常に確定できるため、気筒・クランク位置状態マップC
CHMAPの該当領域に2進数で00(正常確定)の状
態データがストアされており、さらに、カムセンカウン
タが2で気筒情報変数RCASが0となる組合せは、明
らかに異常ではあるがカムセン入力が2ヶある以上確定
せざるを得ない状態であるため、気筒・クランク位置状
態マップCCHMAPの該当領域に2進数で10(異常
確定)の状態データがストアされている。Further, the combination of CCAS = 2, that is, the combination of the Camcen counter of 3 and the cylinder information variable RCAS of 0 for the BTDC of 10 ° CA to ATDC of 83 ° CA of a certain cylinder is the crank across the TDC of the # 1 cylinder. Since the position can be determined normally, the cylinder / crank position state map C
The state data of binary 00 (normally determined) is stored in the corresponding area of the CHMAP. Further, the combination in which the Camsen counter is 2 and the cylinder information variable RCAS is 0 is clearly abnormal, but the Camsen input is apparently abnormal. Since it is inevitable that there are two or more, the state data of 10 (abnormal) is stored in the corresponding area of the cylinder / crank position state map CCHMAP.
【0137】そして、上記ステップS801で気筒・クラン
ク位置状態マップCCHMAPから状態データを読込む
と、ステップS802へ進み、エラーレベルECASが2で
ないか否か、すなわち、現在の状態が気筒判別のなされ
ていない不明な状態であるか否かを調べ、ECAS=2
のときには、ステップS803で気筒・クランク位置状態マ
ップCCHMAPから読込んだ状態データのビット0が
0か否か、すなわち確定状態か否かを調べ、確定状態の
ときにはステップS804へ進み、確定状態でなく推定状態
であるときにはルーチンを抜けて確定状態となるまで待
つ。When the status data is read from the cylinder / crank position status map CCHMAP in step S801, the flow advances to step S802 to determine whether or not the error level ECAS is not 2, that is, the current status has not been determined by the cylinder. Check whether the state is unknown or not, ECAS = 2
In step S803, it is checked whether or not bit 0 of the status data read from the cylinder / crank position status map CCHMAP in step S803 is 0, that is, whether or not the status is determined. If the status is determined, the process proceeds to step S804. If the state is the estimation state, the routine exits from the routine and waits until the state is determined.
【0138】一方、上記ステップS802でECAS≠2の
ときにはステップS804へ進んで、推定状態か否かを調
べ、確定状態、推定状態に応じてステップS805以降の処
理或はステップS812以降の処理へ進む。また、上記ステ
ップS803において確定状態でステップS804へ進んだとき
には、ステップS805以降の処理へ進む。On the other hand, if ECAS ≠ 2 in step S802, the flow advances to step S804 to check whether the state is the estimated state, and to the processing after step S805 or the processing after step S812 according to the confirmed state or the estimated state. . When the process proceeds to step S804 in the determined state in step S803, the process proceeds to step S805 and subsequent steps.
【0139】まず、ステップS805以降の処理について説
明すると、このステップS805へ進んだときには、正常、
異常に拘らず気筒判別がなされた確定状態であるため、
図23のタイムチャートからもわかるように、今回のク
ラセン割込みはカムパルスが3ヶ或は2ヶ入力された後
のBTDC97°CAの割込みであるため、クランク位
置情報変数CCASを0にする。First, the processing after step S805 will be described.
Because the cylinder is determined regardless of the abnormality,
As can be seen from the time chart of FIG. 23, since the current classane interrupt is an interrupt of BTDC 97 ° CA after three or two cam pulses are input, the crank position information variable CCAS is set to 0.
【0140】次いで、ステップS806へ進んでカムセンカ
ウンタが3でないか否かを調べ、カムセンカウンタが3
でないとき、すなわちカムセンカウンタが2のときに
は、#2気筒の点火後であるため、ステップS807で気筒
情報変数RCASを3にしてステップS809へ進み、カム
センカウンタが3のときには、#1気筒の点火後である
ため、ステップS808で気筒情報変数RCASを1にして
ステップS809へ進む。Then, the flow advances to step S806 to check whether or not the Camcen counter is not 3.
If not, that is, if the Camcen counter is 2, since the # 2 cylinder has been ignited, the cylinder information variable RCAS is set to 3 in step S807, and the process proceeds to step S809. If the Camcen counter is 3, the # 1 cylinder is Since the ignition has been performed, the cylinder information variable RCAS is set to 1 in step S808, and the process proceeds to step S809.
【0141】ステップS809では、更新したクランク位置
情報変数CCAS、気筒情報変数RCAS、及び、カム
センカウンタをパラメータとして再び気筒・クランク位
置状態マップCCHMAPから状態データを読込み、こ
の状態データのビット1が1であるか、すなわち異常状
態であるか否かを調べる。In step S809, state data is read again from the cylinder / crank position state map CCHMAP using the updated crank position information variable CCAS, cylinder information variable RCAS, and Camsen counter as parameters, and bit 1 of this state data is set to 1 , That is, whether it is in an abnormal state.
【0142】その結果、上記ステップS809において、状
態データのビット1が1で異常状態と判定されるときに
は、クランク位置情報変数CCAS、気筒情報変数RC
ASの更新結果は不安の残る推定であるとしてステップ
S810でエラーレベルECASを1にしてルーチンを抜
け、状態データのビット1が0であり正常状態であると
きには、ステップS811でエラーレベルECASを0とし
てルーチンを抜ける。As a result, in step S809, when bit 1 of the status data is 1 and it is determined that the status is abnormal, 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 step S810, the error level ECAS is set to 1 and the routine is exited. When the bit 1 of the status data is 0 and the state is normal, the error level ECAS is set to 0 in step S811 and the routine exits.
【0143】一方、ステップS812以降の処理では、ステ
ップS812で、現在のクランク位置情報変数CCAS(前
回のクラセン割込みで算出されたクランク位置情報変数
CCAS)が2、すなわち、気筒情報変数RCASの変
化点であるか否かを調べ、CCAS=2のときには、ス
テップS812からステップS813へ進んで、気筒情報変数R
CASを1増加させ、ステップS814でクランク位置情報
変数CCASを0にしてステップS817へ進む。On the other hand, in the processing after step S812, in step S812, the current crank position information variable CCAS (the crank position information variable CCAS calculated by the previous classen interrupt) is 2, that is, the changing point of the cylinder information variable RCAS. It is checked whether or not CCAS = 2. If CCAS = 2, the process proceeds from step S812 to step S813, where the cylinder information variable R
CAS is incremented by 1, and the crank position information variable CCAS is set to 0 in step S814, and the process proceeds to step S817.
【0144】一方、上記ステップS812で、CCAS≠2
のときには、上記ステップS812からステップS815へ進ん
でカムセンカウンタが0でないか否かを調べ、カムセン
カウンタが0でないときには、前述のステップS813へ分
岐し、カムセンカウンタが0のときには、ステップS816
でクランク位置情報変数CCASを1増加させ、ステッ
プS817へ進む。On the other hand, in the above step S812, CCAS ≠ 2
In step S812, the process proceeds from step S812 to step S815 to check whether the Cam Seng counter is not 0. If the Cam Seng counter is not 0, the process branches to step S813. If the Cam Seng counter is 0, the process proceeds to step S816.
Increments the crank position information variable CCAS by 1, and proceeds to step S817.
【0145】ステップS817では、更新したクランク位置
情報変数CCAS、気筒情報変数RCAS、及び、カム
センカウンタをパラメータとして再び気筒・クランク位
置状態マップCCHMAPから状態データを読込んで異
常状態であるか否かを調べ、状態データのビット1が0
であり、正常状態であるときには、そのまま(現在のエ
ラーレベルECAS=0のまま)ルーチンを抜ける。ま
た、上記ステップS817で、状態データのビット1が1で
異常状態のときには、ステップS818へ進み、クランク位
置情報変数CCAS、気筒情報変数RCASの更新結果
は不安の残る推定であるとしてエラーレベルECASを
1にし、ルーチンを抜ける。In step S817, state data is read from the cylinder / crank position state map CCHMAP again using the updated crank position information variable CCAS, cylinder information variable RCAS, and Camsen counter as parameters, and it is determined whether an abnormal state is present. Check that bit 1 of the status data is 0
If the state is normal, the routine exits the routine without changing the current error level (ECAS = 0). If the bit 1 of the status data is 1 in step S817, indicating an abnormal state, the process proceeds to step S818, and the error level ECAS is determined as an update result of the crank position information variable CCAS and the cylinder information variable RCAS as an estimation that remains uneasy. Set to 1 and exit the routine.
【0146】以上のように、クランク位置変数CCA
S,RCAS,ACAS,ECASにより刻々と変化す
るクランク位置の状態を把握し、さらに、気筒・クラン
ク位置状態マップCCHMAPを用いて、現在の状態を
評価し、次にとるべき状態を知ることができるため、通
常の条件判断による処理に比較して大幅にプログラムを
簡略化することができ、メモリ容量の節約、処理速度の
向上を図ることができるとともに、プログラムの可撓性
を向上して仕様変更に対しても柔軟に対処することがで
きる。As described above, the crank position variable CCA
S, RCAS, ACAS, and ECAS are used to grasp the ever-changing state of the crank position, and further, using the cylinder / crank position state map CCHMAP, to evaluate the current state and to know the next state to be taken. Therefore, the program can be greatly simplified as compared with the process based on normal condition judgment, and the memory capacity can be reduced, the processing speed can be improved, and the specification can be changed by improving the flexibility of the program. Can be flexibly dealt with.
【0147】次に、図10、図11に示す燃料噴射開始
時期算出ルーチンについて説明する。この燃料噴射開始
時期算出ルーチンは、前述したジョブ実行サブルーチン
のステップS553で実行される50msジョブのうちの一
つで、吸気行程直前の10°CAを基準として何ms前
に燃料噴射を開始するのかを、全気筒について設定す
る。Next, the fuel injection start timing calculation routine shown in FIGS. 10 and 11 will be described. This fuel injection start timing calculation routine is one of the 50 ms jobs executed in step S553 of the above-described job execution subroutine, and how many ms before the fuel injection is started based on 10 ° CA immediately before the intake stroke. Is set for all cylinders.
【0148】まず、ステップS1000で始動時かを判断
し、始動時の場合にはステップS1001へ進み、噴射開始
遅れ時間IJDELYを0とし、ステップS1002で噴射
開始区間設定フラグIJTMGFを例えば2の1回噴射
にセットしてサブルーチンを抜ける。First, it is determined in step S1000 whether or not the engine is at the time of starting. If the engine is at the time of starting, the process proceeds to step S1001, the injection start delay time IJDELY is set to 0, and the injection start section setting flag IJTMGF is set to, for example, 2 times in step S1002. Set to injection and exit the subroutine.
【0149】上記噴射開始遅れ時間IJDELYは後述
する噴射タイマセットマクロ2で設定するタイマ待ち時
間に組込まれるもので、噴射開始区間の始り(BTDC
97゜CAクラセン信号入力(以下「97゜CAクラセ
ン」と略記する)、或はBTDC10゜CAクラセン信
号入力(以下「10゜CAクラセン」と略記する)から
何ms後に噴射開始するのかを決定する。また、上記噴
射開始区間設定フラグIJTMGFにより、#1〜#4
気筒の噴射開始区間が特定される。すなわち、この噴射
開始区間は、#1〜#4気筒毎の噴射開始区間テーブル
IJnTBL(n=#1,#2,#3,#4)に予め格
納されている。図23に示すように、この各噴射開始区
間テーブルIJnTBL(n=#1,#2,#3,#
4)では、#1〜#4気筒の1サイクルを前述のクラン
ク総合位置変数ACASに対応して97°CAクラセン
と10°CAクラセンとで8区間に区分し、各区間をビ
ット7〜ビット0に対応させた1バイトの変数として上
記噴射開始区間設定フラグIJTMGFにて噴射開始区
間を設定する。すなわち、本実施例では、噴射開始区間
テーブルIJnTBLの各噴射開始区間を、吸気行程の
後半を0、前半を1、排気行程の後半を2、前半を3、
燃焼行程の後半を4、前半を5、さらに、圧縮行程の後
半を6、前半すなわち吸気行程終了直後を7と定義して
いる。但し、噴射開始区間0では噴射処理を行わない。The injection start delay time IJDELY is incorporated in a timer waiting time set by an injection timer set macro 2 to be described later, and starts the injection start section (BTDC).
Determines the number of milliseconds after the start of the injection from the 97 @ CA classa signal input (hereinafter abbreviated as "97 @ CA classa") or the BTDC 10 @ CA classa signal input (hereinafter abbreviated as "10 @ CA classa"). . Also, # 1 to # 4 are set by the injection start section setting flag IJTMGF.
The injection start section of the cylinder is specified. That is, this injection start section is stored in advance in the injection start section table IJnTBL (n = # 1, # 2, # 3, # 4) for each of the # 1 to # 4 cylinders. As shown in FIG. 23, each injection start section table IJnTBL (n = # 1, # 2, # 3, #
In 4), one cycle of cylinders # 1 to # 4 is divided into eight sections of 97 ° CA class and 10 ° CA class in accordance with the above-described crank total position variable ACAS, and each section is defined as bit 7 to bit 0. The injection start section is set by the above-mentioned injection start section setting flag IJTMGF as a 1-byte variable corresponding to. That is, in the present embodiment, each of the injection start sections of the injection start section table IJnTBL is set to 0 in the second half of the intake stroke, 1 in the first half, 2 in the second half of the exhaust stroke, and 3 in the first half.
The second half of the combustion stroke is defined as 4, the first half is defined as 5, the second half of the compression stroke is defined as 6, and the first half is defined as 7 immediately after the end of the intake stroke. However, the injection process is not performed in the injection start section 0.
【0150】従って、上記ステップS1002において、I
JTMGF=2は、8ビットの変数で表せば00000
010であるため、噴射開始区間1(10°CAのクラ
セン)から待ち時間無しで燃料噴射が開始される。Therefore, in step S1002, I
JTMGF = 2 is 00000 if represented by an 8-bit variable.
Since it is 010, fuel injection is started from the injection start section 1 (10 ° CA class) without any waiting time.
【0151】一方、上記ステップS1000で始動時ではな
いと判断されてステップS1003へ分岐すると、噴射開始
セット時間IJTIMEがゼロかを判断し、IJTIM
E=0の場合、上記ステップS1001へ戻りステップS100
1,S1002を経てルーチンを抜ける。On the other hand, if it is determined in step S1000 that it is not the time of starting, and the flow branches to step S1003, it is determined whether the injection start set time IJTIME is zero, and IJTIM is determined.
If E = 0, return to step S1001 and return to step S100
Exit the routine via 1, S1002.
【0152】この噴射開始セット時間IJTIMEはユ
ーザ側の制御ストラテジーで設定するもので、例えば、
この噴射開始セット時間IJTIMEに要求噴射幅IJ
SEIn(n=#1,#2,#3,#4)を代入すれ
ば、噴射エンドを吸気行程直前のBTDC10°CAに
ほぼ固定することができる。また、この噴射開始セット
時間IJTIMEを任意に設定することで噴射エンド制
御を行うことができる。The injection start set time IJTIME is set by a control strategy on the user side.
The required injection width IJ is added to the injection start set time IJTIME.
By substituting SEIn (n = # 1, # 2, # 3, # 4), the injection end can be substantially fixed at BTDC10 ° CA immediately before the intake stroke. The injection end control can be performed by arbitrarily setting the injection start set time IJTIME.
【0153】従って、ユーザ側の制御ストラテジーにお
いてIJTIME=0と設定することも考えられ、この
場合には上記ステップS1003から、上記ステップS1001へ
戻り、ステップS1002で噴射開始区間1(10°CAク
ラセン)から待ち時間無しで噴射を開始する。Accordingly, it is conceivable to set IJTIME = 0 in the control strategy on the user side. In this case, the process returns from step S1003 to step S1001, and in step S1002, the injection start section 1 (10 ° CA class) Starts injection without waiting time.
【0154】また、ステップS1003でIJTIME≠0
と判断されてステップS1004へ進むと、このステップS10
04以下において、噴射開始セット時間IJTIMEに基
づく噴射開始区間及び噴射開始遅れ時間IJDELYを
算出する。In step S1003, IJTIMEJ0
When the process proceeds to step S1004, this step S10
From 04 onwards, an injection start section and an injection start delay time IJDELY based on the injection start set time IJTIME are calculated.
【0155】すなわち、上記噴射開始セット時間IJT
IMEを噴射開始区間毎のクラセン間隔(BTDC97
°〜10°CA或はBTDC10°〜ATDC83°C
A間の間隔時間)で順次、ゼロ或は負になるまで減算し
て噴射開始区間を特定するとともに、この特定した噴射
開始区間の始め(97°CAクラセン或は10°CAク
ラセン)から何ms後に燃料噴射を開始すれば良いかを
噴射開始遅れ時間IJDELYにより設定する。That is, the injection start set time IJT
The IME is used for classifier intervals (BTDC97 for each injection start section).
° to 10 ° CA or BTDC 10 ° to ATDC 83 ° C
(Interval time between A and A) to sequentially specify the injection start section by subtracting the value until the value becomes zero or negative, and specify the number of milliseconds from the start of the specified injection start section (97 ° CA class or 10 ° CA class). Whether the fuel injection should be started later is set by the injection start delay time IJDELY.
【0156】まず、ステップS1004では、上記噴射開始
セット時間IJTIMEからクラセン間隔を減算し、そ
の値をアキュムレータAに格納し、ステップS1005でこ
のアキュムレータAの値が正か、ゼロあるいは負かを判
断し、A≦0場合、ステップS1006へ進み、噴射開始遅
れ時間IJDELYを上記アキュムレータAに格納した
値の2の補数で設定し(IJDELY=−A)、ステッ
プS1007で噴射開始区間設定フラグIJTMGFを4と
してルーチンを抜ける。この場合、噴射開始区間は2で
あり、97°CAクラセンから上記噴射開始遅れ時間I
JDELY後に燃料噴射が開始される。First, in step S1004, the classifier interval is subtracted from the injection start set time IJTIME, and the value is stored in the accumulator A. In step S1005, it is determined whether the value of the accumulator A is positive, zero, or negative. , A ≦ 0, the process proceeds to step S1006, where the injection start delay time IJDELY is set by a two's complement of the value stored in the accumulator A (IJDELY = −A), and the injection start section setting flag IJTMGF is set to 4 in step S1007. Exit the routine. In this case, the injection start section is 2, and the injection start delay time I
Fuel injection is started after JDELY.
【0157】一方、上記ステップS1005で、A>0と判
断されると、ステップS1008へ分岐し、上記アキュムレ
ータAの値を、このアキュムレータAに格納した値から
クラセン間隔を減算した値とし(A=A−クラセン間
隔)、ステップS1009でこのアキュムレータAの値を参
照し、A≦0の場合、ステップS1010へ進み、噴射開始
遅れ時間IJDELYを上記アキュムレータAに格納し
た値の2の補数で設定し(IJDELY=−A)、ステ
ップS1011で噴射開始区間設定フラグIJTMGFを8
として、ルーチンを抜ける。この場合、噴射開始区間は
3であり、一つ前の10°CAクラセンから噴射開始遅
れ時間IJDELY後に燃料噴射が開始される。On the other hand, if it is determined in step S1005 that A> 0, the flow branches to step S1008, where the value of the accumulator A is set to a value obtained by subtracting the classen interval from the value stored in the accumulator A (A = (A-classen interval), the value of the accumulator A is referred to in step S1009, and if A ≦ 0, the process proceeds to step S1010, where the injection start delay time IJDELY is set by the two's complement of the value stored in the accumulator A ( IJDELY = -A). In step S1011, the injection start section setting flag IJTMGF is set to 8
To exit the routine. In this case, the injection start section is 3, and the fuel injection is started after the injection start delay time IJDELY from the immediately preceding 10 ° CA class.
【0158】一方、上記ステップS1009で、A>0と判
断されると、ステップS1012へ分岐し、上記アキュムレ
ータAの値を、このアキュムレータAに格納した値から
クラセン間隔を減算した値とし(A=A−クラセン間
隔)、ステップS1013でこのアキュムレータAの値を参
照し、A≦0の場合、ステップS1014へ進み、噴射開始
遅れ時間IJDELYを上記アキュムレータAの値の2
の補数で設定し(IJDELY=−A)、ステップS101
5で噴射開始区間設定フラグIJTMGFを16として
ルーチンを抜ける。この場合、噴射開始区間は4であ
り、一つ前の97°CAクラセンから上記噴射開始遅れ
時間IJDELY後に燃料噴射が開始される。On the other hand, if it is determined in step S1009 that A> 0, the flow branches to step S1012, and the value of the accumulator A is set to a value obtained by subtracting the classen interval from the value stored in the accumulator A (A = A), the value of the accumulator A is referred to in step S1013, and if A ≦ 0, the process proceeds to step S1014, where the injection start delay time IJDELY is set to 2 of the value of the accumulator A.
(IJDELY = -A), and step S101
At 5, the injection start section setting flag IJTMGF is set to 16, and the routine exits. In this case, the injection start section is 4, and the fuel injection is started after the injection start delay time IJDELY from the immediately preceding 97 ° CA class.
【0159】一方、上記ステップS1013で、A>0と判
断されると、ステップS1016へ分岐し、上記アキュムレ
ータAの値を、このアキュムレータAに格納した値から
クラセン間隔を減算した値とし(A=A−クラセン間
隔)、ステップS1017でこのアキュムレータAに格納し
た値を参照し、A≦0の場合、ステップS1018へ進み、
噴射開始遅れ時間IJDELYを上記アキュムレータA
の値の2の補数で設定し(IJDELY=−A)、ステ
ップS1019で噴射開始区間設定フラグIJTMGFを3
2としてルーチンを抜ける。この場合、噴射開始区間は
5であり、二つ前の10°CAクラセンから噴射開始遅
れ時間IJDELY後に燃料噴射が開始される。On the other hand, if it is determined in step S1013 that A> 0, the flow branches to step S1016, and the value of the accumulator A is set to a value obtained by subtracting the classen interval from the value stored in the accumulator A (A = A-classen interval), referring to the value stored in the accumulator A in step S1017, and if A ≦ 0, proceed to step S1018,
The injection start delay time IJDELY is set to the above accumulator A
(IJDELY = -A), and in step S1019, sets the injection start section setting flag IJTMGF to 3
The routine exits as step 2. In this case, the injection start section is 5, and the fuel injection is started after the injection start delay time IJDELY from the previous 10 ° CA class.
【0160】一方、上記ステップS1017で、A>0と判
断されると、ステップS1020へ分岐し、上記アキュムレ
ータAの値を、このアキュムレータAに格納した値から
クラセン間隔を減算した値とし(A=A−クラセン間
隔)、ステップS1021でこのアキュムレータAに格納し
た値を参照し、A≦0の場合、ステップS1022へ進み、
噴射開始遅れ時間IJDELYを上記アキュムレータA
の値の2の補数で設定し(IJDELY=−A)、ステ
ップS1023で噴射開始区間設定フラグIJTMGFを6
4としてルーチンを抜ける。この場合、噴射開始区間は
6であり、二つ前の97°CAクラセンから噴射開始遅
れ時間IJDELY後に燃料噴射が開始される。On the other hand, if it is determined in step S1017 that A> 0, the flow branches to step S1020, and the value of the accumulator A is set to a value obtained by subtracting the classen interval from the value stored in the accumulator A (A = A-classen interval), refer to the value stored in the accumulator A in step S1021, and if A ≦ 0, proceed to step S1022.
The injection start delay time IJDELY is set to the above accumulator A
(IJDELY = -A), and sets the injection start section setting flag IJTMGF to 6 in step S1023.
The routine exits as step 4. In this case, the injection start section is 6, and the fuel injection is started after the injection start delay time IJDELY from the 97 ° CA classen two before.
【0161】一方、上記ステップS1021で、A>0と判
断されると、ステップS1024へ分岐し、上記アキュムレ
ータAの値を、このアキュムレータAに格納した値から
クラセン間隔を減算した値とし(A=A−クラセン間
隔)、ステップS1025でこのアキュムレータAに格納し
た値を参照し、A≦0の場合、ステップS1026へ進み、
噴射開始遅れ時間IJDELYを上記アキュムレータA
に格納した値の2の補数で設定し(IJDELY=−
A)、ステップS1027で噴射開始区間設定フラグIJT
MGFを128としてルーチンを抜ける。この場合、噴
射開始区間は7であり、三つ前の10°CAクラセンか
ら噴射開始遅れ時間IJDELY後に燃料噴射が開始さ
れる。On the other hand, if it is determined in step S1021 that A> 0, the flow branches to step S1024, and the value of the accumulator A is set to a value obtained by subtracting the classen interval from the value stored in the accumulator A (A = A-classen interval), referring to the value stored in the accumulator A in step S1025, and if A ≦ 0, proceed to step S1026,
The injection start delay time IJDELY is set to the above accumulator A
(IJDELY = −)
A), in step S1027, the injection start section setting flag IJT
The routine exits with the MGF set to 128. In this case, the injection start section is 7, and the fuel injection is started after the injection start delay time IJDELY from the previous 10 ° CA classen.
【0162】一方、上記ステップS1025で、A>0と判
断されると、ステップS1028へ分岐し、噴射開始遅れ時
間IJDELYを0とし、ステップS1029で噴射開始区
間設定フラグIJTMGFを128としてルーチンを抜
ける。この場合、噴射開始区間は7であり、三つ前の1
0°CAクラセンから待ち時間なしで燃料噴射が開始さ
れる。すなわち、噴射開始区間7から待ち時間なしで開
始される燃料噴射が最大噴射量となる。On the other hand, if it is determined in step S1025 that A> 0, the flow branches to step S1028, where the injection start delay time IJDELY is set to 0, and in step S1029, the injection start section setting flag IJTMGF is set to 128, and the routine exits. In this case, the injection start section is 7 and the previous three 1
Fuel injection is started without waiting time from 0 ° CA class. That is, the fuel injection that is started from the injection start section 7 without any waiting time is the maximum injection amount.
【0163】例えば、図24(a)に示すように、噴射
開始セット時間IJTIMEに基づいて噴射開始区間が
5(IJTMGF=32)に設定された場合、噴射開始
区間5から噴射開始遅れ時間IJDELY後に燃料噴射
が開始される。これを図23の総合位置変数ACASに
対応させて説明すれば、#1気筒ではACAS=2、#
3気筒ではACAS=5、#2気筒ではACAS=8、
#4気筒ではACAS=11となる。For example, as shown in FIG. 24 (a), when the injection start section is set to 5 (IJTMGF = 32) based on the injection start set time IJTIME, the injection start delay time IJDELY after the injection start section 5 Fuel injection is started. This will be described with reference to the total position variable ACAS of FIG. 23. In the case of # 1 cylinder, ACAS = 2, #
ACAS = 5 for three cylinders, ACAS = 8 for # 2 cylinder,
ACAS = 11 for the # 4 cylinder.
【0164】尚、上記フローチャートでは噴射開始区間
設定フラグIJTMGFのビット指定を1気筒当り1カ
所としているが、噴射開始区間設定フラグIJTMGF
で複数のビットを指定して、1サイクル中に複数回噴射
させれば、例えば、初回噴射で気化の促進を図り、最後
の噴射で空燃比をトータル的に調整するすることができ
るばかりでなく、結果として、加速時の増量等に対して
も後の噴射量を調整することで柔軟に対応することがで
きる。In the above flowchart, the bit designation of the injection start section setting flag IJTMGF is set to one place per cylinder.
If a plurality of bits are specified and the fuel is injected multiple times during one cycle, for example, it is possible not only to promote the vaporization in the first injection and to totally adjust the air-fuel ratio in the last injection, As a result, it is possible to flexibly cope with an increase in the amount of acceleration or the like by adjusting the amount of injection later.
【0165】また、本フローチャートでは、噴射開始区
間を50msec毎に設定しているため、エンジン回転
数が9000〜10000rpm等の高回転数に達して
もメインCPU58の負担が増加することはなく、高回
転数域でも噴射エンド制御が可能になる。In this flowchart, since the injection start section is set every 50 msec, the load on the main CPU 58 does not increase even if the engine speed reaches a high speed such as 9000 to 10000 rpm. Injection end control becomes possible even in the rotation speed range.
【0166】図12は噴射タイマセットサブルーチン
で、図2に示すクラセンによる割込み処理ルーチンのス
テップS205で実行されるもので、噴射開始区間毎に噴射
タイマをセットする。FIG. 12 is an injection timer setting subroutine, which is executed in step S205 of the interrupt processing routine by the class shown in FIG. 2, and sets the injection timer for each injection start section.
【0167】まず、ステップS1100でエラーレベルEC
ASが2かを判断し、ECAS=2の場合、クランク位
置の判別が不明な状態であるため、以降の処理をせずサ
ブルーチンを抜け、また、ECAS≠2の場合ステップ
S1101へ進み、クランク位置情報変数CCASが1かを
判断し、CCAS=1の場合、演算不要と判断してルー
チンを抜ける。図23に示すように、CCAS=1の場
合は65°CAクラセンの割込みであり、既に現噴射開
始区間における噴射タイマのセットが終了しているため
直ちにサブルーチンを抜け、処理負担を軽減する。一
方、CCAS≠1の場合は、97°CAクラセンの割込
みか、10°CAクラセンの割込みの何れかであり、噴
射開始区間の始りであるため、ステップS1102以下にお
いて現噴射開始区間での噴射幅及び噴射開始時期を設定
する。First, at step S1100, the error level EC is set.
It is determined whether AS is 2. If ECAS = 2, the determination of the crank position is in an unknown state, so the subroutine is exited without performing the subsequent processing.
Proceeding to S1101, it is determined whether or not the crank position information variable CCAS is 1, and if CCAS = 1, it is determined that calculation is unnecessary and the routine exits. As shown in FIG. 23, when CCAS = 1, it is an interrupt of 65 ° CA class, and since the setting of the injection timer in the current injection start section has already been completed, the subroutine is immediately exited to reduce the processing load. On the other hand, in the case of CCAS ≠ 1, it is either the interruption of the 97 ° CA class or the interruption of the 10 ° CA class, which is the start of the injection start section. Set the width and injection start timing.
【0168】まず、ステップS1102〜ステップS1105で
は、後述する噴射タイマセットマクロ1を全気筒につい
て実行し、現噴射開始区間における噴射幅(以下「有効
噴射幅」とする)TEIJAn(n=#1,#2,#
3,#4)を全気筒について設定する。First, in steps S1102 to S1105, an injection timer set macro 1 to be described later is executed for all cylinders, and an injection width (hereinafter referred to as an “effective injection width”) TEIJAn (n = # 1, # 2, #
3, # 4) are set for all cylinders.
【0169】そして、ステップS1106で、上記各ステッ
プS1102〜ステップS1105で各々設定した有効噴射幅TE
IJAnが全てゼロかを判断し、全てゼロの場合、噴射
タイマを再セットする必要がないためサブルーチンを抜
ける。また、少なくとも一つの気筒がTEIJAn≠0
の場合には、ステップS1107へ進み、全ての噴射タイマ
を停止状態とし、その間、以下のステップS1108〜ステ
ップS1111の処理を行う。Then, in step S1106, the effective injection width TE set in each of steps S1102 to S1105 is set.
It is determined whether or not IJAn is all zero. If all are zero, the subroutine is exited because it is not necessary to reset the injection timer. In addition, at least one cylinder has TEIJAn ≠ 0
In the case of, the process proceeds to step S1107, in which all the injection timers are stopped, and during that time, the following steps S1108 to S1111 are performed.
【0170】このステップS1108〜ステップS1111では、
後述する噴射タイマセットマクロ2を全気筒について実
行し、上記噴射タイマセットマクロ1で設定した有効噴
射幅TEIJAnに基づく噴射時間を全気筒分設定す
る。In steps S1108 to S1111,
The injection timer set macro 2 described later is executed for all cylinders, and the injection time based on the effective injection width TEIJAn set by the injection timer set macro 1 is set for all cylinders.
【0171】そして、ステップS1112で全ての噴射タイ
マを再スタートさせてサブルーチンを抜ける。Then, in step S1112, all the injection timers are restarted, and the process exits the subroutine.
【0172】なお、上記ステップS1107で、全ての噴射
タイマが停止されると、噴射時間が計時されないため燃
料噴射中の気筒では燃料噴射が続行され、また噴射停止
中の気筒では噴射停止状態が続行される。また、上記ス
テップS1108〜ステップS1112で設定した噴射時間には噴
射タイマを停止した時間に相当する処理時間が考慮され
ている。In step S1107, when all the injection timers are stopped, the injection time is not measured, so that the fuel injection is continued in the cylinder during fuel injection, and the injection stop state is continued in the cylinder during injection stop. Is done. The injection time set in steps S1108 to S1112 takes into account the processing time corresponding to the time during which the injection timer is stopped.
【0173】上記噴射タイマセットサブルーチンにおけ
るステップS1102〜ステップS1105で実行される気筒毎の
噴射タイマセットマクロ1は図13,図14に示す噴射
タイマセットマクロ1を示すフローチャートにて実行さ
れる。尚、この噴射タイマセットマクロ1のプログラム
は#1気筒の噴射タイマセットルーチンを基本プログラ
ムとし、これを#2〜#4気筒にも応用できるようにマ
クロ化したものである。The injection timer set macro 1 for each cylinder executed in steps S1102 to S1105 in the injection timer set subroutine is executed according to the flowchart shown in FIG. 13 and FIG. The program of the injection timer set macro 1 is based on the injection timer set routine of the # 1 cylinder, and is made into a macro so that it can be applied to the # 2 to # 4 cylinders.
【0174】まず、ステップS1200で当該#n(n=
1,2,3或は4)気筒の現在の噴射開始区間番号を、
クランク総合位置変数ACASに基づき当該#n気筒の
噴射開始区間テーブルIJnTBL(図23)を参照し
て調査し、ステップS1201で噴射開始区間番号がゼロか
を判断する。そして、噴射開始区間がゼロの場合、ステ
ップS1202へ進み、噴射開始区間がゼロでない場合ステ
ップS1210へ進む。First, in step S1200, the corresponding #n (n =
1, 2, 3, or 4) the current injection start section number of the cylinder
Based on the crank total position variable ACAS, a check is made with reference to the injection start section table IJnTBL (FIG. 23) of the #n cylinder, and it is determined in step S1201 whether the injection start section number is zero. When the injection start section is zero, the process proceeds to step S1202, and when the injection start section is not zero, the process proceeds to step S1210.
【0175】噴射開始区間0の時は 吸気行程後半であ
り噴射処理を行わない為、ステップS1202ないしステッ
プS1209で次回の燃料噴射に備え燃料噴射の初期化処理
を実行する。まず、ステップS1202で当該#n気筒の累
積噴射幅TEIJBnをゼロとし、ステップS1203でユ
ーザ側ジョブから燃料カット要求があるかを判断し、燃
料カット要求がない場合ステップS1204へ進み、燃料カ
ット要求がある場合にはステップS1208へ進む。Since the injection start section 0 is in the latter half of the intake stroke and the injection processing is not performed, the initialization processing of the fuel injection is executed in steps S1202 to S1209 in preparation for the next fuel injection. First, in step S1202, the cumulative injection width TEIJBn of the #n cylinder is set to zero. In step S1203, it is determined whether there is a fuel cut request from the user side job. If there is no fuel cut request, the process proceeds to step S1204, where the fuel cut request is If there is, the process proceeds to step S1208.
【0176】燃料カット要求なしと判断してステップS1
204へ進むと、燃料カット状態フラグPRCUTの値を
参照して当該#n気筒が燃料カット状態かを判断し、燃
料カット状態ではない場合ステップS1205へ進み、また
燃料カット状態の場合ステップS1206へ進む。It is determined that there is no fuel cut request and step S1
In step 204, it is determined whether the #n cylinder is in the fuel cut state with reference to the value of the fuel cut state flag PRCUT. If the fuel cut state is not in progress, the flow proceeds to step S1205. .
【0177】この燃料カット状態フラグPRCUTは#
1〜#4気筒をビット0〜ビット3の4ビットに対応さ
せて表したもので、ユーザ側ジョブで燃料カットが要求
された時の最初のルーチンでセットされ、また燃料カッ
ト要求解除後の最初のルーチンでクリアされる。This fuel cut state flag PRCUT is #
Cylinders 1 to # 4 are represented in correspondence with the four bits of bit 0 to bit 3, and are set in the first routine when a fuel cut is requested by the user's job, and are also set after the fuel cut request is released. Cleared by the routine.
【0178】上述したように、この燃料カット状態フラ
グPRCUTは、噴射開始区間0において当該#n気筒
に対応するビットがセットされているかを判断し、ユー
ザ側ジョブから燃料カット要求がなく、しかも、この燃
料カット状態フラグPRCUTがセットされている気筒
は次のサイクルで燃料が噴射されない。As described above, this fuel cut state flag PRCUT determines whether the bit corresponding to the #n cylinder is set in the injection start section 0, and there is no fuel cut request from the user side job, and No fuel is injected to the cylinder in which the fuel cut state flag PRCUT is set in the next cycle.
【0179】そして、燃料カット状態ではないと判断さ
れてステップS1205へ進むと、噴射開始区間0では噴射
処理を行わないため当該#n気筒の有効噴射幅TEIJ
Anをゼロにして当該#n気筒の噴射タイマセットマク
ロ1を終了する。When it is determined that the fuel is not in the cut-off state and the process proceeds to step S1205, the injection processing is not performed in the injection start section 0, so that the effective injection width TEIJ of the #n cylinder concerned.
An is set to zero, and the injection timer set macro 1 for the #n cylinder is ended.
【0180】また、上記ステップS1204から燃料カット
状態と判断されてステップS1206へ進むと、ユーザ側ジ
ョブから燃料カット要求がなく、燃料カット状態フラグ
PRCUTはセットされているので、復帰後、第1回目
のルーチンであり、次のサイクルにおける燃料カットリ
カバリに備え当該#n気筒の噴射開始区間ゼロで付着補
正量分に相当する燃料を1回噴射する為、ユーザ側ジョ
ブで設定した燃料付着補正量TEFUCHで当該#n気
筒の有効噴射幅TEIJAnを更新し、ステップS1207
で燃料カット状態フラグPRCUTの当該#n気筒に対
応するビットをクリアした後、当該#n気筒の噴射タイ
マセットマクロ1を終了する。If the fuel cut state is determined from step S1204 and the flow advances to step S1206, there is no fuel cut request from the user side job, and the fuel cut state flag PRCUT is set. In order to inject the fuel equivalent to the adhesion correction amount once in the injection start section zero of the #n cylinder in preparation for the fuel cut recovery in the next cycle, the fuel adhesion correction amount TEFUCH set in the user-side job , The effective injection width TEIJAn of the #n cylinder is updated, and step S1207 is performed.
After the bit of the fuel cut state flag PRCUT corresponding to the #n cylinder is cleared, the injection timer set macro 1 for the #n cylinder is ended.
【0181】その結果、燃料カット及び燃料カットリカ
バリに備える付着補正を気筒毎に設定することができ
る。As a result, the adhesion correction for the fuel cut and the fuel cut recovery can be set for each cylinder.
【0182】また、上記ステップS1203で、ユーザ側ジ
ョブから燃料カット要求ありと判断した場合には、噴射
処理を行わない噴射開始区間0で、しかも燃料カットが
要求されているため、ステップS1208で有効噴射幅TE
IJAnをクリアし、ステップS1209で燃料カット状態
フラグPRCUTの当該#n気筒に対応するビットをセ
ットして、当該#n気筒の噴射タイマセットマクロ1を
終了する。If it is determined in step S1203 that there is a fuel cut request from the user side job, the fuel cut is requested in the injection start section 0 in which the injection process is not performed. Injection width TE
IJAn is cleared, the bit corresponding to the #n cylinder in the fuel cut state flag PRCUT is set in step S1209, and the injection timer set macro 1 for the #n cylinder is ended.
【0183】また、上記ステップS1201で現在の噴射開
始区間がゼロ以外、すなわち、噴射処理領域の区間であ
ると判断された場合には、ステップS1210以下で通常の
噴射処理を行う。まず、ステップS1210では、燃料カッ
ト状態フラグPRCUTの当該#n気筒のビットの値を
参照し、当該#n気筒が燃料カット状態かを判断し、燃
料カット状態の場合ステップS1211へ進み、有効噴射幅
TEIJAnをゼロにして当該#n気筒の噴射タイマセ
ットマクロ1を終了する。If it is determined in step S1201 that the current injection start section is other than zero, that is, it is within the injection processing area, normal injection processing is performed in step S1210 and subsequent steps. First, in step S1210, it is determined whether or not the #n cylinder is in the fuel cut state by referring to the value of the bit of the #n cylinder in the fuel cut state flag PRCUT. TEIJAn is set to zero, and the injection timer set macro 1 for the #n cylinder is ended.
【0184】一方、上記ステップS1210で燃料カット状
態ではないと判断されるとステップS1212で今より後の
区間では噴射しないかを、噴射開始区間設定フラグIJ
TMGFの値を参照して判断し、今より後の区間におい
ても噴射すると判断した場合、ステップS1213へ進み、
また、今より後の区間では噴射しないと判断した場合、
ステップS1218へ進む。On the other hand, if it is determined in step S1210 that the fuel is not in the fuel cut state, it is determined in step S1212 whether or not to inject fuel in a section after the current time.
Judgment is made with reference to the value of TMGF, and when it is judged that injection is to be performed also in a section after this, the process proceeds to step S1213,
Also, if it is determined that injection will not be performed in the section after now,
Proceed to step S1218.
【0185】上記ステップS1212は1サイクル中におけ
る複数回噴射に対応したステップで、上記噴射開始区間
設定フラグIJTMGFのビット0〜ビット7で指定し
た区間が2箇所以上ある場合、例えば、図24(b)に
示すように、IJTMGF=32+4であれば、区間5
と2が噴射開始区間であり、噴射開始区間5(図23参
照)においては今より後の区間で噴射されるためステッ
プS1213へ進み、一方、噴射開始区間2では今より後の
区間で噴射しないためステップS1218へ進む。Step S1212 is a step corresponding to a plurality of injections in one cycle. If there are two or more sections specified by bits 0 to 7 of the injection start section setting flag IJTMGF, for example, as shown in FIG. ), If IJTMGF = 32 + 4, section 5
And 2 are injection start sections. In the injection start section 5 (see FIG. 23), the injection is performed in a section after the present, so the process proceeds to step S1213. On the other hand, in the injection start section 2, no injection is performed in the section after the present. Therefore, the process proceeds to step S1218.
【0186】そして、ステップS1213へ進むと、現在の
区間で噴射するかを、上記噴射開始区間設定フラグIJ
TMGFの値を参照してその指示値が前記ステップS120
0で検索した現在の噴射開始区間番号と一致するかによ
り判断し、現在の区間で噴射しない場合、ステップS121
4で有効噴射幅TEIJAnをゼロにして当該#n気筒
の噴射タイマセットマクロ1を終了する。When the flow advances to step S1213, it is determined whether or not to perform the injection in the current section by the injection start section setting flag IJ.
Referring to the value of TMGF, the indicated value is determined in step S120.
Judgment is made based on whether it matches the current injection start section number searched at 0, and if injection is not performed in the current section, step S121
In step 4, the effective injection width TEIJAn is set to zero, and the injection timer set macro 1 for the #n cylinder is terminated.
【0187】一方、上記ステップS1213で現在の区間で
噴射すると判断された場合には、ステップS1215へ進
み、ユーザ側ジョブで10ms毎に設定される気筒別要
求噴射幅IJSEInを2のn乗(n:0,1,2等、予
め設定し、或は1サイクル中の噴射回数に応じて設定す
る値)で除算して1回当りの噴射量を求め、その値をア
キュムレータAに格納し、ステップS1216でこのアキュ
ムレータAに格納した値で当該#n気筒の有効噴射幅T
EIJAnを設定し、ステップS1217で、上記アキュム
レータAの値に累積噴射幅TEIJBnを足し込み、噴
射タイマセットマクロ1を終了する。On the other hand, if it is determined in step S1213 that the injection is to be performed in the current section, the flow advances to step S1215 to increase the cylinder-by-cylinder required injection width IJSEIn set by the user's job every 10 ms to the power of 2 n (n : 0, 1, 2, etc., which is set in advance or set according to the number of injections in one cycle) to obtain the injection amount per injection, and stores the value in the accumulator A. The effective injection width T of the #n cylinder is determined by the value stored in the accumulator A in S1216.
EIJAn is set, and in step S1217, the cumulative injection width TEIJBn is added to the value of the accumulator A, and the injection timer set macro 1 ends.
【0188】図24(b)に示すように、噴射開始区間
が2箇所ある場合、上記次数nを1とすれば、最後の噴
射開始区間では、最新の気筒別要求噴射幅IJSEIn
の1/2に相当する有効噴射幅が設定される。As shown in FIG. 24 (b), when there are two injection start sections, if the order n is set to 1, in the last injection start section, the latest required injection width for each cylinder IJSEIn
Is set to an effective injection width corresponding to 1/2 of the above.
【0189】また、上記ステップS1212からステップS12
18へ進むと、現在の区間で噴射するかを上記ステップS1
213と同様、上記噴射開始区間設定フラグIJTMGF
の値を参照して判断し、現在の区間で噴射する場合、ス
テップS1219へ進み、また現在の区間で噴射しない場
合、ステップS1223へ進む。Further, the steps S1212 to S12
Proceed to step 18 to determine whether to inject in the current section.
213, the injection start section setting flag IJTMGF
Is determined with reference to the value of, and when the injection is performed in the current section, the process proceeds to step S1219, and when the injection is not performed in the current section, the process proceeds to step S1223.
【0190】そして、ステップS1219では、気筒別要求
噴射幅IJSEInから上記累積噴射幅TEIJBnを
減算した値をアキュムレータAに格納し、ステップS122
0で、このアキュムレータAの値で有効噴射幅TEIJ
Anを設定する。In step S1219, a value obtained by subtracting the cumulative injection width TEIJBn from the required injection width IJSEIn for each cylinder is stored in the accumulator A, and step S122 is performed.
When the value of the accumulator A is 0, the effective injection width TEIJ
Set An.
【0191】次いで、ステップS1221で累積噴射幅TE
IJBnを要求噴射幅IJSEInとして、ステップS1
222へ進む。すなわち、現在の区間が噴射終了区間であ
り、これより後の区間では噴射しないため、このルーチ
ンにおいては累積噴射幅TEIJBnを要求噴射幅IJ
SEInと同一の値にする。その結果、例えば、1サイ
クル中1回噴射の場合には,TEIJBn=0であるた
めTEIJAn=IJSEInとなる。そして、次回の
噴射開始区間でのルーチン実行時には、TEIJBn=
IJSEIn=0となる。Next, in step S1221, the cumulative injection width TE
IJBn is set to the required injection width IJSEIn, and step S1
Proceed to 222. That is, the current section is the injection end section, and injection is not performed in the section after this. Therefore, in this routine, the cumulative injection width TEJBn is set to the required injection width IJ.
Make the same value as SEIn. As a result, for example, in the case of one injection in one cycle, TEIJBn = 0 and TEIJAn = IJSEIn. Then, when the routine is executed in the next injection start section, TEIJBn =
IJSEIn = 0.
【0192】そして、ステップS1222で噴射待ち設定フ
ラグFLG_IJをセットして噴射タイマセットマクロ
1を終了する。すなわち、このルーチンでは当該#n気
筒のサイクル中における最後の噴射であり、噴射待ち設
定フラグFLG_IJをセットすることで、後述する噴
射タイマセットマクロ2で設定される噴射終了時期を例
えば吸気行程直前の10°CAクラセンに合わせること
ができる。Then, in step S1222, the injection wait setting flag FLG_IJ is set, and the injection timer set macro 1 ends. That is, this routine is the last injection in the cycle of the #n cylinder, and by setting the injection wait setting flag FLG_IJ, the injection end timing set by the injection timer set macro 2 described later is set to, for example, immediately before the intake stroke. Can be adjusted to 10 ° CA class.
【0193】一方、上記ステップS1218からステップS12
23へ進むと、気筒別要求噴射幅IJSEInから上記ス
テップS1221で設定した累積噴射幅TEIJBnを減算
した値をアキュムレータAに格納する。On the other hand, steps S1218 to S12
In step 23, the accumulator A stores a value obtained by subtracting the cumulative injection width TEIJBn set in step S1221 from the required injection width IJSEIn for each cylinder.
【0194】そして、ステップS1224で上記アキュムレ
ータAの値を参照し、A<0、すなわち、運転条件が変
化して要求噴射量IJSEInが減少した場合、ステッ
プS1226へ進み、また、A≧0、すなわち、要求噴射量
IJSEInが増加したか或は変化していない場合、ス
テップS1225へ進む。燃料噴射幅がユーザ側ジョブにお
いて10ms毎に設定されるため、次のルーチン実行時
に読込む要求噴射幅IJSEInが前回のルーチン実行
時において読込んだ要求噴射幅IJSEInと相違して
いる場合、その差分を増量、或は減量することで、常に
最新の値で有効噴射幅TEIJAnを設定することがで
きるため運転条件の変化に対する追従性が良くなる。In step S1224, the value of the accumulator A is referred to. If A <0, that is, if the required injection amount IJSEIn decreases due to a change in the operating condition, the process proceeds to step S1226, and A ≧ 0, that is, A ≧ 0 If the required injection amount IJSEIn has increased or has not changed, the process proceeds to step S1225. Since the fuel injection width is set every 10 ms in the user side job, if the required injection width IJSEIn read at the time of executing the next routine is different from the required injection width IJSEIn read at the time of executing the previous routine, the difference is obtained. Is increased or decreased, the effective injection width TEIJAn can always be set with the latest value, so that the follow-up performance to changes in operating conditions is improved.
【0195】その後、上記ステップS1224からステップS
1225へ進むと、上記アキュムレータAの値と噴射幅の許
容変動値、例えば0.5msとを比較し、A>0.5m
sの場合ステップS1226へ進み、A≦0.5msの場合
には前記ステップS1214へ進み、有効噴射幅TEIJA
nをゼロにして当該#n気筒の噴射タイマセットマクロ
1を終了する。Thereafter, the steps S1224 to S
Proceeding to 1225, the value of the accumulator A is compared with an allowable variation value of the injection width, for example, 0.5 ms, and A> 0.5 m
In the case of s, the process proceeds to step S1226, and in the case of A ≦ 0.5 ms, the process proceeds to step S1214, and the effective injection width TEIJA
n is set to zero, and the injection timer set macro 1 for the #n cylinder is ended.
【0196】また、ステップS1224或はステップS1225か
らステップS1226へ進むと、有効噴射幅TEIJAnを
上記アキュムレータAの値(ステップS1224からの場合
は負の値)で設定し、ステップS1227で累積噴射幅TE
IJBnを上記要求噴射幅IJSEInとして、噴射タ
イマセットマクロ1を終了する。When the process proceeds from step S1224 or step S1225 to step S1226, the effective injection width TEIJAn is set to the value of the accumulator A (a negative value in the case of step S1224), and the cumulative injection width TE is set in step S1227.
With IJBn set to the required injection width IJSEIn, the injection timer set macro 1 ends.
【0197】上記噴射タイマセットサブルーチンにおけ
るステップS1108〜ステップS1111での噴射タイマセット
マクロ2は図15,図16に示す噴射タイマセットマク
ロ2を示すフローチャートにて実行される。尚、この噴
射タイマセットマクロ2のプログラムは上記噴射タイマ
セットマクロ1を示すフローチャートと同様に#1気筒
のタイマセットルーチンを基本プログラムとし、これを
#2〜#4気筒にも応用できるようにマクロ化したもの
である。The injection timer set macro 2 in steps S1108 to S1111 in the injection timer set subroutine is executed according to the flowchart shown in FIG. 15 and FIG. The program of the injection timer set macro 2 is based on the timer set routine of the # 1 cylinder as a basic program, similarly to the flowchart showing the injection timer set macro 1, and the macro is set so that it can be applied to the # 2 to # 4 cylinders. It is a thing.
【0198】まず、ステップS1300で噴射タイマの状態
から前回の噴射開始区間で設定した燃料の噴射状況を判
断し、今回の噴射開始区間においても継続して噴射中の
場合ステップS1301へ進み、噴射待ち状態が継続されて
いる場合ステップS1307へ進み、また、噴射が終了され
ている場合ステップS1312へ進む。First, in step S1300, the fuel injection status set in the previous injection start section is determined from the state of the injection timer, and if injection is continuing during the current injection start section, the flow advances to step S1301 to wait for injection. When the state is continued, the process proceeds to step S1307, and when the injection is completed, the process proceeds to step S1312.
【0199】継続して噴射中と判断されてステップS130
1へ進むと、停止中の噴射タイマの現状のタイマ値に、
当該#n気筒の前記噴射タイマセットマクロ1で設定し
た正或は負の値の有効噴射幅TEIJAn(ms)を加
算し、その値をアキュムレータAに格納する。従って、
前回のルーチンで一旦設定した噴射タイマの値がその後
の運転条件の変化に基づいて設定した最新の有効噴射幅
TEIJAnで修正されることになる。It is determined that the injection is continuing, and step S130 is performed.
When proceeding to 1, the current timer value of the stopped injection timer is
The positive or negative value effective injection width TEIJAn (ms) set by the injection timer set macro 1 of the #n cylinder is added, and the value is stored in the accumulator A. Therefore,
The value of the injection timer once set in the previous routine is corrected with the latest effective injection width TEIJAn set based on a change in the operating conditions thereafter.
【0200】次いで、ステップS1302で、上記キュムレ
ータAの値から処理時間(噴射タイマ停止から再セット
するまでの時間)を減算し、この減算した値をステップ
S1303で、ゼロから1サイクルの最大噴射量である2回
転時間の間にリミットし(0≦A<2回転時間、従っ
て、Aが負の場合にはA=0となる)、ステップS1304
で、現在噴射中であるためタイマ待ち時間を0とし、ス
テップS1305で噴射タイマのリロード値を上記アキュム
レータAの値で設定し、ステップS1306で上記リロード
値に対応する噴射パルスの出力パターンをタイマにセッ
トして当該#n気筒の噴射タイマセットマクロ2を終了
する。Next, in step S1302, the processing time (time from the stop of the injection timer to the resetting) is subtracted from the value of the accumulator A, and this subtracted value is used in step S1302.
In S1303, a limit is set between two rotation times, which is the maximum injection amount of one cycle from zero (0 ≦ A <2 rotation times, so that when A is negative, A = 0), and step S1304.
Then, since the injection is currently being performed, the timer waiting time is set to 0, the reload value of the injection timer is set by the value of the accumulator A in step S1305, and the output pattern of the injection pulse corresponding to the reload value is set to the timer in step S1306. Then, the injection timer set macro 2 for the #n cylinder is terminated.
【0201】その結果、1回噴射ではその噴射区間が過
ぎた後の区間で、複数回噴射では最後の噴射区間を過ぎ
た後の区間で、今回の区間で設定した有効噴射幅TEI
JAnが前回の区間で設定した値に比し、0.5ms以
上増加している場合には噴射タイマが延長され、また有
効噴射幅TEIJAnが減少している場合には、最後の
噴射区間の噴射タイマが短縮されて、1吸気行程中の気
筒に供給する噴射量の合計が調整される。As a result, in the single injection, the effective injection width TEI set in the present section is the section after the injection section, and in the multiple injection, the section after the last injection section.
If JAn is longer than the value set in the previous section by 0.5 ms or more, the injection timer is extended, and if the effective injection width TEIJAn is reduced, the injection in the last injection section is The timer is shortened, and the total injection amount supplied to the cylinder during one intake stroke is adjusted.
【0202】一方、上記ステップS1300で噴射待ち状態
が継続されていると判断されてステップS1307へ進む
と、噴射タイマにセットされているタイマリロード値
に、今回の区間で設定した正或は負の値の有効噴射幅T
EIJAnを加算して、その値をアキュムレータAに格
納し、ステップS1308で、上記アキュムレータAの値
を、ゼロから1サイクルの最大噴射量である2回転時間
にリミットし(0≦A<2回転時間)、ステップS1309
で直ちに噴射を行うべくタイマ待ち時間を0として、ス
テップS1310でタイマリロード値を上記アキュムレータ
Aに格納されている値で設定し、ステップS1311で上記
タイマリロード値に対応する噴射パルスの出力パターン
をタイマにセットして当該#n気筒の噴射タイマセット
マクロ2を終了する。On the other hand, if it is determined in step S1300 that the injection waiting state is continued, and the flow advances to step S1307, the timer reload value set in the injection timer is set to the positive or negative value set in the present section. Value effective injection width T
EIJAn is added, and the value is stored in accumulator A. In step S1308, the value of accumulator A is limited from zero to two rotation times, which is the maximum injection amount in one cycle (0 ≦ A <2 rotation times). ), Step S1309
In step S1310, the timer wait time is set to 0 to immediately perform injection, the timer reload value is set to the value stored in the accumulator A, and the output pattern of the injection pulse corresponding to the timer reload value is set in step S1311. To terminate the injection timer set macro 2 for the #n cylinder.
【0203】上記タイマ待ち時間は、噴射終了時期を調
整するために、後述するステップS1325で設定されるも
のであるが、前回の噴射開始区間で設定された待ち時間
が今回の噴射開始区間においても依然と計時されている
場合には、タイマ待ち時間が異常に長いので、上記ステ
ップS1309でゼロにし、今回の噴射開始区間で直ちに噴
射を開始し、1吸気行程中に供給する噴射量を調整す
る。The timer waiting time is set in step S1325, which will be described later, in order to adjust the injection end timing. However, the waiting time set in the previous injection start section is also used in the current injection start section. If the time is still measured, the timer wait time is abnormally long, so the value is set to zero in step S1309, the injection is started immediately in the current injection start section, and the injection amount supplied during one intake stroke is adjusted. .
【0204】また、上記ステップS1300で前回の噴射開
始区間での噴射が既に終了していると判断して、ステッ
プS1312へ進むとアキュムレータAに有効噴射幅TEI
JAnを格納し、ステップS1313で、このアキュムレー
タAの値が正か負あるいはゼロかを判断し、A≦0場合
ステップS1314へ進み、また、A>0の場合ステップS13
18へ分岐する。Also, in step S1300, it is determined that the injection in the previous injection start section has already been completed, and when the flow proceeds to step S1312, the effective injection width TEI is stored in accumulator A.
JAn is stored. In step S1313, it is determined whether the value of the accumulator A is positive, negative, or zero. If A ≦ 0, the process proceeds to step S1314. If A> 0, the process proceeds to step S13.
Branch to 18.
【0205】ステップS1314では、有効噴射幅TEIJ
Anが増加してしないので1サイクル中の噴射を終了さ
せるため、噴射待ち設定フラグFLG_IJをクリア
し、ステップS1315でタイマ待ち時間をゼロとし、ステ
ップS1316で噴射タイマのリロード値をゼロとし、ステ
ップS1317で出力パターンをゼロとして当該#n気筒の
噴射タイマセットマクロ2を終了する。In step S1314, the effective injection width TEIJ
In order to end the injection in one cycle since An has not increased, the injection wait setting flag FLG_IJ is cleared, the timer wait time is set to zero in step S1315, the reload value of the injection timer is set to zero in step S1316, and step S1317 To set the output pattern to zero and terminate the injection timer set macro 2 for the #n cylinder.
【0206】また、上記ステップS1313で有効噴射幅T
EIJAnが正の場合には、噴射量の増加分を補償する
ためステップS1318で、上記アキュムレータAに、他の
制御ストラテジーで設定した気筒別の無駄時間TSIN
Jn(n=#1,#2,#3,#4)を加算し、ステッ
プS1319で上記アキュムレータAに格納されている値が
1サイクルの最大噴射量である2回転時間を越えている
場合、2回転時間にリミットし(A<2回転時間)、ス
テップS1320で噴射待ち設定フラグFLG_IJの値を
参照して噴射待ち状態ではないかを判断し、噴射待ち状
態ではない場合、すなわち、噴射待ち設定フラグFLG
_IJがクリアされている場合には、ステップS1321へ
進み、増量分を直ちに噴射させるべくタイマ待ち時間を
0として、ステップS1322でタイマリロード値を上記ア
キュムレータAの値(TEIJAn+TSINJn)で
設定し、ステップS1323で上記タイマリロード値に対応
する噴射パルスの出力パターンを噴射タイマにセットし
て当該#n気筒の噴射タイマセットマクロ2を終了す
る。Further, in the above step S1313, the effective injection width T
If EIJAn is positive, in step S1318, the accumulator A is provided with the dead time TSIN for each cylinder set by another control strategy to compensate for the increase in the injection amount.
Jn (n = # 1, # 2, # 3, # 4) is added, and in step S1319, if the value stored in the accumulator A exceeds the two rotation time, which is the maximum injection amount in one cycle, It is limited to two rotation times (A <2 rotation time), and in step S1320, it is determined whether or not the injection is in the injection waiting state by referring to the value of the injection waiting setting flag FLG_IJ. Flag FLG
If _IJ is cleared, the process proceeds to step S1321, the timer wait time is set to 0 in order to immediately inject the increased amount, and the timer reload value is set to the value of the accumulator A (TEIJAn + TSINJn) in step S1322, and step S1323 Then, the output pattern of the injection pulse corresponding to the timer reload value is set in the injection timer, and the injection timer set macro 2 for the #n cylinder is terminated.
【0207】一方、上記ステップS1320で噴射待ち状態
と判断されてステップS1324へ進むと、噴射待ち設定フ
ラグFLG_IJをクリアした後、ステップS1325で、
上記噴射開始時期算出ルーチンで設定した噴射開始遅れ
時間IJDELYでタイマ待ち時間を設定し、ステップ
S1326でタイマリロード値を上記アキュムレータAの値
で設定し、 ステップS1327で上記タイマリロード値に対
応する噴射パルスの出力パターンを噴射タイマにセット
して当該#n気筒の噴射タイマセットマクロ2を終了す
る。その結果、この噴射開始区間の始りから所定タイマ
待ち時間(IJDELY)後に燃料噴射が開始される。On the other hand, if it is determined in step S1320 that the injection is in the injection waiting state and the flow advances to step S1324, the injection waiting setting flag FLG_IJ is cleared, and in step S1325,
The timer wait time is set by the injection start delay time IJDELY set in the injection start timing calculation routine, and step
In step S1326, the timer reload value is set by the value of the accumulator A. In step S1327, the output pattern of the injection pulse corresponding to the timer reload value is set in the injection timer, and the injection timer set macro 2 for the #n cylinder is ended. . As a result, fuel injection is started after a predetermined timer waiting time (IJDELY) from the start of the injection start section.
【0208】以上の結果、図25に示すように、燃料噴
射開始時期の算出ルーチンで設定した噴射開始区間設定
フラグIJTMGFによるビット指定で、1サイクル中
の噴射回数を4回、3回、2回等、複数回に設定するこ
とができる。また、複数回噴射において、最終回以外の
有効噴射幅を要求噴射幅の1/4,1/2、あるいは1
/1等、任意に設定することができ、最終回噴射におい
て1サイクル中の噴射幅の合計が最新の要求噴射幅にな
るように調整することができる。さらに、最終回噴射の
噴射開始区間内で噴射が終了しない場合には、噴射タイ
マを延長し、また有効噴射幅が減少した場合には、噴射
タイマを短縮して加速増量等過渡時の追従性を良くす
る。As a result, as shown in FIG. 25, the number of injections in one cycle is set to four, three, and two by the bit designation by the injection start section setting flag IJTMGF set in the fuel injection start timing calculation routine. And so on. Further, in the multiple injections, the effective injection width other than the last injection is set to 1/4, 1/2, or 1 of the required injection width.
/ 1, etc., and can be adjusted so that the total of the injection widths in one cycle in the final injection becomes the latest required injection width. Furthermore, if the injection does not end within the injection start section of the final injection, the injection timer is extended, and if the effective injection width is reduced, the injection timer is shortened to follow up during transients such as acceleration increase. To improve.
【0209】なお、図25(b)は、4回噴射(IJT
MGF=128+32+8+2)で、1噴射当りの有効
噴射幅が要求噴射幅の1/4、同図(c)は、3回噴射
(IJTMGF=32+8+2に設定)で、1噴射当り
の有効噴射幅が要求噴射幅の1/4、同図(d)は、2
回噴射(IJTMGF=16+2に設定)で、1噴射当
りの有効噴射幅が要求噴射幅の1/1、同図(e)は、
2回噴射(IJTMGF=4+2に設定)で、1噴射当
りの有効噴射幅が要求噴射幅の1/1にそれぞれ設定し
た場合の例を示したものである。FIG. 25B shows four injections (IJT).
(MGF = 128 + 32 + 8 + 2), the effective injection width per injection is 1/4 of the required injection width, and FIG. 4C shows three injections (IJTMGF = 32 + 8 + 2), and the effective injection width per injection is required. 1/4 of the injection width, and FIG.
In the first injection (IJTMGF = 16 + 2), the effective injection width per injection is 1/1 of the required injection width, and FIG.
This is an example in which the effective injection width per one injection is set to 1/1 of the required injection width in two injections (IJTMGF = 4 + 2).
【0210】以上、本発明の一実施例について説明した
が、これに限定されず、多気筒エンジンであればよく、
また、水平対向エンジン以外のエンジンにも適用するこ
とができる。The embodiment of the present invention has been described above. However, the present invention is not limited to this.
Further, the present invention can be applied to engines other than the horizontally opposed engine.
【0211】[0211]
【発明の効果】以上説明したように本発明によれば、多
気筒エンジンの各気筒の1サイクルを8区間に区分し、
回転に同期する割込み処理では、現在の区間が指定され
た噴射開始区間かを判断して、噴射を開始すべきかを判
断するようにしたため、割込み処理の負担が軽減され、
高回転時であっても処理に余裕ができて、他の制御処理
に支障を来すことなく、良好な燃料噴射制御性を得るこ
とができるなど優れた効果か奏される。As described above, according to the present invention, one cycle of each cylinder of a multi-cylinder engine is divided into eight sections.
In the interrupt processing synchronized with the rotation, it is determined whether the current section is the designated injection start section and whether injection should be started is determined, so that the load of the interrupt processing is reduced,
Even when the engine is running at a high speed, there is an excellent effect such that a margin is provided for the processing, and good control of fuel injection can be obtained without hindering other control processing.
【図1】0.5ms毎の定期割込み処理を示すフローチ
ャートFIG. 1 is a flowchart showing a periodic interrupt process every 0.5 ms.
【図2】クラセン割込み処理を示すフローチャートFIG. 2 is a flowchart showing a class interrupt process;
【図3】ジョブ優先処理を示すフローチャートFIG. 3 is a flowchart illustrating job priority processing.
【図4】ジョブ実行サブルーチンを示すフローチャートFIG. 4 is a flowchart showing a job execution subroutine.
【図5】同上FIG. 5
【図6】同上FIG. 6
【図7】同上FIG. 7
【図8】クランク位置算出サブルーチンを示すフローチ
ャートFIG. 8 is a flowchart showing a crank position calculation subroutine.
【図9】CCAS・RCAS判別サブルーチンを示すフ
ローチャートFIG. 9 is a flowchart showing a CCAS / RCAS determination subroutine.
【図10】燃料噴射開始時期算出ルーチンを示すフロー
チャートFIG. 10 is a flowchart showing a fuel injection start timing calculation routine.
【図11】同上FIG. 11
【図12】噴射タイマセットサブルーチンを示すフロー
チャートFIG. 12 is a flowchart showing an injection timer setting subroutine.
【図13】噴射タイマセットマクロ1ルーチンを示すフ
ローチャートFIG. 13 is a flowchart showing an injection timer set macro 1 routine;
【図14】同上FIG. 14
【図15】噴射タイマセットマクロ2ルーチンを示すフ
ローチャートFIG. 15 is a flowchart showing an injection timer set macro 2 routine;
【図16】同上FIG. 16
【図17】ジョブの実行状態を示す説明図FIG. 17 is an explanatory diagram illustrating a job execution state.
【図18】ジョブフラグの説明図FIG. 18 is an explanatory diagram of a job flag.
【図19】ジョブ実行中フラグとオーバーラップカウン
タの変化を示す説明図FIG. 19 is an explanatory diagram showing changes in a job execution flag and an overlap counter.
【図20】システムシフトバッファの説明図FIG. 20 is an explanatory diagram of a system shift buffer.
【図21】クラセン間隔テーブルの説明図FIG. 21 is an explanatory diagram of a classen interval table.
【図22】気筒・クランク位置状態マップの説明図FIG. 22 is an explanatory diagram of a cylinder / crank position state map.
【図23】クランク位置、カム位置とクランク位置変
数、噴射開始区間テーブル及び気筒別行程順のタイムチ
ャートFIG. 23 is a time chart of a crank position, a cam position and a crank position variable, an injection start section table, and a stroke order for each cylinder.
【図24】噴射開始区間、及び噴射開始区間設定フラグ
の説明図FIG. 24 is an explanatory diagram of an injection start section and an injection start section setting flag.
【図25】噴射タイマコントロールを示すタイムチャー
トFIG. 25 is a time chart showing injection timer control.
【図26】エンジン系の概略構成図FIG. 26 is a schematic configuration diagram of an engine system.
【図27】クランクロータとクランク角センサの正面図FIG. 27 is a front view of a crank rotor and a crank angle sensor.
【図28】カムロータとカム角センサの正面図FIG. 28 is a front view of a cam rotor and a cam angle sensor.
【図29】電子制御系の回路構成図FIG. 29 is a circuit configuration diagram of an electronic control system.
1…エンジン 25…インジェクタ 39…クランク角センサ 41…カム角センサ 50…電子制御装置 ACAS…クランク総合位置変数 IJnTBL…噴射開始区間テーブル IJTMGF…噴射開始区間設定フラグ DESCRIPTION OF SYMBOLS 1 ... Engine 25 ... Injector 39 ... Crank angle sensor 41 ... Cam angle sensor 50 ... Electronic control unit ACAS ... Crank total position variable IJnTBL ... Injection start section table IJTMGF ... Injection start section setting flag
Claims (1)
ク位置区間を総合的に表すクランク総合位置変数をパラ
メータとして、各気筒毎に1サイクルを、吸気行程後
半、吸気行程前半、排気行程後半、排気行程前半、燃焼
行程後半、燃焼行程前半、圧縮行程後半、圧縮行程前半
の8区間に区分し、この各区間を固有の数値で表した各
気筒毎の噴射開始区間テーブルを備え、 設定された噴射開始セット時間を、予め設定された時間
周期で実行されるコンピュータ割込み処理により、上記
区間の起点クランク角を示すクランク角センサ信号入力
から該区間の終点クランク角を示すクランク角センサ信
号入力までの間隔時間で順次ゼロ或いは負になるまで減
算して、燃料噴射を行う噴射開始区間を特定し、該特定
された噴射開始区間を表す変数を噴射開始区間設定フラ
グにセットし、 クランク角センサ信号入力によるエンジン回転同期によ
り実行されるコンピュータ割込み処理により、現在の気
筒及びクランク位置を表す上記クランク位置総合変数に
より該当気筒の上記噴射開始区間テーブルを参照し、該
テーブル参照により得た数値により表される区間と上記
噴射開始区間設定フラグにセットされた変数により指定
されている区間とを比較して、これら両区間の一致によ
り燃料噴射開始区間を決定することを特徴とする多気筒
エンジンの気筒別噴射開始区間設定方法。 1. A cylinder-specific crank indicating a cylinder and a crank position.
Parameter of the overall crank position that comprehensively represents the
One cycle for each cylinder as a meter after the intake stroke
Half, first half of intake stroke, second half of exhaust stroke, first half of exhaust stroke, combustion
Second half of the stroke, first half of the combustion stroke, second half of the compression stroke, first half of the compression stroke
Are divided into eight sections, and each section is represented by a unique numerical value.
An injection start section table is provided for each cylinder, and the set injection start set time is set to a preset time.
The computer interrupt processing executed periodically
Crank angle sensor signal input indicating the starting crank angle of the section
From the crank angle sensor signal indicating the end crank angle of the section.
Decreases to zero or negative in the interval time until signal input
Calculation to determine an injection start section for performing fuel injection, and
Of the injection start section setting flag
And set the engine rotation synchronously by inputting the crank angle sensor signal.
Computer interrupt processing that is executed
The above crank position comprehensive variable representing cylinder and crank position
Referring to the injection start section table of the corresponding cylinder,
The interval represented by the numerical value obtained by referring to the table and the above
Specified by the variable set in the injection start section setting flag
Compared to the section that is
Multi-cylinder characterized by determining a fuel injection start section
How to set the injection start section for each cylinder of the engine.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16263893A JP3331237B2 (en) | 1993-06-30 | 1993-06-30 | Injection start section setting method for each cylinder of a multi-cylinder engine |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16263893A JP3331237B2 (en) | 1993-06-30 | 1993-06-30 | Injection start section setting method for each cylinder of a multi-cylinder engine |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0719099A JPH0719099A (en) | 1995-01-20 |
| JP3331237B2 true JP3331237B2 (en) | 2002-10-07 |
Family
ID=15758428
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP16263893A Expired - Fee Related JP3331237B2 (en) | 1993-06-30 | 1993-06-30 | Injection start section setting method for each cylinder of a multi-cylinder engine |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3331237B2 (en) |
-
1993
- 1993-06-30 JP JP16263893A patent/JP3331237B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0719099A (en) | 1995-01-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3331237B2 (en) | Injection start section setting method for each cylinder of a multi-cylinder engine | |
| JP3530549B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JP3555689B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JP4503744B2 (en) | Vehicle drive control method and system | |
| JP3530551B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JP3530550B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JPH07103052A (en) | Fuel injection control method for multicylinder engine | |
| JP3337149B2 (en) | Engine crank position determination method | |
| JPH0719100A (en) | Method for setting injection starting internal for each cylinder of multi-cylinder engine | |
| JP3294366B2 (en) | Method for discriminating energization state of ignition coil in engine ignition control | |
| JP3294365B2 (en) | Engine ignition control method | |
| JP3645576B2 (en) | Calculation method of engine rotation time | |
| JP3324818B2 (en) | How to use engine crank position information | |
| JP3455243B2 (en) | How to use analog / digital conversion results | |
| JP3384498B2 (en) | Method of eliminating processing delay in engine ignition control | |
| JPH06249053A (en) | Analog/digital conversion method | |
| JPH06257500A (en) | Grasping method for engine operation condition | |
| JP3442806B2 (en) | Job priority processing method | |
| JPH06257501A (en) | Engine half rotation time estimating method | |
| JPH06272651A (en) | Current-carrying sequence setting method in ignition control for engine | |
| JP3617847B2 (en) | How to integrate jobs | |
| JPH06257502A (en) | Calculation of engine speed | |
| JPH06249054A (en) | Method to read switch input data in vehicle control computer | |
| JPH06231004A (en) | Simulating method for analog/digital conversion | |
| JP3564146B2 (en) | Engine ignition timing learning control method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |