JPH0719100A - Method for setting injection starting internal for each cylinder of multi-cylinder engine - Google Patents

Method for setting injection starting internal for each cylinder of multi-cylinder engine

Info

Publication number
JPH0719100A
JPH0719100A JP16263993A JP16263993A JPH0719100A JP H0719100 A JPH0719100 A JP H0719100A JP 16263993 A JP16263993 A JP 16263993A JP 16263993 A JP16263993 A JP 16263993A JP H0719100 A JPH0719100 A JP H0719100A
Authority
JP
Japan
Prior art keywords
injection
job
cylinder
timer
bit
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.)
Pending
Application number
JP16263993A
Other languages
Japanese (ja)
Inventor
Masaru Kurihara
優 栗原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Subaru Corp
Original Assignee
Fuji Heavy Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Heavy Industries Ltd filed Critical Fuji Heavy Industries Ltd
Priority to JP16263993A priority Critical patent/JPH0719100A/en
Publication of JPH0719100A publication Critical patent/JPH0719100A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce a load of interruption process by dividing a single cycle of respective cylinders of a multi-cylinder engine into eight intervals, expressing these respective intervals by a bit 0 to a bit 7 as injection starting intervals, and setting the injection starting intervals of the respective cylinders in one or two more places according to the bit. CONSTITUTION:A single cycle of respective cylinders of a multicylinder engine is divided into eight intervals, and these respective intervals are expressed by a bit 0 to a bit 7 as injection starting intervals, and the bit corresponding to an injection starting interval setting flag IJTMGF is set in one or two more places, and the injection starting interval is specified. Whether or nor a present interval is a designated injection starting interval is deduced in interruption process carried out in synchronism with engine speed by making it correspond to the bit designated by the injection starting interval setting flag IJTMGF, and injection is started in the prescribed timing in the designated interval. Thereby, a load of the interruption process is reduced, and excellent controllability of fuel injection can be obtained.

Description

【発明の詳細な説明】Detailed Description of the Invention

【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 precision. As a result, the development of microcomputer software has become a major factor in the development of vehicle control systems.
Improving the efficiency of processing on control algorithms has become an important issue. Particularly, in recent engine control systems, the control content is complicated, and efficient utilization of the CPU is important for improving the engine controllability.

【0003】従来、上記マイクロコンピュータによるエ
ンジン制御システムにおける燃料の噴射開始時期は、例
えば特開昭61−160545号公報に開示されている
ように、一定クランク角毎に入力するクランクパルスを
カウントしてエンジンの回転角位置を検出し、その検出
値に基づいて設定するもの(いわゆる角度制御)、ある
いは所定クランク角度間で計時した間隔時間に基づき噴
射開始時期を設定するもの(いわゆる時間制御)などが
ある。
Conventionally, the fuel injection start timing in an engine control system using the above microcomputer is obtained by counting crank pulses input at constant crank angle intervals, as disclosed in, for example, Japanese Patent Application Laid-Open No. 61-160545. One that detects the rotational angle position of the engine and sets it based on the detected value (so-called angle control), or one that sets the injection start timing based on the interval time measured between predetermined crank angles (so-called time control), etc. is there.

【0004】[0004]

【発明が解決しようとする課題】ところで、多気筒エン
ジンにおいてシーケンシャル制御を行う場合、従来は、
吸気行程開始前何度から噴射開始せよと言う指示に従
い、エンジン回転に同期する割込み処理の中で現在のク
ランク角が吸気行程前何度かを演算し、この結果を指示
値と比較して噴射を開始すべきかの判定を全気筒につい
て繰返し行っている。
By the way, when performing sequential control in a multi-cylinder engine, conventionally,
In accordance with the instruction to start injection from before the start of the intake stroke, the current crank angle is calculated several times before the intake stroke in the interrupt process synchronized with the engine rotation, and the result is compared with the instruction value for injection. The determination as to whether to start is repeated for all cylinders.

【0005】また、噴射エンドを制御するエンジンで
は、現在のエンジン回転数から噴射終了時期を割出し、
この終了時期から噴射開始時期を逆算して求める手順を
上述したクランク角度毎の割込み処理中で行っている。
Further, in the engine for controlling the injection end, the injection end timing is calculated from the current engine speed,
The procedure for back-calculating the injection start timing from this end timing is performed during the above-described interrupt processing for each crank angle.

【0006】その結果、燃料噴射制御ではエンジン回転
に同期する割込み処理が複雑で重くなり、充分な噴射制
御を行うことができなかった。この問題は、1サイクル
中に複数回噴射を実行する制御系では特に顕著に現れ
る。
As a result, in the fuel injection control, the interrupt processing in synchronism with the engine rotation is complicated and heavy, and the injection control cannot be performed sufficiently. This problem is particularly remarkable in a control system that executes multiple injections in one cycle.

【0007】本発明は上記事情に鑑みてなされたもの
で、エンジン回転に同期して実行する割込み処理の負担
を軽減し、複数回噴射制御を実行する場合でも割込み処
理にかかる負担の少ない多気筒エンジンの気筒別噴射開
始区間設定方法を提供することを目的としている。
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, and multi-cylinder in which the load of interrupt processing is small even when injection control is performed a plurality of times. It is an object of the present invention to provide a method of setting an injection start section for each cylinder of an engine.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
本発明による多気筒エンジンの気筒別噴射開始区間設定
方法は、多気筒エンジンの各気筒の1サイクルを吸気行
程後半、吸気行程前半、排気行程後半、排気行程前半、
燃焼行程後半、燃焼行程前半、圧縮行程後半、圧縮行程
前半の8区間に区分し、この各区間を噴射開始区間とし
てビット0からビット7で表し、指示された1或は2箇
所以上のビットに基づいて各気筒の噴射開始区間を設定
するものである。
In order to achieve the above object, a method for setting an injection start section for each cylinder of a multi-cylinder engine according to the present invention is such that one cycle of each cylinder of the multi-cylinder engine is used in the latter half of the intake stroke, the first half of the intake stroke, and the exhaust gas. Second half of the stroke, first half of the exhaust stroke,
It is divided into 8 sections of the latter half of the combustion stroke, the first half of the combustion stroke, the latter half of the compression stroke, and the first half of the compression stroke. Each of these sections is represented by bit 0 to bit 7 as an injection start section, and is designated by one or more designated bits. The injection start section of each cylinder is set based on this.

【0009】[0009]

【作 用】本発明では、1サイクルを8区間に区分し、
この各区間をビット0からビット7に割当て、エンジン
回転に同期する割込み処理では、指示された1或は2箇
所以上のビットに基づき、現在の区間が指示された噴射
開始区間かを気筒毎に判断する。
[Operation] In the present invention, one cycle is divided into eight sections,
Each section is assigned to bit 0 to bit 7, and in the interrupt processing synchronized with the engine rotation, it is determined for each cylinder whether the current section is the designated injection start section based on the designated bit at one or two or more locations. to decide.

【0010】その結果、ビット0からビット7の任意の
ビット箇所をセット或はクリアするだけで噴射開始区間
を指定することができ、1サイクル中に複数回噴射を実
行する場合でも、割込み処理にかかる負担が軽減され
る。
As a result, the injection start section can be specified only by setting or clearing an arbitrary bit portion of bit 0 to bit 7, and even if the injection is executed a plurality of times in one cycle, the interrupt processing is performed. This burden is reduced.

【0011】[0011]

【実施例】以下、図面に基づいて本発明の実施例を説明
する。
Embodiments of the present invention will be described below with reference to the drawings.

【0012】図面は本発明の一実施例に係り、図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は電子制御系の
回路構成図である。
FIG. 1 relates to an embodiment of the present invention, and FIG. 1 is a flow chart showing a periodic interrupt process every 0.5 ms.
FIG. 2 is a flowchart showing Krasen interrupt processing, and FIG.
Is a flowchart showing a job priority process, FIGS. 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 discrimination subroutine, FIGS. 10 and 11 are flowcharts showing a fuel injection start timing calculation routine, FIG. 12 is a flowchart showing an injection timer setting subroutine, FIG. 13 and FIG.
4 is a flow chart showing the injection timer set macro 1 routine, FIG. 15 and FIG. 16 are flow charts showing the injection timer set macro 2 routine, FIG. 17 is an explanatory diagram showing a job execution state, FIG. 18 is an explanatory diagram of a job flag, FIG. 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 class interval table, and FIG.
24 is an explanatory view of a cylinder / crank position state map, FIG. 23 is a crank position, a cam position and a crank position variable, an injection start section table, and a time chart in the order of strokes by cylinder, FIG.
Is an explanatory view of an injection start section and an injection start section setting flag, FIG. 25 is a time chart showing injection timer control, FIG. 26 is a schematic configuration diagram of an engine system, FIG. 27 is a front view of a crank rotor and a crank angle sensor, and FIG. 28 is a front view of the cam rotor and the cam angle sensor, and FIG. 29 is a circuit configuration diagram of the electronic control system.

【0013】本実施例のエンジン制御システムでは、図
29に示すマイクロコンピュータを中核とした電子制御
装置(ECU)50によって図26に示すエンジン系が
制御され、燃料噴射制御、点火時期制御などが行われ
る。このECU50のマイクロコンピュータには、新し
い概念に基づくオペレーティングシステム(OS)が搭
載されており、このOSの管理下で、各制御ストラテジ
ーに基づく各ジョブが、それぞれの優先レベルに従って
実行される。
In the engine control system of this embodiment, the 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. Be seen. The microcomputer of the ECU 50 is equipped with an operating system (OS) based on a new concept, and under the control of this OS, each job based on each control strategy is executed according to each priority level.

【0014】まず、エンジン系の機器構成について説明
する。
First, the equipment configuration of the engine system will be described.

【0015】図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 is an engine (horizontally opposed four-cylinder engine in the present embodiment), # 1 and # 3 cylinders are on the right bank R side, and # 2 and # are on the left bank L side.
Equipped with 4 cylinders. Then, the intake ports 2a of the cylinder heads 2 provided on both the 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 attached to the upstream side of the throttle passage 5 via an intake pipe 6, and the air cleaner 7 is in communication with an air intake chamber 8 which is an intake port for intake air.

【0016】また、上記排気ポート2bにエキゾースト
マニホルド9を介して排気管10が連通され、この排気
管10に触媒コンバータ11が介装されてマフラ12に
連通されている。一方、上記スロットル通路5にスロッ
トルバルブ5aが設けられ、このスロットル通路5の直
上流の上記吸気管6にインタークーラ13が介装され、
さらに、上記吸気管6の上記エアクリーナ7の下流側に
レゾネータチャンバ14が介装されている。
An exhaust pipe 10 is connected to the exhaust port 2b via an exhaust manifold 9, and a catalytic converter 11 is connected to the exhaust pipe 10 and is connected to a muffler 12. On the other hand, a throttle valve 5a is provided in the throttle passage 5, and an intercooler 13 is provided in the intake pipe 6 immediately upstream of the throttle passage 5,
Further, a resonator chamber 14 is interposed downstream of the air cleaner 7 in the intake pipe 6.

【0017】また、上記レゾネータチャンバ14と上記
インテークマニホルド3とを連通して上記スロットルバ
ルブ5aの上流側と下流側とをバイパスするバイパス通
路15に、アイドルスピードコントロールバルブ(IS
CV)16が介装されている。さらに、このISCV1
6の直下流側に、吸気圧が負圧のとき開弁し、またター
ボチャージャ18によって過給されて吸気圧が正圧にな
ったとき閉弁するチェックバルブ17が介装されてい
る。
Further, an idle speed control valve (IS) is provided in a bypass passage 15 which connects the resonator chamber 14 and the intake manifold 3 and bypasses the upstream side and the downstream side of the throttle valve 5a.
CV) 16 is interposed. Furthermore, this ISCV1
A check valve 17 which is opened immediately downstream of 6 when the intake pressure is a negative pressure and which is closed when the intake pressure becomes a positive pressure by being supercharged by a turbocharger 18 is interposed.

【0018】上記ターボチャージャ18は、上記吸気管
6の上記レゾネータチャンバ14の下流側にコンプレッ
サが介装され、タービンが上記排気管10に介装されて
いる。さらに、上記ターボチャージャ18のタービンハ
ウジング流入口には、ウエストゲート弁19が介装さ
れ、このウエストゲート弁19には、ウエストゲート弁
作動用アクチュエータ20が連設されている。
In the turbocharger 18, a compressor is installed downstream of the resonator chamber 14 of the intake pipe 6, and a turbine is installed in the exhaust pipe 10. Further, a wastegate valve 19 is provided at the turbine housing inlet of the turbocharger 18, and a wastegate valve actuating actuator 20 is connected to the wastegate valve 19.

【0019】上記ウエストゲート弁作動用アクチュエー
タ20は、ダイヤフラムにより2室に仕切られ、一方が
ウエストゲート弁制御用デューティソレノイド弁21に
連通される圧力室を形成し、他方が上記ウエストゲート
弁19を閉方向に付勢するスプリングを収納したスプリ
ング室を形成している。
The waste gate valve actuating actuator 20 is partitioned into two chambers by a diaphragm, one of which forms a pressure chamber communicating with the waste gate valve controlling duty solenoid valve 21, and the other of which forms the waste gate valve 19. A spring chamber is formed that houses a spring that urges in the closing direction.

【0020】上記ウエストゲート弁制御用デューティソ
レノイド弁21は、上記レゾネータチャンバ14と上記
吸気管6の上記ターボチャージャ18のコンプレッサ下
流とを連通する通路に介装されており、ECU50から
出力される制御信号のデューティ比に応じて、上記レゾ
ネータチャンバ14側の圧力と上記コンプレッサ下流側
の圧力とを調圧し、上記ウエストゲート弁作動用アクチ
ュエータ20の圧力室に供給する。
The wastegate valve controlling duty solenoid valve 21 is provided in a passage that connects the resonator chamber 14 and the compressor downstream of the turbocharger 18 of the intake pipe 6, and is controlled by the ECU 50. The pressure on the resonator chamber 14 side and the pressure on the compressor downstream side are adjusted according to the duty ratio of the signal, and the pressure is supplied to the pressure chamber of the waste gate valve operating actuator 20.

【0021】すなわち、上記ECU50によって上記ウ
エストゲート弁制御用デューティソレノイド弁21を制
御し、上記ウエストゲート弁作動用アクチュエータ20
を作動させて上記ウエストゲート弁19による排気ガス
リリーフを調整することにより、上記ターボチャージャ
18による過給圧を制御するようになっている。
That is, the wastegate valve controlling duty solenoid valve 21 is controlled by the ECU 50, and the wastegate valve operating actuator 20 is controlled.
Is operated to adjust the exhaust gas relief by the waste gate valve 19, so that the supercharging pressure by the turbocharger 18 is controlled.

【0022】また、上記インテークマニホルド3に絶対
圧センサ22が通路23を介して連通され、この通路2
3に、上記絶対圧センサ22と上記インテークマニホル
ド3或は大気とを選択的に連通する吸気管圧力/大気圧
切換ソレノイド弁24が介装されている。
An absolute pressure sensor 22 is connected to the intake manifold 3 through a passage 23, and the passage 2
3, an intake pipe pressure / atmospheric pressure switching solenoid valve 24 that selectively communicates the absolute pressure sensor 22 with the intake manifold 3 or the atmosphere is interposed.

【0023】さらに、上記インテークマニホルド3の各
気筒の各吸気ポート2aの直上流側にインジェクタ25
が臨まされ、また、上記シリンダヘッド2の各気筒毎
に、その先端を燃焼室に露呈する点火プラグ26aが取
付けられ、この点火プラグ26aに連設された点火コイ
ル26bにイグナイタ27が接続されている。
Further, an injector 25 is provided 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. There is.

【0024】上記インジェクタ25には、燃料タンク2
8内に設けたインタンク式の燃料ポンプ29から燃料フ
ィルタ30を経て燃料が圧送され、プレッシャレギュレ
ータ31にて調圧される。
The injector 25 includes a fuel tank 2
Fuel is pressure-fed from an in-tank type fuel pump 29 provided inside 8 through a fuel filter 30, and the pressure is regulated by a pressure regulator 31.

【0025】また、上記吸気管6の上記エアークリーナ
7の直下流に吸入空気量センサ32が介装され、上記ス
ロットルバルブ5aに、スロットル開度センサ33aと
アイドルスイッチ33bとを内蔵したスロットルセンサ
33が連設されている。
An intake air amount sensor 32 is provided in the intake pipe 6 immediately downstream of the air cleaner 7, and a throttle sensor 33 having a throttle opening sensor 33a and an idle switch 33b built in the throttle valve 5a. Are lined up.

【0026】さらに、上記エンジン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 which connects the left and right banks of the cylinder block 1a to the exhaust pipe 10. O2 at the collecting part of the above exhaust manifold 9
The sensor 37 is exposed.

【0027】また、上記シリンダブロック1aに支承さ
れたクランクシャフト1bにクランクロータ38が軸着
され、このクランクロータ38の外周に、電磁ピックア
ップなどからなるクランク角センサ39が対設されてい
る。さらに、上記エンジン1のカムシャフト1cに連設
するカムロータ40に、電磁ピックアップなどからなる
気筒判別用のカム角センサ41が対設されている。尚、
上記クランク角センサ39及び上記カム角センサ41
は、電磁ピックアップなどの磁気センサに限らず、光セ
ンサなどでも良い。
A crank rotor 38 is rotatably mounted on the crank shaft 1b supported by the cylinder block 1a, and a crank angle sensor 39 including an electromagnetic pickup is provided on the outer periphery of the crank rotor 38. Further, a cam angle sensor 41 for discriminating a cylinder, which is composed of an electromagnetic pickup or the like, is provided opposite to a cam rotor 40 connected to the cam shaft 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.

【0028】上記クランクロータ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 protrusions 38a, 38b and 38c formed on the outer periphery thereof, and these protrusions 38a, 38b and 38c are associated with respective cylinders (# 1, # 2 and # 2). Before # 3, # 4 compression top dead center (BTD
C) It is formed at the positions of θ1, θ2, and θ3. In this embodiment, θ1 = 97 ° CA, θ2 = 65 ° CA,
θ3 = 10 ° CA.

【0029】上記クランクロータ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, and as shown in FIG. 23, a crank angle signal (class signal) of BTDC 97 °, 65 °, 10 ° CA is 1/2 revolution of the engine. Every (18
Output every 0 ° CA). Then, the input interval time of each signal is counted 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 at the start-time injection start timing and a crank angle indicating a fixed ignition timing at the start.

【0030】また、図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である。
Further, as shown in FIG. 28, on the outer periphery of the cam rotor 40, there are projections 40a, 40b for cylinder discrimination,
40c is formed, and the protrusion 40a is formed at the position after compression top dead center (ATDC) θ4 of the # 3 and # 4 cylinders.
b is composed of three protrusions, and the first protrusion is A for cylinder # 1.
It is formed at the position of TDCθ5. Furthermore, the protrusion 40
c is formed by two protrusions, and the first protrusion is A for cylinder # 2.
It is formed at the position of TCDθ6. In this embodiment, θ4 = 20 ° CA, θ5 = 5 ° CA, θ6 = 2
It is 0 ° CA.

【0031】そして、上記カムロータ40の各突起が上
記カム角センサ41によって検出され、各気筒の燃焼行
程順を#1→#3→#2→#4とした場合、この燃焼行
程順と、上記カム角センサ41の検出信号をカウンタに
よって計数した値とのパターン(図23のタイムチャー
ト参照)に基づいて、気筒判別がなされる。
When each projection of the cam rotor 40 is detected by the cam angle sensor 41 and the combustion stroke sequence of each cylinder is # 1 → # 3 → # 2 → # 4, this combustion stroke sequence and Cylinder discrimination is performed based on a pattern (see the time chart of FIG. 23) of the detection signal of the cam angle sensor 41 and the value counted by the counter.

