JPH0256250B2 - - Google Patents
Info
- Publication number
- JPH0256250B2 JPH0256250B2 JP59202924A JP20292484A JPH0256250B2 JP H0256250 B2 JPH0256250 B2 JP H0256250B2 JP 59202924 A JP59202924 A JP 59202924A JP 20292484 A JP20292484 A JP 20292484A JP H0256250 B2 JPH0256250 B2 JP H0256250B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- task
- microcomputer
- vehicle
- program
- 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
Links
Landscapes
- Controls For Constant Speed Travelling (AREA)
- Combined Controls Of Internal Combustion Engines (AREA)
- Control By Computers (AREA)
Description
産業上の利用分野
本発明は車輛用制御装置に関し、更に詳細に述
べると、マイクロコンピユータを用いて内燃機関
装置をはじめとする種々の車輛用装置を制御する
車輛用制御装置に関する。
従来の技術
マイクロコンピユータにより内燃機関車輛の制
御を行なうことが従来から行なわれてきている
が、その制御内容は年々複雑となり、且つ高精度
の制御を行なうことが要求されてきている。従つ
て、マイクロコンピユータにより実行される制御
項目の増加によつて入出力項目が増加し、マイク
ロコンピユータの負担が増大する傾向にある上、
制御の高速化が要求されて来ている。これらの要
求を満たすためには、より高性能のマイクロコン
ピユータを使用すればよいが、このようなマイク
ロコンピユータは高価であり、装置の製造コスト
を押し上げる要因となる。
そこで、安価なマイクロコンピユータを効率よ
く使用するための方法が種々提案されており、例
えばその1つとして、プログラムを、タスクと呼
ばれる小プログラムに分割し、ソフトタイマによ
つて起動され、エンジン制御の制御機能に基づい
て分類されたタスクの数だけのソフトタイマテー
ブルをRAMに設け、タスクの停止をそのソフト
タイマテーブルの内容をクリアすることにより行
うようにしたものが提案されている(特開昭56−
38541号公報参照)。この方法は、各タスク毎に設
けられたソフトタイマの値に応じて各タスクを起
動するものであり、各タスクには夫々優先度が定
められており、或るタスクの実行中により優先度
の高いタスクの起動要求が出されると、現在実行
中のタスクの情報を、RAM内に一旦退避させ
る。そして、より優先度の高いタスクの実行が終
了した後、RAM内にストアされている情報を取
り出し、中断していたタスクの実行を再開するも
のである。
発明が解決しようとする問題点
しかし、上述の方式では、タスクの優先度の数
に応じてメモリ内に退避領域を設けなければなら
ないため、大容量のメモリを必要とするほか、タ
スクの数が多くなると、タイマのセツト、起動要
求のサーチ等、デイスパツチヤの負担が大きくな
るという問題点を有している。更に、タスクに優
先順位を付し、且つ、割込みによりより優先順位
の高いタスクの優先処理を行なつているので、優
先順位の低いタスクは処理が完了するまでに長い
時間を要し、場合によつては、優先順位の低いタ
スクは起動されないという不都合が生じる虞れが
ある。また、タスクの起動周期、起動順序等は機
関の運転状態等によつて一般に変化するものであ
るが、運転状態の変化を検出して、各タスクに対
応するソフトタイマのタイマ時間のセツトをし直
さなければならず、プログラムが複雑となるとい
う不具合いがあつた。
本発明の目的は、メモリ容量が少なくて済み、
マイクロコンピユータの使用効率を著しく向上さ
せ、車輛の運転状態に応じ制御切換を容易に行な
うことができるようにした車輛用制御装置を提供
することにある。
問題点を解決するための手段
本発明の構成は、車輛用装置を制御するための
制御プログラムが複数の単位プログラムに分割さ
れてなり、間歇的に生じる起動要求に従つて前記
単位プログラムが選択的に実行されることにより
車輛の制御が行なわれるように構成された車輛用
制御装置において、起動要求のための要求信号を
少なくとも所定の一定時間をおいて間歇的に発す
る起動要求発生手段と、実行に要する時間が前記
一定時間よりは短くなるように定められた1つ又
は複数の単位プログラムからなる複数のプログラ
ムに対して夫々要求される起動周期に基づいて定
められた各プログラムの実行頻度を決める実行パ
ターンに関するデータが前記車輛の運転モードに
対応して複数組記憶されているメモリ手段と、前
記車輛の運転モードを検出してその検出結果に相
応する1組のデータを選択する選択手段と、前記
要求信号が発せられる度に前記選択手段により選
択された1組のデータに従う実行パターンに従つ
て所要の1つのプログラムを実行させる手段とを
備え、前記単位プログラムが前記選択された1組
のデータにより示される実行パターンに従つて繰
り返し実行される点に特徴を有する。
作 用
上述の構成によると、各プログラムが少なくと
も一定時間をあけて所定のパターンで起動要求が
生じるたびに実行される。この結果、実行パター
ンに従う頻度で各単位プログラム、すなわち各タ
スクが実行され、これにより要求される起動周期
で各単位プログラムが夫々実行される。
実行パターンは、車輛の運転モードに応じて予
め複数用意されており、車輛の運転モードが変化
しても、常に最適なプログラム実行頻度等が保証
される。従つてモニタプログラムには全く変更を
与えないで済むため、モニタの無駄時間は全く増
えず、搭載できるタスクの数を著しく増大させる
ことができ、プログラムが複雑となるのを避ける
ことができる。
この結果、車輛の運転状態に応じた適切な制御
を簡単に行なうことができ、効率のよい車輛用制
御装置を構成することができる。
実施例
第1図には、本発明の基本概念を示す概略構成
図が示されている。車輛用制御装置400は、所
要の車輛用装置を、所定の制御プログラムに従つ
て制御するための装置である。所定の制御プログ
ラムは、予め複数の単位プログラム(以下タスク
と称する)に分割されて、適宜の記憶装置401
内にストアされている。起動要求発生手段404
は、起動要求のための要求信号を少なくとも所定
の一定時間をおいて間歇的に発するための手段で
ある。そして、この要求信号に応答して実行され
るプログラムは、それぞれ1つ又は複数のタスク
から構成されており、これらの各プログラムは、
その実行に要する時間が上記一定時間よりは短く
なるようにタスクの組み合わせが考慮されてい
る。このようにして構成される複数のプログラム
に対して夫々要求される起動周期に基づいて、各
プログラムの実行頻度を決める実行パターンに関
するデータがメモリ手段402に記憶される。し
たがつて、要求される起動周期が同程度のタスク
が同一のプログラムに属するようにするのが望ま
しい。
ところで、各タスクの所要の起動頻度及び実行
されるべきタスクの種類は車輛の運転状態に応じ
て変わるものである。従つて、これに対処するた
め、メモリ手段402内には、予め定められた複
数の車輛運転状態に夫々見合つた複数の実行パタ
ーンに対応している複数組のデータがストアされ
ており、その時々の車輛運転状態に応じて所要の
1組のデータが選択手段403により選択され
る。
起動要求発生手段404は、タスクの起動要求
を発生するための手段であり、どのタスクの起動
を要求するかは、選択手段403により選択され
た1組のデータにより示される実行パターンに従
つて定められる。
起動要求発生手段404からの起動要求は、演
算手段405に入力され、その起動要求に従つ
て、所要のタスクが記憶装置401から呼び出さ
れ、演算手段405において、必要ならば演算手
段404に入力されているデータを使用して、そ
のタスクが実行される。
このようにして、各タスクが、その時々の車輛
運転状態に応じた実行パターンに従つて、その時
の運転モードに見合つた実行パターンに基づくタ
スクが所要の頻度で逐次実行されることにより、
車輛の制御が適切に効率よく行なわれる。
上述の制御装置は、ストアド・プログラム方式
のデイジタル計算機であるマイクロコンピユータ
を用いて実現することができ、以下、具体的な実
施例について本発明を詳細に説明する。
第2図には、本発明をオートクルーズ機能付の
デイーゼル機関車輛の制御装置に適用した場合
の、車輛用制御装置の一実施例の制御システムの
全体構成図が示されている。車輛用制御装置1
は、燃料噴射ポンプ2から燃料の供給を受けるデ
イーゼル機関3によつて駆動される車輛(図示せ
ず)の制御を行なうための装置であり、第1及び
第2マイクロコンピユータ4,5を備えている。
第1マイクロコンピユータ4は、燃料噴射ポン
プ2の噴射量の制御、燃料噴射ポンプ2の噴射タ
イミングの制御及び車速制御のための制御演算を
主として行ない、第2マイクロコンピユータ5は
第1マイクロコンピユータ4で実行される制御演
算に必要な各種の演算処理を主として行なう構成
となつている。第1及び第2マイクロコンピユー
タ4,5は、夫々、ROMを内蔵しているほか、
外部に設けられたランダム・アクセス・メモリ
(RAM)6と接続されており、RAM6は、後述
するようにして第1及び第2マイクロコンピユー
タ4,5のいずれか一方とRAM6とを選択的に
接続することができるバスライン22を介して、
第1又は第2マイクロコンピユータ4,5により
夫々アクセスできるように構成されている。
第1マイクロコンピユータ4には、バスライン
7を介して、アナログ・デイジタルコンバータ
(A/D)8が接続されている。A/D8には、
デイーゼル機関3の冷却水温度を示す水温信号
TWを出力するための水温センサ9、吸気温度を
示す吸気温信号TAを出力するための吸気温セン
サ10、燃料温度を示す燃温信号TFを出力する
ための燃温センサ11及び吸気圧力を示す吸気圧
信号PIを出力するための吸気圧センサ12が接
続されており、これらの各センサからの上述の信
号はA/D8においてデイジタル信号に変換さ
れ、バスライン7を介して第1マイクロコンピユ
ータ4に入力される。
デイーゼル機関3の出力軸に装着されている角
度センサ13からは、デイーゼル機関3内の各シ
リンダピストンが上死点に到達するタイミング情
報を有する交流信号ACが出力され、この交流信
号ACは、波形処理回路14においてデイーゼル
機関3の上死点タイミングを示すタイミングパネ
ルから成る上死点パルス信号TNに変換され、第
1マイクロコンピユータ4に入力される。更に、
デイーゼル機関3への燃料噴射タイミングを検出
するため燃料噴射弁15に装着された針弁リフト
センサ16からのリフト信号LSは、波形整形回
路17において波形整形され、所定の基準の気筒
における実際の燃料噴射タイミングを示す噴射タ
イミングパルスTNLとして第1マイクロコンピ
ユータ4に入力される。
アクセルセンサ18は、アクセルペダル19の
操作量に従つたアクセル信号APPを出力し、ア
クセル信号APPは第1マイクロコンピユータ4
に入力される。
一方、第2マイクロコンピユータ5には、車速
を検出するための車速センサ23から出力され、
その時々の車速を示す車速データTUSPが入力さ
れると共に、オートクルーズ制御のためのクルー
ズスイツチ20が第2マイクロコンピユータ5の
入力ポートに接続されており、クルーズスイツチ
20の操作に応じた定速走行制御を行なうことが
できる構成となつている。
尚、スタートスイツチ21は、デイーゼル機関
3の始動の際に始動信号STを第1マイクロコン
ピユータ4に供給する。
第1マイクロコンピユータ4に取り込まれた情
報は、バスライン22を介してRAM6に一旦転
送され、RAM6への転送データの内容は、同じ
くバスライン22を介して第2マイクロコンピユ
ータ5内に更に転送することができる。尚、この
データ転送のためのバスライン22の接続の切換
は、各マイクロコンピユータ4,5内において行
なわれる。
第1マイクロコンピユータ4における噴射量制
御演算結果は、デイジタル・アナログ変換器
(D/A)26を介して燃料噴射ポンプ2のコン
トロールラツク27の位置制御を行なうためのサ
ーボ回路28に入力され、その時々の機関の運転
条件に見合つた最適な噴射量がデイーゼル機関3
に供給されるよう、コントロールラツク27の位
置が制御される。符号29で示されるのは、制御
等に異常が生じた時に点灯する警報ランプであ
る。
第2マイクロコンピユータ5には、第1マイク
ロコンピユータ4において実行される燃料噴射ポ
ンプ2の噴射時期制御のための演算結果が与えら
れ、この演算結果に従つてタイミング制御信号
TCSが第2マイクロコンピユータ5から出力さ
れ、増幅器30を介してタイマ31に供給され、
これにより、最適タイミング制御が行なわれる。
第3図には、第2図に示した第1マイクロコン
ピユータ4のプログラム構成図が示されている。
既に述べたように、第1マイクロコンピユータ4
は、主として、噴射量及び噴射タイミングの制御
演算を実行するようにそのプログラムが定められ
ており、先ず、電源の投入に応答して初期化処理
41が行なわれ、ここで、RAM6及び各レジス
タの内容をクリアし、各入力情報の読込みが行な
われ、他の割込処理がなければ、バツクグラウン
ドジヨブの処理42が実行される。バツクグラウ
ンドジヨブは、後述する割込によつて実行される
タスク等の処理のあい間に実行されるものであ
り、図示の実施例では、回転速度の演算、タイマ
31の駆動周波数の演算が行なわれる。
第2マイクロコンピユータ5がRAM6をアク
セスする際に、バスリクエストを出力すると、割
込NMIがかけられ、通常では第1マイクロコン
ピユータ4に接続されているバスライン22がバ
スフリー処理43によりフリーとなり、第2マイ
クロコンピユータ5によるRAM6のアクセスが
終了すると、バスライン22は再び第1マイクロ
コンピユータ4に接続される。
外部のタイマより発生する信号により割込
TIMがかけられると、これにより警報ランプ2
9のON/OFF駆動を行なうための警報ランプ駆
動処理44が実行される。
フリーランニングカウンタの値が予め定められ
た所定値に達した場合に出力されるモニタ信号に
より割込MONが掛けられる。このモニタ信号に
より第1割込処理45が実行され、一定時間Δt
後に更びモニタ信号が出力されるようフリーラン
ニングカウンタのセツトが行なわれる。次に、同
期処理46(後述)が実行され、しかる後、いず
れのタスクを実行するのかを決定するためのモニ
タ処理47が実行される。ここで、タスクとは、
第1マイクロコンピユータ4において実行すべき
制御演算を分割した1つ1つの独立したプログラ
ムを言い、各タスクは、更に、制御サブル―チン
プログラム群48に含まれている1つ又は複数の
制御サブル―チンプログラムから成り立つてい
る。そして、各タスクの実行時間は時間Δt以内
であつて且つばらつきがなるべく少なくなるよう
に記慮して定めてある。従つてタスク処理49に
おいて行なわれる各タスクの処理は、割込MON
が掛けられた場合に、その与えられた割込処理時
間内に必ず終了するようになつている。
モニタ処理47において定められるタスクの実
行順序は、各タスクの優先度に関連して定められ
ており、優先度の高いタスクは、実行頻度が高く
なるように定められている。タスクの実行順序
は、第1マイクロコンピユータ4内のROMにス
トアされているタスクテーブルの内容に従つて定
められる。タスクテーブルは、後述するように、
各タスクの起動周期、起動順序を考慮して各タス
クを示すコードをマトリクス状に配列して成るテ
ーブルである。
一般に、各タスクの起動周期及び起動順序は、
機関の運転状態によつて異なるものであり、従つ
て、本実施例では、後で詳しく述べるように、始
動時(モード0)、低速回転時(モード1)及び
高速回転時(モード2)に対する3枚のテーブル
が用意されている。
尚、これらのテーブルに従つて、各タスクがど
のように起動されるのかは、後述する。
タスク処理49の実行が終了すると、次の割込
みが生じるまでバツクグラウンドジヨブの処理4
2が実行されている。次のモニタ信号が出力され
ると、モニタ処理47において、上述のタスクテ
ーブルに従つて定められる次のタスクの処理がタ
スク処理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参照)。
次に、第5図を参照して、第2マイクロコンピ
ユータ5のプログラム構成について説明する。
電源の投入又は第1マイクロコンピユータ4が
第2マイクロコンピユータ5に対してリセツトを
かけた場合に初期化処理61が実行され、モニタ
処理62及びタスク処理63が実行されるが、こ
こでは、第1マイクロコンピユータ4の制御演算
に伴なう所要の演算処理のタスクが実行される。
この演算処理の内容については後で詳しく述べ
る。
第1マイクロコンピユータ4からの演算リクエ
ストがあると、割込NMIがかけられ、フラグセ
ツト処理64において演算要求のフラグがセツト
される。
外部タイマ信号に応答して割込TIMがかけら
れ、第4割込処理65において、RAM6より、
タイマ31の駆動用パルス信号の周期とそのデユ
ーテイ比データとを読込み、デユーテイ比に関連
した時間データtDTYの作成を行なう。そして、ク
ルーズスイツチ20の状態を読み込みRAM6に
ストアするスイツチ処理66が実行される。
車速センサ23から車速に関連して出力される
車速データTUSPが出力されることに応答して、
割込VSPがかけられ、信号TUSPの発生周期の
検出が行なわれる(周期読込処理67)。
フリーランニングカウンタの値が所定の値とな
ることによつて割込TCVがかけられ、タイマ3
1の駆動信号の反転を行ない、これと同時に、駆
動信号を反転すべき次のタイミングまでの所要時
間をセツトする反転処理68が実行れる。これに
より、所望の周期で所望のデユーテイ比の駆動信
号が出力されることになる。
以下に、モニタ割込みによつて実行される同期
処理46、モニタ処理47及びタスク処理49の
各処理についてより詳細に説明するが、その前
に、第1マイクロコンピユータ4において実行さ
れる制御を第6図を参照して説明する。
第6図には、第1マイクロコンピユータ4によ
り実行される、燃料噴射量の制御系統70と、噴
射タイミングの制御系統90とが示されており、
先ず、燃料噴射量の制御系統70から説明する。
制御系統70は、符号71乃至76で示される
6種類の噴射量演算部を有している。アクセルQ
演算部71では、アクセルペダル19の操作に従
つた噴射量を演算しその結果がデータQAPPとして
出力される。アイドルQ演算部72は、アイドル
運転時に必要な噴射量を演算しその結果がデータ
QIDLとして出力される。クルーズQ演算部73
は、定車速走行に必要な噴射量を演算し、その結
果がデータQCRとして出力される。フルQ演算部
74は、噴射量の最大値を機関速度の関数として
定められている所定の最大噴射量特性を示すデー
タQFULを演算出力する。スモークQ演算部75
は、所定のスモーク限界に従う噴射量を示すデー
タQSMKを演算出力し、スタートQ演算部76は
始動増量を示す、噴射量データQSTを演算出力す
る。
データQAPPとQIDLとは加算部77にて加算さ
れ、その加算出力データとデータQCRとは、最大
値選択部(MAX)78に入力され、大きい方の
データが出力される。データQFUL,QSMK及び最大
値選択部78からの選択データは最小値選択部
(MIN)79に入力され、最も小さい値のデータ
が目標噴射量データとして取出される。この目標
噴射量データは、機関の始動時以外の場合に適用
され、機関の始動時においては、データQSTが目
標噴射量データとなる。スイツチ80はスタート
スイツチ21の操作に応じて出力される始動信号
STにより制御され、始動信号STが出力されてい
る場合にはデータQSTを選択し、それ以外の場合
にはMIN79からの出力データを選択するよう
に作動する。
スイツチ80により選択されたデータは、燃温
補正部81において、その時の燃料温度に応じた
所定の補正係数が乗ぜられ、これにより、燃料温
度が変化しても、目標噴射量データに従う量の燃
料が得られるように目標噴射量データの補正が行
なわれる。燃温補正部81において補正されたデ
ータは、ポンプ特性演算部82に入力され、入力
された噴射量データをそのポンプ特性に従つた位
置データに変換するポンプ特性演算処理が行なわ
れた後、出力部83から最終的な目標位置データ
POUTが出力され、このデータPOUTは、第2図に示
されるように、D/A26を介してサーボ回路2
8に入力される。
噴射タイミングの制御系統90は、機関の運転
状態に従つた目標の噴射時期を演算しその結果を
示すデータTLDを出力するためのロードタイマ特
性演算部91と、機関の冷却水温に従つた噴射タ
イミングの補正を行なうための補正データを演算
しその結果を示すデータTTWを出力するための水
温補正値演算部92と、始動時における水温補正
データを演算しその結果を示すデータTTWSを出
力するための始動時水温補正値演算部93とを有
しており、データTLDは、データTTW又はTTWSと
加算部94において加算される。すなわち、デー
タTTW及びTTWSは、機関が始動状態にあるか否か
を示す始動信号STにより切換制御されるスイツ
チ95を介して、いずれか一方が加算部94に供
給される構成であり、始動時にはデータTTWSが
選択されてデータTLDと加算され、始動時以外の
場合にはデータTTWが選択されデータTLDと加算
される。
加算部94からの加算結果は、目標噴射タイミ
ングデータとして、実際の噴射タイミングを示す
信号が入力されている誤差演算部96に入力さ
れ、ここで噴射タイミング(時期)の目標値と実
際値との差分が演算され、その結果を示す誤差デ
ータTEは、PID演算部97に入力され、PID制御
のために必要なデータ処理が施された後、その結
果を示すデータはパルス巾変調部(PWM)98
に入力される。
パルス巾変調部98には、タイマ31を駆動す
るパルス信号の周波数を演算する駆動周波数演算
部99からの演算データが供給されており、パル
ス巾変調部98からは、駆動周波数演算部99か
ら供給されるデータに従つた周波数でそのデユー
テイ比がPID演算部9からの出力データに従つて
変化する、タイマ31を駆動するための駆動パル
ス信号が、出力される。この駆動パルス信号は、
タイミング制御信号TCSとして増幅器30を介
してタイマ31内の制御用バルブ(図示せず)に
印加される。(第2図参照)。
第6図に示す制御のための各演算をマイクロコ
ンピユータにより実行するため、これらの制御に
必要な演算が、制御サブルーチンプログラムとし
てまとめられており、第7図には、第6図に対応
させて、それらの制御サブルーチンプログラムが
示されている。第7図において、各ブロツクの上
段に演算内容を示し、下段には制御サブルーチン
名が表示されている。これらの制御サブルーチン
プログラムがサブルーチン群として第1マイクロ
コンピユータ4のROM内にストアされている。
第1表に、各制御サブルーチンプログラムの一
覧表を示す。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a vehicle control device, and more specifically, to a vehicle control device that uses a microcomputer to control various vehicle devices including an internal combustion engine device. BACKGROUND OF THE INVENTION Although internal combustion engine vehicles have been controlled by microcomputers for a long time, the control content has become more complex year by year, and high-precision control has been required. Therefore, as the number of control items executed by the microcomputer increases, the number of input/output items increases, and the burden on the microcomputer tends to increase.
There is a growing demand for faster control. In order to meet these demands, a microcomputer with higher performance may be used, but such a microcomputer is expensive and becomes a factor that increases the manufacturing cost of the device. Therefore, various methods have been proposed to efficiently use inexpensive microcomputers. For example, one of them is to divide a program into small programs called tasks, which are started by a soft timer and used to control engine control. It has been proposed that a RAM is provided with as many soft timer tables as the number of tasks classified based on control functions, and tasks are stopped by clearing the contents of the soft timer tables (Japanese Patent Laid-Open No. 56−
(See Publication No. 38541). In this method, each task is started according to the value of a soft timer set for each task, and each task has its own priority. When a high task activation request is issued, information about the currently executing task is temporarily saved in RAM. After the execution of the task with a higher priority is completed, the information stored in the RAM is retrieved and the execution of the suspended task is resumed. Problems to be Solved by the Invention However, in the above-mentioned method, a save area must be provided in memory according to the number of priorities of tasks, which requires a large amount of memory and also increases the number of tasks. If the number increases, there is a problem in that the burden on the dispatcher, such as setting a timer and searching for activation requests, increases. Furthermore, since tasks are prioritized and tasks with a higher priority are prioritized by interrupts, tasks with a lower priority may take a long time to complete, and in some cases As a result, there is a risk that a task with a low priority will not be activated. In addition, although the startup cycle and startup order of tasks generally change depending on the operating state of the engine, changes in the operating state are detected and the timer time of the soft timer corresponding to each task is set. There was a problem that had to be fixed and the program became complicated. The purpose of the present invention is to reduce the memory capacity,
It is an object of the present invention to provide a control device for a vehicle that can significantly improve the usage efficiency of a microcomputer and easily switch control according to the driving condition of the vehicle. Means for Solving the Problems The present invention has a configuration in which a control program for controlling a vehicle device is divided into a plurality of unit programs, and the unit programs are selectively activated in accordance with activation requests that occur intermittently. In a vehicle control device configured to control a vehicle by executing a start request, a start request generating means for intermittently issuing a request signal for a start request at least at predetermined fixed time intervals; The execution frequency of each program is determined based on the activation cycle required for each of a plurality of programs consisting of one or more unit programs whose time required for the program is determined to be shorter than the predetermined time. a memory means storing a plurality of sets of data regarding execution patterns corresponding to the driving mode of the vehicle; a selection means for detecting the driving mode of the vehicle and selecting one set of data corresponding to the detection result; means for executing one required program according to an execution pattern according to the set of data selected by the selection means each time the request signal is issued, and the unit program is configured to execute the set of data selected by the unit program. It is characterized in that it is repeatedly executed according to the execution pattern indicated by . Operation According to the above-described configuration, each program is executed every time a startup request occurs in a predetermined pattern at least at a certain time interval. As a result, each unit program, that is, each task, is executed at a frequency according to the execution pattern, and thereby each unit program is executed at the required startup cycle. A plurality of execution patterns are prepared in advance according to the driving mode of the vehicle, and even if the driving mode of the vehicle changes, the optimal program execution frequency is always guaranteed. Therefore, there is no need to make any changes to the monitor program, so the wasted time of the monitor does not increase at all, the number of tasks that can be loaded can be significantly increased, and the program can be prevented from becoming complicated. As a result, appropriate control according to the driving state of the vehicle can be easily performed, and an efficient vehicle control device can be constructed. Embodiment FIG. 1 shows a schematic configuration diagram showing the basic concept of the present invention. The vehicle control device 400 is a device for controlling required vehicle devices according to a predetermined control program. A predetermined control program is divided in advance into a plurality of unit programs (hereinafter referred to as tasks) and stored in an appropriate storage device 401.
stored inside. Startup request generation means 404
is a means for intermittently issuing a request signal for requesting activation at least at predetermined fixed time intervals. Each program executed in response to this request signal is composed of one or more tasks, and each of these programs is
The combination of tasks is taken into consideration so that the time required for their execution is shorter than the above-mentioned fixed time. Data regarding execution patterns that determine the frequency of execution of each program is stored in the memory means 402 based on the activation cycle required for each of the plurality of programs configured in this manner. Therefore, it is desirable that tasks that require similar startup cycles belong to the same program. Incidentally, the required activation frequency of each task and the type of task to be executed change depending on the driving state of the vehicle. Therefore, in order to cope with this, a plurality of sets of data corresponding to a plurality of execution patterns respectively corresponding to a plurality of predetermined vehicle driving states are stored in the memory means 402, and data sets are stored in the memory means 402. A required set of data is selected by the selection means 403 according to the driving state of the vehicle. The activation request generation means 404 is a means for generating a task activation request, and which task is requested to be activated is determined according to an execution pattern indicated by a set of data selected by the selection means 403. It will be done. The activation request from the activation request generation means 404 is input to the calculation means 405, and according to the activation request, a required task is called from the storage device 401, and the calculation means 405 inputs the task to the calculation means 404 if necessary. The task is performed using the data currently available. In this way, each task is sequentially executed at the required frequency according to an execution pattern that is appropriate for the driving mode at that time, according to an execution pattern that corresponds to the vehicle driving state at the time.
Vehicle control is performed appropriately and efficiently. The above-mentioned control device can be realized using a microcomputer which is a stored program type digital computer, and the present invention will be described in detail below with reference to specific embodiments. FIG. 2 shows an overall configuration diagram of a control system of an embodiment of a vehicle control device in which the present invention is applied to a control device for a diesel locomotive with an auto-cruise function. 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 and 5. There is. The first microcomputer 4 mainly performs control calculations for controlling the injection amount of the fuel injection pump 2, controlling the injection timing of the fuel injection pump 2, and controlling the vehicle speed. The configuration is such that it mainly performs various calculation processes necessary for the control calculations to be executed. The first and second microcomputers 4 and 5 each have a built-in ROM, and
It is connected to an externally provided random access memory (RAM) 6, and the RAM 6 selectively connects either one of the first and second microcomputers 4 and 5 to the RAM 6 as described later. Via the bus line 22 that can
It is configured so that it can be accessed by the first or second microcomputer 4, 5, respectively. An analog/digital converter (A/D) 8 is connected to the first microcomputer 4 via a bus line 7 . In A/D8,
Water temperature signal indicating cooling water temperature of diesel engine 3
Water temperature sensor 9 for outputting TW, intake temperature sensor 10 for outputting intake temperature signal TA indicating intake air temperature, fuel temperature sensor 11 for outputting fuel temperature signal TF indicating fuel temperature, and intake pressure. An intake pressure sensor 12 for outputting an intake pressure signal PI is connected, and the above-mentioned signals from these sensors are converted into digital signals in the A/D 8 and sent to the first microcomputer 4 via the bus line 7. is input. The angle sensor 13 attached to the output shaft of the diesel engine 3 outputs an alternating current signal AC having timing information when each cylinder piston in the diesel engine 3 reaches the top dead center, and this alternating current signal AC has a waveform In the processing circuit 14, it is converted into a top dead center pulse signal TN consisting of a timing panel indicating the top dead center timing of the diesel engine 3, and is input to the first microcomputer 4. Furthermore,
The lift signal LS from the needle valve lift sensor 16 attached to the fuel injection valve 15 in order to detect the fuel injection timing to the diesel engine 3 is waveform-shaped in the waveform shaping circuit 17, and is converted to the actual fuel in the cylinder based on a predetermined standard. It is input to the first microcomputer 4 as an injection timing pulse TNL indicating the injection timing. 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 sent to the first microcomputer 4.
is input. On the other hand, the second microcomputer 5 receives an output from the vehicle speed sensor 23 for detecting the vehicle speed.
Vehicle speed data TUSP indicating the current vehicle speed is input, and a cruise switch 20 for auto-cruise control is connected to the input port of the second microcomputer 5. The structure is such that it can be controlled. Note that the start switch 21 supplies a starting signal ST to the first microcomputer 4 when starting the diesel engine 3. The information taken into the first microcomputer 4 is once transferred to the RAM 6 via the bus line 22, and the contents of the data transferred to the RAM 6 are further transferred to the second microcomputer 5 via the bus line 22. be able to. Incidentally, switching of the connection of the bus line 22 for this data transfer is performed within each microcomputer 4, 5. The injection amount control calculation result in the first microcomputer 4 is inputted to a servo circuit 28 for controlling the position of the control rack 27 of the fuel injection pump 2 via a digital/analog converter (D/A) 26. Diesel engine 3 has the optimum injection amount depending on the engine operating conditions.
The position of the control rack 27 is controlled so that it is supplied with the desired amount of water. Reference numeral 29 indicates an alarm lamp that lights up when an abnormality occurs in the control or the like. The second microcomputer 5 is given the calculation result for the injection timing control of the fuel injection pump 2 executed by the first microcomputer 4, and according to this calculation result, the timing control signal is
TCS is output from the second microcomputer 5 and supplied to the timer 31 via the amplifier 30,
As a result, optimal timing control is performed. FIG. 3 shows a program configuration diagram of the first microcomputer 4 shown in FIG.
As already mentioned, the first microcomputer 4
The program is mainly determined to execute control calculations for injection amount and injection timing, and first, initialization processing 41 is performed in response to turning on the power, and here, the RAM 6 and each register are The contents are cleared, each input information is read, and if there is no other interrupt processing, background job processing 42 is executed. The background job is executed between tasks and other processes executed by interrupts, which will be described later. In the illustrated embodiment, the calculation of the rotational speed and the driving frequency of the timer 31 are It is done. When the second microcomputer 5 outputs a bus request when accessing the RAM 6, an interrupt NMI is generated, and the bus line 22, which is normally connected to the first microcomputer 4, is freed by the bus free processing 43. When the second microcomputer 5 finishes accessing the RAM 6, the bus line 22 is connected to the first microcomputer 4 again. Interrupted by a signal generated from an external timer
When TIM is applied, this will cause alarm lamp 2
Warning lamp drive processing 44 for performing the ON/OFF drive of 9 is executed. An interrupt MON is generated by a monitor signal that is 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 a certain period of time Δt
A free running counter is set so that a monitor signal is outputted later. Next, a synchronization process 46 (described later) is executed, and then a monitor process 47 for determining which task is to be executed is executed. Here, the task is
Each task is an independent program obtained by dividing the control calculations to be executed in the first microcomputer 4, and each task further includes one or more control subroutines included in the control subroutine program group 48. It consists of a chin program. The execution time of each task is determined to be within the time Δt and to minimize variations. Therefore, the processing of each task performed in the task processing 49 is performed by interrupt MON
When the interrupt is multiplied, the interrupt processing always ends within the given interrupt processing time. The execution order of the tasks determined in the monitor process 47 is determined in relation to the priority of each task, and tasks with higher priorities are determined to be executed more frequently. The execution order of the tasks is determined according to the contents of the task table stored in the ROM within the first microcomputer 4. The task table is 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 activation order of each task. Generally, the startup cycle and startup order of each task are as follows:
This differs depending on the operating state of the engine, and therefore, in this example, as will be described in detail later, the There are 3 tables available. Note that how each task is activated according to these tables will be described later. When task processing 49 finishes executing, background job processing 4 continues until the next interrupt occurs.
2 is being executed. When the next monitor signal is output, in monitor processing 47, processing of the next task determined according to the above-described task table is performed in task processing 49. Upon generation of the injection timing pulse TNL, the interrupt NL is executed, and the third interrupt process 51 is executed. The third interrupt process 51 is an injection timing pulse
A soft counter for injection advance angle detection is activated based on the TNL generation timing. Then, the interrupt TDC is executed by the generation of the top dead center pulse signal TN, and by the second interrupt processing 50, the counting operation of the soft counter is performed by the top dead center pulse signal TN corresponding to the injection timing pulse TNL. is stopped, and data tNL related to the injection advance value is calculated from the counting result (see Figures 4a and 4b). Second
In the interrupt processing 50, the top dead center pulse signal TN
The data t N related to the time interval between two consecutive pulses is calculated (see FIG. 4a). Next, the program configuration of the second microcomputer 5 will be explained with reference to FIG. When the power is turned on or when the first microcomputer 4 resets the second microcomputer 5, an initialization process 61 is executed, and a monitor process 62 and a task process 63 are executed. Necessary arithmetic processing tasks associated with control arithmetic by the microcomputer 4 are executed.
The content of this arithmetic processing will be described in detail later. When there is an arithmetic request from the first microcomputer 4, an interrupt NMI is generated, and a flag for the arithmetic request is set in flag setting processing 64. An interrupt TIM is applied in response to the external timer signal, and in the fourth interrupt processing 65, from the RAM 6,
The period of the drive pulse signal of the timer 31 and its duty ratio data are read, and time data tDTY related to the duty ratio is created. Then, a switch process 66 for reading the state of the cruise switch 20 and storing it in the RAM 6 is executed. In response to the vehicle speed data TUSP being output from the vehicle speed sensor 23 in relation to the vehicle speed,
An interrupt VSP is applied, and the generation cycle of the signal TUSP is detected (cycle reading process 67). When the value of the free running counter reaches a predetermined value, an interrupt TCV is applied and timer 3
At the same time, an inversion process 68 is executed to invert the first drive signal and set the required time until the next timing at which the drive signal should be inverted. As a result, a drive signal with a desired duty ratio is output at a desired period. The synchronization process 46, the monitor process 47, and the task process 49 executed by monitor interrupts will be explained in detail below. This will be explained with reference to the figures. 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 explained. The control system 70 has six types of injection amount calculation sections indicated by symbols 71 to 76. Axel Q
The calculation unit 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 calculation unit 72 calculates the injection amount required during idling operation and stores the result as data.
Q Output as IDL . Cruise Q calculation section 73
calculates the injection amount required for driving at a constant speed, and outputs the result as data Q CR . The full Q calculation unit 74 calculates 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. Smoke Q calculation section 75
calculates and outputs data Q SMK indicating the injection amount according to a predetermined smoke limit, and the start Q calculation unit 76 calculates and outputs injection amount data Q ST indicating the starting amount increase. Data Q APP and Q IDL are added in an adder 77, and the added output data and data Q CR are input to a maximum value selector (MAX) 78, and the larger data is output. The data Q FUL , Q SMK and the selection data from the maximum value selection section 78 are input to a minimum value selection section (MIN) 79, and the data with the smallest value is taken out as target injection amount data. This target injection amount data is applied in cases other than when the engine is started, and when the engine is started, the data Q ST becomes the target injection amount data. The switch 80 is a starting signal that is output in response to the operation of the start switch 21.
It is controlled by ST, and operates to select data Q ST when the start signal ST is output, and to select output data from MIN79 in other cases. The data selected by the switch 80 is multiplied by a predetermined correction coefficient according to the fuel temperature at that time in the fuel temperature correction section 81, so that even if the fuel temperature changes, the amount of fuel according to the target injection amount data is The target injection amount data is corrected so that the following is obtained. The data corrected in the fuel temperature correction unit 81 is input to the pump characteristic calculation unit 82, and after a pump characteristic calculation process is performed to convert the input injection amount data into position data according to the pump characteristics, the data is output. Final target position data from part 83
P OUT is output, and this data P OUT is sent to the servo circuit 2 via the D/A 26 as shown in FIG.
8 is input. The injection timing control system 90 includes a load timer characteristic calculation section 91 for calculating the target injection timing according to the operating state of the engine and outputting data TLD indicating the result, and a load timer characteristic calculation section 91 for calculating the target injection timing according to the operating state of the engine and outputting data TLD indicating the result. A water temperature correction value calculation unit 92 for calculating correction data for timing correction and outputting data T TW indicating the result, and a water temperature correction value calculation unit 92 for calculating correction data for water temperature at startup and outputting data T TWS indicating the result. The data T LD is added to the data T TW or T TWS in an adder 94 . In other words, one of the data T TW and T TWS is supplied to the adding section 94 via a switch 95 that is switched and controlled by a starting signal ST indicating whether or not the engine is in a starting state. At the time of startup, data T TWS is selected and added to data T LD , and at times other than startup, data T TW is selected and added to data T LD . The addition result from the addition unit 94 is input as target injection timing data to an error calculation unit 96 into which a signal indicating the actual injection timing is input, and here the difference between the target value and the actual value of the injection timing (time) is input. The difference is calculated, and the error data T E representing the result is input to the PID calculation section 97. After the data processing required for PID control is performed, the data representing the result is sent to the pulse width modulation section (PWM). )98
is input. The pulse width modulation section 98 is supplied with calculation data from a drive frequency calculation section 99 that calculates the frequency of the pulse signal that drives the timer 31 . A driving pulse signal for driving the timer 31 is outputted, the duty ratio of which changes in accordance with the output data from the PID calculation unit 9 at a frequency according to the data to be input. This drive pulse signal is
The timing control signal TCS is applied to a control valve (not shown) in a timer 31 via an amplifier 30. (See Figure 2). In order to execute each calculation for control shown in Fig. 6 by a microcomputer, the calculations necessary for these controls are summarized as a control subroutine program, and Fig. 7 shows a program corresponding to Fig. 6. , their control subroutine programs are shown. In FIG. 7, the calculation contents are shown at the top of each block, and the control subroutine names are displayed at the bottom. These control subroutine programs are stored in the ROM of the first microcomputer 4 as a subroutine group. Table 1 shows a list of each control subroutine program.
【表】【table】
【表】
これらの制御サブルーチンプログラムの実行時
間は様々であり、また、制御上要請される実行頻
度もまた異なつている。このようなサブルーチン
プログラムを効率よく実行するため、これらの制
御サブルーチンプログラムの1つ又は複数から成
る複数のタスクが定義され、そのタスクの実行優
先度を考慮して、タスク単位に所定の時間間隔で
プログラムの起動が行なわれる構成となつてい
る。
タスクの起動時間間隔は、タスクテーブルに基
づいて定められるが、運転条件によつては起動不
要のタスクもある等の理由から、その実行パター
ンは機関の運転条件によつて変更するのが望まし
いものである。このため、本装置では、既述の如
く、機関の運転条件を始動時(モード0)、低回
転域での運転時(モード1)及び高回転域での運
転時(モード2)の3つに分け、各モードに対し
て夫々専用のタスクテーブルが用意されている。
各モードに対するタスクテーブルは第2表乃至第
4表に示されている。[Table] The execution times of these control subroutine programs vary, and the execution frequencies required for control also vary. In order to efficiently execute such subroutine programs, multiple tasks consisting of one or more of these control subroutine programs are defined, and tasks are executed at predetermined time intervals for each task, taking into consideration the execution priority of the task. The configuration is such that the program is started. The task start time interval is determined based on the task table, but it is desirable to change the execution pattern depending on the engine operating conditions, as some tasks may not need to be started depending on the operating conditions. It is. Therefore, as mentioned above, this device has three operating conditions for the engine: when starting (mode 0), when operating in a low rotation range (mode 1), and when operating in a high rotation range (mode 2). A dedicated task table is prepared for each mode.
Task tables for each mode are shown in Tables 2 through 4.
【表】【table】
【表】【table】
【表】
これらのタスクテーブルに掲げられているタス
クの実行順序について、モード0の場合を例にと
つて説明する。
各タスクは、要求される実行頻度を考慮してタ
スクレベル0〜8に分けられると共に、各タスク
レベルにおいても、実行優先度の高い順に左側か
ら並べられている。このように配列された各タス
クの起動、実行は下記に示されるところにより行
なわれる。
(イ) 各タスクは、一定時間間隔毎に発生するモニ
タ割込み毎に1つだけ起動され、次のモニタ割
込の発生までにその実行を終了するものとし、
他のタスクの実行中においては他のタスクの割
込み処理は行なわない。
(ロ) モニタ割込みにより実行されるタスクの順序
は、タスクレベル0の各タスクはモニタ割込の
21回毎に行なわれ、タスクレベル1の各タスク
はモニタ割込の22回毎に行なわれ、一般にタス
クレベルkの各タスクはモニタ割込の2k+1回毎
に行なわれる。
(ハ) 同一タスクレベル内のタスクについては、そ
のタスクレベルに起動の順番が回つてくる毎に
左側に配列されているものから順次起動する。
従つて、タスクテーブルはタスクの実行順序を
示すものであり、どのタスクをタスクテーブルの
どこに配置するかは、そのタスクに対して要求さ
れる実行頻度と実行の優先度とを考慮して適宜に
定めることができる。
第8図には、第2表乃至第4表に示されるタス
クテーブルに基づいて各タスクを順次実行するた
め、第1マイクロコンピユータ4において実行さ
れるモニタ割込のプログラムの詳細フローチヤー
トが示されている。モニタ割込の実行が開始され
ると、先ず時間Δtの周期でモニタ割込みを発生
させるための処理として、フリーランニングカウ
ンタの値YにΔtを加えたものをXにセツトする
(ステツプ110)。フリーランニングカウンタは、
そのときの値Yが所定値Xになつたときモニタ割
込みをかける構成であるから、結局、上述の操作
により、Δt時間後に再びモニタ割込みがかけら
れることになり、以後、Δt時間毎にモニタ割込
みが掛けられることになる。
次いで、ステツプ111において、タスクの起動
がオーバーラツプして掛けられているか否かのチ
エツクが行なわれ、オーバーラツプしている場合
には現在実行中のタスクがそのまま継続して実行
される。一方、オーバーラツプしていない場合に
は、ステツプ112に進む。尚、オーバーラツプし
ているか否かの判別は、後述するフラグOLによ
つて行なわれる。
ステツプ112においては、外部事象が発生して
おり、同期処理の必要性があるか否かの判別を行
ない、同期処理要求がある場合にはステツプ113
において同期処理を行ない、ステツプ114に進む。
ステツプ112の判別結果がNOの場合には、ステ
ツプ113を実行することなく、ステツプ114に進
む。
ステツプ114では、現在タスクが実行されてい
ることを示すフラグOLを「1」とし、ソフトカ
ウンタTCTRの値を1だけ増加させる。そして
以後のステツプでは、このソフトカウンタ
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回毎である。
ステツプ115−0乃至115−7においては、各タ
スクテーブルのどのレベルのタスクを選択すべき
かの判別を行なうものであり、上記説明から判る
ように、タスクレベル0,1,0,2,0,1,
0,3,…が順次選択されることになる。
このようにして、タスクレベルの選択操作が実
行されたのち、タスクテーブルの列の選択が行な
われるが、これを説明するに先だつて、各タスク
テーブルに示されているタスクのアドレスが
RAM6及びマイクロコンピユータのROM内に
おいてどのようにストア,管理されているのかを
説明する。
第9図には、ROM及びRAM内におけるメモ
リ構造が示されている。第1マイクロコンピユー
タのROM内には、アドレスA000からA099まで
のアドレス領域内に第2表に示すタスクのアドレ
スがデータとして図示の如くストアされている。
第2表の各欄の上段に示されているのはそのタス
クの番号であり、第9図では、タスクを特定する
ためにこの番号が用いられている。第3表及び第
4表に示されるタスクについても、同様にして、
ROM内のアドレス領域A100乃至A199及びA200
乃至A299に夫々ストアされている。
このアドレスの管理を行なうため、RAM6内
には、変数PTR0乃至PTR8が設けられており、
この変数によつて、第2表乃至第4表の任意のj
列管理を行なつている。
更に、タスクテーブルの選択を管理するため、
RAM6内には、変数TBLPTRが設けられてお
り、TBLPTRがTBLTOP0の場合には第2表に
示されるモード0のテーブルを選択し、
TBLPTRがTBLTOP1の場合に、第3表に示さ
れるモード1のテーブルを選択し、TBLPTRが
TBLTOP2の場合には第4表に示されるモード
2のテーブルを選択するようになつている。更
に、各テーブルの任意のi行の管理を行なうた
め、RAM6内には変数TCTRが設けられてお
り、TCTRの値に従つて、i行の指定を行なう
構成となつている。
再び第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)、従つて、PTR1←+2の操作が実行され
る(ステツプ118−1)。若し、A+2番地の内容
が0000Hであれば、ステツプ119−1に進み、
PTR1←0とされる。
このようにしてA番地の内容が定められたなら
ば、ステツプ120においてその番地へジヤンプす
る(ステツプ120)。従つて、上述の例では、
T00040のアドレスにジヤンプし、タスクT00040
が起動され、実行される(ステツプ121)。しかる
後、フラグOLが「0」とされ(ステツプ122)、
モニター割込が終了することになる。上記では、
i=1の場合について説明したが、i=1以外の
場合における動作も同様であるので、他のステツ
プについては符号のみを付し、説明を省略する。
上述のモニタ割込動作は、Δt時間毎にかけら
れ、その度に、所要のタスクテーブルにて定めら
れたところに従い所要のタスクが起動され、実行
される。
以上では、第1マイクロコンピユータ4のモニ
タ割込プログラムについて説明したが、次に、第
2マイクロコンピユータ5におけるタスクの起動
について第10図及び第11図を参照して説明す
る。
第2マイクロコンピユータ5には、演算用サブ
ルーチンプログラムがストアされており、これら
の各プログラムは、第1マイクロコンピユータ5
からの指令により起動され、実行される構成であ
る。図示の実施例では、演算用サブルーチンプロ
グラムとして第5表に示す4つのものが用意され
ており、第1マイクロコンピユータ4で制御サブ
ルーチンプログラムが実行される際に必要な計算
処理が、第2マイクロコンピユータ5で実行され
る。[Table] The execution order of the tasks listed in these task tables will be explained using mode 0 as an example. Each task is divided into task levels 0 to 8 in consideration of the required execution frequency, and at each task level, the tasks are arranged from the left in descending order of execution priority. The activation and execution of each task arranged in this way is performed as shown below. (b) Each task shall be started only once for each monitor interrupt that occurs at a fixed time interval, and its execution shall be completed by the time the next monitor interrupt occurs.
Interrupt processing for other tasks is not performed while other tasks are being executed. (b) The order of tasks executed by a monitor interrupt is that each task at task level 0 is executed by a monitor interrupt.
Each task at task level 1 is performed every 22 monitor interrupts, and generally each task at task level k is performed every 2 k+1 monitor interrupts. (c) For tasks within the same task level, each time the order of activation for that task level comes around, the tasks are activated sequentially starting from those arranged on the left. Therefore, the task table indicates the order in which tasks are executed, and which task should be placed where in the task table should be determined as appropriate, taking into account the required execution frequency and execution priority for that task. can be determined. FIG. 8 shows a detailed flowchart of a monitor interrupt program executed in the first microcomputer 4 to sequentially execute each task based on the task tables shown in Tables 2 to 4. ing. When execution of the monitor interrupt is started, first, as a process for generating a monitor interrupt at a period of time Δt, the value Y of the free running counter plus Δt is set to X (step 110). The free running counter is
Since the configuration is such that a monitor interrupt is applied when the value Y at that time reaches a predetermined value will be multiplied. Next, in step 111, a check is made to see if tasks are activated in an overlapping manner, and if so, the currently executing task continues to be executed. On the other hand, if there is no overlap, the process advances to step 112. Note that whether or not there is an overlap is determined by a flag OL, which will be described later. In step 112, it is determined whether an external event has occurred and there is a need for synchronous processing, and if there is a synchronous processing request, step 113 is performed.
At step 114, synchronization processing is performed.
If the determination result in step 112 is NO, the process proceeds to step 114 without executing step 113. 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 increased by one. And in subsequent steps, this soft counter
According to the contents of the TCTR, each task is executed in a predetermined order by referring to the task table described above. The soft counter TCTR has a binary 8-bit output, and has eight outputs from the 20 digit to the 27 digit. Steps 115-0 to 115-7 are
In these steps 115-0 to 115-7, it is determined whether the value of each bit of the counter TCTR is "0" or not. This is done in order from the digit to the highest digit. The determination result in step 115-0 becomes YES every two times the monitor interrupt is performed, and generally becomes YES every 2 n+1 times in step 115-n. Also, from step 115-0
The reason why all the discrimination results up to 115-7 are NO is because
In other words, each bit of the counter TCTR becomes "1" every 29 times. In steps 115-0 to 115-7, it is determined which level of the task in each task table should be selected.As can be seen from the above description, task levels 0, 1, 0, 2, 0, 1,
0, 3, . . . are selected sequentially. In this way, after the task level selection operation is executed, the columns of the task table are selected, but before explaining this, it is important to note that the address of the task shown in each task table is
We will explain how it is stored and managed in the RAM 6 and the ROM of the microcomputer. FIG. 9 shows the memory structure within 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 address A000 to A099 as shown in the figure.
Shown at the top of each column in Table 2 is the number of the task, and in FIG. 9, this number is used to identify the task. Similarly, for the tasks shown in Tables 3 and 4,
Address areas A100 to A199 and A200 in ROM
They are stored in A299 to A299 respectively. In order to manage this address, variables PTR0 to PTR8 are provided in RAM6.
By this variable, any j in Tables 2 to 4
Performs queue management. Additionally, to manage the selection of task tables,
A variable TBLPTR is provided in RAM6, and when TBLPTR is TBLTOP0, the mode 0 table shown in Table 2 is selected.
If TBLPTR is TBLTOP1, select the mode 1 table shown in Table 3 and set TBLPTR to TBLTOP1.
In the case of TBLTOP2, the mode 2 table shown in Table 4 is selected. Further, in order to manage arbitrary i rows of each table, a variable TCTR is provided in the RAM 6, and the i row is specified according to the value of TCTR. The explanation will be given by returning to FIG. 8 again. counter
Based on the value of TCTR, steps 115-0 to 115
It has already been explained that the i-th row of the task table is sequentially specified by -7. Therefore,
Now, the operation of selecting column j when i=1 is selected will be explained. Which of the three task tables mentioned above is selected depends on the contents of TBLPTR determined by the mode determination task. Assuming that it is currently operating in mode 0,
If TBLPTR=TBLTOP0 and PTR1=0, the value of A becomes A010 from FIG. (Step 116-1). The content of address (A010+2) is the address of T0041, so it is different from 0000H (step 117).
-1), therefore, the operation PTR1←+2 is executed (step 118-1). If the content of address A+2 is 0000H, proceed to step 119-1,
PTR1← is assumed to be 0. Once the contents of address A have been determined in this manner, a jump is made to that address (step 120). Therefore, in the above example,
Jump to address T00040 and task T00040
is started and executed (step 121). After that, the flag OL is set to "0" (step 122),
The monitor interrupt will end. In the above,
Although the case where i=1 has been described, since the operation is the same in cases other than i=1, only the reference numerals are given to the other steps and the explanation thereof will be omitted. The above-mentioned monitor interrupt operation is performed every Δt time, and each time a required task is activated and executed according to what is defined in the required task table. The monitor interrupt program of the first microcomputer 4 has been described above. Next, the activation of tasks in the second microcomputer 5 will be described with reference to FIGS. 10 and 11. The second microcomputer 5 stores calculation subroutine programs, and each of these programs is stored in the first microcomputer 5.
It is configured to be started and executed by commands from. In the illustrated embodiment, four calculation subroutine programs shown in Table 5 are prepared, and the calculation processing necessary when the control subroutine program is executed by the first microcomputer 4 is carried out by the second microcomputer 4. It is executed in 5.
【表】
第1マイクロコンピユータ4において、或るタ
スクが実行されている場合において、先ず、その
タスクの実行に必要な演算データをサーチする
(ステツプ200)。次にステツプ201においてRAM
6の指令コードバツフアが空いているか否かを判
別し、空バツフアがなければ、カウンタTCTR
を1つだけ減算し(ステツプ202)、タスクを終了
する。従つて、次のモニタ割込みでは再び同一の
タスクが起動される。このようにして、バツフア
領域が空くのを待つことになる。
ステツプ201の判別結果がYESとなると、指令
コードをRAM6に転送し、データが格納されて
いないブロツクの先頭アドレスETOPを更新する
(ステツプ203)。ステツプ203におけるデータの転
送前において、バツフアが全て空であつたか否か
(従つて、現在の状態でいえばバツフアが1つだ
けデータを格納しているか否か)がステツプ204
において判別される。判別結果がYESならば、
第2マイクロコンピユータ5はアイドル状態を保
つているので、演算開始信号を第2マイクロコン
ピユータに送り、第2マイクロコンピユータ5に
割込みNMIをかける(ステツプ205)。ステツプ
204の判別結果がNOの場合には、ステツプ205を
実行することなく、そのタスクの処理を終了す
る。第2マイクロコンピユータ5は、割込NMI
の実行により、バツフアが空いていることを示す
空フラグを0とし、バツフアにデータがあること
を示す(ステツプ301)。
第2マイクロコンピユータは、バツフアが全て
空ならば、アイドル状態を保つており、割込
NMIにより空フラグが0となつたことに応答し
て(ステツプ302)、第1マイクロコンピユータ4
に割込みNMIを掛けてバス要求を出し、共通メ
モリであるRAM6をバスによつて第2マイクロ
コンピユータ5に接続する(ステツプ303)。即
ち、割込みNMIにより、第1マイクロコンピユ
ータ4はバスライン22を切離し、これにより第
2マイクロコンピユータ5はバスライン22を介
してRAM6と接続される。尚、この間、第1マ
イクロコンピユータ4は待ち状態となつている。
しかる後、所要のデータが転送されているRAM
6内のアドレスBUFiよりデータを読み込み、
BTOP0の更新を行なう。(ステツプ304)。即ち、
BUFiのブロツクのデータを読み出した場合、
BTOP←BUF(i+1)とする。しかし、第11
図から判るように、バツフアブロツクは4つがリ
ング状にリンクされているため、i+1=4なら
ば、BTOP←BUF0とすることになる。
このようにして、データが読込まれた結果、バ
ツフアが全て空になつたか否かの判別が行なわれ
(ステツプ305)、その判別結果がYESであれば、
空フラグを「1」にセツトし(ステツプ306)、バ
スライン22の切離しを行なう(ステツプ307)。
この場合には再び割込みNMIがかかるのを待つ
状態となる。一方、ステツプ305の判別結果が
NOの場合には、ステツプ306は実行されず、ス
テツプ307に進み、バスライン22の切離しのみ
を行なう。
次に、ステツプ308において、バツフアから読
込んだ演算コードの解読を行ない、その結果に従
つて、割算処理(ステツプ309)、2次元補間処理
(ステツプ310)、3次元補間処理(ステツプ311)
又はPID処理(ステツプ312)のいずれかの演算
が実行される。
所要の演算が終了すると、再び第1マイクロコ
ンピユータ4に対して割込みNMIをかけて、バ
スの要求を行ない(ステツプ313)、演算結果を
RAM6内のデータブロツクBUF4に格納し、
(ステツプ314)、ステツプ302に戻り、第1マイク
ロコンピユータ4から割込みNMIがかけられる
のを待つことになる。
以上のようにして、各タスクが、その時の車輛
の運転状態に見合つたタスクテーブルに基づいて
所要のタスクが所定の起動周期、起動順序で順次
起動され、各タスクを構成する所要の制御サブル
ーチンプログラムが第1マイクロコンピユータ4
において実行され、その時必要な演算用のサブル
ーチンが第2マイクロコンピユータ5にて実行さ
れることになる。上述の如くして各タスクが順次
実行されることにより、所望の車輛制御が達成さ
れることになる。
効 果
本発明によれば、要求信号が発生する毎に、選
択された実行パターンに従い、1つ又は複数の単
位プログラムが実行され、この結果、各単位プロ
グラムは要求される所要の頻度で確実に実行さ
れ、且つ次の要求信号が発生するまでにその実行
が終了することになる。さらに、この実行パター
ンは、車輛の運転状態に応じて複数用意されてい
るので、選択手段により運転状態に従つて選択さ
れた1組のデータにより、その運転モードに必要
な単位プログラムを、所要の頻度で実行すること
ができる。従つてモニタプログラムには全く変更
を与えないで済むため、モニタの無駄時間は全く
増えず、搭載できるタスクの数を著しく増大させ
ることができ、プログラムが複雑となるのを避け
ることができる。
この結果、車輛の運転状態に応じた適切な制御
を簡単に行なうことができ、効率のよい車輛用制
御装置を構成することができる。[Table] When a certain task is being executed in the first microcomputer 4, first, calculation data necessary for executing the task is searched (step 200). Next, in step 201, the RAM
It is determined whether the command code buffer of 6 is empty or not, and if there is no empty buffer, the counter TCTR is
is subtracted by one (step 202), and the task is completed. Therefore, the same task is activated again at the next monitor interrupt. In this way, the user waits until the buffer area becomes available. If the determination result in step 201 is YES, the command code is transferred to the RAM 6, and the start address ETOP of the block where no data is stored is updated (step 203). Before the data transfer in step 203, it is determined in step 204 whether all buffers were empty (therefore, in the current state, only one buffer stores data).
It is determined in If the determination result is YES,
Since the second microcomputer 5 maintains an idle state, a computation start signal is sent to the second microcomputer 5, and an interrupt NMI is applied to the second microcomputer 5 (step 205). step
If the determination result in step 204 is NO, the processing of the task is ended without executing step 205. The second microcomputer 5 receives an interrupt NMI
By executing this, the empty flag indicating that the buffer is empty is set to 0, indicating that there is data in the buffer (step 301). If the buffers are all empty, the second microcomputer remains in an idle state and does not receive any interrupts.
In response to the empty flag becoming 0 due to NMI (step 302), the first microcomputer 4
A bus request is issued by applying an interrupt NMI to the memory, and the common memory RAM 6 is connected to the second microcomputer 5 via the bus (step 303). That is, the first microcomputer 4 disconnects the bus line 22 due to the interrupt NMI, and thereby the second microcomputer 5 is connected to the RAM 6 via the bus line 22. Note that during this time, the first microcomputer 4 is in a waiting state.
After that, the required data is transferred to the RAM
Read data from address BUFi in 6,
Update BTOP0. (Step 304). That is,
When reading the data of BUFi block,
Set BTOP←BUF(i+1). However, the 11th
As can be seen from the figure, four buffer blocks are linked in a ring shape, so if i+1=4, BTOP←BUF0. In this way, as a result of reading the data, it is determined whether or not the buffer is completely empty (step 305), and 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 system waits for an interrupt NMI to be issued again. On the other hand, the determination result of step 305 is
If NO, step 306 is not executed, and the process proceeds to step 307, where only the bus line 22 is disconnected. 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), and three-dimensional interpolation processing (step 311) are performed.
or PID processing (step 312). When the required computation is completed, an interrupt NMI is sent to the first microcomputer 4 again to request the bus (step 313), and the result of the computation is sent to the first microcomputer 4.
Store in data block BUF4 in RAM6,
(Step 314), the process returns to Step 302 and waits for an interrupt NMI to be issued from the first microcomputer 4. As described above, each task is sequentially activated in a predetermined activation cycle and activation order based on a task table that matches the driving state of the vehicle at that time, and the required control subroutine program that constitutes each task is activated. is the first microcomputer 4
The second microcomputer 5 executes subroutines for calculations required at that time. By sequentially executing each task as described above, desired vehicle control is achieved. Effects According to the present invention, one or more unit programs are executed according to the selected execution pattern each time a request signal is generated, and as a result, each unit program is reliably executed at the required frequency. It will be executed and the execution will be completed by the time the next request signal is generated. Furthermore, since a plurality of execution patterns are prepared depending on the driving state of the vehicle, one set of data selected according to the driving state by the selection means can be used to execute the unit program necessary for that driving mode. Can be executed frequently. Therefore, there is no need to make any changes to the monitor program, so the wasted time of the monitor does not increase at all, the number of tasks that can be loaded can be significantly increased, and the program can be prevented from becoming complicated. As a result, appropriate control according to the driving state of the vehicle can be easily performed, and an efficient vehicle control device can be constructed.
第1図は本発明の基本概念を示す概略構成図、
第2図は本発明による車輛用制御装置の一実施例
の制御システムの全体構成図、第3図は第2図に
示した第1マイクロコンピユータのプログラム構
成図、第4図a及び第4図bは第2図に示す装置
の波形図、第5図は第2図に示した第2マイクロ
コンピユータのプログラム構成図、第6図は第1
マイクロコンピユータにより実行される制御の内
容を示すための制御系統図、第7図は第6図に示
す制御系統の各部の制御演算を行なう制御サブル
ーチンプログラムを第6図に対比させて示した制
御サブルーチンプログラムの説明図、第8図は第
3図に示されるモニタ割込プログラムの詳細フロ
ーチヤート、第9図は第2図に示される装置の各
メモリ内のメモリ構造を示す図、第10図は第2
マイクロコンピユータの作動を説明するための第
1及び第2マイクロコンピユータのフローチヤー
ト、第11図は第1及び第2マイクロコンピユー
タの作動を説明するためのメモリ構造を示す図で
ある。
1,400…車輛用制御装置、4…第1マイク
ロコンピユータ、5…第2マイクロコンピユー
タ、6…ランダム・アクセス・メモリ(RAM)、
401…記憶装置、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, FIG. 3 is a program configuration diagram of the first microcomputer shown in FIG. 2, and FIGS. b is a waveform diagram of the device shown in Fig. 2, Fig. 5 is a program configuration diagram of the second microcomputer shown in Fig. 2, and Fig. 6 is a waveform diagram of the device shown in Fig. 2.
A control system diagram showing the contents of control executed by a microcomputer, FIG. 7 is a control subroutine showing a control subroutine program for performing control calculations for each part of the control system shown in FIG. 6 in comparison with FIG. An explanatory diagram of the program; FIG. 8 is a detailed flowchart of the monitor interrupt program shown in FIG. 3; FIG. 9 is a diagram showing the memory structure in each memory of the device shown in FIG. 2; FIG. Second
FIG. 11 is a flowchart of the first and second microcomputers for explaining the operations of the microcomputers, and FIG. 11 is a diagram showing the memory structure for explaining the operations of the first and second microcomputers. 1,400... Vehicle control device, 4... First microcomputer, 5... Second microcomputer, 6... Random access memory (RAM),
401...Storage device, 402...Memory means, 403
...Selection means, 404...Start request generation means, 405
...Calculating means.
Claims (1)
が複数の単位プログラムに分割されてなり、間歇
的に生じる起動要求に従つて前記単位プログラム
が選択的に実行されることにより車輛の制御が行
なわれるように構成された車輛用制御装置におい
て、起動要求のための要求信号を少なくとも所定
の一定時間をおいて間歇的に発する起動要求発生
手段と、実行に要する時間が前記一定時間よりは
短くなるように定められた1つ又は複数の単位プ
ログラムからなる複数のプログラムに対して夫々
要求される起動周期に基づいて定められた各プロ
グラムの実行頻度を決める実行パターンに関する
データが前記車輛の運転モードに対応して複数組
記憶されているメモリ手段と、前記車輛の運転モ
ードを検出してその検出結果に相応する1組のデ
ータを選択する選択手段と、前記要求信号が発せ
られる度に前記選択手段により選択された1組の
データに従う実行パターンに従つて所要の1つの
プログラムを実行させる手段とを備え、前記単位
プログラムが前記選択された1組のデータにより
示される実行パターンに従つて繰り返し実行され
ることを特徴とする車輛用制御装置。1. A control program for controlling a vehicle device is divided into a plurality of unit programs, and the vehicle is controlled by selectively executing the unit programs in accordance with intermittent activation requests. A vehicle control device configured to include a start request generating means for intermittently issuing a request signal for a start request at least at a predetermined fixed time interval, and a start request generating means configured such that the time required for execution is shorter than the fixed time period. Data related to an execution pattern that determines the execution frequency of each predetermined program based on the activation cycle required for each of a plurality of programs consisting of one or more predetermined unit programs corresponds to the driving mode of the vehicle. a memory means storing a plurality of sets of data; a selection means for detecting the driving mode of the vehicle and selecting one set of data corresponding to the detection result; and a selection means selected by the selection means each time the request signal is issued. means for executing one required program according to an execution pattern according to the selected set of data, and the unit program is repeatedly executed according to the execution pattern indicated by the selected set of data. A vehicle control device featuring:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20292484A JPS6181234A (en) | 1984-09-29 | 1984-09-29 | Car control device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20292484A JPS6181234A (en) | 1984-09-29 | 1984-09-29 | Car control device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6181234A JPS6181234A (en) | 1986-04-24 |
| JPH0256250B2 true JPH0256250B2 (en) | 1990-11-29 |
Family
ID=16465411
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP20292484A Granted JPS6181234A (en) | 1984-09-29 | 1984-09-29 | Car control device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS6181234A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008062512A1 (en) * | 2006-11-21 | 2008-05-29 | Fujitsu Limited | Multiprocessor system |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102252745B1 (en) * | 2019-09-27 | 2021-05-17 | 주식회사 카이테크 | Electric water pump control system, and method for electric water pump multi control based on Communication ID |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6060024B2 (en) * | 1977-10-19 | 1985-12-27 | 株式会社日立製作所 | Engine control method |
-
1984
- 1984-09-29 JP JP20292484A patent/JPS6181234A/en active Granted
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008062512A1 (en) * | 2006-11-21 | 2008-05-29 | Fujitsu Limited | Multiprocessor system |
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6181234A (en) | 1986-04-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3578082B2 (en) | Processing execution device and recording medium | |
| US4355360A (en) | Method for program control of components of an automotive vehicle | |
| US4099495A (en) | Method and apparatus to determine the timing of a periodically repetitive event with respect to the position of a rotating body, and more particularly ignition timing, fuel injection timing, and the like, in automotive internal combustion engines | |
| CA1115341A (en) | Engine control system | |
| US6009370A (en) | Control unit for vehicle and total control system therefor | |
| US4425890A (en) | Spark timing control apparatus for use with a internal combustion engine | |
| JP3610915B2 (en) | Processing execution apparatus and program | |
| JP4241462B2 (en) | Control unit and microcomputer | |
| JP2000047883A (en) | Task control method and recording medium | |
| US5974346A (en) | Method for controlling technical processes | |
| JPH0256250B2 (en) | ||
| JPH0782363B2 (en) | Vehicle control device | |
| JPS62288343A (en) | Internal combustion engine throttle valve control device | |
| US6490509B1 (en) | Car controlling unit using a multitasking system | |
| US6754576B2 (en) | Electronic control unit having different mask return processes | |
| JPS6181233A (en) | Car control device | |
| JP2000199450A (en) | Engine control device | |
| JPS6181235A (en) | Car control device | |
| JPS6181232A (en) | Car control device | |
| JPH0991154A (en) | Stack allocation method and control device | |
| EP1248192B1 (en) | Processing execution apparatus having data reference limiting function | |
| JPS6181236A (en) | Car control device | |
| JP7263746B2 (en) | Information processing equipment | |
| JPH04121442A (en) | Controller for vehicle | |
| JPH05204667A (en) | Task execution control device in computer system |