JP3442806B2 - Job priority processing method - Google Patents
Job priority processing methodInfo
- Publication number
- JP3442806B2 JP3442806B2 JP00211593A JP211593A JP3442806B2 JP 3442806 B2 JP3442806 B2 JP 3442806B2 JP 00211593 A JP00211593 A JP 00211593A JP 211593 A JP211593 A JP 211593A JP 3442806 B2 JP3442806 B2 JP 3442806B2
- Authority
- JP
- Japan
- Prior art keywords
- job
- priority level
- flag
- priority
- level
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Combined Controls Of Internal Combustion Engines (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、車輌制御における複数
のジョブの処理の効率化を図るジョブの優先処理方法に
関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a job priority processing method for improving efficiency of processing a plurality of jobs in vehicle control.
【0002】[0002]
【従来の技術】近年、自動車などの車輌にマイクロコン
ピュータが導入され、エンジン、パワートレインなどを
高精度に制御することが可能となった。これにより、車
輌制御システムの開発においては、マイクロコンピュー
タのソフトウエア開発が大きな比重を占めるようにな
り、制御アルゴリスム上の処理の効率化が重要な課題と
なっている。2. Description of the Related Art In recent years, microcomputers have been introduced into vehicles such as automobiles, and it has become possible to control engines, power trains and the like with high precision. Therefore, in the development of the vehicle control system, the software development of the microcomputer has become a major factor, and the efficiency of the processing on the control algorithm has become an important issue.
【0003】この場合、上記マイクロコンピュータによ
るエンジン制御システムなどでは、吸入空気量や燃料噴
射量などのようにデジタル制御理論に基づく離散値処理
のために等時間間隔処理を行なうジョブ、点火タイマセ
ットなどのようにクランク位置情報に基づく処理を行な
うジョブなど制御ストラテジー毎に複数のジョブがあ
り、通常、これらの各ジョブは、所定時間間隔毎、所定
クランク角毎に割込み実行されるようになっており、複
数の割込み処理を適切に実行するため、従来より各種提
案がなされている。In this case, in the engine control system using the above microcomputer, a job for performing equal time interval processing for discrete value processing based on digital control theory, such as an intake air amount and a fuel injection amount, an ignition timer set, etc. There are multiple jobs for each control strategy, such as jobs that perform processing based on crank position information, and these jobs are normally interrupted at predetermined time intervals and crank angles. Various proposals have heretofore been made to appropriately execute a plurality of interrupt processes.
【0004】例えば、特開昭55−137358号公報
には、一つの割込み処理プログラム実行中に他の割込み
要求があったときは、その要求が発生したことを登録す
るだけで、その割込み処理は行なわず、実行中の割込み
処理プログラムが終了したのちに登録しておいた要求に
対応する割込み処理プログラムを実行する技術が開示さ
れている。For example, in Japanese Patent Laid-Open No. 55-137358, when another interrupt request is issued during execution of one interrupt processing program, the fact that the request is generated is registered, and the interrupt processing is performed. There is disclosed a technique of executing an interrupt processing program corresponding to a registered request after the interrupt processing program being executed is terminated without executing the interrupt processing program.
【0005】また、特開昭62−10453号公報に
は、優先順位が下位レベルの割込みルーチンで、記憶し
た回転角に応じて点火時期制御、燃料噴射制御等の制御
決定を行ない、下位レベルの割込み処理中に上位レベル
の割込みが発生しても、常に割込み以前の回転角に応じ
て処理を再開する先行技術が開示されている。Further, in Japanese Unexamined Patent Publication No. 62-10453, an interrupt routine having a lower level of priority is used to make control decisions such as ignition timing control and fuel injection control in accordance with the stored rotation angle. A prior art is disclosed in which even if an upper level interrupt occurs during interrupt processing, the process is always restarted according to the rotation angle before the interrupt.
【0006】[0006]
【発明が解決しようとする課題】しかしながら、実行中
の割込み処理プログラムが終了したのちに登録しておい
た要求に対応する割込み処理プログラムを実行すると、
処理時間の長いジョブによって次の重要なジョブが待た
されるといった事態が発生するおそれがある。However, when the interrupt processing program corresponding to the registered request is executed after the interrupt processing program being executed is completed,
A job with a long processing time may cause the next important job to wait.
【0007】また、前述したように、車輌制御において
は、エンジンの回転に同期したジョブ以外に処理すべき
数多くのジョブが存在し、回転同期の割込み処理が全て
他の処理より優先的に実行しなければならないとは限ら
ず、複数のジョブの多重割込みが発生した場合、単に、
記憶した回転角に応じて下位レベルの割込みルーチンを
実行するのみでは、各割込み要求に対処することはでき
ない。Further, as described above, in vehicle control, there are many jobs to be processed in addition to the jobs synchronized with the rotation of the engine, and all the interrupt processing of the rotation synchronization is executed with priority over other processing. It does not have to be, but when multiple interrupts of multiple jobs occur, simply
It is not possible to deal with each interrupt request only by executing the lower level interrupt routine according to the stored rotation angle.
【0008】すなわち、複数のジョブを割込み順に実行
するのみ、あるいは、一義的に回転同期の割込みを最優
先処理することは、処理効率の低下を招くばかりでな
く、等時間間隔毎あるいは所定タイミング毎に行なわな
ければならないジョブを的確に処理するは困難である。That is, only executing a plurality of jobs in the order of interruption, or uniquely giving the highest priority to the rotation-synchronized interruption causes not only a decrease in processing efficiency but also an equal time interval or a predetermined timing. It is difficult to properly process a job that must be performed.
【0009】本発明は上記事情に鑑みてなされたもの
で、車輌制御における各制御ストラテジー毎のジョブの
実行効率を向上させ、等時間間隔毎あるいは所定タイミ
ング毎の的確な処理を可能にするジョブの優先処理方法
を提供することを目的としている。The present invention has been made in view of the above circumstances, and improves the execution efficiency of a job for each control strategy in vehicle control, and makes it possible to perform accurate processing at equal time intervals or at predetermined timings. It is intended to provide a preferential treatment method.
【0010】[0010]
【課題を解決するための手段】上記目的を達成するた
め、請求項1記載の発明は、実行周期により定義される
優先レベルの異なる複数のジョブを優先順に実行すると
共に、多重割込みが発生した時には、低優先側のジョブ
の割込み要求回数を記憶し、高優先ジョブの実行後、順
次低優先側のジョブを、記憶した割込み要求の回数実行
する車両制御のためのジョブの優先処理方法において、
各優先レベル毎にオーバーラップカウンタを割当てると
共に、一定の基本時間毎に実行される定期割込み処理に
より、優先順位を示すと共に上記基本時間の整数倍の各
実行周期毎のジョブ割込み要求を示すジョブフラグを、
上記基本時間の整数倍の間隔で各実行周期に対応してそ
れぞれセットし、定期割込み処理においていずれかのジ
ョブフラグがセットされているか否かを判断し、上記ジ
ョブフラグがセットされている時には、さらに現状の優
先レベル以下のジョブフラグがセットされているか否か
を判断し、多重割込みにより現状レベル以下のジョブフ
ラグがセットされている時には当該低優先レベルのジョ
ブの実行要求回数を示すオーバーラップカウンタのカウ
ント値をカウントアップして、更に現状優先レベルより
高い優先レベルのジョブフラグがセットされているか否
かを判断し、現状レベルより高いレベルのジョブフラグ
がセットされている時には、順次優先レベルを上げて該
優先レベルに対応するジョブフラグがセットされている
かを判断して、セットされているジョブフラグにより示
される優先レベルのオーバーラップカウンタのカウント
値をカウントアップし、現状より高優先レベルのジョブ
フラグがセットされていない時には、当該優先レベルの
ジョブを該優先レベルのオーバーラップカウンタのカウ
ント値により示される回数実行し、上記ジョブの実行
後、優先レベルを順次下げて該優先レベル毎に該優先レ
ベルのオーバーラップカウンタのカウント値を判断し、
該オーバーラップカウンタのカウント値により示される
回数、該優先レベルのジョブを実行することを特徴とす
る。In order to solve the problem] was to achieve the above purpose
Therefore, the invention according to claim 1 is defined by the execution cycle.
If you run multiple jobs with different priority levels in priority order
In both cases, when multiple interrupts occur, the job on the low priority side
The number of interrupt requests of the
Execute the stored interrupt request count for the next lower priority job
In the priority processing method of the job for controlling the vehicle,
Assigning an overlap counter for each priority level
Both are used for periodic interrupt processing that is executed at fixed basic times.
In addition, the priority is indicated and each integer multiple of the above basic time
A job flag indicating a job interrupt request for each execution cycle
Corresponding to each execution cycle at intervals of an integral multiple of the above basic time
Set each of them and use either
Judge whether the job flag is set or not, and
When the job flag is set, the
Whether the job flag of the previous level or lower is set
Job interrupts that are below the current level due to multiple interrupts.
When the lag is set, the job of the low priority level is
Of the overlap counter that indicates the number of execution requests
The counter value is incremented and the current priority level
Whether or not the job flag of high priority level is set
Whether the job flag is higher than the current level
When is set, the priority level
The job flag corresponding to the priority level is set
It is judged by the set job flag.
Of priority level overlap counters
The job that counts up the value and has a higher priority level than the current one
When the flag is not set, the priority level
The job is counted by the overlap counter of the priority level.
Run the number of times indicated by the default value and execute the above job
After that, the priority levels are sequentially lowered, and the priority level is reduced for each priority level.
Determine the count value of Bell's overlap counter,
Indicated by the count value of the overlap counter
It is characterized in that the job of the priority level is executed a number of times .
【0011】請求項2記載の発明は、実行周期により定
義される優先レベルの異なる等時間間隔処理の複数のジ
ョブ、及びエンジン回転に同期した所定クランク角毎の
ジョブを優先順に実行すると共に、多重割込みが発生し
た時には、低優先側のジョブの割込み要求回数を記憶
し、高優先ジョブの実行後、順次低優先側のジョブを、
記憶した割込み要求の回数実行する車両制御のためのジ
ョブの優先処理方法において、各優先レベル毎にオーバ
ーラップカウンタを割当てると共に、上記等時間間隔処
理のジョブについては一定の基本時間毎に実行される定
期割込み処理により、優先順位を示すと共に上記基本時
間の整数倍の各実行周期毎のジョブ割込み要求を示すジ
ョブフラグを、上記基本時間の整数倍の間隔で各実行周
期に対応してそれぞれセットし、定期割込み処理におい
ていずれかのジョブフラグがセットされているか否かを
判断し、上記ジョブフラグがセットされている時には、
さらに現状の優先レベル以下のジョブフラグがセットさ
れているか否かを判断し、多重割込みにより現状レベル
以下のジョブフラグがセットされている時には当該低優
先レベルのジョブの実行要求回数を示すオーバーラップ
カウンタのカウント値をカウントアップして、更に現状
優先レベルより高い優先レベルのジョブフラグがセット
されているか否かを判断し、所定クランク角毎のジョブ
については、該クランク角毎の割込み処理において該優
先レベルに対応するオーバーラップカウンタをカウント
アップして、該当優先レベルのジョブフラグをセット
し、所定クランク角毎の割込み処理により該当優先レベ
ルのジョブフラグをセットした後、または上記定期割込
み処理処理において現状レベルより高いレベルのジョブ
フラグがセットされている時には、順次優先レベルを上
げて該優先レベルに対応するジョブフラグがセットされ
ているかを判断して、セットされているジョブフラグに
より示される優先レベルのオーバーラップカウンタのカ
ウント値をカウントアップし、現状より高優先レベルの
ジョブフラグがセットされていない時には、当該優先レ
ベルのジョブを該優先レベルのオーバーラップカウンタ
のカウント値により示される回数実行し、上記ジョブの
実行後、優先レベルを順次下げて該優先レベル毎に該優
先レベルのオーバーラップカウンタのカウント値を判断
し、該オーバーラップカウンタのカウント値により示さ
れる回数、該優先レベルのジョブ を実行することを特徴
とする。According to a second aspect of the invention, the execution cycle determines
Multiple isochronous processes with different priority levels
And for each predetermined crank angle synchronized with the engine rotation
Jobs are executed in priority order and multiple interrupts occur.
The interrupt request count of the job on the low priority side,
Then, after executing the high-priority job,
Stores the number of stored interrupt requests for the vehicle control
The priority processing method of Job
-Assign a lap counter and
For a physical job, a constant job is executed every fixed basic time.
Period interrupt processing indicates priority and the above basic time
A job interrupt request for each execution cycle that is an integer multiple of
The job flag at each execution cycle at intervals of an integral multiple of the above basic time.
Corresponding to the period, set each to
Check whether any of the job flags are set.
Judgment, when the above job flag is set,
In addition, job flags below the current priority level are set.
It is determined whether or not it is
When the following job flags are set, the
Overlap that indicates the number of execution requests for the previous level job
The count value of the counter is increased and
Job flag of priority level higher than priority level is set
It is judged whether or not the job is performed at a predetermined crank angle.
Regarding the above, in the interrupt processing for each crank angle,
Counts the overlap counter corresponding to the previous level
Up and set the job flag of the corresponding priority level
However, the priority level is interrupted by interrupt processing for each predetermined crank angle.
After setting the job flag of the
Only higher level jobs than the current level in processing
When the flag is set, the priority level is increased sequentially.
The job flag corresponding to the priority level is set
The job flag that has been set,
Of the overlap counter of the priority level indicated by
The count value is incremented and the higher priority level
If the job flag is not set, the priority level
Bell job is overlapped counter of the priority level
Execute the number of times indicated by the count value of
After the execution, the priority level is lowered in sequence and the priority level is reduced for each priority level.
Determine the count value of the previous level overlap counter
Indicated by the count value of the overlap counter.
The job of the priority level is executed the number of times that the job is executed .
【0012】請求項3記載の発明は、請求項1或いは請
求項2記載の発明において、各優先レベル毎のジョブの
実行開始によりセットされ実行終了によりクリアされる
ジョブ実行中フラグを有し、優先レベル毎に該優先レベ
ルのオーバーラップカウンタのカウント値を判断して該
オーバーラップカウンタのカウント値により示される回
数、該優先レベルのジョブを実行するに際し、ジョブ実
行中フラグを参照し、ジョブ実行中フラグがセットされ
ている時は、多重割込みにより中断していたジョブを実
行することを特徴とする。 The invention according to claim 3 is the same as claim 1 or the contract.
In the invention described in claim 2, the job for each priority level is
Set at the start of execution and cleared at the end of execution
It has a job in progress flag and the priority level for each priority level.
The count value of the overlap counter
Number of times indicated by the count value of the overlap counter
The number of job executions when executing a job of the priority level.
Refers to the in-process flag and the job in-execution flag is set
The job that was interrupted by multiple interrupts
Characterized in that row.
【0013】[0013]
【0014】請求項4記載の発明は、請求項1ないし請
求項3のいずれかに記載の発明において、等時間間隔処
理のジョブを対象として、上記基本時間を1つの位置と
して複数の位置を有し、基本時間に対する各優先レベル
のジョブ実行周期の整数倍に対応して、該整数倍の間隔
の位置に対応優先レベルのジョブフラグをセットするデ
ータが配置されたテーブルを備え、一定の基本時間毎に
実行される定期割込み処理においてテーブルの位置を指
定するポインタをインクリメントしてテーブル参照を行
い、等時間間隔処理のジョブを対象として、各実行周期
毎のジョブ割込み要求を示すジョブフラグをセットする
ことを特徴とする。[0014] The invention of claim 4, wherein the organic in the invention described in any one of claims 1 to 3, as a target jobs isochronous process, a plurality of positions of the above basic time as one location However, in correspondence with an integer multiple of the job execution cycle of each priority level with respect to the basic time, there is provided a table in which data for setting job flags of the corresponding priority level is arranged at positions of integer multiples, and a fixed basic time is set. In the periodic interrupt process executed every time, the pointer designating the table position is incremented to refer to the table, and the job flag indicating the job interrupt request for each execution cycle is set for the job of the equal time interval process. It is characterized by
【0015】請求項5記載の発明は、請求項1ないし請
求項3のいずれかに記載の発明において、等時間間隔処
理のジョブを対象として、上記基本時間を1つの位置と
して複数の位置を有し該基本時間に対する最上位優先レ
ベルから予め設定された中位優先レベルまでの各優先レ
ベルのジョブ実行周期の整数倍に対応して該整数倍の間
隔の位置に対応優先レベルのジョブフラグをセットする
データが配置された第1のテーブルと、等時間間隔処理
のジョブを対象として、上記中位優先レベルのジョブの
実行周期を基本時間とし、該基本時間を1つの位置とし
て複数の位置を有し、該基本時間に対する最下位優先レ
ベルまでの各優先レベルのジョブ実行周期の整数倍に対
応して該整数倍の間隔の位置に対応優先レベルのジョブ
フラグをセットするデータが配置された第2のテーブル
とを備え、一定の基本時間毎に実行される定期割込み処
理において上記第1のテーブルの位置を指定するポイン
タをインクリメントして第1のテーブル参照を行うと共
に上記中位優先レベルのジョブの実行周期に対応して上
記第2のテーブルの位置を指定するポインタをインクリ
メントして第2のテーブル参照を行い、等時間間隔処理
のジョブを対象として、各実行周期毎のジョブ割込み要
求を示すジョブフラグをセットすることを特徴とする。[0015] According to a fifth aspect of the invention, organic in the invention described in any one of claims 1 to 3, as a target jobs isochronous process, a plurality of positions of the above basic time as one location Then, corresponding to the integer multiple of the job execution cycle of each priority level from the highest priority level to the preset middle priority level for the basic time, the job flag of the priority level is set at the position of the integer multiple interval. For a job of equal time interval processing and a first table in which data to be processed is arranged, the execution cycle of the above-mentioned medium priority level job is set as a basic time, and the basic time is defined as one position, and a plurality of positions are set. Then, the job flag of the corresponding priority level is set at the position of the integer multiple interval corresponding to the integer multiple of the job execution cycle of each priority level up to the lowest priority level with respect to the basic time. A second table in which data is arranged, and in a periodic interrupt process executed at fixed basic time intervals, the pointer designating the position of the first table is incremented to refer to the first table and A pointer for designating the position of the second table is incremented to correspond to the execution cycle of the medium priority level job, and the second table is referred to. It is characterized in that a job flag indicating a job interruption request is set.
【0016】[0016]
【0017】[0017]
【作用】請求項1記載の発明は、実行周期により定義さ
れる優先レベルの異なる複数のジョブを優先順に実行す
るに際し、各優先レベル毎にオーバーラップカウンタを
割当てる。そして、一定の基本時間毎に実行される定期
割込み処理により、優先順位を示すと共に上記基本時間
の整数倍の各実行周期毎のジョブ割込み要求を示すジョ
ブフラグを、基本時間の整数倍の間隔で各実行周期に対
応してそれぞれセットする。そして、定期割込み処理に
おいていずれかのジョブフラグがセットされているか否
かを判断し、ジョブフラグがセットされている時には、
さらに現状の優先レベル以下のジョブフラグがセットさ
れているか否かを判断する。そして、多重割込みにより
現状レベル以下のジョブフラグがセットされている時に
は当該低優先レベルのジョブの実行要求回数を示すオー
バーラップカウンタのカウント値をカウントアップし
て、更に現状優先レベルより高い優先レベルのジョブフ
ラグがセットされているか否かを判断する。そして、現
状レベルより高いレベルのジョブフラグがセットされて
いる時には、順次優先レベルを上げて該優先レベルに対
応するジョブフラグがセットされているかを判断して、
セットされているジョブフラグにより示される優先レベ
ルのオーバーラップカウンタのカウント値をカウントア
ップする。また、現状より高優先レベルのジョブフラグ
がセットされていない時には、当該優先レベルのジョブ
を該優先レベルのオーバーラップカウンタのカウント値
による回数実行する。そして、ジョブの実行後、優先レ
ベルを順次下げて該優先レベル毎に該優先レベルのオー
バーラップカウンタのカウント値を判断し、該オーバー
ラップカウンタのカウント値により示される回数、該優
先レベルのジョブを実行する。 The invention according to claim 1 is defined by the execution cycle.
Run multiple jobs with different priority levels in priority order
The overlap counter for each priority level.
Allocate. And a regular run every fixed basic time
Interrupt processing indicates priority and the above basic time
A job interrupt request for each execution cycle that is an integer multiple of
Buflag for each execution cycle at intervals of an integral multiple of the basic time.
Set each accordingly. And for periodic interrupt processing
Whether any of the job flags are set
If the job flag is set,
In addition, job flags below the current priority level are set.
It is determined whether or not And due to multiple interrupts
When a job flag below the current level is set
Indicates the number of execution requests for the low priority job.
Count up the count value of the burlap counter
The job level of a priority level higher than the current priority level.
Determine if the lag is set. And now
The job flag of a higher level than the
When you are in
Judge whether the corresponding job flag is set,
Priority level indicated by the set job flag
The count value of the overlap counter
Up. Also, the job flag of higher priority level than the current one
If is not set, the job of the priority level
Is the count value of the overlap counter of the priority level
Execute by the number of times. After executing the job, the priority level
Decrease the bell in sequence and turn the priority level o
Judge the count value of the burlap counter and
The number of times indicated by the count value of the lap counter,
Run the previous level job.
【0018】請求項2記載の発明は、実行周期により定
義される優先レベルの異なる等時間間隔処理の複数のジ
ョブ、及びエンジン回転に同期した所定クランク角毎の
ジョブを優先順に実行するに際し、各優先レベル毎にオ
ーバーラップカウンタを割当てる。そして、等時間間隔
処理のジョブについては一定の基本時間毎に実行される
定期割込み処理により、優先順位を示すと共に上記基本
時間の整数倍の各実行周期毎のジョブ割込み要求を示す
ジョブフラグを、上記基本時間の整数倍の間隔で各実行
周期に対応してそれぞれセットする。そして、定期割込
み処理において、いずれかのジョブフラグがセットされ
ているか否かを判断し、ジョブフラグがセットされてい
る時には、さらに現状の優先レベル以下のジョブフラグ
がセットされているか否かを判断する。そして、多重割
込みにより現状レベル以下のジョブフラグがセットされ
ている時には当該低優先レベルのジョブの実行要求回数
を示すオーバーラップカウンタのカウント値をカウント
アップして、更に現状優先レベルより高い優先レベルの
ジョブフラグがセットされているか否かを判断する。ま
た、所定クランク角毎のジョブについては、該クランク
角毎の割込み処理において該優先レベルに対応するオー
バーラップカウンタをカウントアップして、該当優先レ
ベルのジョブフラグをセットする。そして、所定クラン
ク角毎の割込み処理により該当優先レベルのジョブフラ
グをセットした後、または定期割込み処理処理において
現状レベルより高いレベルのジョブフラグがセットされ
ている時には、順次優先レベルを上げて該優先レベルに
対応するジョブフラグがセットされているかを判断し
て、セットされているジョブフラグにより示される優先
レベルのオーバーラップカウンタのカウント値をカウン
トアップする。また、現状より高優先レベルのジョブフ
ラグがセットされていない時には、当該優先レベルのジ
ョブを該優先レベルのオーバーラップカウンタのカウン
ト値により示される回数実行する。そして、ジョブの実
行後、優先レベルを順次下げて該優先レベル毎に該優先
レベルのオーバーラップカウンタのカウント値を判断
し、該オーバーラップカウンタのカウント値により示さ
れる回数、該優先レベルのジョブを実行する。 The invention according to claim 2 is defined by the execution cycle.
Multiple isochronous processes with different priority levels
And for each predetermined crank angle synchronized with the engine rotation
When executing jobs in priority order, the
Overlap counter is assigned. And at equal time intervals
Processing jobs are executed at fixed basic time intervals
Periodic interrupt processing indicates the priority and the above basic
Indicates a job interrupt request for each execution cycle that is an integral multiple of time
Each execution of the job flag at intervals of integer multiples of the above basic time
Set each corresponding to the cycle. And regular interruption
Only one of the job flags is set
The job flag is set.
Job flags below the current priority level
It is determined whether or not is set. And multiple discount
Job flags below the current level are set due to
The number of execution requests for the low priority job
The count value of the overlap counter indicating
Up to a higher priority level than the current priority level
It is determined whether the job flag is set. Well
Also, for a job for each predetermined crank angle,
The interrupt corresponding to the priority level in the interrupt processing for each corner
The burlap counter is incremented and the priority level
Set the bell job flag. And the predetermined clan
The job flag of the relevant priority level is processed by interrupt processing for each corner.
After setting the flag or during periodic interrupt processing.
A job flag higher than the current level is set
When it is, the priority level is gradually increased to the priority level.
Determine if the corresponding job flag is set
The priority indicated by the set job flag
Count the count value of the level overlap counter
Up. In addition, job jobs with higher priority levels
If the lag is not set, the priority level
The count of the overlap counter of the priority level.
Run the number of times indicated by the value. And the actual job
After the line, the priority level is gradually lowered and the priority is given to each priority level.
Determine the count value of the level overlap counter
Indicated by the count value of the overlap counter.
The job of the priority level is executed the number of times .
【0019】請求項3記載の発明は、各優先レベル毎の
ジョブの実行開始によりセットされ実行終了によりクリ
アされるジョブ実行中フラグを有する。そして、優先レ
ベル毎に該優先レベルのオーバーラップカウンタのカウ
ント値を判断して該オーバーラップカウンタのカウント
値により示される回数、該優先レベルのジョブを実行す
るに際し、ジョブ実行中フラグを参照し、ジョブ実行中
フラグがセットされている時は、多重割込みにより中断
していたジョブを実行する。 The invention according to claim 3 is for each priority level.
It is set when the job starts executing and cleared when the job ends.
The job execution flag is set. And the priority level
For each bell, the counter of the overlap counter of the priority level
Count of the overlap counter by judging the counter value
The job of the priority level is executed the number of times indicated by the value.
When the job is running, refer to the job running flag
Interrupted by multiple interrupts when flag is set
Execute the job you were doing.
【0020】[0020]
【0021】請求項4記載の発明は、等時間間隔処理の
ジョブを対象として、上記基本時間を1つの位置として
複数の位置を有し、基本時間に対する各優先レベルのジ
ョブ実行周期の整数倍に対応して、該整数倍の間隔の位
置に対応優先レベルのジョブフラグをセットするデータ
が配置されたテーブルを備える。そして、一定の基本時
間毎に実行される定期割込み処理において、テーブルの
位置を指定するポインタをインクリメントしてテーブル
参照を行い、等時間間隔処理のジョブを対象として、各
実行周期毎のジョブ割込み要求を示すジョブフラグをセ
ットする。 The invention according to claim 4 is for processing at equal time intervals.
For the job, the basic time as one position
It has multiple positions, and each priority level
Corresponding to an integer multiple of the job execution cycle,
Data that sets the job flag of the priority level
Is provided with a table. And at a certain basic time
In the periodic interrupt processing executed every interval, the table
Table by incrementing the pointer that specifies the position
Refer to each job for equal time interval processing
Set the job flag that indicates the job interrupt request for each execution cycle.
To put.
【0022】請求項5記載の発明は、等時間間隔処理の
ジョブを対象として、上記基本時間を1つの位置として
複数の位置を有し該基本時間に対する最上位優先レベル
から予め設定された中位優先レベルまでの各優先レベル
のジョブ実行周期の整数倍に対応して該整数倍の間隔の
位置に対応優先レベルのジョブフラグをセットするデー
タが配置された第1のテーブルと、等時間間隔処理のジ
ョブを対象として、上記中位優先レベルのジョブの実行
周期を基本時間とし、該基本時間を1つの位置として複
数の位置を有し、該基本時間に対する最下位優先レベル
までの各優先レベルのジョブ実行周期の整数倍に対応し
て該整数倍の間隔の位置に対応優先レベルのジョブフラ
グをセットするデータが配置された第2のテーブルとを
備える。そして、一定の基本時間毎に実行される定期割
込み処理において上記第1のテーブルの位置を指定する
ポインタをインクリメントして第1のテーブル参照を行
うと共に上記中位優先レベルのジョブの実行周期に対応
して上記第2のテーブルの位置を指定するポインタをイ
ンクリメントして第2のテーブル参照を行い、等時間間
隔処理のジョブを対象として、各実行周期毎のジョブ割
込み要求を示すジョブフラグをセットする。 The invention according to claim 5 is for processing at equal time intervals.
For the job, the basic time as one position
The highest priority level for the basic time having a plurality of positions
To each intermediate priority level set in advance
Corresponding to an integer multiple of the job execution cycle of
Data that sets the job flag of the priority level corresponding to the position
Data is placed on the first table and at the same time interval processing
Jobs with medium priority level above
The cycle is the basic time, and the basic time is one position.
The lowest priority level for the base time, having a number of positions
Up to an integer multiple of the job execution cycle of each priority level up to
The job flags of the priority level
The second table with the data to set
Prepare And a periodical schedule that is executed every fixed basic time
Specify the position of the first table in the embedding process
Increment the pointer and make the first table reference
Along with the execution cycle of the above-mentioned medium priority level jobs
The pointer that specifies the position of the second table above.
And refer to the second table for equal time
Job allocation for each execution cycle, targeting remote processing jobs
Set a job flag indicating a request for inclusion.
【0023】[0023]
【0024】[0024]
【実施例】以下、図面を参照して本発明の実施例を説明
する。図面は本発明の一実施例に係り、図1はジョブ優
先処理のフローチャート、図2は0.5ms毎の定期割
込み処理のフローチャート、図3はクラセン割込み処理
のフローチャート、図4はジョブフラグ作成サブルーチ
ンのフローチャート、図5はジョブ実行サブルーチンの
部分フローチャート1、図6はジョブ実行サブルーチン
の部分フローチャート2、図7はジョブ実行サブルーチ
ンの部分フローチャート3、図8はジョブ実行サブルー
チンの部分フローチャート4、図9はジョブの実行状態
を示す説明図、図10はジョブフラグの説明図、図11
はジョブフラグテーブルの説明図、図12はクランク位
置変数の説明図、図13はジョブ実行中フラグとオーバ
ーラップカウンタの変化を示す説明図、図14はシステ
ムシフトバッファの説明図、図15はエンジン系の概略
構成図、図16はクランクロータとクランク角センサの
正面図、図17はカムロータとカム角センサの正面図、
図18は電子制御系の回路構成図である。Embodiments of the present invention will be described below with reference to the drawings. 1 is a flowchart of job priority processing, FIG. 2 is a flowchart of periodic interrupt processing every 0.5 ms, FIG. 3 is a flowchart of Krasen interrupt processing, and FIG. 4 is a job flag creation subroutine. 5 is a partial flowchart 1 of the job execution subroutine, FIG. 6 is a partial flowchart 2 of the job execution subroutine, FIG. 7 is a partial flowchart 3 of the job execution subroutine, FIG. 8 is a partial flowchart 4 of the job execution subroutine, and FIG. FIG. 10 is an explanatory diagram showing a job execution state, FIG. 10 is an explanatory diagram of a job flag, and FIG.
Is an explanatory diagram of a job flag table, FIG. 12 is an explanatory diagram of crank position variables, FIG. 13 is an explanatory diagram showing changes in a job execution flag and an overlap counter, FIG. 14 is an explanatory diagram of a system shift buffer, and FIG. 15 is an engine. FIG. 16 is a front view of a crank rotor and a crank angle sensor, FIG. 17 is a front view of a cam rotor and a cam angle sensor,
FIG. 18 is a circuit configuration diagram of the electronic control system.
【0025】本実施例における車輌制御システムは、例
えば、燃料噴射制御、点火時期制御などを行なうエンジ
ン制御システムであり、図18に示すように、マイクロ
コンピュータを中核とする電子制御装置(ECU)50
によって図15に示すエンジン系が制御される。このE
CU50のマイクロコンピュータには、新しい概念に基
づくオペレーティングシステム(OS)が搭載されてお
り、このOSの管理下で、各制御ストラテジーに基づく
各ジョブが、それぞれの優先レベルに従って実行され
る。The vehicle control system in this embodiment is, for example, an engine control system for performing fuel injection control, ignition timing control, etc., and as shown in FIG. 18, an electronic control unit (ECU) 50 having a microcomputer as its core.
The engine system shown in FIG. 15 is controlled by. This E
The microcomputer of the CU 50 is equipped with an operating system (OS) based on a new concept, and under the control of this OS, each job based on each control strategy is executed according to each priority level.
【0026】まず、エンジン系の機器構成について説明
する。図15に示すように、エンジン1(図においては
水平対向4気筒型エンジンを示す)は、シリンダヘッド
2の吸気ポート2aにインテークマニホルド3が連通さ
れ、このインテークマニホルド3の上流にエアチャンバ
4を介してスロットル通路5が連通されている。このス
ロットル通路5の上流側には、吸気管6を介してエアク
リーナ7が取付けられ、このエアクリーナ7が吸入空気
の取り入れ口であるエアインテークチャンバ8に連通さ
れている。First, the equipment configuration of the engine system will be described. As shown in FIG. 15, an engine 1 (a horizontally opposed four-cylinder engine is shown in the drawing) has an intake manifold 3 in communication with an intake port 2 a of a cylinder head 2, and an air chamber 4 is provided upstream of the intake manifold 3. The throttle passage 5 is communicated with each other. An air cleaner 7 is attached to the upstream side of the throttle passage 5 via an intake pipe 6, and the air cleaner 7 is in communication with an air intake chamber 8 which is an intake port for intake air.
【0027】また、上記排気ポート2bにエキゾースト
マニホルド9を介して排気管10が連通され、この排気
管10に触媒コンバータ11が介装されてマフラ12に
連通されている。一方、上記スロットル通路5にスロッ
トルバルブ5aが設けられ、このスロットル通路5の直
上流の上記吸気管6にインタークーラ13が介装され、
さらに、上記吸気管6の上記エアクリーナ7の下流側に
レゾネータチャンバ14が介装されている。An exhaust pipe 10 is connected to the exhaust port 2b via an exhaust manifold 9, and a catalytic converter 11 is connected to the exhaust pipe 10 and is connected to a muffler 12. On the other hand, a throttle valve 5a is provided in the throttle passage 5, and an intercooler 13 is provided in the intake pipe 6 immediately upstream of the throttle passage 5,
Further, a resonator chamber 14 is interposed downstream of the air cleaner 7 in the intake pipe 6.
【0028】また、上記レゾネータチャンバ14と上記
インテークマニホルド3とを連通して上記スロットルバ
ルブ5aの上流側と下流側とをバイパスするバイパス通
路15に、アイドルスピードコントロールバルブ(IS
CV)16が介装されている。さらに、このISCV1
6の直下流側に、吸気圧が負圧のとき開弁し、またター
ボチャージャ18によって過給されて吸気圧が正圧にな
ったとき閉弁するチェックバルブ17が介装されてい
る。Further, an idle speed control valve (IS) is provided in a bypass passage 15 which connects the resonator chamber 14 and the intake manifold 3 and bypasses the upstream side and the downstream side of the throttle valve 5a.
CV) 16 is interposed. Furthermore, this ISCV1
A check valve 17 which is opened immediately downstream of 6 when the intake pressure is a negative pressure and which is closed when the intake pressure becomes a positive pressure by being supercharged by a turbocharger 18 is interposed.
【0029】上記ターボチャージャ18は、上記吸気管
6の上記レゾネータチャンバ14の下流側にコンプレッ
サハウジングが介装され、タービンハウジングが上記排
気管10に介装されている。さらに、上記ターボチャー
ジャ18のタービンハウジング流入口には、ウエストゲ
ート弁19が介装され、このウエストゲート弁19に
は、ウエストゲート弁作動用アクチュエータ20が連設
されている。In the turbocharger 18, a compressor housing is provided downstream of the resonator chamber 14 of the intake pipe 6, and a turbine housing is provided in the exhaust pipe 10. Further, a wastegate valve 19 is provided at the turbine housing inlet of the turbocharger 18, and a wastegate valve actuating actuator 20 is connected to the wastegate valve 19.
【0030】上記ウエストゲート弁作動用アクチュエー
タ20は、ダイヤフラムにより2室に仕切られ、一方が
ウエストゲート弁制御用デューティソレノイド弁21に
連通される圧力室を形成し、他方が上記ウエストゲート
弁19を閉方向に付勢するスプリングを収納したスプリ
ング室を形成している。The waste gate valve actuating actuator 20 is partitioned into two chambers by a diaphragm, one of which forms a pressure chamber communicating with the waste gate valve controlling duty solenoid valve 21, and the other of which forms the waste gate valve 19. A spring chamber is formed that houses a spring that urges in the closing direction.
【0031】上記ウエストゲート弁制御用デューティソ
レノイド弁21は、上記レゾネータチャンバ14と上記
吸気管6の上記ターボチャージャ18のコンプレッサハ
ウジング下流とを連通する通路に介装されており、EC
U50から出力される制御信号のデューティ比に応じ
て、上記レゾネータチャンバ14側の圧力と上記コンプ
レッサハウジング下流側の圧力とを調圧し、上記ウエス
トゲート弁作動用アクチュエータ20の圧力室に供給す
る。The wastegate valve controlling duty solenoid valve 21 is provided in a passage communicating between the resonator chamber 14 and the compressor housing downstream of the turbocharger 18 of the intake pipe 6, and the EC
The pressure on the resonator chamber 14 side and the pressure on the compressor housing downstream side are adjusted according to the duty ratio of the control signal output from U50, and the pressure is supplied to the pressure chamber of the waste gate valve operating actuator 20.
【0032】すなわち、上記ECU50によって上記ウ
エストゲート弁制御用デューティソレノイド弁21を制
御し、上記ウエストゲート弁作動用アクチュエータ20
を作動させて上記ウエストゲート弁19による排気ガス
リリーフを調整することにより、上記ターボチャージャ
18による過給圧を制御するようになっている。That is, the wastegate valve controlling duty solenoid valve 21 is controlled by the ECU 50, and the wastegate valve operating actuator 20 is controlled.
Is operated to adjust the exhaust gas relief by the waste gate valve 19, so that the supercharging pressure by the turbocharger 18 is controlled.
【0033】また、上記インテークマニホルド3に絶対
圧センサ22が通路23を介して連通され、この通路2
3に、上記絶対圧センサ22と上記インテークマニホル
ド3あるいは大気とを選択的に連通する吸気管圧力/大
気圧切換ソレノイド弁24が介装されている。An absolute pressure sensor 22 is connected to the intake manifold 3 through a passage 23, and the passage 2
3, an intake pipe pressure / atmospheric pressure switching solenoid valve 24 that selectively communicates the absolute pressure sensor 22 with the intake manifold 3 or the atmosphere is interposed.
【0034】さらに、上記インテークマニホルド3の各
気筒の各吸気ポート2aの直上流側にインジェクタ25
が臨まされ、また、上記シリンダヘッド2の各気筒毎
に、その先端を燃焼室に露呈する点火プラグ26aが取
付けられ、この点火プラグ26aに連設する点火コイル
26bにイグナイタ27が接続されている。Further, an injector 25 is provided immediately upstream of each intake port 2a of each cylinder of the intake manifold 3.
Further, an ignition plug 26a whose tip is exposed to the combustion chamber is attached to each of the cylinders of the cylinder head 2, and an igniter 27 is connected to an ignition coil 26b connected to the ignition plug 26a. .
【0035】上記インジェクタ25には、燃料タンク2
8内に設けたインタンク式の燃料ポンプ29から燃料フ
ィルタ30を経て燃料が圧送され、プレッシャレギュレ
ータ31にて調圧される。In the injector 25, the fuel tank 2
Fuel is pressure-fed from an in-tank type fuel pump 29 provided inside 8 through a fuel filter 30, and the pressure is regulated by a pressure regulator 31.
【0036】また、上記吸気管6の上記エアークリーナ
7の直下流に、ホットワイヤ式あるいはホットフィルム
式などの吸入空気量センサ32が介装され、上記スロッ
トルバルブ5aに、スロットル開度センサ33aとアイ
ドルスイッチ33bとを内蔵したスロットルセンサ33
が連設されている。An intake air amount sensor 32 of a hot wire type or a hot film type is provided immediately downstream of the air cleaner 7 of the intake pipe 6, and the throttle valve 5a is connected to a throttle opening sensor 33a. Throttle sensor 33 with built-in idle switch 33b
Are lined up.
【0037】さらに、上記エンジン1のシリンダブロッ
ク1aにノックセンサ34が取付けられるとともに、こ
のシリンダブロック1aの左右両バンクを連通する冷却
水通路35に冷却水温センサ36が臨まされ、上記排気
管10の上記エキゾーストマニホルド9の集合部にO2
センサ37が臨まされている。Further, a knock sensor 34 is attached to the cylinder block 1a of the engine 1, and a cooling water temperature sensor 36 is exposed to a cooling water passage 35 which connects the left and right banks of the cylinder block 1a. O2 at the collecting part of the above exhaust manifold 9
The sensor 37 is exposed.
【0038】また、上記シリンダブロック1aに支承さ
れたクランクシャフト1bにクランクロータ38が軸着
され、このクランクロータ38の外周に、電磁ピックア
ップなどからなるクランク角センサ39が対設されてい
る。さらに、上記エンジン1のカムシャフト1cに連設
するカムロータ40に、電磁ピックアップなどからなる
気筒判別用のカム角センサ41が対設されている。尚、
上記クランク角センサ39及び上記カム角センサ41
は、電磁ピックアップなどの磁気センサに限らず、光セ
ンサなどでも良い。A crank rotor 38 is rotatably mounted on a crank shaft 1b supported by the cylinder block 1a, and a crank angle sensor 39 including an electromagnetic pickup is provided on the outer periphery of the crank rotor 38. Further, a cam angle sensor 41 for discriminating a cylinder, which is composed of an electromagnetic pickup or the like, is provided opposite to a cam rotor 40 connected to the cam shaft 1c of the engine 1. still,
The crank angle sensor 39 and the cam angle sensor 41
Is not limited to a magnetic sensor such as an electromagnetic pickup, but may be an optical sensor.
【0039】上記クランクロータ38は、図16に示す
ように、その外周に突起38a,38b,38cが形成
され、これらの各突起38a,38b,38cが、各気
筒(#1,#2と#3,#4)の圧縮上死点前(BTD
C)θ1,θ2,θ3 の位置に形成されており、本実施例に
おいては、θ1 =97°CA、θ2 =65°CA、θ3
=10°CAである。As shown in FIG. 16, the crank rotor 38 has projections 38a, 38b and 38c formed on the outer periphery thereof, and the projections 38a, 38b and 38c are provided in the cylinders (# 1, # 2 and #). Before # 3, # 4 compression top dead center (BTD
C) It is formed at the positions of θ1, θ2, θ3, and in the present embodiment, θ1 = 97 ° CA, θ2 = 65 ° CA, θ3.
= 10 ° CA.
【0040】上記クランクロータ38の各突起は、上記
クランク角センサ39によって検出され、BTDC97
°,65°,10°のクランク角信号がエンジン1/2
回転毎(180°CA毎)に出力される。そして、各信
号の入力間隔時間がタイマによって計時され、エンジン
回転数が算出される。Each protrusion of the crank rotor 38 is detected by the crank angle sensor 39, and the BTDC 97
Crank angle signals of °, 65 °, and 10 ° are engine 1/2
It is output every rotation (every 180 ° CA). Then, the input interval time of each signal is counted by a timer, and the engine speed is calculated.
【0041】尚、突起38bは、点火時期設定の際の基
準クランク角となり、また、突起38cは、始動時噴射
開始時期の基準クランク角となるとともに始動時の固定
点火時期を示すクランク角となる。The protrusion 38b serves as a reference crank angle when setting the ignition timing, and the protrusion 38c serves as a reference crank angle for the injection start timing at the start and a crank angle indicating the fixed ignition timing at the start. .
【0042】また、図17に示すように、上記カムロー
タ40の外周には、気筒判別用の突起40a,40b,
40cが形成され、突起40aが#3,#4気筒の圧縮
上死点後(ATDC)θ4 の位置に形成され、突起40
bが3個の突起で構成されて最初の突起が#1気筒のA
TDCθ5 の位置に形成されている。さらに、突起40
cが2個の突起で形成され、最初の突起が#2気筒のA
TCDθ6 の位置に形成されている。本実施例において
は、θ4 =20°CA、θ5 =5°CA、θ6=20°
CAである。Further, as shown in FIG. 17, on the outer periphery of the cam rotor 40, there are projections 40a, 40b for cylinder discrimination,
40c is formed, and the protrusion 40a is formed at the position after compression top dead center (ATDC) θ4 of the # 3 and # 4 cylinders.
b is composed of three protrusions, and the first protrusion is A for cylinder # 1.
It is formed at the position of TDCθ5. Furthermore, the protrusion 40
c is formed by two protrusions, and the first protrusion is A for cylinder # 2.
It is formed at the position of TCDθ6. In this embodiment, θ4 = 20 ° CA, θ5 = 5 ° CA, θ6 = 20 °
It is CA.
【0043】そして、上記カムロータ40の各突起が上
記カム角センサ41によって検出され、各気筒の燃焼行
程順を#1→#3→#2→#4とした場合、この燃焼行
程順と、上記カム角センサ41の検出信号をカウンタに
よって計数した値とのパターンに基づいて、気筒判別が
なされる。When each projection of the cam rotor 40 is detected by the cam angle sensor 41 and the combustion stroke sequence of each cylinder is # 1 → # 3 → # 2 → # 4, this combustion stroke sequence and Cylinder discrimination is performed based on the pattern of the detection signal of the cam angle sensor 41 and the value counted by the counter.
【0044】一方、図18に示すように、ECU50
は、燃料噴射制御、点火時期制御などを行なうメインコ
ンピュータ51と、ノック検出処理を行なう専用のサブ
コンピュータ52との2つのコンピュータを中心として
構成され、各部に所定の安定化電源を供給する定電圧回
路53や各種の周辺回路が組込まれている。On the other hand, as shown in FIG.
Is mainly composed of two computers, a main computer 51 for performing fuel injection control, ignition timing control, and the like, and a dedicated sub computer 52 for performing knock detection processing. A constant voltage that supplies a predetermined stabilizing power source to each part. The circuit 53 and various peripheral circuits are incorporated.
【0045】上記定電圧回路53は、ECUリレー54
のリレー接点を介してバッテリ55に接続され、このバ
ッテリ55に、上記ECUリレー54のリレーコイルが
イグニッションスイッチ56を介して接続されている。
また、上記バッテリ55には、上記定電圧回路53が直
接接続され、さらに、燃料ポンプリレー57のリレー接
点を介して燃料ポンプ29が接続されている。The constant voltage circuit 53 includes an ECU relay 54.
The relay coil of the ECU relay 54 is connected to the battery 55 via an ignition switch 56.
Further, the constant voltage circuit 53 is directly connected to the battery 55, and further, the fuel pump 29 is connected via a relay contact of a fuel pump relay 57.
【0046】すなわち、上記定電圧回路53は、上記イ
グニッションスイッチ56がONされ、上記ECUリレ
ー54のリレー接点が閉となったとき、制御用電源を供
給し、また、上記イグニッションスイッチ56がOFF
されたとき、バックアップ用の電源を供給する。That is, the constant voltage circuit 53 supplies control power when the ignition switch 56 is turned on and the relay contact of the ECU relay 54 is closed, and the ignition switch 56 is turned off.
Supply the power for backup when
【0047】上記メインコンピュータ51は、CPU5
8(以下、メインCPU58と称する)、ROM59、
RAM60、上記イグニッションスイッチ56がOFF
されたときにも上記定電圧回路53からバックアップ電
源が供給されてデータを保持するバックアップRAM6
1、カウンタ・タイマ群62、シリアル通信インターフ
ェースであるSCI63、及び、I/Oインターフェー
ス64がバスライン65を介して接続されたマイクロコ
ンピュータである。The main computer 51 has a CPU 5
8 (hereinafter, referred to as main CPU 58), ROM 59,
RAM 60, the ignition switch 56 is OFF
Backup RAM 6 which holds data by being supplied with backup power from the constant voltage circuit 53 even when
1, a counter / timer group 62, a serial communication interface SCI 63, and an I / O interface 64 are connected to each other via a bus line 65.
【0048】尚、上記カウンタ・タイマ群62は、フリ
ーランカウンタ、カム角センサ(以下、適宜、カムセン
と略記する)信号の入力計数用カムセンカウンタなどの
各種カウンタ、燃料噴射タイマ、点火タイマ、後述する
0.5ms毎の定期割込みを発生させるための定期割込
みタイマ、クランク角センサ(以下、適宜、クラセンと
略記する)信号の入力間隔計時用クラセンタイマ、及
び、システム異常監視用のウオッチドッグタイマなどの
各種タイマを便宜上総称するものであり、上記メインコ
ンピュータ51においては、その他、各種のソフトウエ
アカウンタ・タイマが用いられる。The counter / timer group 62 includes various counters such as a free-run counter, a cam angle sensor (hereinafter, abbreviated as "CamSens") signal counting counter, a fuel injection timer, an ignition timer, and the like. A periodic interrupt timer for generating a periodic interrupt every 0.5 ms described later, a crank angle timer for inputting a crank angle sensor (hereinafter, abbreviated as "clasen") signal interval, and a watchdog timer for system abnormality monitoring For the sake of convenience, the various types of timers such as the above are collectively referred to, and various other software counters and timers are used in the main computer 51.
【0049】また、上記サブコンピュータ52も、上記
メインコンピュータ51と同様、CPU71(以下、サ
ブCPU71と称する)、ROM72、RAM73、カ
ウンタ・タイマ群74、SCI75、及び、I/Oイン
ターフェース76がバスライン77を介して接続された
マイクロコンピュータであり、上記メインコンピュータ
51とサブコンピュータ52とは、上記SCI63,7
5を介してシリアル通信ラインにより互いに接続されて
いる。In the sub computer 52, the CPU 71 (hereinafter referred to as the sub CPU 71), the ROM 72, the RAM 73, the counter / timer group 74, the SCI 75, and the I / O interface 76 are also connected to the bus line similarly to the main computer 51. The microcomputer is a microcomputer connected via 77, and the main computer 51 and the sub computer 52 are the SCI 63, 7
They are connected to each other via a serial communication line via 5.
【0050】上記メインコンピュータ51のI/Oイン
ターフェース64には、入力ポートに、吸入空気量セン
サ32、スロットル開度センサ33a、水温センサ3
6、O2 センサ37、絶対圧センサ22、車速センサ4
2、及び、バッテリ55が、8チャンネル入力のA/D
変換器66を介して接続されるとともに、アイドルスイ
ッチ33b、クランク角センサ39、カム角センサ41
が接続されており、さらに、始動状態を検出するために
スタータスイッチ43が接続されている。The I / O interface 64 of the main computer 51 has an intake port, an intake air amount sensor 32, a throttle opening sensor 33a, and a water temperature sensor 3 at its input ports.
6, O2 sensor 37, absolute pressure sensor 22, vehicle speed sensor 4
2 and battery 55 are A / D of 8 channel input
The idle switch 33b, the crank angle sensor 39, and the cam angle sensor 41 are connected together via the converter 66.
Is connected, and further, a starter switch 43 is connected to detect the starting state.
【0051】尚、本実施例においては、上記A/D変換
器66は、7チャンネル分の入力が使用され、残りの1
チャンネルは予備となっている。In this embodiment, the A / D converter 66 uses inputs for 7 channels, and the remaining 1
The channel is reserved.
【0052】また、上記I/Oインターフェース64の
出力ポートには、イグナイタ27が接続され、さらに、
駆動回路67を介して、ISCV16、インジェクタ2
5、燃料ポンプリレー57のリレーコイル、および、ウ
エストゲート弁制御用デューティソレノイド弁21、吸
気管圧力/大気圧切換ソレノイド弁24が接続されてい
る。An igniter 27 is connected to the output port of the I / O interface 64, and further,
Through the drive circuit 67, the ISCV16, the injector 2
5, the relay coil of the fuel pump relay 57, the waste solenoid valve controlling duty solenoid valve 21, and the intake pipe pressure / atmospheric pressure switching solenoid valve 24 are connected.
【0053】一方、上記サブコンピュータ52のI/O
インターフェース76は、入力ポートに、クランク角セ
ンサ39、カム角センサ41が接続されるとともに、A
/D変換器78、周波数フィルタ79、アンプ80を介
してノックセンサ34が接続されており、上記ノックセ
ンサ34からのノック検出信号が上記アンプ80で所定
のレベルに増幅された後に上記周波数フィルタ79によ
り必要な周波数成分が抽出され、上記A/D変換器78
にてデジタル信号に変換されて入力されるようになって
いる。On the other hand, the I / O of the sub computer 52
The interface 76 has an input port to which the crank angle sensor 39 and the cam angle sensor 41 are connected, and
The knock sensor 34 is connected via the D / D converter 78, the frequency filter 79, and the amplifier 80. The knock detection signal from the knock sensor 34 is amplified to a predetermined level by the amplifier 80, and then the frequency filter 79. The necessary frequency components are extracted by the A / D converter 78.
At, it is converted into a digital signal and input.
【0054】上記メインコンピュータ51では、各セン
サ類からの検出信号を処理し、燃料噴射パルス幅、点火
時期などを演算する。すなわち、吸入空気量センサ32
の出力信号から吸入空気量を算出し、RAM60及びバ
ックアップRAM61に記憶されている各種データに基
づき、吸入空気量に見合った燃料噴射量を演算し、ま
た、点火時期などを算出する。The main computer 51 processes the detection signals from the respective sensors and calculates the fuel injection pulse width, ignition timing and the like. That is, the intake air amount sensor 32
The intake air amount is calculated from the output signal, and the fuel injection amount corresponding to the intake air amount is calculated based on various data stored in the RAM 60 and the backup RAM 61, and the ignition timing and the like are calculated.
【0055】そして、上記燃料噴射量に相応する駆動パ
ルス幅信号を、駆動回路67を介して所定のタイミング
で該当気筒のインジェクタ25に出力して燃料を噴射
し、また、所定のタイミングでイグナイタ27に点火信
号を出力し、該当気筒の点火プラグ26aを点火する。Then, a drive pulse width signal corresponding to the fuel injection amount is output to the injector 25 of the corresponding cylinder at a predetermined timing through the drive circuit 67 to inject fuel, and at the predetermined timing, the igniter 27 is also used. To the ignition plug 26a of the corresponding cylinder.
【0056】その結果、該当気筒に供給された混合気が
爆発燃焼し、エキゾーストマニホルド9の集合部に臨ま
されたO2 センサ37により排気ガス中の酸素濃度が検
出され、この検出信号が波形整形された後、上記メイン
CPU58で基準電圧(スライスレベル)と比較され、
エンジンの空燃比状態が目標空燃比に対し、リッチ側に
あるか、リーン側にあるかが判別され、空燃比が目標空
燃比となるようフィードバック制御される。As a result, the air-fuel mixture supplied to the corresponding cylinder explodes and burns, the oxygen concentration in the exhaust gas is detected by the O 2 sensor 37 facing the collecting portion of the exhaust manifold 9, and the waveform of this detection signal is shaped. After that, the main CPU 58 compares the reference voltage (slice level) with
It is determined whether the engine air-fuel ratio state is on the rich side or lean side with respect to the target air-fuel ratio, and feedback control is performed so that the air-fuel ratio becomes the target air-fuel ratio.
【0057】一方、上記サブコンピュータ52では、エ
ンジン回転数とエンジン負荷とに基づいてノックセンサ
34からの信号のサンプル区間を設定し、このサンプル
区間でノックセンサ34からの信号を高速にA/D変換
して振動波形を忠実にデジタルデータに変換し、ノック
発生の有無を判定する。On the other hand, in the sub-computer 52, a sample section of the signal from the knock sensor 34 is set based on the engine speed and the engine load, and the signal from the knock sensor 34 is A / D at high speed in this sample section. Then, the vibration waveform is faithfully converted into digital data to determine whether knock has occurred.
【0058】上記サブコンピュータ52のI/Oインタ
ーフェース76の出力ポートは、上記メインコンピュー
タ51のI/Oインターフェース64の入力ポートに接
続されており、上記サブコンピュータ52でのノック判
定結果がI/Oインターフェース76に出力される。そ
して、上記メインコンピュータ51では、上記サブコン
ピュータ52からノック発生有りの判定結果が出力され
ると、SCI63を介してシリアル通信ラインよりノッ
クデータを読込み、このノックデータに基づいて直ちに
該当気筒の点火時期を遅らせ、ノックを回避する。The output port of the I / O interface 76 of the sub computer 52 is connected to the input port of the I / O interface 64 of the main computer 51, and the knock determination result of the sub computer 52 is I / O. It is output to the interface 76. Then, in the main computer 51, when the sub computer 52 outputs a determination result indicating that knock has occurred, the knock data is read from the serial communication line via the SCI 63, and the ignition timing of the corresponding cylinder is immediately read based on the knock data. Delay and avoid knocks.
【0059】このようなエンジン制御において、上記メ
インコンピュータ51では、各センサ類からの信号入力
処理、エンジン回転数算出、吸入空気量算出、燃料噴射
量算出、点火時期算出といった各項目毎の各種プログラ
ムが、一つのOSの管理下で効率的に実行される。この
OSは、車輌制御のための各種マネジメント機能、及
び、このマネジメント機能に密着した内部ストラテジー
を有し、各種ジョブを体系的に結合する。In such engine control, in the main computer 51, various programs for each item such as signal input processing from each sensor, engine speed calculation, intake air amount calculation, fuel injection amount calculation, ignition timing calculation, etc. Is efficiently executed under the control of one OS. This OS has various management functions for vehicle control and an internal strategy closely related to this management function, and systematically combines various jobs.
【0060】上記OSのマネジメント機能としては、
(1-1)ジョブの優先処理
(1ー2)セクション定義による各ジョブの分割ファイル対
応
(1-3)スタックの使用状況モニタ機能
(1-4)異常割込み動作のモニタ機能
(1-5)ジョブ毎に固有の制約を作らない標準マップ・標
準ワークメモリ設定
などの機能があり、制御ストラテジーの開発環境を向上
させるとともに、限られたCPU能力を最大限に発揮さ
せ、デジタル制御理論の基本である等時間間隔処理を可
能な限り達成することができる。As the management function of the above OS, (1-1) job priority processing (1-2) divided file support for each job according to section definition (1-3) stack usage status monitoring function (1-4) Abnormal interrupt operation monitor function (1-5) Functions such as standard map and standard work memory settings that do not create unique restrictions for each job improve the control strategy development environment and maximize the limited CPU capacity. The same time interval processing which is the basis of digital control theory can be achieved as much as possible.
【0061】等時間間隔処理としては、0.5ms毎の
定期割込みを基本として、2,4,10,50,250
ms毎の5種類の等間隔割込みジョブが用意されてお
り、また、エンジン回転に同期した処理として、クラン
ク角信号入力により即割込み実行される高優先クラセン
ジョブ(以下、単にクラセンジョブと称する)と、より
優先順位が高い他のジョブがないときにクランク角信号
入力により割込み実行される比較的緊急度の低い低優先
クラセンジョブとが用意されている。The equal time interval processing is based on a periodic interrupt every 0.5 ms and is 2, 4, 10, 50, 250.
Five types of equally interrupted jobs for every ms are prepared, and a high-priority class job (hereinafter simply referred to as classen job) that is immediately interrupted by crank angle signal input as processing synchronized with engine rotation. , A relatively low-urgency low-priority job that is interrupted by a crank angle signal input when there is no other job with a higher priority.
【0062】これらの各ジョブには、クラセンジョブ>
2msジョブ>4msジョブ>10msジョブ>低優先
クラセンジョブ>50msジョブ>250msジョブの
順で、7〜1の優先レベルが高位側から低位側に向かっ
て付けられており、図9に示すように、高速ジョブに対
し低速ジョブが分割して処理されるとともに、各ジョブ
の多重待ち処理が行なわれる。Each of these jobs includes a Krasen job>
The priority levels of 7 to 1 are assigned from the higher side to the lower side in the order of 2 ms job> 4 ms job> 10 ms job> low priority class job> 50 ms job> 250 ms job, and as shown in FIG. The low-speed job is divided into the high-speed job and processed, and the multiplex waiting process of each job is performed.
【0063】また、上記OSの下で働く各プログラム
は、機能別の領域毎に順番に配列されており、各機能毎
にセクション宣言によって名前が付けられている。上記
OS下で働く数々のストラテジーファイル(ユーザー側
ファイル)は、各機能毎にOSと同じ名前のセクション
宣言を用いることにより、開発段階において、例えば、
初期値設定処理、10ms毎の処理、バックグランド処
理等を別々のファイルに記述しても、各フィルがリンク
されたとき、同じ処理は連続した1つの領域に集めら
れ、OSと融合し一体となって動作する。The programs operating under the OS are arranged in order for each function-specific area, and each function is named by a section declaration. Many strategy files (files on the user side) that work under the above OS use a section declaration with the same name as the OS for each function, so that at the development stage, for example,
Even if the initial value setting process, the process for every 10 ms, the background process, etc. are described in separate files, when each file is linked, the same process is collected in one continuous area and integrated with the OS. Works.
【0064】各ストラテジーファイル側で使用する主な
セクション領域は、
○変数宣言領域
○自己ファイル名、ファイル制作時の自動記録領域
○セッティングデータ領域
○クラセンジョブ領域
○2msジョブ領域
○4msジョブ領域
○10msジョブ領域
○低優先クラセンジョブ領域
○50msジョブ領域
○250msジョブ領域
○リセット時初期化ジョブ領域
○エンスト時初期化ジョブ領域
○バックグランドジョブ領域
○プログラム本体の領域
であり、機能毎にファイルを分割してプログラム開発が
可能になるとともに、プログラムの構造化記述を可能に
する。The main section areas used on each strategy file side are: ○ variable declaration area ○ self file name, automatic recording area during file creation ○ setting data area ○ class job area ○ 2ms job area ○ 4ms job area ○ 10ms Job area ○ Low priority class job area ○ 50ms job area ○ 250ms job area ○ Reset initialization job area ○ Engine stall initialization job area ○ Background job area ○ Program area, which divides the file for each function It enables program development and structured description of programs.
【0065】また、上記OSには、以上のマネジメント
機能に密着した内部ストラテジーとして、
(2-1)A/D変換処理
(2-2)クランク位置に係る各種情報の算出
(2-3)デバッグ用シュミレーション機能(エンジン回転
及びA/D変換)
(2-4)点火タイマのセット
(2-5)燃料噴射タイマのセット
などの機能を備えており、さらに、これらの機能に係る
各種サービスルーチンが各ジョブ中に用意されている。In addition, the above-mentioned OS has (2-1) A / D conversion processing (2-2) calculation of various information related to crank position (2-3) debug as an internal strategy closely related to the above management function. Simulation function (engine rotation and A / D conversion) (2-4) Ignition timer set (2-5) Fuel injection timer set and other functions are provided. Furthermore, various service routines related to these functions are provided. It is prepared in each job.
【0066】従来、このような機能は各ジョブレベルで
達成するようになっていたが、本システムにおいては、
すべてOS側に用意され、OS側で処理したA/D変換
結果、クランク位置情報、エンジン回転数などに基づい
て、ユーザー側の各ジョブで、燃料噴射量、点火時期な
どを設定すると、これらの指示値がOSによって燃料噴
射タイマ、点火タイマにセットされるようになってい
る。Conventionally, such a function has been achieved at each job level, but in this system,
If the fuel injection amount, ignition timing, etc. are set for each job on the user side based on the A / D conversion result processed by the OS side, crank position information, engine speed, etc. The instruction value is set by the OS in the fuel injection timer and the ignition timer.
【0067】次に、上記メインコンピュータ51におけ
るOSの各種機能のうち、本願のジョブ優先処理に係る
機能を、図1〜図8のフローチャートに基づいて説明す
る。尚、サブコンピュータ52はノック検出処理専用の
コンピュータであるため、その動作説明を省略する。Next, among the various functions of the OS in the main computer 51, the functions related to the job priority processing of the present application will be described based on the flowcharts of FIGS. Since the sub computer 52 is a computer dedicated to knock detection processing, its operation description is omitted.
【0068】まず、イグニッションスイッチ56がON
されてシステムに電源が投入されると、リセットに伴う
リセット割込みが起動し、各種イニシャライズが行なわ
れるとともに、0.5ms毎に定期割込みを起動するた
めの定期割込みタイマが起動され、クランク角センサ3
9からの信号入力毎(BTDC97°,65°,10°
CA毎のエンジン1回転に6回)に起動されるクラセン
割込みが許可され、その後、バックグランドジョブの実
行状態となる。First, the ignition switch 56 is turned on.
When the system is powered on, a reset interrupt associated with the reset is activated, various initializations are performed, and a periodic interrupt timer for activating the periodic interrupt is activated every 0.5 ms.
Each signal input from 9 (BTDC 97 °, 65 °, 10 °
The classen interrupt that is activated every six engine revolutions per CA) is permitted, and then the background job is executed.
【0069】そして、このバックグランドジョブの上
で、0.5ms毎の定期割込みと、エンジン1回転に6
回のクラセン割込みとにより、7レベルのジョブが優先
処理される。この2つの割込みにおいては、各自の処理
を実行後、共通のアドレスにジャンプし、ジョブ優先処
理を実行する。Then, on this background job, a periodic interrupt every 0.5 ms and 6 times per engine revolution.
A job of the 7th level is preferentially processed by the number of classen interrupts. In these two interrupts, after executing their own processing, they jump to a common address and execute job priority processing.
【0070】尚、上記リセット割込みは、内部演算にお
いて0による除算を実行した場合や、無限ループが発生
した場合など、正常時には発生しない要因によっても、
起動される。The reset interrupt may be caused by factors that do not normally occur, such as when division by 0 is executed in an internal operation or when an infinite loop occurs.
Is activated.
【0071】まず、図2に示す0.5ms毎の定期割込
みについて説明する。この定期割込みでは、ステップS1
00で、OS用ワークエリアを設定し、ステップS101で、
ウオッチドッグタイマを初期化すると、ステップS102へ
進んで、P−RUNフラグを20回に1回すなわち10
ms毎に反転する。このP−RUNフラグは、図示しな
い保護回路によってシステムが自動的にリセットされな
いようにするためのフラグであり、システムが正常に動
作して一定時間毎(10ms毎)に反転される限り、上
記保護回路の作動が阻止される。First, the periodic interrupt every 0.5 ms shown in FIG. 2 will be described. In this periodic interrupt, step S1
At 00, set the OS work area, and at step S101,
When the watchdog timer is initialized, the process proceeds to step S102, and the P-RUN flag is set once every 20 times, that is, 10 times.
Invert every ms. The P-RUN flag is a flag for preventing the system from being automatically reset by a protection circuit (not shown), and is protected as long as the system operates normally and is inverted at regular time intervals (every 10 ms). The operation of the circuit is blocked.
【0072】次いで、ステップS103へ進み、スイッチ出
力の転写を行なう。このスイッチ出力は、各ジョブ中で
メモリに書き込んだビットのON,OFF値であり、各
ジョブからは直接I/Oインターフェース64の出力ポ
ートに出力せず、OS側で0.5ms毎にメモリの値を
出力ポートに転写する。Next, in step S103, the switch output is transferred. This switch output is the ON / OFF value of the bit written in the memory in each job. It is not directly output from the output port of the I / O interface 64 from each job, but the OS outputs the memory every 0.5 ms. Transfer the value to the output port.
【0073】次に、ステップS104へ進むと、A/D変換
サブルーチンを実行してA/D変換に係る各種設定を行
ない、ステップS105で、図4に示すジョブフラグ作成サ
ブルーチンを実行して、2,4,10,50,250m
s毎の各ジョブ割込み要求を示すジョブフラグJB_F
LGを作成した後、ステップS106で、A/D変換をスタ
ートする。Next, in step S104, the A / D conversion subroutine is executed to make various settings related to the A / D conversion, and in step S105, the job flag creation subroutine shown in FIG. , 4, 10, 50, 250m
Job flag JB_F indicating each job interrupt request for each s
After creating LG, in step S106, A / D conversion is started.
【0074】上記A/D変換は、基本的に、A/D変換
器66の8チャンネル入力が0.5ms毎に所定の変換
順番毎に処理され、4ms周期で全入力の変換が行なわ
れる。但し、特定の1つのチャンネルは、回転脈動が発
生する吸入管圧力などをA/D変換するためクランク角
90°毎に(0.5msの時間精度で)同期し、変換順
番に対して割込んだ形で処理が行なわれ、その後の入力
の順番を1つ遅れにする。In the A / D conversion, basically, the 8-channel input of the A / D converter 66 is processed every 0.5 ms in a predetermined conversion order, and all the inputs are converted in a cycle of 4 ms. However, one specific channel is synchronized at every crank angle of 90 ° (with time accuracy of 0.5 ms) for A / D conversion of suction pipe pressure that causes rotational pulsation, and interrupts the conversion order. The processing is performed in a dull shape, and the order of subsequent inputs is delayed by one.
【0075】尚、エンジン回転数3750rpm以上で
は、A/D変換の最後の順番の入力が完全に停止し、7
500rpm以上では、最後から2番目の入力も停止す
るが、A/D変換の順番は、スロットル開度、吸入空気
量など変化の速いものを先として、冷却水温、電圧など
比較的変化の遅いものが後になるように設定してあり、
且つ、最後のA/D変換順番をクランク同期入力に設定
してあるため、特に支障は生じない。When the engine speed is 3750 rpm or more, the last input of A / D conversion is completely stopped, and
At 500 rpm or more, the penultimate input is also stopped, but the order of A / D conversion is that the throttle opening, intake air amount, etc. that have a fast change, and the cooling water temperature, voltage, etc., that have a relatively slow change. Is set so that
Moreover, since the last A / D conversion order is set to the crank synchronization input, no particular trouble occurs.
【0076】また、図10に示すように、上記ジョブフ
ラグJB_FLGは、1バイト変数の各ビットを各ジョ
ブに対応するフラグとして割当てたものであり、複数の
ジョブ要求が同時に可能なようになっている。この1バ
イト変数のビット1〜ビット7は優先レベル1〜7に対
応し、それぞれ、250msジョブ、50msジョブ、
低優先クラセンジョブ、10msジョブ、4msジョ
ブ、2msジョブ、クラセンジョブのフラグに割当てら
れている。そして、所定のビットが立てられたとき、対
応する優先レベルのジョブ割込み要求がなされる。尚、
ビット0はバックグランドジョブのフラグに割当てられ
て通常は参照されない。Further, as shown in FIG. 10, the job flag JB_FLG is one in which each bit of the 1-byte variable is assigned as a flag corresponding to each job, and a plurality of job requests can be made simultaneously. There is. Bits 1 to 7 of this 1-byte variable correspond to priority levels 1 to 7, and are respectively 250 ms job, 50 ms job,
It is assigned to flags of low priority class job, 10 ms job, 4 ms job, 2 ms job, and class job. Then, when a predetermined bit is set, a job interruption request of a corresponding priority level is made. still,
Bit 0 is assigned to the flag of the background job and is not normally referred to.
【0077】上記ジョブフラグJB_FLGは、基本的
に、2,4,10,50,250msの各ジョブに対応
するビットが立てられた1バイトの各データと、ゼロデ
ータとをテーブルに配置し、ジョブフラグ作成ルーチン
実行毎、すなわち基本時間である0.5ms毎に、テー
ブルの位置を指定するポインタをインクリメントしてテ
ーブル参照を行なうことにより作成されるようになって
いる。これにより、各定期ジョブの時間間隔を変更する
場合にも、ジョブフラグ作成ルーチン自体のアルゴリズ
ムを変更することなく、テーブル内のデータ変更により
柔軟に対応可能となっている。The job flag JB_FLG basically arranges 1-byte data in which bits corresponding to respective jobs of 2, 4, 10, 50, and 250 ms are set and zero data in a table, and It is created by incrementing the pointer designating the position of the table and referring to the table every time the flag creating routine is executed, that is, every 0.5 ms which is the basic time. As a result, even when the time interval of each regular job is changed, the data in the table can be flexibly dealt with without changing the algorithm of the job flag creation routine itself.
【0078】この際、上記ジョブフラグ作成サブルーチ
ンでは、2,4,10msジョブまでのフラグ作成のた
めの第1のテーブルとしてのジョブフラグテーブルJB
F_Nと、50,250msジョブのフラグ作成のため
の第2のテーブルとしてのジョブフラグテーブルJBF
_Mとの2つのテーブルを用意し、メモリの節約と処理
の高速化を図っている。以下、その手順を図4のフロー
チャートに従って説明する。At this time, in the job flag creation subroutine, the job flag table JB as the first table for creating flags up to 2, 4, and 10 ms jobs
F_N and job flag table JBF as a second table for creating flags for 50,250 ms jobs
Two tables, _M, are prepared to save memory and speed up processing. The procedure will be described below with reference to the flowchart of FIG.
【0079】まず、ステップS400では、ジョブフラグテ
ーブルJBF_N用のポインタJBF_Iを1増やして
40の剰余とし、このジョブフラグ作成サブルーチン実
行毎にポインタJBF_Iを、1,2,…,39,0,
1,2,…とセットすることにより、20ms(=0.
5ms×40)の周期を発生する。次いで、ステップS4
01へ進み、ポインタJBF_Iによって指定されるジョ
ブフラグテーブルJBF_Nの内容JBF_N[JBF
_I]を、ジョブフラグJB_FLGにセットする。First, in step S400, the pointer JBF_I for the job flag table JBF_N is incremented by 1 to make a remainder of 40, and the pointer JBF_I is set to 1, 2, ..., 39, 0, every execution of this job flag creation subroutine.
By setting 1, 2, ..., 20 ms (= 0.
A cycle of 5 ms × 40) is generated. Then, step S4
The processing proceeds to 01 and the contents of the job flag table JBF_N designated by the pointer JBF_I, JBF_N [JBF
_I] is set in the job flag JB_FLG.
【0080】上記ジョブフラグテーブルJBF_Nは、
20ms分の周期に対応する40バイトのテーブルであ
り、図11(a)に示すように、40バイトのデータ列
内に、2msジョブのフラグ(ビット)が立てられた1
バイトデータJBT02が4回に1回、4msジョブの
フラグが立てられた1バイトデータJBT04が8回に
1回、10msジョブのフラグが立てられた1バイトデ
ータJBT10が20回に1回出現するように配置さ
れ、その他はゼロデータとなっている。The job flag table JBF_N is
It is a 40-byte table corresponding to a cycle of 20 ms. As shown in FIG. 11A, a 1-ms flag of 2 ms job is set in a 40-byte data string.
Byte data JBT02 appears once every four times, 1-byte data JBT04 flagged for a 4ms job appears once every eight times, and 1-byte data JBT10 flagged for a 10ms job appears once every twenty times. It is placed in, and the others are zero data.
【0081】従って、0.5ms×4毎、0.5ms×
8毎、0.5ms×20毎に、ポインタJBF_Iによ
って指定されるテーブル内の各データJBT02,JB
T04,JBT10がジョブフラグJB_FLGにセッ
トされ、基本時間(0.5ms)の整数倍である2,
4,10ms毎に、各ジョブのフラグが立てられたジョ
ブフラグJB_FLGが作成されるのである。Therefore, every 0.5 ms × 4, 0.5 ms ×
8 every 0.5 ms × 20, each data JBT02, JB in the table designated by the pointer JBF_I
T04 and JBT10 are set in the job flag JB_FLG and are integer multiples of the basic time (0.5 ms).
The job flag JB_FLG in which the flag of each job is set is created every 4 and 10 ms.
【0082】その後、ステップS402へ進み、10msジ
ョブのフラグがあるか否かを調べ、10msジョブまで
のフラグ作成が終了してるか否かを判別する。そして、
10msジョブのフラグがなく、未だ10msジョブま
でのフラグ作成が終了していないときには、ルーチンを
抜けて定期割込みに戻り、10msジョブのフラグがあ
るときには、50ms以上のジョブに対するフラグを作
成するため、ステップS403へ進む。After that, the process proceeds to step S402, and it is checked whether or not there is a flag for the 10 ms job, and it is determined whether or not the flag creation up to the 10 ms job is completed. And
If there is no flag for the 10 ms job and the flag creation up to the 10 ms job is not completed yet, the routine exits and the routine returns to the regular interrupt, and if the flag for the 10 ms job exists, the flag for the job of 50 ms or more is created. Proceed to S403.
【0083】ステップS403では、ジョブフラグテーブル
JBF_M用のポインタJBF_Xを1増やして25の
剰余とし、ポインタJBF_Xを1,2,…,24,
0,1,2,…とセットし、250ms(=10ms×
25)の周期を発生する。そして、ステップS404で、ポ
インタJBF_Xによって指定されるジョブフラグテー
ブルJBF_Mの内容JBF_M[JBF_X]をジョ
ブフラグJB_FLGにセットし、定期割込みに戻る。In step S403, the pointer JBF_X for the job flag table JBF_M is incremented by 1 to obtain a remainder of 25, and the pointer JBF_X is set to 1, 2, ..., 24 ,.
Set 0, 1, 2, ..., 250ms (= 10ms x
25) is generated. Then, in step S404, the content JBF_M [JBF_X] of the job flag table JBF_M designated by the pointer JBF_X is set to the job flag JB_FLG, and the routine interrupt is returned.
【0084】上記ジョブフラグテーブルJBF_Mは、
第2の基本時間としての10ms単位で250ms分の
周期に対応する25バイトのサブテーブルであり、図1
1(b)に示すように、25バイトのデータ列内に、5
0msジョブのフラグが立てられた1バイトデータJB
T50が5個毎の間隔で、250msジョブのフラグが
立てられた1バイトデータJBTQRが25回に1回出
現するように配置され、その他はゼロデータとなってい
る。The job flag table JBF_M is
It is a 25-byte sub-table corresponding to a cycle of 250 ms in units of 10 ms as the second basic time.
As shown in 1 (b), 5 bytes are stored in a 25-byte data string.
1-byte data JB with 0ms job flag set
T50 is arranged at intervals of 5, and 1-byte data JBTQR flagged for a 250 ms job is arranged to appear once every 25 times, and the others are zero data.
【0085】従って、前述のジョブフラグテーブルJB
F_Nの場合と同様にして、ポインタJBF_Xによっ
て指定されるテーブル内の各データJBT50,JBT
QRは、それぞれ、10ms×5,10ms×25毎に
ジョブフラグJB_FLGにセットされることになり、
第2の基本時間(10ms)の整数倍である50,25
0ms毎に、各ジョブのフラグが立てられたジョブフラ
グJB_FLGが作成される。Therefore, the above-mentioned job flag table JB
Similar to the case of F_N, each data JBT50, JBT in the table designated by the pointer JBF_X
QR will be set in the job flag JB_FLG every 10 ms × 5, 10 ms × 25,
50,25 which is an integer multiple of the second basic time (10 ms)
A job flag JB_FLG in which a flag for each job is set is created every 0 ms.
【0086】通常、このような処理を1つのテーブルで
行なおうとすると、250msジョブまでのフラグを作
成するためには、500バイト(0.5ms×500=
250ms)の領域を必要とするが、このジョブフラグ
作成ルーチンにおいては、2つのジョブフラグテーブル
JBF_N,JBF_Mは、計65バイトの容量で済
み、メモリを大幅に節約することができるばかりでなく
高速にフラグを作成することができる。Usually, if such a process is performed with one table, 500 bytes (0.5 ms × 500 = 0.5 ms × 500 = 0.5 ms) are required to create a flag for a 250 ms job.
250 ms) area is required, but in this job flag creation routine, the two job flag tables JBF_N and JBF_M have a total capacity of 65 bytes, which not only saves a large amount of memory but also speeds up. Flags can be created.
【0087】そして、上記ステップS105でジョブフラグ
作成サブルーチンによりジョブフラグJB_FLGを作
成し、ステップS106でA/D変換をスタートした後は、
ステップS107へ進み、ジョブフラグJB_FLGのいず
れかのジョブに対応するビットが立っているか否かを調
べる。After the job flag JB_FLG is created by the job flag creation subroutine in step S105 and A / D conversion is started in step S106,
In step S107, it is checked whether or not the bit corresponding to any job of the job flag JB_FLG is set.
【0088】その結果、上記ステップS107で、ジョブフ
ラグJB_FLGのビットが一つも立っていないときに
は、どのジョブからも要求がないため割込みを終了し、
ジョブフラグJB_FLGのいずれかのビットが立って
いるときには、ステップS108へ進んで、現状レベル(こ
の定期割込みが実行される時点で所定の優先レベルのジ
ョブが実行されていた状態)以下のフラグがないか否か
を調べる。As a result, at step S107, when no bit is set in the job flag JB_FLG, there is no request from any job, and the interrupt is ended.
If any bit of the job flag JB_FLG is set, the process proceeds to step S108, and there is no flag equal to or lower than the current level (a state in which a job of a predetermined priority level is being executed at the time when this periodic interrupt is executed). Check whether or not.
【0089】上記ステップS108で、現状レベル以下のフ
ラグがないときには、ラベルWAR_JBで示される図
1のジョブ優先処理にジャンプし、現状レベル以下のフ
ラグがあるときには、ステップS109で、現状レベル以下
のレベルのオーバーラップカウンタOLCを1増加させ
る。If there is no flag below the current level in step S108, the process jumps to the job priority process shown in label WAR_JB in FIG. 1, and if there is a flag below the current level, in step S109 the level below the current level is reached. The overlap counter OLC of is increased by one.
【0090】上記オーバーラップカウンタOLCは、ジ
ョブ要求を記憶するためのカウンタであり、各優先レベ
ル毎に1バイト割当てられ、上記ジョブフラグJB_F
LGによるジョブ要求時にインクリメント、ジョブ終了
時にデクリメントされる。すなわち、カウンタによって
ジョブ要求を記憶することによりジョブの多重要求に対
応することができるのである。The overlap counter OLC is a counter for storing a job request, 1 byte is allocated to each priority level, and the job flag JB_F is set.
It is incremented when a job is requested by LG and decremented when the job is completed. That is, by storing the job request by the counter, it is possible to deal with the multiple job request.
【0091】次いで、上記ステップS109からステップS1
10へ進み、現状レベルより高いフラグがないか否かを調
べ、現状レベルより高いフラグがないときには、ルーチ
ンを抜けて割込みを終了し、現状レベルより高いフラグ
があるときには、ラベルWAR_JBのジョブ優先処理
へジャンプする。Then, the above steps S109 to S1
Go to step 10 to check whether there is a flag higher than the current level. If there is no flag higher than the current level, exit the routine and end the interrupt. If there is a flag higher than the current level, the job priority process of label WAR_JB is executed. Jump to.
【0092】一方、この0.5ms毎の定期割込みに対
し、図3のクラセン割込みでは、ステップS200で、OS
用ワークエリアを設定すると、ステップS201で、クラン
ク位置・半回転時間算出のサブルーチンを実行し、現在
のクランク位置を判別するためのクランク位置変数、及
び、最新の3つのクラセン間隔の和である半回転時間を
算出する。On the other hand, in contrast to the periodic interrupt every 0.5 ms, the classen interrupt of FIG.
When the work area for use is set, in step S201, the crank position / half rotation time calculation subroutine is executed, and the crank position variable for determining the current crank position and the half of the latest three Classen intervals are calculated. Calculate the rotation time.
【0093】上記クランク位置変数は、OS中で用意さ
れるシステム変数であり、図12に示すように、#1〜
#4気筒に対するクランク位置を、97°,65°,1
0°CAによって12の状態に区分し、現在のクランク
位置を表わす。The above crank position variables are system variables prepared in the OS, and as shown in FIG.
Crank position for # 4 cylinder is 97 °, 65 °, 1
It is divided into 12 states by 0 ° CA and represents the current crank position.
【0094】すなわち、各気筒毎に、0,1,2の数値
でクラセン入力順を示すクラセン順序S_CCAS、#
1気筒を0、#3気筒を1、#2気筒を2、#4気筒を
3として気筒の燃焼順を示す気筒順序S_RCAS、及
び、0〜11の数値でクラセン順序及び気筒順序を総合
的に表わす総合位置S_ACASの3変数によって現在
のクランク位置を表わし、さらに、クランク位置が確証
をもって正常に判別されたときを0、判別結果がつじつ
まが合わず不安の残る推定状態を1、不明な状態を2と
するエラーレベルS_ECASにより、クランク位置の
判別状況を表わすようになっている。That is, for each cylinder, the Krasen order S_CCAS, # indicating the Krasen input order by the numerical values of 0, 1, 2
Cylinder order S_RCAS that indicates the combustion order of cylinders, where 1 cylinder is 0, # 3 cylinder is 1, # 2 cylinder is 2, and # 4 cylinder is 3, and the Krasen order and the cylinder order are comprehensively represented by the numerical values of 0-11. The current crank position is represented by the three variables of the total position S_ACAS, which is 0 when the crank position is normally discriminated with confirmation, 1 is an estimated state where the discriminant results are not consistent and 1 is anxious, and unknown state. An error level S_ECAS of 2 indicates the determination status of the crank position.
【0095】次いで、上記ステップS201からステップS2
02へ進むと、クランク位置・半回転時間算出のサブルー
チンにおいてクランク位置判定が正常に終了したかある
いは判定不能であったかを、アキュムレータAにストア
されているコードを読み出すことにより調べる(エラー
コード1、正常終了コード0)。Then, from step S201 to step S2
When the process proceeds to 02, it is checked by reading the code stored in the accumulator A whether the crank position determination in the crank position / half-rotation time calculation subroutine has ended normally or cannot be determined (error code 1, normal Exit code 0).
【0096】そして、上記ステップS202で、アキュムレ
ータAの値が1であり、クランク位置が判定不能であっ
たときには、割込みを終了し、アキュムレータAの値が
0であり、クランク位置が正常に判定されているときに
は、ステップS203へ進み、エンストフラグを解除する。Then, in step S202, when the value of the accumulator A is 1 and the crank position cannot be determined, the interrupt is ended, the value of the accumulator A is 0, and the crank position is determined normally. If so, the process proceeds to step S203, and the engine stall flag is cleared.
【0097】尚、上記エンストフラグは、クラセン間隔
計測タイマがO.5sec以上の時間(約30rpm以
下)を計測したときセットされてエンジンがエンスト状
態であることを示すフラグであり、このクラセン割込み
によりクリアされ、エンスト状態が解除される。Note that the class flag is set to 0. This flag is set when the time of 5 seconds or more (about 30 rpm or less) is measured and indicates that the engine is in the stalled state. It is cleared by this classen interrupt and the stalled state is released.
【0098】次に、ステップS204へ進むと、点火タイマ
セットのサブルーチンを実行し、ユーザージョブ側で設
定した点火時期の指示値に基づいて作成された点火スケ
ジュールに従って点火タイマをセットする。この点火ス
ケジュールは、ドエル開始時期、ドエルオン待ち時間、
ドエルオフ待ち時間などをメンバーとする構造体変数で
あり、10msジョブ中に作成ルーチンが用意され、こ
の点火スケジュールに従って点火シーケンスが決定され
る。Next, in step S204, the ignition timer setting subroutine is executed, and the ignition timer is set in accordance with the ignition schedule created based on the instruction value of the ignition timing set on the user job side. This ignition schedule is for dwell start time, dwell on waiting time,
This is a structure variable whose members are the dwell off waiting time and the like. A creation routine is prepared during the 10 ms job, and the ignition sequence is determined according to this ignition schedule.
【0099】次いで、スップS205で、燃料噴射タイマセ
ットのサブルーチンを実行し、ユーザージョブ側で設定
した燃料噴射量の指示値(各気筒毎の噴射幅)に対し、
燃料噴射開始時期などを燃料噴射タイマにセットしてス
テップS206へ進む。Next, in Sup S205, the subroutine for the fuel injection timer setting is executed, and the fuel injection amount instruction value (injection width for each cylinder) set on the user job side is set to
The fuel injection start timing is set in the fuel injection timer, and the process proceeds to step S206.
【0100】ステップS206では、このクラセンが実行さ
れた現状のジョブレベルが自身のジョブレベルであるか
否かを判別し、現状がクラセンジョブ自身のレベルであ
るときには、ステップS207、S208で、クラセンジョブ、
低優先クラセンジョブのオーバーラップカウンタOLC
を、それぞれ1増加させて割込みを終了し、現状のジョ
ブレベルがクラセンジョブのレベルでないときには、ス
テップS209で、現状のジョブレベルが低優先クラセンジ
ョブのレベル以上であるか否かを調べる。In step S206, it is determined whether or not the current job level at which this class is executed is the own job level. If the current status is the level of the class job, the class job is executed in steps S207 and S208. ,
Overlap counter OLC for low priority class job
Is incremented by 1 to terminate the interruption, and when the current job level is not the level of the class job, it is checked in step S209 whether the current job level is the level of the low priority class job or more.
【0101】そして、現状のジョブレベルが低優先クラ
センジョブ以上であるときには、上記ステップS209から
ステップS210へ進んで、低優先クラセンジョブのオーバ
ーラップカウンタOLCを1増加させると、ステップS2
11で、クラセンジョブのジョブフラグをセットし、ラベ
ルWAR_JBのジョブ優先処理へジャンプする。If the current job level is equal to or higher than the low priority class job, the process proceeds from step S209 to step S210 to increment the overlap counter OLC of the low priority class job by 1 and step S2
At 11, the job flag of the class job is set, and the process jumps to the job priority process of the label WAR_JB.
【0102】一方、上記ステップS209で、現状のジョブ
レベルが低優先クラセンジョブ以上でないときには、上
記ステップS209からステップS212へ進み、クラセンジョ
ブのジョブフラグをセットすると、ステップS213で、低
優先クラセンジョブのジョブフラグをセットし、ラベル
WAR_JBのジョブ優先処理へジャンプする。On the other hand, in step S209, if the current job level is not lower than the low-priority class job, the process proceeds from step S209 to step S212, and the job flag of the class job is set. The job flag is set, and the process jumps to the job priority process with the label WAR_JB.
【0103】このジョブ優先処理では、ステップS300
で、ジョブの優先レベルを示す1バイト変数であるジョ
ブレベルJB_LEVを1つ上げると、ステップS301へ
進んで、この優先レベルに対応するジョブフラグが立っ
ていないか調べる。そして、ジョブフラグが立っていな
いときには、ステップS300へ戻ってさらにジョブレベル
JB_LEVを1つ上げ、ジョブフラグが立っていると
きには、ステップS302へ進み、ジョブフラグの立ってい
るジョブのオーバーラップカウンタOLCを初期値の0
から1にし、ステップS303へ進む。In this job priority processing, step S300
Then, if the job level JB_LEV, which is a 1-byte variable indicating the priority level of the job, is increased by 1, the process proceeds to step S301, and it is checked whether or not the job flag corresponding to this priority level is set. If the job flag is not set, the process returns to step S300 to further increase the job level JB_LEV by one, and if the job flag is set, the process proceeds to step S302 to set the overlap counter OLC of the job for which the job flag is set. Initial value 0
Is set to 1 and the process proceeds to step S303.
【0104】ステップS303では、より上のジョブフラグ
があるか否かを調べ、より上のジョブがあるときには、
ステップS300へ戻って前述の処理を繰り返し、より上の
ジョブがないときには、ステップS304へ進んで、ジョブ
実行中フラグJB_RUNをセットすると、ステップS3
05で、後述するジョブ実行サブルーチンにより最上位の
ジョブを実行する。In step S303, it is checked whether or not there is a higher job flag, and if there is a higher job,
Returning to step S300, the above processing is repeated. If there is no higher job, the process proceeds to step S304 to set the job executing flag JB_RUN, and then step S3
At 05, the highest-level job is executed by the job execution subroutine described later.
【0105】上記ジョブ実行中フラグJB_RUNは、
ジョブの実行開始時にセットされ、終了時にクリアされ
るフラグであり、このフラグにより、処理の途中で、よ
り優先度の高いジョブによって割込まれたジョブを識別
することができる。The job executing flag JB_RUN is
It is a flag that is set at the start of job execution and cleared at the end. By this flag, a job interrupted by a job with a higher priority can be identified during processing.
【0106】例えば、図13に示すように、JB_LE
V=4の10msジョブを実行中、JB_LEV=6の
2msジョブの割込み要求がなされると、10msジョ
ブの処理が中断され、より優先度の高い2msジョブ
が、JB_RUN=1、OLC=1にセットされ、実行
される。そして、この2msジョブの処理中に、JB_
LEV=5の4msジョブの割込み要求が発生すると、
この4msジョブは、JB_RUN=0、OLC=1と
されて割込みが受付けられるが、実行はされず待機状態
となる。For example, as shown in FIG. 13, JB_LE
When an interrupt request for a 2ms job with JB_LEV = 6 is made during execution of a 10ms job with V = 4, the processing of the 10ms job is interrupted, and the higher priority 2ms job is set to JB_RUN = 1 and OLC = 1. Is executed. Then, during the processing of this 2 ms job, JB_
When an interrupt request for a 4 ms job with LEV = 5 occurs,
This 4 ms job is set to JB_RUN = 0 and OLC = 1 to accept an interrupt, but is not executed and is in a standby state.
【0107】その後、ジョブ実行サブルーチンによるジ
ョブの実行が終了すると、上記ステップS305からステッ
プS306へ進んでオーバーラップカウンタOLCを1減ら
し、ステップS307で、オーバーラップカウンタOLCが
ゼロになったか否かを調べる。その結果、オーバラップ
カウンタOLCがゼロになっておらず、同じ優先レベル
でジョブ割込み要求が複数回あるときには、ステップS3
05へ戻ってジョブを繰返し実行し、オーバラップカウン
タOLCがゼロになったとき、ステップS307からステッ
プS308へ進んで、ジョブ実行中フラグJB_RUNをク
リアする。After that, when the execution of the job by the job execution subroutine is completed, the process proceeds from step S305 to step S306, the overlap counter OLC is decremented by 1, and it is checked in step S307 whether the overlap counter OLC has become zero. . As a result, when the overlap counter OLC is not zero and there are multiple job interrupt requests at the same priority level, step S3
Returning to 05, the job is repeatedly executed, and when the overlap counter OLC becomes zero, the process proceeds from step S307 to step S308 to clear the job executing flag JB_RUN.
【0108】次に、ステップS309へ進み、ジョブレベル
JB_LEVを1つ下げて次のジョブレベルに移ると、
ステップS310で、このジョブレベルJB_LEVがゼロ
になったか否かを調べる。そして、ジョブレベルJB_
LEVがゼロのときには、この割込みを終了し、ジョブ
レベルJB_LEVがゼロでないときには、ステップS3
11へ進んで、オーバーラップカウンタOLCがゼロか否
かを調べる。Next, in step S309, when the job level JB_LEV is decreased by 1 and the job level is changed to the next job level,
In step S310, it is checked whether this job level JB_LEV has become zero. Then, the job level JB_
When LEV is zero, this interrupt is ended, and when job level JB_LEV is not zero, step S3
Proceed to 11 and check whether the overlap counter OLC is zero.
【0109】上記ステップS311で、オーバーラップカウ
ンタOLCがゼロのときには、このレベルではジョブ要
求はないため、上記ステップS311からステップS309へ戻
って、ジョブレベルJB_LEVをさらに1つ下げて同
様の処理を繰返し、オーバーラップカウンタOLCがゼ
ロでないときには、ステップS312へ進んで、このジョブ
レベルにおいて、ジョブ実行中フラグJB_RUNがセ
ットされているか否かを調べる。When the overlap counter OLC is zero in step S311, there is no job request at this level. Therefore, the process returns from step S311 to step S309, the job level JB_LEV is further lowered by one, and the same processing is repeated. If the overlap counter OLC is not zero, the flow advances to step S312 to check if the job executing flag JB_RUN is set at this job level.
【0110】上記ステップS312で、ジョブ実行中フラグ
JB_RUNがセットされているときには、割込み前に
ジョブを実行中であったため、割込みを終了して割込み
前のジョブへ戻り、ジョブ実行中フラグJB_RUNが
セットされていなければ、ステップS304へ戻って、この
レベルのジョブを実行し、同様の処理を繰返す。When the job executing flag JB_RUN is set in step S312 above, the job was being executed before the interruption, so the interruption is terminated and the process returns to the job before the interruption, and the job executing flag JB_RUN is set. If not, the process returns to step S304, the job of this level is executed, and the same processing is repeated.
【0111】すなわち、図13において、JB_LEV
=6の2msジョブが終了し、OLC=0、JB_RU
N=0になると、ジョブレベルが1つ下げられ、JB_
LEV=5の4msジョブが、JB_RUN=0、OL
C=1の待機状態からJB_RUN=1にセットされ、
実行される。さらに、4msジョブが終了すると、JB
_LEV=4に移り、JB_RUN=1(ジョブ実行
中)の状態から、2msジョブ及び4msジョブによっ
て中断されていた10msジョブの処理が再開される。That is, in FIG. 13, JB_LEV
= 6 ms 2ms job is completed, OLC = 0, JB_RU
When N = 0, the job level is lowered by 1 and JB_
4ms job with LEV = 5, JB_RUN = 0, OL
JB_RUN = 1 is set from the standby state of C = 1,
To be executed. Furthermore, when the 4ms job is completed, JB
Moving to _LEV = 4, the processing of the 10 ms job suspended by the 2 ms job and the 4 ms job is resumed from the state of JB_RUN = 1 (job is being executed).
【0112】このように、0.5ms毎の定期割込み、
クラセン割込みを基本タイミングとして、各ジョブの優
先レベル及び実行タイミングを知らせるジョブフラグJ
B_FLGを作成するため、可能な限り正確に、等時間
間隔処理、エンジン回転同期処理を実現し、各ジョブを
効率良く処理することができる。さらに、基本タイミン
グとなる各割込み毎に更新されるジョブフラグJB_F
LGによらず、オーバーラップカウンタOLCによって
ジョブの多重要求を記憶するため、あるジョブの処理時
間が長びき、再度、同じジョブを実行すべきタイミング
となった場合においても、処理を途中で放棄することな
く、可能な限り最後まで処理を継続することができる。In this way, the periodic interrupt every 0.5 ms,
A job flag J for notifying the priority level and execution timing of each job with the classen interrupt as the basic timing.
Since B_FLG is created, equal time interval processing and engine rotation synchronization processing can be realized as accurately as possible, and each job can be processed efficiently. Further, the job flag JB_F updated for each interrupt which is the basic timing
Since the overlap counter OLC stores the job multiplex request regardless of the LG, the processing is abandoned in the middle even when the processing time of a certain job becomes long and it is time to execute the same job again. The processing can be continued to the end as much as possible without any problem.
【0113】次に、図5〜図8のジョブ実行サブルーチ
ンについて説明する。Next, the job execution subroutine of FIGS. 5 to 8 will be described.
【0114】まず、ステップS500で、ジョブフラグJB
_FLGを参照して実行すべきジョブがクラセンジョブ
でないか否かを調べ、クラセンジョブでないときには、
ラベルALJ10へ分岐し、クラセンジョブのときに
は、ステップS501へ進んで、気筒判別がついているか否
かを調べる。First, in step S500, the job flag JB
By referring to _FLG, it is checked whether the job to be executed is not a class job. If it is not a class job,
The processing branches to label ALJ10, and if it is a class job, the process proceeds to step S501 to check whether or not cylinder discrimination is provided.
【0115】そして、気筒判別がついていないときに
は、そのままルーチンを抜けてジョブを実行せず、気筒
判別がついているとき、上記ステップS501からステップ
S502へ進んで、オーバーラップカウンタOLCの値を参
照して多重待ち状態であるか否かを調べる。If the cylinder is not discriminated, the routine is not executed and the job is not executed. If the cylinder is discriminated, steps S501 to S501 are executed.
In step S502, the value of the overlap counter OLC is referenced to check whether or not the multiplex wait state is set.
【0116】上記ステップS502では、多重待ち状態でな
いとき、ステップS503へ進んで、クラセン割込み毎に算
出されるシステム変数S_ACAS(クランク総合位
置)をユーザー変数ACASとし、一方、多重待ち状態
のときには、ステップS504へ分岐し、ユーザー変数AC
ASを一つ増やして12で割った剰余をとって新たなユ
ーザー変数ACASとし、このユーザー変数ACASを
0,1,2,…,11,0,1,…とソフトウエア的に
更新してゆく。In step S502, when the multiplex waiting state is not set, the process proceeds to step S503, and the system variable S_ACAS (crank total position) calculated for each classen interrupt is set as the user variable ACAS. Branched to S504, user variable AC
AS is incremented by 1 and the remainder is divided by 12 to obtain a new user variable ACAS, and this user variable ACAS is updated in software by 0, 1, 2, ..., 11, 0, 1 ,. .
【0117】すなわち、クラセンジョブ及び低優先クラ
センジョブは、自身または優先度の高いジョブに邪魔さ
れて遅れることがあるが、クラセン割込みは正確にクラ
ンク角センサ信号に同期して実行され、システム変数S
_ACASはジョブの遅れに関係なく更新される。That is, the classen job and the low-priority classen job may be delayed by being disturbed by the self or the job of high priority, but the classen interrupt is executed exactly in synchronization with the crank angle sensor signal, and the system variable S
_ACAS is updated regardless of job delay.
【0118】従って、ジョブ中でシステム変数S_AC
ASを参照してクランク位置を知り、このクランク位置
に応じた仕事を行なおうとしても、自身が他のジョブに
邪魔されて遅れた場合には、自身の仕事に対応したクラ
ンク位置を知ることができなくなる。このため、クラセ
ンジョブ及び低優先クラセンジョブ中では、多重待ち状
態でないときにOS用のシステム変数S_ACASをユ
ーザー用変数ACASとして取込み、このユーザー変数
ACASをジョブ実行毎に更新して多重要求の場合にも
クランク位置に対応した適正な処理がなされるようにす
るのである。Therefore, in the job, the system variable S_AC
Knowing the crank position by referring to AS, and trying to perform work according to this crank position, but if you are delayed because of being disturbed by another job, know the crank position that corresponds to your work Can not be. Therefore, in a class job and a low-priority class job, the system variable S_ACAS for the OS is taken in as the user variable ACAS when not in the multiplex waiting state, and this user variable ACAS is updated each time the job is executed and a multiple request is made. Also, the appropriate processing corresponding to the crank position is performed.
【0119】その後、上記ステップS503あるいは上記ス
テップS504からステップS505へ進み、ジョブのワークエ
リアを設定すると、ステップS506で、レベルゼロの割込
みを許可し、ステップS507で、クラセンジョブのセクシ
ョンに移る。そして、このクラセンジョブセクションに
リンクされた処理を実行し、ステップS508で、割込みを
禁止してルーチンを抜ける。After that, the process proceeds from step S503 or step S504 to step S505 to set the work area of the job. In step S506, the level 0 interrupt is permitted, and in step S507, the classen job section is entered. Then, the processing linked to this class job section is executed, and in step S508, the interrupt is prohibited and the routine exits.
【0120】次に、ステップS500で、これから実行すべ
きジョブがクラセンジョブでないときには、ラベルAL
J10のステップS510で、2msジョブでないか否か調
べ、2msジョブのとき、ステップS511で、ジョブのワ
ークエリアを設定すると、ステップS512で、レベルゼロ
の割込みを許可し、ステップS513で、2msジョブのセ
クションに移る。そして、このセクションにリンクされ
ているジョブ本体(ユーザー側の制御ストラテジーに基
づくルーチン、あるいは、OS側で用意したサービスル
ーチン)を実行し、ステップS514で、割込みを禁止して
ルーチンを抜ける。Next, at step S500, when the job to be executed is not the class job, the label AL
In step S510 of J10, it is checked whether or not the job is a 2 ms job. When the job is a 2 ms job, the work area of the job is set in step S511. In step S512, the level 0 interrupt is permitted, and in step S513, the 2 ms job Go to section. Then, the job main body (a routine based on the control strategy on the user side or a service routine prepared on the OS side) linked to this section is executed, and in step S514, interrupt is prohibited and the routine exits.
【0121】一方、上記ステップ510で、実行すべきジ
ョブが2msジョブでないときには、ステップS510から
ステップS520へ分岐し、実行すべきジョブが4msジョ
ブか否かを調べる。そして、4msジョブでないときに
は、ラベルALJ30へ分岐し、4msジョブのときに
は、ステップS521で、ジョブのワークエリアを設定する
と、ステップS522へ進む。尚、この4msジョブは、A
/D変換利用ジョブであり、後述するシステムシフトバ
ッファSSHBを介してA/D変換データを利用する。On the other hand, if the job to be executed is not a 2 ms job in step 510, the process branches from step S510 to step S520 to check whether the job to be executed is a 4 ms job. If it is not a 4 ms job, the process branches to label ALJ30. If it is a 4 ms job, the work area of the job is set in step S521, and the process proceeds to step S522. Note that this 4ms job is
A / D conversion use job, which uses A / D conversion data via a system shift buffer SSHB described later.
【0122】ステップS522では、レベルゼロの割込みを
許可し、次いで、ステップS523へ進むと、スイッチ入力
を読み込み、ステップS524で、4msジョブのセクショ
ンに移って、リンクされているジョブ本体を実行する。
その後、4msジョブのセクションから抜けると、ステ
ップS525で、割込みを禁止し、ステップS526へ進んで、
システムシフトバッファSSHBをシフトしてルーチン
を抜ける。In step S522, the interrupt of level zero is permitted, and then in step S523, the switch input is read, and in step S524, the section of the 4 ms job is moved to and the linked job main body is executed.
After that, when the section of the 4 ms job is exited, the interrupt is prohibited in step S525, the process proceeds to step S526,
The system shift buffer SSHB is shifted to exit the routine.
【0123】上記システムシフトバッファSSHBは、
図14に示すように、8チャンネルの各A/D変換結果
がストアされる先頭オフセットアドレス0,+8,+1
6,+24,+32,+34,+36,+38番の各メ
モリ、及び、4ms毎のクランク同期のA/D変換結果
がストアされる先頭オフセットアドレス−2番地の1ワ
ードのメモリからなり、0.5ms毎に実行される1回
のA/D変換結果が1ワード(2バイト)でストアされ
る。The system shift buffer SSHB is
As shown in FIG. 14, head offset addresses 0, +8, +1 in which the A / D conversion results of 8 channels are stored
It consists of memories of Nos. 6, +24, +32, +34, +36, and +38, and a 1-word memory at the start offset address -2 where the A / D conversion result of crank synchronization at every 4 ms is stored. One A / D conversion result executed each time is stored in one word (2 bytes).
【0124】先頭オフセットアドレス0番地からは、4
段のシフトメモリとなっており、90°CA毎のA/D
変換結果がストアされ、最新4データ(1回転分)をジ
ョブから参照することができる。また、先頭オフセット
アドレス+32,+34,+36,+38番地は、各1
ワードのメモリであり、なまし処理機能が選択されたと
き、A/D変換結果を加重平均した値がストアされてノ
イズ除去と精度向上を図ることができるようになってお
り、これらのメモリのデータは、低速ジョブで利用でき
る。4 from the first offset address 0
It is a multi-stage shift memory, and A / D every 90 ° CA.
The conversion result is stored and the latest 4 data (1 rotation) can be referred to from the job. The head offset addresses +32, +34, +36, and +38 are each 1
This is a word memory, and when the smoothing function is selected, a weighted average value of the A / D conversion results is stored to enable noise removal and accuracy improvement. The data is available for slow jobs.
【0125】また、各先頭オフセットアドレス+8,+
16,+24番地からは、各4ワードのメモリであり、
4msジョブで利用するようになっている。これらの各
メモリは、先頭に最新のA/D変換結果がストアされ、
4msジョブのオーバーラップカウンタOLCの値に応
じて順にシフトされ、先にストアしたデータから読出さ
れるFIFOバッファとなっている。Further, each head offset address +8, +
From addresses 16 and 24, each is a 4-word memory,
It is designed to be used in 4ms jobs. The latest A / D conversion result is stored at the beginning of each of these memories,
It is a FIFO buffer that is sequentially shifted according to the value of the overlap counter OLC of the 4 ms job and is read from the previously stored data.
【0126】すなわち、A/D変換は、0.5ms毎の
定期割込みにより4ms周期で正確に行なわれるが、4
msジョブは優先度の高いジョブに邪魔されて遅れるこ
とがある。従って、A/D変換の受渡しにFIFOバッ
ファを用い、4msジョブで+8,+16,+24番地
の各FIFOバッファのデータを参照後、上記ステップ
S526で、各FIFOバッファのデータを順にシフトする
のである。That is, A / D conversion is accurately performed in a cycle of 4 ms by a periodic interrupt every 0.5 ms.
ms jobs may be delayed by being disturbed by higher priority jobs. Therefore, the FIFO buffer is used for delivery of A / D conversion, and after referring to the data of each FIFO buffer at addresses +8, +16, and +24 in the 4 ms job, the above steps are performed.
In S526, the data in each FIFO buffer is sequentially shifted.
【0127】一方、上記ステップS520で、実行すべきジ
ョブが4msジョブでなく、ラベルALJ30へ分岐し
たときには、ステップS530で、実行すべきジョブが10
msジョブか否かを調べ、10msジョブのとき、ステ
ップS531で、ジョブのワークエリアを設定し、ステップ
S532で、レベルゼロの割込みを許可すると、ステップS5
33で、10msジョブのセクションに移って、ジョブ本
体を実行し、ステップS534で割込みを禁止してルーチン
を抜ける。On the other hand, when the job to be executed is not the 4 ms job in step S520 and the process branches to label ALJ30, the job to be executed is 10 in step S530.
It is checked whether it is an ms job or not, and if it is a 10 ms job, the work area of the job is set in step S531, and the step
If the level 0 interrupt is enabled in S532, step S5
At 33, the section moves to the 10 ms job section, the job main body is executed, and at step S534, interruption is prohibited and the routine exits.
【0128】尚、上記10msジョブのセクションに
は、半回転時間からエンジン回転数を算出するサービス
ルーチン、前述した点火スケジュールを作成するサービ
スルーチンなどがOS側で用意されている。In the 10 ms job section, a service routine for calculating the engine speed from the half rotation time, a service routine for creating the above-mentioned ignition schedule, etc. are prepared on the OS side.
【0129】また、上記ステップS530で、実行すべきジ
ョブが10msジョブでないときには、上記ステップS5
30からステップS540へ分岐し、実行すべきジョブが低優
先クラセンジョブであるか否かを調べる。そして、低優
先クラセンジョブでないときには、上記ステップS540か
らラベルALJ50へ分岐し、実行すべきジョブが低優
先クラセンジョブのときは、上記ステップS540からステ
ップS541へ進んで、現在の状態が多重待ち状態であるか
否かを調べる。If it is determined in step S530 that the job to be executed is not a 10 ms job, then step S5 is executed.
The process branches from 30 to step S540 to check whether the job to be executed is a low priority class job. If the job is not the low priority class job, the process branches from step S540 to the label ALJ50. If the job to be executed is the low priority class job, the process proceeds from step S540 to step S541, and the current state is the multiplex waiting state. Check if there is.
【0130】そして、現在の状態が多重待ち状態でない
ときには、上記ステップS541からステップS542へ進ん
で、システム変数S_ACAS(クランク総合位置)を
ユーザー変数ACASとしてステップS544へ進み、多重
待ち状態のときには、上記ステップS541からステップS5
43へ分岐し、ユーザー変数ACASを一つ増やして12
で割った剰余をとった後、ステップS544へ進む。When the current state is not the multiplex waiting state, the process proceeds from step S541 to step S542, the system variable S_ACAS (crank total position) is set as the user variable ACAS, and the process proceeds to step S544. Step S541 to Step S5
Branch to 43 and increase the user variable ACAS by 1 to 12
After taking the remainder divided by, go to step S544.
【0131】ステップS544では、ジョブのワークエリア
を設定し、ステップS545で、レベルゼロの割込みを許可
すると、ステップS546で、低優先クラセンジョブのセク
ションに移り、ジョブ本体を実行した後、ステップS547
で割込みを禁止し、ルーチンを抜ける。In step S544, the work area of the job is set, and in step S545, when the level 0 interrupt is permitted, in step S546, the section moves to the low priority class job and the job body is executed, and then step S547.
Disable the interrupt and exit the routine.
【0132】さらに、ラベルALJ50では、実行すべ
きジョブが50msジョブであるか否かを調べ、50m
sジョブのときには、ステップS551へ進んでジョブのワ
ークエリアを設定し、ステップS552へ進む。Further, with the label ALJ50, it is checked whether or not the job to be executed is a 50 ms job, and 50 m
If it is an s job, the flow advances to step S551 to set the work area of the job, and then the flow advances to step S552.
【0133】ステップS552では、レベルゼロの割込みを
許可すると、ステップS553で、50msジョブのセクシ
ョンに移り、OS側で用意したエンストフラグ作成ルー
チン、気筒別の点火時期リタードルーチン、燃料噴射開
始時期設定ルーチンなどを実行し、また、ユーザ側の制
御ストラテジーに基づくルーチンを実行する。そして、
ジョブの終了後、ステップS554で割込みを禁止し、ルー
チンを抜ける。In step S552, if the interrupt of level zero is permitted, then in step S553 the section for the 50 ms job is entered, and the engine stall flag preparation routine, ignition timing retard routine for each cylinder, and fuel injection start timing setting routine prepared on the OS side. Etc., and also executes a routine based on the control strategy of the user side. And
After the job is completed, interrupt is prohibited in step S554, and the routine is exited.
【0134】一方、上記ステップS550で実行すべきジョ
ブが50msジョブではないときには、上記ステップS5
50からステップS560へ分岐し、ジョブのワークエリアを
設定すると、ステップS561で、レベルゼロの割込みを許
可し、ステップS562へ進んで、250msジョブのセク
ション領域へ移行し、ジョブ本体を実行後、ステップS5
63で割込みを禁止してルーチンを抜ける。On the other hand, if the job to be executed in step S550 is not a 50 ms job, then step S5
After branching from step 50 to step S560 and setting the work area of the job, in step S561 the level 0 interrupt is permitted, the process proceeds to step S562, the section area of the 250 ms job is entered, the job body is executed, and then step S5
Disable interrupt at 63 and exit the routine.
【0135】[0135]
【発明の効果】以上説明したように請求項1記載の発明
によれば、実行周期により定義される優先レベルの異な
る複数のジョブを優先順に実行するに際し、各優先レベ
ル毎にオーバーラップカウンタを割当てる。そして、一
定の基本時間毎に実行される定期割込み処理により、優
先順位を示すと共に上記基本時間の整数倍の各実行周期
毎のジョブ割込み要求を示すジョブフラグを、基本時間
の整数倍の間隔で各実行周期に対応してそれぞれセット
する。そして、定期割込み処理においていずれかのジョ
ブフラグがセットされているか否かを判断し、ジョブフ
ラグがセットされている時には、さらに現状の優先レベ
ル以下のジョブフラグがセットされているか否かを判断
する。そして、多重割込みにより現状レベル以下のジョ
ブフラグがセットされている時には当該低優先レベルの
ジョブの実行要求回数を示すオーバーラップカウンタの
カウント値をカウントアップして、更に現状優先レベル
より高い優先レベルのジョブフラグがセットされている
か否かを判断する。そして、現状レベルより高いレベル
のジョブフラグがセットされている時には、順次優先レ
ベルを上げて該優先レベルに対応するジョブフラグがセ
ットされているかを判断して、セットされているジョブ
フラグにより示される優先レベルのオーバーラップカウ
ンタのカウント値をカウントアップする。また、現状よ
り高優先レベルのジョブフラグがセットされていない時
には、当該優先レベルのジョブを該優先レベルのオーバ
ーラップカウンタのカウント値による回数実行する。そ
して、ジョブの実行後、優先レベルを順次下げて該優先
レベル毎に該優先レベルのオーバーラップカウンタのカ
ウント値を判断し、該オーバーラップカウンタのカウン
ト値により示される回数、該優先レベルのジョブを実行
する。従って、各優先レベル毎のジョブフラグのセット
と、多重割込みをカウントする各優先レベル毎のオーバ
ーラップカウンタのカウント値とによる非常に簡単な処
理によって、多重割込みが発生した場合は、高優先レベ
ルのジョブから低優先レベル側のジョブを順に実行する
ことができ、また、非常に簡素な処理により、優先レベ
ル毎に、多重割込みにより発生した要求回数だけ、該優
先レベルのジョブを確実に実行することができる。これ
により、車両制御のための各制御ストラテジーに基づく
実行周期の異なる複数の優先レベルの各ジョブを効率良
く実行し、各優先レベル毎の等時間間隔毎の処理を的確
に実現することができる。請求項2記載の発明によれ
ば、実行周期により定義される優先レベルの異なる等時
間間隔処理の複数のジョブ、及びエンジン回転に同期し
た所定クランク角毎のジョブを優先順に実行するに際
し、各優先レベル毎にオーバーラップカウンタを割当て
る。そして、等時間間隔処理のジョブについては一定の
基本時間毎に実行される定期割込み処理により、優先順
位を示すと共に上記基本時間の整数倍の各実行周期毎の
ジョブ割込み要求を示すジョブフラグを、上記基本時間
の整数倍の間隔で各実行周期に対応してそれぞれセット
する。そして、定期割込み処理において、いずれかのジ
ョブフラグがセットされているか否かを判断し、ジョブ
フラグがセットされている時には、さらに現状の優先レ
ベル以下のジョブフラグがセットされているか否かを判
断する。そして、多重割込みにより現状レベル以下のジ
ョブフラグがセットされている時には当該低優先レベル
のジョブの実行要求回数を示すオーバーラップカウンタ
のカウント値をカウントアップして、更に現状優先レベ
ルより高い優先レベルのジョブフラグがセットされてい
るか否かを判断する。また、所定クランク角毎のジョブ
については、該クランク角毎の割込み処理において該優
先レベルに対応するオーバーラップカウンタをカウント
アップして、該当優先レベルのジョブフラグをセットす
る。そして、所定クランク角毎の割込み処理により該当
優先レベルのジョブフラグをセットした後、または定期
割込み処理処理において現状レベルより高いレベルのジ
ョブフラグがセットされている時には、順次優先レベル
を上げて該優先レベルに対応するジョブフラグがセット
されているかを判断して、セットされているジョブフラ
グにより示される優先レベルのオーバーラップカウンタ
のカウント値をカウントアップする。また、現状より高
優先レベルのジョブフラグがセットされていない時に
は、当該優先レベルのジョブを該優先レベルのオーバー
ラップカウンタのカウント値により示される回数実行す
る。そして、ジョブの実行後、優先レベルを順次下げて
該優先レベル毎に該優先レベルのオーバーラップカウン
タのカウント値を判断し、該オーバーラップカウンタの
カウント値により示される回数、該優先レベルのジョブ
を実行するので、上記請求項1記載の発明による効果に
加え、実行周期により定義される優先レベルの異なる等
時間間隔処理の複数のジョブと、エンジン回転に同期し
た所定クランク角毎のジョブとの多重割込みが発生して
も、確実に高優先レベルのジョブから低優先レベル側の
ジョブを順に、優先レベル毎に多重割込みにより発生し
た要求回数だけ該優先レベルのジョブを実行することが
できる。請求項3記載の発明によれば、各優先レベル毎
のジョブの実行開始によりセットされ実行終了によりク
リアされるジョブ実行中フラグを有する。そして、優先
レベル毎に該優先レベルのオーバーラップカウンタのカ
ウント値を判断して該オーバーラップカウンタのカウン
ト値により示される回数、該優先レベルのジョブを実行
するに際し、ジョブ実行中フラグを参照して、ジョブ実
行中フラグがセットされている時は、多重割込みにより
中断していたジョブを実行するので、上記請求項1或い
は請求項2記載の発明の効果に加え、多重割込みにより
高優先レベルのジョブの実行によって中断されていた低
優先レベル側のジョブを、高優先レベルのジョブの終了
後、確実に再開させることができ、処理を途中で放棄す
ることなく可能な限り最後まで処理を継続することがで
きて、制御性を向上することができる効果を有する。請
求項4記載の発明によれば、等時間間隔処理のジョブを
対象として、上記基本時間を1つの位置として複数の位
置を有し、基本時間に対する各優先レベルのジョブ実行
周期の整数倍に対応して、該整数倍の間隔の位置に対応
優先レベルのジョブフラグをセットするデータが配置さ
れたテーブルを備える。そして、一定の基本時間毎に実
行される定期割込み処理において、テーブルの位置を指
定するポインタをインクリメントしてテーブル参照を行
い、等時間間隔処理のジョブを対象として、各実行周期
毎のジョブ割込み要求を示すジョブフラグをセットする
ので、上記請求項1ないし請求項3のいずれかに記載の
発明の効果に加え、簡単なテーブル参照により、等時間
間隔処理で実行周期の異なる各優先レベル毎のジョブの
実行指示を的確に行うことができ、且つ、演算負担を軽
減して実現できる。また、各定期ジョブの時間間隔を変
更する場合、アルゴリズムを変更することなく、テーブ
ル内のデータ変更により柔軟に対応することができる。
請求項5記載の発明によれば、等時間間隔処理のジョブ
を対象として、上記基本時間を1つの位置として複数の
位置を有し該基本時間に対する最上位優先レベルから予
め設定された中位優先レベルまでの各優先レベルのジョ
ブ実行周期の整数倍に対応して該整数倍の間隔の位置に
対応優先レベルのジョブフラグをセットするデータが配
置された第1のテーブルと、等時間間隔処理のジョブを
対象として、上記中位優先レベルのジョブの実行周期を
基本時間とし、該基本時間を1つの位置として複数の位
置を有し、該基本時間に対する最下位優先レベルまでの
各優先レベルのジョブ実行周期の整数倍に対応して該整
数倍の間隔の位置に対応優先レベルのジョブフラグをセ
ットするデータが配置された第2のテーブルとを備え
る。そして、一定の基本時間毎に実行される定期割込み
処理において上記第1のテーブルの位置を指定するポイ
ンタをインクリメントして第1のテーブル参照を行うと
共に上記中位優先レベルのジョブの実行周期に対応して
上記第2のテーブルの位置を指定するポインタをインク
リメントして第2のテーブル参照を行い、等時間間隔処
理のジョブを対象として、各実行周期毎のジョブ割込み
要求を示すジョブフラグをセットするので、上記請求項
4記載の発明の効果に加え、一つのテーブル参照によっ
て全ての等時間間隔処理の実行周期の相違により各優先
レベルの異なるジョブの実行指示を行う場合に対し、テ
ーブルによるメモリの使用容量を減少することができ
て、更なる演算負担の軽減を実現しつつ、等時間間隔処
理を対象とする全てのジョブフラグを優先レベルに対応
して異なる基本時間の整数倍の時間間隔で的確にセット
することができる効果を有する。As described above, according to the first aspect of the present invention, when a plurality of jobs having different priority levels defined by the execution cycle are executed in order of priority, an overlap counter is assigned to each priority level. . Then, by a periodic interrupt process executed at fixed basic time intervals, a job flag indicating a priority level and a job interrupt request for each execution cycle that is an integral multiple of the basic time is set at intervals of an integral multiple of the basic time. Set each corresponding to each execution cycle. Then, it is determined whether or not any job flag is set in the periodic interrupt processing, and when the job flag is set, it is further determined whether or not a job flag at the current priority level or lower is set. . Then, when the job flag of the current level or lower is set by the multiple interruption, the count value of the overlap counter indicating the number of execution requests of the job of the low priority level is counted up, and the priority level higher than the current priority level is further increased. It is determined whether the job flag is set. Then, when the job flag of a level higher than the current level is set, the priority level is sequentially increased to determine whether the job flag corresponding to the priority level is set, and the job flag indicated by the set job flag is displayed. The count value of the priority level overlap counter is incremented. When the job flag of the priority level higher than the current status is not set, the job of the priority level is executed the number of times based on the count value of the overlap counter of the priority level. After the job is executed, the priority level is sequentially lowered to determine the count value of the overlap counter of the priority level for each priority level, and the job of the priority level is determined by the number of times indicated by the count value of the overlap counter. Run. Therefore, when a multiple interrupt occurs, a high priority level is set by a very simple process by setting the job flag for each priority level and the count value of the overlap counter for counting each multiple interrupt. Jobs on the lower priority level side can be executed in order from the job, and the job of the priority level can be executed reliably for each priority level by the number of requests generated by multiple interrupts for each priority level. You can As a result, it is possible to efficiently execute each job of a plurality of priority levels having different execution cycles based on each control strategy for vehicle control, and accurately realize the processing at each equal time interval for each priority level. According to the invention described in claim 2, when the plurality of jobs of equal time interval processing having different priority levels defined by the execution cycle and the job for each predetermined crank angle synchronized with the engine rotation are executed in the priority order, each priority is executed. Assign an overlap counter for each level. Then, for the job of the equal time interval processing, by the periodic interrupt processing that is executed at a constant basic time, a job flag indicating a priority and a job interrupt request for each execution cycle that is an integral multiple of the basic time, It is set corresponding to each execution cycle at intervals of an integral multiple of the basic time. Then, in the periodic interrupt processing, it is determined whether or not any job flag is set, and when the job flag is set, it is further determined whether or not the job flag of the current priority level or lower is set. To do. Then, when the job flag of the current level or lower is set by the multiple interruption, the count value of the overlap counter indicating the number of execution requests of the job of the low priority level is counted up, and the priority level higher than the current priority level is further increased. It is determined whether the job flag is set. Further, for the job for each predetermined crank angle, the overlap counter corresponding to the priority level is counted up in the interrupt processing for each crank angle, and the job flag of the corresponding priority level is set. Then, after the job flag of the corresponding priority level is set by the interrupt process for each predetermined crank angle, or when the job flag of the higher level than the current level is set in the regular interrupt process, the priority level is sequentially increased to the priority level. It is determined whether the job flag corresponding to the level is set, and the count value of the overlap counter of the priority level indicated by the set job flag is counted up. When the job flag of the priority level higher than the current status is not set, the job of the priority level is executed the number of times indicated by the count value of the overlap counter of the priority level. After the job is executed, the priority level is sequentially lowered to determine the count value of the overlap counter of the priority level for each priority level, and the job of the priority level is determined by the number of times indicated by the count value of the overlap counter. Since it is executed, in addition to the effect of the invention according to claim 1, multiple jobs of equal time interval processing having different priority levels defined by the execution cycle and a job for each predetermined crank angle synchronized with engine rotation are multiplexed. Even if an interrupt occurs, jobs of high priority level can be executed in order from jobs of high priority level, and jobs of the priority level can be executed for each priority level for the number of requests generated by multiple interrupts. According to the third aspect of the invention, the job execution flag is set when the execution of the job for each priority level is started and cleared when the execution is completed. Then, the count value of the overlap counter of the priority level is determined for each priority level, and when the job of the priority level is executed for the number of times indicated by the count value of the overlap counter, the job execution flag is referred to. When the job in-execution flag is set, the job interrupted by the multiple interrupt is executed. Therefore, in addition to the effect of the invention described in claim 1 or 2, the job of high priority level is generated by the multiple interrupt. Jobs on the low priority level side that were interrupted by the execution of can be reliably restarted after the job on the high priority level is completed, and processing can be continued to the end as much as possible without abandoning the processing. Therefore, the controllability can be improved. According to the invention described in claim 4, for a job of equal time interval processing, there are a plurality of positions with the basic time as one position, and it corresponds to an integer multiple of the job execution cycle of each priority level with respect to the basic time. Then, a table is provided in which data for setting the job flag of the corresponding priority level is arranged at the position of the interval of the integral multiple. Then, in the periodic interrupt processing executed at fixed basic time intervals, the pointer designating the position of the table is incremented to refer to the table, and the job interrupt request for each execution cycle is targeted for the job of the equal time interval processing. Since the job flag indicating "1" is set, in addition to the effect of the invention described in any one of claims 1 to 3 , the job for each priority level having a different execution cycle in equal time interval processing can be obtained by a simple table reference. The execution instruction can be accurately performed, and the calculation load can be reduced. Further, when the time interval of each regular job is changed, it is possible to flexibly deal with the data change in the table without changing the algorithm.
According to the invention described in claim 5, for a job of equal time interval processing, there are a plurality of positions with the basic time as one position, and the medium priority set in advance from the highest priority level for the basic time. The first table in which the data for setting the job flag of the corresponding priority level is arranged at the position of the integer multiple interval corresponding to the integer multiple of the job execution cycle of each priority level up to the level, and the equal time interval processing For a job, the execution cycle of the medium priority level job is a basic time, the basic time is one position, and there are a plurality of positions. Jobs of each priority level up to the lowest priority level for the basic time. A second table in which data for setting the job flag of the corresponding priority level is arranged at positions corresponding to an integral multiple of the execution cycle. Then, in the periodic interrupt processing executed at regular intervals, the pointer designating the position of the first table is incremented to refer to the first table, and the execution cycle of the medium priority job is dealt with. Then, the pointer designating the position of the second table is incremented to refer to the second table, and a job flag indicating a job interrupt request for each execution cycle is set for a job of equal time interval processing. Therefore, in addition to the effect of the invention described in claim 4, in the case where execution of jobs with different priority levels is instructed due to the difference in the execution cycle of all isochronous processing by one table reference, the memory of the table is used. It is possible to reduce the used capacity and realize further reduction of the calculation load, and at the same time, to implement all the processes for equal time interval processing. Accurately Bufuragu an integral multiple of the time interval of different basic time corresponding to the priority level has an effect that can be set.
【図1】ジョブ優先処理のフローチャートFIG. 1 is a flowchart of job priority processing.
【図2】0.5ms毎の定期割込み処理のフローチャー
トFIG. 2 is a flowchart of periodic interrupt processing every 0.5 ms.
【図3】クラセン割込み処理のフローチャートFIG. 3 is a flowchart of classen interrupt processing.
【図4】ジョブフラグ作成サブルーチンのフローチャー
トFIG. 4 is a flowchart of a job flag creation subroutine.
【図5】ジョブ実行サブルーチンの部分フローチャート
1FIG. 5 is a partial flowchart 1 of a job execution subroutine.
【図6】ジョブ実行サブルーチンの部分フローチャート
2FIG. 6 is a partial flowchart 2 of a job execution subroutine.
【図7】ジョブ実行サブルーチンの部分フローチャート
3FIG. 7 is a partial flowchart 3 of a job execution subroutine.
【図8】ジョブ実行サブルーチンの部分フローチャート
4FIG. 8 is a partial flowchart 4 of a job execution subroutine.
【図9】ジョブの実行状態を示す説明図FIG. 9 is an explanatory diagram showing a job execution state.
【図10】ジョブフラグの説明図FIG. 10 is an explanatory diagram of a job flag.
【図11】ジョブフラグテーブルの説明図FIG. 11 is an explanatory diagram of a job flag table.
【図12】クランク位置変数の説明図FIG. 12 is an explanatory diagram of crank position variables.
【図13】ジョブ実行中フラグとオーバーラップカウン
タの変化を示す説明図FIG. 13 is an explanatory diagram showing changes in a job execution flag and an overlap counter.
【図14】システムシフトバッファの説明図FIG. 14 is an explanatory diagram of a system shift buffer.
【図15】エンジン系の概略構成図FIG. 15 is a schematic configuration diagram of an engine system.
【図16】クランクロータとクランク角センサの正面図FIG. 16 is a front view of a crank rotor and a crank angle sensor.
【図17】カムロータとカム角センサの正面図FIG. 17 is a front view of a cam rotor and a cam angle sensor.
【図18】電子制御系の回路構成図FIG. 18 is a circuit configuration diagram of an electronic control system.
50 ECU JB_FLG ジョブフラグ OLC オーバーラップカウンタ JB_LEV ジョブレベル JBF_N 第1のテーブル JBF_M 第2のテーブル 50 ECU JB_FLG job flag OLC overlap counter JB_LEV job level JBF_N First table JBF_M Second table
フロントページの続き (56)参考文献 特開 昭55−134719(JP,A) 特開 昭61−82203(JP,A) 特開 昭56−105507(JP,A) 特開 昭59−36814(JP,A) 特開 平4−301162(JP,A) 特開 昭56−104136(JP,A) 特開 昭56−38542(JP,A) 特開 昭53−40105(JP,A) 実開 平2−1443(JP,U) (58)調査した分野(Int.Cl.7,DB名) F02D 41/00 - 45/00 Continuation of front page (56) Reference JP-A-55-134719 (JP, A) JP-A-61-82203 (JP, A) JP-A-56-105507 (JP, A) JP-A-59-36814 (JP , A) JP 4-301162 (JP, A) JP 56-104136 (JP, A) JP 56-38542 (JP, A) JP 53-40105 (JP, A) 2-1443 (JP, U) (58) Fields investigated (Int.Cl. 7 , DB name) F02D 41/00-45/00
Claims (5)
なる複数のジョブを優先順に実行すると共に、多重割込
みが発生した時には、低優先側のジョブの割込み要求回
数を記憶し、高優先ジョブの実行後、順次低優先側のジ
ョブを、記憶した割込み要求の回数実行する車両制御の
ためのジョブの優先処理方法において、 各優先レベル毎
にオーバーラップカウンタを割当てると共に、 一定の基本時間毎に実行される定期割込み処理により、
優先順位を示すと共に上記基本時間の整数倍の各実行周
期毎のジョブ割込み要求を示すジョブフラグを、上記基
本時間の整数倍の間隔で各実行周期に対応してそれぞれ
セットし、 定期割込み処理においていずれかのジョブフラグがセッ
トされているか否かを判断し、 上記ジョブフラグがセットされている時には、さらに現
状の優先レベル以下のジョブフラグがセットされている
か否かを判断し、 多重割込みにより現状レベル以下のジョブフラグがセッ
トされている時には当該低優先レベルのジョブの実行要
求回数を示すオーバーラップカウンタのカウント値をカ
ウントアップして、更に現状優先レベルより高い優先レ
ベルのジョブフラグがセットされているか否かを判断
し、現状レベルより高いレベルのジョブフラグがセット
されている時には、順次優先レベルを上げて該優先レベ
ルに対応するジョブフラグがセットされているかを判断
して、セットされているジョブフラグにより示される優
先レベルのオーバーラップカウンタのカウント値をカウ
ントアップし、 現状より高優先レベルのジョブフラグがセットされてい
ない時には、当該優先レベルのジョブを当該優先レベル
のオーバーラップカウンタのカウント値により示される
回数実行し、 上記ジョブの実行後、優先レベルを順次下げて該優先レ
ベル毎に該優先レベルのオーバーラップカウンタのカウ
ント値を判断し、該オーバーラップカウンタのカウント
値により示される回数、該優先レベルのジョブを実行す
る ことを特徴とするジョブの優先処理方法。1. Priority level differences defined by execution cycles
Multiple jobs are executed in priority order and multiple interrupts are executed.
Occurs, the interrupt request count of the job on the low priority side
The number is stored, and after the high-priority job is executed, the
Of the vehicle control that executes the stored number of interrupt requests
For each priority level in the job priority processing method for
By assigning an overlap counter to, and performing periodic interrupt processing that is executed at fixed basic time intervals,
Indicate the priority and each execution cycle that is an integral multiple of the above basic time
A job flag indicating a job interrupt request for each period is
Corresponding to each execution cycle at intervals of an integral multiple of this time
Set and one of the job flags is set in the periodic interrupt processing.
It determines whether it is bets, when the job flag has been set, further the current
The job flag below the priority level is set
It is determined whether or not the job flag below the current level is set by multiple interruption.
If a job with a low priority level is
The count value of the overlap counter that indicates the number of requests
The priority level is higher than the current priority level.
Determine if the bell job flag is set
However, the job flag of a higher level than the current level is set.
When the priority level is increased, the priority level is gradually increased and the priority level is increased.
The job flag corresponding to the
The job flag indicated by the set job flag.
Count the count value of the overlap counter of the previous level
And the job flag of higher priority level than the current one is set.
When there is no job, the job of the priority level is
Indicated by the count value of the overlap counter of
After executing the job a number of times, lower the priority level in sequence and
For each bell, the counter of the overlap counter of the priority level
Count of the overlap counter
The job of the priority level is executed the number of times indicated by the value.
Priority processing method of the job, characterized in that that.
なる等時間間隔処理の 複数のジョブ、及びエンジン回転
に同期した所定クランク角毎のジョブを優先順に実行す
ると共に、多重割込みが発生した時には、低優先側のジ
ョブの割込み要求回数を記憶し、高優先ジョブの実行
後、順次低優先側のジョブを、記憶した割込み要求の回
数実行する車両制御のためのジョブの優先処理方法にお
いて、 各優先レベル毎にオーバーラップカウンタを割当てると
共に、 上記等時間間隔処理のジョブについては一定の基本時間
毎に実行される定期割込み処理により、優先順位を示す
と共に上記基本時間の整数倍の各実行周期毎のジョブ割
込み要求を示すジョブフラグを、上記基本時間の整数倍
の間隔で各実行周期に対応してそれぞれセットし、 定期割込み処理においていずれかのジョブフラグがセッ
トされているか否かを判断し、 上記ジョブフラグがセットされている時には、さらに現
状の優先レベル以下のジョブフラグがセットされている
か否かを判断し、 多重割込みにより現状レベル以下のジョブフラグがセッ
トされている時には当該低優先レベルのジョブの実行要
求回数を示すオーバーラップカウンタのカウント値をカ
ウントアップして、更に現状優先レベルより高い優先レ
ベルのジョブフラグがセットされているか否かを判断
し、 所定クランク角毎のジョブについては、該クランク角毎
の割込み処理において該優先レベルに対応するオーバー
ラップカウンタをカウントアップして、該当優先レベル
のジョブフラグをセットし、 所定クランク角毎の割込み処理により該当優先レベルの
ジョブフラグをセットした後、または上記定期割込み処
理処理において現状レベルより高いレベルのジョブフラ
グがセットされている時には、順次優先レベルを上げて
該優先レベルに対応するジョブフラグがセットされてい
るかを判断して、セットされているジョブフラグにより
示される優先レベルのオーバーラップカウンタのカウン
ト値をカウントアップし、 現状より高優先レベルのジョブフラグがセットされてい
ない時には、当該優先レベルのジョブを該優先レベルの
オーバーラップカウンタのカウント値により示される回
数実行し、 上記ジョブの実行後、優先レベルを順次下げて該優先レ
ベル毎に該優先レベルのオーバーラップカウンタのカウ
ント値を判断し、該オーバーラップカウンタのカウント
値により示される回数、該優先レベルのジョブを実行す
ることを特徴とするジョブの優先処理方法。 2. Different priority levels defined by execution cycles
Multiple jobs of equal time interval processing , and engine rotation
Execute the jobs for each predetermined crank angle synchronized to
In addition, when multiple interrupts occur, the low priority side
Job interrupt request count, high priority job execution
Then, the jobs on the low priority side are sequentially processed for the stored interrupt requests.
The priority processing method of the job for controlling the vehicle to be executed several times.
And assigning an overlap counter for each priority level
In both cases, a constant basic time is set for the above-mentioned jobs of equal time intervals
The priority is indicated by the periodic interrupt processing executed for each
Together with the job allocation for each execution cycle that is an integral multiple of the above basic time
The job flag indicating a request for inclusion is an integer multiple of the above basic time
Are set for each execution cycle at intervals of , and any job flag is set in the periodic interrupt processing.
It determines whether it is bets, when the job flag has been set, further the current
The job flag below the priority level is set
It is determined whether or not the job flag below the current level is set by multiple interruption.
If a job with a low priority level is
The count value of the overlap counter that indicates the number of requests
The priority level is higher than the current priority level.
Determine if the bell job flag is set
And, for the job for each predetermined crank angle, the crank angle for each
Interrupt corresponding to the priority level
The lap counter is incremented to the corresponding priority level.
The job flag of is set, and interrupt processing for each predetermined crank angle causes the corresponding priority level
After setting the job flag, or the above periodic interrupt processing
Job processing at a higher level than the current level in processing
When the group is set, raise the priority level in sequence.
The job flag corresponding to the priority level is set
The job flag that has been set.
Count of overlapping counters for the indicated priority level
Count value is increased and the job flag of higher priority level than the current one is set.
When there is no job of the priority level,
Number of times indicated by the count value of the overlap counter
Several times, and after executing the above jobs, lower the priority level in sequence and
For each bell, the counter of the overlap counter of the priority level
Count of the overlap counter
The job of the priority level is executed the number of times indicated by the value.
A job priority processing method characterized by the following.
セットされ実行終了によりクリアされるジョブ実行中フ
ラグを有し、 優先レベル毎に該優先レベルのオーバーラップカウンタ
のカウント値を判断して該オーバーラップカウンタのカ
ウント値により示される回数、該優先レベルのジョブを
実行するに際し、ジョブ実行中フラグを参照し、ジョブ
実行中フラグがセットされている時は、多重割込みによ
り中断していたジョブを実行することを特徴とする請求
項1或いは請求項2記載 のジョブの優先処理方法。3. By starting execution of a job for each priority level
A job execution flag that is set and cleared when execution is completed
There is a lag and an overlap counter for each priority level
Of the overlap counter by judging the count value of
The job indicated by the priority value
When executing, refer to the job executing flag and
When the running flag is set, multiple interrupts cause
Billing characterized by executing a suspended job
The job priority processing method according to claim 1 or 2 .
記基本時間を1つの位置として複数の位置を有し、基本
時間に対する各優先レベルのジョブ実行周期の整数倍に
対応して、該整数倍の間隔の位置に対応優先レベルのジ
ョブフラグをセットするデータが配置されたテーブルを
備え、 一定の基本時間毎に実行される定期割込み処理において
テーブルの位置を指定するポインタをインクリメントし
てテーブル参照を行い、等時間間隔処理のジョブを対象
として、各実行周期毎のジョブ割込み要求を示すジョブ
フラグをセットすることを特徴とする請求項1ないし請
求項3のいずれかに記載のジョブの優先処理方法。4. A job for equal time interval processing, having a plurality of positions with the basic time as one position, and corresponding to an integer multiple of the job execution cycle of each priority level with respect to the basic time, the integer Equipped with a table in which the data for setting the job flag of the corresponding priority level is placed at the position of the doubled interval, and the table is referenced by incrementing the pointer that specifies the table position in the periodic interrupt processing that is executed at fixed basic time intervals. It was carried out, as a target jobs isochronous process, priority processing job according to any one of claims 1 to 3, characterized in that to set the job flag indicating a job interrupt requests for each execution cycle Method.
記基本時間を1つの位置として複数の位置を有し該基本
時間に対する最上位優先レベルから予め設定された中位
優先レベルまでの各優先レベルのジョブ実行周期の整数
倍に対応して該整数倍の間隔の位置に対応優先レベルの
ジョブフラグをセットするデータが配置された第1のテ
ーブルと、 等時間間隔処理のジョブを対象として、上記中位優先レ
ベルのジョブの実行周期を基本時間とし、該基本時間を
1つの位置として複数の位置を有し、該基本時間に対す
る最下位優先レベルまでの各優先レベルのジョブ実行周
期の整数倍に対応して該整数倍の間隔の位置に対応優先
レベルのジョブフラグをセットするデータが配置された
第2のテーブルとを備え、 一定の基本時間毎に実行される定期割込み処理において
上記第1のテーブルの位置を指定するポインタをインク
リメントして第1のテーブル参照を行うと共に上記中位
優先レベルのジョブの実行周期に対応して上記第2のテ
ーブルの位置を指定するポインタをインクリメントして
第2のテーブル参照を行い、等時間間隔処理のジョブを
対象として、各実行周期毎のジョブ割込み要求を示すジ
ョブフラグをセットすることを特徴とする請求項1ない
し請求項3のいずれかに記載のジョブの優先処理方法。5. A job of equal time interval processing, having a plurality of positions with the basic time as one position, each priority from the highest priority level to the preset intermediate priority level for the basic time. The first table in which the data for setting the job flag of the priority level corresponding to the integer multiple of the job execution cycle of the level is arranged at the position of the integer multiple, and the job of the equal time interval processing is targeted. The execution cycle of the medium priority level job is set as a basic time, the basic time is defined as one position, and a plurality of positions are provided. An integer multiple of the job execution cycle of each priority level up to the lowest priority level with respect to the basic time. And a second table in which data for setting the job flag of the corresponding priority level is arranged at the position of the integer multiple interval corresponding to In the interrupt processing, the pointer designating the position of the first table is incremented to refer to the first table and the position of the second table is designated corresponding to the execution cycle of the medium priority level job. 4. The job flag indicating a job interrupt request for each execution cycle is set for the job of equal time interval processing by incrementing the pointer to perform the second table reference. Priority processing method of the job described in any one of .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP00211593A JP3442806B2 (en) | 1993-01-08 | 1993-01-08 | Job priority processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP00211593A JP3442806B2 (en) | 1993-01-08 | 1993-01-08 | Job priority processing method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06200820A JPH06200820A (en) | 1994-07-19 |
| JP3442806B2 true JP3442806B2 (en) | 2003-09-02 |
Family
ID=11520356
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP00211593A Expired - Fee Related JP3442806B2 (en) | 1993-01-08 | 1993-01-08 | Job priority processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3442806B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5307056B2 (en) * | 2010-03-05 | 2013-10-02 | ヤンマー株式会社 | Engine equipment |
-
1993
- 1993-01-08 JP JP00211593A patent/JP3442806B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH06200820A (en) | 1994-07-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3442806B2 (en) | Job priority processing method | |
| JP3337149B2 (en) | Engine crank position determination method | |
| JPH06200819A (en) | Work area setting method of microcomputer | |
| JPH06200821A (en) | Integrating method of job | |
| JP3324818B2 (en) | How to use engine crank position information | |
| JP3455243B2 (en) | How to use analog / digital conversion results | |
| JP3645576B2 (en) | Calculation method of engine rotation time | |
| JPH06249054A (en) | Method to read switch input data in vehicle control computer | |
| JP3530549B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JP3555689B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JP3442807B2 (en) | How to simulate engine rotation | |
| JPH0842434A (en) | Ignition timing control device for internal combustion engine | |
| JPH06257500A (en) | Grasping method for engine operation condition | |
| JP3331237B2 (en) | Injection start section setting method for each cylinder of a multi-cylinder engine | |
| JPH06249053A (en) | Analog/digital conversion method | |
| JP3530551B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JPH06257501A (en) | Engine half rotation time estimating method | |
| JPH06257502A (en) | Calculation of engine speed | |
| JP3294365B2 (en) | Engine ignition control method | |
| JP3294366B2 (en) | Method for discriminating energization state of ignition coil in engine ignition control | |
| JPH07103052A (en) | Fuel injection control method for multicylinder engine | |
| JPH06231004A (en) | Simulating method for analog/digital conversion | |
| JPH0719100A (en) | Method for setting injection starting internal for each cylinder of multi-cylinder engine | |
| JP3530550B2 (en) | Fuel injection control method for multi-cylinder engine | |
| JPS5968530A (en) | Control method of internal-combustion engine |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |