JP5040710B2 - Electronic control device and calculation method in electronic control device - Google Patents

Electronic control device and calculation method in electronic control device Download PDF

Info

Publication number
JP5040710B2
JP5040710B2 JP2008034777A JP2008034777A JP5040710B2 JP 5040710 B2 JP5040710 B2 JP 5040710B2 JP 2008034777 A JP2008034777 A JP 2008034777A JP 2008034777 A JP2008034777 A JP 2008034777A JP 5040710 B2 JP5040710 B2 JP 5040710B2
Authority
JP
Japan
Prior art keywords
data
resolution
value
memory
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008034777A
Other languages
Japanese (ja)
Other versions
JP2009190624A (en
Inventor
正幸 金子
拓也 野口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2008034777A priority Critical patent/JP5040710B2/en
Publication of JP2009190624A publication Critical patent/JP2009190624A/en
Application granted granted Critical
Publication of JP5040710B2 publication Critical patent/JP5040710B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、車両の各部を制御する電子制御装置に関し、また、電子制御装置における制御処理での演算方法に関する。   The present invention relates to an electronic control device that controls each part of a vehicle, and also relates to a calculation method in a control process in the electronic control device.

従来、車両においては、機能別に様々な電子制御装置(以下、ECUと記載する)が搭載されている。例えば、エンジンを制御するためのエンジンECU、ブレーキを制御するためのブレーキECUなど、種々のものがある。そして、それら各ECUにはそれぞれ、専用のソフトウェアが組み込まれる(例えば、特許文献1参照)。   2. Description of the Related Art Conventionally, various electronic control devices (hereinafter referred to as ECUs) are mounted on a vehicle according to functions. For example, there are various types such as an engine ECU for controlling the engine and a brake ECU for controlling the brake. Each of these ECUs incorporates dedicated software (see, for example, Patent Document 1).

ECU及びそのECUに組み込まれる組込みソフトウェアの開発過程では、扱うデータのとり得る値の範囲(以下、データ範囲と記載する)を、制御要件(例えば、燃料噴射量、トルク、エンジン回転数等)に応じて予め予測して、データを格納するメモリのデータ型(メモリサイズ)を定めると共に、そのデータ範囲とデータ型とに応じたデータ精度を定めて設計する場合が多い。限られたリソースを有効活用すべく、データ範囲を予め予測し、予測できたデータ範囲に応じて最適なデータ型及びデータ精度を決定する(設計する)ものである。   In the process of developing an ECU and embedded software incorporated in the ECU, the range of values that can be handled (hereinafter referred to as the data range) is changed to control requirements (for example, fuel injection amount, torque, engine speed, etc.). In many cases, the data type (memory size) of the memory for storing the data is predicted in advance, and the data accuracy according to the data range and data type is determined and designed. In order to effectively use limited resources, a data range is predicted in advance, and an optimal data type and data accuracy are determined (designed) according to the predicted data range.

データ型(メモリサイズ)としては、2バイト、4バイトといった種類がある。例えば1〜10の値(データ範囲が1〜10)を2バイトのデータ型で表す場合、分解能(データ精度)は、10/65535(2バイト)となる。データ範囲が1〜1000のデータを2バイトのデータ型で表す場合は、分解能(データ精度)は、1000/65535(2バイト)である。尚、データ型としては、他に、例えば整数を扱う整数型、実数を扱う実数型などがある。整数型としては、正負を表す符号付きの整数型、正数のみの符号無しの整数型などがあり、実数型としては、浮動小数点型、固定小数点型などがある。   Data types (memory size) include 2 bytes and 4 bytes. For example, when a value of 1 to 10 (data range is 1 to 10) is represented by a 2-byte data type, the resolution (data accuracy) is 10/65535 (2 bytes). When data with a data range of 1-1000 is represented by a 2-byte data type, the resolution (data accuracy) is 1000/65535 (2 bytes). Other data types include, for example, an integer type that handles integers and a real number type that handles real numbers. Examples of the integer type include a signed integer type indicating positive / negative and an unsigned integer type including only positive numbers, and examples of the real number type include a floating point type and a fixed point type.

そして、ECUにおける組込みソフトウェアでは、予め決定されたデータ型及びデータ精度を用いて演算が実行される。
特開昭59−85444号公報
And in the embedded software in ECU, a calculation is performed using the data type and data accuracy which were determined beforehand.
JP 59-85444 A

ところで、上記のような開発過程において、制御要件に応じて定まるデータ範囲に変更が生じる場合もある。データ範囲に変更が生じると、データ範囲に応じて決定したデータ型及びデータ精度についても見直しが必要となる。つまり、組込みソフトウェアの再設計が必要となる。   By the way, in the development process as described above, a change may occur in the data range determined according to the control requirements. When the data range changes, the data type and data accuracy determined according to the data range need to be reviewed. In other words, it is necessary to redesign the embedded software.

データ範囲を、予め余裕を持たせて大きめに見積もることも考えられるが、データ範囲が大きいデータについて、限られたデータ型(メモリサイズ)でその値を表現しようとすれば、メモリの分解能(LSB)はどうしても粗くなってしまう。つまり、データ範囲を大きく設定すると、データ精度が低くなってしまい、誤差が大きくなってしまう。一方、メモリサイズを大きくすると、コストが増加してしまう。   Although it is conceivable to estimate the data range with a margin in advance, if the data range is large, if the value is expressed with a limited data type (memory size), the resolution of the memory (LSB) ) Is inevitably rough. That is, if the data range is set large, the data accuracy is lowered and the error is increased. On the other hand, increasing the memory size increases the cost.

尚、メモリサイズのアップによるコストの増加という点では、次のような観点からも問題となっている。近年は、マイコンの高性能化に伴って浮動小数点演算が導入されるようになっているが、浮動小数点演算では、制御要件から決定されるデータ範囲によらず、リソース(メモリサイズ)が一律に決定され(例えば4バイト)、以前よりも多くのリソース(メモリサイズ)を必要とする場合がある。これにより、マイコンにおけるメモリの容量アップや、不揮発性メモリ(EEPROM)の容量アップが必要となる場合があり、このため、コストの増加につながるというものである。   In terms of the increase in cost due to the increase in memory size, there is a problem from the following viewpoint. In recent years, floating-point arithmetic has been introduced as the performance of microcomputers has improved. However, in floating-point arithmetic, resources (memory size) are uniform regardless of the data range determined from control requirements. It is determined (eg, 4 bytes) and may require more resources (memory size) than before. As a result, it may be necessary to increase the capacity of the memory in the microcomputer or increase the capacity of the nonvolatile memory (EEPROM), which leads to an increase in cost.

本発明は、こうした問題に鑑みなされたもので、車両の各部を制御する車両用電子制御装置において、制御のための制御処理で扱うデータの精度をなるべく向上させることを目的とし、また、電子制御装置におけるソフトウェアの再設計やメモリの容量アップを防止することを目的とする。   The present invention has been made in view of these problems, and an object of the present invention is to improve as much as possible the accuracy of data handled in control processing for control in an electronic control device for a vehicle that controls each part of the vehicle. The object is to prevent software redesign and memory capacity increase in the apparatus.

上記目的を達成するためになされた請求項1に記載の電子制御装置は、車両に備えられ、その車両における制御対象を制御する制御処理を実行する。その制御処理のプログラムにおいて変数のデータ型(例えば、2バイト或いは4バイトといったような種別)は予め定められる(例えばプログラム中において宣言される)。   The electronic control device according to claim 1, which has been made to achieve the above object, is provided in a vehicle and executes a control process for controlling a control target in the vehicle. In the control processing program, the data type of the variable (for example, a type such as 2 bytes or 4 bytes) is predetermined (for example, declared in the program).

そして、本請求項1の電子制御装置では、データ幅取得手段が、制御対象を制御するために検出される数値データであって、制御処理において扱われるその数値データの可変範囲の幅(以下、データ幅と言う)を表す情報を取得し、分解能算出手段が、データ幅取得手段により取得されたデータ幅を、データ型に格納可能な範囲を表す値で除算した分解能を算出する。そして、制御処理では、分解能算出手段により算出された分解能で数値データがメモリに格納されるようになっている。   In the electronic control device according to the first aspect, the data width acquisition means is numerical data detected for controlling the control object, and the width of the variable range of the numerical data handled in the control process (hereinafter, Information representing data width) is acquired, and the resolution calculation means calculates a resolution obtained by dividing the data width acquired by the data width acquisition means by a value representing a range that can be stored in the data type. In the control process, numerical data is stored in the memory with the resolution calculated by the resolution calculation means.

つまり、数値データのデータ幅に応じて、分解能が算出されるようになっている。例えば、可変範囲が0〜10(データ幅が10)である数値データAと、可変範囲が0〜100(データ幅が100)である数値データBとがある場合、同じデータ型に格納するならば、前者のほうが分解能を10倍高くすることができる。具体的に、データ型が2バイトであれば、数値データAの分解能は10/65535となり、数値データBの分解能は100/65535となる。本請求項1の電子制御装置では、数値データのデータ幅に応じて分解能が最適に(分解能がより高くなるように)設定されるため、データ精度が粗くなってしまわないようにすることができる。換言すれば、データ精度がなるべく良くなるようにされる。   That is, the resolution is calculated according to the data width of the numerical data. For example, if there is numerical data A whose variable range is 0 to 10 (data width is 10) and numerical data B whose variable range is 0 to 100 (data width is 100), if they are stored in the same data type In the case of the former, the resolution can be increased 10 times. Specifically, if the data type is 2 bytes, the resolution of the numerical data A is 10/65535, and the resolution of the numerical data B is 100/65535. In the electronic control device according to the first aspect of the present invention, since the resolution is set optimally (so that the resolution becomes higher) according to the data width of the numerical data, it is possible to prevent the data accuracy from becoming coarse. . In other words, the data accuracy is improved as much as possible.

また、データ幅に応じて分解能(データ精度)が算出されるため、データ幅の変化に柔軟に対応できる。
例えば従来は、設計段階において、データ幅を制御要件や仕様に応じて予測し、その予測したデータ幅に応じてデータ型や分解能(データ精度)を設定していたが、データ幅は前述のように制御要件や仕様に応じて算出(予測)されるものであり、そのデータ幅の算出値(予測値)に変更が生じる場合もある。このため、データ型や分解能(データ精度)も見直しが必要となる場合があった。つまり、再設計が必要となる場合があった。また、このような再設計を避けるためにデータ幅を大きめに見積もることも考えられるが、そうすると、分解能(データ精度)は粗くなってしまう。
Further, since the resolution (data accuracy) is calculated according to the data width, it is possible to flexibly cope with changes in the data width.
For example, in the past, at the design stage, the data width was predicted according to the control requirements and specifications, and the data type and resolution (data accuracy) were set according to the predicted data width. Are calculated (predicted) according to control requirements and specifications, and the calculated value (predicted value) of the data width may change. For this reason, the data type and resolution (data accuracy) may need to be reviewed. In other words, redesign may be necessary. In order to avoid such redesign, it is conceivable to estimate the data width to be large, but in this case, the resolution (data accuracy) becomes coarse.

これに対し、本請求項1の電子制御装置では、データ幅に応じて分解能(データ精度)が算出されることから、上記のような従来において問題となっていた分解能(データ精度)の見直しというような作業が不要となる。つまり、再設計の問題を回避できる。また、データ幅を大きめに見積もって分解能(データ精度)が低下してしまう、という問題を回避することができる。   On the other hand, in the electronic control device according to the first aspect, since the resolution (data accuracy) is calculated according to the data width, the resolution (data accuracy) which has been a problem in the related art as described above is reviewed. Such work becomes unnecessary. That is, the problem of redesign can be avoided. Further, it is possible to avoid the problem that the resolution (data accuracy) is lowered by estimating the data width to be large.

さらに、このような本請求項1の構成によれば、ソフトウェアの汎用性を向上させることができる。具体的に、例えばデータ幅は車両やエンジンの種類によって異なるが、データ幅に応じて分解能(データ精度)が算出されるようなソフトウェアによれば、車両やエンジンの種類によらずどのような電子制御装置にも搭載することができる。また、ソフトウェア上で分解能(データ精度)が算出されるため、ソフトウェア上において分解能(データ精度)が認識されるようになって、このため、分解能(データ精度)に応じてプログラム(演算)を切り換えるというような必要がなくなる。例えば従来の、分解能(データ精度)が予め設定される構成では、例えばプログラム中において予め分解能(データ精度)が定義され、このため分解能(データ精度)毎にプログラムを切り換える必要もあったが、本請求項1の構成によればそのような必要がなくなる。   Furthermore, according to the configuration of the first aspect, the versatility of the software can be improved. Specifically, for example, the data width varies depending on the type of vehicle or engine, but according to software whose resolution (data accuracy) is calculated according to the data width, what kind of electronic data is used regardless of the type of vehicle or engine. It can also be mounted on a control device. In addition, since the resolution (data accuracy) is calculated on the software, the resolution (data accuracy) is recognized on the software. Therefore, the program (calculation) is switched according to the resolution (data accuracy). It is no longer necessary. For example, in the conventional configuration in which the resolution (data accuracy) is set in advance, for example, the resolution (data accuracy) is defined in advance in the program. Therefore, it is necessary to switch the program for each resolution (data accuracy). According to the configuration of claim 1, such a need is eliminated.