【0032】一方、図29に示すように、ECU50
は、燃料噴射制御、点火時期制御などを行なうメインコ
ンピュータ51と、ノック検出処理を行なう専用のサブ
コンピュータ52との2つのコンピュータを中心として
構成され、各部に所定の安定化電源を供給する定電圧回
路53や各種の周辺回路が組込まれている。
On the other hand, as shown in FIG. 29, the ECU 50
Is mainly composed of two computers, a main computer 51 for performing fuel injection control, ignition timing control, and the like, and a dedicated sub computer 52 for performing knock detection processing. A constant voltage that supplies a predetermined stabilizing power source to each part. The circuit 53 and various peripheral circuits are incorporated.

【0033】上記定電圧回路53は、ECUリレー54
のリレー接点を介してバッテリ55に接続され、このバ
ッテリ55に、上記ECUリレー54のリレーコイルが
イグニッションスイッチ56を介して接続されている。
また、上記バッテリ55には、上記定電圧回路53が直
接接続され、さらに、燃料ポンプリレー57のリレー接
点を介して燃料ポンプ29が接続されている。
The constant voltage circuit 53 includes an ECU relay 54.
The relay coil of the ECU relay 54 is connected to the battery 55 via an ignition switch 56.
Further, the constant voltage circuit 53 is directly connected to the battery 55, and further, the fuel pump 29 is connected via a relay contact of a fuel pump relay 57.

【0034】すなわち、上記定電圧回路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.
Supply the power for backup when

【0035】上記メインコンピュータ51は、CPU5
8(以下、メインCPU58と称する)、ROM59、
RAM60、上記イグニッションスイッチ56がOFF
されたときにも上記定電圧回路53からバックアップ電
源が供給されてデータを保持するバックアップRAM6
1、カウンタ・タイマ群62、シリアル通信インターフ
ェースであるSCI63、及び、I/Oインターフェー
ス64がバスライン65を介して接続されたマイクロコ
ンピュータである。
The main computer 51 has a CPU 5
8 (hereinafter, referred to as main CPU 58), ROM 59,
RAM 60, the ignition switch 56 is OFF
Backup RAM 6 which holds data by being supplied with backup power from the constant voltage circuit 53 even when
1, a counter / timer group 62, a serial communication interface SCI 63, and an I / O interface 64 are connected to each other via a bus line 65.

【0036】尚、上記カウンタ・タイマ群62は、フリ
ーランニングカウンタ、カム角センサ(以下、適宜、カ
ムセンと略記する)信号の入力計数用カムセンカウンタ
などの各種カウンタ、噴射タイマ、点火タイマ、後述す
る0.5ms毎の定期割込みを発生させるための定期割
込みタイマ、クランク角センサ(以下、適宜、クラセン
と略記する)信号の入力間隔計時用クラセンタイマ、及
び、システム異常監視用のウオッチドッグタイマなどの
各種タイマを便宜上総称するものであり、上記メインコ
ンピュータ51においては、その他、各種のソフトウエ
アカウンタ・タイマが用いられる。
The counter / timer group 62 includes various counters such as a free-running counter, a cam angle counter (hereinafter, abbreviated as "CamSen") signal counting counter, an injection timer, an ignition timer, and the like. A periodic interrupt timer for generating a periodic interrupt every 0.5 ms, a crank angle sensor (hereinafter, abbreviated as "classen") signal input interval timing classen timer, and a watchdog timer for system abnormality monitoring, etc. The various timers are collectively referred to for convenience, and other various software counters and timers are used in the main computer 51.

【0037】また、上記サブコンピュータ52も、上記
メインコンピュータ51と同様、CPU71(以下、サ
ブCPU71と称する)、ROM72、RAM73、カ
ウンタ・タイマ群74、SCI75、及び、I/Oイン
ターフェース76がバスライン77を介して接続された
マイクロコンピュータであり、上記メインコンピュータ
51とサブコンピュータ52とは、上記SCI63,7
5を介してシリアル通信ラインにより互いに接続されて
いる。
In the sub computer 52, the CPU 71 (hereinafter referred to as the sub CPU 71), the ROM 72, the RAM 73, the counter / timer group 74, the SCI 75, and the I / O interface 76 are also connected to the bus line as in the main computer 51. The microcomputer is a microcomputer connected via 77, and the main computer 51 and the sub computer 52 are the SCI 63, 7
They are connected to each other via a serial communication line via 5.

【0038】上記メインコンピュータ51のI/Oイン
ターフェース64には、入力ポートに、吸入空気量セン
サ32、スロットル開度センサ33a、水温センサ3
6、O2 センサ37、絶対圧センサ22、車速センサ4
2、及び、バッテリ55が、8チャンネル入力のA/D
変換器66を介して接続されるとともに、アイドルスイ
ッチ33b、クランク角センサ39、カム角センサ41
が接続されており、さらに、始動状態を検出するために
スタータスイッチ43が接続されている。
The I / O interface 64 of the main computer 51 has an intake port, an intake air amount sensor 32, a throttle opening sensor 33a, and a water temperature sensor 3 at its input ports.
6, O2 sensor 37, absolute pressure sensor 22, vehicle speed sensor 4
2 and battery 55 are A / D of 8 channel input
The idle switch 33b, the crank angle sensor 39, and the cam angle sensor 41 are connected together via the converter 66.
Is connected, and further, a starter switch 43 is connected to detect the starting state.

【0039】尚、本実施例においては、上記A/D変換
器66は、7チャンネル分の入力が使用され、残りの1
チャンネルは予備となっている。
In this embodiment, the A / D converter 66 uses inputs for 7 channels, and the remaining 1
The channel is reserved.

【0040】また、上記I/Oインターフェース64の
出力ポートには、イグナイタ27が接続され、さらに、
駆動回路67を介して、ISCV16、インジェクタ2
5、燃料ポンプリレー57のリレーコイル、および、ウ
エストゲート弁制御用デューティソレノイド弁21、吸
気管圧力/大気圧切換ソレノイド弁24が接続されてい
る。
An igniter 27 is connected to the output port of the I / O interface 64, and further,
Through the drive circuit 67, the ISCV16, the injector 2
5, the relay coil of the fuel pump relay 57, the waste solenoid valve controlling duty solenoid valve 21, and the intake pipe pressure / atmospheric pressure switching solenoid valve 24 are connected.

【0041】一方、上記サブコンピュータ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 sub computer 52
The interface 76 has an input port to which the crank angle sensor 39 and the cam angle sensor 41 are connected, and
The knock sensor 34 is connected via the D / D converter 78, the frequency filter 79, and the amplifier 80. The knock detection signal from the knock sensor 34 is amplified to a predetermined level by the amplifier 80, and then the frequency filter 79. The necessary frequency components are extracted by the A / D converter 78.
At, it is converted into a digital signal and input.

【0042】上記メインコンピュータ51では、各セン
サ類からの検出信号を処理し、燃料噴射パルス幅、点火
時期などを演算する。すなわち、吸入空気量センサ32
の出力信号から吸入空気量を算出し、RAM60及びバ
ックアップRAM61に記憶されている各種データに基
づき、吸入空気量に見合った燃料噴射量を演算し、ま
た、点火時期などを算出する。
The main computer 51 processes the detection signals from the sensors and calculates the fuel injection pulse width, the ignition timing and the like. That is, the intake air amount sensor 32
The intake air amount is calculated from the output signal, and the fuel injection amount corresponding to the intake air amount is calculated based on various data stored in the RAM 60 and the backup RAM 61, and the ignition timing and the like are calculated.

【0043】そして、上記燃料噴射量に相応する駆動パ
ルス幅信号を、駆動回路67を介して所定のタイミング
で該当気筒のインジェクタ25に出力して燃料を噴射
し、また、所定のタイミングでイグナイタ27に点火信
号を出力し、該当気筒の点火プラグ26aを点火する。
Then, a drive pulse width signal corresponding to the 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 at the predetermined timing, the igniter 27 is also used. To the ignition plug 26a of the corresponding cylinder.

【0044】その結果、該当気筒に供給された混合気が
爆発燃焼し、エキゾーストマニホルド9の集合部に臨ま
されたO2 センサ37により排気ガス中の酸素濃度が検
出され、この検出信号が波形整形された後、上記メイン
CPU58で基準値(スライスレベル)と比較され、エ
ンジンの空燃比状態が目標空燃比に対し、リッチ側にあ
るか、リーン側にあるかが判別され、空燃比が目標空燃
比となるようフィードバック制御される。
As a result, the air-fuel mixture supplied to the corresponding cylinder explodes and burns, the oxygen concentration in the exhaust gas is detected by the O 2 sensor 37 facing the collecting portion of the exhaust manifold 9, and the waveform of this detection signal is shaped. After that, the main CPU 58 compares it with a reference value (slice level) to determine whether the air-fuel ratio state of the engine is on the rich side or the lean side with respect to the target air-fuel ratio, and the air-fuel ratio is set to the target air-fuel ratio. Feedback control is performed so that

【0045】一方、上記サブコンピュータ52では、エ
ンジン回転数とエンジン負荷とに基づいてノックセンサ
34からの信号のサンプル区間を設定し、このサンプル
区間でノックセンサ34からの信号を高速にA/D変換
して振動波形を忠実にデジタルデータに変換し、ノック
発生の有無を判定する。
On the other hand, in the sub computer 52, a sample section of the signal from the knock sensor 34 is set based on the engine speed and the engine load, and the signal from the knock sensor 34 is A / D at high speed in this sample section. Then, the vibration waveform is faithfully converted into digital data to determine whether knock has occurred.

【0046】上記サブコンピュータ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, and the knock determination result of the sub computer 52 is I / O. It is output to the interface 76. Then, in the main computer 51, when the sub computer 52 outputs a determination result indicating that knock has occurred, the knock data is read from the serial communication line via the SCI 63, and the ignition timing of the corresponding cylinder is immediately read based on the knock data. Delay and avoid knocks.

【0047】このようなエンジン制御において、上記メ
インコンピュータ51では、各センサ類からの信号入力
処理、エンジン回転数算出、吸入空気量算出、燃料噴射
量算出、点火時期算出といった各項目毎の各種プログラ
ムが、一つのOSの管理下で効率的に実行される。この
OSは、車輌制御のための各種マネジメント機能、及
び、このマネジメント機能に密着した内部ストラテジー
を有し、各種ジョブを体系的に結合する。
In such engine control, in the main computer 51, various programs for each item such as signal input processing from each sensor, engine speed calculation, intake air amount calculation, fuel injection amount calculation, ignition timing calculation, etc. Is efficiently executed under the control of one OS. This OS has various management functions for vehicle control and an internal strategy closely related to this management function, and systematically combines various jobs.

【0048】上記OSのマネジメント機能としては、 (1-1)ジョブの優先処理 (1ー2)セクション定義による各ジョブの分割ファイル対
応 (1-3)スタックの使用状況モニタ機能 (1-4)異常割込み動作のモニタ機能 (1-5)ジョブ毎に固有の制約を作らない標準マップ・標
準ワークメモリ設定などの機能があり、制御ストラテジ
ーの開発環境を向上させるとともに、限られたCPU能
力を最大限に発揮させ、デジタル制御理論の基本である
等時間間隔処理を可能な限り達成することができる。
As the management function of the OS, (1-1) priority processing of jobs (1-2) divided file support for each job by section definition (1-3) stack usage status monitoring function (1-4) Abnormal interrupt operation monitoring function (1-5) Functions such as standard map and standard work memory settings that do not create unique restrictions for each job improve the control strategy development environment and maximize the limited CPU power. The same time interval processing which is the basis of digital control theory can be achieved as much as possible.

【0049】等時間間隔処理としては、0.5ms毎の
定期割込みを基本として、2,4,10,50,250
ms毎の5種類の等間隔割込みジョブが用意されてお
り、また、エンジン回転に同期した処理として、クラン
ク角信号入力により即割込み実行される高優先クラセン
ジョブ(以下、単にクラセンジョブと称する)と、より
優先順位が高い他のジョブがないときにクランク角信号
入力により割込み実行される比較的緊急度の低い低優先
クラセンジョブとが用意されている。
As the equal time interval processing, 2, 4, 10, 50, 250 are based on a periodic interrupt every 0.5 ms.
Five types of equally interrupted jobs for every ms are prepared, and a high-priority class job (hereinafter simply referred to as classen job) that is immediately interrupted by crank angle signal input as processing synchronized with engine rotation. , A relatively low-urgency low-priority job that is interrupted by a crank angle signal input when there is no other job with a higher priority.

【0050】これらの各ジョブには、クラセンジョブ>
2msジョブ>4msジョブ>10msジョブ>低優先
クラセンジョブ>50msジョブ>250msジョブの
順で、7〜1の優先レベルが高位側から低位側に向かっ
て付けられており、図17に示すように、高速ジョブに
対し低速ジョブが分割して処理されるとともに、各ジョ
ブの多重待ち処理が行なわれる。
Each of these jobs includes a Krasen job>
A priority level of 7 to 1 is assigned from a high side to a low side in the order of 2 ms job> 4 ms job> 10 ms job> low priority class job> 50 ms job> 250 ms job, and as shown in FIG. The low-speed job is divided into the high-speed job and processed, and the multiplex waiting process of each job is performed.

【0051】また、上記OSの下で働く各プログラム
は、機能別の領域毎に順番に配列されており、各機能毎
にセクション宣言によって名前が付けられている。上記
OS下で働く数々のストラテジーファイル(ユーザ側フ
ァイル)は、各機能毎にOSと同じ名前のセクション宣
言を用いることにより、開発段階において、例えば、初
期値設定処理、10ms毎の処理、バックグランド処理
等を別々のファイルに記述しても、各ファイルがリンク
されたとき、同じ処理は連続した1つの領域に集めら
れ、OSと融合し一体となって動作する。
Each program operating under the OS is arranged in order for each function-specific area, and each function is named by a section declaration. The various strategy files (user files) that work under the OS use section declarations with the same name as the OS for each function, so that at the development stage, for example, initial value setting processing, 10 ms processing, background 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.

【0052】各ストラテジーファイル側で使用する主な
セクション領域は、 ○変数宣言領域 ○自己ファイル名、ファイル制作時の自動記録領域 ○セッティングデータ領域 ○クラセンジョブ領域 ○2msジョブ領域 ○4msジョブ領域 ○10msジョブ領域 ○低優先クラセンジョブ領域 ○50msジョブ領域 ○250msジョブ領域 ○リセット時初期化ジョブ領域 ○エンスト時初期化ジョブ領域 ○バックグランドジョブ領域 ○プログラム本体の領域 であり、機能毎にファイルを分割してプログラム開発が
可能になるとともに、プログラムの構造化記述を可能に
する。
The main section areas used on each strategy file side are: ○ variable declaration area ○ self file name, automatic recording area at file creation ○ setting data area ○ class job area ○ 2ms job area ○ 4ms job area ○ 10ms Job area ○ Low priority class job area ○ 50ms job area ○ 250ms job area ○ Reset initialization job area ○ Initialization job area at stall ○ Background job area ○ This is the area of the program body and divides the file for each function It enables program development and structured description of programs.

【0053】また、上記OSには、以上のマネジメント
機能に密着した内部ストラテジーとして、 (2-1)A/D変換処理 (2-2)クランク位置に係る各種情報の算出 (2-3)デバッグ用シミュレーション機能(エンジン回転
及びA/D変換) (2-4)点火タイマのセット (2-5)噴射タイマのセット などの機能を備えており、さらに、これらの機能に係る
各種サービスルーチンが各ジョブ中に用意されている。
Further, the above-mentioned OS has (2-1) A / D conversion processing (2-2) Calculation of various information related to crank position (2-3) Debug as an internal strategy closely related to the above management function. Simulation function (engine rotation and A / D conversion) (2-4) Ignition timer set (2-5) Injection timer set and other functions are provided, and various service routines related to these functions are provided. It is prepared in the job.

【0054】従来、このような機能は各ジョブレベルで
達成するようになっていたが、本システムにおいては、
すべてOS側に用意され、OS側で処理したA/D変換
結果、クランク位置情報、エンジン回転数などに基づい
て、ユーザ側の各ジョブで、燃料噴射量、点火時期など
を設定すると、これらの指示値がOSによって噴射タイ
マ、点火タイマにセットされるようになっている。
Conventionally, such a function has been achieved at each job level, but in this system,
If the fuel injection amount, ignition timing, etc. are set for each job on the user side based on the A / D conversion result processed by the OS side, crank position information, engine speed, etc. The instruction value is set by the OS in the injection timer and the ignition timer.

【0055】次に、上記メインコンピュータ51におけ
る燃料噴射制御の機能を、ジョブ処理の説明を基本とし
て、図1〜図16に示すフローチャートに従って説明す
る。尚、サブコンピュータ52はノック検出処理専用の
コンピュータであるため、その動作説明を省略する。
Next, the function of 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 description is omitted.

【0056】まず、イグニッションスイッチ56がON
されてシステムに電源が投入されると、リセットに伴う
リセット割込みが起動し、各種イニシャライズが行なわ
れるとともに、0.5ms毎に定期割込みを起動するた
めの定期割込みタイマが起動され、クランク角センサ3
9からの信号入力毎(BTDC97°,65°,10°
CA毎のエンジン1回転に6回)に起動されるクラセン
割込みが許可され、その後、バックグランドジョブの実
行状態となる。
First, the ignition switch 56 is turned on.
When the system is powered on, a reset interrupt associated with the reset is activated, various initializations are performed, and a periodic interrupt timer for activating the periodic interrupt is activated every 0.5 ms.
Each signal input from 9 (BTDC 97 °, 65 °, 10 °
The classen interrupt that is activated every six engine revolutions per CA) is permitted, and then the background job is executed.

【0057】そして、このバックグランドジョブの上
で、0.5ms毎の定期割込みと、エンジン1回転に6
回のクラセン割込みとにより、7レベルのジョブが優先
処理される。この2つの割込みにおいては、各自の処理
を実行後、共通のアドレスにジャンプし、ジョブ優先処
理を実行する。
Then, on this background job, a periodic interrupt every 0.5 ms and 6 times per engine revolution.
A job of the 7th level is preferentially processed by the number of classen interrupts. In these two interrupts, after executing their own processing, they jump to a common address and execute job priority processing.

【0058】尚、上記リセット割込みは、内部演算にお
いて0による除算を実行した場合や、無限ループが発生
した場合など、正常時には発生しない要因によっても、
起動される。
The reset interrupt may be caused by a factor that does not normally occur, such as when division by 0 is executed in an internal operation or when an infinite loop occurs.
Is activated.

【0059】まず、図1に示す0.5ms毎の定期割込
みについて説明する。この定期割込みでは、ステップS1
00で、OS用ワークエリアを設定し、ステップS101で、
ウオッチドッグタイマを初期化すると、ステップS102へ
進んで、P−RUNフラグを20回に1回すなわち10
ms毎に反転する。このP−RUNフラグは、図示しな
い保護回路によってシステムが自動的にリセットされな
いようにするためのフラグであり、システムが正常に動
作して一定時間毎(10ms毎)に反転される限り、上
記保護回路の作動が阻止される。
First, the periodic interrupt every 0.5 ms shown in FIG. 1 will be described. In this periodic interrupt, step S1
At 00, set the OS work area, 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), and is protected as long as the system operates normally and is inverted at regular time intervals (every 10 ms). The operation of the circuit is blocked.

