JPS6239260B2 - - Google Patents
Info
- Publication number
- JPS6239260B2 JPS6239260B2 JP4090179A JP4090179A JPS6239260B2 JP S6239260 B2 JPS6239260 B2 JP S6239260B2 JP 4090179 A JP4090179 A JP 4090179A JP 4090179 A JP4090179 A JP 4090179A JP S6239260 B2 JPS6239260 B2 JP S6239260B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- program
- engine
- level
- flag
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired
Links
- 238000000034 method Methods 0.000 claims description 45
- 230000008569 process Effects 0.000 claims description 33
- 230000004913 activation Effects 0.000 claims description 18
- 230000006870 function Effects 0.000 claims description 14
- 238000004364 calculation method Methods 0.000 claims description 13
- 239000000446 fuel Substances 0.000 description 39
- 238000012545 processing Methods 0.000 description 27
- 239000007858 starting material Substances 0.000 description 23
- 238000010586 diagram Methods 0.000 description 21
- 101100434411 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) ADH1 gene Proteins 0.000 description 9
- 101150102866 adc1 gene Proteins 0.000 description 9
- 239000000498 cooling water Substances 0.000 description 7
- 101150042711 adc2 gene Proteins 0.000 description 6
- 241000234435 Lilium Species 0.000 description 5
- 101100438536 Nicotiana plumbaginifolia CABC gene Proteins 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 102100032501 Death-inducer obliterator 1 Human genes 0.000 description 3
- 101000869896 Homo sapiens Death-inducer obliterator 1 Proteins 0.000 description 3
- 101001053773 Homo sapiens Type I iodothyronine deiodinase Proteins 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000012937 correction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 239000000839 emulsion Substances 0.000 description 3
- 230000005764 inhibitory process Effects 0.000 description 3
- 239000000454 talc Substances 0.000 description 3
- 229910052623 talc Inorganic materials 0.000 description 3
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 3
- ITHCSGCUQDMYAI-ZMIZWQJLSA-N 2-carboxy-D-arabinitol 1,5-bisphosphate Chemical compound OP(=O)(O)OC[C@@H](O)[C@@H](O)[C@](O)(COP(O)(O)=O)C(O)=O ITHCSGCUQDMYAI-ZMIZWQJLSA-N 0.000 description 2
- 101100425794 Arabidopsis thaliana TOM2B gene Proteins 0.000 description 2
- 101100101155 Arabidopsis thaliana TTM1 gene Proteins 0.000 description 2
- 102100021486 Protein S100-G Human genes 0.000 description 2
- 101710122252 Protein S100-G Proteins 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000009191 jumping Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 101100208128 Arabidopsis thaliana TSA1 gene Proteins 0.000 description 1
- 102100023882 Endoribonuclease ZC3H12A Human genes 0.000 description 1
- 101710112715 Endoribonuclease ZC3H12A Proteins 0.000 description 1
- 101100201844 Homo sapiens RSPH1 gene Proteins 0.000 description 1
- 102100035089 Radial spoke head 1 homolog Human genes 0.000 description 1
- 101150104676 TSA2 gene Proteins 0.000 description 1
- 208000000260 Warts Diseases 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 239000002828 fuel tank Substances 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 238000012432 intermediate storage Methods 0.000 description 1
- 230000000873 masking effect Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- QGVYYLZOAMMKAH-UHFFFAOYSA-N pegnivacogin Chemical compound COCCOC(=O)NCCCCC(NC(=O)OCCOC)C(=O)NCCCCCCOP(=O)(O)O QGVYYLZOAMMKAH-UHFFFAOYSA-N 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 201000010153 skin papilloma Diseases 0.000 description 1
- 238000010792 warming Methods 0.000 description 1
Landscapes
- Combined Controls Of Internal Combustion Engines (AREA)
- Control By Computers (AREA)
- Control Of Velocity Or Acceleration (AREA)
- Electrical Control Of Ignition Timing (AREA)
- Electrical Control Of Air Or Fuel Supplied To Internal-Combustion Engine (AREA)
Description
本発明はエンジンの電子式制御方法に関する。
プログラムを所定時間ごとに実行しデイジタル
計算機によりエンジンの制御量を演算する方法は
例えば特開昭53−40105号公報などに開示されて
いる。
エンジンの制御内容が複雑になりプログラムを
エンジンの制御機能毎にタスクに分解し、複数の
設計者が該タスクを別々に作りさらに必要に応じ
て調整し、これらのタスクを組合せることにより
制御システムを完成させることが必要になつてき
た。また制御内容が車のモデルチエンジや制御仕
様の変更に応じて変更され、これにともない制御
システムを構成するタスクが種々異なる場合も頻
繁に起こる。このような場合タスクの追加や削除
が他のタスクの実行結果に影響を与えないことが
必要となる。
従来のシステムにおいてはタスク実行の制御が
全て割込み発生に従つて行われたため、タスクの
追加や削除は割込み発生回路であるハードウエア
の変更が必要であつた。またタスクの実行が終了
する度に割込みを発生させて他のタスクを実行す
ることになるので、割込み発生条件が変更され、
他のタスクの実行条件が変更されたりした。
このためタスクの追加や削除が簡単に行えなか
つたり、あるいは労力を必要としたりする問題が
あつた。
本発明の目的はタスクの追加や削除の変更が容
易に行える電子式エンジン制御方法を提供するこ
とである。
本発明の第1の方法は、エンジンを制御するの
に必要な情報をセンサにより検出する第1のステ
ツプと、上記検出された情報に基づいてメモリに
保持されたプログラムの実行によりデイジタル計
算機でエンジンを制御するための値を演算する第
2のステツプと、上記デイジタル計算機の演算結
果によりエンジンを制御する第3ステツプを有す
る制御方法において、上記プログラムは、エンジ
ンの制御機能毎に分類され且つ上記制御機能がエ
ンジンに及ぼす影響に基づいて決められた起動周
期で実行されるタスクを有し、該各タスクの起動
周期が単位時間毎に発生するINTV割込みの割込
み発生回数により表示され、上記INTV割込み要
求により上記タスクはそのタスクレベルにかかわ
らず実行を中断しINTV割込みを発生する第4ス
テツプと、上記INTV割込みの発生により上記各
タスクの起動周期に達したかどうかを検知し起動
周期に達したタスクには起動要求を示すQフラグ
を表示する第5ステツプと、上記INTV割込み発
生により中断されたタスクのレベルと上記Qフラ
グが表示されたタスクのレベルのうち高い方のレ
ベルのタスクを実行する第6ステツプを有するこ
とである。
本発明の第2の方法は、エンジンを制御するの
に必要な情報をセンサにより検出する第1のステ
ツプと、上記検出された情報に基づいてメモリに
保持されたプログラムの実行によりデイジタル計
算機でエンジンを制御するための値を演算する第
2のステツプと、上記デイジタル計算機の演算結
果によりエンジンを制御する第3ステツプを有す
る制御方法において、上記プログラムは、エンジ
ンの制御機能毎に分類され且つ上記制御機能がエ
ンジンに及ぼす影響に基づいて決められた起動周
期で実行されるタスクを有し、該各タスクの起動
周期が単位時間毎に発生するINTV割込みの割込
み発生回数により表示され、上記INTV割込み要
求により上記タスクはそのタスクレベルにかかわ
らず実行を中断しINTV割込みを発生する第4ス
テツプと、上記INTV割込みの発生により上記各
タスクの起動周期に達したかどうかを検知し起動
周期に達したタスクには起動要求を示すQフラグ
を表示する第5ステツプと、上記INTV割込み発
生により中断されたタスクのレベルと上記Qフラ
グが表示されたタスクのレベルのうち高い方のレ
ベルのタスクを実行する第6ステツプと、上記タ
スクの実行を終了した場合には起動要求を示すQ
フラグの有無を調べ、Qフラグの表示されたタス
クの内最もレベルの高いタスクを実行し、以下こ
れを繰り返すことである。
まず燃料系の制御につき、その燃料供給の一例
を第1図に示す。
第1図はエンジンのスロツトル・チヤンバの断
面図である。まずこのスロツトルチヤンバ周辺に
設けられた各ソレノイドの動作により、このスロ
ツトル・チエンバへ供給される燃料量およびバイ
パス空気量の制御を説明する。
アクセル・ペダル(図示せず)によつて低速系
のスロツトル・バルブ12の開口が制御され、こ
れによりエア・クリーナ(図示せず)からエンジ
ンの各シリンダへの供給空気量が制御される。こ
の低速スロツトル・バルブの開口が大きくなり、
低速側ベンチユリの通過空気量が増大すると、こ
の低速側ベンチユリの負圧によりダイアフラム
(図示せず)を用いて高速側スロツトル14を開
口する。これにより吸入空気量増加に供なう空気
低抗の増大を軽減する。
このようにしてスロツトル・バルブで制御され
てエンジンへ供給される空気流量は、負圧センサ
(図示せず)によりアナログ量として取り込まれ
る。このアナログ量およびその他の後で述べるセ
ンサよりの信号に基づき、第1図の各ソレノイ
ド・バルブ16,18,20,22の開度が制御
される。
次に燃料供給量の制御について説明する。燃料
タンクから導びかれた燃料は導管24よりメイ
ン・ジエツト26を介して導管28へ導びかれ
る。さらに導管24の燃料はまたメイン・ソレノ
イド・バルブ18を介して導管28へ導びかれ
る。従つて導管28への導入燃料はメイン・ソレ
ノイド・バルブ18の開口が大きくなればなるほ
ど多くなり、これらの燃料はさらにメイン・エマ
ルジヨン・チユーブ30で空気と混合され、メイ
ン・ノズル32よりベンチユリ34に供給され
る。高速スロツトル14の開口時にはさらにノズ
ル36からもベンチユリ38に燃料は吸出され
る。一方メイン・ソレノイド・バルブ18と同時
にスロー・ソレノイド・バルブ16も制御され、
このスロー・ソレノイドバルブ16が開口すると
エアー・クリーナを介した空気は開口40より、
導管42へ供給される。一方導管28よりの燃料
はスロー・エマルジヨン・チユーブ44を介して
導管42へ供給される。従つて導管42の燃料量
はスロー・ソレノイドバルブ16よりの空気量が
増大するほど少くなる。この導管42の燃料と空
気の混合はスロー・ホール46よりスロツトルチ
ヤンバへ供給される。
フユーエル・ソレノイド・バルブ20は燃料の
増量の為のバルブで、始動増量や暖機増量等の為
に用いられる。導管42と連通する穴48より導
入された燃料はフユーエル・ソレノイドバルブ2
0の開口量に応じ、スロツトル・チヤンバへ通ず
る導管50へ導びかれる。
エアーソレノイドバルブ22はエンジンへ供給
する空気量を制御するバルブで、エアー・クリー
ナよりの空気が開口52よりエアー・ソレノイ
ド・バルブ22へ供給され、その開口に応じてス
ロツトル・チヤンバへ通じている導管54へ導び
かれる。
第1図のスロー・ソレノイド・バルブ16とメ
イン・ソレノイド・バルブ18によつて空燃比を
制御し、フユーエル・ソレノイドバルブ20によ
つて燃料の増量を行なう。さらにスロー・ソレノ
イドバルブ16とメイン・ソレノイドバルブ18
およびエアー・ソレノイドバルブ22とによりア
イドル時のエンジン・スピードを制御する。
第2図点火装置であり、増幅器62を介してパ
ワー・トランジスタ64へパルス電流が供給さ
れ、この電流によりトランジスタ64はONす
る。これによりバツテリ66より点火コイル68
へ一次コイル電流が流れる。このパルス電流の立
ち下がりでトランジスタ64は遮断状態となり、
点火コイル68の2次コイルに高電圧を発生す
る。
この高電圧は配電器70を介してエンジンの各
シリンダにある点火プラグ72のそれぞれにエン
ジン回転に同期して高電圧を配電する。
第3図は排気ガス環流(以下EGRと記す)シ
ステムを説明するためのもので、負圧源82の一
定負圧が定圧弁84を介して制御弁86へ加えて
いる。定圧弁84はトランジスタ90に加えられ
る繰返しパルスのONデユーテイ比率に応じ、負
圧源の一定負圧を大気88へ開放に対する比率を
制御し、制御弁86への負圧の印加状態を制御す
る。従つて制御弁86へ加えられる負圧はトラン
ジスタ90のONデユーテイ比率で定まる。この
定圧弁84の制御負圧により排気管92から吸気
管82へのEGR量が制御される。
第4図は制御システムの全体構成図である。
CPU102とリード・オンリ・メモリ104
(以下ROHと記す。)とランダ4・アクセス・メ
モリ106(以下RAMと記す。)と入出力回路1
08とから構成されている。上記CPU102は
ROM104内に記憶された各種のプログラムに
より、入出力回路108からの入力データを演算
し、その演算結果を再び入出力回路108へ戻
す。これらの演算に必要な中間的な記憶はRAM
106を使用する。CPU102、ROM104、
RAM106、入出力回路108間の各種データ
のやり取りはデータ・バスとコントロール・バス
とアドレス・バスとからなるバスライン110に
よつて行なわれる。
入出力回路108には第1のアナログ・デイジ
タル・コンバータ122(以下ADC1と記す)と
第2のアナログ・デイジタル・コンバータ124
(以下ADC2と記す)と角度信号処理回路126
と1ビツト情報を入出力する為のデイスクリート
入出力回路128(以下DIOと記す)との入力手
段を待つ。
ADC1にはバツテリ電圧検出センサ132(以
下VBSと記す)と冷却水温センサ134(以下
TWSと記す)と大気温センサ136(以下TAS
と記す)と調整電圧発生器138(以下VRSと
記す)とスロツトル角センサ140(以下θ
THSと記す)とλセンサ142(以下λSと記
す)との出力がマルチ・プレクサ162(以下
MPXと記す)に加えられ、MPX162によりこ
の内の1つを選択してアナログ・デイジタル・変
換回路164(以下ADCと記す)へ入力する。
ADC164の出力であるデイジタル値はレジス
タ166(以下REGと記す)に保持される。
また負圧センサ144(以下VCSと記す)は
ADC2・124へ入力され、アナログ・デイジタ
ル・変換回路172(以下ADCと記す)を介し
てデイジタル変換されレジスタ124(以下
REGと記す)へセツトされる。
角度センサ146(以下ANGSと記す)からは
基準クランク角例えば180度クランク角を示す信
号(以下REFと記す)を微少角例えば1度クラ
ンク角を示す信号(以下POSと記す)とが出力さ
れ、角度信号処理回路126へ加えられ、ここで
波形整形される。
DIO128にはアイドル・スイツチ148(以
下IDLE−SWと記す)とトツプ・ギヤ・スイツ
チ150(以下TOP−SWと記す)とスタータ・
スイツチ152(以下START−SWと記す)と
が入力されている。
次にCPU102の演算結果に基づくパルス出
力回路および制御対象について説明する。空燃比
制御装置162(以下CABCと記す)はこの実施
例ではパルス・デユーテイを変えてスロー・ソレ
ノイド16とメイン・ソレノイド18を制御する
ものである。CABC162のオン・デユーテイを
増大したことにより、メイン・ソレノイド18は
燃料供給を減少させる方向にあるので、インバー
タ163を介して加えられる。一方スロー・ソレ
ノイド16はCABCのオン・デユーテイが増大す
るにつれて燃料供給量は増大する。CABC162
には繰返しパルス周期をセツトするレジスタ16
6(以下CABPと記す)とオン・デユーテイをセ
ツトするレジスタ164(以下CABDと記す)と
が設けられており、CPU102よりこれらのデ
ータがそれぞれセツトされる。
点火パルス発生回路166(以下IGNCと記
す)は点火時期データをセツトするレジスタ16
6(以下ADVと記す)と点火コイル1次電流通
電時間を制御するレジスタ168(以下DWLと
記す)とを有し、これらのデータはCPU102
よりセツトされる。このIGNC164の出力パル
スは点火装置170へ印加される。この点火装置
170の詳細は第2図に示す通りであり出力パル
スは第2図の増幅器62へ加えられる。
燃料増量パルス発生回路172(以下FSCと
記す)はパルスのオン・デユーテイを制御して第
1図のフユーエル・ソレノイド20を制御するも
ので、繰返し周期をセツトするレジスタ176
(以下FSCPと記す)とオン時間をセツトするた
めのレジスタ176(以下FSCDと記す)とを有
している。
EGR量制御パルス発生回路180(以下EGRC
と記す)にはパルス繰返し周期のデータをセツト
するためのレジスタ182(以下EGRPと記す)
とオン時間のデータをセツトするためのレジスタ
180(以下EGRDと記す)とが設けられてお
り、繰返しパルスがANDゲート184を介して
エアー・ソレノイドバルブ22へ加えられる。こ
のANDゲート184にはDIO128の出力DIO1
の信号が加えられ、このDIO1信号がLレベルの
時ANDゲート184は閉じ、エアー・ソレノイ
ドバルブ22が制御される。
一方DIO1がHレベルの時はANDゲート186
を閉じ、EGR装置188を制御する。EGR装置
188の基本構成を第3図に示す。
DIO128は上述の如く、1ビツト信号の入出
力回路で、入力あるいは出力を決定するためのデ
ータを保持するレジスタ(以下DDRと記す)1
92と出力するデータを保持するためのレジスタ
194(以下DOUTと記す)と入力されたデー
タを保持するレジスタ196(以下DINと記す)
とを有している。このDIO128よりフユーエ
ル・ポンプ190を制御するための信号DIO0が
出力される。
第5図は第4図の制御回路のプログラムシステ
ムである。キー・スイツチ(図示せず)により電
源がONするとCPU102はスタート・モードと
なり、イニシヤライズ・プログラム
(INITIALIZ)204を実行する。次に監視プロ
グラム(MONIT)206を実行し、バツク・グ
ラウンド・ジヨブ(BACK GROUND JOB)2
08を実行する。このバツク・グラウンド・ジヨ
ブとして例えばEGR量の計算タスク(以下EGR
CAL.TASKと記す)やフユーエル・ソレノイド
バルブとエア・ソレノイドバルブの計算タスク
(以下EISCと記す)を実行する。このTASKの実
行中、割込要因(以下IRQと記す)が発生すると
IRQの開示ステツプ222より、IRQ要因分析プ
ログラム224(以下IRQ ANALと記す)を実
行する。このIRQ ANALのプログラムはさらに
ADC1の終了割込処理(以下ADC1END IRQと記
す)プログラム226とADC2の終了割込処理
(以下ADC2END IRQと記す)プログラム228
と一定期間経過割込処理(以下INTV IRQと記
す)プログラムとエンジン停止割込処理(以下
ENST IRQと記す)プログラムからなり、後述
する各タスクの起動の必要なタスクにそれぞれ起
動要求(以下QUEUEと記す)を出す。
このIRQ ANALプログラム224内の各プロ
グラムADC1 END IRQ226やADC2 END
IRQ228やINTV IRQ230の各プログラムに
よりQUEUEが出される各タスクはレベル・ゼ
ロ・タスク群252やレベル1タスク群254や
レベル2タスク群256やレベル3タスク群25
6であるか、あるいは該各タスク群は構成するタ
スクである。またENST IRQプログラム232
によりQUEUEが発生するタスクはエンジン停止
時の処理タスク262(以下ENST TASKと記
す)である。このENST TASK262が実行さ
れると再び制御システムはスタート・モードとな
り、開始点202へ戻る。
タスク・スケジユーラ242はQUEUEの発生
しているタスク群かあるいは実行中断タスク群の
内レベルの高いタスク群(ここではレベル・ゼロ
を最高とする)から実行するように、タスク群の
実行序順を決定する。タスク群の実行が終了する
と終了報告プログラム258(以下EXITと記
す)により終了報告される。この終了報告によ
り、実行待ちになつているタスク群の内の最もレ
ベルの高いタスク群を次に実行する。
実行中断タスク群やQUEUEの発生しているタ
スク群がなくなるとタスク・スケジユーラ242
より再びバツク・グラウンド・ジヨブ208の実
行へ移る。さらにレベル・ゼロ・タスク群からレ
ベル3タスク群のどれかを実行中にIRQが発生す
るとIRQ処理プログラムの開始点222へ戻る。
第1表に各タスクの起動とその機能を示す。
The present invention relates to a method for electronically controlling an engine. A method of calculating engine control amounts using a digital computer by executing a program at predetermined time intervals is disclosed in, for example, Japanese Patent Laid-Open No. 53-40105. As the engine control content becomes more complex, the program is broken down into tasks for each engine control function, multiple designers create the tasks separately, and make adjustments as necessary, and these tasks are combined to create a control system. It has become necessary to complete the Furthermore, control contents are changed in response to vehicle model changes or changes in control specifications, and as a result, the tasks that make up the control system often vary. In such a case, it is necessary that adding or deleting a task does not affect the execution results of other tasks. In conventional systems, all control of task execution was performed in accordance with the occurrence of interrupts, so addition or deletion of tasks required changes to the hardware that was the interrupt generation circuit. Also, each time a task finishes executing, an interrupt is generated and another task is executed, so the interrupt generation conditions are changed.
The execution conditions of other tasks have changed. For this reason, there was a problem that adding or deleting tasks could not be done easily or required a lot of effort. SUMMARY OF THE INVENTION An object of the present invention is to provide an electronic engine control method that allows tasks to be easily added or deleted. A first method of the present invention includes a first step of detecting information necessary to control the engine using a sensor, and a digital computer controlling the engine by executing a program stored in a memory based on the detected information. In the control method, the program has a second step of calculating a value for controlling the engine, and a third step of controlling the engine based on the calculation result of the digital computer. It has tasks that are executed at a startup cycle determined based on the effect that the function has on the engine, and the startup cycle of each task is indicated by the number of times the INTV interrupt occurs per unit time, and the INTV interrupt request mentioned above is The fourth step is to suspend the execution of the above task regardless of its task level and generate an INTV interrupt, and the fourth step is to detect whether or not the activation period of each task has been reached due to the occurrence of the INTV interrupt, and the task that has reached its activation period. The fifth step is to display the Q flag indicating a startup request, and the fifth step is to execute the task at the higher level of the level of the task that was interrupted due to the occurrence of the INTV interrupt and the level of the task for which the Q flag is displayed. It has 6 steps. A second method of the present invention includes a first step of detecting information necessary to control the engine using a sensor, and a digital computer controlling the engine by executing a program stored in a memory based on the detected information. In the control method, the program has a second step of calculating a value for controlling the engine, and a third step of controlling the engine based on the calculation result of the digital computer. It has tasks that are executed at a startup cycle determined based on the effect that the function has on the engine, and the startup cycle of each task is indicated by the number of times the INTV interrupt occurs per unit time, and the INTV interrupt request mentioned above is The fourth step is to suspend the execution of the above task regardless of its task level and generate an INTV interrupt, and the fourth step is to detect whether or not the activation period of each task has been reached due to the occurrence of the INTV interrupt, and the task that has reached its activation period. The fifth step is to display the Q flag indicating a startup request, and the fifth step is to execute the task at the higher level of the level of the task that was interrupted due to the occurrence of the INTV interrupt and the level of the task for which the Q flag is displayed. 6 steps and a Q that indicates a startup request when the execution of the above task is finished.
The presence or absence of the flag is checked, the task with the highest level among the tasks for which the Q flag is displayed is executed, and this process is repeated thereafter. First, regarding fuel system control, an example of fuel supply is shown in FIG. FIG. 1 is a cross-sectional view of the throttle chamber of the engine. First, the control of the amount of fuel and bypass air supplied to the throttle chamber by the operation of each solenoid provided around the throttle chamber will be explained. An accelerator pedal (not shown) controls the opening of a low-speed throttle valve 12, thereby controlling the amount of air supplied from an air cleaner (not shown) to each cylinder of the engine. The opening of this low-speed throttle valve becomes larger,
When the amount of air passing through the low-speed bench lily increases, the high-speed throttle 14 is opened using a diaphragm (not shown) due to negative pressure in the low-speed bench lily. This reduces the increase in air resistance due to an increase in the amount of intake air. The air flow rate thus controlled by the throttle valve and supplied to the engine is captured as an analog quantity by a negative pressure sensor (not shown). Based on this analog quantity and other signals from sensors to be described later, the opening degree of each solenoid valve 16, 18, 20, 22 shown in FIG. 1 is controlled. Next, control of the fuel supply amount will be explained. Fuel from the fuel tank is conducted from conduit 24 through main jet 26 to conduit 28. Additionally, fuel in conduit 24 is also directed to conduit 28 via main solenoid valve 18. Therefore, the larger the opening of the main solenoid valve 18, the more fuel will be introduced into the conduit 28, and these fuels will be further mixed with air in the main emulsion tube 30 and will be sent to the vent lily 34 through the main nozzle 32. Supplied. When the high-speed throttle 14 is opened, fuel is further sucked out from the nozzle 36 to the bench lily 38. Meanwhile, the slow solenoid valve 16 is also controlled at the same time as the main solenoid valve 18.
When the slow solenoid valve 16 opens, air passes through the air cleaner through the opening 40.
is supplied to conduit 42. Fuel from conduit 28, on the other hand, is supplied to conduit 42 via slow emulsion tube 44. Therefore, the amount of fuel in conduit 42 decreases as the amount of air from slow solenoid valve 16 increases. This mixture of fuel and air in conduit 42 is supplied to the throttle chamber through a slow hole 46. The fuel solenoid valve 20 is a valve for increasing the amount of fuel, and is used for increasing the starting amount, increasing the amount for warming up, etc. The fuel introduced through the hole 48 communicating with the conduit 42 is supplied to the fuel solenoid valve 2.
Depending on the opening amount of 0, it is directed to a conduit 50 leading to the throttle chamber. The air solenoid valve 22 is a valve that controls the amount of air supplied to the engine, and air from the air cleaner is supplied to the air solenoid valve 22 through an opening 52, and a conduit leading to the throttle chamber according to the opening. You will be led to 54. The slow solenoid valve 16 and main solenoid valve 18 shown in FIG. 1 control the air-fuel ratio, and the fuel solenoid valve 20 increases the amount of fuel. Furthermore, the slow solenoid valve 16 and the main solenoid valve 18
and air solenoid valve 22 to control engine speed at idle. In the ignition device shown in FIG. 2, a pulse current is supplied to a power transistor 64 via an amplifier 62, and the transistor 64 is turned on by this current. As a result, the ignition coil 68 from the battery 66
Primary coil current flows to. At the fall of this pulse current, the transistor 64 is cut off,
A high voltage is generated in the secondary coil of the ignition coil 68. This high voltage is distributed via a power distributor 70 to each spark plug 72 in each cylinder of the engine in synchronization with engine rotation. FIG. 3 is for explaining an exhaust gas recirculation (hereinafter referred to as EGR) system, in which constant negative pressure from a negative pressure source 82 is applied to a control valve 86 via a constant pressure valve 84. The constant pressure valve 84 controls the ratio of the constant negative pressure of the negative pressure source to the atmosphere 88 according to the ON duty ratio of the repeated pulses applied to the transistor 90, and controls the state of application of negative pressure to the control valve 86. Therefore, the negative pressure applied to the control valve 86 is determined by the ON duty ratio of the transistor 90. The amount of EGR flowing from the exhaust pipe 92 to the intake pipe 82 is controlled by the controlled negative pressure of the constant pressure valve 84. FIG. 4 is an overall configuration diagram of the control system.
CPU 102 and read-only memory 104
(hereinafter referred to as ROH), the lander 4 access memory 106 (hereinafter referred to as RAM), and the input/output circuit 1
It consists of 08. The above CPU102 is
Using various programs stored in the ROM 104, input data from the input/output circuit 108 is operated, and the operation results are returned to the input/output circuit 108 again. The intermediate storage required for these operations is RAM.
106 is used. CPU102, ROM104,
Various types of data are exchanged between the RAM 106 and the input/output circuit 108 via a bus line 110 consisting of a data bus, a control bus, and an address bus. The input/output circuit 108 includes a first analog-digital converter 122 (hereinafter referred to as ADC1) and a second analog-digital converter 124.
(hereinafter referred to as ADC2) and angle signal processing circuit 126
It waits for input means to the discrete input/output circuit 128 (hereinafter referred to as DIO) for inputting and outputting 1-bit information. ADC1 includes a battery voltage detection sensor 132 (hereinafter referred to as VBS) and a cooling water temperature sensor 134 (hereinafter referred to as VBS).
(hereinafter referred to as TWS) and atmospheric temperature sensor 136 (hereinafter referred to as TAS)
), the adjustment voltage generator 138 (hereinafter referred to as VRS), and the throttle angle sensor 140 (hereinafter referred to as θ
The outputs of the λ sensor 142 (hereinafter referred to as λS) and the multiplexer 162 (hereinafter referred to as λS)
MPX 162 selects one of them and inputs it to an analog-to-digital conversion circuit 164 (hereinafter referred to as ADC).
The digital value that is the output of the ADC 164 is held in a register 166 (hereinafter referred to as REG). In addition, the negative pressure sensor 144 (hereinafter referred to as VCS)
It is input to the ADC2.124, converted to digital via the analog-to-digital conversion circuit 172 (hereinafter referred to as ADC), and converted into a register 124 (hereinafter referred to as ADC).
REG). The angle sensor 146 (hereinafter referred to as ANGS) outputs a signal indicating a reference crank angle, for example, 180 degrees crank angle (hereinafter referred to as REF), and a signal indicating a minute angle, for example, 1 degree crank angle (hereinafter referred to as POS). The signal is applied to the angle signal processing circuit 126, where the waveform is shaped. The DIO 128 includes an idle switch 148 (hereinafter referred to as IDLE-SW), a top gear switch 150 (hereinafter referred to as TOP-SW), and a starter switch.
A switch 152 (hereinafter referred to as START-SW) is input. Next, a pulse output circuit and a controlled object based on the calculation results of the CPU 102 will be explained. In this embodiment, an air-fuel ratio control device 162 (hereinafter referred to as CABC) controls the slow solenoid 16 and the main solenoid 18 by changing the pulse duty. By increasing the on-duty of CABC 162, main solenoid 18 tends to reduce its fuel supply, which is applied via inverter 163. On the other hand, the amount of fuel supplied to the slow solenoid 16 increases as the on-duty of CABC increases. CABC162
is a register 16 for setting the repeat pulse period.
6 (hereinafter referred to as CABP) and a register 164 (hereinafter referred to as CABD) for setting on-duty, and these data are set by the CPU 102, respectively. The ignition pulse generation circuit 166 (hereinafter referred to as IGNC) is a register 16 that sets ignition timing data.
6 (hereinafter referred to as ADV) and a register 168 (hereinafter referred to as DWL) that controls the ignition coil primary current energization time, and these data are stored in the CPU 102.
It is set from This output pulse of IGNC 164 is applied to ignition device 170. The details of the igniter 170 are shown in FIG. 2, and the output pulses are applied to the amplifier 62 of FIG. The fuel increase pulse generating circuit 172 (hereinafter referred to as FSC) controls the on-duty of the pulse to control the fuel solenoid 20 shown in FIG. 1, and the register 176 sets the repetition period.
(hereinafter referred to as FSCP) and a register 176 (hereinafter referred to as FSCD) for setting on-time. EGR amount control pulse generation circuit 180 (hereinafter referred to as EGRC)
) is a register 182 (hereinafter referred to as EGRP) for setting pulse repetition period data.
and a register 180 (hereinafter referred to as EGRD) for setting on-time data, and a repetitive pulse is applied to the air solenoid valve 22 via an AND gate 184. This AND gate 184 has the output DIO1 of DIO128.
When the DIO1 signal is at L level, the AND gate 184 is closed and the air solenoid valve 22 is controlled. On the other hand, when DIO1 is at H level, AND gate 186
closes and controls the EGR device 188. The basic configuration of the EGR device 188 is shown in FIG. As mentioned above, DIO 128 is a 1-bit signal input/output circuit, and is a register (hereinafter referred to as DDR) 1 that holds data for determining input or output.
92, a register 194 for holding output data (hereinafter referred to as DOUT), and a register 196 for holding input data (hereinafter referred to as DIN).
It has This DIO 128 outputs a signal DIO0 for controlling the fuel pump 190. FIG. 5 shows a program system for the control circuit shown in FIG. When the power is turned on by a key switch (not shown), the CPU 102 enters a start mode and executes an initialization program (INITIALIZ) 204. Next, execute the monitoring program (MONIT) 206 and execute the BACK GROUND JOB 2.
Execute 08. This background job includes, for example, the EGR amount calculation task (hereinafter referred to as EGR
CAL.TASK) and fuel solenoid valve and air solenoid valve calculation tasks (hereinafter referred to as EISC). During the execution of this TASK, if an interrupt factor (hereinafter referred to as IRQ) occurs,
From the IRQ disclosure step 222, an IRQ factor analysis program 224 (hereinafter referred to as IRQ ANAL) is executed. This IRQ ANAL program is further
ADC1 end interrupt processing (hereinafter referred to as ADC1END IRQ) program 226 and ADC2 end interrupt processing (hereinafter referred to as ADC2END IRQ) program 228
, a certain period elapsed interrupt processing (hereinafter referred to as INTV IRQ) program, and an engine stop interrupt processing (hereinafter referred to as INTV IRQ) program.
It consists of a program (hereinafter referred to as ENST IRQ) and issues a startup request (hereinafter referred to as QUEUE) to each task that needs to be started, which will be described later. Each program in this IRQ ANAL program 224 ADC1 END IRQ226 and ADC2 END
Each task to which a QUEUE is issued by each program of IRQ228 and INTV IRQ230 is a level zero task group 252, a level 1 task group 254, a level 2 task group 256, and a level 3 task group 25.
6, or each task group is a constituent task. Also ENST IRQ Program 232
The task in which QUEUE occurs is the engine stop processing task 262 (hereinafter referred to as ENST TASK). When this ENST TASK 262 is executed, the control system enters the start mode again and returns to the starting point 202. The task scheduler 242 sets the execution order of the tasks so that they are executed starting with the task in which the QUEUE is occurring or the task with the highest level among the tasks whose execution has been interrupted (here, level zero is the highest). decide. When the execution of the task group is completed, the completion report program 258 (hereinafter referred to as EXIT) reports the completion. Based on this completion report, the task group with the highest level among the task groups waiting for execution is executed next. When there are no more suspended tasks or QUEUE tasks, the task scheduler 242
The process then moves on to executing the background job 208 again. Furthermore, if an IRQ occurs while any of the level 0 task group to level 3 task group is being executed, the process returns to the starting point 222 of the IRQ processing program. Table 1 shows the activation of each task and its functions.
【表】【table】
【表】
この第1表において、第5図の制御システムを
管理するためのプログラムとして、IRQ ANAL
プログラムやTASK SCHDULERやEXITがあ
る。これらのプログラム(以下OSと記す)は第
6図の如くROM104のアドレスA000から
アドレスA300に保持されている。
さらにレベル・ゼロ・プログラムとして
AD1IN、AD1ST、AD2IN、AD2ST、RPMINの
各プログラムがあり、通常INTV IRQの10〔m
SEC〕で起動される。レベル1プログラムとし
てCARBC、IGNCAL、DWLCALプログラムがあ
り、INTV IRQの20〔mSEC〕ごとに起動され
る。レベル2プログラムのLAMBDAプログラム
があり、INTV IRQの40〔mSEC〕ごとに起動さ
れる。レベル3プログラムとしてHOSEIプログ
ラムがあり、INTV IRQの100〔mSEC〕ごとに
記動される。またバツク・グラウンド・ジヨブと
してEGRCALとFISCプログラムがある。上記レ
ベル・ゼロ・プログラムはPROG1としてそれぞ
れ第6図のROM104のアドレスA700から
AB00に記憶されている。レベル・1プログラ
ムはPROG2としてROM104のアドレスAB0
0からAE00に記憶されている。レベル2プロ
グラムはPROG3としてTROM104のアドレス
AF00からB000に記憶されている。レベル
3プログラムはPROG4としてROM104のア
ドレスB000からB100に記憶されている。
またバツク・グラウンド・ジヨブ・プログラムは
B100からB200に保持されている。なお上
記プログラムPROG1からPROG4までの各プロ
グラムのスタード・アドレスのリスト(以下
SFTMRと記す)がB200からB300までに
保持され、PROG1からPROG4までの各プログ
ラム起動周期を表わす値(以下TTMと記す)が
アドレスB300からB400に記憶されてい
る。
その他のデータは必要に応じB400からB5
00に記憶される。それに続いて演算のためのデ
ータADV・MAPやAF・MAP、EGR・MAPをそ
れぞれ記憶している。
第5図におけるINITIALIZ204プログラムの
詳細を第7図を用いて説明する。ステツプ282で
IRQ発生時の退避エリアを設定する。次にステツ
プ284でRAM106を全てクリアする。ステツプ
286で入出力回路108のレジスタ内に初期値の
設定を行なう。この初期値設定として例えば、エ
ンジンのシリンダ数や角度センサ146の初期値
やDIO128のDDRの設定やINTV IRQ発生のた
めのタイマの設定やENST IRQ発生のための検
出期間の設定やエンジン回転数検出のための計測
時間の設定がある。
ステツプ288でADC1に起動をかけ、さらに
ADC1ENDIRQの為の禁止解除を行なう。この場
合AD1STプログラムのスタート・アドレスであ
る第6図のアドレスA701へジヤンプする。こ
れにより第4図のADC1・122のMPXの入力の
1つであるバツテリ電圧検出センサVBS132の
出力がセレクトされてADC164へ入力され
る。ステツプ290へ戻つてここでADC1END IRQ
を待つ。ADC164の動作が完了し、REG16
6へデイジタル値がセツトされるとステータス・
レジスタSTAUS198へADC164の動作完了
が報告され、ADC1END IRQがCPU102へ入
力される。これによりプログラムAD1INが実行
され、センサ132の出力が取り込まれる。
ステツプ292でセンサ132から142の値を
全て取り込んだかを確認する。この場合センサ1
32の入力の取込みが完了されただけなので、ス
テツプ288へ戻る。このステツプ288で再び
AD1STプログラムが起動され、MPX162は次
の入力であるセンサ134の出力をセレクトす
る。ステツプセンサ134の出力のアナログ・デ
イジタル変換が完了すると再び、ステツプ292で
プログラムAD1INが実行され、レジスタREG1
66内に保持されている水温センサTWS134
の出力のデイジタル値が取り込まれたROM10
4のDATAエリアに保持される。ステツプ292で
再びステツプ288へ戻される。このようにステツ
プ288からステツプ292のループを回ることにより
センサ132から142の出力のデイジタル値が
次々に取り込まれ、λセンサであるλS142の
出力値の取り込みが完了すると、ステツプ294へ
進む。
ステツプ294で始動時の点火時期の演算と設定
を行なう。この点火時期θADV(ST)はエンジ
ンの冷却水温TWの関数として演算する。この関
数を第9図に示す。第9図の特性に従つてθ
ADV(ST)を演算し、この演算された結果は第
4図IGNC164のレジスタADV166にセツト
される。
ステツプ296で始動時のエアー・ソレノイドバ
ルブ22の演算を行う。この演算は第10図に示
す特性に基づいて行なわれ、その演算出力はレジ
スタEGRD180にセツトされる。尚EGRP18
2についても固定値がセツトされる。第10図の
特性はEGRP182のセツト値に対するEGRD1
80のセツト値の比である。
ステツプ298で燃料ソレノイド・オン・デユー
テイの初期値が演算される。この演算値は第11
図により行なわれるものであり、レジスタCABP
166の設定値に対するレジスタCABD164の
設定値の比率が第11図の特性図として示されて
いる。レジスタCABD164とCABP166のデ
ータのセツトにより、第5図のプログラム
INITIALIZ204の実行を終了し、第8図に示す
MONITプログラム206へ移る。
MONITプログラム206はステツプ302より開
始され、ステツプ302で第4図のスタータ・スイ
ツチ152がON状態かどうかDIO128のDIN
レジスタ196を監視することにより行なわれ
る。もしスタータ・スイツチ152がON状態で
あるとDINレジスタ196の第6ビツトが“H”
となつている。また逆にOFFしていると“L”
となつている。今エンジンの始動前であるとする
とスタータ・スイツチはOFFであり、ステツプ
302からステツプ312へ進み、ここで始動後かどう
かを判断する。この判断は例えばスタータ・フラ
グが立つているかどうかを判断する。このスター
タ・フラグはステツプ308で立てられるものであ
る。始動前はスタータ・フラグが立つていないの
で、ステツプ312でNOとなり、再びステツプ302
へ戻る。スタータ・スイツチ152がONされる
までステツプ302のNOからステツプ312のNOを通
つてステツプ302へ戻るルートを回る。このルー
トトを回りながら、スタータ・スイツチの監視を
行なう。
スタータ・スイツチがONするとステツプ302で
判断がYESとなり、ステツプ304へ進む。ここ
で、既にスタータ・スイツチがONしていたかど
うかを判断する。初めてステツプ304へ進んだ場
合はスタータ・スイツチのONを検出した直後で
あり、ステツプ304で判断がNOとなる。ステツプ
304の判断もスタータ・フラツグが立つているか
どうかで判断される。スタータ・フラツグの立つ
ていない時は判断をNOとしてステツプ306へ進
み、始動の為の準備がされる。例えば本実施例で
は、フユーエル・ポンプ190の起動のために
DIO128のDOUTレジスタ194の第ゼロ・ビ
ツトに“H”をセツトする。これに、よりフユー
エル・ポンプの電源が入る。次にステツプ306
で、DOUTレジスタ194の第1ビツトを
“L”とする。これによりEGRC回路178の出
力でエアー・ソレノイド22が制御される。実際
にはDOUTレジスタ194の第ゼロビツトと第
1ビツトのセツトは同時に行なわれる。
ステツプ308でINTV IRQの禁止解除がなさ
れ、点火出力禁止の解除がなされる。このINTV
IRQの禁止解除は例えば第4図のMASKレジスタ
200の第4ビツトを“H”にすることにより行
なう。さらにステツプ308でスタータ・フラグを
立てる。このスタータ・フラグは既にスタータ・
スイツチがONであることを示していて、ステツ
プ304とステツプ312でこのフラグを判断に用い
る。
ステツプ310で入出力回路108の出力系であ
るCABC162とIGNC164とFSC172と
EGRC178とに起動をかけるため、後で説明す
るモード・レジスタに“H”をセツトする。これ
により各制御装置ヘパルス出力が送られる。ステ
ツプ310からステツプ302へ戻り、ステツプ302で
スタータ・スイツチ152がONかどうか判断さ
れる。始動中はスタータ・スイツチがONであ
り、YESからステツプ304へ進む。このステツプ
304で、スタータ・フラグをチエツクし、フラグ
が立つていれば既にスタート中であるとしてステ
ツプ302へ戻る。
このようにスタータ・モータが駆動されている
間は、ステツプ302のYESと304のYESと作られ
るループを回つている。
エンジンが始動されるとスタータ・スイツチ1
52がOFFとなるので、ステツプ302の判断は
NOとなり、ステツプ312へ進む。ステツプ312で
スタータ・フラグがチエツクされ、スタータ・フ
ラグが立つているのでステツプ314へ進む。この
ステツプ314で、ENST IRQの禁止解除がなさ
れ、このステツプ316以降エンジンの停止はこの
ENST IRQで検出できる。
次にプログラム208へ進む、このプログラム
を第12図に詳細する。
第12図において、ステツプ410でアイドル・
スイツチ148がONかどうかが判断される。も
しONであれば排気ガス環流は行なわれない。
従つてステツプ412へ進み、ここでエアー・ソ
レノイドバルブ22をDIOのレジスタDOUT19
4の第1ビツト“L”にすることにより指定され
る。このため、レジスタEGRD180にセツトさ
れた値に応じて第1図のエアー・ソレノイドバル
ブ22が制御される。ステツプ414で冷却水温に
応じてエアーソレノイドバルブ22のデユーテイ
がレジスタEGRD180に設定される。さらに水
温TWに応じたフユーエル・ソレノイドバルブか
らの燃料供給量がレジスタFSCD172にセツト
される。これらの値に応じてフユーエル・ソレノ
イドバルブ20とエアー・ソレノイドバルブ22
が制御され、アイドル時のエンジンが制御され
る。このステツプ416の終了により再び410へ進
み、このフローを繰り返す。
一方アイドル・スイツチ148がオンでない状
態ではエアー・ソレノイドバルブ22は使用され
ず、代りに排気ガス環流が行なわれる。このため
EGR量を制御するEGR装置が駆動されるこの装
置を駆動するためにステツプ418でDIOのDOUT
レジスタ194の第4ビツトが“H”とされ、レ
ジスタEGRD180にセツトされた値でEGR装置
188が駆動される。次にステツプ420でレジス
タFSCD172にゼロがセツトされ、フユーエ
ル・ソレノイド15の駆動を停止する。ステツプ
422で冷却水温が一定値例えばTA℃より高いか
どうかを判断し、もし高ければEGRを掛けない
ようにする。このためステツプ426でEGRCUTを
行うための値を設定する。またステツプ422で冷
却水温が一定値(TA℃)であればステツプ424
へ進む。ステツプ424で冷却水温がTB度Cより低
いかどうかを判断する。もし低い場合、やはり
EGRを掛けないのでステツプ426でEGR CUTを
行う値を設定する。これらの値はステツプ430で
EGRDレジスタにセツトされる。
一方冷却水温TWがTB度より高くTA度より低
い場合EGRを行う。このときのEGR量は負圧セ
ンサ144の出力VCとエンジン回転速度Nで定
まる。出力VCとNとによるEGR量のマツプは第
6図のROMのアドレスB701〜B800に設
けられており、このマツプから検索してEGR量
を定める。ステツプ428で検索を行い。この値を
ステツプ430でレジスタEGRD180へセツトす
る。このレジスタEGRD180のセツト値に応じ
て第4図に示したEGR装置188は駆動され
る。
第12図に示したフローチヤートでは、ステツ
プ430あるいはステツプ416の終了により、再びス
テツプ410へ戻る。このようにすることにより計
算機はエアー・ソレノイド22を制御するための
ステツプ410からステツプ416までのフローチヤー
トかあるいはステツプ418からステツプ430までの
ステツプのフローチヤートを常に実行できる。従
つてIRQなどの発生が生じないものとすれば、点
202よりスタートしたプログラムはINITIALIZ
プログラム204、MONITプログラム206を
通つてバツクグラウンド・ジヨブ208である
FISCプログラムあるいはEGRCALプログラムを
常に実行し続けることになる。
MONITプログラム206やバツクグラウン
ド・ジヨブ208は割込み要求(IRQ)を発生さ
せてその処理を中断できるようになつており、
IRQによる処理が終了すると再び上記プログラム
の実行を再開する。
次に第5図におけるIRQの発生に基づく処理の
説明を行なう。IRQの要因分析のプログラム22
4はADC1END IRQ226の処理とADC2END
IRQ228の処理とINTV IRQ230の処理と
ENST IRQ232の処理とからなつている。こ
こで各プログラム226,228,230,23
2のそれぞれを実行するためには先ず、IRQの要
求内容は何かを調べる。このため第4図のSTA
TUSレジスタ198の内容が調べられる。この
STATUSレジスタの内容を見ることにより、
IRQの発生要因が判明する。この発生要因に応じ
て上記各プログラム226,228,230,2
32を実行し、これによりTASK252,25
4,256,258,262の内の実行が必要な
TASKに起動要求(QUEUE)を出す。
但し、IRQの発生を多くすると管理プログラム
(以下OSと記す)の実行時間が多くなり実質的な
エンジン制御の為の演算時間がとれなくなる欠点
がある。従つてこの実施例では、ADC2END
IRQ228はINITI ALIZあるいはMONITプログ
ラム204と206の実行中のみ発生させ、その
他は発生させない。つまりMONITプログラム2
06の第8図で示したステツプ314で第4図の
MASKレジスタ200にADC2END IRQの禁止
命令をセツトする。またADC1END IRQ226
は最初から発生させない、つまりスタート点であ
る202で全ての割込みが禁止されるように入出
力回路のゼネラル・リセツト信号でIRQ発生禁止
状態になるようにMASKレジスタをセツトす
る。その後IRQ禁止解除の命令を出さないように
することによりADC1END IRQを禁止状態とす
る。
プログラム224の具体例を第13図に示す。
IRQの入口222よりステツプ502へ行く。ここ
でIRQの発生要求がADC2END IRQかどうかを
判断し、そうであればステツプ516でタスク・レ
ベル・ゼロのプログラムに起動要求を出す。これ
は第15図に示したRAM106内のタスク・コ
ントロール・ワードTCW0のb6に“1”のフラ
グを立てる。そしてTASK SCHDULER242
へ進む。ADC2END IRQが発生するのはこの実
施例では第5図のINITIALIZプログラム204の
実行中のみである。それ以外の状態では
ADC2END IRQは禁止される。ステツプ502の判
断が“NO”の場合ステツプ504へ進む。
ステツプ504でIRQの要因が一定周期で発生す
るINTV IRQかどうかを判断する。
“YES”の場合、ステツプ506へ進む。ステツ
プ506からステツプ514はタスク・レベル・ゼロか
らタスク・レベル3までのプログラムの起動タイ
ミングかどうかの判断をする機能を持つ。先ずタ
スク・レベル・ゼロを調べる。タスク・レベル・
ゼロのタスク・コントロール・ワードすなわち第
15図のTCW0のb0〜b5までのカウンタ0
をプラス1だけインクリメントする。ステツプ
508でTCW0のカウンタ0の値と第15図のタス
ク起動タイマTTM0と比較する。ここでTTM0
には“1”が入つている。ここでINTV IRQは10
〔mSEC〕毎に発生するものとしているので、
TTM0に“1”が入つていることはタスク・レ
ベル・ゼロ・プログラム(第5図の252)は10
〔mSEC〕毎に起動されることを表わしている。
第15図のカウンタCNTR0とTTM0をステツ
プ508で比較し、一致する場合“YES”へ進む。
この場合は一致するのでステツプ510へ進み、タ
スク・コントロール・ロードTCW0のb6にフ
ラグ“1”を立てる。この実施例では各TCWの
b6はそのタスクの起動要求のフラグとなる。ス
テツプ510でTCW0のb6にフラグ“1”を立て
たのでこのTCW0のb0〜b5に設けられたカ
ウンタCNTR0をクリアする。
ステツプ512でタスク・レベル・ゼロからタス
ク・レベル1の起動タイミング検索に移る。ステ
ツプ514でタルク・レベル3の終了かを判断す
る。つまりn=4かを判断する。この場合n=1
であるので、ステツプ506へ戻る。ステツプ506で
タルク・レベル1のプログラムのタスク・コント
ロール・ワードである第15図のRAM106内
のTCW1のカウンタCNTR1の内容を+1イン
クリメントする。ステツプ508で、第15図の
ROM104のTTM1と比較する。この実施例で
はTTM1の内容は“2”である。つまりタス
ク・レベル1の起動タイミングは20〔mSEC〕
である。今カウンタCNTR1の内容が“1”であ
ると仮定すると508の判断は“NO”つまりタス
ク・レベル1プログラム254は起動タイミング
ではないことが判断され、ステツプ512へ進む。
ここで再び検索されるタスク・レベルが更進さ
れ、次はタスク・レベル2となる。同様にしてタ
スク・レベル3まで終了すると、ステツプ512で
n=4となり、ステツプ514でn=nMAXの条件
が満足される。そしてタスク・スチジユータ24
2へ進む。
ステツプ504でINTV IRQでなければステツプ
518へ進む。ここでエンジン停止を示すENST
IRQかどうかを判断する。ステツプ504で“NO”
の場合かならずENST IRQのはずであり、ステ
ツプ518を省略してステツプ520へ進んでもよい。
ステツプ520はエンジン停止に基づく特別のプロ
グラムで燃料ポンプを停止し、さらに点火系燃料
の全ての出力系の信号をリセツト状態にし、第5
図のスタート点202へ戻る。
第14図はタスク・スチジユーラ242の詳細
フローチヤートであり、ステツプ530でタスク・
レベルnの実行が必要かを判断する。最初はn=
0であり、タスク・レベル・ゼロのプログラムの
実行の必要について判断する。これはタスク・コ
ントロール・ワードTCWのb6とb7を検索す
ることにより判断できる。b6は起動要求フラグ
でここに“1”が立つていると起動要求が“有
り”であることがわかる。またb7には実行中を
示すフラグであり、ここに“1”が立つていると
実行中であり今中断されていることになる。従つ
てb6とb7の少くともどちらかに“1”があれ
ば実行要となりステツプ538へ進む。
ステツプ538でb7のフラグを判断し、b7が
“1”であれば実行中断中であり点540よりそ
の中断していた実行を再開する。b6とb7の再
方にフラグが立つていてもやはりステツプ538の
判断は“YES”となり、中断中のところのプロ
グラムから再開する。b6のみが“1”の場合、
そのレベルの起動要求フラグつまりb6をステツ
プ542でクリアして、ステツプ544でb7のフラグ
(以下RUNフラグと記す)をセツトする。ステツ
プ542と544はそのタスク・レベルの起動要求状態
から実行状態に進んだことを示す。ステツプ546
でそのタスク・レベル・プログラムのスタート・
アドレスを検索する。これは第15図に示した
ROM104の内に各タスク・レベルのTCWに対
応させて設けられたスタートアドレステーブル
TSAより求められ、このスタートアドレスへジ
ヤンプすることによりそのタスクの実行が行なわ
れる。
第14図へ戻つてステツプ530で“NO”と判断
された場合、この場合は検索のタスク・レベルの
プログラムには起動要求がでていなくしかも、実
行中断でもないことを示している。この場合次の
タスク・レベルの検索にうつる。つまりタスク・
レベルのnがn+1となつてレベルが1つ移動す
る。ここでnがMAXつまりここでは4であるか
を見、4でなければ再びステツプ530へ進む。こ
れを繰り返し、n=4となると点536よりバツ
ク・グラウンド・ジヨブの中断点へ戻る。つまり
点536ではタルク・レベル・ゼロ〜3までの全
てのプログラムに実行の必要がないことが判明し
たことになり、IRQの発生前のバツク・グラン
ド・ジヨブの中断点へ戻る。
第15図は上で述べたタスク・コントロール・
ワードTCWとROM内のタスク・起動周期を表わ
すTTMタスク・スタート・アドレス・テーブル
の関係を示したものである。タスク・コントロー
ル・ワートTCWの0〜3に対応してROM内にタ
スク起動周期TTMがあり、INTV IRQごとに
TCWのカウンタCNTRが各々更新され、各タス
クのTTMと一致したことにより、そのTCWのb6
にフラグが立つ。このフラグにより次にROM内
のタスク・スタート・アドレスTSAよりそのタ
スクのスタート・アドレスが検索され、そのスタ
ート・アドレスへジヤンプすることによりプログ
ラム1〜4の選ばれたプログラムが実行される。
この実行中はRAM106内のそのプログラムに
対応したTCWのb7にフラグが立つ。このフラ
グが立つている間は実行中であることが判断でき
る。このようにして第5図のタスク・スケジユー
ル242のプログラムが実行される。そして例え
ばレベル0〜3までのプログラム252〜258
のいずれかが実行される。この実行中にIRQが発
生すれば再びそのタスクを中断してIRQの処理に
なる。今IRQが発生しないとすると実行中のタス
クの処理はやがて終了する。これにより終了報告
を行うため、EXITプログラム260へ進む。
このEXITプログラムの詳細を第16図に示
す。このプログラムは、紙了タスクを見つけるた
めのステツプ562と564からなる。このステツプ
562と564で先ずタスク・レベルのゼロより検索
し、終了したタスク・レベルを見つける。これに
よりステツプ568へ進み、ここで終了したタスク
のタスク・コントロール・ワードのb7のRUN
フラグをリセツトする。これによりそのプログラ
ムの実行が完全に終つたことになる。そして再び
タスク・スケジユーラへ戻り、次の実行プログラ
ムが決定される。
プログラムの実行と中断を第17図で再び説明
する。今、最も優先度の低いバツク・グラウン
ド・ジヨブ208を実行していたとする。時間t
1でINTV IRQが発生すると管理プログラム(以
下OSプログラムと記す)へ実行が移る。そして
ここで第5図のプログラム224,242の実行
により、例えばレベル・ゼロ・プログラム252
が実行要求されたことがわかる。そして時間t2
でTCW0のb7に“1”が立てられ、さらにb
6がクリアされ、このレベル・ゼロ・プログラム
252が実行される。またこの時、同時にレベル
1のプログラムも起動要求が出たとすとTCW1
のb6にもフラグ“1”が立つている。しかし先
ず、優先度の高いレベル・ゼロ・プログラムを実
行する。時間t3でこのレベル・ゼロ・プログラ
ムの実行を終了すると再びOSプログラムへ戻
り、TCW0のb7のフラグをクリアして次のレ
ベルであるレベル1の実行要求の検知と実行の準
備がされ、t4より実行が始まる。ここでレベル
1の処理に時間がかかると再び次のINTV IRQが
発生し、t5でレベル1のプログラムを中断し
て、OSプログラムへ戻る。そしてOSプログラム
を実行し、このINTV IRQで起動すべきプログラ
ム、例えばプログラム252に起動要求を出す。
そして優先度の最も高いプログラム252を時間
t6より実行する。つまりTCW0のb7にフラ
グ“1”を立てさらにb6のフラグをクリアし
て、TSA0よりプログラム252のスタート・
アドレスを検索し、プログラム252を実行す
る。時間t7でプログラム252の実行を終了
し、OSプログラムへ戻り、EXITプログラムで、
TCW0のb7をクリアする。さらにOSプログラ
ムのタスク・スケジユーラ・プログラム242で
起動要求または中断プログラムを検索する。この
プログラム242により。プログラム254の中
断を検知し、実行を再開する。この再開は時間t
5でCPU102の内容が待避されていたのを時
間t8で再びCPUへ戻すことにより行なわれ
る。プログラム254を再開し、時間t9でその
実行を終了すると、OSプログラムへ戻り、EXIT
プログラムを実行することによりプログラム25
4の終了報告がされる。つまりTCW1のb7の
フラグがクリアされる。
その後、タスク・スケジユーラ・プログラム2
42の実行により、起動要求の出ているプログラ
ムや実行中断のプログラムがないかどうかを検索
し、例えばプログラム256のTCW2のb6に
フラグ“1”が立つているのを発見する。これに
よりプログラム256のスタード・アドレスであ
るTSA2を検索し、プログラム256のスター
ト・アドレスへジヤンプしてプログラム256を
実行する。このとき前にも述べた如く、TCW2
のb6フラグをクリアし、b7のフラグを立て
る。さらに時間t11でプログラム256の実行
が終了するとOSプログラムへ戻り、EXITプログ
ラムによりTCWb7のフラグをクリアして終了報
告する。さらに再び起動要求と実行中断の検索を
行なう。この検索により起動要求や実行中断のプ
ログラムがないとすると、バツク・グラウンド・
ジヨブ208の待避エリアよりCPUへ各データ
を戻し、実行再開を行なう。そしてt13で
INTV IRQが入るとCPUの内容を再び待避させ
て、OSプログラムへ戻り、IRQの要因分折を行
なつて再びプログラムに起動要求をかける。
この説明より解かるように各プログラムの実行
中に割込みが発生するとそのプログラムを中断
し、OSプログラムへ戻り、最も高いレベルのプ
ログラムより実行する。このようにすることによ
り、より重要なプログラムに優先的に処理時間を
割りあてられる。
さらに各プログラムを優先度に応じて各レベル
に分け、各レベルに含まれるそれぞれの処理プロ
グラムを連絡的につらねて実行させ、それぞれの
レベルのプログラムに対し、その総ての処理の終
了で終了報告させているので、OSプログラムの
占める割合が少くてすみ、処理効率が向上する。
さらにこのようにすることにより、同一レベル内
プログラムに対し、相互に割込みが発生すること
がないので、割込みのための待避エリアを各レベ
ルプログラムに対応して設けることで実行可能と
なるので待避エリアが大幅に減少する。
第5図および第17図の説明を各レベルのプロ
グラム252,254,256,258の立場よ
り見た時の実行状態を第18図とに示す。IDLE
状態に起動待ちの状態であり、プログラムにまだ
起動要求が立されていない。次に起動要求が出さ
れるとTCWのb6にフラグが立ち、起動が必要
ということが表示される。IDLE状態から
QUEUE状態へ移動する時間は各プログラムのレ
ベルにより定まつている。さらにQUEUE状態に
なつても実行され順序は優先度により定まる。そ
のプログラムが実行状態に入るのはOSプログラ
ムでTCWのb6のフラグがクリアされ、b7に
フラグが立つてからである。これによりプログラ
ムの実行が始められる。この状態がRUN状態で
ある。そして実行が終るとTCWのb7フラグが
クリアされ、終了報告を完了する。これにより
RUN状態は終り、再びIDLE状態となり次の起動
要求が出るのを待つ。しかし、プログラムの実行
中すなわちRUN中にIRQが発生するとそのプロ
グラムは実行を中断しなければならない。このた
めCPUの内容が待避され、実行が中断する。こ
の状態がREADY状態である。次にこのプログラ
ムが再び実行される状態になると待避エリアよ
り、待避していた内容を再びCPUへ戻し、実行
が再開される。つまりREADY状態から再びRUN
状態へ戻る。このように各レベルプログラムは第
18図の4つの状態を繰り返す。第18図は代表
的な流れであるがREADY状態でTCWのb6に
フラグが立つ可能性がある。これは例えば起動中
断中にそのプログラムの次の起動要求タイミング
になつてしまつた場合である。このときはb7フ
ラグが優先されて先ず、中断中の仕事を終了させ
る。これによりb7フラグが消え、b6フラグに
よりIDLE状態を通らずにQUEUE状態となる。
このように各レベル・プログラム252,25
4,256,258は各々第18図のどれかの状
態にある。また各レベルプログラムはREADY状
態になるのはその各レベルプログラム状態毎にな
る。つまり、例えばレベル1プログラムは第1に
示すCARBCプログラムやIGNCALプログラムや
DWLCALプログラムより構成されている。とこ
ろがレベル1プログラムに対してREADY状態が
存在するのであつて上記各CARB、IGNCAL、
DWLCALプログラムに対してREADY状態があ
るのではないので、各レベルプログラムに対応し
て待避エリアを持たせればよい。第20図の
RAM106のエリア602から608は各レベ
ルに対応して設けられている。
第19図はバツク・グランド・ジヨブの状態変
化を示す図であり、実行中にRUN状態であり、
IRQが発生するとCPUの内容を待避させて
READY状態となる。また割込み処理が終了する
と、待避していた内容をCPUに戻し、実行再開
つまりRUNとなる。IRQの発生でCPUの内容を
待避させる場合第20図で示した待避エリア61
0へ待避される。
第21図はレベル0プログラムである。このプ
ログラムは第1表に示す通り、10ミリ・セツク毎
に起動要求が出される。ステツプ650でADC1の
データの取込みを行ない、654でADC1の次のデ
ータを取り込むための起動をかける。また652の
ステツプは始動前にADCEND IRGを使用するた
めであり、始動前のフラグが立つている場合、始
動前であるためRTIつまり中断しているプログラ
ムへ戻る。このプログラムは第5図のINITIALIZ
プログラム204である。ステツプ656でAD2の
データを取り込み、さらにステツプ658でADC2
の次のデータ取り込みのための起動をかける。ス
テツプ660でエンジン速度を取り込む。これらの
ステツプを終了するとOSのEXITプログラムを実
行し、TCWb7のフラグをクリアーする。
第22図はレベル1プログラムであり、ステツ
プ672で始動中かどうかを判断する。始動中の場
合、始動中の燃料を供給しさらに点火時期を決定
するので、計算の必要がなく、ステツプ678へジ
ンプする。ステツプ674で燃料を計算するための
CARBCALプログラムを実行し、次にステツプ
676でIGNCALプログラムを実行する。これらは
それぞれテーブル検索で行なわれる。ステツプ
678でDWALCALプログラムを実行し、これによ
り通電時間を計算する。
レベル2のLAMBDAプログラムはλの補正プ
ログラムであり、レベル3のHOSEIプログラム
は各補正係数のプログラムである。補正係数とし
ては例えば大気温や、水温などの補正係数を求め
るプログラムであり、これらのパラメータは時定
数が大きいので、長いインターバルブ係数を計数
すれば良い。
また本発明は前述した如く、総ての演算制御が
エンジンの回転数に無関係に行なわれるように
INTV IRQを発生している。このようにIRQの発
生回路の構成を第23図に示す。図において、レ
ジスタ735はCPUからタイマ割込周期を設定
するデータ(例えば10mS)がデータバス752
を通じてセツトされ、同時にカウンタ736には
CLOCKが入力される。そしてこのカウント数と
上記レジスタにセツトされた内容は比較器737
でもつて比較され、レジスタ735の内容とカウ
ンタ736の内容が等しくなつた時、比較器73
7から出力が発せられ、フリツプフロツプ73
8、及び740をセツトする。これと同時に
AND回路747の出力でもつてカウンタ736
とフリツプフロツプ738はリセツトされる。一
方フリツプフロツプ739がセツトされていれ
ば、タイマ割込信号IRQはAND回路748、OR
回路751を介して出力される。ここで上記フリ
ツプフロツプ739は上記IRQを不要とする時
(例えばエンジン始動中)IRQをマスクするため
のフリツプフロツプである。そしてこの時は
CPUからフリツプフロツプ739に対してリセ
ツト指令が発せられる。また上記したタイマ割込
に対して、エンジンの回転が運転中に故障もしく
は操作上のミスで停止(いわゆるエンスト)した
時のエンスト割込は以下の構成で示されている。
この構成はタイマ割込の場合と同一であり、レジ
スタ741、カウンタ742、比較器743、
AND回路746,750、フリツプフロツプ7
45,746からなり動作も前述の場合と同一で
ある。但し、カウンタ742に入力される信号は
エンジンが回転している時に発せられる信号であ
つて、第4図に示す146センサより発生するクラ
ンクの基準角信号REFであり、例えば4気筒の
エンジンの時はクランクが180゜回転する毎に発
せられる信号である。そしてカウンタ742は上
記REF信号が入つている間リセツトがかかるた
め、エンスト割込信号は発せられず、エンジンが
停止するとREF信号が停止しリセツトが解除さ
れるためにエンスト割込信号が発せられる。
以上述べた様なタイマ割込IRQは前述した第5
図のフローチヤートに示されるようにタスクに起
動をかけ、タスクの優先処理が行われる。すなわ
ち、CPUが割込要求を受けるとその割込要引の
分析の判定を行なう。そしてそれがタイマ割込で
あるならば、優先度の高い順にレベル分けされた
タスク器252,254,256,258に起動
をかけタスクスケジユラー242によつて選択
し、タスクの実行がなされる。そしてタスク実行
が終了するとEXITで終了報告され、再び次のタ
イマ割込とタスクスケジユーラによつて次のタス
クが選択される。
一方割込がエンスト割込の場合は燃料ポンプを
OFFすると同時に点火系をリセツトし、入出力
制御回路を総てNO−GOとする。
ADC1END IRQとADC2END 1RQも同様であ
り、ADC1のシーケンス動作が終了するとフリツ
プフロツプ764へ“1”がセツトされる。さら
にCPUよりバス・ライン752を介してフリツ
プフロツプ762へ“1”がセツトされると
ANDゲート770の条件がとれ、ORゲートIRQ
を介してCPUへADC1ENDIRQのサービスを要求
する。しかしフリツプフロツプ762に“1”が
セツトされていない場合はADC1END IRQは禁
止される。ADC2についても同様で、ADC2のシ
ーケンスの終了でフリツプフロツプ768に
“1”がセツトされる。このときフリツプフロツ
プ766に“1”がセツトされていれば
ADC2ENDIRQはANDケート772とORゲート
751を介して発生するが、フリツプフロツプ7
66に“1”がセツトされていないと、ANDゲ
ート772の条件がとれないのでAD2ENDIRQは
発生しない。従つてフリツプフロツプ739,7
45,762,766に対し“1”をセツトした
もののみのIRQが発生し、“0”をセツトすると
IRQの発生を禁止する状態となる。
以上説明したごとく、本発明によれば次のよう
な効果がある。
(A) 本発明においてはプログラムをエンジンの制
御機能毎にタスクに分解し、複数の設計者が該
タスクを別々に作りさらに必要に応じて調整
し、これらのタスクを組合せることにより制御
システムを完成させることが可能と成る。従つ
てエンジンの制御内容が複雑となり高精度の制
御が要求されても迅速にこれに対応できる。
(B) エンジン制御においては制御内容が車のモデ
ルチエンジや制御仕様の変更に応じて変更さ
れ、これにともない制御システムを構成するタ
スクが種々異なる場合も頻繁に起こる。このよ
うな場合タスクの追加や削除が他のタスクの実
行結果に影響を与えないことが必要となる。ま
た、タスクの内容が変更になる場合も頻繁にお
こる。この場合も同様である。
本発明においてはINTV割込みに対応するタ
スクは一定時間毎に中断される。従来の方式の
ごとく、タスクの実行終了時、次の実行タスク
の検索のために割込みを発生させる必要がない
ので、INTV割込みによる中断が終わると次の
INTV割込みまでに中断される可能性はINTV
割込み以外の割込みによる場合のみとなり、非
常に少なくなる。従つて割込み発生条件が簡単
であり、タスクの内容を変更することによる退
避エリアの増減が少ない。このため退避エリア
の余裕を少なくできメモリを有効に活用でき
る。
(C) タスクの分割は制御機能毎に行われるが、こ
の制御機能を比較的細かくし、タスク数を多く
すると上記制御仕様の変更に木目細かく対応で
きるが、従来の方式ではタスク数が増えるた
め、割込み回数が増加し、実質的なエンジン制
御のための処理時間が短くなる問題がある。さ
らに中断タスクが増えるため、退避エリアを増
大させる必要がある。
一方本発明では1タスクの処理時間が短くな
り、INTV割込み間に処理できる可能性が増大
し、中断タスクの数が少なくなる。従つて退避
エリアが減少し、しかも処理時間はほとんど増
加しない。
また第5図の実施例によれば、各レベルプログ
ラム毎に起動周期を変えているので制御効率がさ
らに向上する。さらにまた同一レベルのプログラ
ムに対してはそのプログラムの終了毎にEXIT報
告させているので、同一レベル内で次のプログラ
ムへ進むのに何らOSプログラムの実行を要しな
い。従つて処理時間が速くなる。
またこれにより、同一レベル内のプロクラム相
互間での割込みが互にかからないので待避エリア
の設定を各タスクレベルに応じて行えばよいので
エリアが少くてすむ。
エンジンが始動した後、ADC1END割込や
ADC1END割込みにマスクを掛けているので、
OSプログラムの実行時間の短縮ができ処理効率
が向上する。
第15図に示す実施例によればTCWは各レベ
ルに対して設ければよく、第1表の各プログラム
に対して設ける必要がないのでTCWのエリアが
少くてすむ。
さらにTCWには起動要求を示すフラグb6と
実行中を示すフラグb7が設けてあるので、第1
7図と第18図に示すごとく、プログラムの実行
と中断さらに再開がスムーズにしかも優先度の高
いものよりでき、CPUの制御効率が向上する。[Table] In this Table 1, IRQ ANAL
There are programs, TASK SCHDULER, and EXIT. These programs (hereinafter referred to as OS) are held at addresses A000 to A300 of the ROM 104 as shown in FIG. Furthermore, as a level zero program
There are AD1IN, AD1ST, AD2IN, AD2ST, and RPMIN programs, and usually INTV IRQ 10 [m
SEC]. There are CARBC, IGNCAL, and DWLCAL programs as level 1 programs, which are activated every 20 [mSEC] of INTV IRQ. There is a level 2 program, the LAMBDA program, which is activated every 40 [mSEC] of INTV IRQ. There is a HOSEI program as a level 3 program, which is recorded every 100 [mSEC] of INTV IRQ. There are also EGRCAL and FISC programs as background jobs. The above level zero program starts from address A700 of ROM104 in Figure 6 as PROG1.
Stored in AB00. Level 1 program is PROG2 at address AB0 of ROM104.
It is stored from 0 to AE00. The level 2 program is the address of TROM104 as PROG3.
It is stored from AF00 to B000. The level 3 program is stored as PROG4 at addresses B000 to B100 of the ROM 104.
Also, background job programs are held from B100 to B200. The list of start addresses for each program from PROG1 to PROG4 above (see below)
SFTMR) is held from B200 to B300, and values representing each program activation cycle from PROG1 to PROG4 (hereinafter referred to as TTM) are stored at addresses B300 to B400. Other data is B400 to B5 as necessary.
00 is stored. Subsequently, data for calculations, ADV/MAP, AF/MAP, and EGR/MAP, are stored. Details of the INITIALIZ204 program in FIG. 5 will be explained using FIG. 7. At step 282
Set the evacuation area when an IRQ occurs. Next, in step 284, all RAM 106 is cleared. step
In step 286, initial values are set in the registers of the input/output circuit 108. This initial value setting includes, for example, the number of engine cylinders, the initial value of the angle sensor 146, the DDR setting of DIO 128, the timer setting for INTV IRQ generation, the detection period setting for ENST IRQ generation, and engine rotation speed detection. There is a measurement time setting for. Start up ADC1 in step 288, and
Release the prohibition for ADC1ENDIRQ. In this case, the program jumps to address A701 in FIG. 6, which is the start address of the AD1ST program. As a result, the output of the battery voltage detection sensor VBS132, which is one of the inputs of MPX of the ADC1/122 in FIG. 4, is selected and input to the ADC164. Return to step 290 and enter ADC1END IRQ here.
wait. The operation of ADC164 is completed and REG16
When the digital value is set to 6, the status
The completion of the operation of ADC 164 is reported to register STAUS 198, and ADC1END IRQ is input to CPU 102. As a result, the program AD1IN is executed and the output of the sensor 132 is taken in. At step 292, it is checked whether all values from sensors 132 to 142 have been taken in. In this case sensor 1
Since the acquisition of input No. 32 has only been completed, the process returns to step 288. Again in this step 288
The AD1ST program is started, and the MPX 162 selects the next input, the output of the sensor 134. When the analog-to-digital conversion of the output of the step sensor 134 is completed, the program AD1IN is executed again at step 292, and the register REG1 is
Water temperature sensor TWS134 held in 66
ROM10 into which the digital value of the output is taken
It is held in the DATA area of 4. At step 292, the process returns to step 288. In this way, by going through the loop from step 288 to step 292, the digital values of the outputs of the sensors 132 to 142 are successively captured, and when the capture of the output value of the λ sensor λS 142 is completed, the process proceeds to step 294. In step 294, the ignition timing at startup is calculated and set. This ignition timing θADV (ST) is calculated as a function of the engine cooling water temperature TW. This function is shown in FIG. According to the characteristics shown in Figure 9, θ
ADV(ST) is calculated, and the result of this calculation is set in the register ADV166 of the IGNC 164 in FIG. In step 296, the air solenoid valve 22 is calculated at the time of starting. This calculation is performed based on the characteristics shown in FIG. 10, and the calculation output is set in register EGRD180. Furthermore, EGRP18
A fixed value is also set for 2. The characteristics in Figure 10 are EGRD1 for the set value of EGRP182.
80 set values. In step 298, an initial value for the fuel solenoid on duty is calculated. This calculated value is the 11th
This is done according to the diagram, and the register CABP
The ratio of the setting value of register CABD 164 to the setting value of register CABD 166 is shown as a characteristic diagram in FIG. By setting the data in registers CABD164 and CABP166, the program shown in Figure 5 is executed.
The execution of INITIALIZ204 is finished and shown in Figure 8.
Moving on to the MONIT program 206. The MONIT program 206 starts at step 302, and at step 302 the DIN of DIO 128 is checked to see if the starter switch 152 of FIG. 4 is in the ON state.
This is done by monitoring register 196. If the starter switch 152 is in the ON state, the 6th bit of the DIN register 196 is “H”.
It is becoming. Conversely, if it is OFF, it will be “L”.
It is becoming. Assuming that the engine has not yet started, the starter switch is OFF and the step
Proceeding from step 302 to step 312, it is determined here whether or not it has started. This determination is made, for example, by determining whether a starter flag is set. This starter flag is set in step 308. Since the starter flag is not set before starting, the result in step 312 is NO, and the process returns to step 302.
Return to The route goes from step 302 NO to step 312 NO and back to step 302 until the starter switch 152 is turned on. While going around this route, monitor the starter switch. When the starter switch is turned on, the determination in step 302 becomes YES, and the process proceeds to step 304. At this point, determine whether the starter switch was already turned on. When proceeding to step 304 for the first time, it is immediately after detecting that the starter switch is ON, and the determination at step 304 is NO. step
304 is also determined based on whether the starter flag is set. If the starter flag is not set, the judgment is NO and the process proceeds to step 306, where preparations for starting are made. For example, in this embodiment, in order to start the fuel pump 190,
Set the zeroth bit of DOUT register 194 of DIO 128 to "H". This will turn on the fuel pump. Next step 306
Then, the first bit of the DOUT register 194 is set to "L". As a result, the air solenoid 22 is controlled by the output of the EGRC circuit 178. In reality, the zero and first bits of DOUT register 194 are set at the same time. In step 308, INTV IRQ is disabled, and ignition output is disabled. This INTV
The inhibition of IRQ is canceled, for example, by setting the fourth bit of the MASK register 200 in FIG. 4 to "H". Furthermore, in step 308, a starter flag is set. This starter flag is already
This flag indicates that the switch is ON, and this flag is used for determination in steps 304 and 312. In step 310, the output system of the input/output circuit 108, CABC 162, IGNC 164, and FSC 172, is connected.
In order to activate the EGRC 178, the mode register, which will be explained later, is set to "H". This sends a pulse output to each control device. The process returns from step 310 to step 302, where it is determined whether the starter switch 152 is ON. The starter switch is ON during startup, and the process advances to step 304 from YES. This step
At step 304, the starter flag is checked, and if the flag is set, it is assumed that the start is already in progress and the process returns to step 302. While the starter motor is being driven in this manner, a loop made of steps 302 YES and 304 YES continues. When the engine is started, starter switch 1
Since 52 is OFF, the judgment at step 302 is
If NO, proceed to step 312. The starter flag is checked in step 312, and since the starter flag is set, the process advances to step 314. In this step 314, the inhibition of ENST IRQ is canceled, and the engine will be stopped from this step 316 onward.
Can be detected with ENST IRQ. Next, proceed to program 208, which is detailed in FIG. In FIG. 12, at step 410 the idle
It is determined whether the switch 148 is ON. If ON, exhaust gas recirculation will not take place. Therefore, proceed to step 412, where the air solenoid valve 22 is connected to the register DOUT19 of DIO.
It is designated by setting the first bit of 4 to "L". Therefore, air solenoid valve 22 of FIG. 1 is controlled in accordance with the value set in register EGRD 180. In step 414, the duty of the air solenoid valve 22 is set in the register EGRD 180 according to the cooling water temperature. Further, the amount of fuel supplied from the fuel solenoid valve according to the water temperature TW is set in the register FSCD172. Depending on these values, the fuel solenoid valve 20 and the air solenoid valve 22 are
is controlled, and the engine at idle is controlled. Upon completion of this step 416, the process returns to 410 and repeats this flow. On the other hand, when the idle switch 148 is not on, the air solenoid valve 22 is not used, and exhaust gas recirculation is performed instead. For this reason
The EGR device that controls the amount of EGR is driven. In step 418, DIO's DOUT is driven to drive this device.
The fourth bit of register 194 is set to "H", and EGR device 188 is driven with the value set in register EGRD180. Next, in step 420, zero is set in register FSCD 172 to stop driving fuel solenoid 15. step
At 422, it is determined whether the cooling water temperature is higher than a certain value, for example, TA°C, and if it is higher, EGR is not applied. Therefore, in step 426, values for performing EGRCUT are set. In addition, if the cooling water temperature is a constant value (TA℃) in step 422, the process proceeds to step 424.
Proceed to. In step 424, it is determined whether the cooling water temperature is lower than TB degree C. If it is low, then
Since EGR is not applied, a value for EGR CUT is set in step 426. These values are set in step 430.
Set in EGRD register. On the other hand, if the cooling water temperature TW is higher than TB degree and lower than TA degree, EGR is performed. The EGR amount at this time is determined by the output VC of the negative pressure sensor 144 and the engine rotation speed N. A map of the EGR amount based on the outputs VC and N is provided at addresses B701 to B800 of the ROM in FIG. 6, and the EGR amount is determined by searching from this map. Search in step 428. This value is set in register EGRD 180 in step 430. The EGR device 188 shown in FIG. 4 is driven according to the set value of the register EGRD 180. In the flowchart shown in FIG. 12, upon completion of step 430 or step 416, the process returns to step 410 again. By doing so, the computer can always execute the flowchart for controlling the air solenoid 22 from step 410 to step 416 or from step 418 to step 430. Therefore, assuming that IRQ etc. do not occur, the program started from point 202 is INITIALIZ
Background job 208 through program 204 and MONIT program 206
The FISC program or EGRCAL program will always be running. The MONIT program 206 and background job 208 can interrupt their processing by generating an interrupt request (IRQ).
Once the processing by IRQ is completed, execution of the above program is resumed. Next, the processing based on the generation of IRQ in FIG. 5 will be explained. IRQ factor analysis program 22
4 is ADC1END IRQ226 processing and ADC2END
IRQ228 processing and INTV IRQ230 processing
It consists of ENST IRQ232 processing. Here each program 226, 228, 230, 23
In order to execute each of 2, first check what the IRQ request content is. Therefore, STA in Figure 4
The contents of TUS register 198 are examined. this
By looking at the contents of the STATUS register,
The cause of IRQ is revealed. Each of the above programs 226, 228, 230, 2 depending on the cause of this occurrence.
32, this results in TASK252,25
4,256,258,262 must be executed
Issue a startup request (QUEUE) to TASK. However, if the number of IRQs is increased, the execution time of the management program (hereinafter referred to as OS) increases, and there is a drawback that it becomes impossible to take the calculation time for actual engine control. Therefore, in this example, ADC2END
IRQ 228 is generated only during execution of INITI ALIZ or MONIT programs 204 and 206, and is not generated at other times. In other words, MONIT program 2
At step 314 shown in FIG. 8 of 06, the process shown in FIG.
Set the ADC2END IRQ prohibition instruction in the MASK register 200. Also ADC1END IRQ226
In other words, the MASK register is set so that the general reset signal of the input/output circuit disables IRQ generation so that all interrupts are prohibited at the starting point 202. After that, the ADC1END IRQ is disabled by not issuing a command to cancel the IRQ inhibition. A specific example of the program 224 is shown in FIG.
Go to step 502 from the IRQ entrance 222. Here, it is determined whether the IRQ generation request is an ADC2END IRQ, and if so, an activation request is issued to the task level zero program in step 516. This sets a flag of "1" in b6 of task control word TCW0 in RAM 106 shown in FIG. And TASK SCHDULER242
Proceed to. In this embodiment, the ADC2END IRQ is generated only during execution of the INITIALIZ program 204 in FIG. In other conditions
ADC2END IRQ is prohibited. If the determination at step 502 is "NO", the process advances to step 504. In step 504, it is determined whether the IRQ factor is an INTV IRQ that occurs at regular intervals. If “YES”, proceed to step 506. Steps 506 to 514 have the function of determining whether it is time to start programs from task level zero to task level 3. First, check task level zero. task level
Zero task control word, i.e. counter 0 from b0 to b5 of TCW0 in Figure 15.
Increment by +1. step
At 508, the value of counter 0 of TCW0 is compared with the task activation timer TTM0 of FIG. Here TTM0
contains “1”. Here INTV IRQ is 10
Since it is assumed that it occurs every [mSEC],
“1” in TTM0 means that the task level zero program (252 in Figure 5) is 10.
This indicates that it is activated every [mSEC].
The counters CNTR0 and TTM0 in FIG. 15 are compared in step 508, and if they match, the process goes to "YES".
In this case, since they match, the process advances to step 510 and sets flag "1" in b6 of task control load TCW0. In this embodiment, b6 of each TCW becomes a flag for requesting activation of that task. Since the flag "1" is set in b6 of TCW0 in step 510, the counter CNTR0 provided in b0 to b5 of TCW0 is cleared. In step 512, the process moves on to search for activation timing from task level zero to task level 1. In step 514, it is determined whether talc level 3 is finished. In other words, it is determined whether n=4. In this case n=1
Therefore, the process returns to step 506. At step 506, the contents of counter CNTR1 of TCW1 in RAM 106 in FIG. 15, which is the task control word of the talc level 1 program, is incremented by +1. In step 508, the
Compare with TTM1 of ROM104. In this embodiment, the content of TTM1 is "2". In other words, the startup timing of task level 1 is 20 [mSEC]
It is. Assuming that the content of the counter CNTR1 is "1", the determination at step 508 is "NO", that is, it is determined that it is not time to start the task level 1 program 254, and the process advances to step 512.
Here, the task level to be searched again is advanced, and the next task level becomes task level 2. Similarly, when task level 3 is completed, n=4 in step 512, and the condition n=nMAX is satisfied in step 514. and task studio 24
Proceed to 2. If it is not INTV IRQ at step 504, step
Proceed to 518. ENST indicating engine stop here
Determine whether it is an IRQ. “NO” in step 504
In this case, it must be ENST IRQ, and you may skip step 518 and proceed to step 520.
Step 520 stops the fuel pump with a special program based on the engine stop, and also resets the signals of all the output systems of the ignition system fuel.
Return to the starting point 202 in the diagram. FIG. 14 is a detailed flowchart of the task scheduler 242.
Determine whether level n execution is necessary. Initially n=
0, and determines whether it is necessary to execute a program at task level zero. This can be determined by searching b6 and b7 of the task control word TCW. b6 is a startup request flag, and when it is set to "1", it can be seen that the startup request is "present". Further, b7 is a flag indicating that the process is being executed, and if "1" is set here, it means that the process is currently being executed and is currently being interrupted. Therefore, if at least either b6 or b7 is "1", execution is required and the process proceeds to step 538. At step 538, the flag b7 is determined, and if b7 is "1", execution is being interrupted and the interrupted execution is resumed from point 540. Even if flags b6 and b7 are set, the determination at step 538 is still "YES" and the program is restarted from the interrupted program. If only b6 is “1”,
The startup request flag of that level, ie, b6, is cleared in step 542, and the flag b7 (hereinafter referred to as RUN flag) is set in step 544. Steps 542 and 544 indicate that the task level has progressed from the activation request state to the execution state. step 546
to start that task-level program.
Search for an address. This is shown in Figure 15.
Start address table provided in ROM 104 corresponding to TCW of each task level
The task is executed by jumping to this start address when requested by the TSA. Returning to FIG. 14, if the determination in step 530 is "NO", this indicates that the search task level program has not been requested to start, nor has its execution been interrupted. In this case, the search will proceed to the next task level. In other words, the task
The level n becomes n+1 and the level moves by one. Here, it is checked whether n is MAX, that is, 4 in this case, and if it is not 4, the process returns to step 530. This is repeated, and when n=4, the process returns from point 536 to the interruption point of the background job. In other words, at point 536, it is determined that all programs from talc level zero to level 3 do not need to be executed, and the process returns to the point where the back ground job was interrupted before the IRQ occurred. Figure 15 shows the task control system mentioned above.
This figure shows the relationship between the word TCW and the TTM task start address table that represents the task start cycle in the ROM. There is a task activation cycle TTM in the ROM corresponding to 0 to 3 of the task control wart TCW, and it is set for each INTV IRQ.
The TCW counter CNTR is updated and matches the TTM of each task, so b6 of that TCW is updated.
is flagged. Based on this flag, the start address of the task is then searched from the task start address TSA in the ROM, and by jumping to the start address, the selected programs 1 to 4 are executed.
During this execution, a flag is set in b7 of the TCW corresponding to the program in the RAM 106. As long as this flag is set, it can be determined that the program is being executed. In this way, the program of task scheduler 242 in FIG. 5 is executed. For example, programs 252 to 258 for levels 0 to 3.
Either of these will be executed. If an IRQ occurs during this execution, the task is interrupted again and the IRQ is processed. Assuming that no IRQ occurs now, the processing of the currently running task will eventually end. The process then proceeds to the EXIT program 260 to report completion. Details of this EXIT program are shown in FIG. This program consists of steps 562 and 564 for finding paper completion tasks. This step
562 and 564 first search from task level zero to find the completed task level. This advances to step 568 where RUN of b7 of the task control word of the finished task is entered.
Reset the flag. This means that the program has completely finished executing. Then, the process returns to the task scheduler again, and the next execution program is determined. Program execution and interruption will be explained again with reference to FIG. Assume that the background job 208, which has the lowest priority, is currently being executed. time t
When an INTV IRQ occurs in step 1, execution shifts to the management program (hereinafter referred to as the OS program). Then, by executing the programs 224 and 242 in FIG. 5, for example, the level zero program 252
It can be seen that execution has been requested. and time t2
"1" is set in b7 of TCW0, and then b
6 is cleared and this level zero program 252 is executed. At this time, if a request to start a level 1 program is issued at the same time, TCW1
The flag "1" is also set in b6. But first, a high-priority level zero program is executed. When the execution of this level zero program is finished at time t3, it returns to the OS program again, clears the b7 flag of TCW0, and prepares to detect and execute the next level, level 1, execution request, and from t4 Execution begins. If the level 1 processing takes time, the next INTV IRQ will occur again, and at t5, the level 1 program will be interrupted and the program will return to the OS program. Then, the OS program is executed and a startup request is issued to a program to be started using this INTV IRQ, for example, program 252.
Then, the program 252 with the highest priority is executed from time t6. In other words, set flag "1" to b7 of TCW0, clear flag b6, and start program 252 from TSA0.
Find the address and run program 252. At time t7, execution of the program 252 ends, returns to the OS program, and with the EXIT program,
Clear b7 of TCW0. Further, the task scheduler program 242 of the OS program is searched for a start request or a suspended program. By this program 242. The interruption of the program 254 is detected and execution is resumed. This restart is at time t
This is done by saving the contents of the CPU 102 at time t8 and returning them to the CPU again at time t8. When the program 254 is restarted and finishes its execution at time t9, it returns to the OS program and EXIT
Program 25 by running the program
4 completion report will be made. In other words, flag b7 of TCW1 is cleared. After that, task scheduler program 2
By executing step 42, a search is made to see if there is a program that has issued a startup request or a program whose execution has been interrupted, and for example, it is found that flag "1" is set in b6 of TCW2 of program 256. As a result, TSA2, which is the start address of the program 256, is searched, jumps to the start address of the program 256, and the program 256 is executed. At this time, as mentioned before, TCW2
Clear the b6 flag of and set the b7 flag. Furthermore, when the execution of the program 256 is completed at time t11, the program returns to the OS program, clears the flag of TCWb7 with the EXIT program, and reports the completion. Furthermore, the search for startup requests and execution interruptions is performed again. Assuming that there are no startup requests or interrupted programs as a result of this search, the background
Each data is returned to the CPU from the save area of the job 208 and execution is resumed. And at t13
When an INTV IRQ is received, the contents of the CPU are saved again, the program returns to the OS program, the cause of the IRQ is analyzed, and a startup request is made to the program again. As you can see from this explanation, when an interrupt occurs during the execution of each program, that program is interrupted, returns to the OS program, and is executed starting with the highest level program. By doing so, processing time can be allocated preferentially to more important programs. Furthermore, each program is divided into each level according to its priority, each processing program included in each level is executed in a connected manner, and a completion report is sent to each level program when all its processing is completed. This reduces the amount of space occupied by the OS program, improving processing efficiency.
Furthermore, by doing this, interrupts do not occur between programs within the same level, so by providing a save area for interrupts corresponding to each level program, execution becomes possible. will be significantly reduced. FIG. 18 shows the execution state of the explanations in FIGS. 5 and 17 from the perspective of the programs 252, 254, 256, and 258 at each level. IDLE
The program is in the waiting state for startup, and no startup request has been made to the program yet. Next, when a startup request is issued, a flag is set in b6 of the TCW, indicating that startup is necessary. From IDLE state
The time to move to the QUEUE state is determined by the level of each program. Furthermore, even if it is in the QUEUE state, it is executed and the order is determined by the priority. The program enters the execution state after the flag in b6 of TCW is cleared in the OS program and the flag in b7 is set. This will start the program execution. This state is the RUN state. When the execution is finished, the b7 flag of TCW is cleared and the completion report is completed. This results in
The RUN state ends and it returns to the IDLE state, waiting for the next startup request. However, if an IRQ occurs during program execution, that is, during RUN, the program must suspend execution. As a result, the contents of the CPU are saved and execution is interrupted. This state is the READY state. Next, when this program is ready to be executed again, the saved contents are returned to the CPU from the save area and execution is resumed. In other words, RUN again from READY state.
Return to state. In this way, each level program repeats the four states shown in FIG. Although FIG. 18 shows a typical flow, there is a possibility that b6 of TCW is flagged in the READY state. This is the case, for example, when the timing for the next activation request for the program comes while the activation is being interrupted. At this time, the b7 flag is given priority and the interrupted work is finished first. This causes the b7 flag to disappear and the b6 flag to enter the QUEUE state without passing through the IDLE state. In this way, each level program 252, 25
4, 256, and 258 are each in one of the states shown in FIG. Furthermore, each level program enters the READY state for each level program state. In other words, for example, Level 1 programs include the CARBC program, IGNCAL program, etc.
It consists of the DWLCAL program. However, since the READY state exists for level 1 programs, each of the above CARB, IGNCAL,
Since there is no READY state for DWLCAL programs, it is sufficient to have a save area corresponding to each level program. Figure 20
Areas 602 to 608 of the RAM 106 are provided corresponding to each level. FIG. 19 is a diagram showing the state changes of the back ground job, in which it is in the RUN state during execution;
When an IRQ occurs, the contents of the CPU are saved.
It becomes READY state. When the interrupt processing is finished, the saved contents are returned to the CPU and execution is resumed, that is, RUN. When evacuating the contents of the CPU due to the occurrence of an IRQ, the evacuation area 61 shown in Figure 20 is used.
It is saved to 0. FIG. 21 is a level 0 program. As shown in Table 1, this program issues a startup request every 10 milliseconds. In step 650, the data of ADC1 is taken in, and in 654, the ADC1 is activated to take in the next data. Also, step 652 is for using ADCEND IRG before starting, and if the pre-starting flag is set, it is before starting, so the program returns to RTI, that is, the interrupted program. This program is INITIALIZ in Figure 5.
This is program 204. In step 656, AD2 data is taken in, and in step 658, ADC2 data is taken in.
Activates the next data import. Step 660 captures engine speed. After completing these steps, execute the OS EXIT program and clear the TCWb7 flag. FIG. 22 shows a level 1 program, and in step 672 it is determined whether or not it is starting. If the engine is starting, the fuel for starting is supplied and the ignition timing is determined, so there is no need for calculation and the process jumps to step 678. To calculate the fuel in step 674
Run the CARBCAL program and then step
Run the IGNCAL program on 676. Each of these is performed by table lookup. step
Run the DWALCAL program on the 678 and calculate the energization time. The LAMBDA program at level 2 is a correction program for λ, and the HOSEI program at level 3 is a program for each correction coefficient. The correction coefficients are, for example, programs that calculate correction coefficients for atmospheric temperature, water temperature, etc. Since these parameters have large time constants, it is sufficient to count long intervalve coefficients. Furthermore, as mentioned above, the present invention allows all arithmetic control to be performed regardless of the engine speed.
INTV IRQ is generated. The configuration of such an IRQ generation circuit is shown in FIG. In the figure, a register 735 receives data from the CPU that sets the timer interrupt cycle (for example, 10 mS) via a data bus 752.
counter 736 at the same time.
CLOCK is input. Then, this count number and the contents set in the above register are transferred to a comparator 737.
When the contents of the register 735 and the contents of the counter 736 become equal, the comparator 73
An output is issued from 7 and flip-flop 73
8, and 740. At the same time as this
The counter 736 also outputs the output of the AND circuit 747.
and flip-flop 738 is reset. On the other hand, if flip-flop 739 is set, timer interrupt signal IRQ is output to AND circuit 748, OR
It is output via circuit 751. Here, the flip-flop 739 is a flip-flop for masking the IRQ when the IRQ is not needed (for example, during engine startup). And this time
A reset command is issued from the CPU to flip-flop 739. Furthermore, in contrast to the above-mentioned timer interrupt, an engine stall interrupt when the rotation of the engine stops due to a failure or operational error during operation (so-called engine stall) is shown in the following configuration.
This configuration is the same as that for the timer interrupt, including a register 741, a counter 742, a comparator 743,
AND circuits 746, 750, flip-flop 7
45,746, and the operation is the same as in the previous case. However, the signal input to the counter 742 is a signal emitted when the engine is rotating, and is the reference crank angle signal REF generated by the 146 sensor shown in FIG. is a signal that is emitted every time the crank rotates 180 degrees. Since the counter 742 is reset while the REF signal is input, the engine stall interrupt signal is not generated. When the engine stops, the REF signal is stopped and the reset is released, so the engine stall interrupt signal is generated. The timer interrupt IRQ as described above is
As shown in the flowchart in the figure, tasks are activated and prioritized processing is performed. That is, when the CPU receives an interrupt request, it analyzes and determines the interrupt request. If it is a timer interrupt, task units 252, 254, 256, and 258, which are leveled in descending order of priority, are activated and selected by the task scheduler 242, and the task is executed. When the task execution is finished, the completion is reported with EXIT, and the next task is selected again by the next timer interrupt and the task scheduler. On the other hand, if the interrupt is an engine stall interrupt, turn off the fuel pump.
At the same time as turning off, the ignition system is reset and all input/output control circuits are set to NO-GO. The same applies to ADC1END IRQ and ADC2END 1RQ, and when the sequence operation of ADC1 is completed, flip-flop 764 is set to "1". Furthermore, when the CPU sets "1" to the flip-flop 762 via the bus line 752,
AND gate 770 condition is met, OR gate IRQ
Request the ADC1ENDIRQ service to the CPU via. However, if flip-flop 762 is not set to "1", ADC1END IRQ is inhibited. The same goes for ADC2, and flip-flop 768 is set to "1" at the end of the ADC2 sequence. If "1" is set in flip-flop 766 at this time,
ADC2ENDIRQ is generated through AND gate 772 and OR gate 751, and flip-flop 7
If 66 is not set to "1", the condition of AND gate 772 cannot be satisfied, and AD2ENDIRQ will not occur. Therefore, the flip-flop 739,7
45,762,766 will generate an IRQ only when set to “1”, and when set to “0”
The state will be such that generation of IRQ is prohibited. As explained above, the present invention has the following effects. (A) In the present invention, a program is broken down into tasks for each engine control function, multiple designers create the tasks separately, adjust them as necessary, and then combine these tasks to create a control system. It is possible to complete it. Therefore, even if the details of engine control become complex and high-precision control is required, this can be quickly handled. (B) In engine control, control contents are changed in response to vehicle model changes or changes in control specifications, and as a result, the tasks that make up the control system often vary. In such a case, it is necessary that adding or deleting a task does not affect the execution results of other tasks. Additionally, the contents of tasks often change. The same applies in this case. In the present invention, tasks corresponding to INTV interrupts are interrupted at regular intervals. Unlike conventional methods, when a task finishes executing, there is no need to generate an interrupt to search for the next task to execute, so once the interruption due to the INTV interrupt ends, the next
The possibility of being interrupted before the INTV interrupt is INTV
This is only caused by interrupts other than interrupts, and is extremely rare. Therefore, the interrupt generation conditions are simple, and there is little increase or decrease in the save area due to changing the contents of the task. Therefore, the margin of the save area can be reduced and the memory can be used effectively. (C) Tasks are divided for each control function, but if the control functions are made relatively fine and the number of tasks is increased, changes in the control specifications described above can be responded to in a more detailed manner, but in the conventional method, the number of tasks increases. , there is a problem that the number of interrupts increases and the processing time for actual engine control becomes shorter. Furthermore, since the number of interrupted tasks increases, it is necessary to increase the evacuation area. On the other hand, according to the present invention, the processing time for one task is shortened, the possibility that processing can be performed between INTV interrupts is increased, and the number of interrupted tasks is reduced. Therefore, the evacuation area is reduced and the processing time is hardly increased. Furthermore, according to the embodiment shown in FIG. 5, since the activation cycle is changed for each level program, control efficiency is further improved. Furthermore, since an EXIT report is made for programs at the same level each time the program ends, no OS program execution is required to proceed to the next program within the same level. Therefore, processing time becomes faster. Further, since interrupts between programs at the same level do not overlap with each other, the save area can be set according to each task level, so the area can be reduced. After the engine starts, the ADC1END interrupt or
Since the ADC1END interrupt is masked,
The execution time of OS programs can be shortened, improving processing efficiency. According to the embodiment shown in FIG. 15, the TCW can be provided for each level, and there is no need to provide it for each program in Table 1, so the TCW area can be reduced. Furthermore, since the TCW is provided with a flag b6 indicating a startup request and a flag b7 indicating execution, the first
As shown in Figures 7 and 18, programs can be executed, interrupted, and restarted more smoothly and with higher priority, improving CPU control efficiency.
第1図はエンジンのスロツトル・チヤンバの断
面図、第2図は点火装置の概略図、第3図は排気
ガス環流装置のシステム図、第4図は制御システ
ムの全体構成図、第5図はプログラムのシステム
図、第6図はプログラムの記憶状態を示すメモリ
の構成図、第7図はINITIALIZプログラムの詳細
なフローチヤート図、第8図はMONITプログラ
ムのフローチヤート図、第9図は始動時の点火時
期を示す特性図、第10図は始動時の燃料供給量
を示す特性図、第11図は始動時の空気供給量を
示す特性図、第12図はEGRCALとFISCプログ
ラムの詳細図、第13図は第12図のプログラム
224の詳細フローチヤート図、第14図はタス
ク・スケジユーラの詳細フローチヤート図、第1
5図はタスク・レベル・プログラムの起動要求発
生動作を説明するための説明図、第16図は
EXITプログラムの詳細フローチヤート図、第1
7図はプログラムの処理シーケンスの説明図、第
18図はレベル・プログラムの状態変化を示す
図、第19図はバツク・グラウンド・ジヨブの状
態変化を説明するための図、第20図は待避エリ
アを説明するための図、第21図レベル・ゼロ・
プログラムの詳細フローチヤート図、第22図は
レベル1プログラムの詳細フローチヤート図、第
23図はIRQ発生回路図である。
12……スロツトル・バルブ、14……スロツ
トル、16,18,20,22……ソレノイド・
バルブ、26……メイン・ジエツト、30……メ
イン・エマルジヨン・チユーブ、32……メイ
ン・ノズル、34……ベンチユリ、62……増幅
器、64……パワー・トランジスタ、70……配
電器、102……CPU、104……ROM、10
6……RAM、108……入出力回路、132,
134,136,138,140,142,14
4……センサ、148,150,152……スイ
ツチ。
Figure 1 is a sectional view of the engine throttle chamber, Figure 2 is a schematic diagram of the ignition system, Figure 3 is a system diagram of the exhaust gas recirculation system, Figure 4 is an overall configuration diagram of the control system, and Figure 5 is a diagram of the overall configuration of the control system. Program system diagram; Figure 6 is a memory configuration diagram showing the program storage state; Figure 7 is a detailed flowchart of the INITIALIZ program; Figure 8 is a flowchart of the MONIT program; Figure 9 is at startup. Figure 10 is a characteristic diagram showing the amount of fuel supplied at startup, Figure 11 is a characteristic diagram showing the amount of air supplied at startup, Figure 12 is a detailed diagram of the EGRCAL and FISC programs, 13 is a detailed flowchart of the program 224 in FIG. 12, FIG. 14 is a detailed flowchart of the task scheduler,
Figure 5 is an explanatory diagram for explaining the task level program startup request generation operation, and Figure 16 is
Detailed flowchart of EXIT program, Part 1
Figure 7 is an explanatory diagram of the program processing sequence, Figure 18 is a diagram illustrating changes in the status of the level program, Figure 19 is a diagram illustrating changes in the status of the background job, and Figure 20 is a diagram illustrating the change in the status of the background job. A diagram to explain, Figure 21 Level Zero
FIG. 22 is a detailed flowchart of the program. FIG. 22 is a detailed flowchart of the level 1 program, and FIG. 23 is an IRQ generation circuit diagram. 12... Throttle valve, 14... Throttle, 16, 18, 20, 22... Solenoid
Valve, 26...Main jet, 30...Main emulsion tube, 32...Main nozzle, 34...Bench lily, 62...Amplifier, 64...Power transistor, 70...Distributor, 102... ...CPU, 104...ROM, 10
6...RAM, 108...I/O circuit, 132,
134, 136, 138, 140, 142, 14
4...sensor, 148,150,152...switch.
Claims (1)
により検出する第1のステツプと、上記検出され
た情報に基づいてメモリに保持されたプログラム
の実行によりデイジタル計算機でエンジンを制御
するための値を演算する第2のステツプと、上記
デイジタル計算機の演算結果によりエンジンを制
御する第3ステツプを有する制御方法において、
上記プログラムは、エンジンの制御機能毎に分類
され且つ上記制御機能がエンジンに及ぼす影響に
基づいて決められた起動周期で実行されるタスク
を有し、該各タスクの起動周期が単位時間毎に発
生するINTV割込みの割込み発生回数により表示
され、上記INTV割込み要求により上記タスクは
そのタスクレベルにかかわらず実行を中断し
INTV割込みを発生する第4ステツプと、上記
INTV割込みの発生により上記各タスクについて
起動周期に達したかどうかを検知し起動周期に達
したタスクには起動要求を示すQフラグを表示す
る第5ステツプと、上記INTV割込み発生により
中断されたタスクのレベルと上記Qフラグが表示
されたタスクのレベルのうち高い方のレベルのタ
スクを実行する第6ステツプを有することを特徴
とする電子式エンジン制御方法。 2 特許請求の範囲第1項において、Qフラグが
表示されたタスクの実行の場合は上記Qフラグの
表示を消し、実行中であることを示すRフラグを
表示する第7ステツプと、タスクの実行を終了す
ると該タスクのRフラグの表示を消す第8ステツ
プを有することを特徴とする電子式エンジン制御
方法。 3 エンジンを制御するのに必要な情報をセンサ
により検出する第1のステツプと、上記検出され
た情報に基づいてメモリに保持されたプログラム
の実行によりデイジタル計算機でエンジンを制御
するための値を演算する第2のステツプと、上記
デイジタル計算機の演算結果によりエンジンを制
御する第3ステツプを有する制御方法において、
上記プログラムは、エンジンの制御機能毎に分類
され且つ上記制御機能がエンジンに及ぼす影響に
基づき決められた起動周期で実行されるタスクを
有し、該各タスクの起動周期が単位時間毎に発生
するINTV割込みの割込み発生回数により表示さ
れ、上記INTV割込み要求により上記タスクはそ
のタスクレベルにかかわらず実行を中断しINTV
割込みを発生する第4ステツプと、上記INTV割
込みの発生により上記各タスクについて起動周期
に達したかどうかを検知し起動周期に達したタス
クには起動要求を示すQフラグを表示する第5ス
テツプと、上記INTV割込み発生により中断され
たタスクのレベルと上記Qフラグが表示されたタ
スクのレベルのうち高い方のレベルのタスクを実
行する第6ステツプと、上記タスクの実行を終了
した場合には起動要求を示すQフラグの有無を調
べ、Qフラグの表示されたタスクの内最もレベル
の高いタスクを実行し、以下これを繰り返すこと
を特徴とする電子式エンジン制御方法。[Claims] 1. A first step of detecting information necessary to control the engine using a sensor, and controlling the engine using a digital computer by executing a program stored in a memory based on the detected information. A control method comprising: a second step of calculating a value for the engine; and a third step of controlling the engine based on the calculation result of the digital computer.
The program has tasks that are classified by engine control function and are executed at startup cycles determined based on the influence of the control functions on the engine, and the startup cycle of each task occurs every unit time. This is displayed by the number of times the INTV interrupt occurs, and the INTV interrupt request interrupts execution of the above task regardless of its task level.
The fourth step of generating an INTV interrupt and the above
A fifth step in which it is detected whether or not the startup cycle has been reached for each of the above tasks due to the occurrence of the INTV interrupt, and a Q flag indicating a startup request is displayed for the task that has reached the startup cycle, and a task that has been interrupted due to the occurrence of the INTV interrupt described above. An electronic engine control method, comprising: a sixth step of executing a task at a higher level between the level of the Q flag and the level of the task for which the Q flag is displayed. 2. In claim 1, in the case of execution of a task for which a Q flag is displayed, a seventh step of erasing the display of the Q flag and displaying an R flag indicating that the task is being executed; An electronic engine control method comprising: an eighth step of erasing the display of the R flag of the task when the task is completed. 3. The first step is to use a sensor to detect information necessary to control the engine, and based on the detected information, a digital computer calculates values for controlling the engine by executing a program stored in memory. A control method comprising: a second step of controlling the engine; and a third step of controlling the engine based on the calculation result of the digital computer.
The program has tasks that are classified by engine control function and are executed at startup cycles determined based on the influence of the control functions on the engine, and the startup cycle of each task occurs every unit time. It is displayed by the number of times the INTV interrupt occurs, and the INTV interrupt request interrupts the execution of the above task regardless of its task level.
A fourth step of generating an interrupt, and a fifth step of detecting whether or not each of the tasks has reached its activation cycle due to the generation of the INTV interrupt, and displaying a Q flag indicating a activation request for tasks that have reached their activation cycle. The sixth step is to execute the task at the higher level of the task that was interrupted due to the occurrence of the INTV interrupt and the level of the task for which the Q flag is displayed, and the sixth step is to start when the execution of the task is finished. An electronic engine control method characterized by checking the presence or absence of a Q flag indicating a request, executing the task with the highest level among the tasks for which the Q flag is displayed, and repeating this process thereafter.
Priority Applications (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4090179A JPS55134719A (en) | 1979-04-06 | 1979-04-06 | Method and apparatus for controlling engine electronically |
| EP80101757A EP0017219B1 (en) | 1979-04-06 | 1980-04-02 | Electronic type engine control method and apparatus |
| DE8080101757T DE3072043D1 (en) | 1979-04-06 | 1980-04-02 | Electronic type engine control method and apparatus |
| US06/137,519 US4337513A (en) | 1979-04-06 | 1980-04-04 | Electronic type engine control method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4090179A JPS55134719A (en) | 1979-04-06 | 1979-04-06 | Method and apparatus for controlling engine electronically |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS55134719A JPS55134719A (en) | 1980-10-20 |
| JPS6239260B2 true JPS6239260B2 (en) | 1987-08-21 |
Family
ID=12593406
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4090179A Granted JPS55134719A (en) | 1979-04-06 | 1979-04-06 | Method and apparatus for controlling engine electronically |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS55134719A (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS55159240A (en) * | 1979-05-31 | 1980-12-11 | Nissan Motor Co Ltd | Collection and control unit of data for automobile |
| JPS62276604A (en) * | 1986-05-26 | 1987-12-01 | Nissan Motor Co Ltd | Sequence controller |
-
1979
- 1979-04-06 JP JP4090179A patent/JPS55134719A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS55134719A (en) | 1980-10-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4354238A (en) | Method of controlling air-fuel ratio of internal combustion engine so as to effectively maintain the air fuel ratio at a desired air-fuel ratio of λ=1 | |
| EP0017219B1 (en) | Electronic type engine control method and apparatus | |
| US4482962A (en) | Engine control method | |
| JPS6127571B2 (en) | ||
| JPS6232343B2 (en) | ||
| US4363097A (en) | Electronic type engine control method | |
| US4449502A (en) | Control system for internal combustion engine | |
| JPS6212382B2 (en) | ||
| JPS6212384B2 (en) | ||
| JPS6256339B2 (en) | ||
| JPS6352225B2 (en) | ||
| JPH0375740B2 (en) | ||
| JPS58185948A (en) | fuel injection control device | |
| JPS6239260B2 (en) | ||
| EP0030114A1 (en) | Method for starting an operation of an internal combustion engine and apparatus therefor | |
| JPS632027B2 (en) | ||
| JPH0217703B2 (en) | ||
| JPH0138176B2 (en) | ||
| JPS6336521B2 (en) | ||
| KR850000119B1 (en) | Electronic engine control method | |
| JPS58150047A (en) | Fuel injection controller of internal-combustion engine | |
| JPH0118443B2 (en) | ||
| JPS6239257B2 (en) | ||
| KR840001328B1 (en) | Method of controlling air-fuel ratio of internal combustion engine | |
| JPH0663483B2 (en) | Internal combustion engine controller |