次に、請求項1の電子制御装置では、請求項2のように構成すると良い。
請求項2の電子制御装置は、請求項1の電子制御装置において、データ幅取得手段は、データ幅を所定の分割数で分割してその分割後の個々のデータ幅(以下、個別データ幅と言う)を算出する個別データ幅算出手段を備え、分解能算出手段は、個別データ幅を、データ型に格納可能な範囲を表す値で除算した分解能(以下、個別分解能と言う)を算出するようになっている。
Next, the electronic control device according to claim 1 may be configured as in claim 2.
According to a second aspect of the present invention, there is provided the electronic control device according to the first aspect, wherein the data width acquisition means divides the data width by a predetermined number of divisions, and the individual data widths after the division (hereinafter referred to as individual data widths) And a resolution calculation unit that calculates a resolution obtained by dividing the individual data width by a value representing a range that can be stored in the data type (hereinafter referred to as individual resolution). It has become.

そして、可変範囲を所定の分割数で分割して、分割後の個々の領域(以下、個別領域と言う)のそれぞれについて、その領域の始値(以下、オフセット値と言う)を算出するオフセット値算出手段を備え、制御処理では、数値データの値から、その数値データが含まれる個別領域のオフセット値(以下、対象オフセット値と言う)を減算した値が、個別分解能でメモリに格納されるようになっていると共に、そのメモリに格納された値と、対象オフセット値とを用いて数値データが表わされるように構成されている。   Then, the variable range is divided by a predetermined number of divisions, and for each of the divided areas (hereinafter referred to as individual areas), an offset value for calculating the starting value (hereinafter referred to as an offset value) of that area In the control process, a value obtained by subtracting an offset value (hereinafter referred to as a target offset value) of an individual area including the numerical data from the numerical data value is stored in the memory with the individual resolution. In addition, the numerical data is expressed using the value stored in the memory and the target offset value.

本請求項2の構成について例をあげて具体的に説明する。
可変範囲が0〜10(データ幅が10)である数値データAを例にとる。また、分割数は4、データ型は2バイトであるとする。
The configuration of the second aspect will be specifically described with an example.
Take numerical data A whose variable range is 0 to 10 (data width is 10) as an example. The number of divisions is 4 and the data type is 2 bytes.

分割数4で数値データAのデータ幅を分割すると(つまり、4つに分割すると)、分割後の個々のデータ幅は2.5となる。データ幅2.5を2バイトのデータ型に格納する場合、分解能は2.5/65535となる。   When the data width of the numerical data A is divided by the number of divisions 4 (that is, divided into four), the individual data width after division is 2.5. When the data width 2.5 is stored in a 2-byte data type, the resolution is 2.5 / 65535.

可変範囲0〜10を分割数4で分割した後の個々の領域は、それぞれ、0〜2.5(領域0)、2.5〜5.0(領域1)、5.0〜7.5(領域2)、7.5〜10(領域3)となる。各領域の始値(オフセット値)は、それぞれ、0、2.5、5.0、7.5である。領域間の境界の数値は番号の大きい領域に属する。例えば2.5という数値は、領域1に属する。   The individual areas after dividing the variable range 0 to 10 by the division number 4 are 0 to 2.5 (area 0), 2.5 to 5.0 (area 1), and 5.0 to 7.5, respectively. (Region 2), 7.5 to 10 (region 3). The starting value (offset value) of each region is 0, 2.5, 5.0, and 7.5, respectively. The numerical value of the boundary between the regions belongs to the region with a large number. For example, a numerical value of 2.5 belongs to region 1.

ここで、3.5という数値を表す場合を考える。数値3.5は、可変範囲0〜10を4分割した後の個々の領域のうち、領域1に含まれる。そして、3.5は、2.5+1であり、領域1のオフセット値2.5に1を足した数値として表される。   Here, a case where a numerical value of 3.5 is expressed is considered. The numerical value 3.5 is included in the region 1 among the individual regions after the variable range 0 to 10 is divided into four. 3.5 is 2.5 + 1, and is expressed as a numerical value obtained by adding 1 to the offset value 2.5 of the region 1.

そして、本請求項2の構成では、3.5=2.5+1で表した場合の1が、2.5/65535の分解能でメモリに格納される。そして、そのメモリに格納された値と、オフセット値である2.5という数値とで、3.5という数値が表される。   In the configuration of claim 2, 1 in the case of 3.5 = 2.5 + 1 is stored in the memory with a resolution of 2.5 / 65535. Then, the value stored in the memory and the numerical value of 2.5 which is the offset value represent a numerical value of 3.5.

これによれば、3.5という値を表す場合に、より高い分解能(データ精度)でその値を表すことができる。具体的に、所定の数値データのデータ幅を所定分割数で分割し、分割後のデータ幅に基づいて分解能を算出しているため、分解能(データ精度)を(1/分割数)倍だけ向上させる(細かくする)ことができる。   According to this, when a value of 3.5 is represented, the value can be represented with higher resolution (data accuracy). Specifically, the data width of the predetermined numerical data is divided by the predetermined number of divisions, and the resolution is calculated based on the data width after the division, so the resolution (data accuracy) is improved by (1 / number of divisions) times Can be made fine.

次に、請求項2の電子制御装置では、請求項3のように構成すると良い。
請求項3の電子制御装置は、請求項2の電子制御装置において、データ幅は所定の分割数で所定幅毎に分割されるようになっており、オフセット値は、個別データ幅に、分割の境界数を表す整数値の最小値から最大値をそれぞれ乗算することで算出されるようになっている。
Next, the electronic control device according to claim 2 is preferably configured as in claim 3.
According to a third aspect of the present invention, in the electronic control device of the second aspect, the data width is divided into a predetermined number of divisions for each predetermined width, and the offset value is divided into individual data widths. It is calculated by multiplying the minimum value of the integer value representing the number of boundaries by the maximum value.

分割の境界数について、例えば4分割の場合は、境界数(区切りの数)は3である。
例えば、上記の数値データAの可変範囲0〜10,データ範囲10を4分割する例において、本請求項3の構成によれば、わざわざオフセット値0、2.5、5.0、7.5を記憶しておかなくても、データ幅2.5、及び分割の境界数を表す情報(4分割を表す情報)さえあれば、データ幅2.5に0〜3を乗算して、オフセット値0(2.5*0)、2.5(2.5*1)、5.0(2.5*2)、7.5(2.5*3)を算出することができる。4分割の場合は、前述のように分割の境界は3つであり、データ幅2.5に0〜3の整数値を乗算することでオフセット値が算出される。
Regarding the number of division boundaries, for example, in the case of four divisions, the number of boundaries (number of divisions) is three.
For example, in the example in which the variable range 0 to 10 and the data range 10 of the numerical data A are divided into four, according to the configuration of the third aspect, the offset values 0, 2.5, 5.0, and 7.5 are bothered. Even if the data width is 2.5 and the information indicating the number of division boundaries (information indicating four divisions) is present, the data width 2.5 is multiplied by 0 to 3 to obtain the offset value. 0 (2.5 * 0), 2.5 (2.5 * 1), 5.0 (2.5 * 2), and 7.5 (2.5 * 3) can be calculated. In the case of four divisions, there are three division boundaries as described above, and the offset value is calculated by multiplying the data width 2.5 by an integer value of 0 to 3.

ところで、電子制御装置においては、数値データは、その電子制御装置に備えられる不揮発性メモリ(以下、EEPROMと記載する)やバックアップRAMに格納される場合がある。この場合において、オフセット値がそのまま格納されると、メモリ容量がより多く必要となる。この点、請求項3の電子制御装置では、分割数を表す情報さえ記憶しておけば、オフセット値をそのまま格納する必要がないため、メモリ容量を節約することができる。   By the way, in an electronic control device, numerical data may be stored in a non-volatile memory (hereinafter referred to as EEPROM) or backup RAM provided in the electronic control device. In this case, if the offset value is stored as it is, more memory capacity is required. In this regard, in the electronic control device according to the third aspect, as long as the information indicating the number of divisions is stored, it is not necessary to store the offset value as it is, so that the memory capacity can be saved.

尚、分割数を表す情報を記憶するメモリサイズとして例えば2ビットが割り当てられた場合、そのメモリには0〜3(つまり、最大4分割までを表す情報)を記憶できる。このため、例えば1バイトのデータ中に、最大4分割までを表す情報を、4種類の数値データについてそれぞれ記憶しておくことができる。   In addition, when 2 bits are allocated as a memory size for storing information representing the number of divisions, 0 to 3 (that is, information representing up to 4 divisions) can be stored in the memory. For this reason, for example, information representing up to four divisions can be stored for each of four types of numerical data in 1-byte data.

次に、請求項1〜3の電子制御装置では、請求項4のように構成することができる。
請求項4の電子制御装置は、データ幅取得手段及び分解能算出手段の動作を制御する動作制御手段を備え、該動作制御手段は、使用者の入力に基づき、数値データの種別毎に、データ幅取得手段及び分解能算出手段の動作を許可するか否かを判定し、動作制御手段により動作が許可されない場合は、データ幅取得手段及び分解能算出手段は動作しないように構成され、この場合の制御処理では、使用者により予め入力された分解能で数値データがメモリに格納されるようになっている。
Next, the electronic control device according to claims 1 to 3 can be configured as in claim 4.
The electronic control device according to claim 4 includes operation control means for controlling operations of the data width acquisition means and the resolution calculation means, the operation control means for each type of numerical data based on a user input. It is determined whether or not the operation of the acquisition unit and the resolution calculation unit is permitted. When the operation is not permitted by the operation control unit, the data width acquisition unit and the resolution calculation unit are configured not to operate, and the control processing in this case In this case, numerical data is stored in the memory with a resolution input in advance by the user.

例えば、データ幅に応じて分解能(データ精度)が適宜算出される構成は上述のようにメリットがあるが、一方で、開発者(設計者)が、分解能(データ精度)を固定したいという場合も想定される。この点、本請求項4の電子制御装置によれば、データ幅に応じて分解能(データ精度)が算出されるという構成を無効にするということも自由にでき、開発者(設計者)に要望により応えることができる。   For example, the configuration in which the resolution (data accuracy) is appropriately calculated according to the data width has the advantages as described above. On the other hand, the developer (designer) may want to fix the resolution (data accuracy). is assumed. In this regard, according to the electronic control device of claim 4, it is possible to invalidate the configuration in which the resolution (data accuracy) is calculated according to the data width, which is requested by the developer (designer). Can respond.

次に、請求項5の電子制御装置は、請求項1〜4の電子制御装置において、数値データは、固定小数点型の変数としてメモリに格納されるようになっている。
例えば、浮動小数型の変数の場合、データ型は少なくとも4バイトとなり、メモリ容量を増加させる必要も生じ得る。これに対し、本請求項5の電子制御装置では、固定小数型を適用するため、浮動小数型を適用する場合と比較してメモリ容量を抑えることができる。
Next, according to a fifth aspect of the present invention, in the electronic control device according to the first to fourth aspects, the numerical data is stored in the memory as a fixed-point variable.
For example, in the case of a floating-point variable, the data type is at least 4 bytes, and it may be necessary to increase the memory capacity. On the other hand, in the electronic control device according to the fifth aspect, since the fixed decimal type is applied, the memory capacity can be suppressed as compared with the case where the floating decimal type is applied.

尚、数値データの種類に応じて、浮動小数型を適用するか固定小数型を適用するかを変更しても良い。例えば、分解能(データ精度)の精密さが要求される数値データについては浮動小数型が適用されるようにし、分解能(データ精度)の精密さがさほど要求されない数値データについては固定小数型が適用されるようにしても良い。   Depending on the type of numerical data, whether to apply a floating decimal type or a fixed decimal type may be changed. For example, a floating-point type is applied to numerical data that requires precision in resolution (data accuracy), and a fixed decimal type is applied to numerical data that does not require much precision in resolution (data accuracy). You may make it.

次に、請求項5の電子制御装置では、請求項6のように構成すると良い。
請求項6の電子制御装置は、請求項5の電子制御装置において、数値データの要求精度は予め定められ、数値データを、固定小数点型の変数として、分解能算出手段により算出される分解能でメモリに格納した場合のそのデータの精度(以下、数値データ精度と言う)と、要求精度とを比較する比較手段を備え、比較手段の比較結果に基づき、数値データ精度が要求精度を満たしているか否かを判定し、満たしている場合に数値データが固定小数型の変数としてメモリに格納されるようになっている。
Next, an electronic control device according to a fifth aspect is preferably configured as in the sixth aspect.
According to a sixth aspect of the present invention, in the electronic control device of the fifth aspect, the required accuracy of the numerical data is predetermined, and the numerical data is stored in the memory with a resolution calculated by the resolution calculating means as a fixed-point variable. Comparing means for comparing the accuracy of the stored data (hereinafter referred to as numerical data accuracy) with the required accuracy is provided. Whether the numerical data accuracy satisfies the required accuracy based on the comparison result of the comparing means Is satisfied, the numerical data is stored in the memory as a fixed decimal variable.

これによれば、数値データを固定小数型でメモリに格納しようとする際に、分解能算出手段によりデータ幅に応じて算出された分解能(データ精度)が予め定められた要求精度を満たしていれば、固定小数型で格納され、この場合はメモリ容量を節約することができる。逆に言えば、分解能算出手段によりデータ幅に応じて算出された分解能(データ精度)が予め定められた要求精度を満たしていなければ、固定小数型で格納されないようにすることができるが、この場合は、例えば浮動小数型で格納されるようにすることで数値データの精度を向上させることができる。   According to this, when the numerical data is stored in the memory in the fixed decimal type, if the resolution (data accuracy) calculated according to the data width by the resolution calculation means satisfies the predetermined required accuracy. In this case, the memory capacity can be saved. Conversely, if the resolution (data accuracy) calculated according to the data width by the resolution calculation means does not satisfy the predetermined required accuracy, it can be prevented from being stored in the fixed decimal type. In this case, for example, the accuracy of numerical data can be improved by storing the data in a floating-point type.

つまり、本請求項6の構成によれば、メモリ容量を節約することと、データ精度の悪化を防止することとを、両立させることができる。
次に、請求項7の電子制御装置は、車両に備えられ、その車両における制御対象を制御する制御処理を実行する電子制御装置であって、制御処理のプログラムにおいて変数のデータ型は予め定められ、制御対象を制御するために検出される数値データであって、制御処理において扱われるその数値データの要求精度である分解能は予め定められている。
That is, according to the configuration of the sixth aspect, it is possible to achieve both saving of memory capacity and preventing deterioration of data accuracy.
Next, an electronic control device according to a seventh aspect of the present invention is an electronic control device that is provided in a vehicle and executes a control process for controlling a control target in the vehicle, and a data type of a variable is determined in advance in the control process program. The resolution that is the numerical data detected for controlling the controlled object and is the required accuracy of the numerical data to be handled in the control process is determined in advance.

そして、データ幅取得手段が、数値データの可変範囲の幅(以下、データ幅と言う)を表す情報を取得し、分割数算出手段が、そのデータ幅を前記データ型に前記分解能で格納可能な範囲を表す値で除算して、その結果の小数点以下を切り上げて分割数を算出し、オフセット値算出手段が、数値データの可変範囲が分割数算出手段により算出された分割数(以下、算出分割数と言う)で分割された後の個々の領域(以下、個別領域と言う)のそれぞれについて、その領域の始値(以下、オフセット値と言う)を算出する。   The data width acquisition means acquires information indicating the width of the variable range of the numerical data (hereinafter referred to as data width), and the division number calculation means can store the data width in the data type with the resolution. Divide by the value representing the range, round up the result to calculate the number of divisions, and the offset value calculation means calculates the number of divisions in which the variable range of the numerical data is calculated by the division number calculation means (hereinafter calculated division) For each of the individual regions (hereinafter referred to as individual regions) after being divided by a number), the starting value (hereinafter referred to as an offset value) of that region is calculated.

そして、制御処理では、数値データの値から、その数値データが含まれる個別領域のオフセット値(以下、対象オフセット値と言う)を減算した値が、予め定められた分解能でメモリに格納されるようになっていると共に、そのメモリに格納された値と、対象オフセット値とを用いて数値データが表わされるようになっている。   In the control process, a value obtained by subtracting an offset value (hereinafter referred to as a target offset value) of an individual area including the numerical data from the value of the numerical data is stored in the memory with a predetermined resolution. In addition, the numerical data is represented using the value stored in the memory and the target offset value.

この請求項7の電子制御装置において、数値データの可変範囲(データ幅)を分割して、メモリに格納する幅を分割後のデータ幅に狭めることで要求精度となるデータの分解能(データ精度)を満足させるという趣旨がある。請求項2と以下のような点で異なる。   8. The electronic control unit according to claim 7, wherein the variable range (data width) of the numerical data is divided, and the width stored in the memory is narrowed to the data width after the division, so that the resolution of the data (data accuracy) which is required accuracy There is a purpose of satisfying. It differs from claim 2 in the following points.

本請求項7の電子制御装置では、数値データの要求精度が予め定められており、その要求精度に合わせて、数値データの可変範囲(データ幅)の分割数が算出される点が、請求項2の構成と異なっている。   In the electronic control device of claim 7, the required accuracy of numerical data is predetermined, and the number of divisions of the variable range (data width) of the numerical data is calculated in accordance with the required accuracy. This is different from the configuration of 2.

例えば電子制御装置においては、制御要件或いは仕様に基づいて分解能(データ精度)の精密さが決定される場合もあるが、データ幅が大きい場合、その分解能(データ精度)を維持しようとすればデータ型を大きくしなければならなくなる。   For example, in an electronic control device, the precision of resolution (data accuracy) may be determined based on control requirements or specifications, but if the data width is large, if the resolution (data accuracy) is to be maintained, the data You have to make the mold bigger.

この点、本請求項7の電子制御装置によれば、分割数算出手段が、データ幅取得手段により取得されたデータ幅を、所定のデータ型に所定の分解能(尚、共に予め定められる)で格納可能な範囲を表す値で除算して、その結果の小数点以下を切り上げて分割数を算出するため、メモリに格納する幅を、数値データの可変範囲(データ幅)をその分割数で分割した後の個々のデータ幅にまで狭めた場合の分解能(データ精度)が、予め定められる要求精度に合致するようになるため、データ型を大きくしなくても、要求精度が満たされるようになる。   In this regard, according to the electronic control device of the present invention, the division number calculating means converts the data width acquired by the data width acquiring means into a predetermined data type with a predetermined resolution (both are predetermined in advance). In order to calculate the number of divisions by dividing by the value representing the storable range and rounding up the result, the variable storage range (data width) of the numerical data is divided by the number of divisions. Since the resolution (data accuracy) when narrowed to the individual data width later matches the predetermined required accuracy, the required accuracy can be satisfied without increasing the data type.

次に、請求項7の電子制御装置では、請求項8のように構成すると良い。
請求項8の電子制御装置は、請求項7の電子制御装置において、データ幅取得手段及び分割数算出手段の動作を制御する動作制御手段を備え、該動作制御手段は、使用者の入力に基づき、数値データの種別毎に、データ幅取得手段及び分割数算出手段の動作を許可するか否かを判定し、動作制御手段により動作が許可されない場合は、データ幅取得手段及び分割数算出手段は動作しないように構成され、この場合の制御処理では、使用者により予め入力された分解能で数値データがメモリに格納されるようになっている。
Next, an electronic control device according to a seventh aspect may be configured as in the eighth aspect.
An electronic control device according to an eighth aspect of the present invention is the electronic control device according to the seventh aspect, further comprising operation control means for controlling operations of the data width acquisition means and the division number calculation means, and the operation control means is based on a user input. Then, for each type of numerical data, it is determined whether or not the operation of the data width acquisition unit and the division number calculation unit is permitted, and when the operation is not permitted by the operation control unit, the data width acquisition unit and the division number calculation unit In the control process in this case, the numerical data is stored in the memory with the resolution input in advance by the user.

これによれば、請求項4について述べた効果と同じ効果を得ることができる。
次に、請求項9の発明は、車両に備えられる電子制御装置にて、その車両における制御対象を制御する制御処理において用いられる演算方法であって、制御処理のプログラムにおいて変数のデータ型は予め定められ、制御対象を制御するために検出される数値データであって、制御処理において扱われるその数値データの可変範囲の幅(以下、データ幅と言う)を表す情報を取得し、取得されたデータ幅を、データ型に格納可能な範囲を表す値で除算した分解能を算出し、制御処理では、算出された分解能で数値データがメモリに格納されるようになっていることを特徴とする電子制御装置における演算方法である。
According to this, the same effect as described in claim 4 can be obtained.
Next, the invention of claim 9 is an arithmetic method used in a control process for controlling an object to be controlled in the vehicle by an electronic control device provided in the vehicle, wherein the data type of the variable is set in advance in the program of the control process. Information that is defined and detected to control the control target, and that represents the width of the variable range of the numerical data (hereinafter referred to as data width) handled in the control process, A resolution obtained by dividing the data width by a value representing a range that can be stored in the data type is calculated, and in the control process, numerical data is stored in the memory with the calculated resolution. It is the calculation method in a control apparatus.

これによれば、請求項1について述べた効果と同じ効果を得ることができる。   According to this, the same effect as described in claim 1 can be obtained.

以下に、本発明の実施形態を図面に基づき説明する。
[第1実施形態]
図1は、本発明が適用された電子制御装置(以下、ECUと記載する)1の構成図である。
Embodiments of the present invention will be described below with reference to the drawings.
[First Embodiment]
FIG. 1 is a configuration diagram of an electronic control device (hereinafter referred to as ECU) 1 to which the present invention is applied.

図1のECU1は車両に備えられてその車両の各部を制御するものであり、そのECU1が扱う種々の制御データの値がとり得る範囲(後述するデータ範囲)から、その制御データのそれぞれについて、制御データを格納するメモリの分解能(LSB:Least Significant Bit)を動的に算出する機能を備える。言い換えると、データ精度を一律にして扱うのではなく、制御データそれぞれについてのデータ範囲に応じてその制御データのデータ精度を動的に算出する。尚、制御データとは、車両を制御するための各種制御処理(制御ロジック)で用いられるものであり、例えば燃料噴射量やエンジン回転数といったようなデータが考えられる。   The ECU 1 of FIG. 1 is provided in a vehicle and controls each part of the vehicle. From the range (data range described later) that can be taken by various control data values handled by the ECU 1, It has a function of dynamically calculating the resolution (LSB: Last Significant Bit) of a memory for storing control data. In other words, the data accuracy of the control data is dynamically calculated according to the data range for each control data, instead of handling the data accuracy uniformly. The control data is used in various control processes (control logic) for controlling the vehicle. For example, data such as the fuel injection amount and the engine speed can be considered.

ECU1は、マイコン10と、不揮発性のメモリであるEEPROM30とを備えている。
マイコン10は、所定のプログラムに従い動作して各種演算を実行するCPU12と、CPU12に各種演算を実行させるためのプログラムや固定データが予め格納されるフラッシュROM16と、CPU12による演算結果が一時的に記憶されるRAM18と、例えば車両に設けられるバッテリ(図示省略)から常時電源電圧が供給され、電源電圧が供給される間情報を保持可能なバックアップRAM20と、を備えている。
The ECU 1 includes a microcomputer 10 and an EEPROM 30 that is a nonvolatile memory.
The microcomputer 10 operates in accordance with a predetermined program to execute various calculations, a flash ROM 16 in which programs for causing the CPU 12 to execute various calculations and fixed data are stored in advance, and calculation results by the CPU 12 are temporarily stored. And a backup RAM 20 that is always supplied with a power supply voltage from, for example, a battery (not shown) provided in the vehicle and can hold information while the power supply voltage is supplied.

また、CPU12は、浮動小数点演算を行うFPU14を備えている。FPU14は、CPU12からの指令により動作して浮動小数点演算を行う演算器である。
次に、ECU1のCPU12が実行する図2〜図4の処理について説明する。
The CPU 12 also includes an FPU 14 that performs floating-point arithmetic. The FPU 14 is an arithmetic unit that operates according to a command from the CPU 12 and performs floating-point arithmetic.
Next, the processes of FIGS. 2 to 4 executed by the CPU 12 of the ECU 1 will be described.

まず、図2は、制御データのデータ精度(メモリの分解能)を算出する分解能算出処理を表すフローチャートである。この分解能算出処理は、制御データを更新、或いは参照するタイミングで実行される。   First, FIG. 2 is a flowchart showing a resolution calculation process for calculating data accuracy (memory resolution) of control data. This resolution calculation process is executed at a timing when the control data is updated or referred to.

図2の分解能算出処理では、まず、S110で、制御データがとり得る値の範囲(幅)であるデータ範囲(以下、Dsとも記載(併記)する)を表す情報を取得する。尚、以下の説明では、例えば「データ範囲(Ds)を取得する」というように「を表す情報」という記載を適宜省略して説明する。データ範囲(Ds)は、具体的に、制御データの値の最小値〜最大値の範囲の幅を言う。このデータ範囲(Ds)は、フラッシュROM16に予め記憶されており、S110では、フラッシュROM16からデータ範囲(Ds)を読み出して取得するようになっている。また、データ範囲(Ds)は、制御要件(例えば、燃料噴射量、トルク、エンジン回転数といった種々の要件)に応じて定められるものであり、フラッシュROM16には、データ範囲(Ds)と制御要件との関係を表す情報(テーブル)が記憶されている。S110では、その時々の制御要件に応じたデータ範囲(Ds)の情報が読み出される。   In the resolution calculation process of FIG. 2, first, in S110, information representing a data range (hereinafter also referred to as Ds (also described as Ds)) that is a range (width) of values that can be taken by the control data is acquired. In the following description, description of “information representing” is omitted as appropriate, for example, “acquire data range (Ds)”. The data range (Ds) specifically refers to the width of the range of the minimum value to the maximum value of the control data. The data range (Ds) is stored in advance in the flash ROM 16, and the data range (Ds) is read from the flash ROM 16 and acquired in S110. The data range (Ds) is determined according to control requirements (for example, various requirements such as fuel injection amount, torque, and engine speed), and the flash ROM 16 includes a data range (Ds) and control requirements. Information (table) representing the relationship is stored. In S110, information on the data range (Ds) corresponding to the control requirements at that time is read.