【0060】次いで、ステップS103へ進み、スイッチ出
力の転写を行なう。このスイッチ出力は、各ジョブ中で
メモリに書き込んだビットのON,OFF値であり、各
ジョブからは直接I/Oインターフェース64の出力ポ
ートに出力せず、OS側で0.5ms毎にメモリの値を
出力ポートに転写する。
Next, in step S103, the switch output is transferred. This switch output is the ON / OFF value of the bit written in the memory in each job. It is not directly output from the output port of the I / O interface 64 from each job, but the OS outputs the memory every 0.5 ms. Transfer the value to the output port.

【0061】次に、ステップ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 related to A / D conversion, and in step S105 a job flag creation subroutine is executed to set 2, 4, 10 After creating the job flag JB_FLG indicating each job interruption request every 50, 250 ms, the A / D conversion is started in step S106.

【0062】上記A/D変換は、基本的に、A/D変換
器66の8チャンネル入力が0.5ms毎に所定の変換
順番毎に処理され、4ms周期で全入力の変換が行なわ
れる。但し、特定の1つのチャンネルは、回転脈動が発
生する吸入管圧力などをA/D変換するためクランク角
90°毎に(0.5msの時間精度で)同期し、変換順
番に対して割込んだ形で処理が行なわれ、その後の入力
の順番を1つ遅れにする。
In the A / D conversion, basically, the 8-channel input of the A / D converter 66 is processed every 0.5 ms in a predetermined conversion order, and all the inputs are converted in a cycle of 4 ms. However, one specific channel is synchronized at every crank angle of 90 ° (with time accuracy of 0.5 ms) for A / D conversion of suction pipe pressure that causes rotational pulsation, and interrupts the conversion order. The processing is performed in a dull shape, and the order of subsequent inputs is delayed by one.

【0063】尚、エンジン回転数3750rpm以上で
は、A/D変換の最後の順番の入力が完全に停止し、7
500rpm以上では、最後から2番目の入力も停止す
るが、A/D変換の順番は、スロットル開度、吸入空気
量など変化の速いものを先として、冷却水温、電圧など
比較的変化の遅いものが後になるように設定してあり、
且つ、最後のA/D変換順番をクランク同期入力に設定
してあるため、特に支障は生じない。
When the engine speed is 3750 rpm or more, the last input of A / D conversion is completely stopped, and
At 500 rpm or more, the penultimate input is also stopped, but the order of A / D conversion is that the throttle opening, intake air amount, etc. that have a fast change, and the cooling water temperature, voltage, etc., that have a relatively slow change. Is set so that
Moreover, since the last A / D conversion order is set to the crank synchronization input, no particular trouble occurs.

【0064】また、図18に示すように、上記ジョブフ
ラグJB_FLGは、1バイト変数の各ビットを各ジョ
ブに対応するフラグとして割当てたものであり、複数の
ジョブ要求が同時に可能なようになっている。この1バ
イト変数のビット1〜ビット7は優先レベル1〜7に対
応し、それぞれ、250msジョブ、50msジョブ、
低優先クラセンジョブ、10msジョブ、4msジョ
ブ、2msジョブ、クラセンジョブのフラグに割当てら
れている。そして、所定のビットが立てられたとき、対
応する優先レベルのジョブ割込み要求がなされる。尚、
ビット0はバックグランドジョブのフラグに割当てられ
て通常は参照されない。
Further, as shown in FIG. 18, the job flag JB_FLG is one in which each bit of the 1-byte variable is assigned as a flag corresponding to each job, and a plurality of job requests can be made simultaneously. There is. Bits 1 to 7 of this 1-byte variable correspond to priority levels 1 to 7, and are respectively 250 ms job, 50 ms job,
It is assigned to flags of low priority class job, 10 ms job, 4 ms job, 2 ms job, and class job. Then, when a predetermined bit is set, a job interruption request of a corresponding priority level is made. still,
Bit 0 is assigned to the flag of the background job and is not normally referred to.

【0065】そして、上記ステップS105でジョブフラグ
作成サブルーチンによりジョブフラグJB_FLGを作
成し、上記ステップS106でA/D変換をスタートした後
は、ステップS107へ進み、ジョブフラグJB_FLGの
いずれかのジョブに対応するビットが立っているか否か
を調べる。
Then, in step S105, the job flag JB_FLG is created by the job flag creation subroutine, and after A / D conversion is started in step S106, the process proceeds to step S107, and any job of the job flag JB_FLG is processed. Check whether the bit to be set is set.

【0066】その結果、ジョブフラグJB_FLGのビ
ットが一つも立っていないときには、どのジョブからも
要求がないため割込みを終了し、ジョブフラグJB_F
LGのいずれかのビットが立っているときには、ステッ
プS108へ進んで、現状レベル(この定期割込みが実行さ
れる時点で所定の優先レベルのジョブが実行されていた
状態)以下のフラグがないか否かを調べる。
As a result, when none of the bits of the job flag JB_FLG is set, there is no request from any job and the interrupt is ended.
If any bit of LG is set, the process proceeds to step S108, and there is no flag below the current level (a state in which a job of a predetermined priority level is being executed at the time when this periodic interrupt is executed). To find out.

【0067】上記ステップS108で、現状レベル以下のフ
ラグがないときには、ラベルWAR_JBで示される図
3のジョブ優先処理にジャンプし、現状レベル以下のフ
ラグがあるときには、ステップS109で、現状レベル以下
のレベルのオーバーラップカウンタOLCを1増加させ
る。
If there is no flag below the current level in step S108, the process jumps to the job priority process shown in label WAR_JB in FIG. 3, and if there is a flag below the current level, in step S109 the level below the current level is reached. The overlap counter OLC of is increased by one.

【0068】上記オーバーラップカウンタOLCは、ジ
ョブ要求を記憶するためのカウンタであり、各優先レベ
ル毎に1バイト割当てられ、上記ジョブフラグJB_F
LGによるジョブ要求時にインクリメント、ジョブ終了
時にデクリメントされる。すなわち、カウンタによって
ジョブ要求を記憶することによりジョブの多重要求に対
応することができるのである。
The overlap counter OLC is a counter for storing a job request, 1 byte is allocated to each priority level, and the job flag JB_F is set.
It is incremented when a job is requested by LG and decremented when the job is completed. That is, by storing the job request by the counter, it is possible to deal with the multiple job request.

【0069】次いで、上記ステップS109からステップS1
10へ進み、現状レベルより高いフラグがないか否かを調
べ、現状レベルより高いフラグがないときには、ルーチ
ンを抜けて割込みを終了し、現状レベルより高いフラグ
があるときには、ラベルWAR_JBのジョブ優先処理
へジャンプする。
Then, the above steps S109 to S1
Go 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, exit the routine and end the interrupt. If there is a flag higher than the current level, the job priority process of label WAR_JB is executed. Jump to.

【0070】一方、この0.5ms毎の定期割込みに対
し、図2のクラセンによる割込みでは、ステップS200
で、OS用ワークエリアを設定すると、ステップS201
で、後述するクランク位置算出のサブルーチンを実行
し、現在のクランク位置を判別するためのクランク位置
変数、及び、最新の3つのクラセン間隔の和であるエン
ジン半回転の経過時間すなわち半回転時間を算出する。
On the other hand, in contrast to the periodic interrupt every 0.5 ms, the interrupt by the classen in FIG.
Then, when the OS work area is set, step S201
Then, the crank position calculation subroutine to be described later is executed, and the 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, are calculated. To do.

【0071】上記クランク位置変数は、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
It is divided into 12 states by ° CA and represents the current crank position.

【0072】すなわち、各気筒毎に、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, the crank position information variable S_CC indicating the Krasen input order by the numerical value of 0, 1, 2
AS, # 1 cylinder is 0, # 3 cylinder is 1, # 2 cylinder is 2, #
Cylinder information variable S_ indicating the combustion order of cylinders with 4 cylinders as 3
RCAS and 3 of the total position variable S_ACAS that comprehensively represent the Krasen order and the cylinder order with numerical values of 0 to 11
The current crank position is represented by a variable, and when the crank position is normally determined with certainty, it is set to 0,
The estimated state where the determination result does not match and the anxiety remains 1,
An error level S_ECAS that sets the unknown state to 2 indicates the determination situation of the crank position. 23, S_ indicating a system variable is omitted.

【0073】次いで、上記ステップS201からステップS2
02へ進むと、クランク位置算出のサブルーチンにおいて
クランク位置判定が正常に終了したか或は判定不能であ
ったかを、アキュムレータAにストアされているコード
を読み出すことにより調べる(エラーコード1、正常終
了コード0)。
Next, from step S201 to step S2
When the process proceeds to 02, it is checked whether or not the crank position determination is normally completed or cannot be determined in the crank position calculation subroutine by reading the code stored in the accumulator A (error code 1, normal end code 0 ).

【0074】そして、上記ステップS202で、アキュムレ
ータAの値が1であり、クランク位置が判定不能であっ
たときには、割込みを終了し、アキュムレータAの値が
0であり、クランク位置が正常に判定されているときに
は、ステップS203へ進み、エンストフラグを解除する。
Then, in step S202, when the value of the accumulator A is 1 and the crank position cannot be determined, the interruption is ended, 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 cleared.

【0075】尚、上記エンストフラグは、エンジンがエ
ンスト状態であることを示すフラグであり、クラセン間
隔が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 processing routine prepared for a 50 ms job is provided. Is set by, and is cleared by this classen interrupt to release the stalled state.

【0076】次に、ステップS204へ進むと、点火タイマ
セットのサブルーチンを実行し、ユーザジョブ側で設定
した点火時期の指示値に基づいて作成された点火スケジ
ュールに従って点火タイマをセットする。この点火スケ
ジュールは、ドエル開始時期、ドエルオン待ち時間、ド
エルオフ待ち時間などをメンバーとする構造体変数であ
り、10msジョブ中に作成ルーチンが用意され、この
点火スケジュールに従って点火シーケンスが決定され
る。
Next, in step S204, the ignition timer setting subroutine is executed to set the ignition timer according to the ignition schedule created based on the instruction value of the ignition timing set by the user job. This ignition schedule is a structure variable having members such as dwell start timing, dwell on waiting time, and dwell off waiting time, and a preparation routine is prepared during a 10 ms job, and an ignition sequence is determined according to this ignition schedule.

【0077】次いで、ステップS205で、後述する噴射タ
イマセットサブルーチンを実行し、ユーザジョブ側で設
定した気筒毎の要求燃料噴射幅に対応する噴射時間を、
1回噴射或は複数回噴射に応じた1回当りの有効噴射幅
として算出し、噴射タイマにセットしてステップS206へ
進む。
Next, at step S205, an injection timer set subroutine 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 corresponding to single injection or multiple injections, is set in the injection timer, and the routine proceeds to step S206.

【0078】ステップ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 the own job level. If the current status is the level of the class job, the class job is executed in steps S207 and S208. ,
Overlap counter OLC for low priority class job
Is incremented by 1 to terminate the interruption, and when the current job level is not the level of the class job, it is checked in step S209 whether the current job level is the level of the low priority class job or more.

【0079】そして、現状のジョブレベルが低優先クラ
センジョブ以上であるときには、上記ステップS209から
ステップS210へ進んで、低優先クラセンジョブのオーバ
ーラップカウンタOLCを1増加させると、ステップS2
11で、クラセンジョブのジョブフラグをセットし、ラベ
ルWAR_JBのジョブ優先処理へジャンプする。
If the current job level is equal to or higher than the low-priority class job, the process proceeds from step S209 to step S210, and if the overlap counter OLC of the low-priority class job is incremented by 1, step S2
At 11, the job flag of the class job is set, and the process jumps to the job priority process of the label WAR_JB.

【0080】一方、上記ステップS209で、現状のジョブ
レベルが低優先クラセンジョブ以上でないときには、上
記ステップS209からステップS212へ進み、クラセンジョ
ブのジョブフラグをセットすると、ステップS213で、低
優先クラセンジョブのジョブフラグをセットし、ラベル
WAR_JBのジョブ優先処理へジャンプする。
On the other hand, if it is determined in step S209 that the current job level is not higher than the low priority class job, the process proceeds from step S209 to step S212 to set the job flag of the class job. The job flag is set, and the process jumps to the job priority process with the label WAR_JB.

【0081】図3に示すジョブ優先処理では、ステップ
S300で、ジョブの優先レベルを示す1バイト変数である
ジョブレベルJB_LEVを1つ上げると、ステップS3
01へ進んで、この優先レベルに対応するジョブフラグが
立っていないか調べる。そして、ジョブフラグが立って
いないときには、ステップS300へ戻ってさらにジョブレ
ベルJB_LEVを1つ上げ、ジョブフラグが立ってい
るときには、ステップS302へ進み、ジョブフラグの立っ
ているジョブのオーバーラップカウンタOLCを初期値
の0から1にし、ステップS303へ進む。
In the job priority processing shown in FIG.
If the job level JB_LEV, which is a 1-byte variable indicating the priority level of the job, is incremented by 1 in S300, step S3
Go to 01 and check if the 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, and if the job flag is set, the process proceeds to step S302 to set the overlap counter OLC of the job for which the job flag is set. The initial value is changed from 0 to 1, and the process proceeds to step S303.

【0082】ステップS303では、より上のジョブフラグ
があるか否かを調べ、より上のジョブがあるときには、
ステップS300へ戻って前述の処理を繰り返し、より上の
ジョブがないときには、ステップS304へ進んで、ジョブ
実行中フラグJB_RUNをセットすると、ステップS3
05で、後述するジョブ実行サブルーチンにより最上位の
ジョブを実行する。
In step S303, it is checked whether or not there is a higher job flag. When there is a higher job,
Returning to step S300, the above processing is repeated. If there is no higher job, the process proceeds to step S304 to set the job executing flag JB_RUN, and then step S3
At 05, the highest-level job is executed by the job execution subroutine described later.

【0083】上記ジョブ実行中フラグJB_RUNは、
ジョブの実行開始時にセットされ、終了時にクリアされ
るフラグであり、このフラグにより、処理の途中で、よ
り優先度の高いジョブによって割込まれたジョブを識別
することができる。
The job executing flag JB_RUN is
It is a flag that is set at the start of job execution and cleared at the end. By this flag, a job interrupted by a job with a higher priority can be identified during processing.

【0084】例えば、図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
When an interrupt request for a 2ms job with JB_LEV = 6 is made during execution of a 10ms job with V = 4, the processing of the 10ms job is interrupted, and the higher priority 2ms job is set to JB_RUN = 1 and OLC = 1. Is executed. Then, during the processing of this 2 ms job, JB_
When an interrupt request for a 4 ms job with LEV = 5 occurs,
This 4 ms job is set to JB_RUN = 0 and OLC = 1 to accept an interrupt, but is not executed and is in a standby state.

【0085】その後、ジョブ実行サブルーチンによるジ
ョブの実行が終了すると、上記ステップS305からステッ
プS306へ進んでオーバーラップカウンタOLCを1減ら
し、ステップS307で、オーバーラップカウンタOLCが
ゼロになったか否かを調べる。その結果、オーバラップ
カウンタOLCがゼロになっておらず、同じ優先レベル
でジョブ割込み要求が複数回あるときには、ステップS3
05へ戻ってジョブを繰返し実行し、オーバラップカウン
タOLCがゼロになったとき、ステップS307からステッ
プS308へ進んで、ジョブ実行中フラグJB_RUNをク
リアする。
After that, when the execution of the job by the job execution subroutine is completed, the process proceeds from step S305 to step S306, the overlap counter OLC is decremented by 1, and it is checked in step S307 whether the overlap counter OLC has become zero. . As a result, when the overlap counter OLC is not zero and there are multiple job interrupt requests at the same priority level, step S3
Returning to 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 executing flag JB_RUN.

【0086】次に、ステップS309へ進み、ジョブレベル
JB_LEVを1つ下げて次のジョブレベルに移ると、
ステップS310で、このジョブレベルJB_LEVがゼロ
になったか否かを調べる。そして、ジョブレベルJB_
LEVがゼロのときには、この割込みを終了し、ジョブ
レベルJB_LEVがゼロでないときには、ステップS3
11へ進んで、オーバーラップカウンタOLCがゼロか否
かを調べる。
Next, in step S309, when the job level JB_LEV is decreased by 1 and the job level is moved to the next job level,
In step S310, it is checked whether this job level JB_LEV has become zero. Then, the job level JB_
When LEV is zero, this interrupt is ended, and when job level JB_LEV is not zero, step S3
Proceed to 11 and check whether the overlap counter OLC is zero.

【0087】上記ステップS311で、オーバーラップカウ
ンタOLCがゼロのときには、このレベルではジョブ要
求はないため、上記ステップS311からステップS309へ戻
って、ジョブレベルJB_LEVをさらに1つ下げて同
様の処理を繰返し、オーバーラップカウンタOLCがゼ
ロでないときには、ステップS312へ進んで、このジョブ
レベルにおいて、ジョブ実行中フラグJB_RUNがセ
ットされているか否かを調べる。
When the overlap counter OLC is zero in step S311, there is no job request at this level. Therefore, the process returns from step S311 to step S309, the job level JB_LEV is further lowered by one, and the same processing is repeated. If the overlap counter OLC is not zero, the flow advances to step S312 to check if the job executing flag JB_RUN is set at this job level.

【0088】上記ステップS312で、ジョブ実行中フラグ
JB_RUNがセットされているときには、割込み前に
ジョブを実行中であったため、割込みを終了して割込み
前のジョブへ戻り、ジョブ実行中フラグJB_RUNが
セットされていなければ、ステップS304へ戻って、この
レベルのジョブを実行し、同様の処理を繰返す。
When the job executing flag JB_RUN is set in step S312, the job was being executed before the interruption, so the interruption is terminated and the process returns to the job before the interruption, and the job executing flag JB_RUN is set. If not, the process returns to step S304, the job of this level is executed, and the same processing is repeated.

【0089】すなわち、図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 ms 2ms job is completed, OLC = 0, JB_RU
When N = 0, the job level is lowered by 1 and JB_
4ms job with LEV = 5, JB_RUN = 0, OL
JB_RUN = 1 is set from the standby state of C = 1,
To be executed. Furthermore, when the 4ms job is completed, JB
Moving to _LEV = 4, the processing of the 10 ms job suspended by the 2 ms job and the 4 ms job is resumed from the state of JB_RUN = 1 (job is being executed).

【0090】このように、0.5ms毎の定期割込み、
クラセン割込みを基本タイミングとして、各ジョブの優
先レベル及び実行タイミングを知らせるジョブフラグJ
B_FLGを作成するため、可能な限り正確に、等時間
間隔処理、エンジン回転同期処理を実現し、各ジョブを
効率良く処理することができる。さらに、基本タイミン
グとなる各割込み毎に更新されるジョブフラグJB_F
LGによらず、オーバーラップカウンタOLCによって
ジョブの多重要求を記憶するため、あるジョブの処理時
間が長引き、再度、同じジョブを実行すべきタイミング
となった場合においても、処理を途中で放棄することな
く、可能な限り最後まで処理を継続することができる。
In this way, the periodic interrupt every 0.5 ms,
A job flag J for notifying the priority level and execution timing of each job with the classen interrupt as the basic timing.
Since 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, the job flag JB_F updated for each interrupt which is the basic timing
Since the overlap counter OLC stores the job multiplex request regardless of LG, even if the processing time of a certain job is prolonged and it is time to execute the same job again, the processing is abandoned midway. No, the process can be continued to the end as much as possible.

【0091】次に、図4〜図7のジョブ実行サブルーチ
ンについて説明する。
Next, the job execution subroutine of FIGS. 4 to 7 will be described.

【0092】まず、ステップS500で、ジョブフラグJB
_FLGを参照して実行すべきジョブがクラセンジョブ
でないか否かを調べ、クラセンジョブでないときには、
ラベルALJ10へ分岐し、クラセンジョブのときに
は、ステップS501へ進んで、気筒判別がついているか否
かを調べる。
First, in step S500, the job flag JB
By referring to _FLG, it is checked whether the job to be executed is not a class job. If it is not a class job,
The processing branches to label ALJ10, and if it is a class job, the process proceeds to step S501 to check whether or not cylinder discrimination is provided.

【0093】そして、気筒判別がついていないときに
は、そのままルーチンを抜けてジョブを実行せず、気筒
判別がついているとき、上記ステップS501からステップ
S502へ進んで、オーバーラップカウンタOLCの値を参
照して多重待ち状態であるか否かを調べる。
When the cylinder is not discriminated, the routine is not executed and the job is not executed. When the cylinder is discriminated, the steps from step S501 to step S501 are executed.
In step S502, the value of the overlap counter OLC is referenced to check whether or not the multiplex wait state is set.

【0094】上記ステップS502では、多重待ち状態でな
いとき、ステップS503へ進んで、クラセン割込み毎に算
出されるシステム変数S_ACAS(クランク総合位置
変数)をユーザ変数ACASとし、一方、多重待ち状態
のときには、ステップS504へ分岐し、ユーザ変数ACA
Sを一つ増やして12で割った剰余をとって新たなユー
ザ変数ACASとし、このユーザ変数ACASを0,
1,2,…11,0,1,…とソフトウエア的に更新し
てゆく。
In step S502, when the multiplex waiting state is not set, the process proceeds to step S503, and the system variable S_ACAS (crank total position variable) calculated for each classen interrupt is set as the user variable ACAS. On the other hand, in the multiplex waiting state, It branches to step S504, and user variable ACA
S is incremented by 1 and divided by 12, and the remainder is taken as a new user variable ACAS. This user variable ACAS is set to 0,
1, 2, ... 11, 0, 1, ... are updated by software.

【0095】すなわち、クラセンジョブ及び低優先クラ
センジョブは、自身または優先度の高いジョブに邪魔さ
れて遅れることがあるが、クラセン割込みは正確にクラ
ンク角センサ信号に同期して実行され、システム変数S
_ACASはジョブの遅れに関係なく更新される。
That is, the classen job and the low-priority classen job may be delayed by being disturbed by the job itself or the job of high priority, but 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.

【0096】従って、ジョブ中でシステム変数S_AC
ASを参照して気筒及びクランク位置に係る情報を知
り、この情報に応じた仕事を行なおうとしても、自身が
他のジョブに邪魔されて遅れた場合には、自身の仕事に
対応した気筒及びクランク位置に係る情報を知ることが
できなくなる。このため、クラセンジョブ及び低優先ク
ラセンジョブ中では、多重待ち状態でないときにOS用
のシステム変数S_ACASをユーザ用変数ACASと
して取込み、このユーザ変数ACASをジョブ実行毎に
更新して多重要求の場合にも、自身に対応した気筒及び
クランク位置に係る情報を得て適正な処理がなされるよ
うにするのである。
Therefore, in the job, the system variable S_AC
Even if the user knows the information about the cylinder and the crank position by referring to AS and tries to perform the work according to this information, if he / she is delayed by another job, the cylinder corresponding to his / her work And, it becomes impossible to know the information related to the crank position. Therefore, in the class job and the low-priority class job, the system variable S_ACAS for the OS is taken in as the user variable ACAS when not in the multiplex waiting state, and this user variable ACAS is updated for each job execution, and in the case of multiple request. Also, the information regarding the cylinder and crank position corresponding to itself is obtained so that appropriate processing can be performed.

【0097】その後、上記ステップS503或は上記ステッ
プS504からステップS505へ進み、ジョブのワークエリア
を設定すると、ステップS506で、レベルゼロの割込みを
許可し、ステップS507で、クラセンジョブのセクション
に移る。そして、このクラセンジョブセクションにリン
クされた処理を実行し、ステップS508で、割込みを禁止
してルーチンを抜ける。
After that, the process proceeds from step S503 or step S504 to step S505 to set the work area of the job. In step S506, the level 0 interrupt is permitted. In step S507, the classen job section is entered. Then, the processing linked to this class job section is executed, and in step S508, the interrupt is prohibited and the routine exits.

【0098】次に、ステップS500で、これから実行すべ
きジョブがクラセンジョブでないときには、ラベルAL
J10のステップS510で、2msジョブでないか否か調
べ、2msジョブのとき、ステップS511で、ジョブのワ
ークエリアを設定すると、ステップS512で、レベルゼロ
の割込みを許可し、ステップS513で、2msジョブのセ
クションに移る。そして、このセクションにリンクされ
ているジョブ本体(ユーザ側の制御ストラテジーに基づ
くルーチン、或は、OS側で用意したサービスルーチ
ン)を実行し、ステップS514で、割込みを禁止してルー
チンを抜ける。
Next, at 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 or not the job is a 2 ms job. When the job is a 2 ms job, the work area of the job is set in step S511. In step S512, the level 0 interrupt is permitted, and in step S513, the 2 ms job Go to section. Then, the main body of the job (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, interruption is prohibited and the routine exits.

【0099】一方、上記ステップ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 in step S510, the process branches from step S510 to step S520 to check whether the job to be executed is a 4 ms job. If it is not a 4 ms job, the process branches to label ALJ30. If it is a 4 ms job, the work area of the job is set in step S521, and the process proceeds to step S522. Note that this 4ms job is
A / D conversion use job, which uses A / D conversion data via a system shift buffer SSHB described later.

【0100】ステップS522では、レベルゼロの割込みを
許可し、次いで、ステップS523へ進むと、スイッチ入力
を読込み、ステップS524で、4msジョブのセクション
に移って、リンクされているジョブ本体を実行する。そ
の後、4msジョブのセクションから抜けると、ステッ
プS525で、割込みを禁止し、ステップS526へ進んで、シ
ステムシフトバッファSSHBをシフトしてルーチンを
抜ける。
In step S522, the interrupt of level zero is permitted, and then in step S523, the switch input is read, and in step S524, the section of the 4 ms job is moved to and the linked job main body is executed. After that, when the section of the 4 ms job is exited, the interrupt is prohibited in step S525, the process proceeds to step S526, the system shift buffer SSHB is shifted, and the routine exits.

【0101】上記システムシフトバッファ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 in which the respective A / D conversion results of 8 channels are stored
It consists of memories of Nos. 6, +24, +32, +34, +36, and +38, and a 1-word memory at the start offset address -2 where the A / D conversion result of crank synchronization at every 4 ms is stored. One A / D conversion result executed each time is stored in one word (2 bytes).

【0102】先頭オフセットアドレス0番地からは、4
段のシフトメモリとなっており、90°CA毎のA/D
変換結果がストアされ、最新4データ(1回転分)をジ
ョブから参照することができる。また、先頭オフセット
アドレス+32,+34,+36,+38番地は、各1
ワードのメモリであり、なまし処理機能が選択されたと
き、A/D変換結果を加重平均した値がストアされてノ
イズ除去と精度向上を図ることができるようになってお
り、これらのメモリのデータは、低速ジョブで利用でき
る。
From the start offset address 0, 4
It is a multi-stage shift memory, and A / D every 90 ° CA.
The conversion result is stored and the latest 4 data (1 rotation) can be referred to from the job. The head offset addresses +32, +34, +36, and +38 are each 1
This is a word memory, and when the smoothing function is selected, a weighted average value of the A / D conversion results is stored to enable noise removal and accuracy improvement. The data is available for slow jobs.

【0103】また、各先頭オフセットアドレス+8,+
16,+24番地からは、各4ワードのメモリであり、
4msジョブで利用するようになっている。これらの各
メモリは、最新のA/D変換結果が先頭から数えて、4
msジョブのオーバーラップカウンタOLCの値だけ後
のワードにストアされ、4msジョブ実行に際し、先頭
方向からデータが読出され、ジョブの終了に伴って、後
の各ワードのデータが順に先頭方向にシフトされるの
で、先にストアしたデータから読出されるFIFOバッ
ファとなっている。
Further, each head offset address + 8, +
From addresses 16 and 24, each is a 4-word memory,
It is designed to be used in 4ms jobs. In each of these memories, the latest A / D conversion result is counted from the beginning,
The value of the overlap counter OLC of the ms job is stored in the subsequent word, the data is read from the head direction when the 4 ms job is executed, and the data of each subsequent word is sequentially shifted to the head direction as the job ends. Therefore, it is a FIFO buffer that is read out from the data that has been stored previously.

【0104】すなわち、A/D変換は、0.5ms毎の
定期割込みにより4ms周期で正確に行なわれるが、4
msジョブは優先度の高いジョブに邪魔されて遅れるこ
とがある。従って、A/D変換の受渡しにFIFOバッ
ファを用い、4msジョブで+8〜,+16〜,+24
〜番地の各FIFOバッファのデータを参照後、上記ス
テップS526で、各FIFOバッファのデータを順にシフ
トするのである。
That is, the A / D conversion is accurately performed in a cycle of 4 ms by a periodic interrupt every 0.5 ms.
ms jobs may be delayed by being disturbed by higher priority jobs. 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 in the FIFO buffers at addresses, the data in the FIFO buffers are sequentially shifted in step S526.

【0105】一方、上記ステップS520で、実行すべきジ
ョブが4msジョブでなく、ラベルALJ30へ分岐し
たときには、ステップS530で、実行すべきジョブが10
msジョブか否かを調べ、10msジョブのとき、ステ
ップS531で、ジョブのワークエリアを設定し、ステップ
S532で、レベルゼロの割込みを許可すると、ステップS5
33で、10msジョブのセクションに移って、ジョブ本
体を実行し、ステップS534で割込みを禁止してルーチン
を抜ける。
On the other hand, when the job to be executed is not the 4 ms job in step S520 but branches to the label ALJ30, the job to be executed is 10 in step S530.
It is checked whether it is an ms job or not, and if it is a 10 ms job, the work area of the job is set in step S531, and the step
If the level 0 interrupt is enabled in S532, step S5
At 33, the section moves to the 10 ms job section, the job main body is executed, and at step S534, interruption is prohibited and the routine exits.

【0106】尚、上記10msジョブのセクションに
は、半回転時間からエンジン回転数を算出するサービス
ルーチン、前述した点火スケジュールを作成するサービ
スルーチンなどがOS側で用意されている。
In the 10 ms job section, a service routine for calculating the engine speed from the half rotation time, a service routine for creating the above-mentioned ignition schedule, etc. are prepared on the OS side.

【0107】また、上記ステップ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 process branches to step S540 to check whether the job to be executed is a low priority class job. If the job is not the low priority class job, the process branches from step S540 to the label ALJ50. If the job to be executed is the low priority class job, the process proceeds from step S540 to step S541, and the current state is the multiplex waiting state. Check if there is.

【0108】そして、現在の状態が多重待ち状態でない
ときには、上記ステップS541からステップS542へ進ん
で、システム変数S_ACAS(クランク総合位置変
数)をユーザ変数ACASとしてステップS544へ進み、
多重待ち状態のときには、上記ステップS541からステッ
プS543へ分岐し、ユーザ変数ACASを一つ増やして1
2で割った剰余をとった後、ステップS544へ進む。
When the current state is not the multiplex waiting state, the routine proceeds from step S541 to step S542 where the system variable S_ACAS (crank total position variable) is set as the user variable ACAS and the routine proceeds to step S544.
When in the multiplex waiting state, the process branches from step S541 to step S543, and the user variable ACAS is incremented by 1 to 1
After taking the remainder divided by 2, proceed to step S544.

【0109】ステップS544では、ジョブのワークエリア
を設定し、ステップS545で、レベルゼロの割込みを許可
すると、ステップS546で、低優先クラセンジョブのセク
ションに移り、ジョブ本体を実行した後、ステップS547
で割込みを禁止し、ルーチンを抜ける。
In step S544, the work area of the job is set, and in step S545, when the interrupt of level 0 is permitted, in step S546, the low priority class job is moved to the section, the job body is executed, and then step S547.
Disable the interrupt and exit the routine.

【0110】さらに、ラベルALJ50では、ステップ
S550で、実行すべきジョブが50msジョブであるか否
かを調べ、50msジョブのときには、ステップS551へ
進んでジョブのワークエリアを設定し、ステップS552へ
進む。
Further, in the label ALJ50, the step
In S550, it is checked whether or not 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 the work area of the job, and the process proceeds to step S552.

【0111】ステップS552では、レベルゼロの割込みを
許可すると、ステップS553で、50msジョブのセクシ
ョンに移り、OS側で用意したエンスト処理ルーチン、
気筒別の点火時期リタードルーチン、燃料噴射開始時期
算出ルーチンなどを実行し、また、ユーザ側の制御スト
ラテジーに基づくルーチンを実行する。そして、ジョブ
の終了後、ステップS554で割込みを禁止し、ルーチンを
抜ける。
When the level 0 interrupt is permitted in step S552, the process moves to the 50 ms job section in step S553, and the stalling processing routine prepared on the OS side,
The ignition timing retard routine for each cylinder, the fuel injection start timing calculation routine, etc. are executed, and the routine based on the control strategy on the user side is executed. After the job is completed, the interrupt is prohibited in step S554, and the routine is exited.

【0112】一方、上記ステップ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 process branches to step S560 to set the work area of the job, permit the level 0 interrupt in step S561, and proceed to step S562.
After moving to the section area of the 250 ms job and executing the job body, the interrupt is prohibited and the routine exits in step S563.

【0113】以上のジョブ優先処理においては、クラン
ク位置を常に的確に把握しておく必要があり、クラセン
割込み毎に、図8に示すクランク位置算出サブルーチン
が実行されて前述したクランク位置変数S_CCAS,
S_RCAS,S_ACAS,S_ECASが算出され
る。尚、以下の説明においては、システム変数であるこ
とを示すS_をクランク位置変数から省略する。
In the above job priority processing, it is necessary to always know the crank position accurately, and the crank position calculation subroutine shown in FIG. 8 is executed for each classen interrupt to execute the crank position variable S_CCAS,
S_RCAS, S_ACAS, S_ECAS are calculated. In the following description, S_ indicating a system variable will be omitted from the crank position variable.

【0114】このクランク位置算出サブルーチンでは、
まず、ステップ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 2 bytes of the class timer are stored in the lower 2 bytes of the soft timer. This classen timer is a hardware timer provided in the ECU 50, and in the present embodiment, a 16-bit timer has a maximum of 2 timers.
Counting is possible up to 55 ms, but a continuous area of 3 bytes is secured in the memory, 2 bytes of the Classen timer are transferred to the lower 2 bytes, and the 3rd byte is counted up by the interrupt generated by the overflow of the Classen timer. It is used as a soft timer. As a result, the signal input interval time from the crank angle sensor 39 (hereinafter abbreviated as “Krasen interval”) can be up to 64 sec (2
It is possible to count up to 55 ms x 256), and 1
Without using a special hardware timer of 6 bits or more, it is possible to easily cope with an extremely long Krasen interval such as cranking.

【0115】次いで、ステップS601へ進むと、クラセン
間隔が設定時間以下か否かを調べる。この設定時間は、
最大エンジン回転数に対応するクラセン間隔としての時
間、例えば0.3msであり、上記ステップS601でクラ
セン間隔が設定時間以下のときには、ノイズの混入など
によるクラセンタイマの計数エラーとしてステップS602
でアキュムレータAにエラーコード1を格納してルーチ
ンを抜け、また、上記ステップS601で、クラセン間隔が
設定時間より長いときには、クラセンタイマの計数が正
常であるとしてステップS603へ進む。
Next, when proceeding to step S601, it is checked whether or not the class interval is equal to or shorter than the set time. This set time is
The time as a classen interval corresponding to the maximum engine speed is, for example, 0.3 ms, and when the classen interval is less than or equal to the set time in the above step S601, it is determined as a counting error of the classen timer due to mixing of noise or the like in step S602.
In step S601, the error code 1 is stored in the accumulator A, and the routine is exited. If the classen interval is longer than the set time in step S601, the classen timer count is considered to be normal, and the process proceeds to step S603.

【0116】ステップS603では、後述するCCAS・R
CAS判別サブルーチンを実行してクランク位置を判別
し、ステップS604で、エラーレベルECASが2である
か否か、すなわち、クランキング時などのように気筒判
別がなされていない状態であるか否かを調べ、ECAS
=2のときには、ステップS605へ分岐してアキュムレー
タAにエラーコード1を格納し、ルーチンを抜ける。
At step S603, CCAS.R to be described later is performed.
The CAS determination subroutine is executed to determine the crank position, and in step S604, it is determined whether or not the error level ECAS is 2, that is, whether or not the cylinder is not determined, such as during cranking. Examine, ECAS
= 2, the process branches to step S605, the error code 1 is stored in the accumulator A, and the routine exits.

【0117】一方、上記ステップ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 the above step S604, ECAS ≠ 2
In 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, whether or not the crank position information variable CCAS is 1, that is,
Current crank position is BTDC 65 ° CA-10 ° CA
During the period (see FIG. 23), CCAS = 1
In case of, it jumps from step S607 to step S609, and in case of CCAS ≠ 1, it advances from step S607 to step S608 and increments the A / D conversion request by 1,
Proceed to step S609.

【0118】この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 the crank synchronous A / D conversion for each crank angle 90 ° CA. It takes a value of 0, 1 and when the value is 1, the crank Instructs synchronous A / D conversion. That is, as described above, the A / D conversion of 1 channel out of the 8 channels 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 / D conversion request for crank synchronization is set, and A / D conversion is performed at every 90 ° crank angle (accurately, every 87 °, 93 °) for the A / D conversion order every 0.5 ms. Is interrupted.

【0119】その後、ステップ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), and then step S610.
Then, the soft timer is limited by 2 bytes, and if the classen timer overflows, the lower 2 bytes are F
The processing proceeds to step S611 as FFF (255 ms).

【0120】ステップS611では、総合位置変数ACAS
=0,1,2,…11を添字とする配列TCAS[AC
AS](配列の要素)にクラセン間隔データをストア
し、ステップS612で、クランク位置情報変数CCAS=
0,1,2を添字とする配列MTCSX[CCAS]
(配列の要素)にクラセン間隔データをストアする。
In step S611, the total position variable ACAS
Array TCAS [AC with subscripts = 0, 1, 2, ... 11
AS] (element of the array), the Krasen interval data is stored, and in step S612, the crank position information variable CCAS =
Array MTCSX [CCAS] with subscripts 0, 1, 2
Store Classen interval data in (array element).

【0121】配列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 in which classen interval data for two engine revolutions corresponding to ACAS = 0, 1, 2, ... 11 is stored. , The array MTCSX is
As shown in FIG. 6B, it is a 3-word class interval table in which three class interval data corresponding to CCAS = 0, 1, 2 are stored.

【0122】すなわち、上記ステップ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
RCAS discrimination subroutine (details will be described later), and each information variable CCAS, RCAS, AC by step S609.
AS is updated, for example, CCAS = 1, RCAS =
1, updated to ACAS = 4, and when the crank position is currently BTDC 65 ° to 10 ° CA of the # 3 cylinder, from the classen signal input at the BTDC 97 ° CA of the # 3 cylinder measured by the classen timer to the # 3 cylinder. BTDC
The time until the class signal is input at 65 ° CA (class interval data) is calculated in step S611 as the total position variable AC.
The AS is stored as a parameter at the address ACAS = 3 in the array TCAS, and the crank position information variable CCAS is used as a parameter in the array MTCS in step S612.
Store to address CCAS = 0 of X.

