JPH06272651A - Current-carrying sequence setting method in ignition control for engine - Google Patents

Current-carrying sequence setting method in ignition control for engine

Info

Publication number
JPH06272651A
JPH06272651A JP6071793A JP6071793A JPH06272651A JP H06272651 A JPH06272651 A JP H06272651A JP 6071793 A JP6071793 A JP 6071793A JP 6071793 A JP6071793 A JP 6071793A JP H06272651 A JPH06272651 A JP H06272651A
Authority
JP
Japan
Prior art keywords
ignition
job
energization
timer
time
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
JP6071793A
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 JP6071793A priority Critical patent/JPH06272651A/en
Publication of JPH06272651A publication Critical patent/JPH06272651A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To secure optimum current-carrying time of an ignition coil irrespec tive of ignition distances. CONSTITUTION:It is judged whether or not a value of an ignition cylinder information parameter IGRCAS shows same value both in view of dowel and ignition (S1607). When the ignition cylinder information parameter IGRCAS shows same value as that in the ignition, the normal ignition completion is judged and interruption is completed. Then, a first current-carrying sequence made up of the waiting time, dowel on, dowel time, ignition is set in an ignition timer when the next dowel is started by interruption. When the ignition cylinder information parameter shows different value from that in the ignition, necessary of immediate starting of dowel is judged. The timer initial value is set to 256 and the timer reload value is set to FFFF (S1609, S1610). The ignition timer is then started (S1612). Thus, a second current-carrying sequence made up of dowel off time and ignition is set in the ignition timer when the ignition is started by interruption.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、点火終了時に次の点火
の通電シーケンスを設定して点火を行なうエンジンの点
火制御における通電シーケンスの設定方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for setting an energization sequence in ignition control of an engine for setting the next ignition energization sequence at the end of ignition to perform ignition.

【0002】[0002]

【従来の技術】近年、自動車などの車輌にマイクロコン
ピュータが導入され、エンジン、パワートレインなどを
高精度に制御することが可能となった。このマイクロコ
ンピュータは、定電圧回路や各種周辺回路を加えた電子
制御装置(ECU)として車輌に搭載され、車輌の運転
状態を検出する各種センサ類からの信号に基づいてエン
ジンの燃料噴射制御や点火制御などを実行する。
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. This microcomputer is mounted on a vehicle as an electronic control unit (ECU) that includes a constant voltage circuit and various peripheral circuits, and controls fuel injection and ignition of the engine based on signals from various sensors that detect the operating state of the vehicle. Performs control, etc.

【0003】上記ECUによる点火制御は、通常、所定
クランク角毎の割込み処理で実行され、例えば特開昭6
2−159747号公報には、所定クランク角毎の割込
みルーチンにおいて、吸入空気量及びエンジン回転数に
基づくマップの補間計算から基本点火時期を計算し、こ
の基本点火時期に、ノッキング、冷却水温などによる遅
角補正を加えて最終的な点火時期(角度)を算出した
後、この最終的な点火時期(角度)を時間に換算して点
火コイルの通電終了時刻、通電開始時刻を点火時期制御
用カウンタ(タイマ)にセットする技術が開示されてい
る。
The ignition control by the ECU is usually executed by interrupt processing for each predetermined crank angle.
In Japanese Patent Laid-Open No. 2-159747, a basic ignition timing is calculated from an interpolation calculation of a map based on an intake air amount and an engine speed in an interrupt routine for each predetermined crank angle, and the basic ignition timing is determined by knocking, cooling water temperature, or the like. After the final ignition timing (angle) is calculated by adding the retardation correction, the final ignition timing (angle) is converted into time and the energization end time and energization start time of the ignition coil are set to the ignition timing control counter. A technique of setting a timer is disclosed.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、エンジ
ン高回転時には、必然的に点火間隔が小さくなるため、
次のクランク割込み時に点火コイルの通電開始時刻をセ
ットするのみでは、点火コイルの通電時間が短くなって
必要な点火エネルギーが蓄積されず、失火が発生するお
それがある。
However, since the ignition interval is inevitably shortened at the time of high engine speed,
If only the energization start time of the ignition coil is set at the next crank interruption, the energization time of the ignition coil is shortened, the necessary ignition energy is not accumulated, and misfire may occur.

【0005】本発明は上記事情に鑑みてなされたもの
で、点火間隔の大小に拘らず常に最適な点火コイルの通
電時間を確保することのできるエンジンの点火制御にお
ける通電シーケンスの設定方法を提供することを目的と
している。
The present invention has been made in view of the above circumstances, and provides a method for setting an energization sequence in engine ignition control that can always ensure an optimum ignition coil energization time regardless of the size of the ignition interval. Is intended.

【0006】[0006]

【課題を解決するための手段】第1の発明は、エンジン
のクランク位置を検出する信号の入力毎に区間を設定
し、この区間を基準として点火コイルの通電・遮断を行
ない、点火制御を実行する際に、点火終了時に、上記点
火コイルの通電終了と通電開始とが同一区間内となるか
否かを判別し、通電終了と通電開始が同一区間内でない
と判別した場合、通電を開始する区間となってから通電
開始までの時間のデータと、通電継続時間のデータとを
点火タイマにセットする第1の通電シーケンスを設定
し、通電終了と通電開始とが同一区間内となると判別し
た場合、点火終了から所定のオフ時間をもって通電を開
始させるデータを上記点火タイマにセットした後、点火
を実行する区間となってから通電終了までの時間のデー
タを上記点火タイマにセットする第2の通電シーケンス
を設定することを特徴とする。
According to a first aspect of the present invention, a section is set for each input of a signal for detecting the crank position of an engine, and the ignition coil is energized / interrupted with reference to this section to execute ignition control. At the end of ignition, it is determined whether the energization end and energization start of the ignition coil are in the same section, and if energization end and energization start are not in the same section, energization is started. When it is determined that the first energization sequence that sets the data of the time from the start of energization to the start of energization and the data of the energization duration in the ignition timer is set and the end of energization and the start of energization are within the same section After setting the data for starting energization with a predetermined off time from the end of ignition to the ignition timer, the data for the time from the start of the ignition to the end of energization is set in the ignition timer. And sets the second energization sequence of Tsu and.

【0007】第2の発明は、第1の発明において、上記
点火コイルの通電終了と通電開始とが同一区間内となる
か否かを、通電開始区間となってから次の通電開始区間
となるまで点火対象気筒を一定の値で示すデータと、こ
のデータと同一気筒に対して同じ値を取り、通電終了区
間となってから次の通電終了区間となるまで点火対象気
筒を一定の値で示すデータとが異なるか否かにより判別
することを特徴とする。
According to a second aspect of the present invention, in the first aspect, whether or not the energization end and the energization start of the ignition coil are within the same section is the energization start section and then the next energization start section. Up to the data indicating the cylinder to be ignited with a constant value and the same value for this data as the same cylinder, and indicating the cylinder to be ignited with a constant value from the energization end section to the next energization end section The feature is that it is determined whether or not the data is different.

【0008】[0008]

【作用】第1の発明では、点火終了時に、点火コイルの
通電終了と通電開始とが同一区間内となるか否かを判別
し、その判別結果に応じて第1,第2の通電シーケンス
のいずれかを設定する。すなわち、通電終了と通電開始
が同一区間内でない場合には、通電を開始する区間とな
ってから通電開始までの時間のデータと、通電継続時間
のデータとを点火タイマにセットする第1の通電シーケ
ンスを設定し、通電終了と通電開始とが同一区間内とな
る場合には、点火終了から所定のオフ時間をもって通電
を開始させるデータを点火タイマにセットした後、点火
を実行する区間となってから通電終了までの時間のデー
タを点火タイマにセットする第2の通電シーケンスを設
定して、点火コイルの通電・遮断を行ない、点火制御を
実行する。
In the first aspect of the present invention, it is determined whether or not the energization end and the energization start of the ignition coil are within the same section at the end of ignition, and the first and second energization sequences are determined according to the result of the determination. Set either. That is, when the end of energization and the start of energization are not in the same section, the first energization for setting the data of the time from the start of energization to the start of energization and the data of energization continuation time in the ignition timer. When the sequence is set and the end of energization and the start of energization are in the same section, after setting the data to start energization with a predetermined off time from the end of ignition to the ignition timer, it becomes the section to execute ignition. A second energization sequence is set in which the data of the time from the start of energization to the ignition timer is set, the energization / interruption of the ignition coil is performed, and the ignition control is executed.

【0009】第2の発明では、第1の発明において、通
電開始区間となってから次の通電開始区間となるまで点
火対象気筒を一定の値で示すデータと、このデータと同
一気筒に対して同じ値を取り、通電終了区間となってか
ら次の通電終了区間となるまで点火対象気筒を一定の値
で示すデータとが異なるか否かにより、点火コイルの通
電終了と通電開始とが同一区間内となるか否かを判別
し、通電シーケンスを設定する。
According to a second aspect of the present invention, in the first aspect of the present invention, data indicating the cylinder to be ignited by a constant value from the energization start section to the next energization start section and the same cylinder as this data are set. It takes the same value, and whether the ignition coil energization end and energization start are the same section depending on whether the data indicating the ignition target cylinder with a constant value differs from the energization end section to the next energization end section It is determined whether or not it is within the range, and the energization sequence is set.

【0010】[0010]

【実施例】以下、図面を参照して本発明の実施例を説明
する。図面は本発明の一実施例に係り、図1は点火終了
時割込み処理のフローチャート、図2は0.5ms毎の
定期割込み処理のフローチャート、図3はクラセン割込
み処理のフローチャート、図4はジョブ優先処理のフロ
ーチャート、図5はジョブ実行サブルーチンの部分フロ
ーチャート1、図6はジョブ実行サブルーチンの部分フ
ローチャート2、図7はジョブ実行サブルーチンの部分
フローチャート3、図8はジョブ実行サブルーチンの部
分フローチャート4、図9はクランク位置算出サブルー
チンのフローチャート、図10はCCAS・RCAS判
別サブルーチンのフローチャート、図11は点火スケジ
ュール作成サブルーチンの部分フローチャート1、図1
2は点火スケジュール作成サブルーチンの部分フローチ
ャート2、図13は点火スケジュール作成サブルーチン
の部分フローチャート3、図14は点火スケジュール作
成サブルーチンの部分フローチャート4、図15は点火
タイマセットサブルーチンの部分フローチャート1、図
16は点火タイマセットサブルーチンの部分フローチャ
ート2、図17はジョブの実行状態を示す説明図、図1
8はジョブフラグの説明図、図19はクランク位置変数
の説明図、図20はジョブ実行中フラグとオーバーラッ
プカウンタの変化を示す説明図、図21はシステムシフ
トバッファの説明図、図22はクラセン間隔テーブルの
説明図、図23は気筒・クランク位置状態マップの説明
図、図24は点火シーケンスと点火区間変数の説明図、
図25は点火スケジュールの説明図、図26はスケジュ
ールポインタテーブルの説明図、図27は点火タイマセ
ットの説明図、図28は通電状態マップの説明図、図2
9は通電気筒情報と点火気筒情報との関係を示す説明
図、図30はクランク位置とエンジンの行程を示すタイ
ムチャート、図31はエンジン系の概略構成図、図32
はクランクロータとクランク角センサの正面図、図33
はカムロータとカム角センサの正面図、図34は電子制
御系の回路構成図である。
Embodiments of the present invention will be described below with reference to the drawings. The drawings relate to one embodiment of the present invention, FIG. 1 is a flowchart of interrupt processing at the end of ignition, FIG. 2 is a flowchart of periodic interrupt processing at intervals of 0.5 ms, FIG. 3 is a flowchart of classen interrupt processing, and FIG. 5 is a partial flowchart 1 of the job execution subroutine, FIG. 6 is a partial flowchart 2 of the job execution subroutine, FIG. 7 is a partial flowchart 3 of the job execution subroutine, and FIG. 8 is a partial flowchart 4 of the job execution subroutine. Is a flowchart of a crank position calculation subroutine, FIG. 10 is a flowchart of a CCAS / RCAS discrimination subroutine, and FIG. 11 is a partial flowchart 1 of an ignition schedule creation subroutine.
2 is a partial flowchart 2 of the ignition schedule creating subroutine, FIG. 13 is a partial flowchart 3 of the ignition schedule creating subroutine, FIG. 14 is a partial flowchart 4 of the ignition schedule creating subroutine, FIG. 15 is a partial flowchart 1 of the ignition timer setting subroutine, and FIG. FIG. 1 is a partial flowchart 2 of the ignition timer setting subroutine, and FIG. 17 is an explanatory view showing a job execution state.
8 is an explanatory diagram of the job flag, FIG. 19 is an explanatory diagram of the crank position variable, FIG. 20 is an explanatory diagram showing changes in the job executing flag and the overlap counter, FIG. 21 is an explanatory diagram of the system shift buffer, and FIG. 23 is an explanatory diagram of the interval table, FIG. 23 is an explanatory diagram of a cylinder / crank position state map, FIG. 24 is an explanatory diagram of an ignition sequence and ignition interval variables,
25 is an explanatory diagram of an ignition schedule, FIG. 26 is an explanatory diagram of a schedule pointer table, FIG. 27 is an explanatory diagram of an ignition timer set, FIG. 28 is an explanatory diagram of an energization state map, and FIG.
9 is an explanatory view showing the relationship between energized cylinder information and ignition cylinder information, FIG. 30 is a time chart showing the crank position and the stroke of the engine, FIG. 31 is a schematic configuration diagram of the engine system, and FIG.
Is a front view of the crank rotor and the crank angle sensor, and FIG.
Is a front view of a cam rotor and a cam angle sensor, and FIG. 34 is a circuit configuration diagram of an electronic control system.

【0011】本実施例のエンジン制御システムでは、図
34に示すマイクロコンピュータを中核とした電子制御
装置(ECU)50により図31に示すエンジン系が制
御され、燃料噴射制御、点火時期制御などが行なわれ
る。上記ECU50のマイクロコンピュータには、新し
い概念に基づくオペレーティングシステム(OS)が搭
載され、このOSにより、各センサ類からの信号入力処
理、エンジン回転数算出処理、吸入空気量算出処理、燃
料噴射量設定処理、点火時期設定処理などといった各制
御項目毎のジョブが管理されて効率的に実行されるよう
になっている。
In the engine control system of this embodiment, the engine system shown in FIG. 31 is controlled by an electronic control unit (ECU) 50 having a microcomputer shown in FIG. 34 as a core, and fuel injection control, ignition timing control, etc. are performed. Be done. The microcomputer of the ECU 50 is equipped with an operating system (OS) based on a new concept. With this OS, signal input processing from each sensor, engine speed calculation processing, intake air amount calculation processing, fuel injection amount setting Jobs for each control item such as processing and ignition timing setting processing are managed and efficiently executed.

【0012】まず、上記ECU50によって制御される
エンジン系の機器構成について説明する。
First, a device configuration of an engine system controlled by the ECU 50 will be described.

【0013】図31に示すように、エンジン1(図にお
いては水平対向4気筒型エンジンを示す)は、シリンダ
ヘッド2の吸気ポート2aにインテークマニホルド3が
連通され、このインテークマニホルド3の上流にエアチ
ャンバ4を介してスロットル通路5が連通されている。
このスロットル通路5の上流側には、吸気管6を介して
エアクリーナ7が取付けられ、このエアクリーナ7が吸
入空気の取り入れ口であるエアインテークチャンバ8に
連通されている。
As shown in FIG. 31, an engine 1 (a horizontally opposed four-cylinder type engine is shown in the figure) has an intake manifold 3 communicated with an intake port 2 a of a cylinder head 2, and an intake manifold 3 is provided with an air intake upstream of the intake manifold 3. A throttle passage 5 communicates with the 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.

【0014】また、上記排気ポート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 inserted in the exhaust pipe 10 and 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.

【0015】また、上記レゾネータチャンバ14と上記
インテークマニホルド3とを連通して上記スロットルバ
ルブ5aの上流側と下流側とをバイパスするバイパス通
路15に、アイドルスピードコントロールバルブ(IS
CV)16が介装されている。さらに、このISCV1
6の直下流側に、吸気圧が負圧のとき開弁し、またター
ボチャージャ18によって過給されて吸気圧が正圧にな
ったとき閉弁するチェックバルブ17が介装されてい
る。
In addition, an idle speed control valve (IS) is provided in a bypass passage 15 that 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.

【0016】上記ターボチャージャ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.

【0017】上記ウエストゲート弁作動用アクチュエー
タ20は、ダイヤフラムにより2室に仕切られ、一方が
ウエストゲート弁制御用デューティソレノイド弁21に
連通される圧力室を形成し、他方が上記ウエストゲート
弁19を閉方向に付勢するスプリングを収納したスプリ
ング室を形成している。
The waste gate valve actuating actuator 20 is divided into two chambers by a diaphragm, one of which forms a pressure chamber communicating with the waste gate valve 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.

【0018】上記ウエストゲート弁制御用デューティソ
レノイド弁21は、上記レゾネータチャンバ14と上記
吸気管6の上記ターボチャージャ18のコンプレッサ下
流とを連通する通路に介装されており、ECU50から
出力される制御信号のデューティ比に応じて、上記レゾ
ネータチャンバ14側の圧力と上記コンプレッサ下流側
の圧力とを調圧し、上記ウエストゲート弁作動用アクチ
ュエータ20の圧力室に供給する。
The wastegate valve controlling duty solenoid valve 21 is interposed in a passage that connects the resonator chamber 14 and the compressor downstream of the turbocharger 18 of the intake pipe 6, and is output from 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.

【0019】すなわち、上記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.

【0020】また、上記インテークマニホルド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.

【0021】さらに、上記インテークマニホルド3の各
気筒の各吸気ポート2aの直上流側にインジェクタ25
が臨まされ、また、上記シリンダヘッド2の各気筒毎
に、その先端を燃焼室に露呈する点火プラグ26が取付
けられ、この点火プラグ26に各気筒毎に配設された点
火コイル26aを介してイグナイタ27が接続されてい
る。
Further, an injector 25 is provided immediately upstream of each intake port 2a of each cylinder of the intake manifold 3.
Further, an ignition plug 26 whose tip is exposed to the combustion chamber is attached to each cylinder of the cylinder head 2, and an ignition coil 26a is provided to this ignition plug 26 for each cylinder. The igniter 27 is connected.

【0022】上記インジェクタ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.

【0023】また、上記吸気管6の上記エアークリーナ
7の直下流に、ホットワイヤ式あるいはホットフィルム
式などの吸入空気量センサ32が介装され、上記スロッ
トルバルブ5aに、スロットル開度センサ33aとアイ
ドルスイッチ33bとを内蔵したスロットルセンサ33
が連設されている。
An intake air amount sensor 32 of a hot wire type or a hot film type is provided in the intake pipe 6 immediately downstream of the air cleaner 7, and the throttle valve 5a is connected to a throttle opening sensor 33a. Throttle sensor 33 with built-in idle switch 33b
Are lined up.

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

【0025】また、上記シリンダブロック1aに支承さ
れたクランクシャフト1bにクランクロータ38が軸着
され、このクランクロータ38の外周に、電磁ピックア
ップなどからなるクランク角センサ39が対設されてい
る。さらに、上記エンジン1のカムシャフト1cに連設
するカムロータ40に、電磁ピックアップなどからなる
気筒判別用のカム角センサ41が対設されている。尚、
上記クランク角センサ39及び上記カム角センサ41
は、電磁ピックアップなどの磁気センサに限らず、光セ
ンサなどでも良い。
A crank rotor 38 is rotatably mounted on a 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.

【0026】上記クランクロータ38は、図32に示す
ように、その外周に突起38a,38b,38cが形成
され、これらの各突起38a,38b,38cが、各気
筒(#1,#2と#3,#4)の圧縮上死点前(BTD
C)θ1,θ2,θ3 の位置に形成されており、本実施例に
おいては、θ1 =97°CA、θ2 =65°CA、θ3
=10°CAである。
As shown in FIG. 32, 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 the cylinders (# 1, # 2 and #). Before # 3, # 4 compression top dead center (BTD
C) It is formed at the positions of θ1, θ2, θ3, and in the present embodiment, θ1 = 97 ° CA, θ2 = 65 ° CA, θ3.
= 10 ° CA.

【0027】上記クランクロータ38の各突起は、上記
クランク角センサ39によって検出され、図30のタイ
ムチャートに示すように、BTDC97°,65°,1
0°のクランクパルスがエンジン1/2回転毎(180
°CA毎)に出力される。そして、各信号の入力間隔時
間がタイマによって計時され、エンジン回転数が算出さ
れる。
The protrusions of the crank rotor 38 are detected by the crank angle sensor 39, and as shown in the time chart of FIG. 30, BTDC 97 °, 65 °, 1
A crank pulse of 0 ° is generated every ½ revolution of the engine (180
Output every (° CA). Then, the input interval time of each signal is counted by a timer, and the engine speed is calculated.

【0028】尚、突起38bは、点火時期設定の際の基
準クランク角となり、また、突起38cは、始動時噴射
開始時期の基準クランク角となるとともに始動時の固定
点火時期を示すクランク角となる。
The protrusion 38b serves as a reference crank angle when setting the ignition timing, and the protrusion 38c serves as a reference crank angle for the injection start timing at the start and a crank angle indicating the fixed ignition timing at the start. .

【0029】また、図33に示すように、上記カムロー
タ40の外周には、気筒判別用の突起40a,40b,
40cが形成され、突起40aが#3,#4気筒の圧縮
上死点後(ATDC)θ4 の位置に形成され、突起40
bが3個の突起で構成されて最初の突起が#1気筒のA
TDCθ5 の位置に形成されている。さらに、突起40
cが2個の突起で形成され、最初の突起が#2気筒のA
TDCθ6 の位置に形成されている。本実施例において
は、θ4 =20°CA、θ5 =5°CA、θ6=20°
CAである。
Further, as shown in FIG. 33, on the outer periphery of the cam rotor 40, the 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 TDC θ6. In this embodiment, θ4 = 20 ° CA, θ5 = 5 ° CA, θ6 = 20 °
It is CA.

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

【0031】一方、図34に示すECU50は、燃料噴
射制御、点火時期制御などを行なうメインコンピュータ
51と、ノック検出処理を行なう専用のサブコンピュー
タ52との2つのコンピュータを中心として構成され、
各部に所定の安定化電源を供給する定電圧回路53や各
種の周辺回路が組込まれている。
On the other hand, the ECU 50 shown in FIG. 34 is mainly composed of two computers, that is, 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 circuit 53 for supplying a predetermined stabilizing power source and various peripheral circuits are incorporated in each unit.

【0032】上記定電圧回路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.

【0033】すなわち、上記定電圧回路53は、上記イ
グニッションスイッチ56がONされ、上記ECUリレ
ー54のリレー接点が閉となったとき、制御用電源を供
給し、また、上記イグニッションスイッチ56がOFF
されたとき、バックアップ用の電源を供給する。
That is, the constant voltage circuit 53 supplies control power when the ignition switch 56 is turned on and the relay contact of the ECU relay 54 is closed, and the ignition switch 56 is turned off.
Supply the power for backup when

【0034】上記メインコンピュータ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.

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

【0036】また、上記サブコンピュータ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 similarly to 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.

【0037】上記メインコンピュータ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.

【0038】尚、本実施例においては、上記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.

【0039】また、上記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.

【0040】一方、上記サブコンピュータ52のI/O
インターフェース76は、入力ポートに、クランク角セ
ンサ39、カム角センサ41が接続されるとともに、A
/D変換器78、周波数フィルタ79、アンプ80を介
してノックセンサ34が接続されており、上記ノックセ
ンサ34からのノック検出信号が上記アンプ80で所定
のレベルに増幅された後に上記周波数フィルタ79によ
り必要な周波数成分が抽出され、上記A/D変換器78
にてデジタル信号に変換されて入力されるようになって
いる。
On the other hand, the I / O of the 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.

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

【0042】そして、上記燃料噴射量に相応する駆動パ
ルス幅信号を、駆動回路67を介して所定のタイミング
で該当気筒のインジェクタ25に出力して燃料を噴射
し、また、所定のタイミングでイグナイタ27に点火信
号を出力し、該当気筒の点火プラグ26を点火する。
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 26 of the corresponding cylinder.

【0043】その結果、該当気筒に供給された混合気が
爆発燃焼し、エキゾーストマニホルド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 O2 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 the reference voltage (slice level) with
It is determined whether the engine air-fuel ratio state is on the rich side or lean side with respect to the target air-fuel ratio, and feedback control is performed so that the air-fuel ratio becomes the target air-fuel ratio.

【0044】一方、上記サブコンピュータ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.

【0045】上記サブコンピュータ52のI/Oインタ
ーフェース76の出力ポートは、上記メインコンピュー
タ51のI/Oインターフェース64の入力ポートに接
続されており、上記サブコンピュータ52でのノック判
定結果がI/Oインターフェース76に出力される。そ
して、上記メインコンピュータ51では、上記サブコン
ピュータ52からノック発生有りの判定結果が出力され
ると、SCI63を介してシリアル通信ラインよりノッ
クデータを読込み、このノックデータに基づいて直ちに
該当気筒の点火時期を遅らせ、ノックを回避する。
The output port of the I / O interface 76 of the sub computer 52 is connected to the input port of the I / O interface 64 of the main computer 51, 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.

【0046】このようなエンジン制御において、上記メ
インコンピュータ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.

【0047】上記OSのマネジメント機能としては、 (1-1)ジョブの優先処理 (1ー2)セクション定義による各ジョブの分割ファイル対
応 (1-3)スタックの使用状況モニタ機能 (1-4)異常割込み動作のモニタ機能 (1-5)ジョブ毎に固有の制約を作らない標準マップ・標
準ワークメモリ設定 などの機能があり、制御ストラテジーの開発環境を向上
させるとともに、限られたCPU能力を最大限に発揮さ
せ、デジタル制御理論の基本である等時間間隔処理を可
能な限り達成することができる。
As the management function of the above OS, (1-1) priority processing of jobs (1-2) support for divided files of each job by section definition (1-3) stack usage monitoring function (1-4) Abnormal interrupt operation monitor 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.

【0048】等時間間隔処理としては、0.5ms毎の
定期割込みを基本として、2,4,10,50,250
ms毎の5種類の等間隔割込みジョブが用意されてお
り、また、エンジン回転に同期した処理として、クラン
ク角信号入力により即割込み実行される高優先クラセン
ジョブ(以下、単にクラセンジョブと称する)と、より
優先順位が高い他のジョブがないときにクランク角信号
入力により割込み実行される比較的緊急度の低い低優先
クラセンジョブとが用意されている。
As the equal time interval processing, 2, 4, 10, 50, 250 are based on the 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.

【0049】これらの各ジョブには、クラセンジョブ>
2msジョブ>4msジョブ>10msジョブ>低優先
クラセンジョブ>50msジョブ>250msジョブの
順で、7〜1の優先レベルが高位側から低位側に向かっ
て付けられており、図17に示すように、高速ジョブに
対し低速ジョブが分割して処理されるとともに、各ジョ
ブの多重待ち処理が行なわれる。
Each of these jobs includes a class 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.

【0050】また、上記OSの下で働く各プログラム
は、機能別の管理領域すなわちセクション領域毎に順番
に配列されており、各セクション領域には機能毎にセク
ション宣言によって名前が付けられている。各ストラテ
ジーファイル側で使用する主なセクション領域は、 ○変数宣言領域 ○自己ファイル名、ファイル制作時の自動記録領域 ○セッティングデータ領域 ○クラセンジョブ領域 ○2msジョブ領域 ○4msジョブ領域 ○10msジョブ領域 ○低優先クラセンジョブ領域 ○50msジョブ領域 ○250msジョブ領域 ○リセット時初期化ジョブ領域 ○エンスト時初期化ジョブ領域 ○バックグランドジョブ領域 ○プログラム本体の領域 であり、機能毎にファイルを分割してプログラム開発が
可能になるとともに、プログラムの構造化記述を可能に
する。
Further, each program operating under the OS is arranged in order for each function-based management area, that is, for each section area, and each section area is named for each function by a section declaration. The main section areas used on each strategy file side are: ○ Variable declaration area ○ Self-file name, automatic recording area during 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 ○ Engine stall initialization job area ○ Background job area ○ Program body area, which is a file division for each function and program development It also enables structured description of programs.

【0051】また、上記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 internal strategy closely related to the above management function Simulation function (engine rotation and A / D conversion) (2-4) Ignition timer set (2-5) Fuel injection timer set and other functions are provided. Furthermore, various service routines related to these functions are provided. It is prepared in each job.

【0052】従来、このような機能は各ジョブレベルで
達成するようになっていたが、本システムにおいては、
すべて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 fuel injection timer and the ignition timer.

【0053】次に、上記メインコンピュータ51の点火
制御の機能を、ジョブ処理の説明を基本として図1〜図
16のフローチャートに従って説明する。尚、サブコン
ピュータ52はノック検出処理専用のコンピュータであ
るため、その動作説明を省略する。
Next, the ignition control function of the main computer 51 will be described with reference to the flowcharts of FIGS. Since the sub computer 52 is a computer dedicated to knock detection processing, its operation description is omitted.

【0054】まず、イグニッションスイッチ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.

【0055】そして、このバックグランドジョブの上
で、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.

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

【0057】まず、図2に示す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. 2 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.

【0058】次いで、ステップS103へ進み、スイッチ出
力の転写を行なう。このスイッチ出力は、各ジョブ中で
メモリに書き込んだビットのON,OFF値であり、各
ジョブからは直接I/Oインターフェース64の出力ポ
ートに出力せず、OS側で0.5ms毎にメモリの値を
出力ポートに転写する。
Then, 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.

【0059】次に、ステップ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.

【0060】上記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.

【0061】尚、エンジン回転数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.

【0062】また、図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.

【0063】そして、上記ステップ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.

【0064】その結果、ジョブフラグ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.

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

【0066】上記オーバーラップカウンタ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.

【0067】次いで、上記ステップ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.

【0068】一方、この0.5ms毎の定期割込みに対
し、図3のクラセンによる割込みでは、ステップ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, a crank position / half-rotation time calculation subroutine described below is executed to calculate a crank position variable for determining the current crank position and a half-rotation time that is the sum of the latest three Classen intervals.

【0069】上記クランク位置変数は、OS中で用意さ
れるシステム変数であり、図19に示すように、#1〜
#4気筒に対するクランク位置を、97°,65°,1
0°CAによって12の状態の区間に区分し、現在のク
ランク位置を表わす。
The crank position variables are system variables prepared in the OS, and as shown in FIG.
Crank position for # 4 cylinder is 97 °, 65 °, 1
It is divided into 12 state sections by 0 ° CA and represents the current crank position.

【0070】すなわち、各気筒毎に、0,1,2の数値
でクラセン入力順を示すクランク位置情報変数S_CC
AS、#1気筒を0、#3気筒を1、#2気筒を2、#
4気筒を3として気筒の燃焼順を示す気筒情報変数S_
RCAS、及び、0〜11の数値でクラセン順序及び気
筒順序を総合的に表わすクランク総合位置変数S_AC
ASの3変数によって現在のクランク位置を表わし、さ
らに、クランク位置が確証をもって正常に判別されたと
きを0、判別結果がつじつまが合わず不安の残る推定状
態を1、不明な状態を2とするエラーレベルS_ECA
Sにより、クランク位置の判別状況を表わすようになっ
ている。尚、図19においては、システム変数であるこ
とを示すS_を省略している。
That is, for each cylinder, the crank position information variable S_CC indicating the order of Krasen input by numerical values 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 a crank total position variable S_AC that comprehensively represents the Krasen order and the cylinder order with numerical values of 0 to 11
The current crank position is represented by the three variables of AS, and when the crank position is normally discriminated with confirmation, it is set to 0, an estimated state where the discriminant results are not consistent and 1 is anxiety, and 2 is an unknown state. Error level S_ECA
S is used to indicate the determination status of the crank position. Incidentally, in FIG. 19, S_ indicating a system variable is omitted.

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

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

【0073】尚、上記エンストフラグは、エンジンがエ
ンスト状態であることを示すフラグであり、クラセン間
隔が0.5sec以上の時間(約30rpm以下)のと
き、50msジョブに用意されているエンスト処理ルー
チンによりセットされ、このクラセン割込みによりクリ
アされてエンスト状態が解除される。
The engine stall flag is a flag indicating that the engine is in the 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.

【0074】次に、ステップS204へ進むと、後述する点
火タイマセットのサブルーチンを実行し、点火シーケン
ス決定のための後述する点火スケジュールに従って点火
タイマをセットする。次いで、ステップS205で、燃料噴
射タイマセットのサブルーチンを実行し、ユーザージョ
ブ側で設定した燃料噴射量の指示値(各気筒毎の噴射
幅)に対し、燃料噴射開始時期などを燃料噴射タイマに
セットしてステップS206へ進む。
Next, in step S204, the ignition timer setting subroutine described below is executed, and the ignition timer is set according to the ignition schedule described below for determining the ignition sequence. Next, in step S205, the fuel injection timer setting subroutine is executed, and the fuel injection start timing and the like are set in the fuel injection timer for the fuel injection amount instruction value (injection width for each cylinder) set on the user job side. Then, the process proceeds to step S206.

【0075】ステップS206では、このクラセンが実行さ
れた現状のジョブレベルが自身のジョブレベルであるか
否かを判別し、現状がクラセンジョブ自身のレベルであ
るときには、ステップS207、S208で、クラセンジョブ、
低優先クラセンジョブのオーバーラップカウンタOLC
を、それぞれ1増加させて割込みを終了し、現状のジョ
ブレベルがクラセンジョブのレベルでないときには、ス
テップS209で、現状のジョブレベルが低優先クラセンジ
ョブのレベル以上であるか否かを調べる。
In step S206, it is determined whether or not the current job level at which this class is executed is its own job level. If the current status is at the class job itself, then in steps S207 and S208 the class job ,
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.

【0076】そして、現状のジョブレベルが低優先クラ
センジョブ以上であるときには、上記ステップ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.

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

【0078】このジョブ優先処理では、ステップS300
で、ジョブの優先レベルを示す1バイト変数であるジョ
ブレベルJB_LEVを1つ上げると、ステップS301へ
進んで、この優先レベルに対応するジョブフラグが立っ
ていないか調べる。そして、ジョブフラグが立っていな
いときには、ステップS300へ戻ってさらにジョブレベル
JB_LEVを1つ上げ、ジョブフラグが立っていると
きには、ステップS302へ進み、ジョブフラグの立ってい
るジョブのオーバーラップカウンタOLCを初期値の0
から1にし、ステップS303へ進む。
In this job priority process, step S300
Then, if the job level JB_LEV, which is a 1-byte variable indicating the priority level of the job, is increased by one, the process proceeds to step S301, and it is checked whether or not 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. Initial value 0
Is set to 1 and the process proceeds to step S303.

【0079】ステップS303では、より上のジョブフラグ
があるか否かを調べ、より上のジョブがあるときには、
ステップS300へ戻って前述の処理を繰り返し、より上の
ジョブがないときには、ステップS304へ進んで、ジョブ
実行中フラグJB_RUNをセットすると、ステップS3
05で、後述するジョブ実行サブルーチンにより最上位の
ジョブを実行する。
In step S303, it is checked whether or not there is a higher job flag. If 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.

【0080】上記ジョブ実行中フラグ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.

【0081】例えば、図20に示すように、JB_LE
V=4の10msジョブを実行中、JB_LEV=6の
2msジョブの割込み要求がなされると、10msジョ
ブの処理が中断され、より優先度の高い2msジョブ
が、JB_RUN=1、OLC=1にセットされ、実行
される。そして、この2msジョブの処理中に、JB_
LEV=5の4msジョブの割込み要求が発生すると、
この4msジョブは、JB_RUN=0、OLC=1と
されて割込みが受付けられるが、実行はされず待機状態
となる。
For example, as shown in FIG. 20, 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.

【0082】その後、ジョブ実行サブルーチンによるジ
ョブの実行が終了すると、上記ステップ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.

【0083】次に、ステップ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 lowered 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.

【0084】上記ステップ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.

【0085】上記ステップS312で、ジョブ実行中フラグ
JB_RUNがセットされているときには、割込み前に
ジョブを実行中であったため、割込みを終了して割込み
前のジョブへ戻り、ジョブ実行中フラグJB_RUNが
セットされていなければ、ステップS304へ戻って、この
レベルのジョブを実行し、同様の処理を繰返す。
When the job executing flag JB_RUN is set in step S312 above, 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.

【0086】すなわち、図20において、JB_LEV
=6の2msジョブが終了し、OLC=0、JB_RU
N=0になると、ジョブレベルが1つ下げられ、JB_
LEV=5の4msジョブが、JB_RUN=0、OL
C=1の待機状態からJB_RUN=1にセットされ、
実行される。さらに、4msジョブが終了すると、JB
_LEV=4に移り、JB_RUN=1(ジョブ実行
中)の状態から、2msジョブ及び4msジョブによっ
て中断されていた10msジョブの処理が再開される。
That is, in FIG. 20, 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).

【0087】このように、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.

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

【0089】まず、ステップS500で、ジョブフラグJB
_FLGを参照して実行すべきジョブがクラセンジョブ
でないか否かを調べ、クラセンジョブでないときには、
ラベルALJ10へ分岐し、クラセンジョブのときに
は、ステップS501へ進んで、気筒判別がついているか否
かを調べる。
First, in step S500, the job flag JB is set.
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.

【0090】そして、気筒判別がついていないときに
は、そのままルーチンを抜けてジョブを実行せず、気筒
判別がついているとき、上記ステップ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.

【0091】上記ステップS502では、多重待ち状態でな
いとき、ステップS503へ進んで、クラセン割込み毎に算
出されるシステム変数S_ACAS(クランク総合位置
変数)をユーザー変数ACASとし、一方、多重待ち状
態のときには、ステップS504へ分岐し、ユーザー変数A
CASを一つ増やして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, while in the multiplex waiting state, The process branches to step S504 and the user variable A
The new user variable ACAS is obtained by taking the remainder obtained by increasing CAS by 1 and dividing by 12, and this user variable ACAS
, 0, 1, 2, ..., 11, 0, 1 ,.

【0092】すなわち、クラセンジョブ及び低優先クラ
センジョブは、自身または優先度の高いジョブに邪魔さ
れて遅れることがあるが、クラセン割込みは正確にクラ
ンク角センサ信号に同期して実行され、システム変数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 high-priority job, 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.

【0093】従って、ジョブ中でシステム変数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. For this reason, in the class job and the low-priority class job, the OS system variable S_ACAS is set to the user variable ACAS when the multi-wait state is not set.
As described above, the user variable ACAS is updated every time the job is executed, and even in the case of a multiple request, the information regarding the cylinder and crank position corresponding to itself is obtained and appropriate processing is performed.

【0094】その後、上記ステップS503あるいは上記ス
テップS504からステップS505へ進み、ジョブのワークエ
リアを設定すると、ステップS506で、レベルゼロの割込
みを許可し、ステップS507で、クラセンジョブのセクシ
ョンに移る。そして、このクラセンジョブセクションに
リンクされた処理を実行し、ステップS508で、割込みを
禁止してルーチンを抜ける。
Thereafter, 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, and 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.

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

【0096】一方、上記ステップS510で、実行すべきジ
ョブが2msジョブでないときには、ステップS510から
ステップS520へ分岐し、実行すべきジョブが4msジョ
ブか否かを調べる。そして、4msジョブでないときに
は、ラベルALJ30へ分岐し、4msジョブのときに
は、ステップS521で、ジョブのワークエリアを設定する
と、ステップS522へ進む。尚、この4msジョブは、A
/D変換利用ジョブであり、後述するシステムシフトバ
ッファSSHBを介してA/D変換データを利用する。
On the other hand, in step S510, if the job to be executed is not a 2 ms job, the process branches from step S510 to step S520 to check whether or not 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.

【0097】ステップ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 to exit the routine.

【0098】上記システムシフトバッファSSHBは、
図21に示すように、8チャンネルの各A/D変換結果
がストアされる先頭オフセットアドレス0,+8,+1
6,+24,+32,+34,+36,+38番の各メ
モリ、及び、4ms毎のクランク同期のA/D変換結果
がストアされる先頭オフセットアドレス−2番地の1ワ
ードのメモリからなり、0.5ms毎に実行される1回
のA/D変換結果が1ワード(2バイト)でストアされ
る。
The system shift buffer SSHB is
As shown in FIG. 21, head offset addresses 0, +8, +1 in which the 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).

【0099】先頭オフセットアドレス0番地からは、4
段のシフトメモリとなっており、90°CA毎のA/D
変換結果がストアされ、最新4データ(1回転分)をジ
ョブから参照することができる。また、先頭オフセット
アドレス+32,+34,+36,+38番地は、各1
ワードのメモリであり、なまし処理機能が選択されたと
き、A/D変換結果を加重平均した値がストアされてノ
イズ除去と精度向上を図ることができるようになってお
り、これらのメモリのデータは、低速ジョブで利用でき
る。
4 from the start offset address 0
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.

【0100】また、各先頭オフセットアドレス+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,
Since the value of the overlap counter OLC of the ms job is stored in the subsequent word, the data is read from the first word when the 4 ms job is executed, and the data of each word is sequentially shifted to the first direction as the job ends. It is a FIFO buffer that is read from the data stored in.

【0101】すなわち、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.

【0102】一方、上記ステップ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.

【0103】尚、上記10msジョブのセクションに
は、半回転時間からエンジン回転数を算出するエンジン
回転数算出サブルーチン、後述する点火スケジュール作
成サブルーチンなどがサービスルーチンとしてOS側で
用意されている。
In the 10 ms job section, an engine speed calculation subroutine for calculating the engine speed from the half rotation time, an ignition schedule creation subroutine to be described later, and the like are prepared as service routines on the OS side.

【0104】また、上記ステップS530で、実行すべきジ
ョブが10msジョブでないときには、上記ステップS5
30からステップS540へ分岐し、実行すべきジョブが低優
先クラセンジョブであるか否かを調べる。そして、低優
先クラセンジョブでないときには、上記ステップS540か
らラベルALJ50へ分岐し、実行すべきジョブが低優
先クラセンジョブのときは、上記ステップS540からステ
ップS541へ進んで、現在の状態が多重待ち状態であるか
否かを調べる。
If it is determined in step S530 that the job to be executed is not a 10 ms job, then step S5 is executed.
The process branches from 30 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.

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

【0106】ステップ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 section of the low priority class job is moved to and the job main body is executed, and then step S547.
Disable the interrupt and exit the routine.

【0107】さらに、ラベル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.

【0108】ステップ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 setting 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.

【0109】一方、上記ステップS550で実行すべきジョ
ブが50msジョブではないときには、上記ステップS5
50からステップS560へ分岐し、ジョブのワークエリアを
設定すると、ステップS561で、レベルゼロの割込みを許
可し、ステップS562へ進んで、250msジョブのセク
ション領域へ移行し、ジョブ本体を実行後、ステップS5
63で割込みを禁止してルーチンを抜ける。
On the other hand, if the job to be executed in step S550 is not a 50 ms job, then step S5
After branching from step 50 to step S560 and setting the work area of the job, in step S561 the level 0 interrupt is permitted, the process proceeds to step S562, the section area of the 250 ms job is entered, the job body is executed, and then step S5
Disable interrupt at 63 and exit the routine.

【0110】以上のジョブ優先処理においては、クラン
ク位置を常に的確に把握しておく必要があり、クラセン
割込み毎に、図9に示すクランク位置算出サブルーチン
が実行されて前述したクランク位置変数S_CCAS,
S_RCAS,S_ACAS,S_ECASが算出され
る。尚、以下の説明においては、システム変数であるこ
とを示すS_をクランク位置変数から省略する。
In the above job priority processing, it is necessary to always grasp the crank position accurately, and the crank position calculation subroutine shown in FIG. 9 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.

【0111】このクランク位置算出サブルーチンでは、
まず、ステップS600で、クラセンタイマの下2バイトを
ソフトタイマの下2バイトにストアする。このクラセン
タイマはECU50に備えられたハードウエアタイマで
あり、本実施例においては、16ビットタイマで最大2
55msまで計数が可能であるが、メモリ上に3バイト
の連続した領域を確保し、ソフトタイマとして使用す
る。
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 and used as a soft timer.

【0112】すなわち、ソフトタイマの下2バイトにク
ラセンタイマの2バイトを転写し、クラセンタイマのオ
ーバーフローにより発生する割込みで3バイト目をカウ
ントアップすることにより、クラセン間隔を最大64s
ec(255ms×256)まで計数することが可能と
なり、16ビット以上の特別なハードウエアタイマを使
用することなく、クランキング時などクラセン間隔が極
めて長い場合にも容易に対応することができる。
That is, by transferring 2 bytes of the classen timer to the lower 2 bytes of the soft timer and counting up the 3rd byte by the interrupt generated by the overflow of the classen timer, the classen interval can be up to 64 seconds.
It is possible to count up to ec (255 ms × 256), and it is possible to easily cope with an extremely long Krasen interval such as cranking without using a special hardware timer of 16 bits or more.

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

【0114】ステップ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 the error level ECAS is 2, that is, whether the crank position is unknown such as during cranking. , ECAS = 2
In case of, it branches to step S605 and accumulator A
Store error code 1 in and exit the routine.

【0115】一方、上記ステップS604で、ECAS≠2
のときには、ステップS606へ進み、ソフトタイマの3バ
イト目を0とする。そしてステップS607へ進み、クラン
ク位置情報変数CCASが1であるか否か、すなわち、
現在のクランク位置がBTDC65°CA〜10°CA
の間(図19参照)であるか否かを調べ、CCAS=1
のときには、ステップS607からステップS609へジャンプ
し、CCAS≠1のときには、ステップS607からステッ
プS608へ進んで、A/D変換リクエストを1増加させ、
ステップS609へ進む。
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. 19), 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.

【0116】このA/D変換リクエストは、クランク角
90°毎にクランク同期A/D変換を指示するためのフ
ラグ的な変数であり、0、1の値をとり、値が1のとき
クランク同期A/D変換を指示する。すなわち、前述し
たように、8チャンネルのA/D変換のうち1チャンネ
ルのA/D変換はクランク角90°毎に行なわれるが、
CCASが0になったとき(BTDC97°)と、CC
ASが2になったとき(BTDC10°)、クランク同
期のA/D変換リクエストをセットし、0.5ms毎の
A/D変換順番に対してクランク角90°毎のA/D変
換を割込ませるのである。
This A / D conversion request is a flag-like variable for instructing crank synchronization A / D conversion for each 90 ° crank angle, and takes a value of 0, 1 and when the value is 1, crank synchronization is performed. Instruct A / D conversion. That is, as described above, of the 8-channel A / D conversion, the 1-channel A / D conversion is performed at every crank angle of 90 °.
When CCAS becomes 0 (BTDC 97 °), CC
When AS becomes 2 (BTDC 10 °), the crank-synchronized A / D conversion request is set, and the A / D conversion for every 90 ° crank angle is interrupted for the A / D conversion order every 0.5 ms. It does.

【0117】その後、ステップS609では、気筒情報変数
RCASを3倍してクランク位置情報変数CCASを加
算することによりクランク総合位置変数ACASを算出
すると(ACAS=RCAS×3+CCAS)、ステッ
プS610で、ソフトタイマを2バイトでリミットし、クラ
センタイマがオーバーフローしている場合には下2バイ
トをFFFF(255ms)としてステップS611へ進
む。
Thereafter, in step S609, the crank 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 in step S610, the soft timer is calculated. Is limited to 2 bytes, and when the classen timer overflows, the lower 2 bytes are set to FFFF (255 ms) and the process proceeds to step S611.

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

【0119】配列TCASは、図22(a)に示すよう
に、ACAS=0,1,2,…、11に対応するエンジ
ン2回転分のクラセン間隔データがストアされた12ワ
ードのクラセン間隔テーブルであり、配列MTCSX
は、図22(b)に示すように、CCAS=0,1,2
に対応する3ヶのクラセン間隔データがストアされた3
ワードのクラセン間隔テーブルである。
As shown in FIG. 22A, 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. Yes, array MTCSX
As shown in FIG. 22B, CCAS = 0,1,2
3 pieces of Classen interval data corresponding to
It is a word classen interval table.

