JPH0782363B2 - Vehicle control device - Google Patents

Vehicle control device

Info

Publication number
JPH0782363B2
JPH0782363B2 JP20292284A JP20292284A JPH0782363B2 JP H0782363 B2 JPH0782363 B2 JP H0782363B2 JP 20292284 A JP20292284 A JP 20292284A JP 20292284 A JP20292284 A JP 20292284A JP H0782363 B2 JPH0782363 B2 JP H0782363B2
Authority
JP
Japan
Prior art keywords
task
execution
microcomputer
control
data
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 - Lifetime
Application number
JP20292284A
Other languages
Japanese (ja)
Other versions
JPS6182203A (en
Inventor
朝治 源河
玲 関口
恭一 藤森
Original Assignee
株式会社ゼクセル
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社ゼクセル filed Critical 株式会社ゼクセル
Priority to JP20292284A priority Critical patent/JPH0782363B2/en
Publication of JPS6182203A publication Critical patent/JPS6182203A/en
Publication of JPH0782363B2 publication Critical patent/JPH0782363B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明は車輛用制御装置に関し、更に詳細に述べると、
マイクロコンピュータを用いて内燃機関装置をはじめと
する種々の車輛用装置を制御する車輛用制御装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a vehicle control device, and more specifically,
The present invention relates to a vehicle control device for controlling various vehicle devices such as an internal combustion engine device using a microcomputer.

従来の技術 マイクロコンピュータにより内燃機関車輛の制御を行な
うことが従来から行なわれてきているが、その制御内容
は年々複雑となり、且つ高精度の制御を行なうことが要
求されてきている。従って、マイクロコンピュータによ
り実行される制御項目の増加によって入出力項目が増加
し、マイクロコンピュータの負担が増大する傾向にある
上、制御の高速化が要求されて来ている。これらの要求
を満たすためには、より高性能のマイクロコンピュータ
を使用すればよいが、このようなマイクロコンピュータ
は高価であり、装置の製造コストを押し上げる要因とな
る。
2. Description of the Related Art Conventionally, control of an internal combustion engine vehicle has been performed by a microcomputer, but the control content has become complicated year by year, and high precision control is required. Therefore, as the number of control items executed by the microcomputer increases, the number of input / output items increases, the load on the microcomputer tends to increase, and the speedup of control is required. In order to meet these requirements, a higher performance microcomputer may be used, but such a microcomputer is expensive and causes a rise in the manufacturing cost of the device.

そこで、安価なマイクロコンピュータを効率よく使用す
るための方法が種々提案されており、例えばその1つと
して、プログラムを、タスクと呼ばれる小プログラムに
分割し、ソフトタイマによって起動され、エンジン制御
の制御機能に基づいて分類されたタスクの数だけソフト
タイマテーブルをRAMに設け、タスクの停止をそのソフ
トタイマテーブルの内容をクリアすることにより行うよ
うにしたものが提案されている(特開昭56−38541号公
報参照)。この方法は、各タスク毎に設けられたソフト
タイマの値に応じて各タスクを起動するものであり、各
タスクには夫々優先度が定められており、或るタスクの
実行中により優先度の高いタスクの起動要求が出される
と、現在実行中のタスクの情報を、RAM内に一旦退避さ
れる。そして、より優先度の高いタスクの実行が終了し
た後、RAM内にストアされている情報を取り出し、中断
していたタスクの実行を再開するものである。
Therefore, various methods for efficiently using an inexpensive microcomputer have been proposed. As one of them, for example, a program is divided into small programs called tasks, which are activated by a soft timer and have a control function for engine control. It is proposed that a soft timer table is provided in the RAM for the number of tasks classified based on the above, and the task is stopped by clearing the contents of the soft timer table (JP-A-56-38541). (See the official gazette). This method activates each task according to the value of the soft timer provided for each task, and each task has its own priority. When a high task activation request is issued, the information of the currently executing task is temporarily saved in RAM. Then, after the execution of the task with the higher priority is completed, the information stored in the RAM is taken out and the execution of the interrupted task is resumed.

発明が解決しようとする問題点 しかし、上述の方式では、タスクの優先度の数に応じて
メモリ内に退避領域を設けなければならないため、大容
量のメモリを必要とするほか、タスクの数が多くなる
と、タイマのセット、起動要求のサーチ等、ディスパッ
チャの負担が大きくなるという問題点を有している。更
に、タスクに優先順位を付し、且つ、割込みにより優先
順位の高いタスクの優先処理を行なっているので、優先
順位の低いタスクは処理が完了するまでに長い時間を要
し、場合によつては、優先順位の低いタスクは起動され
ないという不都合が生じる虞れがある。また、タスクの
数だけタイマが必要となり、タスクの数が多いと、メモ
リの必要容量が大巾に増えるという問題点も有してい
る。
Problems to be Solved by the Invention However, in the above method, since a save area must be provided in the memory according to the number of task priorities, a large amount of memory is required and the number of tasks is reduced. As the number increases, there is a problem that the load of the dispatcher becomes heavy, such as setting a timer and searching for an activation request. Furthermore, since the tasks are prioritized and the high priority tasks are prioritized by interrupts, the low priority tasks take a long time to complete. May cause an inconvenience that a low priority task is not activated. In addition, there is a problem that a timer is required for the number of tasks, and if the number of tasks is large, the required memory capacity increases significantly.

本発明の目的は、メモリ容量が少なくて済み、マイクロ
コンピュータの使用効率を著しく向上させ、制御性能の
改善を図ることができるようにした車輛用制御装置を提
供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a vehicle control device that requires a small memory capacity, can significantly improve the use efficiency of a microcomputer, and can improve control performance.

問題点を解決するための手段 上記問題点を解決するための本発明の特徴は、車輛用装
置を制御するための複数の制御サブルーチンプログラム
が実行されることにより車輛の制御が行なわれるように
構成された車輛用制御装置において、前記複数の制御サ
ブルーチンプログラムをストアしておくストア手段と、
それぞれの実行時間が略均一となるように1つ又は実行
優先度が同一程度である複数の制御サブルーチンプログ
ラムを構成要素として構成されている複数個のタスクと
その各実行優先度を示すタスクレベルデータを含んでお
りこれら複数個のタスクの実行優先度を定めるためのタ
スクテーブルが運転条件に応じて複数組ストアされてい
るメモリ手段と、前記タクスの各実行時間のうち最も長
い実行時間よりも長く設定された所定の一定時間間隔
で、タスクレベルデータに基づき、タスクレベルデータ
によって示される独行優先度が高いタスクほど実行頻度
が高くなるように、且つ所定の1実行周期においてこれ
ら複数個のタスクが少なくとも1回は実行されるよう
に、実行すべきタスクを次々と周期的に指定するための
指定手段と、該指定手段により指定されたタスクの制御
サブルーチンプログラムを前記ストア手段から取り出し
て割り込みなしで実行する実行手段とを備えて成る点に
ある。
Means for Solving the Problems A feature of the present invention for solving the above problems is that a vehicle is controlled by executing a plurality of control subroutine programs for controlling a vehicle device. In the above described vehicle control device, storing means for storing the plurality of control subroutine programs,
A plurality of tasks each including one or a plurality of control subroutine programs having the same execution priority so that the respective execution times are substantially uniform, and task level data indicating the respective execution priorities. A memory means in which a plurality of sets of task tables for determining execution priorities of these plurality of tasks are stored according to operating conditions, and a longer execution time than the longest execution time of each execution time of the task. Based on the task level data, at a set predetermined time interval, a task having a higher self-priority indicated by the task level data has a higher execution frequency, and a plurality of these tasks are executed in a predetermined one execution cycle. Designating means for periodically designating the tasks to be executed so that they are executed at least once, and the designating means. Certain control subroutine program of the designated task to the point comprising a means for executing without interruption is removed from said store means by.

作用 上述の構成によると、各プログラムは、実行パターンデ
ータに従って、プログラムの各実行時間のうち最も長い
時間よりも長く設定された所定の一定時間間隔で順次実
行されるので、各プログラムに対して起動間隔を定める
ためのソフトタイマを設ける必要がなく、また、1つの
プログラムが実行中に他のプログラムの割込みを受ける
こともないので、各プログラムは、結局、夫々に対して
予め定められた所定の周期で確実に実行される。また、
各プログラムが実行途中で中断しないので、無駄な時間
が大巾に減少し、高効率にて制御プログラムが実行され
る。
Action According to the above configuration, each program is sequentially executed according to the execution pattern data at a predetermined fixed time interval that is set longer than the longest time of each execution time of the program. Since there is no need to provide a soft timer for determining the interval and there is no interruption of one program during execution of another program, each program eventually ends up with a predetermined predetermined value for each program. It is surely executed in a cycle. Also,
Since each program is not interrupted during its execution, the wasted time is greatly reduced, and the control program is executed with high efficiency.

更に、各プログラムは、制御サブルーチンプログラム群
の内の1つ叉は複数から構成されるものであるから、各
プログラムの実行時間がほぼ等しくなるように各プログ
ラム内容の設定を行なうことが可能となり、これによ
り、極めて適切な実行周期を設定できるので、より一層
無駄時間の削減を図ることができ、制御速度を向上さ
せ、制御の高効率化に大きく寄与することができる。ま
た、制御プログラムの開発に当り、所謂モジュール化の
手法を応用することができ、プログラム開発の分業化が
図れる上に、保守も容易になる等の利点を有している。
Further, since each program is composed of one or a plurality of control subroutine programs, it is possible to set the contents of each program so that the execution times of the programs are almost equal. As a result, an extremely appropriate execution cycle can be set, so that the dead time can be further reduced, the control speed can be improved, and the control efficiency can be greatly improved. Further, in developing the control program, a so-called modularization method can be applied, which has an advantage that the program development can be divided into labor and the maintenance is easy.

実施例 第1図には、本発明の基本概念を示す概略構成図が示さ
れている。車輛用制御装置400は、車輛用装置401を、所
定の制御プログラムに従って制御するための装置であ
る。所定の制御プログラムは、予め複数のプログラム
(以下タスクと称する)に分割されており、各タスクに
対して与えられているコードをタスクの実行優先度に関
連して配列したテーブルが、メモリ手段402内に格納さ
れている。メモリ手段402内に格納されているテーブル
の内容は、読出手段403により、所定の規則に従って所
定の一定時間間隔で読出され、メモリ手段402から読出
されたコードは演算手段404に入力される。
Embodiment FIG. 1 is a schematic block diagram showing the basic concept of the present invention. The vehicle control device 400 is a device for controlling the vehicle device 401 according to a predetermined control program. The predetermined control program is divided into a plurality of programs (hereinafter referred to as tasks) in advance, and a table in which the codes given to each task are arranged in relation to the execution priority of the task is a memory means 402. It is stored in. The contents of the table stored in the memory means 402 are read by the reading means 403 at a predetermined fixed time interval according to a predetermined rule, and the code read from the memory means 402 is input to the computing means 404.

ストア手段405には、各タスクを構成する要素としての
複数の制御サブルーチンプログラムがストアされてお
り、メモリ手段402から演算手段404にコードが入力され
ると、入力されたコードにより特定されるタスクの実行
に必要な1つ又は複数の制御サブルーチンプログラムを
ストア手段405から呼び出し、必要ならば演算手段404に
入力されているデータを使用して、そのタスクを実行す
る。
The storing means 405 stores a plurality of control subroutine programs as elements constituting each task. When a code is input from the memory means 402 to the calculating means 404, the task specified by the input code is stored. One or more control subroutine programs required for execution are called from the storing means 405, and if necessary, the task is executed using the data input to the calculating means 404.

このようにして、タスクを順次実行することにより、車
輛用装置401の制御が行なわれる。
In this manner, the vehicle device 401 is controlled by sequentially executing the tasks.

上述の制御装置は、ストアド・プログラム方式のディジ
タル計算機であるマイクロコンピュータを用いて実現す
ることができ、以下、具体的な実施例について本発明を
詳細に説明する。
The above-described control device can be realized by using a microcomputer which is a stored program digital computer, and the present invention will be described in detail below with reference to specific embodiments.

第2図には、本発明をオートクルーズ機能付のディーゼ
ル機関車輛の制御装置に適用した場合の、車輛用制御装
置の一実施例の制御システムの全体構成図が示されてい
る。車輛用制御装置1は、燃料噴射ポンプ2から燃料の
供給を受けるディーゼル機関3によって駆動される車輛
(図示せず)の制御を行なうための装置であり、第1及
び第2マイクロコンピュータ4,5を備えている。
FIG. 2 shows an overall configuration diagram of a control system of an embodiment of a vehicle control device when the present invention is applied to a diesel locomotive vehicle control device with an auto cruise function. The vehicle control device 1 is a device for controlling a vehicle (not shown) driven by a diesel engine 3 supplied with fuel from a fuel injection pump 2, and includes first and second microcomputers 4, 5, 4. Is equipped with.

第1マイクロコンピュータ4は、燃料噴射ポンプの噴射
量の制御、燃料噴射ポンプ2の噴射タイミングの制御及
び車速制御のための制御演算を主として行ない、第2マ
イクロコンピュータ5は第1マイクロコンピュータ4で
実行される制御演算に必要な各種の演算処理を主として
行なう構成となっている。第1及び第2マイクロコンピ
ュータ4,5は、それぞれ、ROMを内蔵しているほか、外部
に設けられたランダム・アクセス・メモリ(RAM)6と
接続されており、RAMは、後述するようにして、第1及
び第2マイクロコンピュータ4,5のいずれか一方とRAM6
とを選択的に接続することができるバスライン22を介し
て、第1叉は第2マイクロコンピュータ4,5によりそれ
ぞれアクセスできるように構成されている。
The first microcomputer 4 mainly performs control calculation for controlling the injection amount of the fuel injection pump, control of injection timing of the fuel injection pump 2, and vehicle speed control, and the second microcomputer 5 is executed by the first microcomputer 4. Is configured to mainly perform various kinds of arithmetic processing required for the control calculation. Each of the first and second microcomputers 4 and 5 has a built-in ROM and is connected to a random access memory (RAM) 6 provided outside. , One of the first and second microcomputers 4 and 5 and RAM6
The first and second microcomputers 4 and 5 are respectively configured to be accessible via a bus line 22 capable of selectively connecting and.

第1マイクロコンピュータ4には、バスライン7を介し
て、アナログ・ディジタルコンバータ(A/D)8が接続
されている。A/D8には、ディーゼル機関3の冷却水温度
を示す水温信号TWを出力するための水温センサ9、吸気
温度を示す吸気温信号TAを出力するための吸気温センサ
10、燃料温度を示す燃温信号TFを出力するための燃温セ
ンサ11及び吸気圧力を示す吸気圧信号PIを出力するため
の吸気圧センサ12が接続されており、これらの各センサ
からの上述の信号はA/D8においてディジタル信号に交換
され、バスライン7を介して第1マイクロコンピュータ
4に入力される。
An analog / digital converter (A / D) 8 is connected to the first microcomputer 4 via a bus line 7. The A / D 8 is a water temperature sensor 9 for outputting a water temperature signal TW indicating the cooling water temperature of the diesel engine 3 and an intake temperature sensor for outputting an intake temperature signal TA indicating the intake temperature.
10, a fuel temperature sensor 11 for outputting a fuel temperature signal TF indicating the fuel temperature and an intake pressure sensor 12 for outputting an intake pressure signal PI indicating the intake pressure are connected. Signal is exchanged with the A / D 8 for a digital signal and input to the first microcomputer 4 via the bus line 7.

ディーゼル機関3の出力軸に装着されている角度センサ
13からは、ディーゼル機関3内の各シリンダピストンが
上死点に到達するタイミング情報を有する交流信号ACが
出力され、この交流信号ACは、波形処理回路14におい
て、ディーゼル機関3の上死点タイミングを示すタイミ
ングパルスから成る上死点パルス信号TNに交換され、第
1マイクロコンピュータ4に入力される。更に、ディー
ゼル機関3への燃料噴射タイミングを検出するため、燃
料噴射弁15に装着された針弁リフトセンサ16からのリフ
ト信号LSは、波形成形回路17において波形成形され、所
定の基準の気筒における実際の燃料噴射タイミングを示
す噴射タイミングパルスTNLとして第1マイクロコンピ
ュータ4に入力される。
Angle sensor mounted on the output shaft of diesel engine 3
An AC signal AC having timing information at which each cylinder piston in the diesel engine 3 reaches the top dead center is output from the 13 and the AC signal AC is output to the top dead center timing of the diesel engine 3 in the waveform processing circuit 14. Is exchanged with a top dead center pulse signal TN composed of a timing pulse indicating the signal of FIG. Further, in order to detect the fuel injection timing to the diesel engine 3, the lift signal LS from the needle valve lift sensor 16 mounted on the fuel injection valve 15 is waveform-shaped in the waveform shaping circuit 17, and the predetermined reference cylinder An injection timing pulse TNL indicating the actual fuel injection timing is input to the first microcomputer 4.

アクセルセンサ18は、アクセルペダル19の操作量に従っ
たアクセル信号APPを出力し、アクセル信号APPは第1マ
イクロコンピュータ4に入力される。
The accelerator sensor 18 outputs an accelerator signal APP according to the operation amount of the accelerator pedal 19, and the accelerator signal APP is input to the first microcomputer 4.

一方、第2マイクロコンピュータ5には、車速を検出す
るための車速センサ23から出力され、その時々の車速を
示す車速データTUSPが入力されると共に、オートクルー
ズ制御のためのクルーズスイッチ20が第2マイクロコン
ピュータ5の入力ポートに接続されており、クルーズス
イッチ20の操作に応じた定速走行制御を行なうことがで
きる構成となっている。
On the other hand, the second microcomputer 5 receives the vehicle speed data TUSP, which is output from the vehicle speed sensor 23 for detecting the vehicle speed and indicates the vehicle speed at that time, and the cruise switch 20 for the automatic cruise control is secondly provided. It is connected to the input port of the microcomputer 5 and has a configuration capable of performing constant-speed traveling control according to the operation of the cruise switch 20.

尚、スタートスイッチ21は、ディーゼル機関3の始動の
際に始動信号STを第1マイクロコンピュータ4に供給す
る。
The start switch 21 supplies a start signal ST to the first microcomputer 4 when starting the diesel engine 3.

第1マイクロコンピュータ4に取り込まれた情報は、バ
スライン22を介してRAM6に一旦転送され、RAM6への転送
データの内容は、同じくバスライン22を介して第2マイ
クロコンピュータ5内に更に転送することができる。
尚、このデータ転送のためのバスライン22の接続の切換
は、各マイクロコンピュータ4,5内において行なわれ
る。
The information taken into the first microcomputer 4 is once transferred to the RAM 6 via the bus line 22, and the content of the transfer data to the RAM 6 is further transferred into the second microcomputer 5 via the bus line 22. be able to.
The switching of the connection of the bus line 22 for this data transfer is performed in each of the microcomputers 4 and 5.

第1マイクロコンピュータ4における噴射量制御演算結
果は、ディジタル・アナログ変換器(D/A)26を介して
燃料噴射ポンプ2のコントロールラック27の位置制御を
行なうためのサーボ回路28に入力され、その時々の機関
の運転条件に見合った最適な噴射量がディーゼル機関3
に供給されるよう、コントロールラック27の位置が制御
される。符号29で示されるのは、制御等に異常が生じた
時に点灯する警報ランプである。
The injection amount control calculation result in the first microcomputer 4 is input via a digital / analog converter (D / A) 26 to a servo circuit 28 for controlling the position of the control rack 27 of the fuel injection pump 2, Diesel engine 3 has the optimum injection amount that matches the operating conditions of the engine from time to time.
The position of the control rack 27 is controlled so as to be supplied to the. Reference numeral 29 is an alarm lamp that lights up when an abnormality occurs in control or the like.

第2マイクロコンピュータ5には、第1マイクロコンピ
ュータ4において実行される燃料噴射ポンプ2の噴射時
期制御のための演算結果が与えられ、この演算結果に従
ってタイミング制御信号TCSが第2マイクロコンピュー
タ5から出力され、増幅器30を介してタイマ31に供給さ
れ、これにより、最適タイミング制御が行なわれる。
A calculation result for injection timing control of the fuel injection pump 2 executed in the first microcomputer 4 is given to the second microcomputer 5, and a timing control signal TCS is output from the second microcomputer 5 according to this calculation result. And is supplied to the timer 31 via the amplifier 30, whereby optimum timing control is performed.

第3図には、第2図に示した第1マイクロコンピュータ
4のプログラム構成図が示されている。既に述べたよう
に、第1マイクロコンピュータ4は、主として、噴射量
及び噴射タイミングの制御演算を実行するようにそのプ
ログラムが定められており、先ず、電源の投入に応答し
て初期化処理41が行なわれ、ここで、RAM6及び各レジス
タの内容をクリアし、各入力情報の読込みが行なわれ、
他の割込処理がなければ、バックグラウンドジョブの処
理42が実行される。バックグラウンドジョブは、後述す
る割込によって実行されるタスク等の処理のあい間に実
行されるものであり、図示の実施例では、回転速度の演
算、タイマ31の駆動周波数の演算が行なわれる。
FIG. 3 shows a program configuration diagram of the first microcomputer 4 shown in FIG. As described above, the program of the first microcomputer 4 is mainly set so as to execute the control calculation of the injection amount and the injection timing, and first, the initialization process 41 is performed in response to the power-on. Then, the contents of RAM6 and each register are cleared and each input information is read.
If there is no other interrupt process, the background job process 42 is executed. The background job is executed during processing such as a task executed by an interrupt, which will be described later. In the illustrated embodiment, the calculation of the rotation speed and the calculation of the drive frequency of the timer 31 are performed.

第2マイクロコンピュータ5がRAM6をアクセスする際
に、バスリクエストを出力すると、割込NMIがかけら
れ、通常では第1マイクロコンピュータ4に接続されて
いるバスライン22がバスフリー処理43によりフリーとな
り、第2マイクロコンピュータ5によるRAM6のアクセス
が終了すると、バスライン22は再び第1マイクロコンピ
ュータ4に接続される。
When the second microcomputer 5 accesses the RAM 6 and outputs a bus request, an interrupt NMI is applied, and normally the bus line 22 connected to the first microcomputer 4 becomes free by the bus free processing 43, When the access of the RAM 6 by the second microcomputer 5 is completed, the bus line 22 is connected to the first microcomputer 4 again.

外部のタイマより発生する信号により割込TIMがかけら
れると、これにより警報ランプ29のON/OFF駆動を行なう
ための警報ランプ駆動処理44が実行される。
When the interrupt TIM is applied by a signal generated by an external timer, the alarm lamp driving process 44 for ON / OFF driving the alarm lamp 29 is executed.

フリーランニングカウンタの値が予め定められた所定値
に達した場合に出力されるモニタ信号により割込MONが
掛けられる。このモニタ信号により第1割込処理45が実
行され、一定時間Δt後に再びモニタ信号が出力される
ようフリーランニングカウンタのセットが行なわれる。
次に、同期処理46(後述)が実行され、しかる後、いず
れのタスクを実行するのかを決定するためのモニタ処理
47が実行される。ここで、タスクとは、第1マイクロコ
ンピュータ4において実行すべき制御演算を分割した1
つ1つの独立したプログラムを言い、各タスクは、更
に、制御サブルーチンプログラム群48に含まれている1
つ叉は複数の制御サブルーチンプログラムから成り立っ
ている。そして、各タスクの実行時間は時間Δt以内で
あって、且つばらつきがなるべく少なくなるように配慮
して定めてある。従って、タスク処理49において行なわ
れる各タスクの処理は、割込MONが掛けられた場合に、
その与えられた割込処理時間内に必ず終了するようにな
っている。
An interrupt MON is applied by a monitor signal output when the value of the free running counter reaches a predetermined value. The first interrupt process 45 is executed by this monitor signal, and the free running counter is set so that the monitor signal is output again after a fixed time Δt.
Next, a synchronization process 46 (described later) is executed, and thereafter, a monitor process for determining which task is to be executed.
47 is executed. Here, the task is a 1 obtained by dividing the control operation to be executed in the first microcomputer 4.
Each independent program, and each task is included in the control subroutine program group 48.
The fork consists of multiple control subroutine programs. The execution time of each task is set within the time Δt, and the variation is set to be as small as possible. Therefore, the processing of each task performed in the task processing 49 is performed when an interrupt MON is applied.
It is supposed to be completed within the given interrupt processing time.

モニタ処理47において定められるタスクの実行順序は、
各タスクの優先度に関連して定められており、優先度の
高いタスクは、実行頻度が高くなるように定められてい
る。タスクの実行順序は、第1マイクロコンピュータ4
内のROMにストアされているタスクテーブルの内容に従
って定められる。タスクテーブルは、後述するように、
各タスクの起動周期、起動順序を考慮して各タスクを示
すコードをマトリクス状に配列して成るテーブルであ
る。
The execution order of the tasks defined in the monitor process 47 is
It is defined in relation to the priority of each task, and the tasks with high priority are defined to be executed more frequently. The order of execution of tasks is the first microcomputer 4
It is determined according to the contents of the task table stored in the internal ROM. The task table, as described below,
This is a table in which codes indicating each task are arranged in a matrix in consideration of the activation cycle and the activation order of each task.

一般に、各タスクの起動周期及び起動順序は、機関の運
転状態によって異なるものであり、従って、本実施例で
は、後で詳しく述べるように、始動時(モード0)、低
速回転時(モード1)及び高速回転時(モード2)に対
する3枚のテーブルが用意されている。
Generally, the starting cycle and the starting order of each task differ depending on the operating state of the engine. Therefore, in this embodiment, as will be described later in detail, at the time of starting (mode 0) and at low speed rotation (mode 1). And three tables for high speed rotation (mode 2) are prepared.

尚、これらのテーブルに従って、各タスクがとのように
起動されるかは、後述する。
Whether each task is activated according to these tables will be described later.

タスク処理49の実行が終了すると、次の割込みが生じる
までバックグランドジョブの処理42が実行されている。
次のモニタ信号が出力されると、モニタ処理47におい
て、上述のタスクテーブルに従って定められる次のタス
クの処理がタスク処理49において行なわれる。
When the task processing 49 is completed, the background job processing 42 is executed until the next interrupt occurs.
When the next monitor signal is output, in the monitor process 47, the process of the next task determined according to the above task table is performed in the task process 49.

噴射タイミングパルスTNLの発生により、割込NLが実行
され、第3割込処理51が実行される。第3割込処理51
は、噴射タイミングパルスTNLの発生タイミングにより
噴射進角検出のためのソフトカウンタを起動させる。そ
して、上死点パルス信号TNの発生により割込TDCが実行
され、第2割込処理50によって、噴射タイミングパルス
TNLに対応する上死点パルス信号TNによって上記ソフト
カウンタの計数動作を停止させ、その計数結果より噴射
進角値に関連したデータtNLの演算を行なう(第4図
(a),(b)参照)。第2割込処理50では、また、上
死点パルス信号TNの連続した2つのパルスの時間間隔に
関連したデータtNの演算を行なう(第4図(a)参
照)。
When the injection timing pulse TNL is generated, the interrupt NL is executed and the third interrupt process 51 is executed. Third interrupt processing 51
Activates a soft counter for detecting the injection advance angle according to the generation timing of the injection timing pulse TNL. Then, the interrupt TDC is executed by the generation of the top dead center pulse signal TN, and the injection timing pulse is generated by the second interrupt processing 50.
The counting operation of the soft counter is stopped by the top dead center pulse signal TN corresponding to TNL, and the data t NL related to the injection advance value is calculated from the counting result (FIGS. 4 (a) and 4 (b)). reference). In the second interrupt processing 50, data t N related to the time interval between two consecutive pulses of the top dead center pulse signal TN is also calculated (see FIG. 4 (a)).

次に、第5図を参照して、第2マイクロコンピュータ5
のプログラム構成について説明する。
Next, referring to FIG. 5, the second microcomputer 5
The program configuration of will be described.

電源の投入叉は第1マイクロコンピュータ4が第2マイ
クロコンピュータ5に対してリセットをかけた場合に初
期化処理61が実行され、モニタ処理62及びタスク処理63
が実行されるが、ここでは、第1マイクロコンピュータ
4の制御演算に伴なう所要の演算処理のタスクが実行さ
れる。この演算処理の内容については後で詳しく述べ
る。
When the power is turned on or the first microcomputer 4 resets the second microcomputer 5, the initialization process 61 is executed, and the monitor process 62 and the task process 63 are performed.
Is executed, but here, the task of the required arithmetic processing associated with the control calculation of the first microcomputer 4 is executed. The details of this arithmetic processing will be described later in detail.

第1マイクロコンピュータ4からの演算リクエストがあ
ると、割込NMIがかけられ、フラグセット処理64におい
て演算要求のフラグがセットされる。
When there is a calculation request from the first microcomputer 4, an interrupt NMI is applied and a flag of calculation request is set in the flag setting process 64.

外部タイマ信号に応答して割込TIMがかけられ、第4割
込処理65において、RAM6より、タイマ31の駆動用パルス
信号の周期とそのデューティ比データとを読込み、デュ
ーティ比に関連した時間データtDTRの作成を行なう。そ
して、クルーズスイッチ20の状態を読み込みRAM6にスト
アするスイッチ処理66が実行される。
An interrupt TIM is applied in response to the external timer signal, and in the fourth interrupt processing 65, the period of the driving pulse signal of the timer 31 and its duty ratio data are read from the RAM 6 and the time data related to the duty ratio is read. t Create DTR . Then, a switch process 66 for reading the state of the cruise switch 20 and storing it in the RAM 6 is executed.