【0123】従って、クラセン入力によるクラセン割込
み毎に総合位置変数ACAS、クランク位置情報変数C
CASが更新される都度、配列TCAS,MTCSX内
のデータが順次更新されるので、配列TCASを参照す
ることにより、各気筒の各クランク位置におけるクラセ
ン間隔の変化(回転速度の変化)を知ることができ、各
気筒の失火の有無、燃焼状態などを判断することがで
き、全気筒の運転状況を把握することができる。また、
配列MTCSXを参照することにより、常に最新のクラ
セン間隔を得ることができ、現在の運転状況を迅速に把
握することができる。
Therefore, the total position variable ACAS and the crank position information variable C are set for each classen interrupt by the classen input.
Every time the CAS is updated, the data in the arrays TCAS and MTCSX are sequentially updated. Therefore, by referring to the array TCAS, it is possible to know the change in the Krasen interval (change in rotational speed) at each crank position of each cylinder. Therefore, it is possible to determine whether or not there is a misfire in each cylinder, the combustion state, and the like, and it is possible to grasp the operating status of all cylinders. Also,
By referring to the array MTCSX, the latest Classen interval can always be obtained, and the current operating condition can be quickly grasped.

【0124】次いで、ステップS613へ進むと、再び、エ
ラーレベルECASの値を調べる。ここでは、前述のス
テップS604においてECAS≠2であることを既に確認
してあるため、エラーレベルECASが1か否か、すな
わち、クランク位置の判別が不安の残る推定状態である
か否かを調べる。
Next, in step S613, the value of the error level ECAS is checked again. Here, since it has already been confirmed in step S604 that ECAS ≠ 2, 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 estimation state in which anxiety remains. .

【0125】上記ステップS613でECAS≠1(すなわ
ちECAS=0)であり、クランク位置が確証をもって
判別されているときには、上記ステップS613からステッ
プS614へ進んで、最新3ヶのクラセン間隔データの和
(配列MTCSXにストアされているクラセン間隔デー
タの和)を、3バイトの半回転時間MTCS18として
算出する(MTCS18=ΣMTCSX)。すなわち、
半回転時間MTCS18は、クラセン割込み毎にクラン
ク位置情報変数CCASが更新されて配列MTCSX内
のデータが更新される毎に算出され、BTDC97°,
65°,10°CAの各位置毎にクラセン間隔の移動和
を取ることにより常に最新のデータが得られるようにな
っている。
When ECAS ≠ 1 (that is, ECAS = 0) in step S613 and the crank position is determined with certainty, the process proceeds from step S613 to step S614, and the sum of the latest three classen interval data ( The sum of the 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 each time the crank position information variable CCAS is updated for each classen interrupt and the data in the array MTCSX is updated, and the BTDC 97 °,
The latest data can always be obtained by taking the moving sum of the Krassen intervals for each position of 65 ° and 10 ° CA.

【0126】一方、上記ステップS613で、ECAS=1
であり、クランク位置の判別が不安の残る推定状態であ
るときには、配列MTCSXから半回転時間MTCS1
8を算出せず、ステップS615で半回転時間推定のサブル
ーチンを実行して半回転時間MTCS18を推定する。
On the other hand, in the above step S613, ECAS = 1
When the crank position is in an estimated state where the determination of the crank position remains uncertain, the half rotation time MTCS1 is calculated from the array MTCSX.
8 is not calculated, but the half rotation time estimation subroutine is executed in step S615 to estimate the half rotation time MTCS18.

【0127】この半回転時間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 Krasen interval time. That is, as shown in FIG. 23, if the current crank position information variable CCAS is 1, the previous crank angle is 32 ° CA (BTDC 97 ° to 65 ° C).
The angle between A) and the half-rotation time MT based on the following equation based on the crank angle and the previous Krasen distance data.
Calculate CS18. MTCS18 = previous classen interval × 180/32 Also, when CCAS = 2, BT
DC 55 ° CA between 65 ° and 10 ° CA and the previous Krasen interval data, the previous Krasen interval x 180 /
The half rotation time MTCS18 is calculated from 55, and
When CCAS = 0, BTDC 10 ° CA to ATD
Based on the angle 93 ° CA between C83 ° CA (BTDC97 ° CA of the next cylinder) and the previous Krasen interval data, the half-rotation time MTC is calculated by the previous Classen interval x 180/93.
S18 is calculated.

【0128】そして、上記ステップS614で半回転時間M
TCS18を算出した後、或は、上記ステップS615で半
回転時間MTCS18を推定した後は、ステップS616へ
進み、3バイトの半回転時間MTCS18を2バイトに
リミットして所定の変数MTCSKにストアすると、ス
テップS617で、この変数MTCSKを2倍して変数MT
CSK4にストアし、ステップS618で、正常終了コード
0をアキュムレータAに格納してルーチンを抜ける。
Then, in step S614, the half rotation time M
After calculating the TCS18 or after estimating the half rotation time MTCS18 in the above step S615, the process proceeds to step S616, and 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 and the variable MT
Store it in CSK4, store the normal end code 0 in accumulator A in step S618, and exit the routine.

【0129】そして、前述のジョブ実行サブルーチンに
おいて10ms毎にエンジン回転数が算出され、このエ
ンジン回転数は、3バイトの半回転時間MTCS18を
2バイトにリミットした変数MTCSKの逆数から算出
される。
Then, in the above-mentioned job execution subroutine, the engine speed is calculated every 10 ms, and this engine speed is calculated from the reciprocal of the variable MTCSK which limits the half-rotation time MTCS18 of 3 bytes to 2 bytes.

【0130】詳述すると、毎分回転数rpmの単位時間
(1min)の半分の時間30secを半回転時間MT
CSKで割算することにより、1rpmを単位とする2
バイト単位の変数NRPM、すなわち、エンジン回転数
が算出され(NRPM=30sec/MTCSK)、こ
のエンジン回転数が基本パラメータの1つとして各種の
制御量演算処理に用いられるのである。
More specifically, half of the unit time (1 min) of the revolutions per minute rpm, 30 seconds, is taken as the half revolution time MT.
Divide by CSK to make 1 rpm as a unit 2
The variable NRPM in bytes, 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.

【0131】次に、図9に示すフローチャートに従っ
て、上記クランク位置算出サブルーチンのステップS603
で実行されるCCAS・RCAS判別サブルーチンにつ
いて説明する。
Next, according to the flow chart shown in FIG. 9, step S603 of the above crank position calculation subroutine.
The CCAS / RCAS discrimination subroutine executed in step S1 will be described.

【0132】このサブルーチンでは、まず最初に、ステ
ップS800で、カムセンカウンタを0〜4にリミットす
る。このカムセンカウンタで計数されるカム角センサ4
1からのカムパルスの数(クラセン信号入力間のカムパ
ルス数)は、図23に示すように、正常状態の場合0〜
3であるが、ノイズなどの影響により4以上の異常な計
数値となるおそれがあるため、カムセンカウンタを0〜
4にリミットして異常な状態を4で代表するのである。
In this subroutine, first, in step S800, the CamSen counter is limited to 0-4. Cam angle sensor 4 counted by this cam sensor counter
As shown in FIG. 23, the number of cam pulses from 1 (the number of cam pulses between Krasen signal inputs) is 0 in the normal state.
Although it is 3, since there is a possibility that an abnormal count value of 4 or more will be caused by the influence of noise, etc.
It is limited to 4 and represents an abnormal state by 4.

【0133】次に、ステップS801へ進み、カムセンカウ
ンタ(の計数値)、気筒情報変数RCAS、クランク位
置情報変数CCASから、5×4×2の組合わせ(カム
センカウンタが0〜4の5種類、気筒情報変数RCAS
が0〜3の4種類、クランク位置情報変数CCASが
0,1と2の場合の2種類)に対する状態データがスト
アされている気筒・クランク位置状態マップCCHMA
Pを読む。
Next, in step S801, a combination of 5 × 4 × 2 (5 in which the CamSen counter is 0 to 4 is selected) from (the count value of) the CamSen counter, the cylinder information variable RCAS, and the crank position information variable CCAS. Type, cylinder information variable RCAS
Of the cylinder / crank position state CCHMA in which the state data for four types of 0 to 3 and two types when the crank position information variable CCAS is 0, 1 and 2 are stored.
Read P.

【0134】この気筒・クランク位置状態マップ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 is used when the crank position information variable CCAS is 0 or 1, and when the crank position information variable CCAS is a change point of the cylinder information variable RCAS.
The state data indicating whether normal, abnormal, or determinable should be estimated is stored for all possible states of each combination of the cam sen counter and the cylinder information variable RCAS. The current state can be evaluated and the next state to be taken can be known.

【0135】この状態データは2ビットのデータであ
り、ビット0の値により確定か推定かを表わし、ビット
1の値により正常か異常かを表わす。ビット0の値は、
0のとき確定、1のとき推定を示し、図22からわかる
ように、カムセンカウンタが2,3の場合にのみ確定で
あって(図23に示すカムセン信号パターン参照)、そ
れ以外は推定せざるを得ない状態である。また、ビット
1の値は、0のとき正常、1のとき異常を示し、カムセ
ンカウンタが3以下で、且つ、図23によるクランク位
置変数の組合せに合致する場合のみ正常であって、それ
以外は異常な状態である。
This state data is 2-bit data, and the value of bit 0 represents definite or estimated, and the value of bit 1 represents normal or abnormal. The value of bit 0 is
When the value is 0, the determination is made, and when the value is 1, the estimation is shown. As can be seen from FIG. 22, the determination is made only when the Camcen counter is 2 or 3 (see the Camcen signal pattern shown in FIG. 23), and the other values are estimated. It is inevitable. The value of bit 1 is normal when it is 0 and abnormal when it is 1, and is normal only when the camsen counter is 3 or less and the combination of crank position variables shown in FIG. 23 is met. Is an abnormal condition.

【0136】例えば、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 CAMDC counter is 0 and the cylinder information variable RCAS is 0 for BTDC 97 ° to 10 ° CA of a certain cylinder is in a state in which the crank position can be normally estimated. , The cylinder shown in FIG.
Binary 01 (normally estimated) state data is stored in the corresponding region of the crank position state map CCHMAP. Further, when the CamSen counter is 1 and the cylinder information variable RC
Since the combination in which AS is 0 is obviously abnormal and is a state that can only be estimated, state data of 11 (abnormality estimation) in binary number is stored in the corresponding region of the cylinder / crank position state map CCHMAP. .

【0137】また、CCAS=2、すなわち、ある気筒
のBTDC10°CA〜ATDC83°CAに対し、カ
ムセンカウンタが3で気筒情報変数RCASが0となる
組合せは、#1気筒のTDCを挟んだクランク位置と正
常に確定できるため、気筒・クランク位置状態マップC
CHMAPの該当領域に2進数で00(正常確定)の状
態データがストアされており、さらに、カムセンカウン
タが2で気筒情報変数RCASが0となる組合せは、明
らかに異常ではあるがカムセン入力が2ヶある以上確定
せざるを得ない状態であるため、気筒・クランク位置状
態マップCCHMAPの該当領域に2進数で10(異常
確定)の状態データがストアされている。
Further, CCAS = 2, that is, a combination of BTDC 10 ° CA to ATDC 83 ° CA of a certain cylinder, in which the Camsen counter is 3 and the cylinder information variable RCAS is 0, the cranks including the TDC of the # 1 cylinder are used. Cylinder / crank position status map C because the position can be normally determined
The combination in which the state data of 00 (normally determined) in binary number is stored in the corresponding area of CHMAP, and further, the combination in which the Camcen counter is 2 and the cylinder information variable RCAS is 0 is obviously abnormal, but the Camcen input is Since there are two or more states that must be determined, the state data of 10 (abnormal determination) in binary is stored in the corresponding region of the cylinder / crank position state map CCHMAP.

【0138】そして、上記ステップ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 process proceeds to step S802, and it is determined whether or not the error level ECAS is 2, that is, the current status is not cylinder-determined. Check whether it is in an unknown state, ECAS = 2
If it is, it is checked whether or not bit 0 of the state data read from the cylinder / crank position state map CCHMAP in step S803 is 0, that is, whether it is the confirmed state. If it is the confirmed state, the process proceeds to step S804, and the state is not the confirmed state. When it is in the estimated state, it exits the routine and waits until it becomes the confirmed state.

【0139】一方、上記ステップS802でECAS≠2の
ときにはステップS804へ進んで、推定状態か否かを調
べ、確定状態、推定状態に応じてステップS805以降の処
理或はステップS812以降の処理へ進む。また、上記ステ
ップS803において確定状態でステップS804へ進んだとき
には、ステップS805以降の処理へ進む。
On the other hand, when ECAS ≠ 2 in step S802, the process proceeds to step S804 to check whether the state is the estimated state, and depending on the confirmed state and the estimated state, the process proceeds to step S805 and subsequent steps or step S812 and subsequent steps. . If the process proceeds to step S804 in the confirmed state at step S803, the process proceeds to step S805 and subsequent steps.

【0140】まず、ステップS805以降の処理について説
明すると、このステップS805へ進んだときには、正常、
異常に拘らず気筒判別がなされた確定状態であるため、
図23のタイムチャートからもわかるように、今回のク
ラセン割込みはカムパルスが3ヶ或は2ヶ入力された後
のBTDC97°CAの割込みであるため、クランク位
置情報変数CCASを0にする。
First, the processing from step S805 onward will be described.
Since it is in the confirmed state that the cylinder discrimination is made regardless of abnormality,
As can be seen from the time chart of FIG. 23, the crank position information variable CCAS is set to 0 because the classen interrupt this time is an interrupt of BTDC97 ° CA after three or two cam pulses are input.

【0141】次いで、ステップS806へ進んでカムセンカ
ウンタが3でないか否かを調べ、カムセンカウンタが3
でないとき、すなわちカムセンカウンタが2のときに
は、#2気筒の点火後であるため、ステップS807で気筒
情報変数RCASを3にしてステップS809へ進み、カム
センカウンタが3のときには、#1気筒の点火後である
ため、ステップS808で気筒情報変数RCASを1にして
ステップS809へ進む。
Next, in step S806, it is checked whether or not the Camcen counter is 3, and the Camcen counter is 3
If it is not, that is, when the CamSen counter is 2, it is after ignition of the # 2 cylinder, so the cylinder information variable RCAS is set to 3 in Step S807 and the process proceeds to Step S809. Since it is after ignition, the cylinder information variable RCAS is set to 1 in step S808, and the flow proceeds to step S809.

【0142】ステップS809では、更新したクランク位置
情報変数CCAS、気筒情報変数RCAS、及び、カム
センカウンタをパラメータとして再び気筒・クランク位
置状態マップCCHMAPから状態データを読込み、こ
の状態データのビット1が1であるか、すなわち異常状
態であるか否かを調べる。
In step S809, the status data is read again from the cylinder / crank position status map CCHMAP using the updated crank position information variable CCAS, cylinder information variable RCAS, and Camsen counter as parameters, and bit 1 of this status data is 1 , That is, whether or not it is in an abnormal state.

【0143】その結果、上記ステップ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 state data is 1 and it is determined that the state is abnormal, the crank position information variable CCAS and the cylinder information variable RC are determined.
Assuming that the AS update result is an uneasy estimate
In step S810, the error level ECAS is set to 1, and the routine exits. When bit 1 of the status data is 0, indicating a normal state, the error level ECAS is set to 0 in step S811, and the routine exits.

【0144】一方、ステップ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 Krasen interrupt) is 2, that is, the change point of the cylinder information variable RCAS. If CCAS = 2, the process proceeds from step S812 to step S813, and the cylinder information variable R
CAS is incremented by 1, the crank position information variable CCAS is set to 0 in step S814, and the flow proceeds to step S817.

【0145】一方、上記ステップS812で、CCAS≠2
のときには、上記ステップS812からステップS815へ進ん
でカムセンカウンタが0でないか否かを調べ、カムセン
カウンタが0でないときには、前述のステップS813へ分
岐し、カムセンカウンタが0のときには、ステップS816
でクランク位置情報変数CCASを1増加させ、ステッ
プS817へ進む。
On the other hand, in the above step S812, CCAS ≠ 2
If it is, the process proceeds from step S812 to step S815 to check whether the Camcen counter is not 0. If the Camcen counter is not 0, the process branches to the above-mentioned step S813, and when the Camcen counter is 0, the process proceeds to step S816.
Then, the crank position information variable CCAS is incremented by 1, and the process proceeds to step S817.

【0146】ステップS817では、更新したクランク位置
情報変数CCAS、気筒情報変数RCAS、及び、カム
センカウンタをパラメータとして再び気筒・クランク位
置状態マップCCHMAPから状態データを読込んで異
常状態であるか否かを調べ、状態データのビット1が0
であり、正常状態であるときには、そのまま(現在のエ
ラーレベルECAS=0のまま)ルーチンを抜ける。ま
た、上記ステップS817で、状態データのビット1が1で
異常状態のときには、ステップS818へ進み、クランク位
置情報変数CCAS、気筒情報変数RCASの更新結果
は不安の残る推定であるとしてエラーレベルECASを
1にし、ルーチンを抜ける。
In step S817, the status data is read again from the cylinder / crank position status map CCHMAP using the updated crank position information variable CCAS, cylinder information variable RCAS, and Camsen counter as parameters to determine whether or not there is an abnormal condition. Check, bit 1 of status data is 0
In the normal state, the routine is exited as it is (the current error level ECAS = 0 remains). If the bit 1 of the status data is 1 and the status is abnormal in step S817, the process proceeds to step S818, and the error level ECAS is set as the estimation result that the crank position information variable CCAS and the cylinder information variable RCAS are anxious. Set to 1 and exit the routine.

【0147】以上のように、クランク位置変数CCA
S,RCAS,ACAS,ECASにより刻々と変化す
るクランク位置の状態を把握し、さらに、気筒・クラン
ク位置状態マップCCHMAPを用いて、現在の状態を
評価し、次にとるべき状態を知ることができるため、通
常の条件判断による処理に比較して大幅にプログラムを
簡略化することができ、メモリ容量の節約、処理速度の
向上を図ることができるとともに、プログラムの可撓性
を向上して仕様変更に対しても柔軟に対処することがで
きる。
As described above, the crank position variable CCA
It is possible to grasp the state of the crank position that changes momentarily by S, RCAS, ACAS, and ECAS, and further evaluate the current state by using the cylinder / crank position state map CCHMAP to know the state to be taken next. Therefore, the program can be greatly simplified compared to the processing based on the normal condition judgment, the memory capacity can be saved, the processing speed can be improved, and the flexibility of the program can be improved to change the specifications. Can be dealt with flexibly.

【0148】次に、図10、図11に示す燃料噴射開始
時期算出ルーチンについて説明する。この燃料噴射開始
時期算出ルーチンは、前述したジョブ実行サブルーチン
のステップS553で実行される50msジョブのうちの一
つで、噴射開始区間、噴射回数、及び1回当りの噴射幅
を全気筒について設定する。すなわち、噴射エンドを固
定した場合の連続噴射の開始時期が遅い場合、噴射回数
を2回に設定し、一方連続噴射の開始時期が早い場合に
は噴射回数を1回にするものである。
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 job execution subroutine described above, and sets the injection start section, the number of injections, and the injection width per injection for all cylinders. . That is, when the start timing of continuous injection is fixed when the injection end is fixed, the number of injections is set to two, while when the start timing of continuous injection is early, the number of injections is set to one.

