JP2016162330A - Electronic controller - Google Patents
Electronic controller Download PDFInfo
- Publication number
- JP2016162330A JP2016162330A JP2015042051A JP2015042051A JP2016162330A JP 2016162330 A JP2016162330 A JP 2016162330A JP 2015042051 A JP2015042051 A JP 2015042051A JP 2015042051 A JP2015042051 A JP 2015042051A JP 2016162330 A JP2016162330 A JP 2016162330A
- Authority
- JP
- Japan
- Prior art keywords
- task
- logic function
- mode
- logic
- function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000000737 periodic effect Effects 0.000 description 40
- 238000000034 method Methods 0.000 description 24
- 238000002347 injection Methods 0.000 description 8
- 239000007924 injection Substances 0.000 description 8
- 238000012937 correction Methods 0.000 description 6
- 239000000446 fuel Substances 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、電子制御装置に関する。 The present invention relates to an electronic control device.
例えば、車両のエンジンを制御する電子制御装置では、マイクロコンピュータのCPU(Central Processing Unit)が、エンジンを制御するためのタスクを一定時間毎に実行する。一定時間毎に実行されるタスクは、定期タスクと呼ばれる。 For example, in an electronic control device that controls a vehicle engine, a CPU (Central Processing Unit) of a microcomputer executes a task for controlling the engine at regular intervals. A task executed at regular intervals is called a regular task.
また近年、パワートレイン系の制御ソフトウェアは大規模化しており、CPUの処理負荷も増大する傾向にある。CPUの処理負荷が大きくなると、一定時間毎に実行されるべきタスクを、予定の一定時間毎に実行できない状態(いわゆるタスク抜け)が発生する可能性がある。タスク抜けが起こると、そのタスクが本来の実行タイミングで実行されなくなるため、制御対象の良好な制御を実施することができなくなる。 In recent years, the control software for the powertrain system has become larger and the processing load on the CPU tends to increase. When the processing load on the CPU increases, there is a possibility that a task (so-called task omission) in which a task to be executed every predetermined time cannot be executed every predetermined time is generated. When a task omission occurs, the task is not executed at the original execution timing, so that it is impossible to perform good control of the controlled object.
一方、例えば特許文献1には、処理負荷(演算負荷)がしきい値より大きい場合には制御プログラムの一部の実行を停止する、という技術が記載されている。 On the other hand, for example, Patent Document 1 describes a technique of stopping execution of a part of a control program when a processing load (calculation load) is larger than a threshold value.
特許文献1の技術は、タスク抜けを防止するものではなく、また、処理負荷が大きい場合に、制御プログラムの一部を実行しなくなるため、その実行されなくなった制御プログラムによる制御機能を失うこととなり、制御性能の大幅な低下を招く。 The technique of Patent Document 1 does not prevent task omission, and when the processing load is large, a part of the control program is not executed, so that the control function by the control program that is no longer executed is lost. As a result, the control performance is significantly reduced.
そこで、本発明は、制御性能の低下を抑制しつつ、タスク抜けを防止することを目的としている。 Accordingly, an object of the present invention is to prevent task omission while suppressing a decrease in control performance.
第1発明の電子制御装置は、制御対象を制御するために一定時間毎に実行されるべきタスクが記憶された記憶手段と、前記タスクを一定時間毎に実行する処理手段と、を備える。そして、前記タスクを構成する複数の関数として、簡易化が不能なロジックの関数である第1種ロジック関数と、簡易化しても制御対象の制御に対する影響が少ないロジックの関数である第2種ロジック関数とがある。 An electronic control device according to a first aspect of the present invention comprises storage means for storing a task to be executed at regular intervals in order to control a controlled object, and processing means for executing the tasks at regular intervals. As the plurality of functions constituting the task, a first type logic function that is a logic function that cannot be simplified, and a second type logic that is a logic function that has little influence on the control of the control target even if simplified. There is a function.
記憶手段には、第2種ロジック関数として、簡易化されていない通常演算のための通常ロジック関数と、通常演算よりも簡易化された演算のための簡易ロジック関数とが、記憶されている。また、処理手段がタスクを実行する際の実行モードとしては、第2種ロジック関数として通常ロジック関数の方を実行する通常ロジックモードと、第2種ロジック関数として簡易ロジック関数の方を実行する簡易ロジックモードとがある。 The storage means stores, as the second type logic function, a normal logic function for a normal operation that is not simplified and a simple logic function for a calculation simplified more than the normal operation. In addition, as the execution mode when the processing means executes the task, the normal logic mode that executes the normal logic function as the second type logic function and the simple logic function that executes the simple logic function as the second type logic function. There is a logic mode.
そして、処理手段は、判定手段と、モード切替手段と、を備える。判定手段は、タスクを一定時間毎に実行できないタスク抜けが発生する可能性があるか否かを判定する。モード切替手段は、判定手段によりタスク抜けが発生する可能性があると判定されると、タスクの実行モードを、前記通常ロジックモードから前記簡易ロジックモードに切り替える。 The processing unit includes a determination unit and a mode switching unit. The determination unit determines whether or not there is a possibility that a task omission that cannot be executed at regular time intervals may occur. The mode switching means switches the task execution mode from the normal logic mode to the simple logic mode when the determination means determines that there is a possibility of task omission.
この電子制御装置によれば、処理手段の処理負荷が大きくなってタスク抜けが発生する可能性がでてくると、タスクを構成する関数のうち、第1種ロジック関数以外の第2種ロジック関数については、通常ロジック関数に代えて、通常ロジック関数よりも簡易化された簡易ロジック関数が実行されるようになる。 According to this electronic control device, when the processing load of the processing means increases and the possibility of task omission occurs, among the functions constituting the task, the second type logic function other than the first type logic function As for, instead of the normal logic function, a simplified logic function simplified than the normal logic function is executed.
このため、処理手段の処理負荷が低減されてタスク抜けの発生が防止される。また、第2種ロジック関数の処理が全く実行されなくなるのではなく、第2種ロジック関数として簡易ロジック関数が実行されるため、制御性能の低下を抑制することができる。よって、制御性能の低下を抑制しつつ、タスク抜けを防止することができる。 For this reason, the processing load of the processing means is reduced, and the occurrence of task omission is prevented. In addition, since the processing of the second type logic function is not executed at all, the simple logic function is executed as the second type logic function, so that it is possible to suppress a decrease in control performance. Therefore, task omission can be prevented while suppressing a decrease in control performance.
なお、特許請求の範囲に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本発明の技術的範囲を限定するものではない。 In addition, the code | symbol in the parenthesis described in the claim shows the correspondence with the specific means as described in embodiment mentioned later as one aspect, Comprising: The technical scope of this invention is limited is not.
以下に、本発明が適用された実施形態の電子制御装置について説明する。
図1に示す実施形態の電子制御装置(以下、ECUという)1は、例えば車両のエンジンを制御するECUであり、当該ECU1の動作を司る処理部として、マイクロコンピュータ(以下、マイコンという)3を備える。尚、ECUは、「Electronic Control Unit」の略である。そして、マイコン3は、処理手段としてのCPU5と、CPU5によって実行されるプログラムが記憶された記憶手段としてのROM7と、CPU5による演算結果が記憶されるRAM9と、を備える。
Hereinafter, an electronic control device according to an embodiment to which the present invention is applied will be described.
An electronic control device (hereinafter referred to as ECU) 1 of the embodiment shown in FIG. 1 is an ECU that controls an engine of a vehicle, for example, and a microcomputer (hereinafter referred to as microcomputer) 3 is used as a processing unit that controls the operation of the ECU 1. Prepare. Note that ECU is an abbreviation for “Electronic Control Unit”. The microcomputer 3 includes a CPU 5 as processing means, a ROM 7 as storage means in which a program executed by the CPU 5 is stored, and a RAM 9 in which calculation results by the CPU 5 are stored.
ECU1には、エンジンを制御するために用いる情報を検出するためのセンサとして、吸気量センサ11、クランク角センサ12、水温センサ13、吸気温センサ14及び空燃比センサ15などが接続されている。また、ECU1には、駆動対象としてのインジェクタ17が接続されている。 The ECU 1 is connected with an intake air amount sensor 11, a crank angle sensor 12, a water temperature sensor 13, an intake air temperature sensor 14, an air-fuel ratio sensor 15, and the like as sensors for detecting information used for controlling the engine. The ECU 1 is connected with an injector 17 as a drive target.
各センサ11〜15からの信号は、図示しない信号入力回路を介してマイコン3に入力される。マイコン3では、CPU5が、ROM7内のプログラムを実行することにより、各センサ11〜15からの信号に基づいてエンジンに対する燃料噴射量を演算し、その演算結果に基づいてインジェクタ17の駆動を制御する。尚、図示を省略しているが、ECU1には、マイコン3からの噴射指令信号に応じてインジェクタ17に駆動信号を出力する駆動回路も備えられている。 Signals from the sensors 11 to 15 are input to the microcomputer 3 via a signal input circuit (not shown). In the microcomputer 3, the CPU 5 calculates the fuel injection amount for the engine based on the signals from the sensors 11 to 15 by executing the program in the ROM 7, and controls the driving of the injector 17 based on the calculation result. . Although not shown, the ECU 1 is also provided with a drive circuit that outputs a drive signal to the injector 17 in response to an injection command signal from the microcomputer 3.
マイコン3のROM7に記憶されたエンジン制御用のプログラムとしては、一定時間毎に実行されるべきタスク(以下、定期タスクという)がある。
その定期タスクに割り当てられたエンジン制御用のロジックは、CPU5の高負荷時でも通常演算が必須な第1種ロジックと、簡易演算でもエンジンの制御に対する影響が少ない第2種ロジックとに、分類されている。第1種ロジックは、エンジンの制御において簡易化が不能な必須のロジックであり、第2種ロジックは、簡易化してもエンジンの制御に対する影響が少ないロジックである。
The engine control program stored in the ROM 7 of the microcomputer 3 includes a task to be executed at regular intervals (hereinafter referred to as a regular task).
The engine control logic assigned to the periodic task is classified into a first type logic that requires normal calculation even when the CPU 5 is heavily loaded, and a second type logic that has little influence on engine control even with simple calculation. ing. The first type logic is essential logic that cannot be simplified in engine control, and the second type logic is logic that has little influence on engine control even if simplified.
このため、定期タスクを構成するエンジン制御用の関数のうち、第1種ロジックの関数である第1種ロジック関数(以下、必須ロジック関数ともいう)は、簡易化することができない。一方、第2種ロジックの関数である第2種ロジック関数は、簡易化してもエンジンの制御に対する影響が少ないため、CPU5の高負荷時には簡易化して実行することができる。また、第1種ロジック関数と第2種ロジック関数とのうち、少なくとも第2種ロジック関数は複数ある。 For this reason, among the functions for engine control constituting the periodic task, the first type logic function (hereinafter also referred to as an essential logic function) that is a function of the first type logic cannot be simplified. On the other hand, the second type logic function, which is a function of the second type logic, has little influence on the engine control even if simplified, and can therefore be simplified and executed when the CPU 5 is under a high load. Further, among the first type logic function and the second type logic function, there are at least a plurality of second type logic functions.
そこで、マイコン3のROM7には、定期タスクを構成する第2種ロジック関数の各々について、簡易化されていない通常演算のための通常ロジック関数と、通常演算よりも簡易化された演算のための簡易ロジック関数とが、記憶されている。 Therefore, in the ROM 7 of the microcomputer 3, for each of the second type logic functions constituting the periodic task, a normal logic function for normal calculation that is not simplified and a calculation that is simplified more than normal calculation are provided. Simple logic functions are stored.
通常ロジック関数と簡易ロジック関数は、具体的には、図2に示すロジックテーブルの形態でROM7に記憶されている。
図2に示すように、ロジックテーブルは、第2種ロジック関数の各々について通常ロジック関数を記録した通常ロジックテーブルと、第2種ロジック関数の各々について簡易ロジック関数を記録した簡易ロジックテーブルとの、2つによって構成されている。図2において、「Func A()」、「Func B()」、「Func C()」、「Func D()」…は、通常ロジック関数であり、「Func a()」、「Func b()」、「Func c()」、「Func d()」…は、簡易ロジック関数である。ROM7には、第2種ロジック関数として、通常ロジック関数と簡易ロジック関数との両方がそれぞれ記憶されているということになる。通常ロジック関数は、本来の第2種ロジック関数に該当し、その通常ロジック関数を簡易化したものが簡易ロジック関数である。
Specifically, the normal logic function and the simple logic function are stored in the ROM 7 in the form of a logic table shown in FIG.
As shown in FIG. 2, the logic table includes a normal logic table that records a normal logic function for each of the second type logic functions, and a simple logic table that records a simple logic function for each of the second type logic functions. It consists of two. In FIG. 2, “Func A ()”, “Func B ()”, “Func C ()”, “Func D ()”... Are normal logic functions, and “Func a ()”, “Func b” “()”, “Func c ()”, “Func d ()”... Are simple logic functions. The ROM 7 stores both the normal logic function and the simple logic function as the second type logic function. The normal logic function corresponds to the original type 2 logic function, and a simplified logic function is a simplified version of the normal logic function.
そして、簡易ロジックテーブルには、簡易ロジック関数の各々について、その簡易ロジック関数の処理時間も記録されている。
また、簡易ロジックテーブルにおいて、簡易ロジック関数の記録順は、処理時間が小さいもの順になっている。そして、簡易ロジック関数の処理順序は、図2における左端の「処理順序」の欄に示すように、簡易ロジックテーブルにおける簡易ロジック関数の記録順(即ち、処理時間が小さいもの順)となっている。
And the processing time of the simple logic function is also recorded on each simple logic function in the simple logic table.
In the simple logic table, the recording order of the simple logic functions is in the order of processing time. The processing order of the simple logic functions is the recording order of the simple logic functions in the simple logic table (that is, the processing time is the smallest) as shown in the “processing order” column at the left end in FIG. .
例えば、第1種ロジック関数としては、エンジンの吸気量及び回転数から、噴射量の基本値である基本噴射量を算出するための基本噴射量演算関数と、既に算出されている複数の各補正係数を用いて基本噴射量を補正して、インジェクタ17の駆動制御に用いる最終的な噴射量を算出する制御噴射量演算関数とがある。 For example, the first type logic function includes a basic injection amount calculation function for calculating a basic injection amount, which is a basic value of the injection amount, from the intake air amount and the rotation speed of the engine, and a plurality of corrections that have already been calculated. There is a control injection amount calculation function that corrects the basic injection amount using a coefficient and calculates a final injection amount used for drive control of the injector 17.
そして、第2種ロジック関数は、上記複数の各補正係数を算出するための関数である。
例えば、第2種ロジック関数としては、エンジンの水温に基づいて補正係数を算出する関数(例えば、Func A(),Func a())や、エンジンの吸気温に基づいて補正係数を算出する関数(例えば、Func B(),Func b())や、エンジン始動時からの経過時間に基づいて補正係数を算出する関数(例えば、Func C(),Func c())や、空燃比に基づいて補正係数を算出する関数(例えば、Func D(),Func d())などがある。
The second type logic function is a function for calculating the plurality of correction coefficients.
For example, as the second type logic function, a function (for example, Func A (), Funca ()) that calculates a correction coefficient based on the engine water temperature, or a function that calculates a correction coefficient based on the intake air temperature of the engine. (For example, Func B (), Func b ()), a function for calculating a correction coefficient based on the elapsed time since the engine start (for example, Func C (), Func c ()), Functions for calculating correction coefficients (for example, Func D (), Func d ()).
次に、CPU5が実行する定期タスクの処理について、図3を用い説明する。
マイコン3においては、予め定められた一定時間毎に定期タスクの起床要求が発生するようになっており、CPU5は、その起床要求が発生すると、図3の定期タスクの実行を開始する。
Next, periodic task processing executed by the CPU 5 will be described with reference to FIG.
In the microcomputer 3, a wake-up request for a regular task is generated every predetermined time, and when the wake-up request is generated, the CPU 5 starts executing the periodic task shown in FIG.
図3に示すように、CPU5は、定期タスクでは、まずS110にて、定期タスクについての余裕時間を算出する。余裕時間とは、当該定期タスクの前回の終了時から今回の開
始時までの時間である。例えば、当該定期タスクを終了するときに、マイコン3におけるフリーランタイマ値を、タスク終了時刻としてRAM9に記憶しておき、今回の起床要求が発生したときのフリーランタイマ値から、RAM9に記憶しておいたタスク終了時刻を引いた値を、余裕時間として算出することができる。
As shown in FIG. 3, in the periodic task, the CPU 5 first calculates a margin time for the periodic task in S110. The spare time is the time from the previous end of the periodic task to the start of this time. For example, when the periodic task ends, the free run timer value in the microcomputer 3 is stored in the RAM 9 as the task end time, and is stored in the RAM 9 from the free run timer value when the current wakeup request is generated. A value obtained by subtracting the task end time can be calculated as a margin time.
CPU5は、次のS120にて、必須ロジック関数を実行する。前述の通り必須ロジック関数は、第1種ロジック関数である。
CPU5は、次のS130にて、図4に示すロジックモード判定処理を行う。
In step S120, the CPU 5 executes the essential logic function. As described above, the essential logic function is the first type logic function.
In the next S130, the CPU 5 performs a logic mode determination process shown in FIG.
CPU5が定期タスクを実行する際の実行モードとしては、通常ロジックモードと、簡易ロジックモードとがある。通常ロジックモードは、第2種ロジック関数として通常ロジック関数の方を実行するモードであり、簡易ロジックモードは、第2種ロジック関数として簡易ロジック関数の方を実行するモードである。そして、ロジックモード判定処理は、定期タスクの実行モードを、通常ロジックモードと簡易ロジックモードとに切り替えるための処理である。 The execution mode when the CPU 5 executes the periodic task includes a normal logic mode and a simple logic mode. The normal logic mode is a mode in which the normal logic function is executed as the second type logic function, and the simple logic mode is a mode in which the simple logic function is executed as the second type logic function. The logic mode determination process is a process for switching the execution mode of the regular task between the normal logic mode and the simple logic mode.
図4に示すように、CPU5は、ロジックモード判定処理では、S210にて、現在の実行モードが簡易ロジックモードであるか否かを判定し、簡易ロジックモードでなければ(つまり、通常ロジックモードであれば)、S220に進む。 As shown in FIG. 4, in the logic mode determination process, the CPU 5 determines in S210 whether or not the current execution mode is the simple logic mode, and if it is not the simple logic mode (that is, in the normal logic mode). If there is), the process proceeds to S220.
CPU5は、S220では、図3のS110で算出した余裕時間が規定値未満であるか否かを判定する。そして、余裕時間が規定値未満でなければ(S220:NO)、そのまま当該ロジックモード判定処理を終了するが、余裕時間が規定値未満であれば(S220:YES)、定期タスクのタスク抜けが発生する可能性があると判断して、S230に進む。 In S220, the CPU 5 determines whether or not the margin time calculated in S110 of FIG. 3 is less than a specified value. If the allowance time is not less than the specified value (S220: NO), the logic mode determination process is terminated as it is. If the allowance time is less than the specified value (S220: YES), the task missing from the periodic task occurs. The process proceeds to S230.
CPU5は、S230では、タスク抜けを防止するために、通常ロジックモードを解除して、簡易ロジックモードにセットする。つまり、定期タスクの実行モードを通常ロジックモードから簡易ロジックモードに切り替える。そして、その後、当該ロジックモード判定処理を終了する。 In S230, the CPU 5 cancels the normal logic mode and sets it to the simple logic mode in order to prevent task omission. That is, the execution mode of the periodic task is switched from the normal logic mode to the simple logic mode. Thereafter, the logic mode determination process is terminated.
また、CPU5は、上記S210にて、現在の実行モードが簡易ロジックモードであると判定した場合には、S240に進む。
CPU5は、S240では、当該CPU5の現在の処理負荷が低負荷状態であるか否かを判定する。低負荷状態とは、定期タスクのタスク抜けが発生する可能性が無い、と考えられる処理負荷の状態である。
If the CPU 5 determines in S210 that the current execution mode is the simple logic mode, the process proceeds to S240.
In S240, the CPU 5 determines whether or not the current processing load of the CPU 5 is in a low load state. The low load state is a processing load state in which there is no possibility of a task omission of a periodic task.
例えば、マイコン3では、特定の入力信号に応じてCPU5の処理負荷が変化する。
一例を挙げると、クランク角センサ12から出力される信号(以下、クランク角信号という)には、エンジンのクランク軸が所定角度回転する毎にパルスが生じる。そして、マイコン3では、クランク角信号にパルスが生じる毎に、割り込みが発生して、CPU5が割り込み処理を行う。このため、エンジン回転数が大きくなるほど、割り込みの発生頻度が高くなり、CPU5の処理負荷が大きくなる。よって、CPU5は、S240では、例えば、クランク角信号におけるパルスの発生間隔に基づいて検出されるエンジン回転数が所定値以下であるか否かを判定し、エンジン回転数が所定値以下であれば、低負荷状態であると判定する。
For example, in the microcomputer 3, the processing load of the CPU 5 changes according to a specific input signal.
For example, a signal (hereinafter referred to as a crank angle signal) output from the crank angle sensor 12 generates a pulse every time the crankshaft of the engine rotates by a predetermined angle. In the microcomputer 3, an interrupt is generated every time a pulse is generated in the crank angle signal, and the CPU 5 performs an interrupt process. For this reason, as the engine speed increases, the frequency of interruptions increases and the processing load on the CPU 5 increases. Therefore, in S240, for example, the CPU 5 determines whether or not the engine speed detected based on the pulse generation interval in the crank angle signal is equal to or smaller than a predetermined value, and if the engine speed is equal to or smaller than the predetermined value. It is determined that the load is low.
CPU5は、上記S240にて、低負荷状態ではないと判定した場合には、そのまま当該ロジックモード判定処理を終了するが、低負荷状態であると判定した場合には、定期タスクのタスク抜けが発生する可能性が無くなったと判断して、S250に進む。 If the CPU 5 determines in S240 that it is not in a low load state, the CPU 5 terminates the logic mode determination process as it is. If it is determined that the load is in a low load state, a task missing from a periodic task occurs. If it is determined that there is no longer a possibility to do so, the process proceeds to S250.
CPU5は、S250では、簡易ロジックモードを解除して、通常ロジックモードにセットする。つまり、定期タスクの実行モードを簡易ロジックモードから通常ロジックモードに切り替える。そして、その後、当該ロジックモード判定処理を終了する。 In S250, the CPU 5 cancels the simple logic mode and sets the normal logic mode. That is, the execution mode of the periodic task is switched from the simple logic mode to the normal logic mode. Thereafter, the logic mode determination process is terminated.
図3の説明に戻る。CPU5は、S130にて図4のロジックモード判定処理を終了すると、S140に進む。
CPU5は、S140では、現在の実行モードが簡易ロジックモードであるか否かを判定し、簡易ロジックモードでなければ(つまり、通常ロジックモードであれば)、S150に進む。
Returning to the description of FIG. CPU5 will complete | finish the logic mode determination process of FIG. 4 in S130, and will progress to S140.
In S140, the CPU 5 determines whether or not the current execution mode is the simple logic mode. If it is not the simple logic mode (that is, if it is the normal logic mode), the CPU 5 proceeds to S150.
CPU5は、S150では、第2ロジック関数の各々として、前述の通常ロジックテーブル(図2)に記録されている通常ロジック関数の各々を全て実行し、その後、当該定期タスクを終了する。 In S150, the CPU 5 executes each of the normal logic functions recorded in the above-described normal logic table (FIG. 2) as each of the second logic functions, and then ends the periodic task.
一方、CPU5は、上記S140にて、現在の実行モードが簡易ロジックモードであると判定した場合には、S160に進む。
CPU5は、S160では、前述の簡易ロジックテーブル(図2)から、実行対象の簡易ロジック関数を1つ選択すると共に、その選択した簡易ロジック関数の処理時間も読み出す。S160での簡易ロジック関数の選択規則は下記の通りである。
On the other hand, if the CPU 5 determines in S140 that the current execution mode is the simple logic mode, the process proceeds to S160.
In S160, the CPU 5 selects one simple logic function to be executed from the above-described simple logic table (FIG. 2), and reads the processing time of the selected simple logic function. The rules for selecting a simple logic function in S160 are as follows.
・処理時間が小さいものから順に選択する。
・但し、前回実行した当該定期タスクにおいて、後述するS200で次回開始関数情報がRAM9に記憶されていれば、その次回開始関数情報が示す簡易ロジック関数から順に選択する。尚、次回開始関数情報は、簡易ロジックテーブルに記録されている簡易ロジック関数のうち、前回の定期タスクで最後に実行した簡易ロジック関数の次に処理時間が小さい簡易ロジック関数を示す。また、次回開始関数情報は、簡易ロジックモードから通常ロジックモードに戻った場合には消去される。
・ Select from the smallest processing time.
However, if the next start function information is stored in the RAM 9 in the later-described periodic task in S200 described later, the simple logic function indicated by the next start function information is selected in order. The next start function information indicates a simple logic function having the shortest processing time next to the simple logic function last executed in the previous periodic task among the simple logic functions recorded in the simple logic table. The next start function information is deleted when the simple logic mode returns to the normal logic mode.
そして、CPU5は、次のS170にて、現在から当該定期タスクの次回の開始予定時刻(具体的には、次回の起床要求の発生予定時刻)までの残り時間を計測する。例えば、次回の起床要求の発生予定時刻に相当するフリーランタイマ値から、現在のフリーランタイマ値を引き、その引き算した値にフリーランタイマ値の分解能時間を乗じた時間を、残り時間として算出する。更に、CPU5は、S170では、計測した残り時間から所定時間Tαを引いた時間(以下、処理可能時間という)が、S160で選択した簡易ロジック関数の処理時間以上であるか否かを判定する。所定時間Tαは、後述するS180で簡易ロジック関数の実行を完了してから、次の簡易ロジック関数を実行することなく当該定期タスクを終了するまでに必要な最大の処理時間である。よって、処理可能時間(=残り時間−Tα)は、当該定期タスクの次回の開始予定時刻までに当該定期タスクを終了させることが可能な範囲で、簡易ロジック関数の実行に使用することが可能な時間である。 Then, in the next S170, the CPU 5 measures the remaining time from the present to the next scheduled start time of the periodic task (specifically, the next scheduled wakeup request generation time). For example, the current free-run timer value is subtracted from the free-run timer value corresponding to the scheduled time for the next wake-up request, and the subtracted value is multiplied by the resolution time of the free-run timer value to calculate the remaining time. To do. Further, in S170, the CPU 5 determines whether or not the time obtained by subtracting the predetermined time Tα from the measured remaining time (hereinafter referred to as processable time) is equal to or longer than the processing time of the simple logic function selected in S160. The predetermined time Tα is the maximum processing time required from the completion of the execution of the simple logic function in S180 described later to the end of the periodic task without executing the next simple logic function. Therefore, the processable time (= remaining time−Tα) can be used for the execution of the simple logic function as long as the periodic task can be completed by the next scheduled start time of the periodic task. It's time.
CPU5は、上記S170にて、処理可能時間が処理時間以上であると判定した場合には、S160で選択した簡易ロジック関数を実行しても、次回の起床要求が発生するまでに当該定期タスクを終了することができると判断して、S180に進み、S160で選択した簡易ロジック関数を実行する。 If the CPU 5 determines in S170 that the processable time is equal to or longer than the processing time, even if the simple logic function selected in S160 is executed, the CPU 5 executes the periodic task until the next wake-up request is generated. If it is determined that the process can be completed, the process proceeds to S180, and the simple logic function selected in S160 is executed.
そして、CPU5は、次のS190にて、簡易ロジックテーブルに記録されている全ての簡易ロジック関数の実行を完了したか否かを判定し、全ての簡易ロジック関数の実行を完了していないと判定した場合には、S160に戻る。CPU5は、この場合のS160では、前回のS160で選択した簡易ロジック関数の次に処理時間が小さい簡易ロジック
関数を選択する。
In step S190, the CPU 5 determines whether or not the execution of all the simple logic functions recorded in the simple logic table is completed, and determines that the execution of all the simple logic functions is not completed. If so, the process returns to S160. In S <b> 160 in this case, the CPU 5 selects a simple logic function having the next shortest processing time after the simple logic function selected in the previous S <b> 160.
また、CPU5は、上記S190にて、全ての簡易ロジック関数の実行を完了したと判定した場合には、当該定期タスクを終了する。
一方、CPU5は、上記S170にて、処理可能時間が処理時間以上ではないと判定した場合には、S160で選択した簡易ロジック関数を実行せずに、S200に進む。この場合には、S160で選択した簡易ロジック関数を実行すると、次回の起床要求が発生するまでに当該定期タスクを終了することができず、タスク抜けを発生させてしまうからである。
If the CPU 5 determines in S190 that the execution of all the simple logic functions has been completed, the CPU 5 ends the periodic task.
On the other hand, if it is determined in S170 that the processable time is not equal to or longer than the processing time, the CPU 5 proceeds to S200 without executing the simple logic function selected in S160. In this case, if the simple logic function selected in S160 is executed, the periodic task cannot be completed until the next wake-up request is generated, causing a task omission.
そして、CPU5は、S200では、S160で選択した簡易ロジック関数を示す情報を、前述の次回開始関数情報としてRAM9に記憶し、その後、当該定期タスクを終了する。この場合、次回の定期タスクにおいて、最初のS160では、次回開始関数情報が示す簡易ロジック関数から順に選択される。よって、次回の前記タスクでは、前回の定期タスクで最後に実行した簡易ロジック関数の次の順番の簡易ロジック関数から実行されることとなる。また、次回開始関数情報としては、例えば、該当する簡易ロジック関数の処理順序(図2の左端の欄参照)が記憶される。 In S200, the CPU 5 stores the information indicating the simple logic function selected in S160 in the RAM 9 as the above-mentioned next start function information, and then ends the periodic task. In this case, in the next periodic task, in the first S160, the simple logic functions indicated by the next start function information are selected in order. Therefore, the next task is executed from the simple logic function in the next order of the simple logic function executed last in the previous periodic task. As the next start function information, for example, the processing order of the corresponding simple logic function (see the leftmost column in FIG. 2) is stored.
以上のようなECU1において、マイコン3のCPU5は、定期タスクのタスク抜けが発生する可能性があると判定すると(S220:YES)、定期タスクの実行モードを、通常ロジックモードから簡易ロジックモードに切り替える(S230)。そして、定期タスクにおいて、簡易ロジックモードの場合には、第2種ロジック関数として、通常ロジック関数を簡易化した簡易ロジック関数を実行する(S160〜S190)。 In the ECU 1 as described above, when the CPU 5 of the microcomputer 3 determines that there is a possibility that the task of the periodic task may be lost (S220: YES), the execution mode of the periodic task is switched from the normal logic mode to the simple logic mode. (S230). In the case of the simple logic mode in the regular task, a simple logic function obtained by simplifying the normal logic function is executed as the second type logic function (S160 to S190).
このため、CPU5の処理負荷が低減されて(具体的には定期タスクの処理時間が短縮されて)タスク抜けの発生が防止される。また、第2種ロジック関数の処理が全く実行されなくなるのではなく、第2種ロジック関数として簡易ロジック関数が実行されるため、エンジンの制御性能の低下を抑制することができる。よって、制御性能の低下を抑制しつつ、タスク抜けを防止することができる。 For this reason, the processing load of the CPU 5 is reduced (specifically, the processing time of the periodic task is shortened), and the occurrence of task omission is prevented. In addition, the process of the second type logic function is not stopped at all, but the simple logic function is executed as the second type logic function, so that it is possible to suppress a decrease in the control performance of the engine. Therefore, task omission can be prevented while suppressing a decrease in control performance.
また、CPU5は、定期タスクの実行を開始すると、当該定期タスクの前回の終了時から今回の開始時までの時間を余裕時間として計測し(S110)、その計測した余裕時間が規定値未満であれば、定期タスクのタスク抜けが発生する可能性があると判定する(S220)。このため、タスク抜けが発生する可能性があるか否かを正しく判定することができる。 Further, when the execution of the periodic task is started, the CPU 5 measures the time from the previous end of the periodic task to the start of this time as an allowance time (S110), and if the measured allowance time is less than the specified value. For example, it is determined that there is a possibility that the task omission of the periodic task may occur (S220). Therefore, it is possible to correctly determine whether or not there is a possibility of task omission.
また、CPU5は、定期タスクにおいては、第2種ロジック関数よりも先に第1種ロジック関数を実行する(S120)ようになっている。そして、簡易ロジックモードの場合の定期タスクでは、第1種ロジック関数の実行を完了した後、当該タスクの次回の開始予定時刻までに当該タスクを終了させることが可能な範囲で、極力多くの簡易ロジック関数を実行する(S160〜S190)。このため、タスク抜けを防止しつつ、できるだけ多くの簡易ロジック関数を実行して制御への影響を抑制することができる。 Further, in the periodic task, the CPU 5 executes the first type logic function before the second type logic function (S120). In the regular task in the simple logic mode, the simple task is completed as much as possible within a range in which the task can be completed by the next scheduled start time of the task after completing the execution of the first type logic function. The logic function is executed (S160 to S190). For this reason, it is possible to execute as many simple logic functions as possible and suppress the influence on the control while preventing task omission.
しかも、CPU5は、簡易ロジックモードの場合の定期タスクでは、簡易ロジック関数を、処理時間が小さいものから順に実行する。このため、より多くの簡易ロジック関数を実行することができる。 In addition, in the regular task in the simple logic mode, the CPU 5 executes the simple logic functions in descending order of processing time. For this reason, more simple logic functions can be executed.
また、CPU5は、簡易ロジックモードの場合の定期タスクにおいて、全ての簡易ロジック関数を実行することができなかった場合には(S170:NO)、今回の定期タスクで最後に実行した簡易ロジック関数の次の順番の簡易ロジック関数を示す情報を、次回開
始関数情報としてRAM9に記憶する(S200)。そして、CPU5は、次回の定期タスクでは、その次回開始関数情報が示す簡易ロジック関数(つまり、前回の定期タスクで最後に実行した簡易ロジック関数の次の順番の簡易ロジック関数)から実行する(S160,S180)。このため、全ての簡易ロジック関数を複数回の定期タスクによって実行することができるようになる。このことからも制御への影響を抑制することができる。
Further, when all the simple logic functions cannot be executed in the regular task in the simple logic mode (S170: NO), the CPU 5 determines the last simple logic function executed in the current regular task. Information indicating the next simple logic function is stored in the RAM 9 as next start function information (S200). Then, the CPU 5 executes the next regular task from the simple logic function indicated by the next start function information (that is, the simple logic function in the next order of the simple logic function executed last in the previous regular task) (S160). , S180). For this reason, all the simple logic functions can be executed by a plurality of periodic tasks. Also from this, the influence on the control can be suppressed.
また、CPU5は、簡易ロジックモードに移行した後、定期タスクのタスク抜けが発生する可能性が無くなったと判定すると(S240:YES)、定期タスクの実行モードを、簡易ロジックモードから通常ロジックモードに切り替える(S250)。このため、通常モードに復帰することができる。 In addition, when the CPU 5 determines that there is no longer a possibility of the task missing of the periodic task after shifting to the simple logic mode (S240: YES), the execution mode of the periodic task is switched from the simple logic mode to the normal logic mode. (S250). For this reason, it is possible to return to the normal mode.
尚、図4のS240では、図3のS110で算出した余裕時間が所定値以上であるか否かを判定し、余裕時間が所定値以上であれば、タスク抜けが発生する可能性が無くなったと判定して、S250に進むようになっていても良い。 In S240 of FIG. 4, it is determined whether or not the margin time calculated in S110 of FIG. 3 is equal to or greater than a predetermined value. If the margin time is equal to or greater than the predetermined value, there is no possibility of task omission. The determination may be made to proceed to S250.
以上、本発明の実施形態について説明したが、本発明は上記実施形態に限定されることなく、種々の形態を採り得る。また、前述の数値も一例であり他の値でも良い。
例えば、図3のS200では、今回の定期タスクで最後に実行した簡易ロジック関数を示す情報を、RAM9に記憶し、次回の定期タスクでは、その情報が示す簡易ロジック関数の次の順番の簡易ロジック関数から実行するようになっていても良い。また、制御対象はトランスミッションなどでも良い。
As mentioned above, although embodiment of this invention was described, this invention can take a various form, without being limited to the said embodiment. The above-mentioned numerical values are also examples, and other values may be used.
For example, in S200 of FIG. 3, information indicating the simple logic function last executed in the current periodic task is stored in the RAM 9, and in the next periodic task, the simple logic in the next order of the simple logic function indicated by the information is stored. It may be executed from a function. Further, the control target may be a transmission or the like.
また、上記実施形態における1つの構成要素が有する機能を複数の構成要素として分散させたり、複数の構成要素が有する機能を1つの構成要素に統合させたりしてもよい。また、上記実施形態の構成の少なくとも一部を、同様の機能を有する公知の構成に置き換えてもよい。また、上記実施形態の構成の一部を省略してもよい。なお、特許請求の範囲に記載した文言によって特定される技術思想に含まれるあらゆる態様が本発明の実施形態である。また、上述した電子制御装置(ECU)の他、当該電子制御装置を構成要素とするシステム、当該電子制御装置としてコンピュータを機能させるためのプログラム、このプログラムを記録した媒体、タスク抜け防止方法など、種々の形態で本発明を実現することもできる。 In addition, the functions of one component in the above embodiment may be distributed as a plurality of components, or the functions of a plurality of components may be integrated into one component. Further, at least a part of the configuration of the above embodiment may be replaced with a known configuration having the same function. Moreover, you may abbreviate | omit a part of structure of the said embodiment. In addition, all the aspects included in the technical idea specified by the wording described in the claims are embodiments of the present invention. In addition to the electronic control unit (ECU) described above, a system including the electronic control unit as a constituent element, a program for causing a computer to function as the electronic control unit, a medium storing the program, a task omission prevention method, etc. The present invention can also be realized in various forms.
1…ECU(電子制御装置)、5…CPU、7…ROM 1 ... ECU (electronic control unit), 5 ... CPU, 7 ... ROM
Claims (6)
前記タスクを構成する複数の関数として、簡易化が不能なロジックの関数である第1種ロジック関数と、簡易化しても前記制御対象の制御に対する影響が少ないロジックの関数である第2種ロジック関数と、があり、
前記記憶手段には、前記第2種ロジック関数として、簡易化されていない通常演算のための通常ロジック関数と、前記通常演算よりも簡易化された演算のための簡易ロジック関数とが、記憶されており、
前記処理手段が前記タスクを実行する際の実行モードとしては、前記第2種ロジック関数として前記通常ロジック関数の方を実行する通常ロジックモード(S150)と、前記第2種ロジック関数として前記簡易ロジック関数の方を実行する簡易ロジックモード(S160〜S200)と、があり、
前記処理手段は、
前記タスクを前記一定時間毎に実行できないタスク抜けが発生する可能性があるか否かを判定する判定手段(S110,S220)と、
前記判定手段により前記タスク抜けが発生する可能性があると判定されると、前記実行モードを、前記通常ロジックモードから前記簡易ロジックモードに切り替えるモード切替手段(S230)と、を備えること、
を特徴とする電子制御装置。 An electronic control device (7) that includes a storage unit (7) that stores a task to be executed at regular intervals to control a control target, and a processing unit (5) that executes the task at regular intervals. In 1)
As the plurality of functions constituting the task, a first type logic function that is a logic function that cannot be simplified, and a second type logic function that is a logic function that has little influence on the control of the control target even if simplified. There is,
The storage means stores, as the second type logic function, a normal logic function for a normal operation that is not simplified and a simple logic function for a calculation that is simplified more than the normal operation. And
The execution mode when the processing means executes the task includes a normal logic mode (S150) in which the normal logic function is executed as the second type logic function, and the simple logic as the second type logic function. There is a simple logic mode (S160 to S200) for executing the function,
The processing means includes
A determination means (S110, S220) for determining whether or not there is a possibility that a task omission that cannot be performed at the predetermined time may occur;
Mode switching means (S230) for switching the execution mode from the normal logic mode to the simple logic mode when the determination means determines that the task omission may occur.
An electronic control device.
前記判定手段は、前記タスクの実行が開始されると、当該タスクの前回の終了時から今回の開始時までの時間を余裕時間として計測し、その計測した余裕時間が規定値未満であれば、前記タスク抜けが発生する可能性があると判定すること、
を特徴とする電子制御装置。 The electronic control device according to claim 1.
When the execution of the task is started, the determination unit measures the time from the previous end of the task to the start of this time as a margin time, and if the measured margin time is less than a specified value, Determining that the task omission may occur,
An electronic control device.
前記第2種ロジック関数は複数あると共に、前記記憶手段には、複数の前記第2種ロジック関数の各々について、前記通常ロジック関数と前記簡易ロジック関数とが記憶されており、
前記処理手段は、
前記タスクにおいては、前記第1種ロジック関数を前記第2種ロジック関数よりも先に実行するようになっており(S120)、
更に、前記簡易ロジックモードの場合の前記タスクでは、前記第1種ロジック関数の実行を完了した後、当該タスクの次回の開始予定時刻までに当該タスクを終了させることが可能な範囲で極力多くの前記簡易ロジック関数を実行すること(S160〜S200)、
を特徴とする電子制御装置。 The electronic control device according to claim 1 or 2,
There are a plurality of the second type logic functions, and the storage unit stores the normal logic function and the simple logic function for each of the plurality of the second type logic functions.
The processing means includes
In the task, the first type logic function is executed before the second type logic function (S120),
Further, in the task in the simple logic mode, as much as possible within a range in which the task can be completed by the next scheduled start time of the task after the execution of the first type logic function is completed. Executing the simple logic function (S160 to S200);
An electronic control device.
前記処理手段は、前記簡易ロジックモードの場合の前記タスクでは、前記簡易ロジック関数を、処理時間が小さいものから順に実行すること、
を特徴とする電子制御装置。 The electronic control device according to claim 3.
In the task in the case of the simple logic mode, the processing means executes the simple logic functions in order from the smallest processing time,
An electronic control device.
前記処理手段は、前記簡易ロジックモードの場合の前記タスクにおいて、全ての前記簡易ロジック関数を実行することができなかった場合には(S170:NO)、次回の前記タスクでは、前回の前記タスクで最後に実行した前記簡易ロジック関数の次の順番の簡易
ロジック関数から実行すること(S200,S160,S180)、
を特徴とする電子制御装置。 The electronic control device according to claim 4.
In the task in the case of the simple logic mode, the processing means may not execute all the simple logic functions (S170: NO), and the next task is the previous task. Executing from the simple logic function in the next order of the simple logic function executed last (S200, S160, S180),
An electronic control device.
前記処理手段は、
前記実行モードが前記通常ロジックモードから前記簡易ロジックモードに切り替えられた後、前記タスク抜けが発生する可能性が無くなったか否かを判定する復帰判定手段(S240)と、
前記復帰判定手段により前記タスク抜けが発生する可能性が無くなったと判定されると、前記実行モードを前記簡易ロジックモードから前記通常ロジックモードに切り替えるモード復帰手段(S250)と、を備えること、
を特徴とする電子制御装置。 The electronic control device according to any one of claims 1 to 5,
The processing means includes
After the execution mode is switched from the normal logic mode to the simple logic mode, a return determination unit (S240) for determining whether or not the possibility of the task omission occurs is eliminated.
Mode return means (S250) for switching the execution mode from the simple logic mode to the normal logic mode when it is determined by the return determination means that there is no possibility that the task omission occurs.
An electronic control device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015042051A JP2016162330A (en) | 2015-03-04 | 2015-03-04 | Electronic controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015042051A JP2016162330A (en) | 2015-03-04 | 2015-03-04 | Electronic controller |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2016162330A true JP2016162330A (en) | 2016-09-05 |
Family
ID=56845187
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015042051A Pending JP2016162330A (en) | 2015-03-04 | 2015-03-04 | Electronic controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2016162330A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019159310A1 (en) * | 2018-02-16 | 2019-08-22 | 株式会社日立製作所 | Electronic control device |
JP7510327B2 (en) | 2020-10-14 | 2024-07-03 | 日立Astemo株式会社 | Electronic Control Unit |
-
2015
- 2015-03-04 JP JP2015042051A patent/JP2016162330A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019159310A1 (en) * | 2018-02-16 | 2019-08-22 | 株式会社日立製作所 | Electronic control device |
JP7510327B2 (en) | 2020-10-14 | 2024-07-03 | 日立Astemo株式会社 | Electronic Control Unit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5112837B2 (en) | Output signal processing method and vehicle operation control device for atmospheric temperature sensor | |
JP6125111B2 (en) | In-vehicle electronic control unit | |
JP2016162330A (en) | Electronic controller | |
JP2006090356A (en) | Vehicle control device and processing load control program | |
US20190304531A1 (en) | On-vehicle device, clock setting method for on-vehicle device, and computer-readable non-transitory storage medium having program stored therein | |
JP2005301812A (en) | Digital control device and engine control device using the same | |
JP2016013782A (en) | On-vehicle electronic control device | |
JP5527294B2 (en) | Idle stop control device | |
JP7435182B2 (en) | electronic control unit | |
JPH11232148A (en) | Method and system for measuring load rate of computer | |
JP2010003213A (en) | Controller, arithmetic mode changeover method and program | |
JP2008276674A (en) | Electronic computer capable of specifying execution time of task, and program for electronic computer | |
JP5659995B2 (en) | Electronic control unit | |
JP2019173661A (en) | Control apparatus | |
JP7070108B2 (en) | Electronic control device equipped with a multi-core microcomputer | |
JP6447442B2 (en) | Electronic control unit | |
JP2001323836A (en) | Abnormality detection method for crank synchronous task | |
JP2002041493A (en) | Microcomputer | |
JP2019173660A (en) | Control apparatus | |
JP2017123119A (en) | Electronic control device | |
JP2001256063A (en) | Controller and engine controller | |
JP2015215743A (en) | Electronic control unit | |
JP5794012B2 (en) | Electronic control unit | |
JP4853274B2 (en) | ENGINE CONTROL DEVICE AND PROGRAM | |
JP6904054B2 (en) | Fuel injection control device |