車速センサ23から車速に関連して出力される車速データ
TUSPが出力されることに応答して、割込VSPがかけら
れ、信号TUSPの発生周期の検出が行なわれる(周期読込
処理67)。
Vehicle speed data output from the vehicle speed sensor 23 in relation to the vehicle speed
In response to the output of TUSP, the interrupt VSP is applied and the generation cycle of the signal TUSP is detected (cycle reading processing 67).

フリーランニングカウンタの値が所定の値となることに
よって割込TCVがかけられ、タイマ31の駆動信号の反転
を行ない、これと同時に、駆動信号を反転すべき次のタ
イミングまでの所要時間をセットする反転処理68が実行
される。これにより、所望の周期で所望のデューティ比
の駆動信号が出力されることになる。
When the value of the free-running counter reaches a predetermined value, an interrupt TCV is applied, and the drive signal of the timer 31 is inverted, and at the same time, the time required to invert the drive signal is set. Inversion processing 68 is executed. As a result, a drive signal having a desired duty ratio is output at a desired cycle.

以下に、モニタ割込みによって実行される周期処理46、
モニタ処理47及びタスク処理49の各処理についてより詳
細に説明するが、その前に、第1マイクロコンピュータ
4において実行される制御を第6図を参照して説明す
る。
Below, the periodic processing 46 executed by the monitor interrupt,
Each process of the monitor process 47 and the task process 49 will be described in more detail, but before that, the control executed in the first microcomputer 4 will be described with reference to FIG.

第6図には、第1マイクロコンピュータ4により実行さ
れる、燃料噴射量の制御系統70と、噴射タイミングの制
御系統90とが示されており、先ず、燃料噴射量の制御系
統70から説明する。
FIG. 6 shows a fuel injection amount control system 70 and an injection timing control system 90 that are executed by the first microcomputer 4. First, the fuel injection amount control system 70 will be described. .

制御系統70は、符号71乃至76で示される6種類の噴射量
演算部を有している。アクセルQ演算部71では、アクセ
ルペダル19の操作に従った噴射量を演算しその結果がデ
ータQAPPとして出力される。アイドルQ演算部72は、ア
イドル運転時に必要な噴射量を演算しその結果がデータ
QIDLとして出力される。クルーズQ演算部73は、定車速
走行に必要な噴射量を演算し、その結果がデータQCR
して出力される。フルQ演算部74は、噴射量の最大値を
機関速度の関数として定められている所定の最大噴射量
特性を示すデータQFULを演算出力する。スモークQ演算
部75は、所定のスモーク限界に従う噴射量を示すデータ
QSMKを演算出力し、スタートQ演算部76は始動増量を示
す噴射量データQSTを演算出力する。
The control system 70 has six types of injection amount calculators denoted by reference numerals 71 to 76. The accelerator Q calculator 71 calculates the injection amount according to the operation of the accelerator pedal 19 and outputs the result as data Q APP . The idle Q calculator 72 calculates the injection amount required during idle operation, and the result is data.
Output as Q IDL . The cruise Q calculation unit 73 calculates the injection amount required for traveling at a constant vehicle speed, and the result is output as data Q CR . The full Q computing unit 74 computes and outputs data Q FUL indicating a predetermined maximum injection amount characteristic in which the maximum value of the injection amount is determined as a function of the engine speed. The smoke Q calculator 75 is a data indicating the injection amount according to a predetermined smoke limit.
The Q SMK is calculated and output, and the start Q calculation unit 76 calculates and outputs the injection amount data Q ST indicating the increase in the starting amount.

データQAPPとQIDLとは加算部77にて加算され、その加算
出力データとデータQCRとは、最大値選択部(MAX)78に
入力され、大きい方のデータが出力される。データ
QFUL,QSMK及び最大値選択部78からの選択データは最小
値選択部(MIN)79に入力され、最も小さい値のデータ
が目標噴射量データとして取出される。この目標噴射量
データは、機関の始動時以外の場合に適用され、機関の
始動時においては、データQSTが目標噴射量データとな
る。スイッチ80はスタートスイッチ21の操作に応じて出
力される始動信号STにより制御され、始動信号STが出力
されている場合にはデータQSTを選択し、それ以外の場
合にはMIN79からの出力データを選択するように作動す
る。
The data Q APP and Q IDL are added by the addition unit 77, and the addition output data and the data Q CR are input to the maximum value selection unit (MAX) 78, and the larger data is output. data
The selection data from Q FUL , Q SMK and the maximum value selection unit 78 is input to the minimum value selection unit (MIN) 79, and the data with the smallest value is taken out as the target injection amount data. This target injection amount data is applied when the engine is not started, and the data Q ST is the target injection amount data when the engine is started. The switch 80 is controlled by the start signal ST output according to the operation of the start switch 21, and when the start signal ST is being output, the data Q ST is selected, otherwise, the output data from the MIN79. To select.

スイッチ80により選択されたデータは、燃温補正部81に
おいて、その時の燃料温度に応じた所定の補正係数が乗
ぜられ、これにより、燃料温度が変化しても、目標噴射
量データに従う量の燃料が得られるように目標噴射量デ
ータの補正が行なわれる。燃温補正部81において補正さ
れたデータは、ポンプ特性演算部82に入力され、入力さ
れた噴射量データをそのポンプ特性に従った位置データ
に変換するポンプ特性演算処理が行なわれた後、出力部
83から最終的な目標位置データPoutが出力され、このデ
ータPpotは、第2図に示されるように、D/A26を介して
サーボ回路28に入力される。
The fuel temperature correction unit 81 multiplies the data selected by the switch 80 by a predetermined correction coefficient according to the fuel temperature at that time, so that even if the fuel temperature changes, an amount of fuel that is in accordance with the target injection amount data is used. The target injection amount data is corrected so that The data corrected by the fuel temperature correction unit 81 is input to the pump characteristic calculation unit 82, and after the pump characteristic calculation processing for converting the input injection amount data into position data according to the pump characteristic is output. Department
The final target position data P out is output from 83, and this data P pot is input to the servo circuit 28 via the D / A 26 as shown in FIG.

噴射タイミングの制御系統90は、機関の運転状態に従っ
た目標の噴射時期を演算しその結果を示すデータTLD
出力するためのロードタイマ特性演算部91と、機関の冷
却水温に従った噴射タイミングの補正を行なうための補
正データを演算しその結果を示すデータTTWを出力する
ための水温補正値演算部92と、始動時における水温補正
データを演算しその結果を示すデータTTWSを出力するた
めの始動時水温補正値演算部93とを有しており、データ
TLDは、データTTW又はTTWSと加算部94において加算され
る。すなわち、データTTW及びTTWSは、機関が始動状態
にあるか否かを示す始動信号STにより切換制御されるス
イッチ95を介して、いずれか一方が加算部94に供給され
る構成であり、始動時にはデータTTWSが選択されてデー
タTLDと加算され、始動時以外の場合にはデータTTWが選
択されデータTLDと加算される。
The injection timing control system 90 calculates a target injection timing according to the operating state of the engine and outputs a data T LD showing the result, a load timer characteristic calculation unit 91, and an injection according to the cooling water temperature of the engine. A water temperature correction value calculation unit 92 for calculating correction data for timing correction and outputting data T TW indicating the result, and water temperature correction data at the time of starting and outputting data T TWS indicating the result It has a start-up water temperature correction value calculation unit 93 for
T LD is added to the data T TW or T TWS in the adder 94. That is, the data T TW and T TWS have a configuration in which one of them is supplied to the addition unit 94 via the switch 95 which is switch-controlled by the start signal ST indicating whether or not the engine is in the start state, At the time of starting, the data T TWS is selected and added to the data T LD, and at the time other than the time of starting, the data T TW is selected and added to the data T LD .

加算部94からの加算結果は、目標噴射タイミングデータ
として、実際の噴射タイミングを示す信号が入力されて
いる誤差演算部96に入力され、ここで噴射タイミング
(時期)の目標値と実際値との差分が演算され、その結
果を示す誤差データTEは、PID演算部97に入力され、PID
制御のために必要なデータ処理が施され後、その結果を
示すデータはパルス巾変調部(PWM)98に入力される。
The addition result from the addition unit 94 is input as the target injection timing data to the error calculation unit 96 to which the signal indicating the actual injection timing is input, and here, the target value and the actual value of the injection timing (timing) are compared. The difference is calculated, and the error data T E indicating the result is input to the PID calculation unit 97 and
After data processing necessary for control is performed, data indicating the result is input to the pulse width modulation unit (PWM) 98.

パルス巾変調部98には、タイマ31を駆動するパルス信号
の周波数を演算する駆動周波数演算部99からの演算デー
タが供給されており、パルス巾変調部98からは、駆動周
波数演算部99から供給されるデータに従った周波数で且
つそのデューティ比がPID演算部9からの出力データに
従って変化する、タイマ31を駆動するための駆動パルス
信号が出力される。この駆動パルス信号は、タイミング
制御信号TCSとして増幅器30を介してタイマ31内の制御
用バルブ(図示せず)に印加される(第2図参照)。
The pulse width modulation unit 98 is supplied with calculation data from the drive frequency calculation unit 99 that calculates the frequency of the pulse signal that drives the timer 31, and the pulse width modulation unit 98 is supplied from the drive frequency calculation unit 99. A drive pulse signal for driving the timer 31 is output, which has a frequency according to the data described above and whose duty ratio changes according to the output data from the PID calculator 9. This drive pulse signal is applied as a timing control signal TCS to a control valve (not shown) in the timer 31 via the amplifier 30 (see FIG. 2).

第6図に示す制御のための各演算をマイクロコンピュー
タにより実行するため、これらの制御に必要な演算が、
制御サブルーチンプログラムとしてまとめられており、
第7図には、第6図に対応させて、それらの制御サブル
ーチンプログラムが示されている。第7図において、各
ブロックの上段に演算内容を示し、下段には制御サブル
ーチン名が表示されている。これらの制御サブルーチン
プログラムがサブルーチン群として第1マイクロコンピ
ュータ4のROM内にストアされている。
Since each operation for control shown in FIG. 6 is executed by the microcomputer, the operation necessary for these controls is
It is organized as a control subroutine program,
FIG. 7 shows those control subroutine programs corresponding to FIG. In FIG. 7, the calculation contents are shown in the upper part of each block, and the control subroutine name is displayed in the lower part. These control subroutine programs are stored in the ROM of the first microcomputer 4 as a subroutine group.

第1表に、各制御サブルーチンプログラムの一覧表を示
す。
Table 1 shows a list of control subroutine programs.

これらの制御サブルーチンプログラムの実行時間は様々
であり、また、制御上要請される実行頻度もまた異なっ
ている。このようなサブルーチンプログラムを効率よく
実行するため、これらの制御サブルーチンプログラムの
1つ叉は複数から成る複数のタスクが定義され、そのタ
スクの実行優先度を考慮して、タスク単位に所定の時間
間隔でプログラムの起動が行なわれる構成となってい
る。
The execution time of these control subroutine programs varies, and the execution frequency required for control also differs. In order to efficiently execute such a subroutine program, one or a plurality of tasks of these control subroutine programs are defined, and in consideration of the execution priority of the task, a predetermined time interval is set for each task. It is configured to start the program in.

タスクの起動時間間隔は、タスクテーブルに基づいて定
められるが、運転条件によっては起動不要のタスクもあ
る等の理由から、その実行パターンは機関の運転条件に
よって変更するのが望ましいものである。このため、本
装置では、既述の如く、機関の運転条件を始動時(モー
ド0)、低回転域での運転時(モード1)及び高回転域
での運転時(モード2)の3つに分け、各モードに対し
て夫々専用のタスクテーブルが用意されている。各モー
ドに対するタスクテーブルは第2表乃至第4表に示され
ている。
Although the task activation time interval is determined based on the task table, it is desirable to change the execution pattern according to the operating conditions of the engine because there are tasks that do not need to be started depending on the operating conditions. Therefore, in this device, as described above, there are three engine operating conditions: at startup (mode 0), at low speed region (mode 1), and at high speed region (mode 2). There are separate task tables for each mode. The task tables for each mode are shown in Tables 2-4.

これらのタスクテーブルに掲げられているタスクの実行
順序について、モード0の場合を例にとって説明する。
The execution order of the tasks listed in these task tables will be described by taking the case of mode 0 as an example.

各タスクは、要求される実行頻度を考慮してタスクレベ
ル0〜8に分けられると共に、各タスクレベルにおいて
も、実行優先度の高い順に左側から並べられている。こ
のように配列された各タスクの起動、実行は下記に示さ
れるところにより行なわれる。
Each task is divided into task levels 0 to 8 in consideration of the required execution frequency, and each task level is also arranged from the left side in descending order of execution priority. The activation and execution of each task arranged in this way is performed as described below.

(イ)各タスクは、一定時間間隔毎に発生するモニタ割
込み毎に1つだけ起動され、次のモニタ割込の発生まで
にその実行を終了するものとし、他のタスクの実行中に
おいては他のタスクの割込み処理は行なわない。
(B) Only one task is activated for each monitor interrupt that occurs at regular time intervals, and its execution is terminated before the next monitor interrupt occurs, while other tasks are executing. No interrupt processing of the task is performed.

(ロ)モニタ割込みにより実行されるタスクの順序は、
タスクレベル0の各タスクはモニタ割込の21回毎に行な
われ、タスクレベル1の各タスクはモニタ割込の22回毎
に行なわれ、一般にタスクレベルkの各タスクはモニタ
割込の2k+1回毎に行なわれる。
(B) The order of tasks executed by the monitor interrupt is
Each task in the task level 0 is performed every two single monitor interrupts, each task of the task level 1 is performed every 2 two monitors interrupts, generally each task of the task level k is the monitor interruption Every 2 k + 1 times.

(ハ)同一タスクレベル内のタスクについては、そのタ
スクレベルに起動の順番が回ってくる毎に左側に配列さ
れているものから順次起動する。
(C) With respect to tasks within the same task level, the tasks arranged on the left side are sequentially activated each time the activation order reaches the task level.

従って、タスクテーブルはタスクの実行順序を示すもの
であり、どのタスクをタスクテーブルのどこに配置する
かは、そのタスクに対して要求される実行頻度と実行の
優先度とを考慮して適宜に定めることができる。
Therefore, the task table indicates the execution order of the tasks, and which task is to be placed in which part of the task table is appropriately determined in consideration of the execution frequency required for the task and the execution priority. be able to.

第8図には、第2表乃至第4表に示されるタスクテーブ
ルに基づいて各タスクを順序実行するため、第1マイク
ロコンピュータ4において実行されるモニタ割込のプロ
グラムの詳細フローチャートが示されている。モニタ割
込の実行が開始されると、先ず時間Δtの周期でモニタ
割込みを発生させるための処理として、フリーランニン
グカウンタの値YにΔtを加えたものをXにセットする
(ステップ110)。フリーランニングカウンタは、その
ときの値Yが所定値Xになったときモニタ割込みをかけ
る構成であるから、結局、上述の操作により、Δt時間
後に再びモニタ割込みがかけられることになり、以後、
Δt時間毎にモニタ割込みが掛けられることになる。
FIG. 8 shows a detailed flowchart of a monitor interrupt program executed in the first microcomputer 4 in order to execute each task in order based on the task tables shown in Tables 2 to 4. There is. When the execution of the monitor interrupt is started, first, the value Y of the free running counter plus Δt is set to X as a process for generating a monitor interrupt at a period of time Δt (step 110). Since the free-running counter is configured to issue a monitor interrupt when the value Y at that time reaches a predetermined value X, the monitor interrupt is issued again after Δt time by the above-mentioned operation, and thereafter,
A monitor interrupt will be issued every Δt time.

次いで、ステップ111において、タスクの起動がオーバ
ーラップして掛けられているか否かのチェックが行なわ
れ、オーバーラップしている場合には、現在実行中のタ
スクがそのまま継続して実行される。一方、オーバーラ
ップしていない場合には、ステップ112に進む。尚、オ
ーバーラップしているか否かの判別は、後述するフラグ
OLによって行なわれる。
Next, in step 111, it is checked whether or not the task activations are overlapped, and if they are overlapped, the currently executing task is continuously executed. On the other hand, if they do not overlap, the process proceeds to step 112. The flag to be described later is used to determine whether or not they overlap.
Performed by an office lady.

ステップ112においては、外部事象が発生しており、同
期処理の必要性があるか否かの判別を行ない、同期処理
要求がある場合にはステップ113において同期処理を行
ない、ステップ114に進む。ステップ112の判別結果がNO
の場合には、ステップ113を実行することなく、ステッ
プ114に進む。
In step 112, it is determined whether or not an external event has occurred and there is a need for synchronization processing. If there is a synchronization processing request, the synchronization processing is performed in step 113, and the process proceeds to step 114. NO in step 112
In the case of, the process proceeds to step 114 without executing step 113.

ステップ114では、現在タスクが実行されていることを
示すフラグOLを「1」とし、ソフトカウンタTCTRの値を
1だけ増加させる。そして以後のステップでは、このソ
フトカウンタTCTRの内容に従って、前述のタスクテーブ
ルを参照して、各タスクを所定の順序で実行する。
In step 114, the flag OL indicating that the task is currently being executed is set to "1" and the value of the soft counter TCTR is incremented by one. Then, in the subsequent steps, each task is executed in a predetermined order by referring to the above-mentioned task table according to the contents of the soft counter TCTR.

ソフトカウンタTCTRは2進の8ビットの出力を有し、20
の桁から27の桁までの8つの出力を有している。ステッ
プ115−0乃至115−7は、夫々カウンタTCTRの各ビット
の値が「0」か否かの判別を行なうステップであり、こ
れらのステップ115−0乃至115−7において、各ビット
が「0」か否かの判別が、最下位の桁から順々に最上位
まで行なわれる。ステップ115−0の判別結果はモニタ
割込みが2回行なわれる毎にYESとなり、一般にステッ
プ115−nについては2n+1回毎にYESとなる。また、ステ
ップ115−0から115−7までの判別結果が全てNOとなる
のは、換言すれば、カウンタTCTRの各ビットが全て
「1」となるのは、29回毎である。
Soft counter TCTR has an output of 8-bit binary, 2 0
It has eight outputs ranging from 1 to 2 7 digits. Steps 115-0 to 115-7 are steps for determining whether or not the value of each bit of the counter TCTR is "0", and in each of these steps 115-0 to 115-7, each bit is "0". Whether or not it is determined from the lowest digit to the highest digit in order. The determination result of step 115-0 is YES each time a monitor interrupt is performed twice, and generally, step 115-n is YES every 2 n + 1 times. Moreover, the the determination result is NO in all of steps 115-0 to 115-7 is, in other words, each bit of the counter TCTR all become "1" are each 2 9 times.

ステップ115−0乃至115−7においては、各タスクテー
ブルのどのレベルのタスクを選択すべきかの判別を行な
うものであり、上記説明から判るように、タスクレベル
0,1,0,2,0,1,0,3,・・・が順次選択されることになる。
In steps 115-0 to 115-7, which level of the task in each task table should be selected is determined. As can be seen from the above description, the task level
0,1,0,2,0,1,0,3, ... will be sequentially selected.

このようにして、タスクレベルの選択操作が実行された
のち、タスクテーブルの列の選択が行なわれるが、これ
を説明するに先だって、各タスクテーブルに示されてい
るタスクのアドレスがRAM6及びマイクロコンピュータの
ROM内においてどのようにストア、管理されているのか
を説明する。
In this way, after the task-level selection operation is executed, the columns of the task table are selected. Prior to explaining this, the address of the task shown in each task table is the RAM 6 and the microcomputer. of
Explain how it is stored and managed in ROM.

第9図には、ROM及びRAM内におけるメモリ構造が示され
ている。第1マイクロコンピュータのROM内には、アド
レスA000からA099までのアドレス領域内に第2表に示す
タスクのアドレスがデータとして図示の如くストアされ
ている。第2表の各欄の上段に示されているのはそのタ
スクの番号であり、第9図では、タスクを特定するため
にこの番号が用いられている。第3表及び第4表に示さ
れるタスクについても、同様にして、ROM内のアドレス
領域A100乃至A199及びA200乃至A299に夫々ストアされて
いる。
FIG. 9 shows the memory structure in the ROM and RAM. In the ROM of the first microcomputer, the addresses of the tasks shown in Table 2 are stored as data in the address area from addresses A000 to A099 as shown in the figure. What is shown in the upper part of each column of Table 2 is the task number, and in FIG. 9, this number is used to identify the task. Similarly, the tasks shown in Tables 3 and 4 are also stored in the address areas A100 to A199 and A200 to A299 in the ROM, respectively.

このアドレスの管理を行なうため、RAM6内には、変数PT
R0乃至PTR8が設けらけており、この変数によって、第2
表乃至第4表の任意のj列管理を行なっている。
In order to manage this address, the variable PT is stored in RAM6.
R0 to PTR8 are provided, and the second
Any column j management of Tables to 4 is performed.

更に、タスクテーブルの選択を管理するため、RAM6内に
は、変数TBLPTRが設けられており、TBLPTRがTBLTOP0の
場合には第2表に示されるモード0のテーブルを選択
し、TBLPTRがTBLTOP1の場合に、第3表に示されるモー
ド1のテーブルを選択し、TBLPTRがTBLTOP2の場合には
第4表に示されるモード2のテーブルを選択するように
なっている。更に、各テーブルの任意のi行の管理を行
なうため、RAM6内には変数TCTRが設けられており、TCTR
の値に従って、i行の指定を行なう構成となっている。
Further, in order to manage the selection of the task table, a variable TBLPTR is provided in RAM6. When TBLPTR is TBLTOP0, the mode 0 table shown in Table 2 is selected, and when TBLPTR is TBLTOP1. In addition, the mode 1 table shown in Table 3 is selected, and when TBLPTR is TBLTOP2, the mode 2 table shown in Table 4 is selected. In addition, a variable TCTR is provided in RAM6 to manage any i row in each table.
According to the value of, the i-th row is designated.

再び第8図に戻って説明を行なう。カウンタTCTRの値に
基づき、ステップ115−0乃至115−7によりタスクテー
ブルのi行の指定が順次行なわれることについすては既
に説明した。従って、今、i=1が選択された場合のj
列の選択動作について説明する。上述の3つのタスクテ
ーブルのどれを選択するかは、モード判断のタスクによ
り定められているTBLPTRの内容に従うこととなる。今、
モード0で作動しているとすると、TBLPTR=TBLTOP0で
あり、PTR1=0とすれば、Aの値は第9図からA010とな
る。(ステップ116−1) (A010+2)番地の内容は、T0041のアドレスであるか
ら、0000Hとは異なり(ステップ117−1)、従って、PT
R1←+2の操作が実行される(ステップ118−1)。若
し、A+2番地の内容が0000Hであれば、ステップ119−
1に進み、PTR1←0とされる。
Returning to FIG. 8 again, description will be made. It has already been described that the i row of the task table is sequentially designated in steps 115-0 to 115-7 based on the value of the counter TCTR. Therefore, now j when i = 1 is selected
The column selection operation will be described. Which of the above-mentioned three task tables is selected depends on the content of TBLPTR defined by the task of mode judgment. now,
If it is operating in mode 0, TBLPTR = TBLTOP0, and if PTR1 = 0, the value of A becomes A010 from FIG. (Step 116-1) Since the content of the address (A010 + 2) is the address of T0041, it is different from 0000H (Step 117-1).
The operation of R1 ← + 2 is executed (step 118-1). If the contents of address A + 2 are 0000H, step 119-
Proceed to 1 and PTR1 ← 0.

このようにしてA番地の内容が定められたならば、ステ
ップ120においてその番地へジャンプする(ステップ12
0)。従って、上述の例では、T00040のアドレスにジャ
ンプし、タスクT00040が起動され、実行される(ステッ
プ121)。しかる後、フラグOLが「0」とされ(ステッ
プ122)、モニター割込が終了することになる。上記で
は、i=1の場合について説明したが、i=1以外の場
合における動作も同様であるので、他のステップについ
ては符号のみを付し、説明を省略する。
When the content of the address A is determined in this way, the address is jumped to in step 120 (step 12).
0). Therefore, in the above example, the address T00040 is jumped to, and the task T00040 is activated and executed (step 121). After that, the flag OL is set to "0" (step 122), and the monitor interrupt ends. In the above, the case of i = 1 has been described, but the operation is the same in cases other than i = 1, therefore, only the reference numerals are attached to the other steps and the description thereof is omitted.

上述のモニター割込操作は、Δt時間毎にかけられ、そ
の度に、所要のタスクテーブルにて定められたところに
従い所要のタスクが起動され、実行される。
The monitor interrupt operation described above is performed every Δt time, and each time the required task is activated and executed according to the requirements defined in the required task table.

以上では、第1マイクロコンピュータ4のモニター割込
プログラムについて説明したが、次に、第2マイクロコ
ンピュータ5におけるタスクの起動について第10図及び
第11図を参照して説明する。
In the above, the monitor interrupt program of the first microcomputer 4 has been described. Next, activation of a task in the second microcomputer 5 will be described with reference to FIGS. 10 and 11.

第2マイクロコンピュータ5には、演算用サブルーチン
プログラムがストアされており、これらの各プログラム
は、第1マイクロコンピュータ5からの指令により始動
され、実行される構成である。図示の実施例では、演算
用サブルーチンプログラムとして第5表に示す4つのも
のが用意されており、第1マイクロコンピュータ4で制
御サブルーチンプログラムが実行される際に必要な計算
処理が、第2マイクロコンピュータ5で実行される。
The second microcomputer 5 stores a calculation subroutine program, and each of these programs is started and executed by a command from the first microcomputer 5. In the illustrated embodiment, four subroutines shown in Table 5 are prepared as calculation subroutine programs, and the calculation process required when the control subroutine program is executed by the first microcomputer 4 is the second microcomputer. It is executed in 5.

第1マイクロコンピュータ4において、或るタスクが実
行されている場合において、先ず、そのタスクの実行に
必要な演算データをサーチする(ステップ200)。次に
ステップ201においてRAM6の指令コードバッファが空い
ているか否かを判別し、空バッファがなければ、カウン
タTCTRを1つだけ減算し(ステップ202)、タスクを終
了する。従って、次のモニタ割込みでは再び同一のタス
クが起動される。このようにして、バッファ領域が空く
のを待つことになる。
When a certain task is being executed in the first microcomputer 4, first, the operation data necessary for executing the task is searched (step 200). Next, in step 201, it is judged whether or not the command code buffer of the RAM 6 is empty. If there is no empty buffer, the counter TCTR is decremented by 1 (step 202) and the task is ended. Therefore, at the next monitor interrupt, the same task is activated again. In this way, it waits until the buffer area becomes empty.

ステップ201の判別結果がYESとなると、指令コードをRA
M6に転送し、データが格納されていないブロックの先頭
アドレスETOPを更新する(ステップ203)。ステップ203
におけるデータの転送前において、バッファが全て空で
あったか否か(従って、現在の状態でいえばバッファが
1つだけデータを格納しているか否か)がステップ204
において判別される。判別結果がYESならば、第2マイ
クロコンピュータ5はアイドル状態を保っているので、
演算開始信号を第2マイクロコンピュータに送り、第2
マイクロコンピュータ5に割込みNMIをかける(ステッ
プ205)。ステップ204の判別結果がNOの場合には、ステ
ップ205を実行することなく、そのタスクの処理を終了
する。第2マイクロコンピュータ5は、割込NMIの実行
により、バッファが空いていることを示す空フラグを0
とし、バッファにデータがあることを示す(ステップ30
1)。
If the determination result in step 201 is YES, the command code is RA
The data is transferred to M6 and the start address ETOP of the block in which no data is stored is updated (step 203). Step 203
Before the transfer of the data in step (4), it is determined whether all the buffers are empty (thus, in the present state, whether or not the buffer stores only one data).
Is determined in. If the determination result is YES, the second microcomputer 5 remains in the idle state,
Send a calculation start signal to the second microcomputer
An interrupt NMI is applied to the microcomputer 5 (step 205). If the determination result of step 204 is NO, the process of the task ends without executing step 205. The second microcomputer 5 sets the empty flag indicating that the buffer is empty to 0 by executing the interrupt NMI.
To indicate that there is data in the buffer (step 30
1).

第2マイクロコンピュータは、バッファが全て空なら
ば、アイドル状態を保っており、割込NMIにより空フラ
グが0となったことに応答して(ステップ302)、第1
マイクロコンピュータ4に割込みNMIを掛けてバス要求
を出し、共通メモリであるRAM6をバスによって第2マイ
クロコンピュータ5に接続する(ステップ303)。即
ち、割込みNMIにより、第1マイクロコンピュータ4は
バスライン22を切離し、これにより第2マイクロコンピ
ュータ5はバスライン22を介してRAM6と接続される。
尚、この間、第1マイクロコンピュータ4は待ち状態と
なっている。しかる後、所要データが転送されているRA
M6内のアドレスBUFiよりデータを読み込み、BTOP0の更
新を行なう。(ステップ304)。即ち、BUFiのブロック
のデータを読み出した場合、BTOP←BUF(i+1)とす
る。しかし、第11図から判るように、バッファブロック
は4つがリング状にリンクされているため、i+1=4
ならば、BTOP←BUF0とすることになる。
If the buffers are all empty, the second microcomputer remains in the idle state, and responds to the empty flag being set to 0 by the interrupt NMI (step 302).
An interrupt NMI is applied to the microcomputer 4 to issue a bus request, and the RAM 6 which is a common memory is connected to the second microcomputer 5 by the bus (step 303). That is, the interrupt NMI causes the first microcomputer 4 to disconnect the bus line 22, so that the second microcomputer 5 is connected to the RAM 6 via the bus line 22.
During this time, the first microcomputer 4 is in a waiting state. After that, RA where the required data is transferred
Data is read from address BUFi in M6 and BTOP0 is updated. (Step 304). That is, when the data of the block of BUFi is read, BTOP ← BUF (i + 1). However, as can be seen from FIG. 11, since four buffer blocks are linked in a ring, i + 1 = 4
Then BTOP ← BUF0.

このようにして、データが読込まれた結果、バッファが
全て空になったか否かの判別が行なわれ(ステップ30
5)、その判別結果がYESであれば、空フラグを「1」に
セットし(ステップ306)、バスライン22の切離しを行
なう(ステップ307)。この場合には再び割込みNMIがか
かるのを待つ状態となる。一方、ステップ305の判別結
果がNOの場合には、ステップ306は実行されず、ステッ
プ307に進み、バスライン22の切離しのみを行なう。
In this way, it is determined whether or not all the buffers are empty as a result of reading the data (step 30
5) If the determination result is YES, the empty flag is set to "1" (step 306) and the bus line 22 is disconnected (step 307). In this case, the state of waiting for the interrupt NMI again occurs. On the other hand, if the determination result in step 305 is NO, step 306 is not executed, and the process proceeds to step 307, and only the bus line 22 is disconnected.

次に、ステップ308においてバッファから読込んだ演算
コードの解読を行ない、その結果に従って、割算処理
(ステップ309)、2次元補間処理(ステップ310)、3
次元補間処理(ステップ311)叉はPID処理(ステップ31
2)のいずれかの演算が実行される。
Next, in step 308, the operation code read from the buffer is decoded, and according to the result, division processing (step 309), two-dimensional interpolation processing (step 310), 3
Dimensional interpolation processing (step 311) or PID processing (step 31)
One of the operations in 2) is executed.

所要の演算が終了すると、再び第1マイクロコンピュー
タ4に対して割込みNMIをかけてバスの要求を行ない
(ステップ313)、演算結果をRAM6内のデータブロックB
UF4に格納し、(ステップ314)、ステップ302に戻り、
第1マイクロコンピュータ4から割込みNMIがかけられ
るのを待つことになる。
When the required calculation is completed, an interrupt NMI is again issued to the first microcomputer 4 to request the bus (step 313), and the calculation result is returned to the data block B in the RAM 6.
Store in UF4, (step 314), return to step 302,
It waits until the interrupt NMI is issued from the first microcomputer 4.

以上のようにして、各タスクがタスクテーブルに基づい
て順次起動され、各タスクを構成する所要の制御サブル
ーチンプログラムが第1マイクロコンピュータ4におい
て実行され、その時必要な演算用のサブルーチンが第2
マイクロコンピュータ5にて実行されることになる。上
述の如くして、各タスクが順次実行されることにより、
所望の車輛制御が達成されることになる。
As described above, the respective tasks are sequentially activated based on the task table, the required control subroutine programs constituting the respective tasks are executed in the first microcomputer 4, and the necessary arithmetic subroutines at that time are the second subroutine.
It is executed by the microcomputer 5. As described above, by executing each task in sequence,
The desired vehicle control will be achieved.

効果 本発明によれば、各タスク(プログラム)は、予め定め
られたそれらの実行順序に関する実行パターンデータで
あるテブルの内容に従って、タスクの各実行時間のうち
最も長い時間よりも長く設定された所定の一定時間間隔
で順次実行されるので、各タスクに対して起動間隔を定
めるためのソフトタイマを設ける必要がなく、また、1
つのタスクが実行中に他のタスクの割込みを受けること
もないので、各タスクは、結局、夫々に対して予め定め
られた所定の周期で確実に実行される。また、各タスク
が実行途中で中断しないので、無駄な時間が大巾に減少
し、高効率にて制御プログラムが実行される。
Effect According to the present invention, each task (program) is set to a predetermined time longer than the longest time of each execution time of the task according to the contents of the table which is the execution pattern data regarding the execution order determined in advance. Since it is executed sequentially at a fixed time interval, it is not necessary to provide a soft timer for determining the activation interval for each task.
Since one task does not receive an interrupt from another task during execution, each task is surely executed in a predetermined cycle which is predetermined for each event. In addition, since each task is not interrupted during execution, useless time is greatly reduced, and the control program is executed with high efficiency.

更に、各タスクは、制御サブルーチンプログラム群の内
の1つ叉は複数から構成されるものであるから、各タス
クの実行時間がほぼ等しくなるような各タスク内容の設
定を行なうことが可能になり、これにより、極めて適切
な実行周期を設定できるので、より一層無駄時間の削減
を図ることができ、制御速度を向上させ、制御の高効率
化に大きく寄与することができる。また、制御プログラ
ムの開発に当り、所謂モジュール化の手法を応用するこ
とができ、プログラム開発の分業化が図れる上に、保守
も用意になる等の利点も有している。
Further, since each task is composed of one or a plurality of control subroutine programs, it is possible to set the contents of each task so that the execution time of each task is almost equal. As a result, the extremely appropriate execution cycle can be set, so that the dead time can be further reduced, the control speed can be improved, and the control efficiency can be greatly improved. Further, in developing the control program, a so-called modularization method can be applied, which has an advantage that the program development can be divided into labor and maintenance can be prepared.

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

第1図は本発明の基本概念を示す概略構成図、第2図は
本発明による車輛用制御装置の一実施例の制御システム
の全体構成図、第3図は第2図に示した第1マイクロコ
ンピュータのプログラム構成図、第4図(a)及び第4
図(b)は第2図に示す装置の波形図、第5図は第2図
に示した第2マイクロコンピュータのプログラム構成
図、第6図は第1マイクロコンピュータにより実行され
る制御の内容を示すための制御系統図、第7図は第6図
に示す制御系統の各部の制御演算を行なう制御サブルー
チンプログラムを第6図に対比させて示した制御サブル
ーチンプログラムの説明図、第8図は第3図に示される
モニタ割込プログラムの詳細フローチャート、第9図は
第4図に示される装置の各メモリ内のメモリ構造を示す
図、第10図は第2マイクロコンピュータの作動を説明す
るための第1及び第2マイクロコンピュータのフローチ
ャート、第11図は第1及び第2マイクロコンピュータの
作動を説明するためのメモリ構造を示す図である。 1,400……車輛用制御装置、4……第1マイクロコンピ
ュータ、5……第2マイクロコンピュータ、6……ラン
ダム・アクセス・メモリ(RAM)、402……メモリ手段、
403……読出手段、404……演算手段、405……ストア手
段。
FIG. 1 is a schematic configuration diagram showing the basic concept of the present invention, FIG. 2 is an overall configuration diagram of a control system of an embodiment of a vehicle control device according to the present invention, and FIG. 3 is a first configuration shown in FIG. Microcomputer program configuration diagram, FIG. 4 (a) and FIG.
2B is a waveform diagram of the apparatus shown in FIG. 2, FIG. 5 is a program configuration diagram of the second microcomputer shown in FIG. 2, and FIG. 6 shows the contents of control executed by the first microcomputer. FIG. 7 is an explanatory diagram of a control subroutine program in which FIG. 7 shows a control subroutine program for performing control calculation of each part of the control system shown in FIG. 6 in comparison with FIG. 6, and FIG. 3 is a detailed flowchart of the monitor interrupt program shown in FIG. 3, FIG. 9 is a diagram showing a memory structure in each memory of the apparatus shown in FIG. 4, and FIG. 10 is a diagram for explaining the operation of the second microcomputer. FIG. 11 is a flow chart of the first and second microcomputers, and FIG. 11 is a diagram showing a memory structure for explaining the operation of the first and second microcomputers. 1,400 ... Vehicle control device, 4 ... First microcomputer, 5 ... Second microcomputer, 6 ... Random access memory (RAM), 402 ... Memory means,
403 ... reading means, 404 ... calculation means, 405 ... store means.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 藤森 恭一 埼玉県東松山市箭弓町3丁目13番26号 ヂ ーゼル機器株式会社東松山工場内 (56)参考文献 特開 昭56−111901(JP,A) 特開 昭59−38806(JP,A) ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Kyoichi Fujimori 3-13-26, Yasumicho, Higashimatsuyama City, Saitama Prefecture Diesel Equipment Co., Ltd. Higashimatsuyama Factory (56) Reference JP-A-56-111901 (JP, A) JP-A-59-38806 (JP, A)

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】車輛用装置を制御するための複数の制御サ
ブルーチンプログラムが実行されることにより車輛の制
御が行なわれるように構成された車輛用制御装置におい
て、 前記複数の制御サブルーチンプログラムをストアしてお
くストア手段と、 それぞれの実行時間が略均一となるように1つ又は実行
優先度が同一程度である複数の制御サブルーチンプログ
ラムを構成要素として構成されている複数個のタスクと
その各実行優先度を示すタスクレベルデータを含んでお
りこれら複数個のタスクの実行優先度を定めるためのタ
スクテーブルが運転条件に応じて複数組ストアされてい
るメモリ手段と、 前記タスクの各実行時間のうち最も長い実行時間よりも
長く設定された所定の一定時間間隔で、タスクレベルデ
ータに基づき、タスクレベルデータによって示される実
行優先度が高いタスクほど実行頻度が高くなるように、
且つ所定の1実行周期においてこれら複数個のタスクが
少なくとも1回は実行されるように、実行すべきタスク
を次々と周期的に指定するための指定手段と、 該指定手段により指定されたタスクの制御サブルーチン
プログラムを前記ストア手段から取り出して割り込みな
しで実行する実行手段と を備えて成ることを特徴とする車輛用制御装置。
1. A vehicle control device configured to control a vehicle by executing a plurality of control subroutine programs for controlling a vehicle device, wherein the plurality of control subroutine programs are stored. The storing means, the plurality of tasks constituted by one or a plurality of control subroutine programs having the same execution priority so that their execution times are substantially uniform, and their respective execution priorities Memory unit that stores task level data indicating the degree of execution and stores a plurality of task tables for determining the execution priority of these plurality of tasks according to the operating conditions, and the execution time of each of the tasks. Based on the task level data, the task level data is set at a predetermined fixed time interval that is set to be longer than the long execution time. As the task as the execution frequency execution priority is high as indicated by the data becomes high,
In addition, a designation means for periodically designating the tasks to be executed one after another so that the plurality of tasks are executed at least once in one predetermined execution cycle, and the task designated by the designating means. A control subroutine program for executing the control subroutine program from the storing means and executing the control subroutine program without interruption.
JP20292284A 1984-09-29 1984-09-29 Vehicle control device Expired - Lifetime JPH0782363B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20292284A JPH0782363B2 (en) 1984-09-29 1984-09-29 Vehicle control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20292284A JPH0782363B2 (en) 1984-09-29 1984-09-29 Vehicle control device

Publications (2)

Publication Number Publication Date
JPS6182203A JPS6182203A (en) 1986-04-25
JPH0782363B2 true JPH0782363B2 (en) 1995-09-06

Family

ID=16465379

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20292284A Expired - Lifetime JPH0782363B2 (en) 1984-09-29 1984-09-29 Vehicle control device

Country Status (1)

Country Link
JP (1) JPH0782363B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0825407B2 (en) * 1986-08-19 1996-03-13 アイシン精機株式会社 Speed control device
JP6281463B2 (en) * 2014-10-03 2018-02-21 株式会社デンソー Control device

Also Published As

Publication number Publication date
JPS6182203A (en) 1986-04-25

Similar Documents

Publication Publication Date Title
GB2037009A (en) Engine control system
JP2002189606A (en) Processing execution device and storage medium
JPS6232343B2 (en)
JP4241462B2 (en) Control unit and microcomputer
US5968159A (en) Interrupt system with fast response time
US5974346A (en) Method for controlling technical processes
JPH0782363B2 (en) Vehicle control device
JPH0256250B2 (en)
EP1785849B1 (en) Inter-CPU data transfer device
US6490509B1 (en) Car controlling unit using a multitasking system
EP1327935B1 (en) Electronic control unit with task return processing
JPS6181233A (en) Car control device
US20030172215A1 (en) Interrupt- controller
JPS6181232A (en) Car control device
JP2000199450A (en) Engine control device
JPS6181235A (en) Car control device
EP1248192B1 (en) Processing execution apparatus having data reference limiting function
JPH0991154A (en) Stack allocating method and control equipment
JPS6181236A (en) Car control device
JP2020091540A (en) Information processing device
JPH1139172A (en) Electronic controller
CN1040588C (en) Computer system for sequential and servo control
CN1019336B (en) Microprocessor vectored interrupts
JP2001323840A (en) Control unit for automobile
JPH0512173A (en) Information processor