【0149】まず、ステップS1000で始動時かを判断
し、始動時の場合にはステップS1001へ進み、噴射開始
遅れ時間IJDELYを0とし、ステップS1002で1回
当りの噴射すべき有効噴射幅を1サイクル当りの総噴射
量である要求噴射幅IJSEIn(n=#1,#2,#
3,#4)の1/2に設定し、ステップS1003で噴射開
始区間設定フラグIJTMGFを例えば128+2の複
数回噴射にセットしてルーチンを抜ける。
First, in step S1000, it is determined whether or not the engine is starting. If the engine is starting, the process proceeds to step S1001, the injection start delay time IJDELY is set to 0, and the effective injection width to be injected per injection is set to 1 in step S1002. Required injection width IJSEIn (n = # 1, # 2, #, which is the total injection amount per cycle)
3, # 4) is set to 1/2, the injection start section setting flag IJTMGF is set to a plurality of injections of 128 + 2, for example, in step S1003, and the routine exits.

【0150】上記噴射開始遅れ時間IJDELYは後述
する噴射タイマセットマクロ2で設定するタイマ待ち時
間に組込まれるもので、噴射開始区間の始り(BTDC
97゜CAクラセン信号入力(以下「97゜CAクラセ
ン」と略記する)、或はBTDC10゜CAクラセン信
号入力(以下「10゜CAクラセン」と略記する)から
何ms後に、1回噴射であれば最初の噴射を、2回噴射
であれば2回目の噴射を開始するのかを決定する。
The injection start delay time IJDELY is incorporated in the timer waiting time set by the injection timer set macro 2 described later, and the start of the injection start section (BTDC
If it is a single injection after several ms from the input of 97 ° CA class signal (hereinafter abbreviated as “97 ° CA class”) or BTDC 10 ° CA class signal (hereinafter abbreviated as “10 ° CA class”) If the first injection is the second injection, it is determined whether to start the second injection.

【0151】また、上記噴射開始区間設定フラグIJT
MGFにより、#1〜#4気筒の噴射開始区間が特定さ
れる。すなわち、この噴射開始区間は、#1〜#4気筒
毎の噴射開始区間テーブルIJnTBL(n=#1,#
2,#3,#4)に予め格納されている。
Further, the injection start section setting flag IJT is set.
The MGF specifies the injection start section of the # 1 to # 4 cylinders. That is, this injection start section is the injection start section table IJnTBL (n = # 1, #) for each of # 1 to # 4 cylinders.
2, # 3, # 4).

【0152】図23に示すように、この各噴射開始区間
テーブルIJnTBL(n=#1,#2,#3,#4)
では、#1〜#4気筒の1サイクルを前述のクランク総
合位置変数ACASに対応して97°CAクラセンと1
0°CAクラセンとで8区間に区分し、各区間をビット
7〜ビット0に対応させた1バイトの変数として上記噴
射開始区間設定フラグIJTMGFにて噴射開始区間を
設定する。すなわち、本実施例では、噴射開始区間テー
ブルIJnTBLの各噴射開始区間を、吸気行程の後半
を0、前半を1、排気行程の後半を2、前半を3、燃焼
行程の後半を4、前半を5、さらに、圧縮行程の後半を
6、前半すなわち吸気行程終了直後を7と定義してい
る。但し、噴射開始区間0では噴射処理を行わない。
As shown in FIG. 23, each injection start section table IJnTBL (n = # 1, # 2, # 3, # 4).
Then, one cycle of the # 1 to # 4 cylinders corresponds to the above-mentioned crank total position variable ACAS and 97 ° CA class and 1
The injection start section is set by the injection start section setting flag IJTMGF as a 1-byte variable corresponding to each of bits 7 to 0 by dividing the section into 8 sections with 0 ° CA class. That is, in the present embodiment, each injection start section of the injection start section table IJnTBL has 0 in the latter half of the intake stroke, 1 in the first half, 2 in the second half of the exhaust stroke, 3 in the first half, and 4 in the second half of the combustion stroke. 5, the latter half of the compression stroke is defined as 6, and the first half, that is, immediately after the end of the intake stroke is defined as 7. However, the injection process is not performed in the injection start section 0.

【0153】従って、上記ステップS1003において、I
JTMGF=128+2は、8ビットの変数で表せば1
0000010であり、まず、1回目の噴射が噴射開始
区間7(10°CAのクラセン)から開始され、次いで
2回目の噴射が噴射開始区間1(10°CAのクラセ
ン)から待ち時間無しで開始される。
Therefore, in step S1003, I
JTMGF = 128 + 2 is 1 if expressed by an 8-bit variable
0000010, the first injection is started from the injection start section 7 (10 ° CA class), and the second injection is started from the injection start section 1 (10 ° CA class) without waiting time. It

【0154】一方、上記ステップS1000で始動時ではな
いと判断されてステップS1004へ分岐すると、噴射開始
セット時間IJTIMEがゼロかを判断し、IJTIM
E=0の場合、上記ステップS1001へ戻りステップS100
1,ステップS1002,ステップS1003を経てルーチンを抜け
る。
On the other hand, if it is determined in step S1000 that it is not the time to start and the process branches to step S1004, it is determined whether the injection start set time IJTIME is zero, and IJTIM is set.
If E = 0, the process returns to step S1001 and step S100.
The routine exits through step S1002, step S1003.

【0155】この噴射開始セット時間IJTIMEはユ
ーザ側の制御ストラテジーで設定するもので、例えば、
この噴射開始セット時間IJTIMEに要求噴射幅IJ
SEIn(n=#1,#2,#3,#4)を代入すれ
ば、噴射エンドを吸気行程直前のBTDC10°CAに
ほぼ固定することができる。また、この噴射開始セット
時間IJTIMEを任意に設定することで噴射エンド制
御を行うことができる。従って、ユーザ側の制御ストラ
テジーにおいてIJTIME=0と設定することも考え
られ、この場合には上記ステップS1004から、上記ステ
ップS1001へ戻り、上述したステップS1002で要求噴射幅
に対する1回当りの噴射幅を設定し、ステップS1003で
複数の噴射開始区間を設定してルーチンを抜ける。
The injection start set time IJTIME is set by the control strategy on the user side.
This injection start set time IJTIME requires the required injection width IJ
By substituting SEIn (n = # 1, # 2, # 3, # 4), the injection end can be almost fixed to BTDC 10 ° CA just before the intake stroke. Further, the injection end control can be performed by arbitrarily setting the injection start set time IJTIME. Therefore, it may be possible to set IJTIME = 0 in the control strategy on the user side. In this case, the process returns from step S1004 to step S1001 and the injection width per injection with respect to the required injection width in step S1002 is set. After setting, a plurality of injection start sections are set in step S1003, and the routine exits.

【0156】また、ステップS1004でIJTIME≠0
と判断されてステップS1005へ進むと、このステップS10
05以下において、噴射開始セット時間IJTIMEに基
づく噴射開始区間及び噴射開始遅れ時間IJDELYを
算出する。
In step S1004, IJTIME ≠ 0.
If it is determined that the operation proceeds to step S1005, this step S10
In 05 or less, the injection start section and the injection start delay time IJDELY based on the injection start set time IJTIME are calculated.

【0157】すなわち、上記噴射開始セット時間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 set to the classen interval for each injection start section (BTDC97
° -10 ° CA or BTDC10 ° -ATDC83 ° C
The time interval between A) is sequentially subtracted until it becomes zero or negative to identify each injection start section of multiple injections, and the start of the last injection start section (97 ° CA class or 10
The injection start delay time IJDELY sets the number of ms after which the fuel injection should be started.

【0158】まず、ステップS1005では、上記噴射開始
セット時間IJTIMEからクラセン間隔を減算し、そ
の値をアキュムレータAに格納し、ステップS1006でこ
のアキュムレータAの値が正か、ゼロあるいは負かを判
断し、A≦0場合、ステップS1007へ進み、噴射開始遅
れ時間IJDELYを上記アキュムレータAに格納した
値の2の補数で設定し(IJDELY=−A)、ステッ
プS1008で1回当りの噴射すべき有効噴射幅を要求噴射
幅IJSEIn(n=#1,#2,#3,#4)の1/
2に設定し、ステップS1009で噴射開始区間設定フラグ
IJTMGFを例えば128+4の複数回噴射にセット
してルーチンを抜ける。IJTMGF=128+4を8
ビットの変数で表せば、10000100であり、従っ
て、噴射開始区間は7と2であり、1回目の噴射が噴射
開始区間7から待ち時間無しで開始され、後の噴射が噴
射開始区間2の97°CAクラセンから噴射開始遅れ時
間IJDELY後に開始される。
First, in step S1005, the Krasen interval is subtracted from the injection start set time IJTIME and the value is stored in the accumulator A. In step S1006, it is determined whether the value of the accumulator A is positive, zero or negative. , A ≦ 0, the routine proceeds to step S1007, where the injection start delay time IJDELY is set by the 2's complement of the value stored in the accumulator A (IJDELY = −A), and at step S1008 the effective injection to be performed once The width is 1 / of the required injection width IJSEIn (n = # 1, # 2, # 3, # 4)
2, the injection start section setting flag IJTMGF is set to 128 + 4 multiple injections in step S1009, and the routine exits. IJTMGF = 128 + 4 = 8
Expressed in a bit variable, it is 10,000100, and therefore the injection start sections are 7 and 2, the first injection is started from the injection start section 7 without waiting time, and the subsequent injection is 97 of the injection start section 2. It is started after the injection start delay time IJDELY from CA Classen.

【0159】一方、上記ステップS1006で、A>0と判
断されると、ステップS1010へ分岐し、上記アキュムレ
ータAの値を、このアキュムレータAに格納した値から
クラセン間隔を減算した値とし(A=A−クラセン間
隔)、ステップS1011でこのアキュムレータAの値を参
照し、A≦0の場合、ステップS1012へ進み、噴射開始
遅れ時間IJDELYを上記アキュムレータAに格納し
た値の2の補数で設定し(IJDELY=−A)、ステ
ップS1013で1回当りの噴射すべき有効噴射幅を要求噴
射幅IJSEInの1/2に設定し、ステップS1014で
噴射開始区間設定フラグIJTMGFを例えば128+
8の複数回噴射にセットしてルーチンを抜ける。IJT
MGF=128+8を8ビットの変数で表せば、100
01000であり、従って、噴射開始区間は7と3であ
り、1回目の噴射が噴射開始区間7から待ち時間無しで
開始され、後の噴射が噴射開始区間3の10°CAクラ
センから噴射開始遅れ時間IJDELY後に開始され
る。
On the other hand, if it is determined that A> 0 in step S1006, the process branches to step S1010, and the value of the accumulator A is set to a value obtained by subtracting the Krasen interval from the value stored in the accumulator A (A = A-classen interval), the value of this accumulator A is referred to in step S1011. If A ≦ 0, the process proceeds to step S1012, and the injection start delay time IJDELY is set to the two's complement of the value stored in the accumulator A ( IJDELY = -A), the effective injection width to be injected per injection is set to 1/2 of the required injection width IJSEIn in step S1013, and the injection start section setting flag IJTMGF is set to 128+ in step S1014.
Set to multiple injections of 8 and exit the routine. IJT
If MGF = 128 + 8 is expressed by an 8-bit variable, 100
01000, therefore, the injection start sections are 7 and 3, the first injection is started from the injection start section 7 without waiting time, and the subsequent injection is delayed from the 10 ° CA class in the injection start section 3 from the injection start delay. Started after time IJDELY.

【0160】一方、ステップS1011で、A>0と判断さ
れると、ステップS1015へ分岐し、上記アキュムレータ
Aの値を、このアキュムレータAに格納した値からクラ
セン間隔を減算した値とし(A=A−クラセン間隔)、
ステップS1016でこのアキュムレータAの値を参照し、
A≦0の場合、ステップS1017へ進み、噴射開始遅れ時
間IJDELYを上記アキュムレータAの値の2の補数
で設定し(IJDELY=−A)、ステップS1018で1
回当りの噴射すべき有効噴射幅を要求噴射幅IJSEI
nの1/2に設定し、ステップS1019で噴射開始区間設
定フラグIJTMGFを例えば128+16の複数回噴
射にセットしてルーチンを抜ける。IJTMGF=12
8+16を8ビットの変数で表せば、10010000
であり、従って、噴射開始区間は7と4であり、1回目
の噴射が噴射開始区間7から待ち時間無しで開始され、
後の噴射が噴射開始区間4の97°CAクラセンから噴
射開始遅れ時間IJDELY後に開始される。
On the other hand, if it is judged at step S1011 that A> 0, the process branches to step S1015, and the value of the accumulator A is set to the value obtained by subtracting the Krasen interval from the value stored in the accumulator A (A = A -Classen interval),
In step S1016, refer to the value of this accumulator A,
If A ≦ 0, the process proceeds to step S1017, the injection start delay time IJDELY is set by the complement of 2 of the value of the accumulator A (IJDELY = −A), and 1 is set in step S1018.
The required injection width IJSEI is the effective injection width for each injection.
It is set to 1/2 of n, the injection start section setting flag IJTMGF is set to a plurality of injections of 128 + 16, for example, in step S1019, and the routine exits. IJTMGF = 12
If 8 + 16 is represented by an 8-bit variable, 10010000
Therefore, the injection start sections are 7 and 4, and the first injection is started from the injection start section 7 without waiting time,
The subsequent injection is started after the injection start delay time IJDELY from the 97 ° CA class in the injection start section 4.

【0161】一方、ステップS1016で、A>0と判断さ
れると、ステップS1020へ分岐し、上記アキュムレータ
Aの値を、このアキュムレータAに格納した値からクラ
セン間隔を減算した値とし(A=A−クラセン間隔)、
ステップS1021でこのアキュムレータAに格納した値を
参照し、A≦0の場合、ステップS1022へ進み、噴射開
始遅れ時間IJDELYを上記アキュムレータAの値の
2の補数で設定し(IJDELY=−A)、ステップS1
023で1回当りの噴射すべき有効噴射幅を要求噴射幅I
JSEInの1/2に設定し、ステップS1024で噴射開
始区間設定フラグIJTMGFを例えば128+32の
複数回噴射にセットしてルーチンを抜ける。IJTMG
F=128+32を8ビットの変数で表せば、1010
0000であり、従って、噴射開始区間は7と5であ
り、1回目の噴射が噴射開始区間7から待ち時間無しで
開始され、後の噴射が噴射開始区間5の10°CAクラ
センから噴射開始遅れ時間IJDELY後に開始され
る。
On the other hand, if it is determined in step S1016 that A> 0, the process branches to step S1020, and the value of the accumulator A is set to a value obtained by subtracting the Krasen interval from the value stored in the accumulator A (A = A -Classen interval),
The value stored in the accumulator A is referred to in step S1021, and if A ≦ 0, the process proceeds to step S1022, and the injection start delay time IJDELY is set by the complement of 2 of the value of the accumulator A (IJDELY = −A), Step S1
In 023, the effective injection width to be injected per injection is the required injection width I
It is set to 1/2 of JSEIn, the injection start section setting flag IJTMGF is set to, for example, 128 + 32 multiple injections in step S1024, and the routine exits. IJTMG
If F = 128 + 32 is represented by an 8-bit variable, 1010
0000, therefore, the injection start sections are 7 and 5, the first injection is started from the injection start section 7 without waiting time, and the subsequent injection is delayed from the injection start section 5 of 10 ° CA class and the injection start delay. Started after time IJDELY.

【0162】一方、ステップS1021で、A>0と判断さ
れると、ステップS1025へ分岐し、上記アキュムレータ
Aの値を、このアキュムレータAに格納した値からクラ
セン間隔を減算した値とし(A=A−クラセン間隔)、
ステップS1026でこのアキュムレータAに格納した値を
参照し、A≦0の場合、ステップS1027へ進み、噴射開
始遅れ時間IJDELYを上記アキュムレータAの値の
2の補数で設定し(IJDELY=−A)、ステップS1
028で1回に全部噴射することを設定し、ステップS1029
で噴射開始区間設定フラグIJTMGFを例えば64の
1回噴射にセットしてルーチンを抜ける。IJTMGF
=64を8ビットの変数で表せば、01000000で
あり、噴射開始区間6の97°CAクラセンから噴射開
始遅れ時間IJDELY後に燃料噴射が開始される。一
方、ステップS1026で、A>0と判断されると、ステッ
プS1030へ分岐し、上記アキュムレータAの値を、この
アキュムレータAに格納した値からクラセン間隔を減算
した値とし(A=A−クラセン間隔)、ステップS1031
でこのアキュムレータAに格納した値を参照し、A≦0
の場合、ステップS1032へ進み、噴射開始遅れ時間IJ
DELYを上記アキュムレータAに格納した値の2の補
数で設定し(IJDELY=−A)、ステップS1033で
1回で全部噴射することを設定し、噴射開始区間設定フ
ラグIJTMGFを128としてルーチンを抜ける。I
JTMGF=128を8ビットの変数で表せば、100
00000であり、噴射開始区間7の10°CAクラセ
ンから噴射開始遅れ時間IJDELY後に燃料噴射が開
始される。
On the other hand, if it is determined in step S1021 that A> 0, the process branches to step S1025, and the value of the accumulator A is set to a value obtained by subtracting the Krasen interval from the value stored in the accumulator A (A = A -Classen interval),
The value stored in the accumulator A is referred to in step S1026. If A ≦ 0, the process proceeds to step S1027, and the injection start delay time IJDELY is set to the 2's complement of the value of the accumulator A (IJDELY = −A), Step S1
In 028, set to jet all at once, and step S1029
Then, the injection start section setting flag IJTMGF is set to a single injection of 64, for example, and the routine is exited. IJTMGF
= 64 with an 8-bit variable is 01000000, and the fuel injection is started after the injection start delay time IJDELY from the 97 ° CA class in the injection start section 6. On the other hand, if it is determined that A> 0 in step S1026, the process branches to step S1030, and the value of the accumulator A is set as a value obtained by subtracting the Krasen interval from the value stored in the accumulator A (A = A-classen interval). ), Step S1031
And refer to the value stored in this accumulator A, and A ≤ 0
In the case of, the process proceeds to step S1032, and the injection start delay time IJ
DELY is set by the two's complement of the value stored in the accumulator A (IJDELY = -A), all injection is set at one time in step S1033, the injection start section setting flag IJTMGF is set to 128, and the routine exits. I
If JTMGF = 128 is represented by an 8-bit variable, 100
The fuel injection is started after the injection start delay time IJDELY from the 10 ° CA class in the injection start section 7.

【0163】一方、ステップS1031で、A>0と判断さ
れると、ステップS1035へ分岐し、噴射開始遅れ時間I
JDELYを0とし、ステップS1036 で1回で全部噴射
することを設定し、ステップS1037で噴射開始区間設定
フラグIJTMGFを128としてルーチンを抜ける。
IJTMGF=128を8ビットの変数で表せば、10
000000であり、噴射開始区間7の10°CAクラ
センから待ち時間無しで燃料噴射が開始される。従っ
て、このステップでの噴射が1サイクル中の最大噴射量
となる。
On the other hand, if it is determined in step S1031 that A> 0, the process branches to step S1035, and the injection start delay time I
JDELY is set to 0, and it is set in step S1036 that all injection is to be performed once. In step S1037, the injection start section setting flag IJTMGF is set to 128, and the routine exits.
If IJTMGF = 128 is represented by an 8-bit variable, 10
The fuel injection is started from the 10 ° CA class in the injection start section 7 without waiting time. Therefore, the injection in this step becomes the maximum injection amount in one cycle.

【0164】図24に上記フローチャートに基づく燃料
噴射開始時期の設定例のタイムチャートを示す。
FIG. 24 shows a time chart of an example of setting the fuel injection start timing based on the above flow chart.

【0165】同図(a)に示すように、連続噴射の場合
に噴射開始時期を遅くしても1サイクル中で噴射を完了
させることが出来る場合には2回噴射とし、最初の噴射
で燃料の気化の促進を図り、後の噴射で空燃比をトータ
ル的に調整する。例えば、噴射開始区間設定フラグIJ
TMGFが128+8に設定され、噴射開始遅れ時間I
JDELYが時間tに設定された場合、まず、噴射開始
区間7の10°CAクラセンから待ち時間無しで、総噴
射量の1/2を噴射し、次いで噴射開始区間3の10°
CAクラセンから時間t後に残りの1/2が噴射され
る。
As shown in FIG. 13A, in the case of continuous injection, if the injection can be completed in one cycle even if the injection start timing is delayed, the injection is performed twice, and the fuel is injected in the first injection. In order to accelerate the vaporization of the air-fuel ratio, the air-fuel ratio is totally adjusted by the subsequent injection. For example, the injection start section setting flag IJ
TMGF is set to 128 + 8, injection start delay time I
When JDELY is set to the time t, first, from the 10 ° CA class in the injection start section 7, ½ of the total injection amount is injected without waiting time, and then 10 ° in the injection start section 3.
The remaining 1/2 is injected after a time t from CA Classen.

【0166】また同図(b)に示すように、連続噴射の
場合に噴射を早く開始しなければ1サイクル中で噴射を
完了させることが出来ない場合には1回噴射とする。例
えば、噴射開始区間設定フラグIJTMGFが64に設
定され、噴射開始遅れ時間IJDELYが時間tに設定
された場合、まず、噴射開始区間6の97°CAクラセ
ンから時間t後に全部噴射する。
Further, as shown in FIG. 13B, in the case of continuous injection, if the injection cannot be completed in one cycle unless the injection is started early, the injection is performed once. For example, when the injection start section setting flag IJTMGF is set to 64 and the injection start delay time IJDELY is set to the time t, first, all the injections are made after the time t from the 97 ° CA class in the injection start section 6.

【0167】尚、上記フローチャートでは噴射開始区間
設定フラグIJTMGFのビット指定を1気筒当り1カ
所あるいは2カ所としているが、噴射開始区間設定フラ
グIJTMGFで3カ所以上のビットを指定するように
しても良い。複数回噴射とすることで、最後の噴射で空
燃比をトータル的に調整し、結果として加速増量等の過
渡時の空燃比変動に対しても後の噴射量を調整すること
で柔軟に対応することができる。
In the above flowchart, the bit designation of the injection start section setting flag IJTMGF is one or two per cylinder, but it is also possible to designate three or more bits by the injection start section setting flag IJTMGF. . By making multiple injections, the air-fuel ratio is totally adjusted at the last injection, and as a result, it is possible to flexibly respond to the fluctuation of the air-fuel ratio during transition such as acceleration increase by adjusting the subsequent injection amount. be able to.

【0168】また、本フローチャートでは、噴射開始区
間を50msec毎に設定しているため、エンジン回転
数が9000〜10000rpm等の高回転数に達して
もメインCPU58の負担が増加することはなく、高回
転数域でも噴射エンド制御が可能になる。
Further, in this flowchart, since the injection start section is set every 50 msec, even if the engine speed reaches a high speed such as 9000 to 10000 rpm, the load on the main CPU 58 does not increase, and the high speed is maintained. The injection end control becomes possible even in the rotational speed range.

【0169】図12は噴射タイマセットサブルーチン
で、図2に示すクラセンによる割込み処理ルーチンのス
テップS205で実行されるもので、噴射開始区間毎に噴射
タイマをセットする。
FIG. 12 is an injection timer setting subroutine, which is executed in step S205 of the interrupt processing routine by the classen shown in FIG. 2, and sets the injection timer for each injection start section.

【0170】まず、ステップ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, in step S1100, the error level EC
If AS is 2, and ECAS = 2, the crank position is still unknown, so the subroutine is skipped without further processing. If ECAS ≠ 2, the step is executed.
The process proceeds to S1101, and it is determined whether the crank position information variable CCAS is 1, and when CCAS = 1, it is determined that calculation is unnecessary and the routine exits. As shown in FIG. 23, in the case of CCAS = 1, it is an interruption 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 and the processing load is reduced. On the other hand, if CCAS ≠ 1, it is either a 97 ° CA class interrupt or a 10 ° CA class interrupt, which is the start of the injection start section, and therefore injection in the current injection start section in step S1102 and subsequent steps. Set the width and injection start timing.

【0171】まず、ステップS1102〜ステップS1105で
は、後述する噴射タイマセットマクロ1を全気筒につい
て実行し、現噴射開始区間における噴射幅(以下「有効
噴射幅」とする)TEIJAn(n=#1,#2,#
3,#4)を全気筒について設定する。
First, in steps S1102 to S1105, the injection timer set macro 1 described below is executed for all cylinders, and the injection width (hereinafter referred to as "effective injection width") TEIJAn (n = # 1, in the current injection start section). # 2, #
3, 3) are set for all cylinders.

【0172】そして、ステップS1106で、上記各ステッ
プS1102〜ステップS1105で各々設定した有効噴射幅TE
IJAnが全てゼロかを判断し、全てゼロの場合、噴射
タイマを再セットする必要がないためサブルーチンを抜
ける。また、少なくとも一つの気筒がTEIJAn≠0
の場合には、ステップS1107へ進み、全ての噴射タイマ
を停止状態とし、その間、以下のステップS1108〜ステ
ップS1111の処理を行う。
Then, in step S1106, the effective injection width TE set in each of the above steps S1102 to S1105.
It is determined whether IJAn is all zero. If all IJAn are zero, it is not necessary to reset the injection timer and the process exits the subroutine. Further, at least one cylinder has TEIJAN ≠ 0.
In this case, the process proceeds to step S1107, all the injection timers are stopped, and during that time, the processes of steps S1108 to S1111 described below are performed.

【0173】このステップS1108〜ステップS1111では、
後述する噴射タイマセットマクロ2を全気筒について実
行し、上記噴射タイマセットマクロ1で設定した有効噴
射幅TEIJAnに基づく噴射時間を全気筒分設定す
る。
In steps S1108 to S1111,
The injection timer set macro 2 described below 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.

【0174】そして、ステップS1112で全ての噴射タイ
マを再スタートさせてサブルーチンを抜ける。
Then, in step S1112, all the injection timers are restarted and the subroutine is exited.

【0175】なお、上記ステップ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 fuel-injected cylinders and the injection stopped state is continued in the injection-stopped cylinders. To be done. The processing time corresponding to the time when the injection timer is stopped is taken into consideration in the injection time set in steps S1108 to S1112.

【0176】上記噴射タイマセットサブルーチンにおけ
るステップ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 above-mentioned injection timer set subroutine is executed according to the flowcharts of the injection timer set macro 1 shown in FIGS. The program of the injection timer set macro 1 is a macro program so that the injection timer set routine of the # 1 cylinder is used as a basic program and can be applied to the # 2 to # 4 cylinders.

【0177】まず、ステップS1200で当該#n(n=
1,2,3或は4)気筒の現在の噴射開始区間番号を、
クランク総合位置変数ACASに基づき当該#n気筒の
噴射開始区間テーブルIJnTBL(図23)を参照し
て調査し、ステップS1201で噴射開始区間番号がゼロか
を判断する。そして、噴射開始区間がゼロの場合、ステ
ップS1202へ進み、噴射開始区間がゼロでない場合ステ
ップS1210へ進む。
First, at 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, the injection start section table IJnTBL (FIG. 23) of the corresponding #n cylinder is referred to, and it is determined in step S1201 whether the injection start section number is zero. If the injection start section is zero, the process proceeds to step S1202, and if the injection start section is not zero, the process proceeds to step S1210.

【0178】噴射開始区間0の時は 吸気行程後半であ
り噴射処理を行わない為、ステップS1202ないしステッ
プS1209で次回の燃料噴射に備え燃料噴射の初期化処理
を実行する。まず、ステップS1202では、当該#n気筒
の累積噴射幅TEIJBnをゼロとし、ステップS1203
でユーザ側ジョブから燃料カット要求があるかを判断
し、燃料カット要求がない場合ステップS1204へ進み、
燃料カット要求がある場合にはステップS1208へ進む。
In the injection start section 0, the injection process is not performed since the intake stroke is in the latter half. Therefore, in steps S1202 to S1209, the fuel injection initialization process is executed in preparation for the next fuel injection. First, in step S1202, the cumulative injection width TEIJBn of the #n cylinder is set to zero, and step S1203
Determines whether there is a fuel cut request from the job on the user side, and if there is no fuel cut request, the process proceeds to step S1204,
If there is a fuel cut request, the process advances to step S1208.

【0179】燃料カット要求なしと判断してステップS1
204へ進むと、燃料カット状態フラグPRCUTの値を
参照して当該#n気筒が燃料カット状態かを判断し、燃
料カット状態ではない場合ステップS1205へ進み、また
燃料カット状態の場合ステップS1206へ進む。
When it is judged that there is no fuel cut request, step S1
When the process proceeds to 204, it is determined whether the #n cylinder is in the fuel cut state by referring to the value of the fuel cut state flag PRCUT. If it is not in the fuel cut state, the process proceeds to step S1205, and if it is in the fuel cut state, the process proceeds to step S1206. .

【0180】この燃料カット状態フラグPRCUTは#
1〜#4気筒をビット0〜ビット3の4ビットに対応さ
せて表したもので、ユーザ側ジョブにおいて燃料カット
が要求された時の最初のルーチンでセットされ、また燃
料カット要求解除後の最初のルーチンでクリアされる。
This fuel cut state flag PRCUT is #
1 to # 4 cylinders are shown in correspondence with 4 bits of bit 0 to bit 3, and are set in the first routine when a fuel cut is requested in the user side job, and the first after the fuel cut request is released. It is cleared in the routine.

【0181】上述したように、この燃料カット状態フラ
グPRCUTは、噴射開始区間0において当該#n気筒
に対応するビットがセットされているかを判断し、ユー
ザ側ジョブから燃料カット要求がなく、しかも、この燃
料カット状態フラグPRCUTがセットされている気筒
は次のサイクルで燃料が噴射されない。
As described above, the fuel cut state flag PRCUT determines whether or not the bit corresponding to the #n cylinder is set in the injection start section 0, there is no fuel cut request from the user side job, and Fuel is not injected into the cylinder for which the fuel cut state flag PRCUT is set in the next cycle.

【0182】そして、燃料カット状態ではないと判断さ
れてステップS1205へ進むと、噴射開始区間0では噴射
処理を行わないため当該#n気筒の有効噴射幅TEIJ
Anをゼロにして当該#n気筒の噴射タイマセットマク
ロ1を終了する。
If it is determined that the fuel cut state is not reached and the routine proceeds to step S1205, the injection process is not performed in the injection start section 0, so 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.

【0183】また、上記ステップS1204から燃料カット
状態と判断されてステップS1206へ進むと、ユーザ側ジ
ョブから燃料カット要求がなく、燃料カット状態フラグ
PRCUTはセットされているので、復帰後、第1回目
のルーチンであり、次のサイクルにおける燃料カットリ
カバリに備え当該#n気筒の噴射開始区間ゼロで付着補
正量分に相当する燃料を1回噴射する為、ユーザ側ジョ
ブで設定した燃料付着補正量TEFUCHで当該#n気
筒の有効噴射幅TEIJAnを更新し、ステップS1207
で燃料カット状態フラグPRCUTの当該#n気筒に対
応するビットをクリアした後、当該#n気筒の噴射タイ
マセットマクロ1を終了する。
If it is determined in step S1204 that the fuel cut state has been reached and the process proceeds 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 prepare for the fuel cut recovery in the next cycle, the fuel corresponding to the adhesion correction amount is injected once at the injection start section zero of the #n cylinder. Therefore, the fuel adhesion correction amount TEFUCH set by the user side job is set. In step S1207, the effective injection width TEIJAn of the #n cylinder is updated.
After clearing the bit corresponding to the #n cylinder of the fuel cut state flag PRCUT, the injection timer set macro 1 of the #n cylinder is ended.

【0184】その結果、燃料カット及び燃料カットリカ
バリに備える付着補正を気筒毎に設定することができ
る。
As a result, it is possible to set the adhesion correction for the fuel cut and the fuel cut recovery for each cylinder.

【0185】また、上記ステップ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, it is effective in step S1208 because 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 of the fuel cut state flag PRCUT is set in step S1209, and the injection timer set macro 1 of the #n cylinder is ended.

【0186】また、上記ステップ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, the section of the injection processing region, normal injection processing is performed in step S1210 and thereafter. First, in step S1210, the bit value of the #n cylinder of the fuel cut state flag PRCUT is referenced to determine whether the #n cylinder is in the fuel cut state. If it is in the fuel cut state, the process proceeds to step S1211 and the effective injection width TEIJAn is set to zero, and the injection timer set macro 1 of the #n cylinder is ended.

【0187】一方、上記ステップS1210で燃料カット状
態ではないと判断されるとステップS1212で今より後の
区間では噴射しないかを、噴射開始区間設定フラグIJ
TMGFの値を参照して判断し、今より後の区間におい
ても噴射すると判断した場合、ステップS1213へ進み、
また、今より後の区間では噴射しないと判断した場合、
ステップS1218へ進む。
[0187] On the other hand, if it is determined in step S1210 that the fuel cut state is not established, then in step S1212 it is determined whether or not injection will be performed in the section after this time.
If it is determined with reference to the value of TMGF, and it is determined that the injection will be performed in the section after this time, the flow proceeds to step S1213,
Also, if it is determined that injection will not be performed in the section after this,
Proceeds to step S1218.

【0188】上記ステップS1212は1サイクル中におけ
る複数回噴射に対応したステップで、上記噴射開始区間
設定フラグIJTMGFのビット0〜ビット7で指定し
た区間が2箇所以上ある場合、例えば、図24(a)に
示すように、IJTMGF=128+8であれば、区間
7と3が噴射開始区間であり、噴射開始区間7において
は今より後の区間で噴射されるためステップS1213へ進
み、一方、噴射開始区間3では今より後の区間で噴射を
開始しないためステップS1218へ進む。
Step S1212 is a step corresponding to a plurality of injections in one cycle, and when there are two or more sections designated by bits 0 to 7 of the injection start section setting flag IJTMGF, for example, as shown in FIG. ), If IJTMGF = 128 + 8, sections 7 and 3 are injection start sections, and in the injection start section 7, injection is performed in a section after this, so the flow proceeds to step S1213, while the injection start section In 3, the injection is not started in the section after this, so the flow proceeds to step S1218.

【0189】そして、ステップS1213へ進むと、現在の
区間で噴射するかを、上記噴射開始区間設定フラグIJ
TMGFの値を参照してその指示値が前記ステップS120
0で検索した現在の噴射開始区間番号と一致するかによ
り判断し、現在の区間で噴射しない場合、ステップS121
4へ進み有効噴射幅TEIJAnをゼロにして当該#n
気筒の噴射タイマセットマクロ1を終了する。
When proceeding to step S1213, it is determined whether the injection is to be performed in the current section, the injection start section setting flag IJ.
Referring to the value of TMGF, the indicated value is set in the above step S120.
If it is judged that the injection number does not coincide with the current injection start section number searched in 0, and if the injection is not performed in the current section, step S121
4, the effective injection width TEIJAn is set to zero and the relevant #n
The cylinder injection timer set macro 1 is terminated.

【0190】一方、上記ステップS1213で現在の区間で
噴射すると判断された場合には、ステップS1215へ進
み、ユーザ側ジョブで10ms毎に設定される気筒別要
求噴射幅IJSEInを2のn乗で除算して1回当りの
噴射量を求め、その値をアキュムレータAに格納し、ス
テップS1216でこのアキュムレータAに格納した値で当
該#n気筒の有効噴射幅TEIJAnを設定し、ステッ
プS1217で、上記アキュムレータAの値に累積噴射幅T
EIJBnを足し込み、噴射タイマセットマクロ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 divide the cylinder-specific required injection width IJSEIn set every 10 ms by the user's job by 2 n. Then, the injection amount per time is calculated, the value is stored in the accumulator A, the effective injection width TEIJAn of the #n cylinder is set by the value stored in the accumulator A in step S1216, and the accumulator is set in step S1217. Cumulative injection width T to the value of A
EIJBn is added and the injection timer set macro 1 ends.

【0191】上記次数nは、前述した燃料噴射開始時期
の算出ルーチンのステップS1002,S1008,S1013,S1018,S1
023,S1028,S1033あるいはS1036で設定した噴射回数に基
づいて設定されるもので、1/2噴射に設定されている
場合には n=1、全部噴射に設定されている場合には n
=0に設定される。その結果、2回噴射では、最後の噴
射開始区間において、最新の気筒別要求噴射幅IJSE
Inの1/2に相当する有効噴射幅が設定される。
The above order n is determined by the steps S1002, S1008, S1013, S1018, S1 in the above-described fuel injection start timing calculation routine.
It is set based on the number of injections set in 023, S1028, S1033, or S1036, and n = 1 when 1/2 injection is set and n when all injections are set.
Is set to = 0. As a result, in the double injection, the latest required injection width IJSE for each cylinder is obtained in the last injection start section.
An effective injection width corresponding to 1/2 of In is set.

【0192】また、上記ステップS1212からステップS12
18へ進むと、現在の区間で噴射するかを上記ステップS1
213と同様、上記噴射開始区間設定フラグIJTMGF
の値を参照して判断し、現在の区間で噴射する場合、ス
テップS1219へ進み、また現在の区間で噴射しない場
合、ステップS1223へ進む。
In addition, the above steps S1212 to S12
When it proceeds to step 18, it is determined whether to inject in the current section in the above step S1.
Similar to 213, the injection start section setting flag IJTMGF
If it is determined that the injection is performed in the current section, the process proceeds to step S1219. If the injection is not performed in the current section, the process proceeds to step S1223.

【0193】そして、ステップS1219では、気筒別要求
噴射幅IJSEInから上記累積噴射幅TEIJBnを
減算した値をアキュムレータAに格納し、ステップS122
0で、このアキュムレータAの値で有効噴射幅TEIJ
Anを設定する。
Then, in step S1219, a value obtained by subtracting the cumulative injection width TEIJBn from the cylinder-specific required injection width IJSEIn is stored in the accumulator A, and step S122
At 0, the effective injection width TEIJ at the value of this accumulator A
Set An.

【0194】次いで、ステップS1221で累積噴射幅TE
IJBnを要求噴射幅IJSEInとして、ステップS1
222へ進む。すなわち、現在の区間が噴射終了区間であ
り、これより後の区間では噴射しないため、このルーチ
ンにおいては累積噴射幅TEIJBnを要求噴射幅IJ
SEInと同一の値にする。その結果、例えば、1サイ
クル中1回噴射の場合には,TEIJBn=0であるた
めTEIJAn=IJSEInとなる。そして、次回の
噴射開始区間でのルーチン実行時には、TEIJBn=
IJSEIn=0となる。
Next, at step S1221, the cumulative injection width TE
Step S1 with IJBn as the required injection width IJSEIn
Continue to 222. That is, since the current section is the injection end section and the injection is not performed in the section after this, the cumulative injection width TEIJBn is set to the required injection width IJ in this routine.
Set to the same value as SEIn. As a result, for example, in the case of injection once in one cycle, TEIJBn = 0, so TEIJAn = IJSEIn. Then, when the routine is executed in the next injection start section, TEIJBn =
IJSEIn = 0.

【0195】そして、ステップS1222で噴射待ち設定フ
ラグFLG_IJをセットして噴射タイマセットマクロ
1を終了する。すなわち、このルーチンでは当該#n気
筒のサイクル中における最後の噴射であり、噴射待ち設
定フラグFLG_IJをセットすることで、後述する噴
射タイマセットマクロ2で設定される噴射終了時期を例
えば吸気行程直前の10°CAクラセンに合わせること
ができる。
Then, in step S1222, the injection waiting setting flag FLG_IJ is set and the injection timer set macro 1 is ended. That is, in this routine, it is the last injection in the cycle of the #n cylinder, and by setting the injection waiting 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.

【0196】一方、上記ステップS1218からステップS12
23へ進むと、気筒別要求噴射幅IJSEInから上記ス
テップS1221で設定した累積噴射幅TEIJBnを減算
した値をアキュムレータAに格納する。
On the other hand, the above steps S1218 to S12
When proceeding to 23, a value obtained by subtracting the cumulative injection width TEIJBn set in step S1221 from the cylinder-specific required injection width IJSEIn is stored in the accumulator A.

【0197】そして、ステップS1224で上記アキュムレ
ータAの値を参照し、A<0、すなわち、運転条件が変
化して要求噴射量IJSEInが減少した場合、ステッ
プS1226へ進み、また、A≧0、すなわち、要求噴射量
IJSEInが増加したか或は変化していない場合、ス
テップS1225へ進む。燃料噴射幅がユーザ側ジョブにお
いて10ms毎に設定されるため、次のルーチン実行時
に読込む要求噴射幅IJSEInが前回のルーチン実行
時において読込んだ要求噴射幅IJSEInと相違して
いる場合、その差分を増量、或は減量することで、常に
最新の値で有効噴射幅TEIJAnを設定することがで
きるため運転条件の変化に対する追従性が良くなる。
Then, in step S1224, the value of the accumulator A is referred to. If A <0, that is, if the operating condition changes and the required injection amount IJSEIn decreases, the process proceeds to step S1226, and A ≧ 0, that is, 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 job on the user side, if the requested injection width IJSEIn read at the time of execution of the next routine is different from the requested injection width IJSEIn read at the time of execution of the previous routine, the difference between them. Since the effective injection width TEIJAn can be always set to the latest value by increasing or decreasing the value, the followability to changes in operating conditions is improved.

【0198】その後、上記ステップS1224からステップS
1225へ進むと、上記アキュムレータAの値と噴射幅の許
容変動値、例えば0.5msとを比較し、A>0.5m
sの場合ステップS1226へ進み、A≦0.5msの場合
には前記ステップS1214へ進み、有効噴射幅TEIJA
nをゼロにして当該#n気筒の噴射タイマセットマクロ
1を終了する。
Thereafter, the above steps S1224 to S
Proceeding to 1225, the value of the accumulator A is compared with the allowable fluctuation value of the injection width, for example, 0.5 ms, and A> 0.5 m
If s, the process proceeds to step S1226. If A ≦ 0.5 ms, the process proceeds to step S1214, and the effective injection width TEIJA.
The n is set to zero and the injection timer set macro 1 of the #n cylinder concerned is ended.

【0199】また、ステップS1224或はステップS1225か
らステップS1226へ進むと、有効噴射幅TEIJAnを
上記アキュムレータAの値(ステップS1224からの場合
は負の値)で設定し、ステップS1227で累積噴射幅TE
IJBnを上記要求噴射幅IJSEInとして、噴射タ
イマセットマクロ1を終了する。
Further, when the process proceeds from step S1224 or step S1225 to step S1226, the effective injection width TEIJAn is set by the value of the accumulator A (negative value from step S1224), and the cumulative injection width TE is set at step S1227.
The injection timer set macro 1 is ended with IJBn being the required injection width IJSEIn.

【0200】上記噴射タイマセットサブルーチンにおけ
るステップS1108〜ステップS1111での噴射タイマセット
マクロ2は図15,図16に示す噴射タイマセットマク
ロ2を示すフローチャートにて実行される。尚、この噴
射タイマセットマクロ2のプログラムは上記噴射タイマ
セットマクロ1を示すフローチャートと同様に#1気筒
のタイマセットルーチンを基本プログラムとし、これを
#2〜#4気筒にも応用できるようにマクロ化したもの
である。
The injection timer set macro 2 in steps S1108 to S1111 in the above-mentioned injection timer set subroutine is executed according to the flowchart of the injection timer set macro 2 shown in FIGS. The program of this injection timer set macro 2 is based on the timer set routine of the # 1 cylinder as the basic program as in the flow chart showing the injection timer set macro 1, and the macro can be applied to the # 2 to # 4 cylinders. It has been transformed.

【0201】まず、ステップS1300で噴射タイマの状態
から前回の噴射開始区間で設定した燃料の噴射状況を判
断し、今回の噴射開始区間においても継続して噴射中の
場合ステップS1301へ進み、噴射待ち状態が継続されて
いる場合ステップS1307へ進み、また、噴射が終了され
ている場合ステップS1312へ進む。
First, in step S1300, the injection state of the fuel set in the previous injection start section is judged from the state of the injection timer, and if the injection is continued in this injection start section, the process proceeds to step S1301 and waits for injection. If the state is continued, the process proceeds to step S1307, and if the injection is finished, the process proceeds to step S1312.

【0202】継続して噴射中と判断されてステップS130
1へ進むと、停止中の噴射タイマの現状のタイマ値に、
当該#n気筒の前記噴射タイマセットマクロ1で設定し
た正或は負の値の有効噴射幅TEIJAn(ms)を加
算し、その値をアキュムレータAに格納する。従って、
前回のルーチンで一旦設定した噴射タイマの値がその後
の運転条件の変化に基づいて設定した最新の有効噴射幅
TEIJAnで修正されることになる。
[0202] It is determined that the injection is continuously performed, and the step S130 is performed.
If you proceed to 1, the current timer value of the injection timer that is stopped,
The effective injection width TEIJAn (ms) of the positive or negative value 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 by the latest effective injection width TEIJAn set based on the change in the operating conditions thereafter.

【0203】次いで、ステップS1302で、上記キュムレ
ータAの値から処理時間(噴射タイマ停止から再セット
するまでの時間)を減算し、この減算した値をステップ
S1303で、ゼロから1サイクルの最大噴射量である2回
転時間の間にリミットし(0≦A<2回転時間、従っ
て、Aが負の場合にはA=0となる)、ステップS1304
で、現在噴射中であるためタイマ待ち時間を0とし、ス
テップS1305で噴射タイマのリロード値を上記アキュム
レータAの値で設定し、ステップS1306で上記リロード
値に対応する噴射パルスの出力パターンをタイマにセッ
トして当該#n気筒の噴射タイマセットマクロ2を終了
する。
Then, in step S1302, the processing time (the time from the stop of the injection timer to the resetting) is subtracted from the value of the accumulator A, and the subtracted value is used in step S1302.
In S1303, the maximum injection amount is restricted from zero to two rotation times in one cycle (0 ≦ A <2 rotation times, therefore, A = 0 when A is negative), and step S1304
Since the injection is currently in progress, 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 in the timer in step S1306. After setting, the injection timer set macro 2 for the #n cylinder is ended.

【0204】その結果、1回噴射ではその噴射区間が過
ぎた後の区間で、複数回噴射では最後の噴射区間を過ぎ
た後の区間で、今回の区間で設定した有効噴射幅TEI
JAnが前回の区間で設定した値に比し、0.5ms以
上増加している場合には噴射タイマが延長され、また有
効噴射幅TEIJAnが減少している場合には、最後の
噴射区間の噴射タイマが短縮されて、1吸気行程中の気
筒に供給する噴射量の合計が調整される。
As a result, the effective injection width TEI set in the present section is obtained in the section after the injection section has passed in the single injection and in the section after the last injection section has been passed in the multiple injections.
When JAn is increased by 0.5 ms or more compared to the value set in the previous section, the injection timer is extended, and when the effective injection width TEIJAn is decreased, injection in the last injection section is performed. The timer is shortened to adjust the total injection amount supplied to the cylinder during one intake stroke.

【0205】一方、上記ステップS1300で噴射待ち状態
が継続されていると判断されてステップS1307へ進む
と、噴射タイマにセットされているタイマリロード値
に、今回の区間で設定した正或は負の値の有効噴射幅T
EIJAnを加算して、その値をアキュムレータAに格
納し、ステップS1308で、上記アキュムレータAの値
を、ゼロから1サイクルの最大噴射量である2回転時間
にリミットし(0≦A<2回転時間)、ステップS1309
で直ちに噴射を行うべくタイマ待ち時間を0として、ス
テップS1310でタイマリロード値を上記アキュムレータ
Aに格納されている値で設定し、ステップS1311で上記
タイマリロード値に対応する噴射パルスの出力パターン
をタイマにセットして当該#n気筒の噴射タイマセット
マクロ2を終了する。
On the other hand, when it is judged in step S1300 that the injection waiting state is continued and the routine proceeds to step S1307, the timer reload value set in the injection timer is set to the positive or negative value set in this section. Value of effective injection width T
EIJAn is added, and the value is stored in the accumulator A. In step S1308, the value of the accumulator A is limited to two rotation times, which is the maximum injection amount of one cycle from zero (0 ≦ A <2 rotation time). ), Step S1309
In step S1310, 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 end the injection timer set macro 2 for the #n cylinder.

【0206】上記タイマ待ち時間は、噴射終了時期を調
整するために、後述するステップS1325で設定されるも
のであるが、前回の噴射開始区間で設定された待ち時間
が今回の噴射開始区間においても依然と計時されている
場合には、タイマ待ち時間が異常に長いので、上記ステ
ップS1309でゼロにし、今回の噴射開始区間で直ちに噴
射を開始し、1吸気行程中に供給する噴射量を調整す
る。
The timer waiting time is set in step S1325 described later in order to adjust the injection end time, but the waiting time set in the previous injection start section is also set in the current injection start section. If the time is still being counted, the timer waiting time is abnormally long, so it is set to zero in step S1309 above, injection is immediately started in the current injection start section, and the injection amount supplied during one intake stroke is adjusted. .

【0207】また、上記ステップS1300で前回の噴射開
始区間での噴射が既に終了していると判断して、ステッ
プS1312へ進むとアキュムレータAに有効噴射幅TEI
JAnを格納し、ステップS1313で、このアキュムレー
タAの値が正か負あるいはゼロかを判断し、A≦0場合
ステップS1314へ進み、また、A>0の場合ステップS13
18へ分岐する。
Further, when it is judged in the above step S1300 that the injection in the previous injection start section has already ended, and the routine proceeds to step S1312, the effective injection width TEI is set in the accumulator A.
JAN is stored, and it is determined in step S1313 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 S1313.
Branch to 18.

【0208】ステップS1314では、有効噴射幅TEIJ
Anが増加してしないので1サイクル中の噴射を終了さ
せるため、噴射待ち設定フラグFLG_IJをクリア
し、ステップS1315でタイマ待ち時間をゼロとし、ステ
ップS1316で噴射タイマのリロード値をゼロとし、ステ
ップS1317で出力パターンをゼロとして当該#n気筒の
噴射タイマセットマクロ2を終了する。
In step S1314, the effective injection width TEIJ
Since An has not increased, the injection waiting setting flag FLG_IJ is cleared to end the injection in one cycle, the timer waiting 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. Then, the output pattern is set to zero and the injection timer set macro 2 for the #n cylinder concerned is ended.

【0209】また、上記ステップ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を終了す
る。
[0209] In addition, in step S1313, the effective injection width T
When EIJAn is positive, in step S1318, the dead time TSIN for each cylinder set by another control strategy is set in the accumulator A in order to compensate for the increase in the injection amount.
If Jn (n = # 1, # 2, # 3, # 4) is added, and the value stored in the accumulator A in step S1319 exceeds the maximum injection amount of one cycle, that is, two rotation times, When it is not in the injection waiting state, that is, when the injection waiting state is set, that is, the injection waiting state is determined by referring to the value of the injection waiting setting flag FLG_IJ in step S1320. Flag FLG
If _IJ is cleared, the process proceeds to step S1321, the timer waiting time is set to 0 in order to immediately inject the increased amount, the timer reload value is set at the value of the accumulator A (TEIJAn + TSINJn) in step S1322, and step S1323 is set. 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 concerned is ended.

【0210】一方、上記ステップ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 waiting and the process proceeds to step S1324, after the injection waiting setting flag FLG_IJ is cleared, in step S1325,
The timer waiting time is set by the injection start delay time IJDELY set in the injection start timing calculation routine, and the step
The timer reload value is set by the value of the accumulator A in S1326, the output pattern of the injection pulse corresponding to the timer reload value is set in the injection timer in step S1327, 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 this injection start section.

【0211】以上の結果、図25に示すように、燃料噴
射開始時期の算出ルーチンで設定した噴射開始区間設定
フラグIJTMGFによるビット指定で、1サイクル中
の噴射回数を4回、3回、2回等、複数回に設定するこ
とができる。また、複数回噴射において、最終回以外の
有効噴射幅を、次数nの指定にて要求噴射幅の1/4,
1/1等、任意に設定することができ、最終回噴射にお
いて1サイクル中の噴射幅の合計が最新の要求噴射幅に
なるように調整することができる。さらに、最終回噴射
の噴射開始区間内で噴射が終了しない場合には、噴射タ
イマを延長し、また有効噴射幅が減少した場合には、噴
射タイマを短縮して加速増量等過渡時の追従性を良くす
る。
As a result of the above, as shown in FIG. 25, the number of injections in one cycle is set to 4, 3, or 2 by the bit designation by the injection start section setting flag IJTMGF set in the calculation routine of the fuel injection start timing. Etc. can be set multiple times. Also, in multiple injections, the effective injection width other than the final injection is set to ¼ of the required injection width by designating the order n.
It can be set arbitrarily such as 1/1, and can be adjusted so that the sum 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 zone of the final injection, the injection timer is extended, and if the effective injection width decreases, the injection timer is shortened to follow the transition during acceleration and other increases. Improve

【0212】なお、図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. 25 (b) 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. 7C shows three times injection (IJTMGF = 32 + 8 + 2) effective injection width per injection is required. 1/4 of the injection width, 2 in FIG.
In the single injection (set to IJTMGF = 16 + 2), the effective injection width per injection is 1/1 of the required injection width, and FIG.
It shows an example in which the effective injection width per injection is set to 1/1 of the required injection width in each of two injections (IJTMGF = 4 + 2).

【0213】以上、本発明の一実施例について説明した
が、これに限定されず、多気筒エンジンであればよく、
また、水平対向エンジン以外のエンジンにも適用するこ
とができる。
Although one embodiment of the present invention has been described above, the present invention is not limited to this, as long as it is a multi-cylinder engine,
It can also be applied to engines other than horizontally opposed engines.

【0214】[0214]

【発明の効果】以上説明したように本発明によれば、多
気筒エンジンの各気筒の1サイクルを8区間に区分し、
この各区間をビット0からビット7に割当て、エンジン
回転に同期する割込み処理では、指示された1或は2箇
所以上のビットに基づき、現在の区間が噴射開始区間か
を気筒毎に判断するようにしたため、複数回噴射におけ
る噴射開始区間の指定が容易になり、割込み処理の負担
が軽減され良好な燃料噴射制御性を得ることができるな
ど優れた効果か奏される。
As described above, according to the present invention, one cycle of each cylinder of a multi-cylinder engine is divided into eight sections,
Each of the sections is assigned to bits 0 to 7, and in the interrupt processing synchronized with the engine rotation, it is determined for each cylinder whether the current section is the injection start section based on the instructed bit at one or two or more locations. Therefore, it is easy to specify the injection start section in a plurality of injections, the burden of interrupt processing is reduced, and good fuel injection controllability can be obtained.

【図面の簡単な説明】[Brief description of drawings]

【図1】0.5ms毎の定期割込み処理を示すフローチ
ャート
FIG. 1 is a flowchart showing a periodic interrupt process every 0.5 ms.

【図2】クラセン割込み処理を示すフローチャートFIG. 2 is a flowchart showing Krasen interrupt processing.

【図3】ジョブ優先処理を示すフローチャートFIG. 3 is a flowchart showing job priority processing.

【図4】ジョブ実行サブルーチンを示すフローチャートFIG. 4 is a flowchart showing a job execution subroutine.

【図5】同上[FIG. 5] Same as above

【図6】同上[FIG. 6] Same as above

【図7】同上[FIG. 7] Same as above

【図8】クランク位置算出サブルーチンを示すフローチ
ャート
FIG. 8 is a flowchart showing a crank position calculation subroutine.

【図9】CCAS・RCAS判別サブルーチンを示すフ
ローチャート
FIG. 9 is a flowchart showing a CCAS / RCAS discrimination subroutine.

【図10】燃料噴射開始時期の算出ルーチンを示すフロ
ーチャート
FIG. 10 is a flowchart showing a routine for calculating a fuel injection start timing.

【図11】同上[FIG. 11] Same as above

【図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 Same as above

【図15】噴射タイマセットマクロ2ルーチンを示すフ
ローチャート
FIG. 15 is a flowchart showing an injection timer set macro 2 routine.

【図16】同上FIG. 16 Same as above

【図17】ジョブの実行状態を示す説明図FIG. 17 is an explanatory diagram showing 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 the job execution flag and the 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 crank position, a cam position, a crank position variable, an injection start section table, and a time chart of 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.

【符号の説明】[Explanation of symbols]

1…エンジン 25…インジェクタ 39…クランク角センサ 41…カム角センサ 50…電子制御装置 ACAS…クランク総合位置変数 IJnTBL…噴射開始区間テーブル IJTMGF…噴射開始区間設定フラグ TEIJAn…有効噴射幅 1 ... Engine 25 ... Injector 39 ... Crank angle sensor 41 ... Cam angle sensor 50 ... Electronic control unit ACAS ... Crank overall position variable IJnTBL ... Injection start section table IJTMGF ... Injection start section setting flag TEIJAn ... Effective injection width

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 多気筒エンジンの各気筒の1サイクルを
吸気行程後半、吸気行程前半、排気行程後半、排気行程
前半、燃焼行程後半、燃焼行程前半、圧縮行程後半、圧
縮行程前半の8区間に区分し、 この各区間を噴射開始区間としてビット0からビット7
で表し、 指示された1或は2箇所以上のビットに基づいて各気筒
の噴射開始区間を設定することを特徴とする多気筒エン
ジンの気筒別噴射開始区間設定方法。
1. One cycle of each cylinder of a multi-cylinder engine is divided into eight sections, namely the latter half of the intake stroke, the first half of the intake stroke, the latter half of the exhaust stroke, the first half of the exhaust stroke, the latter half of the combustion stroke, the first half of the combustion stroke, the latter half of the compression stroke, and the first half of the compression stroke. It is divided, and each of these sections is used as an injection start section and bit 0 to bit 7
The method for setting an injection start section for each cylinder of a multi-cylinder engine is characterized in that the injection start section for each cylinder is set on the basis of one or two or more designated bits.
JP16263993A 1993-06-30 1993-06-30 Method for setting injection starting internal for each cylinder of multi-cylinder engine Pending JPH0719100A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16263993A JPH0719100A (en) 1993-06-30 1993-06-30 Method for setting injection starting internal for each cylinder of multi-cylinder engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16263993A JPH0719100A (en) 1993-06-30 1993-06-30 Method for setting injection starting internal for each cylinder of multi-cylinder engine

Publications (1)

Publication Number Publication Date
JPH0719100A true JPH0719100A (en) 1995-01-20

Family

ID=15758448

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16263993A Pending JPH0719100A (en) 1993-06-30 1993-06-30 Method for setting injection starting internal for each cylinder of multi-cylinder engine

Country Status (1)

Country Link
JP (1) JPH0719100A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7384555B1 (en) * 1993-09-22 2008-06-10 Kurita Water Industries Ltd. Process for biological treatment of aqueous organic wastes

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7384555B1 (en) * 1993-09-22 2008-06-10 Kurita Water Industries Ltd. Process for biological treatment of aqueous organic wastes

Similar Documents

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