S110の後は、S120に進み、制御データを格納するメモリの型(サイズ)を取得する(読み出す)。メモリの型とは、言い換えると、変数の型(例えば2バイト、或いは4バイトといったような種別)である。尚、以下、メモリの型(サイズ)をDspとも記載(併記)する。メモリの型(Dsp)を表す情報は、例えばフラッシュROM16に予め記憶されている。   After S110, the process proceeds to S120, and the type (size) of the memory storing the control data is acquired (read). In other words, the memory type is a variable type (for example, a type such as 2 bytes or 4 bytes). In the following, the memory type (size) is also described (also shown) as Dsp. Information indicating the memory type (Dsp) is stored in advance in the flash ROM 16, for example.

次に、S130に進み、メモリの分解能(以下、Vacとも記載(併記)する)を更新(算出)する。具体的に、メモリの分解能(Vac)は、Vac=Ds/Ds_maxなる式により算出される。Ds_maxは、メモリの型(Dsp)の最大値である。つまり、メモリの分解能(Vac)は、データ範囲(Ds)をメモリの型に格納可能な範囲(Dsp)で除算した値である。例えばデータ範囲10(最小値0〜最大値10)の制御データを2バイトの型に格納する場合、分解能は、10/65535となる。S130の後は、当該処理を終了する。   Next, in S130, the resolution of the memory (hereinafter also referred to as Vac (also described)) is updated (calculated). Specifically, the resolution (Vac) of the memory is calculated by the equation Vac = Ds / Ds_max. Ds_max is the maximum value of the memory type (Dsp). That is, the resolution (Vac) of the memory is a value obtained by dividing the data range (Ds) by the range (Dsp) that can be stored in the memory type. For example, when storing control data in the data range 10 (minimum value 0 to maximum value 10) in a 2-byte type, the resolution is 10/65535. After S130, the process ends.

次に、図3は、各種制御ロジックにより算出される実データを、図2の処理で算出したメモリの分解能(Vac)を用いて変換してメモリに格納する格納処理を表すフローチャートである。ここで、実データ(tDfx)は、例えばプログラム中において一時的に使用される(レジスタ等に一時的に格納される)テンポラリ変数であり、制御データ(Dfx)は、格納アドレスが定義され、各種制御ロジックに公開される変数であるとして区別する。   Next, FIG. 3 is a flowchart showing a storage process in which actual data calculated by various control logics is converted using the memory resolution (Vac) calculated in the process of FIG. 2 and stored in the memory. Here, the actual data (tDfx) is a temporary variable that is temporarily used in the program (stored temporarily in a register or the like), for example, and the control data (Dfx) has a storage address defined therein. Distinguish it as a variable exposed to control logic.

図3の格納処理では、まず、S210で、所定の実データ(以下、tDfxとも記載(併記)する)を算出する。
次に、S220に進み、実データ(tDfx)を、前述のS130で予め算出したメモリの分解能(Vac)に合致するデータに変換してその変換したデータをメモリに書き込む。メモリに書き込まれたデータが制御データ(Dfx)であり、各種制御ロジックで利用可能となる。
In the storage process of FIG. 3, first, predetermined actual data (hereinafter also referred to as tDfx (also described)) is calculated in S210.
In step S220, the actual data (tDfx) is converted into data that matches the resolution (Vac) of the memory calculated in advance in step S130, and the converted data is written in the memory. Data written in the memory is control data (Dfx), which can be used in various control logics.

制御データ(Dfx)は、Dfx=tDfx/Vacなる式により算出される。つまり、S220では、実データ(tDfx)が予めソフトウェア上で算出されたメモリの分解能(Vac)に合致するデータ(制御データ:Dfx)としてメモリに格納される。S220の処理の後は当該処理を終了する。   The control data (Dfx) is calculated by the equation Dfx = tDfx / Vac. That is, in S220, the actual data (tDfx) is stored in the memory as data (control data: Dfx) that matches the resolution (Vac) of the memory calculated in advance on the software. After the process of S220, the process ends.

次に、図4は、メモリに格納された制御データ(Dfx)を、各種制御ロジックのプログラムにおいて利用できる実データ(tDfx)に変換する変換処理を表すフローチャートである。   Next, FIG. 4 is a flowchart showing a conversion process for converting the control data (Dfx) stored in the memory into actual data (tDfx) that can be used in various control logic programs.

この変換処理では、まず、S310で、前述のS220でメモリに格納された制御データ(Dfx)をそのメモリから読み出す。
次に、S320に進み、実データ(tDfx)を算出する。具体的に、実データ(tDfx)は、tDfx=Dfx*Vacなる式により算出される。
In this conversion process, first, in S310, the control data (Dfx) stored in the memory in S220 described above is read from the memory.
Next, proceeding to S320, actual data (tDfx) is calculated. Specifically, the actual data (tDfx) is calculated by the equation tDfx = Dfx * Vac.

そして、S330では、実データ(tDfx)を用いた処理(制御ロジック)が実行される。そしてその後、当該処理を終了する。
以上のように、本第1実施形態のECU1では、制御データがとり得る値の範囲(幅)であるデータ範囲と、制御データを格納するメモリの型(サイズ)とから、メモリの分解能(データ精度)をソフトウェア上で算出するようにしている。これにより、データ範囲の大きさにかかわらず、データ範囲に応じて適切なデータ精度がソフトウェア上で設定されるようになる。例えばデータ範囲が小さい場合にはデータ精度が高く設定され、これにより、より細かい桁まで表現されるようになり、逆に、データ範囲が大きい場合にはデータ精度が小さく設定され、これにより、細かい桁までは表現できないとしてもより広い範囲の値を表現できるようになる。
In S330, processing (control logic) using actual data (tDfx) is executed. Thereafter, the process is terminated.
As described above, in the ECU 1 of the first embodiment, the resolution (data) of the memory is determined from the data range that is the range (width) of values that the control data can take and the type (size) of the memory that stores the control data. Accuracy) is calculated on the software. As a result, regardless of the size of the data range, appropriate data accuracy is set on the software according to the data range. For example, when the data range is small, the data accuracy is set high, so that even finer digits are expressed, and conversely, when the data range is large, the data accuracy is set small, thereby making the fine data Even if it cannot be expressed up to digits, a wider range of values can be expressed.

このように、ソフトウェア上においてデータ精度が算出されるため、そのソフトウェア上ではデータ精度を認識して演算を実行することができる。従来、例えばデータ精度が複数種類存在する場合は、データ精度に合わせてソフトウェア上の演算を切り換えるというような構成を設ける場合もあったが、本実施形態のECU1によればデータ精度が認識されるためそのような構成が必要なくなる。このため、ソフトウェアの汎用性が広がる。   In this way, since the data accuracy is calculated on the software, the data accuracy can be recognized on the software and the calculation can be executed. Conventionally, for example, when there are a plurality of types of data accuracy, there is a case in which a configuration in which computation on software is switched in accordance with the data accuracy may be provided, but the ECU 1 of the present embodiment recognizes the data accuracy. Therefore, such a configuration is not necessary. This increases the versatility of the software.

また、ECU1に搭載する組込みソフトウェアの開発において、制御要件や仕様に応じて予測されるデータ範囲に変更が生じることでデータ精度を見直す(設計し直す)必要が生じてしまう、という問題を回避できる。   Further, in the development of the embedded software installed in the ECU 1, it is possible to avoid the problem that the data accuracy needs to be reviewed (redesigned) due to a change in the data range predicted according to the control requirements and specifications. .

尚、本実施形態において、S110の処理がデータ幅取得手段に相当し、S130の処理が分解能算出手段に相当している。
[第2実施形態]
次に、第2実施形態について、第1実施形態と異なる点を中心に説明する。
In this embodiment, the process of S110 corresponds to a data width acquisition unit, and the process of S130 corresponds to a resolution calculation unit.
[Second Embodiment]
Next, the second embodiment will be described focusing on differences from the first embodiment.

本第2実施形態では、第1実施形態と比較して、CPU12が図2〜図4の処理に代えて図5〜図7の処理を実行する点が異なっている。
図5は、データ範囲(Ds)及びそのデータ範囲(Ds)の分割数に応じて、分割後の個々の領域の範囲を算出すると共に、その算出した範囲に応じてメモリの分解能を算出する算出処理を表すフローチャートである。
The second embodiment is different from the first embodiment in that the CPU 12 executes the processes of FIGS. 5 to 7 instead of the processes of FIGS.
FIG. 5 shows a calculation for calculating the range of each divided area according to the data range (Ds) and the number of divisions of the data range (Ds), and calculating the resolution of the memory according to the calculated range. It is a flowchart showing a process.

図5の処理では、まず、S410で、データ範囲(Ds)及びそのデータ範囲(Ds)の分割数(以下、Ndivと記載(併記)する)を取得する。ここで、データ範囲(Ds)及び分割数(Ndiv)は、フラッシュROM16に予め記憶されており、S410では、フラッシュROM16からデータ範囲(Ds)及び分割数(Ndiv)を読み出して取得する。また、分割数(Ndiv)は例えばデータの種類毎に定められる。   In the process of FIG. 5, first, in S410, the data range (Ds) and the number of divisions of the data range (Ds) (hereinafter referred to as Ndiv (also described)) are acquired. Here, the data range (Ds) and the division number (Ndiv) are stored in the flash ROM 16 in advance, and in S410, the data range (Ds) and the division number (Ndiv) are read from the flash ROM 16 and acquired. The division number (Ndiv) is determined for each data type, for example.

次に、S420に進み、データ範囲(Ds)を分割数(Ndiv)で等分割し、分割後の領域のデータ範囲(以下、Dsdとも記載(併記)する)を算出する。データ範囲(Dsd)は、分割後の各領域の幅を表すものであり、Dsd=Ds/Ndivなる式により算出される。   In step S420, the data range (Ds) is equally divided by the number of divisions (Ndiv), and the data range of the divided area (hereinafter also referred to as Dsd (also described)) is calculated. The data range (Dsd) represents the width of each area after the division, and is calculated by the equation Dsd = Ds / Ndiv.

次に、S430に進み、オフセット値(Dofn)を算出する。ここで、オフセット値(Dofn)とは、データの最小値〜最大値の可変範囲を分割数(Ndiv)で分割した後の個々の領域の始値であり、データ範囲(Dsd)の値に0〜n(n=0〜Ndiv−1)の値を乗じて算出される。つまり、オフセット値(Dofn)は、Dofn=Dsd*nなる式により算出される。算出されたオフセット値(Dofn)は所定のメモリに記憶される。   Next, proceeding to S430, an offset value (Dofn) is calculated. Here, the offset value (Dofn) is the starting value of each area after the variable range of the minimum value to the maximum value of the data is divided by the division number (Ndiv), and the value of the data range (Dsd) is 0. It is calculated by multiplying the value of ~ n (n = 0 to Ndiv-1). That is, the offset value (Dofn) is calculated by the equation Dofn = Dsd * n. The calculated offset value (Dofn) is stored in a predetermined memory.

データ範囲(Dsd)及びオフセット値(Dofn)について例を挙げて説明する。
例えば、データ範囲(Ds)が10(最小値0〜最大値10)で分割数(Ndiv)が4の場合(つまり、データ範囲10を4分割する場合)、分割後の個々の領域のデータ範囲(Dsd)は、10(データ範囲:Ds)/4(分割数:Ndiv)=2.5(データ範囲:Dsd)となる。オフセット値(Dofn)は、2.5*0=0、2.5*1=2.5、2.5*2=5、2.5*3=7.5となる。
The data range (Dsd) and the offset value (Dofn) will be described with examples.
For example, when the data range (Ds) is 10 (minimum value 0 to maximum value 10) and the division number (Ndiv) is 4 (that is, when the data range 10 is divided into 4), the data range of each divided area (Dsd) is 10 (data range: Ds) / 4 (number of divisions: Ndiv) = 2.5 (data range: Dsd). The offset values (Dofn) are 2.5 * 0 = 0, 2.5 * 1 = 2.5, 2.5 * 2 = 5, 2.5 * 3 = 7.5.

次に、S440に進み、メモリの分解能(Vac)を算出する。メモリの分解能(Vac)は、Vac=Dsd/Ds_maxなる式により算出される。つまり、ここでは、データ範囲(Ds)を分割数(Ndiv)で分割した後の領域のデータ範囲(Dsd)に応じてメモリの分解能(Vac)を算出する。具体的に、メモリに格納する幅をデータ範囲(Dsd)とした場合の分解能を算出する。これによれば、メモリの分解能(Vac)は、分割前のデータ範囲(Ds)に応じて算出する場合よりも向上するが、これは、メモリに格納するデータ範囲を狭くすることで格納するデータのデータ精度を向上させる趣旨である。尚、詳しくは後述するが、制御データは、分割後のデータ範囲(Dsd)における値と前述のオフセット値とを用いて表現(復元)することができる。   In step S440, the resolution (Vac) of the memory is calculated. The resolution (Vac) of the memory is calculated by the equation Vac = Dsd / Ds_max. That is, here, the resolution (Vac) of the memory is calculated according to the data range (Dsd) of the area after the data range (Ds) is divided by the division number (Ndiv). Specifically, the resolution when the width stored in the memory is the data range (Dsd) is calculated. According to this, the resolution (Vac) of the memory is improved as compared with the case of calculating in accordance with the data range (Ds) before the division, but this is because the data stored by narrowing the data range stored in the memory. The purpose is to improve the data accuracy. As will be described in detail later, the control data can be expressed (restored) using the value in the data range (Dsd) after the division and the above-described offset value.