【0120】すなわち、上記ステップS603のCCAS・
RCAS判別サブルーチン(詳細は後述する)及びステ
ップS609により各情報変数CCAS,RCAS,ACA
Sが更新され、例えば、CCAS=1、RCAS=1,
ACAS=4に更新されて、現在、クランク位置が#3
気筒のBTDC65゜〜10゜CAのとき、クラセンタ
イマによって計時された#3気筒のBTDC97゜CA
におけるクラセン信号入力から#3気筒のBTDC65
゜CAにおけるクラセン信号入力までの時間(クラセン
間隔データ)を、ステップS611で総合位置変数ACAS
をパラメータとして配列TCASのACAA=3のアド
レスにストアすると共に、ステップS612でクランク位置
情報変数CCASをパラメータとして配列MTCSXの
CCAS=0のアドレスにストアする。
That is, the CCAS
Each information variable CCAS, RCAS, ACA by the RCAS discrimination subroutine (details will be described later) and step S609.
S is updated, for example, CCAS = 1, RCAS = 1,
ACAS = 4 has been updated, and now the crank position is # 3.
When the cylinder BTDC is 65 ° to 10 ° CA, the # 3 cylinder BTDC 97 ° CA is clocked by the classen timer.
From the Krasen signal input in the # 3 cylinder BTDC65
In step S611, the total position variable ACAS is calculated as the time until the Krasen signal is input in ° CA (Krasen interval data).
Is stored as a parameter at the address of ACAA = 3 in the array TCAS, and the crank position information variable CCAS is stored as a parameter at the address of CCAS = 0 in the array MTCSX in step S612.

【0121】従って、クラセン入力によるクラセン割込
み毎に総合位置変数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.

【0122】次いで、ステップ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. .

【0123】上記ステップS613でECAS≠1(すなわ
ちECAS=0)であり、クランク位置が確証をもって
判別されているときには、上記ステップS613からステッ
プS614へ進んで、最新3ヶのクラセン間隔データの和
(配列MTCSXにストアされているクラセン間隔デー
タの和)を、3バイトの半回転時間MTCS18として
算出する(MTCS18=ΣMTCSX)。すなわち、
半回転時間MTCS18は、クラセン割込み毎にクラン
ク位置情報変数CCASが更新されて配列MTCSX内
のデータが更新される毎に算出され、BTDC97°,
65°,10°の各位置毎にクラセン間隔の移動和を取
ることにより常に最新のデータが得られるようになって
いる。
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 °.

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

【0125】すなわち、CCAS=0のとき、BTDC
10°〜ATDC83°(次の気筒のBTDC97゜)
間の角度93°から前回のクラセン間隔×180/93
を半回転時間MTCS18と推定し、CCAS=1のと
き、BTDC97°〜65°間の角度32°から、前回
のクラセン間隔×180/32を半回転時間MTCS1
8と推定する。さらに、CCAS=2のとき、BTDC
65°〜10°間の角度55°から前回のクラセン間隔
×180/55を半回転時間MTCS18と推定する。
That is, when CCAS = 0, BTDC
10 ° ~ ATDC 83 ° (BTDC 97 ° for the next cylinder)
The angle between 93 ° and the previous Krasen distance x 180/93
Is estimated as a half rotation time MTCS18, and when CCAS = 1, from the angle 32 ° between BTDC 97 ° and 65 °, the previous Krasen interval × 180/32 is calculated as the half rotation time MTCS1.
Estimated to be 8. Furthermore, when CCAS = 2, BTDC
From the angle 55 ° between 65 ° and 10 °, the previous Krasen interval × 180/55 is estimated as the half rotation time MTCS18.

【0126】そして、上記ステップS614で半回転時間M
TCS18を算出した後、あるいは、上記ステップS615
で半回転時間MTCS18を推定した後は、ステップS6
16へ進み、3バイトの半回転時間MTCS18を2バイ
トにリミットして所定の変数MTCSKにストアする
と、ステップS617で、この変数MTCSKを2倍して変
数MTCSK4にストアし、ステップS618で、正常終了
コード0をアキュムレータAに格納してルーチンを抜け
る。
Then, in step S614, the half rotation time M
After calculating TCS18, or the above step S615.
After estimating the half rotation time MTCS18 in step S6,
Proceeding to step 16, when the 3-byte half rotation time MTCS 18 is limited to 2 bytes and stored in the predetermined variable MTCSK, in step S617 this variable MTCSK is doubled and stored in the variable MTCSK4, and in step S618, normal end Store code 0 in accumulator A and exit the routine.

【0127】そして、前述のジョブ実行サブルーチンに
おいて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 that limits the 3-byte half rotation time MTCS 18 to 2 bytes.

【0128】詳述すると、毎分回転数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.

【0129】次に、図10に示されるCCAS・RCA
S判別サブルーチンについて説明する。このサブルーチ
ンでは、まず最初に、ステップS800で、カムセンカウン
タを0〜4にリミットする。このカムセンカウンタで計
数されるカム角センサ41からのカムパルスの数(クラ
セン信号入力間のカムパルス数)は、図30に示すよう
に、正常状態の場合0〜3であるが、ノイズなどの影響
により4以上の異常な計数値となるおそれがあるため、
カムセンカウンタを0〜4にリミットして異常な状態を
4で代表するのである。
Next, the CCAS / RCA shown in FIG.
The S determination subroutine will be described. In this subroutine, first, in step S800, the CamSen counter is limited to 0-4. As shown in FIG. 30, the number of cam pulses from the cam angle sensor 41 (the number of cam pulses between Krasen signals input) counted by the camsen counter is 0 to 3 in the normal state, but the influence of noise or the like is generated. May result in an abnormal count value of 4 or more,
The camsen counter is limited to 0 to 4 and an abnormal state is represented by 4.

【0130】次に、ステップ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 (the number of cam sens counters 0 to 4 is 5) is obtained from (the count value of) the cam sen 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.

【0131】この気筒・クランク位置状態マップCCH
MAPは、図23(a)及び(b)に示すように、クラ
ンク位置情報変数CCASが0あるいは1の場合と、気
筒情報変数RCASの変化点であるクランク位置情報変
数CCASが2の場合とに分け、カムセンカウンタと気
筒情報変数RCASの各組合わせの起こり得る全ての状
態に対し、正常か異常か、確定して良いか推定すべきか
を示す状態データがストアされており、現在の状態を評
価し、次にとるべき状態を知ることができる。
This cylinder / crank position state map CCH
As shown in FIGS. 23 (a) and 23 (b), MAP is used when the crank position information variable CCAS is 0 or 1 and when the crank position information variable CCAS, which is the change point of the cylinder information variable RCAS, is 2. Separately, for all possible states of each combination of the cam sen counter and the cylinder information variable RCAS, state data indicating whether it is normal, abnormal, or whether it should be confirmed or confirmed should be stored. You can evaluate and know what to do next.

【0132】上記状態データは2ビットのデータであ
り、ビット0の値により確定か推定かを表わし、ビット
1の値により正常か異常かを表わす。ビット0の値は、
0のとき確定、1のとき推定を示し、図30からわかる
ように、カムセンカウンタが2,3の場合にのみ確定で
あって、それ以外は推定せざるを得ない状態である。ま
た、ビット1の値は、0のとき正常、1のとき異常を示
し、カムセンカウンタが3以下で、且つ、図19及び図
30による組合せに合致する場合のみ正常であって、そ
れ以外は異常な状態である。
The above-mentioned state data is 2-bit data, and the value of bit 0 indicates whether it is definite or estimated, and the value of bit 1 indicates whether it is 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. 30, the determination is made only when the CamSen counter is 2 or 3, and the estimation is otherwise inevitable. When the value of bit 1 is 0, it indicates normal, and when it is 1, it indicates abnormal. Only when the value of Camsen counter is 3 or less and the combination according to FIG. 19 and FIG. It is in an abnormal state.

【0133】例えば、CCAS=0あるいは1、すなわ
ち、ある気筒のBTDC97°〜10°に対し、カムセ
ンカウンタが0で気筒情報変数RCASが0となる組合
せは、図19及び図30からもわかるように、クランク
位置を正常に推定すれば良い状態であるため、気筒・ク
ランク位置状態マップCCHMAPの該当領域に2進数
で01(正常推定)の状態データがストアされており、
さらに、カムセンカウンタが1で気筒情報変数RCAS
が0となる組合せは、明らかに異常であって推定するし
かない状態であるため、気筒・クランク位置状態マップ
CCHMAPの該当領域に2進数で11(異常推定)の
状態データがストアされている。
For example, as shown in FIGS. 19 and 30, the combination of CCAS = 0 or 1, that is, the combination of BTDC 97 ° to 10 ° of a certain cylinder with the Camsen counter set to 0 and the cylinder information variable RCAS set to 0 is obtained. In addition, since it is a state in which the crank position can be estimated normally, the state data of 01 (normal estimation) in binary is stored in the corresponding region of the cylinder / crank position state map CCHMAP.
Furthermore, when the cam sen counter is 1 and the cylinder information variable RCAS is
The combination in which 0 is 0 is clearly abnormal and is in a state that can only be estimated. Therefore, 11 (abnormality estimation) state data in binary number is stored in the corresponding region of the cylinder / crank position state map CCHMAP.

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

【0135】そして、上記ステップ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.

【0136】一方、上記ステップS802でECAS≠2の
ときにはステップS804へ進んで、推定状態か否かを調
べ、確定状態、推定状態に応じてステップS805以降の処
理あるいはステップS812以降の処理へ進む。また、上記
ステップS803において確定状態でステップS804へ進んだ
ときには、ステップS805以降の処理へ進む。
On the other hand, if ECAS ≠ 2 in step S802, the flow advances to step S804 to check whether the state is the estimated state or not, and depending on the fixed state or the estimated state, the process proceeds to step S805 or subsequent steps or step S812 or 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.

【0137】まず、ステップS805以降の処理について説
明すると、このステップS805へ進んだときには、正常、
異常に拘らず気筒判別がなされた確定状態であるため、
図30のタイムチャートからもわかるように、今回のク
ラセン割込みはカムパルスが3ヶあるいは2ヶ入力され
た後のBTDC97°の割込みであるため、クランク位
置情報変数CCASを0にする。
First, the processing after step S805 will be described. When the processing proceeds to this step S805,
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. 30, since the present classen interrupt is an interrupt of BTDC 97 ° after three or two cam pulses are input, the crank position information variable CCAS is set to 0.

【0138】次いで、ステップ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 CamSen counter is 3, and the CamSen 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.

【0139】ステップ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.

【0140】その結果、上記ステップS809において、状
態データのビット1が1で異常状態と判定されるときに
は、クランク位置情報変数CCAS、気筒情報変数RC
ASの更新結果は不安の残る推定であるとしてステップ
S810でエラーレベルECASを1にしてルーチンを抜
け、状態データのビット1が0であり正常状態であると
きには、ステップS811でエラーレベルECASを0とし
てルーチンを抜ける。
As a result, in step S809, when the bit 1 of the status data is 1 and it is determined that there is an abnormal condition, the crank position information variable CCAS and the cylinder information variable RC are obtained.
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.

【0141】一方、ステップ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 (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 = 0 is set in step S814, and the flow proceeds to step S817.

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

【0143】ステップ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 the status is abnormal. 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.

【0144】以上の0.5ms毎の定期割込み処理とク
ラセン割込み処理により、ユーザー側の制御ストラテジ
ーに基づく各ジョブが優先処理され、例えば10msジ
ョブ中の点火時期設定ルーチンにより、吸入空気量、エ
ンジン回転数などのエンジン運転状態に応じて点火時期
の指示値(角度)IG_DEGが設定されると、この指
示点火時期IG_DEGに基づいて、OS側で用意した
点火スケジュール作成サブルーチンで点火スケジュール
が作成され、点火シーケンスが決定される。
Each job based on the control strategy on the user side is preferentially processed by the above-mentioned periodic interrupt processing and the classen interrupt processing every 0.5 ms. For example, the intake air amount and the engine rotation speed are set by the ignition timing setting routine during the 10 ms job. When the instruction value (angle) IG_DEG of the ignition timing is set according to the engine operating state such as the number, the ignition schedule is created by the ignition schedule creation subroutine prepared on the OS side based on the indicated ignition timing IG_DEG, and the ignition schedule is created. The sequence is determined.

【0145】上記指示点火時期IG_DEGは、圧縮上
死点より遅角側を負として−60°〜+97°の範囲で
設定可能であり、点火シーケンスの決定に際しては、ク
ランク位置変数を用いて点火区間変数を設定し、この点
火区間変数によって示される区間を基準として上記点火
スケジュールを作成する。
The command ignition timing IG_DEG can be set in the range of -60 ° to + 97 ° with the retard side from the compression top dead center being negative, and when determining the ignition sequence, the crank position variable is used to determine the ignition interval. A variable is set, and the ignition schedule is created based on the section indicated by this ignition section variable.

【0146】上記点火区間変数は、図24に示すよう
に、気筒情報変数RCASを用いて点火コイル26aへ
の通電、点火のシーケンスを行なう対象気筒を示す点火
気筒情報変数IGRCAS、クランク位置情報変数CC
ASを用いて通電終了すなわち点火が行なわれる区間を
示す点火クランク位置情報変数IGCCAS、クランク
位置情報変数CCASを用いて点火コイル26aへの通
電が開始されるべき区間を示すドエル開始クランク位置
情報変数DWCCASであり、上記点火クランク位置情
報変数IGCCASは、0,1,2の値をとり、上記ド
エル開始クランク位置情報変数DWCCASは、ドエル
が点火に先立って前の行程に入り込むことがあるため、
−3,−2,−1,0,1,2の値をとる(但し、点火
クランク位置情報変数IGCCASより大きな値はとれ
ない)。
As shown in FIG. 24, the ignition interval variables are the ignition cylinder information variable IGRCAS and the crank position information variable CC indicating the target cylinder for which the ignition coil 26a is energized and ignited using the cylinder information variable RCAS.
Ignition crank position information variable IGCCAS indicating a section where energization ends, that is, ignition is performed using AS, and dwell start crank position information variable DWCCAS indicating a section where energization to the ignition coil 26a should start using the crank position information variable CCAS The ignition crank position information variable IGCCAS takes values of 0, 1, and the dwell start crank position information variable DWCCCAS may enter the previous stroke before the dwell of the dwell.
It takes a value of -3, -2, -1, 0, 1, 2 (however, a value larger than the ignition crank position information variable IGCCAS cannot be taken).

【0147】さらに、上記ドエル開始クランク位置情報
変数DWCCASによって示される区間の中で、どの程
度待ってから通電を開始すべきかの通電開始待ち時間、
すなわち通電を開始する区間となってから通電開始まで
の時間のデータをドエルオン待ち時間TDW_ONで示
し、上記点火クランク位置情報変数IGCCASによっ
て示される区間の中で、どの程度待ってから通電を終了
すべきかの通電終了待ち時間、すなわち点火を実行する
区間となってから通電終了するまでの時間のデータをド
エルオフ待ち時間TDW_OFで示す。
Further, in the section indicated by the dwell start crank position information variable DWCCCAS, the energization start waiting time of how long to wait before energization is started,
That is, the data of the time from the start of energization until the start of energization is indicated by the dwell-on waiting time TDW_ON, and how long to wait before ending energization in the section indicated by the ignition crank position information variable IGCCAS. The data of the dwell-off waiting time TDW_OF is shown as the data of the dwell-off waiting time TDW, that is, the data of the time from the start of the ignition to the end of the energization.

【0148】そして、通電開始及び通電終了の区間デー
タと、通電開始待ち時間及び通電終了待ち時間の時間デ
ータとを点火スケジュールとして10ms毎に作成す
る。すなわち、図25に示すように、1バイトの上記ド
エル開始クランク位置情報変数DWCCAS、2バイト
の上記ドエルオン待ち時間TDW_ON、1バイトの上
記点火クランク位置情報変数IGCCAS、2バイトの
上記ドエルオフ待ち時間TDW_OFをメンバーとする
構造体変数を点火スケジュールとして所定のメモリ領域
に記録する。
Then, energization start and energization end section data and time data of energization start waiting time and energization end waiting time are created every 10 ms as an ignition schedule. That is, as shown in FIG. 25, 1 byte of the dwell start crank position information variable DWCCCS, 2 bytes of the dwell on wait time TDW_ON, 1 byte of the ignition crank position information variable IGCCAS, and 2 bytes of the dwell off wait time TDW_OF are set. The structure variable to be a member is recorded as an ignition schedule in a predetermined memory area.

【0149】この場合、上記点火スケジュールは、先頭
オフセットアドレス+0,+6,+12からの各6バイ
トのメモリ領域に、3枚の点火スケジュールIGSCD
L1,IGSCDL2,IGSCDL3がストアされる
ようになっており、後述するスケジュールポインタに従
って、10msジョブ中の点火スケジュール作成サブル
ーチンで書込みが行なわれるとともに、クラセン割込み
の点火タイマセットで使用される。尚、この場合、1つ
の点火シーケンスの途中ではスケジュール変更は行なわ
ず、後述する点火終了時割込みで最新のスケジュールが
採用される。
In this case, the ignition schedule includes three ignition schedules IGSCD in a memory area of 6 bytes each from the start offset address +0, +6, +12.
L1, IGSCDL2, and IGSCDL3 are stored, and are written in the ignition schedule creation subroutine in the 10 ms job according to the schedule pointer described later, and are used in the ignition timer set of the classen interrupt. In this case, the schedule is not changed in the middle of one ignition sequence, and the latest schedule is adopted by the ignition end interrupt described later.

【0150】従来では、点火時期の指示値を設定し、こ
の指示値に基づいて点火シーケンスを決定して点火タイ
マにセットするという一連の処理は、全てクラセン割込
み時に行なっており、負荷が重いためエンジン高回転時
に支障をきたすおそれがあったが、本発明では、10m
s毎に点火スケジュールを作成し、この点火スケジュー
ルに従ってクラセン割込みで点火タイマにセットするた
め、エンジン高回転においても負荷が増大することな
く、正確に点火制御を行なうことができるのである。
Conventionally, a series of processes of setting an instruction value of ignition timing, determining an ignition sequence based on the instruction value, and setting the ignition timer is performed at the time of classen interruption, and the load is heavy. There was a risk of trouble at high engine speeds, but in the present invention, 10 m
Since the ignition schedule is created for each s and the ignition timer is set by the classen interrupt according to the ignition schedule, the ignition control can be accurately performed without increasing the load even at the high engine speed.

【0151】次に、上記点火スケジュールの作成につい
て、図11〜図14のフローチャートに従って説明す
る。
Next, the preparation of the ignition schedule will be described with reference to the flowcharts of FIGS.

【0152】この点火スケジュール作成サブルーチンで
は、まず、ステップS1200で、ユーザージョブ側で設定
した指示ドエル時間ITDWLを半回転時間MTCS1
8でリミットすることにより、各気筒に配設した点火コ
イル26aに対して同時に2つの点火コイルには通電し
ないようにし、リミットした値を実ドエル時間TDWL
とし、点火コイル26aに対する通電継続時間のデータ
としてRAM60の所定アドレスにストアする。
In this ignition schedule creation subroutine, first, in step S1200, the instruction dwell time ITDWL set on the user job side is set to the half rotation time MTCS1.
By setting a limit value of 8, the two ignition coils are not energized at the same time with respect to the ignition coil 26a arranged in each cylinder, and the limited value is set to the actual dwell time TDWL.
Then, it is stored in a predetermined address of the RAM 60 as data of the duration of energization of the ignition coil 26a.

【0153】次いで、ステップS1201へ進み、処理遅れ
時間を含めたドエル時間を見かけ上のドエル時間D_T
DWLとし、ステップS1202で、処理遅れ時間に相当す
るむだ角度をDM_DEGとする。この処理遅れ時間
は、クラセン割込みが入ってから実際に点火タイマがセ
ットされるまでの処理遅れ時間であり、後述する点火タ
イマセットサブルーチンにおいて処理遅れ時間の最大値
が記録される。
Next, the flow proceeds to step S1201, and the apparent dwell time D_T including the processing delay time is included.
DWL, and in step S1202, the dead angle corresponding to the processing delay time is set to DM_DEG. This processing delay time is the processing delay time from when the classen interrupt is input until the ignition timer is actually set, and the maximum value of the processing delay time is recorded in the ignition timer setting subroutine described later.

【0154】次に、上記ステップS1202からステップS12
03へ進むと、エラーレベルECASがゼロでないか否
か、すなわち気筒及びクランク位置が判別されているか
否かをを調べ、ECAS≠0で気筒及びクランク位置が
判別されていないときにはルーチンを抜け、ECAS=
0のとき、ステップS1204へ進んで、新しいスケジュー
ルポインタをXレジスタに保存する。
Next, the above steps S1202 to S12.
When it proceeds to 03, it is checked whether the error level ECAS is not zero, that is, whether the cylinder and crank position are discriminated. When ECAS ≠ 0 and the cylinder and crank position are not discriminated, the routine is exited and the ECAS =
When it is 0, the process advances to step S1204 to save the new schedule pointer in the X register.

【0155】上記スケジュールポインタは、10msジ
ョブで使用するスケジュールポインタIGSCUSと、
クラセン割込みで使用するスケジュールポインタIGS
CPTとがあり、いずれも、0,6,12の値をとる。
そして、クラセン割込みで採用されて現在実行中の点火
スケジュールを示すスケジュールポインタIGSCPT
と、前回、点火スケジュールを作成したときのスケジュ
ールポインタIGSCUSとの論理和をとり、この論理
和の値をパラメータとして図26に示すスケジュールポ
インタテーブルIGSTBLを検索し、3枚の点火スケ
ジュールIGSCDL1,IGSCDL2,IGSCD
L3のうち、新たに書込みを行なう点火スケジュールを
選択する。
The schedule pointer is a schedule pointer IGSCUS used in a 10 ms job,
Schedule pointer IGS used in Classen interrupt
There is CPT, and all take values of 0, 6, and 12.
Then, a schedule pointer IGSCPT indicating the currently executed ignition schedule adopted by the classen interrupt.
With the schedule pointer IGSCUS when the ignition schedule was created last time, the value of this logical sum is used as a parameter to search the schedule pointer table IGSTBL, and three ignition schedules IGSCDL1, IGSCDL2 IGSCD
An ignition schedule for newly writing is selected from L3.

【0156】例えば、現在実行されている点火スケジュ
ールへのポインタIGSCPTが0(点火スケジュール
IGSCDL1)であり、前回作成した点火スケジュー
ルへのポインタIGSCUSが6(点火スケジュールI
GSCDL2)である場合、0と6の論理和6に対応す
るスケジュールポインタテーブルIGSTBLのアドレ
スには、次にデータを書込むべき点火スケジュールIG
SCDL3を指定するポインタの値12がストアされて
おり、この12が新しいスケジュールポインタとしてX
レジスタにストアされ、点火スケジュールIGSCDL
3に書込みが行なわれた後、Xレジスタからスケジュー
ルポインタIGSCUSに保存される。
For example, the pointer IGSCPT to the currently executed ignition schedule is 0 (ignition schedule IGSCDL1), and the pointer IGSCUS to the previously created ignition schedule is 6 (ignition schedule I
GSCDL2), the address of the schedule pointer table IGSTBL corresponding to the logical sum 6 of 0 and 6 is the ignition schedule IG to which the next data should be written.
A pointer value 12 for designating SCDL3 is stored, and this 12 is X as a new schedule pointer.
Ignition schedule IGSCDL stored in register
After being written to 3, the X register is saved to the schedule pointer IGSCUS.

【0157】すなわち、点火スケジュールが2枚である
と、エンジン高回転においてはクラセン割込みが頻繁に
発生するため、使用していない点火スケジュールのデー
タを10msジョブで書換え中に次のクラセン割込みが
発生し、新たな点火スケジュールを採用することができ
なくなる。また、エンジン低回転では、使用していない
点火スケジュールのデータの書換えが完了してもクラセ
ン割込みが入らずに次のデータ書換え対象スケジュール
が採用中のスケジュールとなってしまう。このため、点
火スケジュールを3枚とし、10ms毎に作成した点火
スケジュールデータを非同期のクラセン割込みに対して
円滑に渡すことができるようにするのである。
That is, when the number of ignition schedules is two, a Krasen interrupt frequently occurs at a high engine speed. Therefore, the next Krasen interrupt occurs while the unused ignition schedule data is being rewritten by a 10 ms job. , Will not be able to adopt a new ignition schedule. Also, at low engine speed, even if the rewriting of the unused ignition schedule data is completed, the Krasen interrupt does not occur and the next data rewriting target schedule becomes the adopted schedule. Therefore, the number of ignition schedules is set to 3, and the ignition schedule data created every 10 ms can be smoothly passed to the asynchronous classen interrupt.

【0158】その後、上記ステップS1204からステップS
1205へ進むと、BTDC10°より前に点火が指示され
ているか否かを調べるため、10から指示点火時期IG
_DEGを減算して差をアキュムレータAにストアし、
ステップS1206で、アキュムレータAの内容と処理遅れ
時間に相当するむだ角度DM_DEGとを比較する。そ
の結果、A<DM_DEGであり、処理遅れ時間を含ん
でBTDC10°より前の点火であるときには、ラベル
IGS10で示されるステップS1300以降の処理へ進
み、A≧DM_DEGであり、処理遅れ時間を含んでB
TDC10°〜ATDC83°の間の点火であるときに
は、ステップS1207へ進む。
After that, the above steps S1204 to S
When proceeding to 1205, in order to check whether ignition is instructed before BTDC 10 °, instructed ignition timing IG from 10
Subtract _DEG and store the difference in accumulator A,
In step S1206, the contents of the accumulator A are compared with the dead angle DM_DEG corresponding to the processing delay time. As a result, when A <DM_DEG and the ignition is before the BTDC10 ° including the processing delay time, the process proceeds to the processing of step S1300 and subsequent steps indicated by the label IGS10, and A ≧ DM_DEG, and the processing delay time is included. B
If the ignition is between TDC 10 ° and ATDC 83 °, the process proceeds to step S1207.

【0159】ステップS1207では、アキュムレータAの
内容を70でリミットしてATDC60°以降では点火
が行なわれないようにし、ステップS1208で、半回転前
のクラセン間隔に基づいてドエルオフ待ち時間TDW_
OFを算出する。具体的には、クラセン間隔テーブルM
TCSXからBTDC10°〜ATDC83°の区間を
示すクランク位置情報変数CCASの値2に対応するク
ラセン間隔を読出し、アキュムレータAの内容をCCA
S=2の区間のクランク角の値93で割った値を、読出
したクラセン間隔に掛け、この値を新たなアキュムレー
タAの内容とする。そして、この新たなアキュムレータ
Aの内容をドエルオフ待ち時間TDW_OFとするので
ある。
In step S1207, the content of the accumulator A is limited to 70 so that ignition is not performed after ATDC 60 °, and in step S1208, the dwell-off waiting time TDW_
Calculate OF. Specifically, Classen interval table M
The classen interval corresponding to the value 2 of the crank position information variable CCAS indicating the section of BTDC10 ° to ATDC83 ° from TCSX is read, and the contents of the accumulator A are CCA.
A value obtained by dividing the crank angle value 93 in the section of S = 2 is multiplied by the read Krasen interval, and this value is set as the content of the new accumulator A. The contents of the new accumulator A are set as the dwell off waiting time TDW_OF.

【0160】すなわち、エンジンの回転は、大局的には
半回転周期で変動するため、同じ測定区間の最新のクラ
セン間隔を用いてドエルオフ待ち時間TDW_OFを算
出することにより、定常的なクランク角度毎の回転変動
誤差を取り除いて、燃焼の強さ、フライホイール重量、
変速比、ピストン重量などの影響を受けなくすることが
でき、正確な点火設定が可能となる。
That is, since the engine rotation fluctuates in a half-rotation cycle in general, the dwell-off waiting time TDW_OF is calculated by using the latest Klassen interval in the same measurement section to calculate the steady crank angle. Removing the rotational fluctuation error, the combustion strength, flywheel weight,
It is possible to eliminate the influence of the gear ratio, the piston weight, etc., and it becomes possible to set the ignition accurately.

【0161】次に、上記ステップS1208からステップS12
09へ進むと、BTDC10°〜ATDC83°の区間を
示すCCAS=2の値をアキュムレータBにストアし
て、このアキュムレータBの内容を点火クランク位置情
報変数IGCCASの値とし、ステップS1210で、アキ
ュムレータAの内容すなわちドエルオフ待ち時間TDW
_OFと見かけ上のドエル時間D_TDWLとを比較す
る。
Next, the above steps S1208 to S12.
When proceeding to 09, the value of CCAS = 2 indicating the section of BTDC10 ° to ATDC83 ° is stored in the accumulator B, the content of this accumulator B is set as the value of the ignition crank position information variable IGCCAS, and in step S1210, the accumulator A is stored. Content or dwell-off waiting time TDW
Compare _OF with apparent dwell time D_TDWL.

【0162】そして、A>D_TDWLであり、同じ区
間でドエル開始が可能なとき、上記ステップS1210から
ラベルIGS90で示されるステップS1460以降の処理
へ分岐し、A≦D_TDWLであり、同じ区間でドエル
を開始できないときには、ステップS1211へ進んでアキ
ュムレータBの内容を1減算すると、ステップS1212
で、アキュムレータAの内容を、IGCCAS=1に対
応する1つ前の区間のクラセン間隔を加算した値とし、
ラベルIGS15で示されるステップS1350以降の処理
へ進む。
When A> D_TDWL and the dwell can be started in the same section, the process branches from the above step S1210 to the processing of step S1460 and subsequent steps indicated by the label IGS90, and A ≦ D_TDWL, and the dwell is set in the same section. If it cannot be started, the process proceeds to step S1211 and the content of accumulator B is decremented by 1, and step S1212
Then, the content of the accumulator A is set to a value obtained by adding the classen interval of the immediately preceding section corresponding to IGCCAS = 1,
The process proceeds to step S1350 and subsequent steps indicated by the label IGS15.

【0163】一方、上記ステップS1206で、A<DM_
DEGであり、処理遅れ時間を含んでBTDC10°よ
り前の点火が指示されてラベルIGS10以降の処理へ
進んだときには、ステップS1300で、BTDC65°よ
り前に点火が指示されているか否かを調べるため、65
から指示点火時期IG_DEGを減算して差をアキュム
レータAにストアし、ステップS1301で、アキュムレー
タAの内容と処理遅れ時間に相当するむだ角度DM_D
EGとを比較し、A<DM_DEGであり、処理遅れ時
間を含んでBTDC65°より前の点火であるときに
は、BTDC97°より前の点火か否かを調べるため、
さらにラベルIGS20で示されるステップS1400以降
の処理へ進み、A≧DM_DEGであり、処理遅れ時間
を含んでBTDC65°〜BTDC10°の間の点火で
あるときには、ステップS1302へ進む。
On the other hand, in the above step S1206, A <DM_
When the ignition is instructed to ignite before BTDC10 ° including the processing delay time and the processing proceeds to the label IGS10 and thereafter, in step S1300, it is determined whether or not ignition is instructed before BTDC65 °. , 65
The instruction ignition timing IG_DEG is subtracted from the value to store the difference in the accumulator A, and in step S1301, the dead angle DM_D corresponding to the contents of the accumulator A and the processing delay time.
When IG is compared with EG and A <DM_DEG is satisfied and the ignition is before BTDC 65 ° including the processing delay time, it is checked whether or not the ignition is before BTDC 97 °.
Further, the process proceeds to step S1400 and subsequent steps indicated by the label IGS20, and if A ≧ DM_DEG and the ignition is between BTDC65 ° and BTDC10 ° including the process delay time, the process proceeds to step S1302.

【0164】ステップS1302では、BTDC65°〜1
0°の区間を示すクランク位置情報変数CCASの値1
に対応してクラセン間隔テーブルMTCSXから読出し
たクラセン間隔に、アキュムレータAの内容をCCAS
=1の区間のクランク角の値55で割った値を掛けて新
たなアキュムレータAの内容とし、この新たなアキュム
レータAの内容をドエルオフ待ち時間TDW_OFとす
る。そして、ステップS1303で、CCAS=1の値をア
キュムレータBにストアし、このアキュムレータBの内
容を点火クランク位置情報変数IGCCASの値として
ステップS1350へ進む。
In step S1302, BTDC 65 ° to 1
Value 1 of the crank position information variable CCAS indicating the 0 ° section
The contents of the accumulator A are set to CCAS at the class intervals read from the class interval table MTCSX corresponding to
The value of the new accumulator A is multiplied by a value obtained by dividing the crank angle value 55 in the section of = 1 to obtain the content of the new accumulator A as dwell-off waiting time TDW_OF. Then, in step S1303, the value of CCAS = 1 is stored in accumulator B, and the content of this accumulator B is set as the value of ignition crank position information variable IGCCAS, and the flow proceeds to step S1350.

【0165】ステップS1350,S1351,S1352は、前述した
ステップS1210,S1211,1212と同様の処理であり、同じ区
間でドエル開始が可能か否かを判定して、同じ区間でド
エルを開始できるときには、ラべルIGS90以降の処
理へ分岐し、同じ区間でドエルを開始できないときに
は、ドエルオフ待ち時間TDW_OFを1つ前の区間の
クラセン間隔を加算した値とする処理である。
Steps S1350, S1351, S1352 are the same processes as steps S1210, S1211, 1212 described above, and it is judged whether or not the dwell can be started in the same section. If the dwell can be started in the same section, When the dwell cannot be started in the same section by branching to the processing after the label IGS90, the dwell off waiting time TDW_OF is set to a value obtained by adding the classen interval of the preceding section.

【0166】すなわち、ステップS1350で、アキュムレ
ータAの内容すなわちドエルオフ待ち時間TDW_OF
と見かけ上のドエル時間D_TDWLとを比較し、A>
D_TDWLのとき、ステップS1350からラベルIGS
90以降の処理へ分岐し、A≦D_TDWLのとき、ス
テップS1351でアキュムレータBの内容を1減算し(B
=0)、ステップS1352で、アキュムレータAの内容
を、点火クランク位置情報変数IGCCAS=0に対応
する区間のクラセン間隔を加算した値としてラベルIG
S25で示されるステップS1450以降の処理へ進む。
That is, in step S1350, the contents of accumulator A, that is, the dwell-off waiting time TDW_OF.
And the apparent dwell time D_TDWL are compared, and A>
If D_TDWL, label IGS from step S1350.
The processing branches to processing after 90, and when A ≦ D_TDWL, the content of the accumulator B is decremented by 1 in step S1351 (B
= 0), in step S1352, the content of the accumulator A is labeled as a value obtained by adding the Krasen interval in the section corresponding to the ignition crank position information variable IGCCAS = 0.
Then, the process proceeds to step S1450 and subsequent steps shown in S25.

【0167】一方、ラベルIGS20で示されるステッ
プS1400以降の処理では、ステップS1400で、BTDC9
7°より前に点火が指示されているか否かを調べるた
め、97から指示点火時期IG_DEGを減算して差を
アキュムレータAにストアし、ステップS1401で、アキ
ュムレータAの内容と処理遅れ時間に相当するむだ角度
DM_DEGとを比較する。
On the other hand, in the processing after step S1400 indicated by the label IGS20, in step S1400, BTDC9
In order to check whether or not the ignition is instructed before 7 °, the instruction ignition timing IG_DEG is subtracted from 97 and the difference is stored in the accumulator A. In step S1401, the content of the accumulator A and the processing delay time are corresponded. Compare the dead angle DM_DEG.

【0168】そして、上記ステップS1401で、A<DM
_DEGであり、処理遅れ時間を含んでBTDC97°
より前の点火であるときには、上記ステップS1401から
ステップS1402へ分岐してアキュムレータAの内容を処
理遅れ時間に相当するむだ角度DM_DEGとして最大
進角を制限してステップS1403へ進み、上記ステップS14
01で、A≧DM_DEGであり、処理遅れ時間を含んで
BTDC97°〜BTDC65°の間の点火であるとき
には、ステップS1403へ進む。
Then, in the above step S1401, A <DM
_DEG, including processing delay time, BTDC 97 °
When the ignition is earlier, the process branches from step S1401 to step S1402, and the content of the accumulator A is set as the dead angle DM_DEG corresponding to the processing delay time to limit the maximum advance angle and the process proceeds to step S1403.
At 01, A ≧ DM_DEG, and when the ignition is included between BTDC 97 ° and BTDC 65 ° including the processing delay time, the process proceeds to step S1403.

【0169】ステップS1403では、BTDC97°〜6
5°の区間を示すクランク位置情報変数CCASの値0
に対応してクラセン間隔テーブルMTCSXから読出し
たクラセン間隔に、アキュムレータAの内容をCCAS
=0の区間のクランク角の値32で割った値を掛けて新
たなアキュムレータAの内容とし、この新たなアキュム
レータAの内容をドエルオフ待ち時間TDW_OFとす
る。
In step S1403, BTDC 97 ° to 6 °
Value 0 of crank position information variable CCAS indicating a 5 ° section
The contents of the accumulator A are set to CCAS at the class intervals read from the class interval table MTCSX corresponding to
The content of the new accumulator A is multiplied by a value obtained by dividing the crank angle value 32 in the section of = 0, and the content of the new accumulator A is set as the dwell-off waiting time TDW_OF.

【0170】次いで、ステップS1404へ進み、CCAS
=0の値をアキュムレータBにストアし、このアキュム
レータBの内容を点火クランク位置情報変数IGCCA
Sの値としてステップS1450へ進む。ステップS1450以降
の処理は、先のステップS1210,S1211,S1212及びステッ
プS1350,S1351,S1352と同様、同じ区間でドエル開始が
可能か否かを判定して、同じ区間でドエルを開始できる
ときには、ラべルIGS90以降の処理へ分岐し、同じ
区間でドエルを開始できないときには、ドエルオフ待ち
時間TDW_OFを1つ前の区間のクラセン間隔を加算
した値とする処理の繰返しである。
Next, in step S1404, the CCAS
The value of = 0 is stored in the accumulator B, and the contents of the accumulator B are stored in the ignition crank position information variable IGCCA.
As the value of S, the process proceeds to step S1450. Similar to the previous steps S1210, S1211, S1212 and steps S1350, S1351, S1352, the process after step S1450 determines whether or not the dwell can be started in the same section, and when the dwell can be started in the same section, When the dwell cannot be started in the same section by branching to the processing after the bail IGS90, the processing is repeated by setting the dwell off waiting time TDW_OF to a value obtained by adding the Krassen interval of the preceding section.

【0171】すなわち、ステップS1450,S1451,S1452の
処理、ステップS1453,S1454,S1455の処理、ステップS14
56,S1457,S1458の処理で、A≦D_TWDLであり、ラ
べルIGS90へ分岐しないとき、アキュムレータBの
内容を、B=−1、B=−2、B=−3と順に減らして
区間を1つずつ前にし、ドエルオフ待ち時間TDW_O
Fを次々に延長してゆく。
That is, the processes of steps S1450, S1451 and S1452, the processes of steps S1453, S1454 and S1455, and step S14.
In the processing of 56, S1457, S1458, when A ≦ D_TWDL and the branch is not made to the label IGS90, the content of the accumulator B is reduced in order to B = −1, B = −2, B = −3, and the section is reduced. Wait one by one and wait for dwelling off TDW_O
Extend F one after another.

【0172】そして、ステップS1456〜S1458を経てアキ
ュムレータBの内容が−3に達し、ステップS1459でA
>D_TDWLとなったとき、ステップS1459からラベ
ルIGS90のステップS1460へ進み、依然としてA≦
D_TDWLのときには、ステップS1459からステップS
1461へ進んで、アキュムレータAの内容を処理遅れ時間
としてステップS1462へ進む。
Then, through steps S1456 to S1458, the content of accumulator B reaches -3, and in step S1459, A
When> D_TDWL, the process proceeds from step S1459 to step S1460 of the label IGS90 and still A ≦
In the case of D_TDWL, steps S1459 to S
Proceeding to 1461, the contents of accumulator A are set as the processing delay time, and the flow proceeds to step S1462.

【0173】ラベルIGS90のステップS1460では、
ドエルオフ待ち時間TDW_OFから逆算してドエルオ
ン待ち時間TDW_ONを算出するため、アキュムレー
タAの内容すなわちドエルオフ待ち時間TDW_OFか
ら実ドエル時間TDWLを減算して新たなアキュムレー
タAの内容とし、ステップS1462へ進む。
At step S1460 of the label IGS90,
Since the dwell-on waiting time TDW_OF is calculated back to calculate the dwell-on waiting time TDW_ON, the contents of the accumulator A, that is, the dwell-off waiting time TDW_OF, is subtracted from the actual dwell time TDWL to obtain the contents of the new accumulator A, and the process proceeds to step S1462.

【0174】そして、ステップS1462で、アキュムレー
タAの内容をドエルオン待ち時間TDW_ONとし、ま
た、ステップS1463で、アキュムレータBの内容をドエ
ル開始クランク位置情報変数DWCCASの値として点
火スケジュールの書換えを終了すると、ステップS1464
へ進んで、Xレジスタの値をスケジュールポインタIG
SCUSに保存し、ルーチンを抜ける。
Then, in step S1462, the contents of the accumulator A are set to the dwell-on waiting time TDW_ON, and in step S1463, the contents of the accumulator B are set to the value of the dwell start crank position information variable DWCCAS, and the ignition schedule is rewritten. S1464
To the schedule pointer IG.
Save to SCUS and exit the routine.

【0175】以上の点火スケジュールが10ms毎に作
成されると、クラセン割込み時に、点火タイマがセット
される。この点火タイマは、図27に示すように、モー
ドM1の出力パターン、あるいは、モードM2の出力パ
ターンで動作し、モードM1では、初期値T1、リロー
ド値T2をタイマにセットしてスタートさせると、時間
T1が経過したとき、出力がローレベル(点火コイル非
通電)からハイレベル(点火コイル通電)となり、時間
T2経過後にローレベルとなる一方、モードM2では、
初期値T3、リロード値FFFF(時間規定せず)をタ
イマにセットして出力がハイレベルの状態でタイマをス
タートさせると、時間T3経過後に出力がローレベルと
なる。
When the above ignition schedule is created every 10 ms, the ignition timer is set at the time of the classen interrupt. As shown in FIG. 27, this ignition timer operates in the output pattern of the mode M1 or the output pattern of the mode M2. In the mode M1, when the initial value T1 and the reload value T2 are set and started, When the time T1 has elapsed, the output changes from a low level (non-energization of the ignition coil) to a high level (energization of the ignition coil) and becomes a low level after the time T2 elapses.
If the initial value T3 and the reload value FFFF (time is not specified) are set in the timer and the timer is started while the output is at the high level, the output becomes the low level after the time T3 has elapsed.

【0176】この場合、通常のクラセン割込みでは、モ
ードM1でドエル開始時間及びドエル時間をセットする
第1の通電シーケンスが採用され、エンジン高回転時な
ど、点火の時間間隔が短くなり、クラセン割込み時に既
に点火コイル26aへの通電が行なわれている状態で点
火区間となったとき、モードM2でドエルオフ時間をセ
ットする第2の通電シーケンスが採用される。
In this case, in the normal classen interrupt, the first energization sequence for setting the dwell start time and the dwell time in the mode M1 is adopted, and the ignition time interval is shortened when the engine is rotating at high speed. When the ignition section is started while the ignition coil 26a is already energized, the second energization sequence for setting the dwell off time in the mode M2 is adopted.

【0177】この第1,第2の通電シーケンスは、エン
ジン回転数の高低、ドエル時間の大小、回転数の急変、
点火時期の急変などによって決まり、後述する点火終了
時の割込み処理において最新の点火スケジュールから現
在の通電状態が調べられ、直ちに次のドエルを開始すべ
きどうかを判別することにより、2種類の通電シーケン
スのいずれかが選択される。そして、クラセン割込み時
の点火タイマセットサブルーチンにおいて通電シーケン
スが判別され、通電シーケンスに応じて点火タイマがセ
ットされる。
In the first and second energization sequences, the engine speed is high or low, the dwell time is large or small, the speed is suddenly changed,
Determined by sudden changes in ignition timing, the current energization state is checked from the latest ignition schedule in interrupt processing at the end of ignition, which will be described later, and immediately determines whether to start the next dwell. Is selected. Then, the energization sequence is determined in the ignition timer setting subroutine at the time of the classen interrupt, and the ignition timer is set according to the energization sequence.

【0178】すなわち、点火終了時に次の点火のための
通電シーケンスを適切に設定することにより、従来のよ
うに、エンジン高回転時に点火コイルの通電時間が短く
なって必要な点火エネルギーが蓄積されずに失火が発生
することを防止し、点火間隔の大小に拘らず常に最適な
点火コイルの通電時間を確保してエンジン出力性能の向
上、排気ガスエミッションの改善などを図ることができ
るのである。
That is, by appropriately setting the energization sequence for the next ignition at the end of ignition, the energization time of the ignition coil is shortened at the time of high engine rotation, and the required ignition energy is not accumulated, as in the conventional case. It is possible to prevent the occurrence of misfire and to always ensure the optimum energization time of the ignition coil regardless of the size of the ignition interval, thereby improving the engine output performance and improving the exhaust gas emission.

【0179】以下、まず、点火タイマセットサブルーチ
ンについて図15及び図16のフローチャートに従って
説明する。
First, the ignition timer setting subroutine will be described below with reference to the flowcharts of FIGS.

【0180】この点火タイマセットサブルーチンでは、
ステップS1500で、エラーレベルECASが2であるか
否か、すなわち、気筒及びクランク位置の判別がなされ
ていない不明の状態であるか否かを調べ、ECAS=2
のときには、そのままルーチンを抜け、ECAS≠2の
とき、ステップS1501へ進んで、点火時期未設定フラグ
IGTMNSがセットされているか否かを調べる。
In this ignition timer set subroutine,
In step S1500, it is checked whether or not the error level ECAS is 2, that is, whether or not the cylinder and crank positions are not discriminated, and ECAS = 2.
In case of, the routine is exited as it is, and in case of ECAS ≠ 2, the routine proceeds to step S1501 to check whether or not the ignition timing unset flag IGTMNS is set.

【0181】上記点火時期未設定フラグIGTMNS
は、後述する点火終了割込みにおいて点火タイマにドエ
ルオンの時間のみがセットされ、ドエルオフの時間がセ
ットされずにドエルが開始されて点火のタイミングが未
設定の状態にあることを示すフラグであり、上記ステッ
プS1501で、点火時期未設定フラグがセットされてお
り、点火コイル26aへ通電中であるときには、ラベル
TENS30で示されるステップS1530以降の処理へ分
岐してドエルオフ待ち時間→点火のモードM2による第
2の通電シーケンスを点火タイマに設定し、点火時期未
設定フラグがセットされていないときには、上記ステッ
プS1501からステップS1502へ進む。
Ignition timing unset flag IGTMNS
Is a flag indicating that only the dwell-on time is set in the ignition timer in the ignition end interrupt described later, the dwell is started without setting the dwell-off time, and the ignition timing is not set. In step S1501, when the ignition timing unset flag is set and the ignition coil 26a is energized, the process branches to step S1530 and subsequent steps indicated by label TENS30, and the dwell-off waiting time → second ignition mode M2 When the ignition sequence is set to the ignition timer and the ignition timing unset flag is not set, the process proceeds from step S1501 to step S1502.

【0182】ステップS1502では、後述する点火終了時
割込みにおいて採用された最新の点火スケジュールから
読出したドエル開始クランク位置情報変数DWCCAS
の指示値によるドエル開始区間を横軸、クランク総合位
置変数ACASを縦軸として通電状態マップIGCTB
Lを参照する。
In step S1502, the dwell start crank position information variable DWCCCAS read from the latest ignition schedule adopted in the ignition end interrupt which will be described later.
Energization state map IGCTB with the horizontal axis of the dwell start section according to the indicated value of the crank and the vertical axis of the crank total position variable ACAS
Reference L.

【0183】上記通電状態マップIGCTBLは、点火
スケジュールが各気筒共通の点火シーケンスを表わすも
のであるに対し、図28に示すように、クランク総合位
置変数ACASと、ドエル開始クランク位置情報変数D
WCCASあるいは点火クランク位置情報変数IGCC
ASの指示値とに基づいて、ある時点での気筒毎の点火
コイル26aへの通電状態を1バイトのマップ値で表わ
したものである。
In the above energization state map IGCTBL, the ignition schedule represents the ignition sequence common to all cylinders, but as shown in FIG. 28, the crank total position variable ACAS and the dwell start crank position information variable D are set.
WCCAS or ignition crank position information variable IGCC
Based on the instruction value of AS, the energization state of the ignition coil 26a for each cylinder at a certain time is represented by a 1-byte map value.

【0184】上記通電状態マップIGCTBLのマップ
値は、上位4ビットが、値0で今現在、値Fで一回遅
れ、値Eで2回遅れの遅れ状況を表わし、下位4ビット
が通電対象気筒を示すデータとして気筒情報変数RCA
Sを表わし、点火気筒情報変数IGRCASとして採用
される。例えば、ドエル開始クランク位置情報変数DW
CCASが−1で現在のクランク位置総合変数ACAS
が3であれば、マップ値はF1であり、これは、RCA
S=1すなわち#3気筒に対するドエルが1つ前の区間
で始まっているべきであったことを表わす。また、例え
ば、点火クランク位置情報変数IGCCASが2で現在
のクランク位置総合変数ACASが11であれば、マッ
プ値は03であり、これは、RCAS=3すなわち#4
気筒に対する点火が今の区間で行なわれるべきであるこ
とを表わす。
In the map value of the energization state map IGCTBL, the upper 4 bits have a value of 0 and the value F is currently delayed once, and the value E is delayed twice, and the lower 4 bits are the cylinders to be energized. Cylinder information variable RCA
It represents S and is adopted as the ignition cylinder information variable IGRCAS. For example, the dwell start crank position information variable DW
CCAS is -1 and the current crank position total variable ACAS
Is 3, the map value is F1, which is the RCA
S = 1, that is, the dwell for the # 3 cylinder should have started in the previous section. Further, for example, if the ignition crank position information variable IGCCAS is 2 and the current crank position total variable ACAS is 11, the map value is 03, which is RCAS = 3, that is, # 4.
Indicates that the cylinder should be ignited in the current interval.

【0185】これにより、現在の区間に対してあるべき
通電状態を効率的に判別することができ、条件判断の繁
雑化によるメモリ容量の増大や処理速度の低下を抑えて
精密且つ高速な点火制御を可能とすることができるので
ある。
As a result, it is possible to efficiently discriminate the energization state that should be present in the current section, suppress the increase in memory capacity and the reduction in processing speed due to the complicated condition judgment, and perform precise and high-speed ignition control. Can be made possible.

【0186】その後、上記ステップS1502からステップS
1503へ進むと、上記通電状態マップIGCTBLの参照
結果から今ドエル開始区間でないか否かを判断し、ドエ
ル開始区間でないときにはルーチンを抜け、ドエル開始
区間であるときには、ステップS1504へ進んで、点火タ
イマが作動中であることを示すタイマ作動中フラグFL
G_IGを参照してタイマが終了しているか否かを調
べ、タイマが終了していないときにはルーチンを抜け、
タイマが終了しているとき、ステップS1505で点火気筒
情報変数IGRCASを決定し、ラベルTENS70で
示されるステップS1570以降の処理へ進んで、待ち時間
→ドエルオン→ドエル時間→点火のモードM1による第
1の通電シーケンスを点火タイマに設定する。
Thereafter, the above steps S1502 to S
When it proceeds to 1503, it is judged from the reference result of the above-mentioned energization state map IGCTBL whether or not it is the dwell start section now. If it is not the dwell start section, the routine exits. If it is the dwell start section, the routine proceeds to step S1504, and the ignition timer Flag FL indicating that the timer is operating
Check G_IG to see if the timer has expired. If the timer has not expired, exit the routine,
When the timer has expired, the ignition cylinder information variable IGRCAS is determined in step S1505, the process proceeds to step S1570 and subsequent steps indicated by the label TENS70, and wait time → dwell on → dwell time → first ignition mode M1 Set the energization sequence to the ignition timer.

【0187】次に、ラベルTENS30以降のモードM
2による点火タイマのセット、及び、ラベルTENS7
0以降のモードM1による点火タイマのセットについて
説明する。
[0187] Next, the mode M after the label TENS30
2 Set ignition timer and label TENS7
The setting of the ignition timer in the mode M1 after 0 will be described.

【0188】まず、ラベルTENS30以降では、ステ
ップS1530で、点火スケジュールの点火クランク位置情
報変数IGCCASの指示値による点火区間を横軸、ク
ランク総合位置変数ACASを縦軸として通電状態マッ
プIGCTBLを参照し、ステップS1531で、今点火区
間でないか否かを調べる。そして、点火区間でないとき
にはルーチンを抜け、点火区間のとき、ステップS1531
からステップS1532へ進んで、アキュムレータBに値F
FFFをストアし、ステップS1533で、点火タイマの出
力パターンをモードM2とする。
First, after the label TENS30, in step S1530, the energization state map IGCTBL is referenced with the horizontal axis of the ignition section according to the instruction value of the ignition crank position information variable IGCCAS of the ignition schedule and the vertical axis of the crank total position variable ACAS. In step S1531, it is checked whether it is not in the ignition section. If it is not in the ignition section, the routine is exited, and if it is in the ignition section, step S1531
From step S1532, the value F is stored in the accumulator B.
FFF is stored, and the output pattern of the ignition timer is set to mode M2 in step S1533.

【0189】次に、ステップ1534へ進み、点火スケジュ
ールから読出したドエルオフ待ち時間TDW_OFに対
して現在の処理遅れ時間を減算し、その値をアキュムレ
ータAにストアすると、ステップS1535で、アキュムレ
ータAの内容が正の値であり、正常であるか否かを調べ
る。
Next, proceeding to step 1534, the current processing delay time is subtracted from the dwell off waiting time TDW_OF read from the ignition schedule, and the value is stored in the accumulator A. At step S1535, the contents of the accumulator A are stored. It is a positive value, and it is checked whether it is normal or not.

【0190】上記ステップS1535において、A>0であ
り、正常であるときには、上記ステップS1535からステ
ップS1580へ進んで、アキュムレータAの内容を気筒別
のリタード時間を加算した新たな内容とする。この気筒
別のリタード時間は、50msジョブにおいて、気筒別
のリタード角度からリタード時間に変換されたものであ
り、このクラセン割込み時の点火タイマセットの際に加
算することにより、極めて容易に気筒別にリタードを行
なうことができる。
In step S1535, when A> 0 and normal, the flow proceeds from step S1535 to step S1580 to set the contents of accumulator A to the new contents obtained by adding the retard time for each cylinder. This retard time for each cylinder is converted from the retard angle for each cylinder to the retard time in the 50 ms job, and it is extremely easy to perform the retard time for each cylinder by adding it when setting the ignition timer at the time of the classen interrupt. Can be done.

【0191】その後、ステップS1581へ進み、新たなア
キュムレータAの内容、すなわち気筒別のリタード時間
を加算したドエルオフ時間をタイマ初期値とし、ステッ
プS1582で、アキュムレータBの内容をタイマリロード
値として、ステップS1595で、点火タイマをスタートさ
せる。
Thereafter, the flow proceeds to step S1581, and the contents of the new accumulator A, that is, the dwell-off time obtained by adding the retard time for each cylinder is set as the timer initial value. In step S1582, the contents of the accumulator B is set as the timer reload value, and step S1595 is set. Then, start the ignition timer.

【0192】すなわち、点火コイル通電中で点火区間と
なったクラセン割込みから、点火スケジュールのドエル
オフ待ち時間TDW_OFから現在の処理遅れ時間を減
算して気筒別のリタード時間を加算した時間に達したと
き、点火タイマの出力がハイレベルからローレベルとな
って点火(ドエルオフ)が行なわれる。尚、この場合、
点火タイマの出力がローレベルとなってからは、タイマ
リロード値がFFFFにセットされているため、ローレ
ベルの状態をそのまま継続する。
That is, when the current processing delay time is subtracted from the dwell-off waiting time TDW_OF of the ignition schedule and the retard time for each cylinder is added from the Krasen interrupt which is in the ignition section while the ignition coil is energized, The output of the ignition timer changes from high level to low level, and ignition (dwell off) is performed. In this case,
Since the timer reload value is set to FFFF after the ignition timer output becomes low level, the low level state is continued.

【0193】そして、点火タイマをスタートさせた後、
ステップS1596へ進み、タイマ作動中であることを示す
ためタイマ作動中フラグFLG_IGをセットすると、
ステップS1597で、点火時期未設定フラグIGTMNS
をクリアしてルーチンを抜ける。
Then, after starting the ignition timer,
In step S1596, if the timer operating flag FLG_IG is set to indicate that the timer is operating,
In step S1597, ignition timing unset flag IGTMNS
To clear the routine.

【0194】一方、上記ステップS1535において、アキ
ュムレータAの内容すなわちドエルオフ待ち時間TDW
_OFから現在の処理遅れ時間を減算した値が、通常起
こり得ないA≦0の状態となったときには、点火タイマ
には負の時間はセットできないため、上記ステップS153
5からステップS1590へ分岐してタイマ初期値を0とし、
ステップS1591で、アキュムレータBの内容をタイマリ
ロード値としてステップS1592へ進む。
On the other hand, in step S1535, the contents of the accumulator A, that is, the dwell-off waiting time TDW.
When the value obtained by subtracting the current processing delay time from _OF is in a state where A ≦ 0, which cannot occur normally, a negative time cannot be set in the ignition timer, so the above step S153.
Branch from 5 to step S1590 to set the timer initial value to 0,
In step S1591, the contents of accumulator B are set as the timer reload value, and the flow advances to step S1592.

【0195】ステップS1592では、現在の処理遅れ時間
が記録値ICTIMEを越えたか否かを調べ、記録値I
CTIMEを越えていないときには、ステップS1594で
エラーフラグをセットし、記録値ICTIMEを越えて
いるときには、ステップS1593で、処理遅れ記録を更新
して記録値ICTIMEの最大値を書換えた後、ステッ
プS1594でエラーフラグをセットし、前述のステップ159
5〜S1597を経てルーチンを抜ける。
In step S1592, it is checked whether or not the current processing delay time exceeds the recorded value ICTIME, and the recorded value I
If it does not exceed CTIME, an error flag is set in step S1594, and if it exceeds record value ICTIME, in step S1593 the processing delay record is updated to rewrite the maximum value of record value ICTIME, and then in step S1594. Set the error flag and go to step 159 above.
Exit the routine through 5 to S1597.

【0196】上記記録値ICTIMEは、次の点火スケ
ジュール作成の際に用いられ、この記録値ICTIME
による処理遅れ時間を見込んでおくことにより、次の点
火タイマセットで二度とエラーが生じないようにするこ
とができる。
The above recorded value ICTIME is used when the next ignition schedule is created.
By anticipating the processing delay time due to, it is possible to prevent an error from occurring again in the next ignition timer set.

【0197】次に、ラベルTENS70以降の処理につ
いて説明すると、ステップS1570で、モードM1の出力
パターンを設定し、ステップS1571で、各気筒の点火コ
イル26aに対応するイグナイタ27内の駆動回路を選
択するためのロジック上のデストリビュータを選択す
る。
Next, the processing after the label TENS70 will be described. In step S1570, the output pattern of the mode M1 is set, and in step S1571, the drive circuit in the igniter 27 corresponding to the ignition coil 26a of each cylinder is selected. Choose a distributor on the logic for.

【0198】次いで、ステップS1572へ進み、点火スケ
ジュールから読出したドエルオン待ち時間TDW_ON
に対して現在の処理遅れ時間を減算し、その値をアキュ
ムレータAにストアすると、ステップS1573へ進んで、
アキュムレータBに実ドエル時間TDWLをストアす
る。
Next, in step S1572, the dwell-on waiting time TDW_ON read from the ignition schedule is read.
Is subtracted from the current processing delay time, and the value is stored in the accumulator A, the process proceeds to step S1573,
Store the actual dwell time TDWL in accumulator B.

【0199】そして、上記ステップS1573からステップS
1574へ進み、アキュムレータAの内容すなわちドエルオ
ン時間TDW_ONが正の値で正常であるか否かを調
べ、A>0のとき、前述のステップS1580以降へ進み、
ステップS1580,S1581,S1582を経て、アキュムレータA
の内容を気筒別のリタード時間を加算した新たな内容と
してタイマ初期値とし、アキュムレータBの内容すなわ
ち実ドエル時間TDWLをタイマリロード値として点火
タイマをスタートさせ、前述のステップS1595,S1596,S1
597を経てルーチンを抜ける。
Then, from step S1573 to step S
The procedure proceeds to 1574, and it is checked whether or not the contents of the accumulator A, that is, the dwell-on time TDW_ON is a positive value and is normal, and when A> 0, the procedure proceeds to the step S1580 and thereafter,
After steps S1580, S1581 and S1582, accumulator A
Is set as a timer initial value as new contents obtained by adding the retard time for each cylinder, and the ignition timer is started by using the contents of the accumulator B, that is, the actual dwell time TDWL as the timer reload value, and the above-mentioned steps S1595, S1596, S1
Exit the routine via 597.

【0200】すなわち、クラセン割込み時に、点火時期
未設定フラグIGTMNSがセットされておらず点火コ
イル26aが通電されていないときには、通電状態マッ
プIGCTBLから今回のクラセン割込みの状態を判別
し、今回のクラセン割込みがドエル開始区間のとき、点
火スケジュールのドエルオン待ち時間TDW_ONから
現在の処理遅れ時間を減算して気筒別のリタード時間を
加算した時間を点火タイマにセットし、設定時間経過後
に点火タイマの出力をローレベルからハイレベルとして
点火コイル26aへの通電を開始し、実ドエル時時間T
DWLが経過した後に通電を終了して点火を行なうので
ある。
That is, at the time of the classen interrupt, when the ignition timing unset flag IGTMNS is not set and the ignition coil 26a is not energized, the current state of the classen interrupt is determined from the energization state map IGCTBL to determine the current classen interrupt. Is the dwell start section, the current processing delay time is subtracted from the dwell-on waiting time TDW_ON of the ignition schedule and the retard time for each cylinder is added to the ignition timer. After the set time elapses, the output of the ignition timer is set to low. From the level to the high level, the energization of the ignition coil 26a is started, and the actual dwell time T
After the passage of DWL, energization is terminated and ignition is performed.

【0201】また、上記ステップS1574において、A≦
0のときには、上記ステップS1574から前述のステップS
1590以降へ進み、同様に、タイマ初期値を0、アキュム
レータBの内容をタイマリロード値として、現在の処理
遅れ時間が記録値ICTIMEを越えているとき、処理
遅れ記録を更新する。
In step S1574, A ≦
When it is 0, the above steps S1574 to S
When the processing proceeds to 1590 and thereafter, similarly, when the timer initial value is 0 and the content of the accumulator B is the timer reload value and the current processing delay time exceeds the recording value ICTIME, the processing delay record is updated.

【0202】以上の点火タイマセットサブルーチンによ
り点火タイマがセットされ、点火が行なわれると、図1
に示す点火終了時割込みが発生する。
When the ignition timer is set by the above ignition timer setting subroutine and ignition is performed,
An interrupt occurs at the end of ignition as shown in.

【0203】この点火終了時割込みでは、まず最初に、
ステップS1600でドエルオフ時であるか否かを調べ、ド
エルオフ時でないときには割込みを終了し、ドエルオフ
時のみ、ステップS1601以降へ進んで、所定の処理を行
なう。
In this ignition end interrupt, first of all,
In step S1600, it is checked whether or not it is during dwell-off. If it is not during dwell-off, the interruption is ended, and only during dwell-off, the process proceeds to step S1601 and subsequent steps to perform a predetermined process.

【0204】すなわち、ステップS1601で、点火タイマ
の停止・クリアを行ない、ステップS1602で、タイマ作
動中フラグFLG_IGをクリアすると、ステップS160
3へ進み、前述の点火スケジュール作成サブルーチンに
おいて使用した最新の点火スケジュールを指示するスケ
ジュールポインタIGSCUSの値を、スケジュールポ
インタIGSCPTにコピーし、このスケジュールポイ
ンタIGSCPTによって指定されるアドレスの最新の
点火スケジュールを採用する。
That is, in step S1601, the ignition timer is stopped / cleared, and in step S1602, the timer operating flag FLG_IG is cleared.
Proceed to 3 and copy the value of the schedule pointer IGSCUS, which indicates the latest ignition schedule used in the above-mentioned ignition schedule creation subroutine, to the schedule pointer IGSCPT, and adopt the latest ignition schedule of the address specified by this schedule pointer IGSCPT. To do.

【0205】次いで、ステップS1604へ進み、点火スケ
ジュールのドエル開始クランク位置情報変数DWCCA
Sと現在のクランク総合位置変数ACASとをパラメー
タとして、通電状態マップIGCTBLからマップ値を
読出して下位4ビットから現在の点火気筒情報変数IG
RCASを調査し、ステップS1605で、現在の点火気筒
情報変数IGRCASが今までと同じ値であるか否かを
調べる。
Then, the flow proceeds to step S1604, and the dwell start crank position information variable DWCCA of the ignition schedule.
Using S and the current crank total position variable ACAS as parameters, a map value is read from the energization state map IGCTBL and the lower 4 bits indicate the current ignition cylinder information variable IG.
The RCAS is checked, and in step S1605, it is checked whether or not the current ignition cylinder information variable IGRCAS has the same value as before.

【0206】その結果、現在の点火気筒情報変数IGR
CASが今までと同じときには、同じ気筒にもう一度点
火する必要がないため、割込みを終了し、現在の点火気
筒情報変数IGRCASが今までと異なるときには、上
記ステップS1605からステップS1606へ進んで、点火気筒
情報変数IGRCASを更新し、ステップS1607へ進
む。
As a result, the current ignition cylinder information variable IGR
When CAS is the same as before, it is not necessary to ignite the same cylinder again, so interrupt is ended, and when the current ignition cylinder information variable IGRCAS is different from before, the routine proceeds from step S1605 to step S1606, and the ignition cylinder is ignited. The information variable IGRCAS is updated, and the process proceeds to step S1607.

【0207】ステップS1607では、点火気筒情報変数I
GRCASの値をドエルの観点から見た値と点火の観点
から見た値が同じか否かを調べることにより、現在の状
況が即座にドエルを開始しなければならない状況か否か
を判別する。ここで、ドエルの観点から見た気筒情報を
RCASDWL(=IGRCAS)で示し、点火の観点で
見た気筒情報をRCASIGで示すと、図29に示すよう
な関係となり、ドエルの観点から見た気筒情報RCAS
DWL(=IGRCAS)は通電開始区間となってから次
の通電開始区間となるまで点火対象気筒を一定の値で示
すデータであり、点火の観点から見た気筒情報RCAS
IGは同一気筒に対して気筒情報RCASDWLと同じ値を
取り、通電終了区間となってから次の通電終了区間とな
るまで点火対象気筒を一定の値で示すデータである。そ
して、点火が終了したままドエルを開始する必要のない
区間でのみ両者が一致する。
In step S1607, the ignition cylinder information variable I
By checking whether the value of GRCAS is the same from the viewpoint of dwell and the value from the viewpoint of ignition, it is determined whether or not the current situation is the situation in which the dwell should be started immediately. Here, if the cylinder information from the viewpoint of dwell is shown by RCASDWL (= IGRCAS) and the cylinder information from the viewpoint of ignition is shown by RCASIG, the relationship as shown in FIG. Information RCAS
DWL (= IGRCAS) is data indicating the ignition target cylinder with a constant value from the energization start section to the next energization start section, and the cylinder information RCAS from the viewpoint of ignition.
IG has the same value as the cylinder information RCASDWL for the same cylinder, and is data indicating the ignition target cylinder with a constant value from the energization end section to the next energization end section. Then, the two coincide with each other only in the section where it is not necessary to start the dwell while the ignition is completed.

【0208】すなわち、この点火終了割込みが発生した
点火終了時に、RCASDWL≠RCASIGとなり、点火
コイルの通電終了と通電開始とが同一区間内の場合に
は、エンジン回転数の急変、点火時期の急変などによ
り、ある気筒の点火が終了すると直ちに次の気筒のドエ
ルを開始しなければならない区間であることがわかる。
That is, at the end of ignition when this ignition end interrupt occurs, RCASDWL ≠ RCASIG, and when the end of energization of the ignition coil and the start of energization are in the same section, a sudden change in engine speed, a sudden change in ignition timing, etc. From this, it is understood that it is a section in which the dwell of the next cylinder must be started immediately after the ignition of one cylinder is completed.

【0209】従って、上記ステップS1607で、点火気筒
情報変数IGRCAS(=RCASDWL)が点火から見
た値RCASIGと同じときには、点火コイルの通電終了
と通電開始とが同一区間内でなく、通常の点火終了と判
別して割込みを終了し、前述したように、クラセン割込
み毎に次のドエル開始区間を待ち、ドエル開始区間とな
ったとき、待ち時間→ドエルオン→ドエル時間→点火の
第1の通電シーケンス(モードM1)を点火タイマにセ
ットする。
Therefore, in step S1607, when the ignition cylinder information variable IGRCAS (= RCASDWL) is the same as the value RCASIG seen from the ignition, the energization end and the energization start of the ignition coil are not in the same section, and the normal ignition end is performed. As described above, the interrupt is ended, and the next dwell start section is waited for each classen interrupt, and when the dwell start section is reached, the first energization sequence of waiting time → dwell on → dwell time → ignition ( Set mode M1) to the ignition timer.

【0210】また、上記ステップS1607で、点火気筒情
報変数IGRCASが点火から見た値RCASIGと異な
るときには、点火コイルの通電終了と通電開始とが同一
区間内であり即座にドエルを開始しなければならない状
況であると判別してステップS1608以降の点火タイマセ
ットの処理へ進み、待ち時間→ドエルオンのみの第2の
通電シーケンスを点火タイマにセットする。
If the ignition cylinder information variable IGRCAS is different from the value RCASIG as seen from ignition in step S1607, the end of energization and the start of energization of the ignition coil must be in the same section and dwell must be started immediately. When it is determined that there is a situation, the process proceeds to the ignition timer setting process from step S1608, and the second energization sequence of only waiting time → dwell-on is set in the ignition timer.

【0211】すなわち、ステップS1608で、ロジック上
のデストリビュータを選択し、ステップS1609で、タイ
マ初期値を256にすると、ステップS1610で、タイマ
リロード値をFFFFとする。尚、タイマ初期値の25
6は、点火コイル26aの一次側端子から回転信号をピ
ックアップするタコメータを採用した場合に確実な計数
を可能とする1msのオフ期間(オフ時間)であり、他
の形式のタコメータを採用する場合には、点火コイル2
6aの特性などに応じて設定しても良い。
That is, in step S1608, a distributor on the logic is selected, and in step S1609, the timer initial value is set to 256. In step S1610, the timer reload value is set to FFFF. The timer default value is 25
6 is an off period (off time) of 1 ms that enables reliable counting when a tachometer that picks up a rotation signal from the primary terminal of the ignition coil 26a is adopted, and when another type of tachometer is used, Is the ignition coil 2
It may be set according to the characteristics of 6a.

【0212】そして、上記ステップS1610からステップS
1611へ進み、点火タイマの出力パターンをモードM1と
してステップS1612で点火タイマをスタートさせ、ステ
ップS1613で、タイマ作動中フラグFLG_IGをセッ
トすると、ステップS1614で、ドエルが開始されている
にも拘らずドエルオフすなわち点火のタイミングが設定
されていないことを示す点火時期未設定フラグIGTM
NSをセットし、割込みを終了する。
Then, from step S1610 to step S16.
Proceeding to 1611, the output pattern of the ignition timer is set to mode M1, the ignition timer is started in step S1612, and the timer operating flag FLG_IG is set in step S1613. In step S1614, the dwell is started even though the dwell is started. That is, the ignition timing unset flag IGTM indicating that the ignition timing is not set.
Set NS and end the interrupt.

【0213】これにより、点火終了後、1msのオフ期
間をおいてドエルが開始され、クラセン割込み毎に点火
をすべき区間となるのを待って点火区間となったとき、
ドエルオフ時間→点火の第2の通電シーケンスが点火タ
イマにセットされる。
As a result, when the dwell is started after an off period of 1 ms after the end of ignition and the ignition section is reached by waiting for the section to be ignited at each classen interrupt,
The second energization sequence of dwell off time → ignition is set in the ignition timer.

【0214】[0214]

【発明の効果】以上説明したように本発明によれば、点
火終了時に、点火コイルの通電終了と通電開始とが同一
区間内となるか否かを判別し、通電終了と通電開始が同
一区間内でない場合、通電を開始する区間となってから
通電開始までの時間のデータと、通電継続時間のデータ
とを点火タイマにセットする第1の通電シーケンスを設
定し、通電終了と通電開始とが同一区間内となる場合、
点火終了から所定のオフ時間をもって通電を開始させる
データを点火タイマにセットした後、点火を実行する区
間となってから通電終了までの時間のデータを点火タイ
マにセットする第2の通電シーケンスを設定して、点火
コイルの通電・遮断を行ない、点火制御を実行するた
め、点火間隔の大小に拘らず常に最適な点火コイルの通
電時間を確保することができ、エンジン出力性能の向
上、排気ガスエミッションの改善を図ることができるな
ど優れた効果が得られる。
As described above, according to the present invention, at the end of ignition, it is determined whether or not the energization end and the energization start of the ignition coil are in the same section, and the energization end and the energization start are in the same section. If it is not within the range, the first energization sequence that sets the data of the time from the start of energization until the start of energization and the data of the energization duration to the ignition timer is set, and the end of energization and the start of energization are set. If it is in the same section,
After setting the data to start energization with a predetermined off time from the end of ignition to the ignition timer, set the second energization sequence to set the data of the time from the start of the ignition to the end of energization to the ignition timer Since the ignition coil is energized / interrupted and the ignition control is executed, the optimum ignition coil energization time can always be secured regardless of the size of the ignition interval, improving engine output performance and exhaust gas emission. It is possible to obtain excellent effects such as improvement of

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

【図1】点火終了時割込み処理のフローチャートFIG. 1 is a flowchart of interrupt processing at the end of ignition.

【図2】0.5ms毎の定期割込み処理のフローチャー
FIG. 2 is a flowchart of periodic interrupt processing every 0.5 ms.

【図3】クラセン割込み処理のフローチャートFIG. 3 is a flowchart of classen interrupt processing.

【図4】ジョブ優先処理のフローチャートFIG. 4 is a flowchart of job priority processing.

【図5】ジョブ実行サブルーチンの部分フローチャート
FIG. 5 is a partial flowchart 1 of a job execution subroutine.

【図6】ジョブ実行サブルーチンの部分フローチャート
FIG. 6 is a partial flowchart 2 of a job execution subroutine.

【図7】ジョブ実行サブルーチンの部分フローチャート
FIG. 7 is a partial flowchart 3 of a job execution subroutine.

【図8】ジョブ実行サブルーチンの部分フローチャート
FIG. 8 is a partial flowchart 4 of a job execution subroutine.

【図9】クランク位置算出サブルーチンのフローチャー
FIG. 9 is a flowchart of a crank position calculation subroutine.

【図10】CCAS・RCAS判別サブルーチンのフロ
ーチャート
FIG. 10 is a flowchart of a CCAS / RCAS discrimination subroutine.

【図11】点火スケジュール作成サブルーチンの部分フ
ローチャート1
FIG. 11 is a partial flowchart 1 of an ignition schedule creation subroutine.

【図12】点火スケジュール作成サブルーチンの部分フ
ローチャート2
FIG. 12 is a partial flowchart 2 of an ignition schedule creation subroutine.

【図13】点火スケジュール作成サブルーチンの部分フ
ローチャート3
FIG. 13 is a partial flowchart 3 of an ignition schedule creation subroutine.

【図14】点火スケジュール作成サブルーチンの部分フ
ローチャート4
FIG. 14 is a partial flowchart 4 of an ignition schedule creation subroutine.

【図15】点火タイマセットサブルーチンの部分フロー
チャート1
FIG. 15 is a partial flowchart 1 of an ignition timer setting subroutine.

【図16】点火タイマセットサブルーチンの部分フロー
チャート2
FIG. 16 is a partial flowchart 2 of an ignition timer setting subroutine.

【図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 of crank position variables.

【図20】ジョブ実行中フラグとオーバーラップカウン
タの変化を示す説明図
FIG. 20 is an explanatory diagram showing changes in a job execution flag and an overlap counter.

【図21】システムシフトバッファの説明図FIG. 21 is an explanatory diagram of a system shift buffer.

【図22】クラセン間隔テーブルの説明図FIG. 22 is an explanatory diagram of a classen interval table.

【図23】気筒・クランク位置状態マップの説明図FIG. 23 is an explanatory diagram of a cylinder / crank position state map.

【図24】点火シーケンスと点火区間変数の説明図FIG. 24 is an explanatory diagram of an ignition sequence and ignition interval variables.

【図25】点火スケジュールの説明図FIG. 25 is an explanatory diagram of an ignition schedule.

【図26】スケジュールポインタテーブルの説明図FIG. 26 is an explanatory diagram of a schedule pointer table.

【図27】点火タイマセットの説明図FIG. 27 is an explanatory diagram of an ignition timer set.

【図28】通電状態マップの説明図FIG. 28 is an explanatory diagram of an energization state map

【図29】通電気筒情報と点火気筒情報との関係を示す
説明図
FIG. 29 is an explanatory diagram showing a relationship between energized cylinder information and ignited cylinder information.

【図30】クランク位置とエンジンの行程を示すタイム
チャート
FIG. 30 is a time chart showing the crank position and the stroke of the engine.

【図31】エンジン系の概略構成図FIG. 31 is a schematic configuration diagram of an engine system.

【図32】クランクロータとクランク角センサの正面図FIG. 32 is a front view of a crank rotor and a crank angle sensor.

【図33】カムロータとカム角センサの正面図FIG. 33 is a front view of a cam rotor and a cam angle sensor.

【図34】電子制御系の回路構成図FIG. 34 is a circuit configuration diagram of an electronic control system.

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

1 エンジン 50 ECU 26a 点火コイル TDW_ON ドエルオン待ち時間 TDW_OF ドエルオフ待ち時間 RCASDWL ドエルの観点から見た気筒情報 RCASIG 点火の観点から見た気筒情報 TDWL 実ドエル時間(通電継続時間) 1 Engine 50 ECU 26a Ignition coil TDW_ON Dwell-on wait time TDW_OF Dwell-off wait time RCASDWL Cylinder information from dwell point of view RCASIG Cylinder information from dwell point of view TDWL Actual dwell time (energization duration time)

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 エンジンのクランク位置を検出する信号
の入力毎に区間を設定し、この区間を基準として点火コ
イルの通電・遮断を行ない、点火制御を実行する際に、 点火終了時に、上記点火コイルの通電終了と通電開始と
が同一区間内となるか否かを判別し、 通電終了と通電開始が同一区間内でないと判別した場
合、通電を開始する区間となってから通電開始までの時
間のデータと、通電継続時間のデータとを点火タイマに
セットする第1の通電シーケンスを設定し、 通電終了と通電開始とが同一区間内となると判別した場
合、点火終了から所定のオフ時間をもって通電を開始さ
せるデータを上記点火タイマにセットした後、点火を実
行する区間となってから通電終了までの時間のデータを
上記点火タイマにセットする第2の通電シーケンスを設
定することを特徴とするエンジンの点火制御における通
電シーケンスの設定方法。
1. A section is set for each input of a signal for detecting the crank position of the engine, and the ignition coil is energized / interrupted with reference to this section, and when the ignition control is executed, the ignition is terminated at the end of ignition. If it is determined whether the coil energization end and energization start are in the same section, and if it is determined that energization end and energization start are not in the same section, the time from the start of energization to the start of energization When the first energization sequence that sets the data of the current and energization duration time to the ignition timer is set and it is determined that the end of energization and the start of energization are in the same section, energization is performed with a predetermined off time from the end of ignition. After setting the data for starting the ignition to the ignition timer, the second energization sequence for setting the data of the time from the start of the ignition to the end of the energization to the ignition timer. A method for setting an energization sequence in ignition control of an engine, characterized by setting the stroke.
【請求項2】 上記点火コイルの通電終了と通電開始と
が同一区間内となるか否かを、通電開始区間となってか
ら次の通電開始区間となるまで点火対象気筒を一定の値
で示すデータと、このデータと同一気筒に対して同じ値
を取り、通電終了区間となってから次の通電終了区間と
なるまで点火対象気筒を一定の値で示すデータとが異な
るか否かにより判別することを特徴とする請求項1記載
のエンジンの点火制御における通電シーケンスの設定方
法。
2. The cylinder to be ignited is indicated by a constant value from the start of the energization section to the start of the next energization whether or not the end of energization and the start of energization of the ignition coil are in the same section. It is determined whether or not the data and the data having the same value for the same cylinder as the data are different from the data indicating the ignition target cylinder by a constant value from the energization end section to the next energization end section. The method for setting an energization sequence in engine ignition control according to claim 1, characterized in that.
JP6071793A 1993-03-19 1993-03-19 Current-carrying sequence setting method in ignition control for engine Pending JPH06272651A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6071793A JPH06272651A (en) 1993-03-19 1993-03-19 Current-carrying sequence setting method in ignition control for engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6071793A JPH06272651A (en) 1993-03-19 1993-03-19 Current-carrying sequence setting method in ignition control for engine

Publications (1)

Publication Number Publication Date
JPH06272651A true JPH06272651A (en) 1994-09-27

Family

ID=13150326

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6071793A Pending JPH06272651A (en) 1993-03-19 1993-03-19 Current-carrying sequence setting method in ignition control for engine

Country Status (1)

Country Link
JP (1) JPH06272651A (en)

Similar Documents

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