次に、図6は、各種制御ロジックにより算出される実データを、図5の処理で算出したメモリの分解能(Vac)を用いて変換してメモリに格納する格納処理を表すフローチャートである。   Next, FIG. 6 is a flowchart showing a storage process in which actual data calculated by various control logics is converted using the memory resolution (Vac) calculated in the process of FIG. 5 and stored in the memory.

この格納処理では、まず、S510で、所定の実データ(tDfx)を算出する。
次に、S520に進み、オフセット値(Dofn)を算出する。この処理は、前述のS430の処理と同じであり、Dofn=Dsd*n(n=0〜Ndiv−1)なる式により算出される。
In this storage process, first, predetermined actual data (tDfx) is calculated in S510.
Next, proceeding to S520, an offset value (Dofn) is calculated. This process is the same as the process of S430 described above, and is calculated by an expression of Dofn = Dsd * n (n = 0 to Ndiv-1).

次に、S530に進み、実データ(tDfx)の最小値〜最大値までの可変範囲を分割数(Ndiv)で等分割した分割後の領域のうち、実データ(tDfx)が何番目の領域に含まれるかを算出する。オフセット値(Dofn)のnの値を算出する(Dofnの具体的な値を算出する)趣旨である。S530で「nの算出」と記載しているのはそのためである。例えば、実データ(tDfx)の値が、S520で算出したオフセット値と比較して、Dof2≦tDfx<Dof3であれば、n=2となる。尚、詳細については図8で後述する。   In step S530, the real data (tDfx) is divided into the number of divisions (Ndiv) in the variable range from the minimum value to the maximum value of the actual data (tDfx). Calculate whether it is included. The purpose is to calculate the value of n of the offset value (Dofn) (to calculate a specific value of Dofn). This is why “calculation of n” is described in S530. For example, when the value of the actual data (tDfx) is compared with the offset value calculated in S520, if Dof2 ≦ tDfx <Dof3, n = 2. Details will be described later with reference to FIG.

次に、S540に進み、実データ(tDfx)を、前述のS440で予め算出したメモリの分解能(Vac)に合致するデータに変換してその変換したデータをメモリに書き込む。尚、前述のように、メモリに書き込まれたデータが、各種制御ロジックで利用可能な制御データ(Dfx)である。ここで、制御データ(Dfx)は、Dfx=(tDfx−Dofn)/Vacなる式により算出される。つまり、実データ(tDfx)からオフセット値(Dofn)を減算した値を、分割後の領域のデータ範囲(Dsd)に応じて算出したメモリの分解能(言い換えればデータ精度)を用いて算出する。これによれば、変換後のデータのデータ精度が向上する一方、その変換後のデータとオフセット値(Dofn)とを用いて、元のデータを正しく算出(復元)できる。   In step S540, the actual data (tDfx) is converted into data that matches the resolution (Vac) of the memory calculated in advance in step S440, and the converted data is written in the memory. As described above, the data written in the memory is control data (Dfx) that can be used by various control logics. Here, the control data (Dfx) is calculated by an expression of Dfx = (tDfx−Dofn) / Vac. That is, a value obtained by subtracting the offset value (Dofn) from the actual data (tDfx) is calculated using the resolution of the memory (in other words, the data accuracy) calculated according to the data range (Dsd) of the divided area. According to this, while the data accuracy of the converted data is improved, the original data can be correctly calculated (restored) using the converted data and the offset value (Dofn).

次に、図7は、メモリに格納された制御データ(Dfx)を、各種制御ロジックのプログラムにおいて利用できる実データ(tDfx)に変換する変換処理を表すフローチャートである。   Next, FIG. 7 is a flowchart showing a conversion process for converting the control data (Dfx) stored in the memory into actual data (tDfx) that can be used in programs of various control logics.

この変換処理では、まず、S610で、前述のS540でメモリに格納された制御データ(Dfx)をそのメモリから読み出す。
次に、S620に進み、実データ(tDfx)を算出する。具体的に、実データ(tDfx)は、tDfx=Dfx*Vac+Dofnなる式により算出される。
In this conversion process, first, in S610, the control data (Dfx) stored in the memory in S540 is read from the memory.
Next, proceeding to S620, actual data (tDfx) is calculated. Specifically, the actual data (tDfx) is calculated by the equation tDfx = Dfx * Vac + Dofn.

そして、S630では、実データ(tDfx)を用いた処理(制御ロジック)が実行される。そしてその後、当該処理を終了する。
次に、図8を用いて本第2実施形態の作用について説明する。
In S630, processing (control logic) using actual data (tDfx) is executed. Thereafter, the process is terminated.
Next, the operation of the second embodiment will be described with reference to FIG.

図8のグラフにおいて、縦軸はデータ値を示し、横軸は分割数を示す。
図8において、データ値Vmin〜Vmaxの幅がデータ範囲(Ds)である。
本第2実施形態では、データ範囲(Ds)を分割数(Ndiv)で等分割する。データ範囲(Ds)を分割数(Ndiv)で等分割した後の個々の領域の範囲(幅)がデータ範囲(Dsd)である。そして、分割後の領域のうち、0番目の領域はVmin(或いはオフセット値Dof0)〜Dof1に相当し、1番目の領域はDof1(1番目の領域のオフセット値)〜Dof2に相当し、2番目の領域はDof2(2番目の領域のオフセット値)〜Dof3に相当する。以下、n番目まで同様である。オフセット値Dof0,Dof1,Dof2,Dof3・・・Dofnの値は、前述のように、Dofn=Dsd*n(n=0〜Ndiv−1)なる式により算出され、それぞれ所定のメモリに記憶される。
In the graph of FIG. 8, the vertical axis indicates the data value, and the horizontal axis indicates the number of divisions.
In FIG. 8, the width of the data values Vmin to Vmax is the data range (Ds).
In the second embodiment, the data range (Ds) is equally divided by the division number (Ndiv). The range (width) of each area after equally dividing the data range (Ds) by the number of divisions (Ndiv) is the data range (Dsd). Of the divided areas, the 0th area corresponds to Vmin (or offset value Dof0) to Dof1, and the first area corresponds to Dof1 (offset value of the first area) to Dof2. This area corresponds to Dof2 (offset value of the second area) to Dof3. Hereinafter, the same applies to the nth. The values of the offset values Dof0, Dof1, Dof2, Dof3,... Dofn are calculated by the formula Dofn = Dsd * n (n = 0 to Ndiv-1) as described above and stored in a predetermined memory. .

今、仮に、実データ(tDfx)が算出されたとする(S510)。そして、その実データ(tDfx)の値は、2番目の領域(Dof2〜Dof3)に含まれるとする。
この場合、Dof2≦tDfx<Dof3であると算出され、n=2(実データ:tDfxは2番目の領域に含まれる)と算出される(S530)。
Assume that actual data (tDfx) is calculated (S510). Then, it is assumed that the value of the actual data (tDfx) is included in the second area (Dof2 to Dof3).
In this case, it is calculated that Dof2 ≦ tDfx <Dof3, and n = 2 (actual data: tDfx is included in the second region) (S530).

この時、実データ(tDfx)を格納するメモリの分解能(Vac)は、前述のように、Vac=Dsd/Ds_maxなる式により算出される(S440)。データ範囲(Dsd)は、Dof2〜Dof3の範囲の幅である。つまり、メモリに格納されるデータはデータ範囲(Ds)ではなくデータ範囲(Dsd:Dof2〜Dof3)のみ表せれば良いため、より細かい桁を表現できる。このため、データ精度が向上する。   At this time, the resolution (Vac) of the memory for storing the actual data (tDfx) is calculated by the equation Vac = Dsd / Ds_max as described above (S440). The data range (Dsd) is the width of the range of Dof2 to Dof3. That is, since the data stored in the memory only needs to represent the data range (Dsd: Dof2 to Dof3), not the data range (Ds), a finer digit can be expressed. For this reason, data accuracy is improved.

一方、実データ(tDfx)の値が含まれる領域のオフセット値(Dof2)が別途算出されるため、これによりそのオフセット値(Dof2)とメモリに格納された高分解能の値とで実データ(tDfx)は正しく表される。   On the other hand, since the offset value (Dof2) of the area including the value of the actual data (tDfx) is separately calculated, the actual value (tDfx) is calculated from the offset value (Dof2) and the high resolution value stored in the memory. ) Is represented correctly.

ここで、車両における後処理制御を例にとり、本第2実施形態の適用例(応用例)について説明する。後処理制御とは、具体的に説明すると、例えばディーゼルエンジンの排出ガスに含まれる粒子状物質(PM)をディーゼルパティキュレートフィルタ(DPF)で捕捉し、その捕捉したPMが既定量に達した時にDPFの温度を上げ、DPFに担持した触媒の反応によりPMを燃焼させ、PMが付着したDPFを再生する、というような制御である。   Here, an application example (application example) of the second embodiment will be described taking post-processing control in a vehicle as an example. More specifically, the post-processing control is, for example, when particulate matter (PM) contained in the exhaust gas of a diesel engine is captured by a diesel particulate filter (DPF), and when the captured PM reaches a predetermined amount. The control is such that the temperature of the DPF is raised, PM is burned by the reaction of the catalyst supported on the DPF, and the DPF to which the PM is attached is regenerated.

このような後処理制御においては、ディーゼルエンジンの1サイクルにおいて発生するPM量が算出され、その算出値が積算される。積算値が、DPFに堆積するPM量となる。積算値は、バックアップRAM20、或いはEEPROM30に格納される(更新記憶される)。ところで、1サイクル当たりのPMの発生量は極僅かであるが、積算されていくとその値は大きくなる。このため、PM量の値を高分解能、かつ広範囲にわたって記憶できる構成が必要となる。この点、従来は、バックアップRAM20、或いはEEPROM30の容量を大きくすることで対応する場合があった。   In such post-processing control, the PM amount generated in one cycle of the diesel engine is calculated, and the calculated values are integrated. The integrated value is the amount of PM deposited on the DPF. The integrated value is stored (updated and stored) in the backup RAM 20 or the EEPROM 30. By the way, the amount of PM generated per cycle is very small, but the value increases as it is integrated. For this reason, the structure which can memorize | store the value of PM amount in high resolution and wide range is needed. Conventionally, there is a case where the capacity of the backup RAM 20 or the EEPROM 30 is increased.

これに対し、本第2実施形態の構成によれば、データ範囲を分割し、メモリ(バックアップRAM20、或いはEEPROM30)に格納する値の幅を、その分割後の各領域の幅に狭めることで、分解能を向上させることができると共に、各領域の始値(オフセット値)を別途保持することで、広範囲にわたる数値を記憶することができる。これにより、メモリ容量を増加させなくても、所望の値を、高分解能、かつ広範囲にわたって記憶できるようになっている。   On the other hand, according to the configuration of the second embodiment, by dividing the data range and narrowing the width of the value stored in the memory (backup RAM 20 or EEPROM 30) to the width of each divided area, The resolution can be improved and a wide range of numerical values can be stored by separately holding the starting value (offset value) of each region. As a result, a desired value can be stored in a wide range over a wide range without increasing the memory capacity.

尚、本実施形態において、S420の処理が個別データ幅算出手段に相当し、S430の処理がオフセット値算出手段に相当している。
[第3実施形態]
次に、第3実施形態について、第2実施形態と比較してその第2実施形態と異なる点を中心に説明する。
In the present embodiment, the process of S420 corresponds to the individual data width calculation unit, and the process of S430 corresponds to the offset value calculation unit.
[Third Embodiment]
Next, the third embodiment will be described with a focus on differences from the second embodiment compared to the second embodiment.

第3実施形態では、第2実施形態と比較して、制御ロジックにて浮動小数演算が実行される点が異なっており、これにより浮動小数型データが算出されるようになっている。
そして、CPU12は、浮動小数型データを固定小数型データに変換する処理を実行するようになっている。
The third embodiment is different from the second embodiment in that floating point arithmetic is executed by the control logic, whereby floating point type data is calculated.
Then, the CPU 12 executes a process of converting the floating point type data into fixed decimal type data.

具体的に、第3実施形態では、第2実施形態と比較して、CPU12は、図6の格納処理に代えて図9の処理を実行するようになっている。図9の処理は、制御データを更新、或いは参照するタイミングで実行される。   Specifically, in the third embodiment, as compared with the second embodiment, the CPU 12 executes the process of FIG. 9 instead of the storage process of FIG. The process of FIG. 9 is executed at a timing at which control data is updated or referenced.

図9の処理では、まず、S710で、浮動小数型の所定の実データ(tDfl)を算出する。
次に、S720に進み、オフセット値(Dofn)を算出する。このS720の処理は、図6のS520の処理と同じである。
In the process of FIG. 9, first, in S710, predetermined floating-point actual data (tDfl) is calculated.
Next, proceeding to S720, an offset value (Dofn) is calculated. The process of S720 is the same as the process of S520 of FIG.

次に、S730に進み、データ範囲(Ds)を分割数(Ndiv)で等分割した分割後の領域のうち、実データ(tDfl)が何番目の領域に含まれるかを算出する。オフセット値(Dofn)のnの値を算出する(Dofnの具体的な値を算出する)趣旨である。S730で「nの算出」と記載しているのはそのためである。例えば、実データ(tDfl)の値が、S720で算出したオフセット値と比較して、Dof2≦tDfl<Dof3であれば、n=2となる。   Next, the process proceeds to S730, and it is calculated in which area the actual data (tDfl) is included in the divided area obtained by equally dividing the data range (Ds) by the division number (Ndiv). The purpose is to calculate the value of n of the offset value (Dofn) (to calculate a specific value of Dofn). This is why “calculation of n” is described in S730. For example, when the value of the actual data (tDfl) is compared with the offset value calculated in S720, if Dof2 ≦ tDfl <Dof3, n = 2.

次に、S740に進み、実データ(tDfl)を、前述のS440で予め算出したメモリの分解能(Vac)に合致するデータに変換してその変換したデータをメモリに書き込む。尚、前述のように、メモリに書き込まれたデータが、各種制御ロジックで利用可能な制御データ(Dfx)である。制御データ(Dfx)は、Dfx=(tDfl−Dofn)/Vacなる式により算出される。S740の後は、当該処理を終了する。   In step S740, the actual data (tDfl) is converted into data that matches the memory resolution (Vac) calculated in advance in step S440, and the converted data is written in the memory. As described above, the data written in the memory is control data (Dfx) that can be used by various control logics. The control data (Dfx) is calculated by the equation Dfx = (tDfl−Dofn) / Vac. After S740, the process ends.

このように、本第3実施形態においては、制御ロジックによる演算は浮動小数型で実行することにより精度を確保し、算出された浮動小数型のデータは固定小数型に変換してメモリに格納することにより、メモリの容量を節約するようにしている。例えば、単精度浮動小数型のデータを格納するには4バイトが必要であるが、固定小数型のデータに変換すれば2バイトで済む。このため、メモリ容量を節約することができる。
〈変形例1〉
ところで、上記第3実施形態では、以下に示す変形例1のように構成しても良い。
As described above, in the third embodiment, the calculation by the control logic is executed in the floating-point type to ensure the accuracy, and the calculated floating-point type data is converted into the fixed-point type and stored in the memory. Thus, the memory capacity is saved. For example, 4 bytes are required to store single-precision floating-point data, but if converted to fixed-decimal data, only 2 bytes are required. For this reason, memory capacity can be saved.
<Modification 1>
By the way, in the said 3rd Embodiment, you may comprise like the modification 1 shown below.

図10は、変形例1の内容を説明する図面である。具体的に、図10は、図9のS740の処理で算出された制御データ(Dfx)、及びS730の処理で算出されたnの値(オフセット値:Dofnにおけるnの値)を、EEPROM30(図1参照)に記憶する方法を示す図面である。   FIG. 10 is a diagram for explaining the contents of the first modification. Specifically, FIG. 10 shows the control data (Dfx) calculated in the process of S740 in FIG. 9 and the value of n calculated in the process of S730 (offset value: the value of n in Dofn) in the EEPROM 30 (FIG. It is drawing which shows the method to memorize | store in 1).

まず、図10(a)について説明する。前述のS710で算出された実データ(tDfl1,tDfl2)は、固定小数型データである制御データ(Dfx1,Dfx2)に変換される(S740)。また、制御データ(Dfx1,Dfx2)の最小値〜最大値の可変範囲を分割した後の個々の領域のうち、何れの領域にその制御データ(Dfx1,Dfx2)が含まれるかを表すnの値(n1,n2)がそれぞれ算出される(S730)。   First, FIG. 10A will be described. The actual data (tDfl1, tDfl2) calculated in S710 described above is converted into control data (Dfx1, Dfx2) that is fixed decimal type data (S740). In addition, the value of n representing which area contains the control data (Dfx1, Dfx2) among the individual areas after dividing the variable range of the minimum value to the maximum value of the control data (Dfx1, Dfx2). (N1, n2) are respectively calculated (S730).

そして、図10(b)に示すが、算出されたnの値(n1,n2)がそれぞれビット値に変換され、EEPROM30に記憶される。nの値(n1,n2)を記憶する点について、これは、オフセット値(Dofn)を記憶することに代えてnの値(n1,n2)を記憶する趣旨である。より具体的に、オフセット値(Dofn)をn=0〜Ndiv−1のそれぞれについて記憶するとメモリの容量が多く必要となるため、nの値のみを記憶しておき、そのnの値からオフセット値(Dofn)の具体的な値を算出できるようにするものである。   Then, as shown in FIG. 10B, the calculated values of n (n1, n2) are converted into bit values and stored in the EEPROM 30. Regarding the point of storing the value (n1, n2) of n, this means that the value (n1, n2) of n is stored instead of storing the offset value (Dofn). More specifically, if the offset value (Dofn) is stored for each of n = 0 to Ndiv-1, a large memory capacity is required. Therefore, only the value of n is stored, and the offset value is calculated from the value of n. A specific value of (Dofn) can be calculated.

例えば、所定の16ビットのメモリ領域において、最初の1,2ビット目をn1の記憶用に割り当て、次の3,4ビット目をn2の記憶用に割り当てていく。以下同様である。最後の15,16ビット目はn8の記憶用に割り当てられる。図10(b)の例のようにnの値を記憶するメモリ領域として2ビットが割り当てられれば、nの値として0〜3までを表現できる。   For example, in a predetermined 16-bit memory area, the first 1 and 2 bits are allocated for storing n1, and the next 3 and 4 bits are allocated for storing n2. The same applies hereinafter. The last 15th and 16th bits are allocated for storing n8. If 2 bits are allocated as a memory area for storing the value of n as in the example of FIG. 10B, 0 to 3 can be expressed as the value of n.

このような変形例1によれば、オフセット値(Dofn)をn=0〜Ndiv−1のそれぞれについて記憶する場合と比較して、メモリ容量を削減することができる。
例えば、図10(c)に示すように、データ範囲(Ds)は10(最小値0〜最大値10)、分割数(Ndiv)は4(つまり、4分割)、メモリの型は2バイト、制御データ(tDfl)の値は3.5の場合を例にとり説明する。
According to the first modification, the memory capacity can be reduced as compared with the case where the offset value (Dofn) is stored for each of n = 0 to Ndiv-1.
For example, as shown in FIG. 10C, the data range (Ds) is 10 (minimum value 0 to maximum value 10), the division number (Ndiv) is 4 (that is, 4 divisions), the memory type is 2 bytes, The case where the value of the control data (tDfl) is 3.5 will be described as an example.

分割後のデータ範囲(Dsd)は、10(データ範囲:Ds)/4(分割数:Ndiv)=2.5となる。分解能(Vac)は、2.5(データ範囲:Dsd)/65535(2バイト)となる。   The divided data range (Dsd) is 10 (data range: Ds) / 4 (number of divisions: Ndiv) = 2.5. The resolution (Vac) is 2.5 (data range: Dsd) / 65535 (2 bytes).

また、最小値0〜最大値10の領域を4分割した後の領域は、それぞれ、0〜2.5(領域0:n=0)、2.5〜5.0(領域1:n=1)、5.0〜7.5(領域2:n=2)、7.5〜10(領域3:n=3)となる。制御データ(tDfl)の値である3.5は、領域1に含まれる(つまり、n=1である)。   In addition, the areas after dividing the area of the minimum value 0 to the maximum value 10 into four are 0 to 2.5 (area 0: n = 0) and 2.5 to 5.0 (area 1: n = 1), respectively. ), 5.0 to 7.5 (region 2: n = 2), and 7.5 to 10 (region 3: n = 3). The value 3.5 of the control data (tDfl) is included in the region 1 (that is, n = 1).

この場合、本変形例1では、nの値である1がビット値に変換されて記憶される。これによれば、オフセット値(2.5)を記憶しておかなくても、2.5(データ範囲:Dsd)*1によりそのオフセット値(2.5)を算出できるため、オフセット値を記憶する場合と比較してメモリの容量を節約することができる。   In this case, in the first modification, 1 which is the value of n is converted into a bit value and stored. According to this, since the offset value (2.5) can be calculated by 2.5 (data range: Dsd) * 1 without storing the offset value (2.5), the offset value is stored. Compared to the case, the memory capacity can be saved.

また一方、制御データ(Dfx)用のメモリには、3.5(実データ:tDfl)−2.5(オフセット値:Dof1)=1が記憶されるのであるが、分解能(Vac)を用いて変換すると、1/(2.5/65535)=26214となる。16進数表示なら0x6666である。つまり、Dfxは0x6666で表され、このデータがメモリに記憶される。尚、0x6666の「0x」は、16進数表示であることを示す符号である。そして、制御ロジックのプログラムにおいて用いる実データ(tDfl)の算出に際しては、〜0x6666の表す1(10進数)とオフセット値2.5(10進数)とから実データ(tDfl)=3.5(10進数)と算出される。
[第4実施形態]
次に、第4実施形態について、第3実施形態と比較してその第3実施形態と異なる点を中心に説明する。
On the other hand, 3.5 (actual data: tDfl) −2.5 (offset value: Dof1) = 1 is stored in the memory for control data (Dfx), but the resolution (Vac) is used. When converted, 1 / (2.5 / 65535) = 26214. In the case of hexadecimal display, it is 0x6666. That is, Dfx is represented by 0x6666, and this data is stored in the memory. Note that “0x” of 0x6666 is a code indicating that the display is hexadecimal. In calculating the actual data (tDfl) used in the control logic program, the actual data (tDfl) = 3.5 (10) from 1 (decimal number) represented by ˜0x6666 and the offset value 2.5 (decimal number). Decimal).
[Fourth Embodiment]
Next, the fourth embodiment will be described focusing on differences from the third embodiment compared to the third embodiment.

第4実施形態は、第3実施形態と比較して、データに求められる精度(要求精度)が予め定められている点、データ範囲(Ds)の分割数(Ndiv)が予め定められておらず、要求精度を満たすように、データ範囲(Ds)に応じて分割数(Ndiv)及びオフセット値(Dofn)を算出する点が異なっている。   Compared to the third embodiment, the fourth embodiment has a predetermined accuracy (required accuracy) required for data, and the number of divisions (Ndiv) of the data range (Ds) is not predetermined. The difference is that the division number (Ndiv) and the offset value (Dofn) are calculated according to the data range (Ds) so as to satisfy the required accuracy.

具体的に、第4実施形態では、第3実施形態と比較して、CPU12は、図9の処理に代えて図11の処理を実行するようになっている。図11の処理は、制御データを更新、或いは参照するタイミングで実行される。   Specifically, in the fourth embodiment, as compared with the third embodiment, the CPU 12 executes the process of FIG. 11 instead of the process of FIG. The process of FIG. 11 is executed at a timing when the control data is updated or referenced.

図11の処理では、まず、S810において、浮動小数型の実データ(tDfl)が算出される。
次に、S820に進み、予め定められるメモリの型(Dsp)、及び分解能(Vac)を取得する。このメモリの型(Dsp)及びメモリの分解能(Vac)を表す情報は、予め所定のメモリに記憶されており、S820では、その情報を読み出すようになっている。
In the process of FIG. 11, first, floating-point actual data (tDfl) is calculated in S810.
In step S820, a predetermined memory type (Dsp) and resolution (Vac) are acquired. Information indicating the memory type (Dsp) and the resolution (Vac) of the memory is stored in advance in a predetermined memory, and the information is read out in S820.

次に、S830に進み、実データ(tDfl)のデータ範囲(Ds)を算出する。データ範囲(Ds)は、実データ(tDfl)の最大値−最小値なる式により算出される。このデータ範囲(Ds)は、各種制御要件に基づき、ソフトウェア上で算出されるものである。つまり、制御要件に応じて変化する。   In step S830, the data range (Ds) of the actual data (tDfl) is calculated. The data range (Ds) is calculated by the formula of maximum value-minimum value of actual data (tDfl). This data range (Ds) is calculated on software based on various control requirements. That is, it changes according to control requirements.

次に、S840に進み、データ範囲(Ds)の分割数(Ndiv)を算出する。具体的に、分割後の個々のデータの範囲(幅)をメモリに格納する場合の分解能が、S820で取得した分解能(Vac)を満たすように分割数(Ndiv)を算出する。分割数(Ndiv)は、分割数(Ndiv)=tData/Ds_maxなる式により算出される。ここで、tData=Ds/Vacである。尚、分割数(Ndiv)の算出において、小数点以下は切り上げとなる。   In step S840, the number of divisions (Ndiv) of the data range (Ds) is calculated. Specifically, the division number (Ndiv) is calculated so that the resolution when the range (width) of each divided data is stored in the memory satisfies the resolution (Vac) acquired in S820. The number of divisions (Ndiv) is calculated by the equation: Number of divisions (Ndiv) = tData / Ds_max. Here, tData = Ds / Vac. In calculating the number of divisions (Ndiv), the numbers after the decimal point are rounded up.

次に、S850に進み、オフセット値(Dofn)を算出する。具体的に、オフセット値(Dofn)は、オフセット値(Dofn)=データ範囲(Dsd)*n(n=0〜Ndiv−1)なる式により算出される。Dsd=tData/Ndivである。   Next, proceeding to S850, an offset value (Dofn) is calculated. Specifically, the offset value (Dofn) is calculated by an expression of offset value (Dofn) = data range (Dsd) * n (n = 0 to Ndiv−1). Dsd = tData / Ndiv.

次に、S860に進み、制御データ(Dfx)を算出する。具体的に、制御データ(Dfx)は、Dfx=(tDfl−Dofj)/Vacなる式により算出される。Dofjのjの値は、Dofj≦tDfl<Dofj+1の式に基づき算出される。つまり、Dofj≦tDfl<Dofj+1を満たすようにjの値が算出される。   Next, proceeding to S860, control data (Dfx) is calculated. Specifically, the control data (Dfx) is calculated by the equation Dfx = (tDfl−Dofj) / Vac. The value of j of Dofj is calculated based on the formula of Dofj ≦ tDfl <Dofj + 1. That is, the value of j is calculated so as to satisfy Dofj ≦ tDfl <Dofj + 1.

尚、本第4実施形態において、S840の処理が分割数算出手段に相当している。
〈変形例2〉
ところで、上記第2〜第4実施形態では、以下に示す変形例2のように構成しても良い。図12は、変形例2の内容を説明する図面である。具体的に、図12に示す変形例2では、メモリの分解能(Vac)、及びオフセット値(Dofn)をソフトウェア上で動的に算出するか否かを管理するようにしている。言い換えると、メモリの分解能(Vac)、及びオフセット値(Dofn)をソフトウェア上で動的に算出する構成を有効にするか無効にするかを管理するようにしている。
In the fourth embodiment, the process of S840 corresponds to the division number calculating means.
<Modification 2>
By the way, in the said 2nd-4th embodiment, you may comprise like the modification 2 shown below. FIG. 12 is a diagram illustrating the contents of Modification 2. Specifically, in the second modification shown in FIG. 12, it is managed whether the resolution (Vac) of the memory and the offset value (Dofn) are dynamically calculated on software. In other words, it manages whether to enable or disable the configuration for dynamically calculating the resolution (Vac) and offset value (Dofn) of the memory on the software.

例えば、図12の例では、2ビットのデータ(つまり、0〜3の数値)で管理している。また、その2ビットの管理情報は、データの種別毎に保持される。具体的に、図12の例では、2バイトのデータ中に、2ビットの管理情報が8種類記憶されるようになっている。つまり、8種類のデータのそれぞれについて、2ビットの管理情報が割り当てられている。   For example, in the example of FIG. 12, management is performed using 2-bit data (that is, a numerical value of 0 to 3). The 2-bit management information is held for each data type. Specifically, in the example of FIG. 12, eight types of 2-bit management information are stored in 2-byte data. That is, 2-bit management information is assigned to each of the eight types of data.

図12の例では、2ビットのデータが表す0〜3の数値のうち、0が適用を表す。具体的に、「適用」の場合は、メモリの分解能(Vac)、及びオフセット値(Dofn)がソフトウェア上で動的に算出されるようになる。例えば、第2実施形態、或いは第3実施形態が実現されることに相当し、より具体的には、第2実施形態のS430及びS440の処理が実行されるようにすることに相当する。   In the example of FIG. 12, 0 represents application among the numerical values of 0 to 3 represented by 2-bit data. Specifically, in the case of “apply”, the resolution (Vac) and offset value (Dofn) of the memory are dynamically calculated on the software. For example, this corresponds to the realization of the second embodiment or the third embodiment, and more specifically, this corresponds to the processing of S430 and S440 of the second embodiment being executed.

一方、図12の例では、1〜3が非適用を表す。
このうち、1は、分解能(Vac)が160/256に固定され、オフセット値(Dofn)が0に固定される例を表す。2は、分解能(Vac)が200/256に固定され、オフセット値(Dofn)が10に固定される例を表す。3は、分解能(Vac)が−1に固定され、オフセット値(Dofn)が1に固定される例を表す。これは、例えば分解能(Vac)が予め定められる第4実施形態が実現されるようにすることに相当する。
On the other hand, in the example of FIG.
Among these, 1 represents an example in which the resolution (Vac) is fixed to 160/256 and the offset value (Dofn) is fixed to 0. 2 represents an example in which the resolution (Vac) is fixed to 200/256 and the offset value (Dofn) is fixed to 10. 3 represents an example in which the resolution (Vac) is fixed to −1 and the offset value (Dofn) is fixed to 1. This corresponds to, for example, realizing the fourth embodiment in which the resolution (Vac) is predetermined.

このような変形例2によれば、メモリの分解能(Vac)、或いはオフセット値(Dofn)がソフトウェア上で動的に算出される構成を有効にする、或いは無効にする、ということを簡単にできるため、自由度が広がる。例えば分解能(Vac)を固定したいと言う開発者(設計者)の要望にも容易に応えることができる。
〈変形例3〉
次に、上記第1〜第4実施形態において、制御データ(Dfx)の型として固定小数型を適用するか浮動小数型を適用するかは、以下のようにして決定しても良い。
According to the second modification, it is possible to easily enable or disable the configuration in which the resolution (Vac) or offset value (Dofn) of the memory is dynamically calculated on the software. Therefore, the degree of freedom is expanded. For example, it is possible to easily respond to a request from a developer (designer) who wants to fix the resolution (Vac).
<Modification 3>
Next, in the first to fourth embodiments, whether to apply the fixed decimal type or the floating decimal type as the type of the control data (Dfx) may be determined as follows.

具体的に、CPU12は、図13の処理を実行して、固定小数型を採用するか浮動小数型を採用するかを決定するようにしている。
図13の処理では、まず、S910において、メモリの型(Dsp)、及びメモリの分解能(Vac)を取得する。メモリの分解能(Vac)は、前述のS130或いはS440で算出されるものである。
Specifically, the CPU 12 executes the processing of FIG. 13 to determine whether to adopt the fixed decimal type or the floating decimal type.
In the process of FIG. 13, first, in S910, the memory type (Dsp) and the memory resolution (Vac) are acquired. The resolution (Vac) of the memory is calculated in S130 or S440 described above.

そして、次に、S920に進み、S910で取得したメモリの分解能(Vac)が、予め要求される分解能(Vacmin)以下か否か(言い換えると、分解能が高いか否か、或いは分解能が優れているか否か)を判断する。   Then, the process proceeds to S920, and whether or not the resolution (Vac) of the memory acquired in S910 is equal to or lower than the resolution (Vacmin) required in advance (in other words, whether the resolution is high or the resolution is excellent). Or not).

S920でVac≦Vacminであると判定すると(S920:YES)、S910で取得した分解能(Vac)が要求される分解能(Vacmin)より高いと判断してS930に移行し、固定小数型を適用する。固定小数型を適用することで、必要なメモリ容量を節約する趣旨である。そしてその後、当該処理を終了する。   If it is determined in S920 that Vac ≦ Vacmin (S920: YES), it is determined that the resolution (Vac) acquired in S910 is higher than the required resolution (Vacmin), the process proceeds to S930, and the fixed decimal type is applied. The purpose is to save the necessary memory capacity by applying the fixed decimal type. Thereafter, the process is terminated.

一方、S920でVac≦Vacminが成立しない、つまり、Vac>Vacminであると判定すると(S920:NO)、S910で取得した分解能(Vac)が要求される分解能(Vacmin)より劣ると判断してS940に移行し、浮動小数型を適用する。制御データ(Dfx)の分解能(データ精度)が要求値より悪化しないようにする趣旨である。そしてその後、当該処理を終了する。   On the other hand, if it is determined in S920 that Vac ≦ Vacmin does not hold, that is, Vac> Vacmin (S920: NO), it is determined that the resolution (Vac) acquired in S910 is inferior to the required resolution (Vacmin). Move to and apply floating point type. This is to prevent the resolution (data accuracy) of the control data (Dfx) from deteriorating from the required value. Thereafter, the process is terminated.

このような本変形例3では、メモリ容量を節約することと、分解能(データ精度)が要求値より悪化しないようにすることとを両立することができる。
以上、本発明の一実施形態について説明したが、本発明は上記実施形態に限定されるものではなく、本発明の技術範囲内において種々の形態をとることができる。
In this third modification, it is possible to achieve both saving of the memory capacity and preventing the resolution (data accuracy) from deteriorating from the required value.
As mentioned above, although one Embodiment of this invention was described, this invention is not limited to the said embodiment, A various form can be taken within the technical scope of this invention.

例えば、上記第1実施形態において、図2の分解能算出処理は定期的に実行されても良い。尚、定期的に実行される場合には、S130の処理で算出されたVacが保持される必要がある。つまり、算出されたVacが所定のメモリ領域に記憶される必要がある。   For example, in the first embodiment, the resolution calculation process in FIG. 2 may be periodically executed. Note that, when periodically executed, the Vac calculated in the process of S130 needs to be held. That is, the calculated Vac needs to be stored in a predetermined memory area.

また図2の分解能算出処理において、データ範囲が変化した場合にのみVacが更新(算出)されるようにしても良い。例えば、CPU12は、図2の処理において、S110にてDs(データ範囲)を取得した後、そのDs(データ範囲)が前回の取得値から変化したか否かを判定し、変化したと判定すると、S130の処理を実行してVacを更新(算出)するようにしても良い。   In the resolution calculation process of FIG. 2, Vac may be updated (calculated) only when the data range changes. For example, in the process of FIG. 2, after acquiring Ds (data range) in S110, the CPU 12 determines whether or not the Ds (data range) has changed from the previous acquired value, and determines that it has changed. , Sac may be executed to update (calculate) Vac.

また、図2の分解能算出処理において、制御データの値がとり得る最小値(Vmin)及び最大値(Vmax)をフラッシュROM16に予め記憶させておき、S110の処理では、CPU12は、その最小値(Vmin)及び最大値(Vmax)をフラッシュROM16から読み出して、データ範囲(Ds)=最大値(Vmax)−最小値(Vmin)の演算を実行することによりデータ範囲(Ds)を算出するようにしても良い。図5の算出処理についても同様である。   In the resolution calculation process of FIG. 2, the minimum value (Vmin) and the maximum value (Vmax) that can be taken by the control data value are stored in the flash ROM 16 in advance, and in the process of S110, the CPU 12 determines the minimum value ( Vmin) and the maximum value (Vmax) are read from the flash ROM 16, and the data range (Ds) is calculated by executing the calculation of data range (Ds) = maximum value (Vmax) −minimum value (Vmin). Also good. The same applies to the calculation processing of FIG.

また、上記変形例2において、データをより大きな分類にグループ分けしたグループ毎に管理情報が割り当てられても良い。また、分割数(Ndiv)が動的に算出される構成について、有効/無効が管理されるようにしても良い。また、場合によっては、メモリの型を動的に算出する構成を付加しても良く、この場合も、メモリの型を動的に算出する構成について、有効/無効が管理されるようにしても良い。   Moreover, in the said modification 2, management information may be allocated for every group which grouped data into the bigger classification | category. Further, validity / invalidity may be managed for a configuration in which the division number (Ndiv) is dynamically calculated. In some cases, a configuration for dynamically calculating the memory type may be added. In this case, the configuration for dynamically calculating the memory type may be managed as valid / invalid. good.

本実施形態のECU1の構成図である。It is a block diagram of ECU1 of this embodiment. CPU12が実行する分解能算出処理を表すフローチャートである。It is a flowchart showing the resolution calculation process which CPU12 performs. CPU12が実行する格納処理を表すフローチャートである。It is a flowchart showing the storage process which CPU12 performs. CPU12が実行する変換処理を表すフローチャートである。It is a flowchart showing the conversion process which CPU12 performs. 第2実施形態のCPU12が実行する分解能算出処理を表すフローチャートである(その1)。It is a flowchart showing the resolution calculation process which CPU12 of 2nd Embodiment performs (the 1). 第2実施形態のCPU12が実行する格納処理を表すフローチャートである(その2)。It is a flowchart showing the storage process which CPU12 of 2nd Embodiment performs (the 2). 第2実施形態のCPU12が実行する変換処理を表すフローチャートである(その3)。It is a flowchart showing the conversion process which CPU12 of 2nd Embodiment performs (the 3). 第2実施形態の作用を表す図面である。It is drawing showing the effect | action of 2nd Embodiment. 第3実施形態のCPU12が実行する処理を表すフローチャートである。It is a flowchart showing the process which CPU12 of 3rd Embodiment performs. 変形例1の内容を表す図面である。10 is a diagram showing the contents of Modification 1. 第4実施形態のCPU12が実行する処理を表すフローチャートである。It is a flowchart showing the process which CPU12 of 4th Embodiment performs. 変形例2の内容を表す図面である。10 is a diagram showing the contents of Modification 2. 変形例3のCPU12が実行する処理を表すフローチャートである。10 is a flowchart illustrating processing executed by a CPU 12 of Modification 3.

符号の説明Explanation of symbols

1…ECU、10…マイコン、12…CPU、14…FPU、16…フラッシュROM、18…RAM、20…バックアップRAM、30…EEPROM。 DESCRIPTION OF SYMBOLS 1 ... ECU, 10 ... Microcomputer, 12 ... CPU, 14 ... FPU, 16 ... Flash ROM, 18 ... RAM, 20 ... Backup RAM, 30 ... EEPROM.

Claims (9)

車両に備えられ、その車両における制御対象を制御する制御処理を実行する電子制御装置であって、
前記制御処理のプログラムにおいて変数のデータ型は予め定められ、
前記制御対象を制御するために検出される数値データであって、前記制御処理において扱われるその数値データの可変範囲の幅(以下、データ幅と言う)を表す情報を取得するデータ幅取得手段と、
前記データ幅取得手段により取得されたデータ幅を、前記データ型に格納可能な範囲を表す値で除算した分解能を算出する分解能算出手段と、を備え、
前記制御処理では、前記分解能算出手段により算出された分解能で前記数値データがメモリに格納されるようになっていることを特徴とする電子制御装置。
An electronic control device that is provided in a vehicle and executes a control process for controlling a control target in the vehicle,
In the control processing program, the data type of the variable is predetermined,
Data width acquisition means for acquiring information indicating the width of a variable range of the numerical data (hereinafter referred to as data width) handled in the control process, which is numerical data detected for controlling the control object; ,
Resolution calculating means for calculating a resolution obtained by dividing the data width acquired by the data width acquiring means by a value representing a range that can be stored in the data type, and
In the control processing, the numerical data is stored in a memory with the resolution calculated by the resolution calculation means.
請求項1に記載の電子制御装置において、
前記データ幅取得手段は、
前記データ幅を所定の分割数で分割してその分割後の個々のデータ幅(以下、個別データ幅と言う)を算出する個別データ幅算出手段を備え、
前記分解能算出手段は、前記個別データ幅を、前記データ型に格納可能な範囲を表す値で除算した分解能(以下、個別分解能と言う)を算出するようになっており、
前記可変範囲を前記所定の分割数で分割して、分割後の個々の領域(以下、個別領域と言う)のそれぞれについて、その領域の始値(以下、オフセット値と言う)を算出するオフセット値算出手段を備え、
前記制御処理では、前記数値データの値から、その数値データが含まれる前記個別領域のオフセット値(以下、対象オフセット値と言う)を減算した値が、前記個別分解能でメモリに格納されるようになっていると共に、そのメモリに格納された値と、前記対象オフセット値とを用いて前記数値データが表わされるように構成されていることを特徴とする電子制御装置。
The electronic control device according to claim 1.
The data width acquisition means includes
Individual data width calculation means for dividing the data width by a predetermined number of divisions and calculating individual data widths after the division (hereinafter referred to as individual data widths),
The resolution calculation means calculates the resolution obtained by dividing the individual data width by a value representing a range that can be stored in the data type (hereinafter referred to as individual resolution).
An offset value for dividing the variable range by the predetermined number of divisions and calculating a starting value (hereinafter referred to as an offset value) of each area after the division (hereinafter referred to as an individual area). A calculation means,
In the control process, a value obtained by subtracting an offset value (hereinafter referred to as a target offset value) of the individual area including the numerical data from the value of the numerical data is stored in the memory with the individual resolution. And an electronic control unit configured to represent the numerical data using a value stored in the memory and the target offset value.
請求項2に記載の電子制御装置において、
前記データ幅は前記所定の分割数で所定幅毎に分割されるようになっており、
前記オフセット値は、前記個別データ幅に、分割の境界数を表す整数値の最小値から最大値をそれぞれ乗算することで算出されるようになっていることを特徴とする電子制御装置。
The electronic control device according to claim 2,
The data width is divided for each predetermined width by the predetermined number of divisions,
The electronic control device is characterized in that the offset value is calculated by multiplying the individual data width by a minimum value from a minimum value of integer values representing the number of division boundaries, respectively.
請求項1ないし請求項3の何れか1項に記載の電子制御装置において、
前記データ幅取得手段及び前記分解能算出手段の動作を制御する動作制御手段を備え、該動作制御手段は、使用者の入力に基づき、数値データの種別毎に、前記データ幅取得手段及び前記分解能算出手段の動作を許可するか否かを判定し、
前記動作制御手段により動作が許可されない場合は、前記データ幅取得手段及び前記分解能算出手段は動作しないように構成され、この場合の前記制御処理では、使用者により予め入力された分解能で前記数値データがメモリに格納されるように構成されていることを特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 3,
Operation control means for controlling the operations of the data width acquisition means and the resolution calculation means, the operation control means for each type of numerical data based on a user input, the data width acquisition means and the resolution calculation Determine whether to allow the action of the means,
When the operation is not permitted by the operation control unit, the data width acquisition unit and the resolution calculation unit are configured not to operate. In the control process in this case, the numerical data is input with a resolution input in advance by a user. Is configured to be stored in a memory.
請求項1ないし請求項4の何れか1項に記載の電子制御装置において、
前記数値データは、固定小数点型の変数としてメモリに格納されるようになっていることを特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 4,
The electronic control device is characterized in that the numerical data is stored in a memory as a fixed-point variable.
請求項5に記載の電子制御装置において、
前記数値データの要求精度は予め定められ、
前記数値データを、固定小数点型の変数として、前記分解能算出手段により算出される分解能で前記メモリに格納した場合のそのデータの精度(以下、数値データ精度と言う)と、前記要求精度とを比較する比較手段を備え、
前記比較手段の比較結果に基づき、前記数値データ精度が前記要求精度を満たしているか否かを判定し、満たしている場合に前記数値データが固定小数型の変数としてメモリに格納されるようになっていることを特徴とする電子制御装置。
The electronic control device according to claim 5.
The required accuracy of the numerical data is predetermined,
When the numerical data is stored as a fixed-point variable in the memory with the resolution calculated by the resolution calculation means, the accuracy of the data (hereinafter referred to as numerical data accuracy) is compared with the required accuracy. Comparing means to
Based on the comparison result of the comparison means, it is determined whether or not the numerical data accuracy satisfies the required accuracy, and if it satisfies, the numerical data is stored in a memory as a fixed decimal variable. An electronic control device characterized by that.
車両に備えられ、その車両における制御対象を制御する制御処理を実行する電子制御装置であって、
前記制御処理のプログラムにおいて変数のデータ型は予め定められ、
前記制御対象を制御するために検出される数値データであって、前記制御処理において扱われるその数値データの要求精度となる分解能は予め定められ、
前記数値データの可変範囲の幅(以下、データ幅と言う)を表す情報を取得するデータ幅取得手段と、
前記データ幅を前記データ型に前記分解能で格納可能な範囲を表す値で除算して、その結果の小数点以下を切り上げて分割数を算出する分割数算出手段と、
前記数値データの可変範囲が前記分割数算出手段により算出された分割数(以下、算出分割数と言う)で分割された後の個々の領域(以下、個別領域と言う)のそれぞれについて、その領域の始値(以下、オフセット値と言う)を算出するオフセット値算出手段とを備え、
前記制御処理では、前記数値データの値から、その数値データが含まれる前記個別領域のオフセット値(以下、対象オフセット値と言う)を減算した値が、前記分解能でメモリに格納されるようになっていると共に、そのメモリに格納された値と、前記対象オフセット値とを用いて前記数値データが表わされるように構成されていることを特徴とする電子制御装置。
An electronic control device that is provided in a vehicle and executes a control process for controlling a control target in the vehicle,
In the control processing program, the data type of the variable is predetermined,
The numerical data detected for controlling the control object, the resolution to be the required accuracy of the numerical data handled in the control process is determined in advance,
Data width acquisition means for acquiring information indicating the width of the variable range of the numerical data (hereinafter referred to as data width);
A division number calculating means for dividing the data width by a value representing a range that can be stored in the data type with the resolution and rounding up the decimal point of the result to calculate the division number;
For each of the individual areas (hereinafter referred to as individual areas) after the variable range of the numerical data is divided by the number of divisions calculated by the division number calculation means (hereinafter referred to as the calculated division number) Offset value calculating means for calculating a starting value (hereinafter referred to as an offset value) of
In the control process, a value obtained by subtracting an offset value (hereinafter referred to as a target offset value) of the individual area including the numerical data from the value of the numerical data is stored in the memory with the resolution. In addition, the electronic control device is configured such that the numerical data is represented using a value stored in the memory and the target offset value.
請求項7に記載の電子制御装置において、
前記データ幅取得手段及び前記分割数算出手段の動作を制御する動作制御手段を備え、該動作制御手段は、使用者の入力に基づき、数値データの種別毎に、前記データ幅取得手段及び前記分割数算出手段の動作を許可するか否かを判定し、
前記動作制御手段により動作が許可されない場合は、前記データ幅取得手段及び前記分割数算出手段は動作しないように構成され、この場合の前記制御処理では、使用者により予め入力された分解能で前記数値データがメモリに格納されるように構成されていることを特徴とする電子制御装置。
The electronic control device according to claim 7.
And an operation control unit that controls operations of the data width acquisition unit and the division number calculation unit, and the operation control unit performs the data width acquisition unit and the division for each type of numerical data based on a user input. Determine whether to allow the operation of the number calculation means,
When the operation is not permitted by the operation control unit, the data width acquisition unit and the division number calculation unit are configured not to operate. In the control process in this case, the numerical value is input with a resolution input in advance by a user. An electronic control device configured to store data in a memory.
車両に備えられる電子制御装置にて、その車両における制御対象を制御する制御処理において用いられる演算方法であって、
前記制御処理のプログラムにおいて変数のデータ型は予め定められ、
前記制御対象を制御するために検出される数値データであって、前記制御処理において扱われるその数値データの可変範囲の幅(以下、データ幅と言う)を表す情報を取得し、
前記取得されたデータ幅を、前記データ型に格納可能な範囲を表す値で除算した分解能を算出し、
前記制御処理では、前記算出された分解能で前記数値データがメモリに格納されるようになっていることを特徴とする電子制御装置における演算方法。
An arithmetic method used in a control process for controlling a control target in a vehicle in an electronic control device provided in the vehicle,
In the control processing program, the data type of the variable is predetermined,
It is numerical data detected for controlling the control object, and obtains information indicating the width of the variable range of the numerical data handled in the control process (hereinafter referred to as data width),
Calculating a resolution obtained by dividing the acquired data width by a value representing a range that can be stored in the data type;
In the control process, the numerical data is stored in a memory with the calculated resolution.
JP2008034777A 2008-02-15 2008-02-15 Electronic control device and calculation method in electronic control device Expired - Fee Related JP5040710B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008034777A JP5040710B2 (en) 2008-02-15 2008-02-15 Electronic control device and calculation method in electronic control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008034777A JP5040710B2 (en) 2008-02-15 2008-02-15 Electronic control device and calculation method in electronic control device

Publications (2)

Publication Number Publication Date
JP2009190624A JP2009190624A (en) 2009-08-27
JP5040710B2 true JP5040710B2 (en) 2012-10-03

Family

ID=41073021

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008034777A Expired - Fee Related JP5040710B2 (en) 2008-02-15 2008-02-15 Electronic control device and calculation method in electronic control device

Country Status (1)

Country Link
JP (1) JP5040710B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5985444A (en) * 1982-11-05 1984-05-17 Nippon Denso Co Ltd Method for protecting learning data in engine control device
JPS6423376A (en) * 1987-07-20 1989-01-26 Fujitsu Ltd Picture input device
JPH0292084A (en) * 1988-09-29 1990-03-30 Canon Inc Picture data transmitter
JPH02188080A (en) * 1989-01-13 1990-07-24 Nikon Corp Ad-da converting circuit
JPH10163871A (en) * 1996-12-04 1998-06-19 Saginomiya Seisakusho Inc Analog-digital conversion device and method, and analog-digital conversion control program storage medium
JP3551875B2 (en) * 2000-01-11 2004-08-11 株式会社デンソー Electronic control unit with floating point arithmetic function
JP3640914B2 (en) * 2001-10-26 2005-04-20 高木産業株式会社 Automatic hot water bath equipment
JP2007327823A (en) * 2006-06-07 2007-12-20 Denso Corp Current measurement method and current measuring apparatus for vehicle-mounted battery

Also Published As

Publication number Publication date
JP2009190624A (en) 2009-08-27

Similar Documents

Publication Publication Date Title
JP2009245212A (en) Embedded control system
JP4515701B2 (en) VEHICLE CONTROL PROGRAM AND VEHICLE CONTROL DEVICE
JP2017199167A (en) Semiconductor device
JP2019196732A (en) On-vehicle communication device
US6981134B2 (en) Method and system for processing using a CPU and digital signal processor
JP5040710B2 (en) Electronic control device and calculation method in electronic control device
US20080256296A1 (en) Information processing apparatus and method for caching data
WO2017065629A1 (en) Task scheduler and method for scheduling a plurality of tasks
JP6518159B2 (en) Method and apparatus for transferring a binary image to a memory device
JP2019074851A (en) Electronic control device
JP2007334563A (en) Vector processing device with mask
JP6316593B2 (en) Semiconductor device
CN103514098A (en) Method and system used for recovering storage space
CN115146769A (en) Digital circuit module for calculating tanh function based on range addressable lookup table
US20080282071A1 (en) Microprocessor and register saving method
JP6365387B2 (en) Electronic control unit
US6725298B1 (en) Method and system for filter-processing by ensuring a memory space for a ring-buffer in digital signal processor
JP3780610B2 (en) Billing information output device
JP2004225668A (en) Electronic control unit and memory device of electronic control unit
JP2007233990A (en) Information processor and circuit design method thereof
JP6485343B2 (en) Control program, control device, and control method
JP2003196991A (en) Rom write device
JP2014137643A (en) Data retention device and data retention method
JP4196773B2 (en) Electronic control device design and development system, program, recording medium
JP3795055B1 (en) Value prediction apparatus, multiprocessor system, and value prediction method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100305

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120330

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120612

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120625

R151 Written notification of patent or utility model registration

Ref document number: 5040710

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150720

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees