JP2005048698A - Signal processor - Google Patents

Signal processor Download PDF

Info

Publication number
JP2005048698A
JP2005048698A JP2003282912A JP2003282912A JP2005048698A JP 2005048698 A JP2005048698 A JP 2005048698A JP 2003282912 A JP2003282912 A JP 2003282912A JP 2003282912 A JP2003282912 A JP 2003282912A JP 2005048698 A JP2005048698 A JP 2005048698A
Authority
JP
Japan
Prior art keywords
counter
signal
angle
value
multiplication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003282912A
Other languages
Japanese (ja)
Inventor
Takayoshi Honda
隆芳 本多
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 JP2003282912A priority Critical patent/JP2005048698A/en
Publication of JP2005048698A publication Critical patent/JP2005048698A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Combined Controls Of Internal Combustion Engines (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To accurately set a count value of an angle counter corresponding to a crank angle, regardless of an engine speed. <P>SOLUTION: A microcomputer 11 (a signal processor) comprises a pulse interval counter 17 for inputting angle signals having rising edges every 10° CA, performing count-up operation every pulse interval (10° CA) as a rising edge interval for the angle signal with a clock CLK from a frequency divider circuit 15, and outputting the counting value as a measured value T for one pulse interval, means 19, 21, 23 for finding an integer value M obtained by dividing the measured value by a number of multiplication N to generate a multiplied clock having a cycle of "cycle of clock CLK×M", and the angle counter 25 for performing count-up operation with the multiplied clock. The frequency of the clock CLK is changed into a larger value as the engine speed is higher. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、エンジンのクランク軸の回転に対応して発生される角度信号に応じて、角度カウンタのカウント値を進めていく信号処理装置に関する。   The present invention relates to a signal processing device that advances a count value of an angle counter in accordance with an angle signal generated in response to rotation of a crankshaft of an engine.

従来より、例えばエンジンを制御する装置は、エンジンのクランク軸の回転に同期して、燃料噴射弁や点火装置等を作動させるための制御信号を出力するように構成される。
そして、この種のエンジン制御装置として、クランク軸の回転に対応した所定角度間隔毎のパルス列の角度信号(クランク信号)を逓倍した逓倍信号を生成すると共に、その逓倍信号で角度カウンタをカウントアップさせることにより、元の角度信号よりも細かい分解能でクランク角を把握し、上記角度カウンタのカウント値が、あるクランク角を指示する設定値と一致したら、点火や噴射の出力を行うようにしたものがある(例えば、特許文献1,2参照)。
2. Description of the Related Art Conventionally, for example, a device for controlling an engine is configured to output a control signal for operating a fuel injection valve, an ignition device, or the like in synchronization with rotation of a crankshaft of the engine.
As this type of engine control device, a multiplied signal is generated by multiplying an angle signal (crank signal) of a pulse train at predetermined angular intervals corresponding to the rotation of the crankshaft, and the angle counter is counted up by the multiplied signal. As a result, the crank angle can be grasped with finer resolution than the original angle signal, and if the count value of the angle counter matches the set value indicating a certain crank angle, the output of ignition or injection is performed. (For example, see Patent Documents 1 and 2).

また、こうした装置では、上記逓倍信号を生成するための手段として、角度信号に所定角度間隔毎のパルスエッジ(以下、特定エッジという)が発生してから該特定エッジが次に発生するまでの1パルス間隔(つまり、所定角度間隔)毎に、その1パルス間隔よりも周期が十分に短い計測用クロックで0からカウントアップすることにより、該1パルス間隔を計測する計測カウンタと、角度信号に特定エッジが発生すると上記計測カウンタによる今回の1パルス間隔分のカウント値を逓倍数Nで除算して、その今回のカウント値が逓倍数Nの何倍であるかを示す整数値Mを求め、該整数値Mを逓倍レジスタにセットする手段と、逓倍レジスタにセットされた整数値Mを初期値として上記計測用クロックによりダウンカウントする逓倍カウンタとを備えており、その逓倍カウンタがアンダーフローすると、逓倍信号としてのパルス(逓倍クロック)を発生すると共に、該逓倍カウンタのカウント値が上記逓倍レジスタ内の整数値Mに戻されるようになっている(例えば、特許文献1参照)。そして、このような構成により、逓倍カウンタからは、周期が計測用クロックの周期×M(つまり、周期が角度信号の1パルス間隔のほぼ1/N)である逓倍信号が出力される。
特開2001−263150号公報 特開2001−227445号公報
Further, in such an apparatus, as a means for generating the multiplied signal, 1 until the specific edge is generated after a pulse edge (hereinafter referred to as a specific edge) for each predetermined angle interval is generated in the angle signal. For each pulse interval (that is, a predetermined angle interval), counting from 0 with a measurement clock whose cycle is sufficiently shorter than the one pulse interval, the measurement counter for measuring the one pulse interval and the angle signal are specified. When an edge is generated, a count value for the current one pulse interval by the measurement counter is divided by a multiplication number N to obtain an integer value M indicating how many times the current count value is the multiplication number N. Means for setting an integer value M in a multiplication register, and a multiplication counter for down-counting by the measurement clock using the integer value M set in the multiplication register as an initial value When the multiplication counter underflows, a pulse (multiplication clock) is generated as a multiplication signal, and the count value of the multiplication counter is returned to the integer value M in the multiplication register. (For example, refer to Patent Document 1). With such a configuration, the multiplication counter outputs a multiplication signal whose cycle is the cycle of the measurement clock × M (that is, the cycle is approximately 1 / N of one pulse interval of the angle signal).
JP 2001-263150 A JP 2001-227445 A

ところで、角度信号を逓倍した逓倍信号を生成する装置では、特許文献1にも記載されているように、1パルス間隔分のカウント値を逓倍数Nで除算した際の桁落ち(即ち、余り)により、角度カウンタの1カウント分の時間(=逓倍信号の周期)に誤差が発生し、その誤差が問題となっていた。つまり、逓倍信号の周期に誤差が生じると、角度カウンタのカウント値がクランク角を正確に示さなくなり、例えば制御信号の出力タイミングの精度が低下するからである。   By the way, in an apparatus that generates a multiplied signal obtained by multiplying an angle signal, as described in Patent Document 1, a digit loss (ie, a remainder) when a count value for one pulse interval is divided by a multiplication number N. Thus, an error occurs in the time of one count of the angle counter (= cycle of the multiplied signal), and the error is a problem. That is, if an error occurs in the cycle of the multiplied signal, the count value of the angle counter does not accurately indicate the crank angle, and for example, the accuracy of the output timing of the control signal decreases.

この誤差について具体例を挙げて説明する。尚、角度信号には10°CA毎(クランク軸が10°回転する毎)に立ち上がりエッジ(特定エッジに相当)が発生するものとし、その角度信号の1パルス間隔(10°CAの時間間隔)を計測する計測カウンタのクロック(上記計測用クロック)の周波数は16MHz(周期=0.0625μs)であり、逓倍数Nは256であるものとする。また、角度カウンタは、カウントアップされるものとする。   This error will be described with a specific example. The angle signal has a rising edge (corresponding to a specific edge) every 10 ° CA (each time the crankshaft rotates 10 °), and one pulse interval of the angle signal (time interval of 10 ° CA). It is assumed that the frequency of the measurement counter clock (measuring clock) is 16 MHz (period = 0.0625 μs) and the multiplication number N is 256. The angle counter is counted up.

まず図15(A)に示すように、例えばエンジン回転数(クランク軸の回転数)が500rpmといった低回転時には、角度信号の1パルス間隔が3333.333…μsとなるため、計測カウンタによる1パルス間隔分のカウント値は、53333(=3333.333…μs/0.0625μs)となり、そのカウント値を逓倍数N(=256)で割ると、整数値Mが208で、余りが85となる。   First, as shown in FIG. 15A, for example, when the engine speed (crankshaft speed) is as low as 500 rpm, one pulse interval of the angle signal is 3333.333... The count value for the interval is 53333 (= 333.333... Μs / 0.0625 μs). When the count value is divided by the multiplication number N (= 256), the integer value M is 208 and the remainder is 85.

このため、逓倍信号の周期は「0.0625μs×208」となり、角度カウンタは、図15(A)に示す如く、その周期毎にカウントアップされることとなるが、その角度カウンタの1カウント分の時間(=逓倍信号の周期)は、角度信号の1パルス間隔を1/Nにした本当の時間に対して、計測カウンタによる1パルス間隔分の全カウント値における上記余りの割合に相当する誤差を持つことになる。   For this reason, the cycle of the multiplied signal is “0.0625 μs × 208”, and the angle counter is counted up every cycle as shown in FIG. 15A. Is the error corresponding to the ratio of the remainder in the total count value for one pulse interval by the measurement counter with respect to the true time when the pulse interval of the angle signal is 1 / N. Will have.

そして、256逓倍する際の余りの最大値は255(=逓倍数N−1)であるため、500rpm付近で考えると、全カウント値に占める余りの割合が最大となるのは、498.41rpmの時であり、その余りの割合(即ち、逓倍信号の周期の誤差)は「255/(256*208+255)」=0.48%となる。   And since the maximum value of the remainder when multiplying by 256 is 255 (= multiplication number N-1), when considering the vicinity of 500 rpm, the ratio of the remainder to the total count value is the largest at 498.41 rpm. It is time, and the ratio of the remainder (that is, the error in the period of the multiplied signal) is “255 / (256 * 208 + 255)” = 0.48%.

次に、図15(B)に示すように、例えばエンジン回転数が10000rpmといった高回転時には、角度信号の1パルス間隔が166.666…μsとなるため、計測カウンタによる1パルス間隔分のカウント値は、2666(=166.666…μs/0.0625μs)となり、そのカウント値を逓倍数N(=256)で割ると、整数値Mが10で、余りが106となる。   Next, as shown in FIG. 15 (B), for example, when the engine speed is 10,000 rpm, the angle signal has one pulse interval of 166.6666... Μs. Is 2666 (= 166.666... Μs / 0.0625 μs). When the count value is divided by the multiplication number N (= 256), the integer value M is 10 and the remainder is 106.

このため、逓倍信号の周期は「0.0625μs×10」となり、角度カウンタは、図15(B)に示す如く、その周期毎にカウントアップされることとなるが、この場合にも、その角度カウンタの1カウント分の時間(=逓倍信号の周期)は、本当の時間に対して、計測カウンタによる1パルス間隔分の全カウント値における上記余りの割合に相当する誤差を持つことになる。   For this reason, the cycle of the multiplied signal is “0.0625 μs × 10”, and the angle counter is counted up for each cycle as shown in FIG. 15B. The time corresponding to one count of the counter (= cycle of the multiplied signal) has an error corresponding to the above-mentioned ratio of the remainder in the total count value corresponding to one pulse interval by the measurement counter with respect to the real time.

そして、10000rpm付近で考えると、全カウント値に占める余りの割合が最大となるのは、9473rpmの時であり、その余りの割合(即ち、逓倍信号の周期の誤差)は「255/(256*10+255)」=9.1%となる。   Considering around 10,000 rpm, the ratio of the remainder to the total count value becomes the maximum at 9473 rpm, and the ratio of the remainder (that is, the error of the multiplication signal cycle) is “255 / (256 * 10 + 255) ”= 9.1%.

このように、エンジン回転数が高い場合ほど、1パルス間隔分のカウント値を逓倍数Nで除算した際の余りの影響(即ち、1パルス間隔分のカウント値に対する余りの割合の最大値であって、逓倍信号の周期誤差の最大値)が大きくなり、その結果、角度カウンタのカウント値とクランク角との対応が不正確になってしまう。このため、制御精度の悪化を招くこととなる。   Thus, the higher the engine speed, the more the influence of the remainder when the count value for one pulse interval is divided by the multiplication number N (that is, the maximum value of the ratio of the remainder to the count value for one pulse interval). As a result, the correspondence between the count value of the angle counter and the crank angle becomes inaccurate. For this reason, deterioration of control accuracy is caused.

尚、こうした誤差を小さくするために、計測カウンタのクロック(計測用クロック)の周波数を高く設定することも考えられるが、特に角度信号の1パルス間隔が長くなる低回転時において、計測カウンタがカウントすべき最大値が大きくなってしまう。このため、ビット数の大きな計測カウンタが必要となり、回路規模が増大してしまう。   In order to reduce such errors, it is conceivable to set the frequency of the measurement counter clock (measurement clock) high, but the measurement counter counts especially during low rotations where the interval of one pulse of the angle signal is long. The maximum value to be increased. For this reason, a measurement counter with a large number of bits is required, and the circuit scale increases.

また、上記特許文献1には、逓倍カウンタに初期値としてセットする整数値Mを、除算による桁落ち部分に対する四捨五入で補正することが記載されているが、そのような補正処理を行っても、せいぜい誤差を半分にできる程度である上に、エンジン回転数が高くなるほど誤差が大きくなってしまうことを解決することはできない。   Further, in Patent Document 1, it is described that the integer value M that is set as an initial value in the multiplication counter is corrected by rounding off a digit loss part by division, but even if such correction processing is performed, In addition to being able to halve the error at most, it cannot be solved that the error increases as the engine speed increases.

本発明は、こうした問題に鑑みなされたものであり、角度カウンタのカウント値とクランク角との対応をエンジン回転数に拘わらず正確なものにすることができる信号処理装置の提供を目的としている。   The present invention has been made in view of these problems, and an object of the present invention is to provide a signal processing device that can make the correspondence between the count value of the angle counter and the crank angle accurate regardless of the engine speed.

上記目的を達成するためになされた請求項1に記載の信号処理装置では、計測手段が、エンジンのクランク軸の回転に対応して所定角度間隔毎にパルスエッジが発生する角度信号を入力し、その角度信号に前記所定角度間隔毎のパルスエッジである特定エッジが発生してから該特定エッジが次に発生するまでの間隔(以下、1パルス間隔という)毎に、該1パルス間隔よりも短い所定の計測用周期でカウント動作を行って、その1パルス間隔の間にカウントしたカウント値を前記1パルス間隔の計測値として出力する。   In the signal processing device according to claim 1, which is made to achieve the above object, the measurement unit inputs an angle signal that generates a pulse edge at every predetermined angle interval corresponding to the rotation of the crankshaft of the engine, Each interval from the occurrence of a specific edge, which is a pulse edge for each predetermined angle interval, to the next occurrence of the specific edge (hereinafter referred to as one pulse interval) is shorter than the one pulse interval. A count operation is performed at a predetermined measurement cycle, and a count value counted during the one-pulse interval is output as a measurement value for the one-pulse interval.

そして、逓倍信号生成手段が、計測手段による計測値(つまり、角度信号の1パルス間隔分のカウント値)を所定の逓倍数Nで除算して、その計測値が逓倍数Nの何倍であるかを示す整数値Mを求め、周期が「前記計測用周期×M」である逓倍信号を生成する。そして更に、角度カウンタが、逓倍信号生成手段からの逓倍信号によってカウント動作する。   Then, the multiplication signal generation means divides the measurement value (that is, the count value for one pulse interval of the angle signal) by the measurement means by a predetermined multiplication number N, and the measurement value is a multiple of the multiplication number N. An integer value M indicating the above is obtained, and a multiplication signal having a cycle of “the measurement cycle × M” is generated. Further, the angle counter performs a counting operation by the multiplied signal from the multiplied signal generating means.

ここで特に、請求項1の信号処理装置には、計測用周期変更手段が設けられており、その計測用周期変更手段は、上記計測手段と逓倍信号生成手段とに共通の計測用周期を、クランク軸の回転数(エンジン回転数)に応じて変更する。具体的には、請求項2に記載の如く、計測用周期変更手段は、クランク軸の回転数が高い場合ほど、計測用周期を短くする。   Here, in particular, the signal processing device according to claim 1 is provided with a measurement cycle changing unit, and the measurement cycle changing unit has a measurement cycle common to the measurement unit and the multiplied signal generating unit. Change according to the number of revolutions of the crankshaft (engine speed). Specifically, as described in claim 2, the measurement cycle changing means shortens the measurement cycle as the rotation speed of the crankshaft is higher.

このような信号処理装置によれば、角度カウンタのカウント値とクランク角との対応をエンジン回転数に拘わらず正確なものにすることができるようになる。
つまり、計測手段による計測値(角度信号の1パルス間隔分のカウント値)をTとすると、「発明が解決しようとする課題」の欄で述べたように、角度カウンタの1カウント分の時間である逓倍信号の周期には最大で「(逓倍数N−1)/T」だけの誤差が生じるが、角度信号の1パルス間隔が長い低回転時よりも、その1パルス間隔が短くなる高回転時の方が、計測用周期を短くすることにより、低回転時と高回転時とで、計測手段による計測値(カウント値)Tに大差が生じないようにすることができ、その結果、高回転時においても、逓倍信号の周期誤差を小さく抑えることができる。そして、逓倍信号の周期誤差が小さくなれば、角度カウンタのカウント値とクランク角との対応が一層正確になる。そして更に、このため、角度カウンタのカウント値に応じて実施される処理の精度が向上する。
According to such a signal processing device, the correspondence between the count value of the angle counter and the crank angle can be made accurate regardless of the engine speed.
That is, when the measurement value (count value for one pulse interval of the angle signal) by the measuring means is T, as described in the section “Problems to be solved by the invention”, the time for one count of the angle counter is An error of "(multiplication number N-1) / T" occurs at the maximum in the period of a certain multiplication signal, but the high-speed rotation in which the one-pulse interval is shorter than in the low-speed rotation in which the one-pulse interval of the angle signal is long. By shortening the measurement cycle, it is possible to prevent a large difference in the measurement value (count value) T measured by the measuring means between the low rotation speed and the high rotation speed. Even during rotation, the cyclic error of the multiplied signal can be kept small. If the cyclic error of the multiplied signal becomes smaller, the correspondence between the count value of the angle counter and the crank angle becomes more accurate. Further, for this reason, the accuracy of processing performed in accordance with the count value of the angle counter is improved.

しかも、この信号処理装置によれば、角度信号の1パルス間隔が長くなる低回転時には、計測用周期が長く設定されるため、計測手段がカウントすべき最大値が必要以上に大きくなってしまうこともない。   In addition, according to this signal processing apparatus, the measurement cycle is set to be longer at low rotations where the one-pulse interval of the angle signal is longer, so that the maximum value to be counted by the measuring means becomes larger than necessary. Nor.

また、計測用周期を短くすると、少なくとも計測手段のカウント動作が早くなるため、装置での消費電力が大きくなるが、本装置では、エンジン始動時などの低回転時には計測用周期を長くすることとなるため、そのような低回転時での消費電力を抑えることができる。   In addition, if the measurement cycle is shortened, at least the counting operation of the measurement means is accelerated, so the power consumption in the device increases.In this device, however, the measurement cycle is lengthened at low revolutions such as when the engine is started. Therefore, it is possible to suppress power consumption at the time of such low rotation.

また更に、角度信号に特定エッジが発生する上記所定角度間隔をX°CAとすると、角度カウンタのカウント値が表すクランク角の分解能(クランク角分解能)は「X°CA/逓倍数N」であるが、この信号処理装置では逓倍数Nが一定であるため、そのクランク角分解能も一定である。このため、例えば、「背景技術」の欄で述べたように、角度カウンタのカウント値が設定値と一致したら制御信号を出力するといった構成を採った場合に、その設定値の分解能を変更する必要がなく、その点においても有利である。   Furthermore, if the predetermined angle interval at which a specific edge occurs in the angle signal is X ° CA, the crank angle resolution (crank angle resolution) represented by the count value of the angle counter is “X ° CA / multiplication number N”. However, in this signal processing device, since the multiplication number N is constant, the crank angle resolution is also constant. For this reason, for example, as described in the “Background Art” section, when a configuration is adopted in which a control signal is output when the count value of the angle counter matches the set value, it is necessary to change the resolution of the set value. This is also advantageous in that respect.

ところで、計測用周期変更手段は、請求項3に記載のように、前記計測用周期を、大きいものが小さいものの2z倍(zは1以上の整数)の関係にある複数通りの周期のうちの何れかに切り換えるように構成するのが好ましい。デジタル回路及び処理の分野において、2z倍の関係にある複数通りの周期を作り出すのは、それ以外の関係にある周期を作り出すよりも遙かに容易であるからである。 By the way, the measurement cycle changing means, as described in claim 3, includes a plurality of cycles in which the measurement cycle is 2 z times larger (z is an integer of 1 or more) than the smaller one. It is preferable to switch to any one of the above. In the field of digital circuits and processing, it is much easier to create a plurality of periods having a relation of 2 z times than to create periods having other relations.

次に、請求項4に記載の信号処理装置は、請求項1の信号処理装置と同様の計測手段,逓倍信号生成手段,及び角度カウンタを備えている。
そして特に、請求項4の信号処理装置には、逓倍数変更手段が設けられており、その逓倍数変更手段は、上記逓倍数Nを、クランク軸の回転数(エンジン回転数)に応じて変更する。具体的には、請求項5に記載の如く、逓倍数変更手段は、クランク軸の回転数が高い場合ほど、逓倍数Nを小さくする。
Next, a signal processing device according to a fourth aspect includes a measurement unit, a multiplied signal generation unit, and an angle counter similar to the signal processing device according to the first aspect.
In particular, the signal processing device according to claim 4 is provided with a multiplication number changing means, and the multiplication number changing means changes the multiplication number N in accordance with the rotation speed of the crankshaft (engine rotation speed). To do. Specifically, as described in claim 5, the multiplication number changing means decreases the multiplication number N as the rotation speed of the crankshaft is higher.

このような信号処理装置によっても、角度カウンタのカウント値とクランク角との対応をエンジン回転数に拘わらず正確なものにすることができるようになる。
つまり、前述したように、計測手段による計測値(角度信号の1パルス間隔分のカウント値)をTとすると、角度カウンタの1カウント分の時間である逓倍信号の周期には最大で「(逓倍数N−1)/T」だけの誤差が生じるが、Tが大きくなる低回転時よりも、Tが小さくなる高回転時の方が、逓倍数Nを小さくすることにより、その誤差を、高回転時においても低回転時と同等に小さく抑えることができるからである。
Even with such a signal processing device, the correspondence between the count value of the angle counter and the crank angle can be made accurate regardless of the engine speed.
That is, as described above, if the measurement value (count value for one pulse interval of the angle signal) is T, the period of the multiplied signal, which is the time for one count of the angle counter, is “(multiplied). (N-1) / T "occurs. However, when T is increased, the error is increased by reducing the multiplication number N in the high rotation where T is small, rather than in the low rotation where T is increased. This is because the rotation can be kept as small as the low rotation.

また、この信号処理装置によれば、計測用周期を短くする必要がないため、計測手段がカウントすべき最大値が大きくなったり、消費電流の増加を招くこともない。
尚、角度信号の1パルス間隔の時間をtpとすると、角度カウンタのカウント値が表す時間の分解能(時間分解能)は「tp/逓倍数N」であるが、tpが大きくなる低回転時には逓倍数Nを大きくし、tpが小さくなる高回転時には逓倍数Nを小さくすることで、その時間分解能を回転数によらず一定範囲にすることができる。
Further, according to this signal processing apparatus, since it is not necessary to shorten the measurement cycle, the maximum value to be counted by the measuring means does not increase and the current consumption does not increase.
If the time of one pulse interval of the angle signal is tp, the time resolution (time resolution) represented by the count value of the angle counter is “tp / multiplication number N”, but the multiplication number at low rotation when tp becomes large. By increasing N and reducing the multiplication number N at high rotations at which tp is reduced, the time resolution can be kept within a certain range regardless of the rotation number.

次に、請求項6に記載の信号処理装置では、請求項4,5の信号処理装置において、角度カウンタは、上位複数ビットの上位カウンタと、下位kビット(kは2以上の整数)の下位カウンタとからなっている。また、逓倍数変更手段は、逓倍数Nを、2n(nは1からkまでの整数のうちの何れか)で表される複数個の数値のうちの何れかに切り換えるようになっている。 Next, in the signal processing device according to claim 6, in the signal processing device according to claims 4 and 5, the angle counter includes an upper counter of upper multiple bits and a lower order of lower k bits (k is an integer of 2 or more). It consists of a counter. Further, the multiplication number changing means switches the multiplication number N to any one of a plurality of numerical values represented by 2 n (n is any integer from 1 to k). .

そして、角度カウンタの上位カウンタは、角度信号に特定エッジが発生する毎にカウント動作するようになっている。
また、角度カウンタの下位カウンタは、前記逓倍信号によってカウント動作すると共に、角度信号に特定エッジが発生するとクリアされるが、更に、この下位カウンタは、逓倍数変更手段により変更される逓倍数Nに応じて、その逓倍数Nが前記複数個の数値のうちの2p(pは1からkまでの整数のうちの何れか)であるとすると、当該下位カウンタの最上位ビットから数えてpビット目が、逓倍信号に応じたカウント動作の最下位ビットとなるように構成されている。
The upper counter of the angle counter performs a count operation every time a specific edge occurs in the angle signal.
In addition, the lower counter of the angle counter performs counting operation by the multiplication signal and is cleared when a specific edge occurs in the angle signal. Further, the lower counter is set to the multiplication number N changed by the multiplication number changing means. Accordingly, if the multiplication number N is 2 p among the plurality of numerical values (p is any one of integers from 1 to k), p bits counted from the most significant bit of the lower counter. The eye is configured to be the least significant bit of the counting operation corresponding to the multiplied signal.

尚、「下位カウンタの最上位ビットから数えてpビット目が逓倍信号に応じたカウント動作の最下位ビットとなる」とは、下位カウンタにおいて、そのpビット目よりも下位のビットは変化せずに、そのpビット目と該pビット目よりも上位のビットからなる部分が、逓倍信号に応じてカウント動作することを意味している。また、下位カウンタの最上位ビットから数えてpビット目とは、最上位ビットを1ビット目として数えたものであり、最下位ビットから数えたならば「k−p+1」ビット目である。一方、以下の説明において、特に「最上位ビットから数えて」と明記していなければ、ビットの順番位置は、最下位ビットから数えたもの(即ち、最下位ビットを1ビット目としたもの)である。   Note that “the p-th bit counted from the most significant bit of the lower counter becomes the lowest bit of the counting operation according to the multiplied signal” means that the lower bits of the lower counter do not change. In addition, this means that the portion consisting of the p-th bit and the bits higher than the p-th bit counts according to the multiplied signal. The p-th bit counted from the most significant bit of the low-order counter is counted from the most significant bit as the first bit, and if counted from the least significant bit, is the “k−p + 1” th bit. On the other hand, in the following description, unless it is specified as “counting from the most significant bit”, the order position of the bits is counted from the least significant bit (ie, the least significant bit is the first bit). It is.

このような請求項6の信号処理装置によれば、逓倍数変更手段によって逓倍数Nが変更されても、角度カウンタのLSB(下位カウンタの1ビット目)の重みは、常に、逓倍数Nが2kである場合の重み(=X°CA/2k)となり、角度カウンタのカウント値の連続性を確実に保つことができる。 According to such a signal processing device of claim 6, even when the multiplication number N is changed by the multiplication number changing means, the weight of the LSB of the angle counter (the first bit of the lower counter) is always the multiplication number N. The weight in the case of 2 k (= X ° CA / 2 k ) is obtained, and the continuity of the count value of the angle counter can be reliably maintained.

ところで、請求項6の信号処理装置において、逓倍数を角度信号の1パルス間隔の途中で、それまでよりも小さい値に変更すると、角度カウンタのカウント値が、変更後の逓倍数に合わない値をとってしまう可能性がある。   By the way, in the signal processing apparatus according to claim 6, when the multiplication number is changed to a smaller value in the middle of one pulse interval of the angle signal, the count value of the angle counter does not match the changed multiplication number. There is a possibility of taking.

例えば、k=8で、逓倍数を256(=28)から128(=27)に変更した場合を例に挙げると、逓倍数が256に設定されている時点では、角度カウンタにおける下位カウンタの1ビット目(=最上位ビットから数えて8ビット目)が逓倍信号に応じたカウント動作の最下位ビットとなるが、逓倍数が128に変更されると、角度カウンタにおける下位カウンタの2ビット目(=最上位ビットから数えて7ビット目)が逓倍信号に応じたカウント動作の最下位ビットとなり、その下位カウンタの1ビット目は変化しなくなる。このため、下位カウンタの1ビット目が“1”である時に逓倍数が128に変更されると、その後、角度信号に特定エッジが発生して下位カウンタがクリアされるまでは、その下位カウンタの値が奇数になってしまう。これは、本来、逓倍数が128であるならば、角度カウンタのカウント値は偶数である(即ち、下位カウンタの1ビット目は“0”である)ということと矛盾してしまう。そして、このことから、例えば「背景技術」の欄で述べたように角度カウンタのカウント値が設定値と一致したら制御信号を出力する、といった構成の場合には、制御信号が出力されなくなってしまう可能性が生じる。 For example, when k = 8 and the multiplication number is changed from 256 (= 2 8 ) to 128 (= 2 7 ), for example, when the multiplication number is set to 256, the low-order counter in the angle counter The first bit (= 8th bit counted from the most significant bit) is the least significant bit of the counting operation according to the multiplied signal, but when the multiplied number is changed to 128, the 2 bits of the lower counter in the angle counter The first bit (= the seventh bit counted from the most significant bit) is the least significant bit of the counting operation corresponding to the multiplied signal, and the first bit of the lower counter is not changed. For this reason, when the multiplication number is changed to 128 when the first bit of the lower counter is “1”, the lower counter is cleared until a specific edge occurs and the lower counter is cleared. The value becomes odd. This contradicts the fact that if the multiplication number is 128, the count value of the angle counter is an even number (that is, the first bit of the lower counter is “0”). For this reason, for example, as described in the “Background Art” section, a control signal is not output when the control signal is output when the count value of the angle counter matches the set value. A possibility arises.

そこで、こうした可能性を回避するためには、請求項7に記載のように、逓倍数変更手段は、逓倍数を、角度信号に特定エッジが発生したタイミングで変更するように構成すれば良い。つまり、逓倍数を変更する場合には、その逓倍数が、角度カウンタの下位カウンタがクリアされるタイミングで変更されることとなり、上記矛盾の発生を避けることができる。   Therefore, in order to avoid such a possibility, as described in claim 7, the multiplication number changing means may be configured to change the multiplication number at the timing when the specific edge occurs in the angle signal. That is, when the multiplication number is changed, the multiplication number is changed at the timing when the lower counter of the angle counter is cleared, and the occurrence of the contradiction can be avoided.

次に、請求項8に記載の信号処理装置では、請求項4〜7の信号処理装置において、角度カウンタのカウント値に基づき制御信号を出力する信号出力手段を備えている。
そして更に、その信号出力手段は、クランク軸の回転角度(クランク角)を指定した設定値が設定される設定部を有しており、その設定部に設定された設定値と、角度カウンタのカウント値とを大小比較して、それら両値が予め定められた大小関係にある場合に、制御信号を出力するようになっている。
Next, a signal processing device according to an eighth aspect is the signal processing device according to the fourth to seventh aspects, further comprising signal output means for outputting a control signal based on a count value of the angle counter.
Further, the signal output means has a setting unit for setting a setting value that designates the rotation angle (crank angle) of the crankshaft. The setting value set in the setting unit and the count of the angle counter are set. A value is compared with a value, and a control signal is output when the two values are in a predetermined magnitude relationship.

このような信号処理装置によれば、逓倍数変更手段により逓倍数Nがそれまでよりも小さい値に変更されて、角度カウンタのカウント値が上記設定部に既に設定されている設定値の分解能(増減単位)よりも荒い分解能で進んでいく、といった状況が発生した場合でも、必ず制御信号を出力することができるようになる。   According to such a signal processing apparatus, the multiplication number N is changed to a smaller value than before by the multiplication number changing means, and the count value of the angle counter is set to the resolution of the setting value already set in the setting unit ( Even in the case where a situation occurs in which the progression proceeds at a resolution rougher than the increase / decrease unit), the control signal can always be output.

つまり、上記の状況が発生すると、角度カウンタのカウント値が設定値を跨いでしまう場合があるため、角度カウンタのカウント値が設定値と一致したら制御信号を出力する、といった構成の場合には、制御信号が出力されなくなってしまう可能性があるが、そのような不具合を確実に回避することができる。   In other words, if the above situation occurs, the count value of the angle counter may straddle the set value. Therefore, if the count value of the angle counter matches the set value, a control signal is output. Although there is a possibility that the control signal is not output, such a problem can be reliably avoided.

尚、請求項8の構成を採用した場合、設定値の分解能は、角度信号に特定エッジが発生する上記所定角度間隔X°CAを一番大きい逓倍数Nmaxで割った値(=X°CA/Nmax)に固定しておくことが好ましい。   When the configuration of claim 8 is adopted, the resolution of the set value is a value obtained by dividing the predetermined angular interval X ° CA at which a specific edge occurs in the angle signal by the largest multiplication number Nmax (= X ° CA / Nmax) is preferably fixed.

以下に、本発明が適用された実施形態のエンジン制御装置について説明する。
まず図1は、第1実施形態のエンジン制御装置に搭載されたマイコン(マイクロコンピュータ)11の構成を表す構成図である。
Hereinafter, an engine control apparatus according to an embodiment to which the present invention is applied will be described.
First, FIG. 1 is a configuration diagram showing a configuration of a microcomputer 11 mounted in the engine control apparatus of the first embodiment.

図1に示すように、マイコン11には、クランクセンサによって発生される角度信号が入力される。この角度信号は、エンジンのクランク軸の回転に対応して所定角度間隔毎(クランク軸が所定角度回転する毎であり、本実施形態では10°CA毎)に立ち上がりエッジが発生する信号である。   As shown in FIG. 1, the microcomputer 11 receives an angle signal generated by a crank sensor. This angle signal is a signal in which a rising edge occurs every predetermined angle interval (every time the crankshaft rotates by a predetermined angle, in this embodiment, every 10 ° CA) corresponding to the rotation of the crankshaft of the engine.

そして、マイコン11は、エンジンを制御するための各種処理を実行するCPU13に加え、クランク軸の回転に同期して制御信号を出力するための手段として、分周回路15、パルス間隔カウンタ17、カウント値レジスタ19、逓倍演算部21、逓倍カウンタ23、角度カウンタ25、設定値レジスタ27、信号出力部29、AND(アンド)回路31、及びNAND(ナンド)回路33を備えている。尚、制御信号としては、例えば、エンジンの点火装置を作動させる点火信号や、エンジンの燃料噴射弁を作動させる噴射信号や、A/D変換器を起動させる起動信号や、マイコンにて割り込み処理を起動させるための割込み要求信号など、エンジン制御を行うための様々な信号が考えられる。   In addition to the CPU 13 that executes various processes for controlling the engine, the microcomputer 11 includes a frequency dividing circuit 15, a pulse interval counter 17, a count as means for outputting a control signal in synchronization with the rotation of the crankshaft. A value register 19, a multiplication operation unit 21, a multiplication counter 23, an angle counter 25, a setting value register 27, a signal output unit 29, an AND (AND) circuit 31, and a NAND (NAND) circuit 33 are provided. Control signals include, for example, an ignition signal for operating an engine ignition device, an injection signal for operating an engine fuel injection valve, an activation signal for starting an A / D converter, and an interrupt process by a microcomputer. Various signals for performing engine control, such as an interrupt request signal for starting, can be considered.

ここで、分周回路15は、高周波の内部クロックをCPU13から指令される分周比で分周して複数通り(本第1実施形態では、16MHz,32MHz,64MHz,及び128MHzの4通り)の周波数の計測用クロックCLKを出力する。尚、この計測用クロックCLKの周期は、何れも、エンジンの全運転領域における10°CA分の時間より短い。   Here, the frequency dividing circuit 15 divides a high-frequency internal clock by a frequency dividing ratio commanded from the CPU 13 to provide a plurality of types (in the first embodiment, four types of 16 MHz, 32 MHz, 64 MHz, and 128 MHz). The frequency measurement clock CLK is output. Note that the period of the measurement clock CLK is shorter than the time of 10 ° CA in the entire operation region of the engine.

パルス間隔カウンタ17は、分周回路15から出力される計測用クロックCLK(本実施形態では立ち上がりエッジ)によってアップカウントするカウンタである。そして、入力される角度信号に10°CA毎の立ち上がりエッジ(特定エッジに相当)が発生すると、その時点でのパルス間隔カウンタ17のカウント値がカウント値レジスタ19にセットされると共に、そのセット直後に当該パルス間隔カウンタ17がリセットされる。   The pulse interval counter 17 is a counter that counts up by the measurement clock CLK (rising edge in the present embodiment) output from the frequency dividing circuit 15. When a rising edge (corresponding to a specific edge) occurs every 10 ° CA in the input angle signal, the count value of the pulse interval counter 17 at that time is set in the count value register 19 and immediately after the setting. At the same time, the pulse interval counter 17 is reset.

このため、パルス間隔カウンタ17は、角度信号に立ち上がりエッジが発生してから同エッジが次に発生するまでの1パルス間隔毎(10°CA毎)に、計測用クロックCLKの周期で0からアップカウント動作を行うこととなる。そして、このパルス間隔カウンタ17のカウント値が、角度信号の1パルス間隔(つまり、10°CA分の時間)の計測値Tとして、カウント値レジスタ19に出力される。   For this reason, the pulse interval counter 17 increases from 0 at the cycle of the measurement clock CLK every pulse interval (every 10 ° CA) from the occurrence of the rising edge to the angle signal until the next occurrence of the edge. A count operation is performed. The count value of the pulse interval counter 17 is output to the count value register 19 as a measurement value T of one pulse interval of the angle signal (that is, a time corresponding to 10 ° CA).

逓倍演算部21は、カウント値レジスタ19にセットされた最新の計測値Tを、予め設定されている逓倍数N(本第1実施形態では256)で除算して、その除算の商の整数値(整数部分)Mを記憶する。そして、この逓倍演算部21に記憶された整数値Mは、逓倍カウンタ23の初期値となる。   The multiplication operation unit 21 divides the latest measured value T set in the count value register 19 by a preset multiplication number N (256 in the first embodiment), and an integer value of the quotient of the division (Integer part) M is stored. The integer value M stored in the multiplication operation unit 21 becomes the initial value of the multiplication counter 23.

逓倍カウンタ23は、分周回路15から出力される計測用クロックCLK(本実施形態では立ち上がりエッジ)によってダウンカウントするカウンタである。そして、逓倍カウンタ23は、そのカウント値が1から0になると、逓倍クロックの立ち上がりを発生させると共に、そのカウント値が逓倍演算部21に記憶されている整数値Mに初期化されるようになっている。   The multiplication counter 23 is a counter that counts down by the measurement clock CLK (rising edge in this embodiment) output from the frequency dividing circuit 15. When the count value is changed from 1 to 0, the multiplication counter 23 generates a rising edge of the multiplied clock, and the count value is initialized to the integer value M stored in the multiplication operation unit 21. ing.

このため、逓倍カウンタ23からは、周期が「計測用クロックCLKの周期×M」であって、周期が角度信号の1パルス間隔のほぼ1/N(=1/256)である逓倍クロック(逓倍信号に相当)が出力されることとなる。   For this reason, the multiplication counter 23 indicates that the cycle is “cycle of measurement clock CLK × M” and the cycle is approximately 1 / N (= 1/256) of one pulse interval of the angle signal (multiplication). (Corresponding to the signal) is output.

次に、角度カウンタ25は、上位8ビットの上位カウンタ25aと、下位8ビットの下位カウンタ25bとからなっている。
そして、上位カウンタ25aは、角度信号の立ち上がりエッジによってアップカウントする(図4参照)。
Next, the angle counter 25 includes an upper counter 25a with upper 8 bits and a lower counter 25b with lower 8 bits.
The upper counter 25a counts up on the rising edge of the angle signal (see FIG. 4).

また、下位カウンタ25bは、逓倍カウンタ23からの逓倍クロック(本実施形態では立ち上がりエッジ)によってアップカウントすると共に、角度信号に立ち上がりエッジが発生するとクリア(リセット)されるが、この下位カウンタ25bには、逓倍カウンタ23からの逓倍クロックが2入力のAND回路31を介して供給されるようになっている。そして、そのAND回路31の入力端子のうち、逓倍カウンタ23からの逓倍クロックが入力される入力端子とは異なる方の入力端子には、下位カウンタ25bの8ビットb0〜b7の否定論理積をとるNAND回路33の出力信号が入力されている。尚、b0が1ビット目(最下位ビット)であり、b7が8ビット目である。   The lower counter 25b counts up by the multiplication clock from the multiplication counter 23 (rising edge in the present embodiment) and is cleared (reset) when a rising edge occurs in the angle signal. The multiplication clock from the multiplication counter 23 is supplied via a 2-input AND circuit 31. Of the input terminals of the AND circuit 31, the negative input of the 8 bits b0 to b7 of the lower counter 25b is taken at the input terminal different from the input terminal to which the multiplied clock from the multiplication counter 23 is input. An output signal of the NAND circuit 33 is input. Note that b0 is the first bit (least significant bit) and b7 is the eighth bit.

このため、下位カウンタ25bは、逓倍クロックの立ち上がりエッジによってアップカウント動作すると共に、角度信号に立ち上がりエッジが発生する毎にクリアされるが、もし、角度信号に立ち上がりエッジが発生する前(つまり、上位カウンタ25aがカウントアップされる前)に、当該下位カウンタ25bの値が255(16進数でFF)に達したならば、NAND回路33の出力がローレベルになってAND回路31から逓倍クロックが出力されなくなるため、そのカウント値(b0〜b8からなる8ビットデータ値)は、角度信号が次に立ち上がるまで255にガードされることとなる。   For this reason, the lower counter 25b performs an up-count operation by the rising edge of the multiplied clock and is cleared every time a rising edge occurs in the angle signal. However, before the rising edge occurs in the angle signal (that is, the upper counter) If the value of the lower counter 25b reaches 255 (hexadecimal FF) before the counter 25a is counted up), the output of the NAND circuit 33 becomes low level, and the AND circuit 31 outputs the multiplied clock. Therefore, the count value (8-bit data value consisting of b0 to b8) is guarded to 255 until the angle signal rises next time.

一方、設定値レジスタ27には、CPU13により、クランク角(クランク軸の回転角度)を指定した16ビットの設定値がセットされる。
そして、信号出力部29は、角度カウンタ25のカウント値(上位カウンタ25aの8ビットと下位カウンタ25bの8ビットとからなる合計16ビットのデータ値)が、設定値レジスタ27にセットされている設定値と一致したら制御信号を出力する。
On the other hand, in the setting value register 27, the CPU 13 sets a 16-bit setting value designating the crank angle (crankshaft rotation angle).
Then, the signal output unit 29 is configured so that the count value of the angle counter 25 (data value of 16 bits in total consisting of 8 bits of the upper counter 25a and 8 bits of the lower counter 25b) is set in the setting value register 27. If it matches the value, a control signal is output.

尚、制御信号の出力方法としては、カウント値=設定値となる毎に、制御信号の出力レベルを反転させたり、制御信号を一定時間だけハイレベル又はローレベルにする、といったものがあるが、本実施形態では、制御信号の出力レベルを反転させるようにしている。また、信号出力部29は、角度カウンタ25のカウント値と設定値レジスタ27にセットされている設定値とを大小比較して、カウント値≧設定値であったら制御信号を出力するように構成しても良い。一方、図示は省略しているが、設定値レジスタ27及び信号出力部29は、マイコン11から出力される制御信号毎にそれぞれ設けられている。   In addition, as the output method of the control signal, there is a method of inverting the output level of the control signal every time the count value = the set value, or setting the control signal to the high level or the low level for a certain time, In this embodiment, the output level of the control signal is inverted. The signal output unit 29 compares the count value of the angle counter 25 with the set value set in the set value register 27 and outputs a control signal if the count value ≧ the set value. May be. On the other hand, although not shown, the set value register 27 and the signal output unit 29 are provided for each control signal output from the microcomputer 11.

次に、CPU13が計測用クロックCLKの周波数(以下、サンプリング周波数ともいう)を変更するために実行する処理について、図2のフローチャートを用いて説明する。
まず図2(A)は、角度信号の立ち上がりタイミングのうち、エンジン回転数を算出すべきタイミングとして定められた特定のクランク角のタイミング毎(本実施形態では120°CA毎)に実行される回転数算出処理を表すフローチャートである。
Next, processing executed by the CPU 13 to change the frequency of the measurement clock CLK (hereinafter also referred to as sampling frequency) will be described with reference to the flowchart of FIG.
First, FIG. 2A shows the rotation executed at each specific crank angle timing (in this embodiment, every 120 ° CA) determined as the timing at which the engine speed should be calculated among the rising timings of the angle signal. It is a flowchart showing a number calculation process.

この回転数算出処理の実行が開始されると、まずS110にて、当該処理の前回の起動時刻から今回の起動時刻までの時間(つまり、120°CA分の時間)に基づき、エンジン回転数を算出する。   When the execution of the rotation speed calculation process is started, first, in S110, the engine rotation speed is calculated based on the time from the previous start time of the process to the current start time (that is, the time of 120 ° CA). calculate.

次に、S120にて、今回算出したエンジン回転数と、現在のサンプリング周波数(即ち、分周回路15に現在出力させている計測用クロックCLKの周波数)とから、そのサンプリング周波数を変更する必要があるか否かを判断する。   Next, in S120, it is necessary to change the sampling frequency from the currently calculated engine speed and the current sampling frequency (that is, the frequency of the measurement clock CLK currently output to the frequency dividing circuit 15). Judge whether there is.

具体的に説明すると、マイコン11内のROM(図示省略)には、図3の上段の如くエンジン回転数とサンプリング周波数との関係を示した回転数対周波数データマップが記憶されている。そして、S120では、その回転数対周波数データマップにおいて今回算出のエンジン回転数に対応するサンプリング周波数を読み込み、その読み込んだサンプリング周波数と、現在のサンプリング周波数とが異なっていれば、サンプリング周波数を変更する必要があると判断する。   Specifically, the ROM (not shown) in the microcomputer 11 stores a rotation speed vs. frequency data map showing the relationship between the engine speed and the sampling frequency as shown in the upper part of FIG. In S120, a sampling frequency corresponding to the engine speed calculated this time is read in the rotation speed versus frequency data map, and if the read sampling frequency is different from the current sampling frequency, the sampling frequency is changed. Judge that it is necessary.

尚、図3の上段に示すように、回転数対周波数データマップは、エンジン回転数が高い場合ほどサンプリング周波数が高くなるように(換言すれば、計測用クロックCLKの周期が短くなるように)設定されている。また、回転数対周波数データマップは、図3の下段に示すように、逓倍クロックの周期の誤差(角度信号の1パルス間隔を1/Nにした本当の時間に対する誤差)の最大値が2%以下となるように設定されている。そして更に、この回転数対周波数データマップでは、サンプリング周波数が変更される回転数付近でサンプリング周波数の切り換えが頻繁に行われてしまうことがないように、ヒステリシスが設けられている。   As shown in the upper part of FIG. 3, in the rotation speed vs. frequency data map, the higher the engine speed, the higher the sampling frequency (in other words, the shorter the cycle of the measurement clock CLK). Is set. Further, as shown in the lower part of FIG. 3, the rotation speed vs. frequency data map shows that the maximum value of the error of the multiplied clock cycle (the error with respect to the real time when 1 pulse interval of the angle signal is 1 / N) is 2%. It is set to be as follows. Furthermore, in this rotation speed vs. frequency data map, hysteresis is provided so that the sampling frequency is not frequently switched around the rotation speed at which the sampling frequency is changed.

そして、S120にて、サンプリング周波数を変更する必要がないと判断した場合には、そのまま当該回転数算出処理を終了するが、サンプリング周波数を変更する必要があると判断した場合には(S120:YES)、S130に進んで、変更すべき新たなサンプリング周波数(つまり、S120で回転数対周波数データマップから読み込んだサンプリング周波数)を記憶する。そして更に、続くS140にて、フラグFaに“1”をセットした後、当該回転数算出処理を終了する。   If it is determined in S120 that the sampling frequency does not need to be changed, the rotation speed calculation process is terminated as it is, but if it is determined that the sampling frequency needs to be changed (S120: YES) In step S130, the new sampling frequency to be changed (that is, the sampling frequency read from the rotation speed versus frequency data map in step S120) is stored. Further, in the subsequent S140, after setting “1” to the flag Fa, the rotation speed calculation process is ended.

次に、図2(B)は、図2(A)の回転数算出処理が終了した後、次の角度信号の立ち上がりタイミングで実行される周波数変更処理を表すフローチャートである。
この周波数変更処理の実行が開始されると、まずS210にて、フラグFaが“1”であるか否かを判定し、フラグFaが“1”でなければ、そのまま当該周波数変更処理を終了するが、フラグFaが“1”であれば(S210:YES)、S220に進む。
Next, FIG. 2B is a flowchart showing a frequency change process executed at the rising timing of the next angle signal after the rotation speed calculation process of FIG.
When the execution of the frequency changing process is started, it is first determined in S210 whether or not the flag Fa is “1”. If the flag Fa is not “1”, the frequency changing process is terminated as it is. However, if the flag Fa is “1” (S210: YES), the process proceeds to S220.

そして、S220では、図2(A)のS130で記憶されたサンプリング周波数を読み出し、そのサンプリング周波数の計測用クロックCLKが分周回路15から出力されるように、該分周回路15へ指令する分周比を切り換える。そして更に、続くS230にて、フラグFaをクリア(フラグFaに“0”をセット)し、その後、当該周波数変更処理を終了する。   Then, in S220, the sampling frequency stored in S130 of FIG. 2A is read out, and the dividing circuit 15 is instructed to output the measurement clock CLK of the sampling frequency from the dividing circuit 15. Change the ratio. Further, in subsequent S230, the flag Fa is cleared (“0” is set in the flag Fa), and then the frequency changing process is terminated.

尚、イグニッションスイッチのオンに伴いエンジン制御装置に電源が投入されてマイコン11が動作を開始した際のサンプリング周波数(つまり、サンプリング周波数の初期値)は、図3からも分かるように最も低い16MHzに設定される。   Note that the sampling frequency (that is, the initial value of the sampling frequency) when the microcomputer 11 starts operating when the engine control device is turned on with the ignition switch turned on is the lowest 16 MHz as can be seen from FIG. Is set.

また、制御信号として、例えば点火装置を駆動するための点火信号を出力するものとすると、CPU13は、角度信号や図示しない気筒判別信号等の情報から、その点火信号の出力レベルを反転させるべきクランク角を算出して、そのクランク角に相当する設定値を設定値レジスタ27にセットする。   If the control signal is to output, for example, an ignition signal for driving the ignition device, the CPU 13 determines the crank signal whose output level is to be inverted from information such as an angle signal and a cylinder discrimination signal (not shown). The angle is calculated, and a set value corresponding to the crank angle is set in the set value register 27.

このようなエンジン制御装置のマイコン11では、図4に示すように、角度信号の立ち上がり毎に、角度カウンタ25の上位8ビット(上位カウンタ25aの値)が1ずつアップすると共に、角度カウンタの下位8ビット(下位カウンタ25bの値)が逓倍クロックによって0から1ずつアップする。このため、角度カウンタ25の合計16ビットのカウント値は、逓倍クロックによって1ずつアップすると共に、角度信号が立ち上がる毎に256の整数倍の値に補正されることとなる。そして、角度カウンタ25のカウント値と設定値レジスタ27内の設定値とが一致したら制御信号が出力されることとなる。   In the microcomputer 11 of such an engine control device, as shown in FIG. 4, every time the angle signal rises, the upper 8 bits (value of the upper counter 25a) of the angle counter 25 are incremented by 1 and the lower order of the angle counter Eight bits (value of the lower counter 25b) are incremented from 0 by 1 by the multiplication clock. For this reason, the total 16-bit count value of the angle counter 25 is incremented by 1 by the multiplication clock, and is corrected to an integer multiple of 256 each time the angle signal rises. When the count value of the angle counter 25 matches the set value in the set value register 27, a control signal is output.

そして特に、本実施形態のマイコン11では、サンプリング周波数(計測用クロックCLKの周波数)を、エンジン回転数に応じて、低回転時には低くし、高回転時には高くするようにしている。例えば、図4に示すように、エンジン回転数が1500rpmの場合には、サンプリング周波数が16MHzに設定される。そして、エンジン回転数が2100rpmよりも高く(この例では2500rpm)になり、そのことが図2(A)の回転数算出処理で検出されると、角度信号の次の立ち上がりタイミングで実行される図2(B)の周波数変更処理により、サンプリング周波数が16MHzよりも高い周波数(この例では32MHz)に変更されることとなる(図3参照)。   In particular, in the microcomputer 11 of the present embodiment, the sampling frequency (frequency of the measurement clock CLK) is set to be low at low speed and high at high speed according to the engine speed. For example, as shown in FIG. 4, when the engine speed is 1500 rpm, the sampling frequency is set to 16 MHz. Then, when the engine speed becomes higher than 2100 rpm (2500 rpm in this example), and this is detected by the rotational speed calculation process of FIG. 2A, the chart is executed at the next rising timing of the angle signal. By the frequency change process 2 (B), the sampling frequency is changed to a frequency higher than 16 MHz (in this example, 32 MHz) (see FIG. 3).

尚、本第1実施形態では、パルス間隔カウンタ17と逓倍カウンタ23とに、分周回路15からの計測用クロックCLKが入力されており、その計測用クロックCLKの周波数(サンプリング周波数)を角度信号の立ち上がりタイミングで変更するようにしているため、そのサンプリング周波数の変更タイミングから角度信号が次に立ち上がるまでの10°CAの期間(以下、周波数変更直後の10°CA期間という)だけは、逓倍カウンタ23から出力される逓倍クロックの周期が、10°CA分の時間を1/Nした正常な時間からずれてしまう。例えば、サンプリング周波数を2倍に変更した場合には、周波数変更直後の10°CA期間だけ、逓倍クロックの周期が1/2になってしまい、サンプリング周波数を1/2倍に変更した場合には、周波数変更直後の10°CA期間だけ、逓倍クロックの周期が2倍になってしまう。   In the first embodiment, the measurement clock CLK from the frequency dividing circuit 15 is input to the pulse interval counter 17 and the multiplication counter 23, and the frequency (sampling frequency) of the measurement clock CLK is set as an angle signal. Therefore, the multiplication counter is used only for a period of 10 ° CA from the change timing of the sampling frequency to the next rise of the angle signal (hereinafter referred to as a 10 ° CA period immediately after the frequency change). The frequency of the multiplied clock output from the output 23 shifts from a normal time obtained by reducing the time corresponding to 10 ° CA by 1 / N. For example, when the sampling frequency is changed to twice, the frequency of the multiplied clock is halved only during the 10 ° CA period immediately after the frequency change, and when the sampling frequency is changed to ½ times. In the 10 ° CA period immediately after the frequency change, the frequency of the multiplied clock is doubled.

しかし、このような現象が発生しても、本第1実施形態では、制御信号を周波数変更直後の10°CA期間中には出力しない(つまり、その期間内のクランク角を示す設定値を設定値レジスタ27に設定しない)ようになっていることと、前述したように角度カウンタ25のカウント値は角度信号が立ち上がる毎に256の整数倍の値に補正されることから、何も問題は生じない。   However, even if such a phenomenon occurs, in the first embodiment, the control signal is not output during the 10 ° CA period immediately after the frequency change (that is, a set value indicating the crank angle within that period is set). The value is not set in the value register 27), and the count value of the angle counter 25 is corrected to an integer multiple of 256 every time the angle signal rises as described above. Absent.

また、このような現象自体が発生しないようにするためには、例えば下記の(a)又は(b)のようにすれば良い。
(a):サンプリング周波数をQ倍に変更したとすると、周波数変更直後の10°CA期間だけ、逓倍カウンタ23にセットされる初期値を、上記整数値MをQ倍した値(=M×Q)に変更する。つまり、逓倍カウンタ23に入力される計測用クロックCLKの周期が1/Qになった分、その逓倍カウンタ23がダウンカウントする値をQ倍にすることで、周波数変更直後の10°CA期間における逓倍クロックの周期ずれを是正するのである。
In order to prevent such a phenomenon from occurring, for example, the following (a) or (b) may be performed.
(A): If the sampling frequency is changed to Q times, an initial value set in the multiplication counter 23 is a value obtained by multiplying the integer value M by Q (= M × Q) during the 10 ° CA period immediately after the frequency change. ). In other words, the value that the multiplication counter 23 counts down by Q is multiplied by the amount corresponding to the period of the measurement clock CLK input to the multiplication counter 23 being 1 / Q, so that the 10 ° CA period immediately after the frequency change. This corrects the period shift of the multiplied clock.

(b):まず、分周回路15と同様の第2の分周回路を設け、逓倍カウンタ23には、その第2の分周回路から、カウント動作用のクロックが入力されるようにする。
そして、CPU13は、通常時においては、分周回路15と上記第2の分周回路との両方が同じ周波数のクロックを出力するように指令するが、分周回路15からパルス間隔カウンタ17へのクロックの周波数を図2(B)のS220で変更すると、角度信号の次の立ち上がりタイミングで、上記第2の分周回路から逓倍カウンタ23へのクロックの周波数を、パルス間隔カウンタ17へのクロックと同じ周波数に変更する。つまり、逓倍カウンタ23へのクロックの周波数は、パルス間隔カウンタ17へのクロックの周波数を変更してから10°CA後(角度信号の1パルス間隔後)に変更するのである。そして、このように構成しても、周波数変更直後の10°CA期間における逓倍クロックの周期ずれをなくすことができる。
(B): First, a second frequency dividing circuit similar to the frequency dividing circuit 15 is provided, and a clock for counting operation is input to the multiplication counter 23 from the second frequency dividing circuit.
The CPU 13 instructs the frequency dividing circuit 15 and the second frequency dividing circuit to output clocks having the same frequency in the normal time. When the clock frequency is changed in S220 of FIG. 2B, the clock frequency from the second frequency divider circuit to the multiplication counter 23 is changed to the clock to the pulse interval counter 17 at the next rising timing of the angle signal. Change to the same frequency. That is, the frequency of the clock to the multiplication counter 23 is changed after 10 ° CA (after one pulse interval of the angle signal) after changing the frequency of the clock to the pulse interval counter 17. And even if comprised in this way, the period shift | offset | difference of the multiplication clock in the 10 degree CA period immediately after a frequency change can be eliminated.

以上のような制御信号処理装置としてのマイコン11によれば、エンジン回転数に拘わらず角度カウンタ25のカウント値とクランク角との対応を正確なものにすることができ、制御信号を精度良く出力することができるようになる。   According to the microcomputer 11 as the control signal processing apparatus as described above, the correspondence between the count value of the angle counter 25 and the crank angle can be made accurate regardless of the engine speed, and the control signal can be output with high accuracy. Will be able to.

つまり、角度カウンタ25の1カウント分の時間である逓倍クロックの周期には、最大で「(逓倍数N−1)/パルス間隔カウンタ17による角度信号の1パルス間隔分のカウント値T」だけの誤差が生じるが、角度信号の1パルス間隔の時間(10°CA分の時間)が長い低回転時よりも、その時間が短くなる高回転時の方が、サンプリング周波数を高くする(計測用クロックCLKの周期を短くする)ことにより、低回転時と高回転時とで、パルス間隔カウンタ17のカウント値Tに大差が生じないようにすることができ、その結果、高回転時においても、逓倍クロックの周期誤差を小さく抑えることができる。そして、逓倍クロックの周期誤差が小さくなれば、角度カウンタ25のカウント値とクランク角との対応が一層正確になり、そのカウント値に基づき出力される制御信号の出力精度が向上するのである。   That is, the period of the multiplied clock, which is the time for one count of the angle counter 25, is only “(multiplier number N−1) / count value T for one pulse interval of the angle signal by the pulse interval counter 17”. Although an error occurs, the sampling frequency is increased at the time of high rotation at which the time is shorter than at low rotation at which the time of one pulse interval of the angle signal (time of 10 ° CA) is long (clock for measurement). By shortening the period of CLK), it is possible to prevent a large difference in the count value T of the pulse interval counter 17 between the low rotation speed and the high rotation speed. As a result, the multiplication is performed even at the high rotation speed. The clock cycle error can be kept small. If the cycle error of the multiplied clock is reduced, the correspondence between the count value of the angle counter 25 and the crank angle becomes more accurate, and the output accuracy of the control signal output based on the count value is improved.

例えば、逓倍数Nが256でサンプリング周波数が16MHzに固定されているとすると、「発明が解決しようとする課題」の欄で述べたように、エンジン回転数が10000rpm付近の9473rpmである場合には、逓倍クロックの周期誤差が9.1%にもなるが、仮に、サンプリング周波数を10倍の160MHzにしたならば、その誤差は、約0.91%に低減されることとなる。詳しくは、エンジン回転数が9473rpm付近で、且つ、サンプリング周波数が160MHzとすると、逓倍クロックの周期誤差が最大となるのは、パルス間隔カウンタ17のカウント値Tが28159(=256×109+255)となる9470rpmのときであり、その場合の誤差は、255/28159=0.91%になる。尚、このことを、「発明が解決しようとする課題」の欄で述べた内容と共にまとめると、図5のようになる。但し、この図5では、サンプリング周期が16MHzで逓倍数Nを16にした場合についても併せて記載している。   For example, assuming that the multiplication number N is 256 and the sampling frequency is fixed at 16 MHz, as described in the column “Problems to be solved by the invention”, when the engine speed is 9473 rpm near 10,000 rpm, The period error of the multiplied clock is 9.1%, but if the sampling frequency is increased to 160 MHz, which is 10 times, the error is reduced to about 0.91%. Specifically, when the engine speed is around 9473 rpm and the sampling frequency is 160 MHz, the cycle error of the multiplied clock becomes the maximum when the count value T of the pulse interval counter 17 is 28159 (= 256 × 109 + 255). 9470 rpm, and the error in that case is 255/28159 = 0.91%. This can be summarized together with the contents described in the column “Problems to be solved by the invention” as shown in FIG. However, FIG. 5 also shows a case where the sampling period is 16 MHz and the multiplication number N is 16.

しかも、このマイコン11によれば、角度信号の1パルス間隔が長くなる低回転時には、サンプリング周波数が低く設定されるため、パルス間隔カウンタ17がカウントすべき最大値が必要以上に大きくなってしまうこともない。また、サンプリング周波数を高くすると、パルス間隔カウンタ17や逓倍カウンタ23のカウント動作が早くなるため消費電力が大きくなるが、本マイコン11では、エンジン始動時などの低回転時にはサンプリング周波数が低く設定されることとなるため、そのような低回転時での消費電力を抑えることができる。   In addition, according to the microcomputer 11, since the sampling frequency is set low at the time of low rotation in which one pulse interval of the angle signal is long, the maximum value that the pulse interval counter 17 should count becomes larger than necessary. Nor. Further, if the sampling frequency is increased, the counting operation of the pulse interval counter 17 and the multiplication counter 23 is accelerated, so that the power consumption increases. However, in this microcomputer 11, the sampling frequency is set to be low at the time of low rotation such as when the engine is started. As a result, the power consumption at the time of such low rotation can be suppressed.

尚、本第1実施形態では、パルス間隔カウンタ17が計測手段に相当し、カウント値レジスタ19,逓倍演算部21,及び逓倍カウンタ23が逓倍信号生成手段に相当し、角度カウンタ25が角度カウンタに相当している。また、計測用クロックCLKの周期が計測用周期に相当している。そして、図2(A)におけるS120〜S140の処理と図2(B)の処理とが、計測用周期変更手段に相当している。   In the first embodiment, the pulse interval counter 17 corresponds to the measurement means, the count value register 19, the multiplication operation unit 21, and the multiplication counter 23 correspond to the multiplication signal generation means, and the angle counter 25 serves as the angle counter. It corresponds. Further, the cycle of the measurement clock CLK corresponds to the measurement cycle. And the process of S120-S140 in FIG. 2 (A) and the process of FIG. 2 (B) are equivalent to the period change means for a measurement.

また、上記第1実施形態では、サンプリング周波数を、大きいものが小さいものの2Y倍(Yは1以上の整数)の関係にある4通り(16,32,64,128MHz)の何れかに切り換えるように構成したが、そのような大小関係でない複数通りの周波数の何れかに切り換えるようにしても良い。但し、2Y倍の関係にある複数通りの周波数を作り出すのは、それ以外の関係にある周波数を作り出すよりも簡単であるため、上記実施形態のように構成した方が回路を簡略化することができ有利である。 In the first embodiment, the sampling frequency is switched to any one of four (16, 32, 64, and 128 MHz) having a relationship of 2 Y times (Y is an integer of 1 or more) that is larger but smaller. However, the frequency may be switched to any one of a plurality of frequencies that are not such a magnitude relationship. However, since it is easier to create a plurality of frequencies having a 2 Y- fold relationship than to create a frequency having any other relationship, the circuit can be simplified when configured as in the above embodiment. This is advantageous.

次に、第2実施形態のエンジン制御装置に搭載されたマイコンについて説明する。
まず図6は、第2実施形態のマイコン41の構成を表す構成図である。尚、図6において、図1と同様の構成要素については同一の符号を付しているため、詳細な説明は省略する。
Next, a microcomputer mounted on the engine control apparatus of the second embodiment will be described.
First, FIG. 6 is a block diagram showing the configuration of the microcomputer 41 of the second embodiment. In FIG. 6, the same components as those in FIG. 1 are denoted by the same reference numerals, and detailed description thereof is omitted.

図6に示すように、第2実施形態のマイコン41は、第1実施形態のマイコン11と比較すると、下記の(1)〜(6)の点が異なっている。
(1):分周回路15は、1種類の周波数(本第2実施形態では16MHz)の計測用クロックCLKを出力する。
As shown in FIG. 6, the microcomputer 41 of the second embodiment differs from the microcomputer 11 of the first embodiment in the following points (1) to (6).
(1): The frequency dividing circuit 15 outputs a measurement clock CLK having one kind of frequency (16 MHz in the second embodiment).

(2):逓倍数NがCPU13によってセットされる逓倍数レジスタ43が設けられている。そして、逓倍演算部21は、パルス間隔カウンタ17からカウント値レジスタ19にセットされた最新の計測値Tを、逓倍数レジスタ43にセットされている逓倍数N(本第2実施形態では、256,128,64,32の4通りのうちの何れか:図9参照)で除算して、その除算の商の整数値Mを記憶する。尚、本第2実施形態においても、この逓倍演算部21に記憶された整数値Mが、逓倍カウンタ23のダウンカウントの初期値となる。   (2): A multiplication number register 43 in which the multiplication number N is set by the CPU 13 is provided. Then, the multiplication calculation unit 21 uses the latest measurement value T set in the count value register 19 from the pulse interval counter 17 as the multiplication number N (256, 256 in the second embodiment). Divide by any one of 128, 64, and 32 (see FIG. 9), and store the integer value M of the quotient of the division. In the second embodiment as well, the integer value M stored in the multiplication operation unit 21 becomes the initial value of the downcount of the multiplication counter 23.

(3):クロック経路切り換え回路45が設けられている。そして、このクロック経路切り換え回路45は、逓倍カウンタ23からAND回路31を介して出力される逓倍クロックを、逓倍数レジスタ43にセットされた逓倍数Nに応じて、角度カウンタ25の下位カウンタ25bを構成する各ビット毎のカウント手段のうち、下位4ビットb0〜b3のカウント手段の何れかのクロック端子に入力する。   (3): A clock path switching circuit 45 is provided. Then, the clock path switching circuit 45 sends the multiplied clock output from the multiplication counter 23 via the AND circuit 31 to the lower counter 25b of the angle counter 25 according to the multiplication number N set in the multiplication number register 43. Of the counting means for each bit constituting, it is inputted to one of the clock terminals of the counting means of the lower 4 bits b0 to b3.

具体的に説明すると、まず、下位カウンタ25bは、図7に示すように、自己のデータ端子とQバー出力端子とが接続された8個のDフリップフロップFF0〜FF7からなる非同期式256進カウンタ(8ビットカウンタ)の構成を有している。尚、その8個のDフリップフロップFF0〜FF7が、各ビットb0〜b7毎のカウント手段に相当する。また、図7において、6段目と7段目のDフリップフロップFF5,FF6は、図示を省略している。   More specifically, first, as shown in FIG. 7, the low-order counter 25b is an asynchronous 256-ary counter composed of eight D flip-flops FF0 to FF7 connected to its own data terminal and Q-bar output terminal. (8-bit counter). The eight D flip-flops FF0 to FF7 correspond to counting means for each bit b0 to b7. In FIG. 7, the sixth and seventh D flip-flops FF5 and FF6 are not shown.

そして、クロック経路切り換え回路45は、AND回路31の出力端子に接続された信号ライン(即ち、逓倍クロックが伝搬される信号ライン)47と1段目のDフリップフロップFF0のクロック端子との接続/非接続を切り換えるスイッチSW0と、2段目のDフリップフロップFF1のクロック端子を1段目のDフリップフロップFF0のQバー出力端子と上記信号ライン47との何れかに接続させるスイッチSW1と、3段目のDフリップフロップFF2のクロック端子を2段目のDフリップフロップFF1のQバー出力端子と上記信号ライン47との何れかに接続させるスイッチSW2と、4段目のDフリップフロップFF3のクロック端子を3段目のDフリップフロップFF2のQバー出力端子と上記信号ライン47との何れかに接続させるスイッチSW3とを備えている。尚、以下の説明において、スイッチSW0〜SW3のオンとは、そのスイッチに対応するDフリップフロップのクロック端子が信号ライン47に接続される方のことを意味している。   The clock path switching circuit 45 connects / connects the signal line 47 connected to the output terminal of the AND circuit 31 (that is, the signal line through which the multiplied clock is propagated) and the clock terminal of the first stage D flip-flop FF0. A switch SW0 for switching the connection; a switch SW1 for connecting the clock terminal of the second-stage D flip-flop FF1 to either the Q-bar output terminal of the first-stage D flip-flop FF0 and the signal line 47; A switch SW2 that connects the clock terminal of the second stage D flip-flop FF2 to either the Q-bar output terminal of the second stage D flip-flop FF1 or the signal line 47, and the clock of the fourth stage D flip-flop FF3 The terminal is either the Q-bar output terminal of the third stage D flip-flop FF2 or the signal line 47. And a switch SW3 which is connected. In the following description, turning on the switches SW0 to SW3 means that the clock terminal of the D flip-flop corresponding to the switch is connected to the signal line 47.

そして更に、逓倍数レジスタ43にセットされた逓倍数Nが、2n(nは5〜8の各整数)で表される4通りの数値(32=25,64=26,128=27,256=28)のうちの2p(pは5〜8の何れか)であるとし、また、スイッチSW0を1番目、スイッチSW1を2番目、スイッチSW2を3番目、スイッチSW3を4番目とすると、クロック経路切り換え回路45は、逓倍数レジスタ43にセットされた逓倍数N(=2p)に応じて、スイッチSW0〜SW3のうち「9−p」番目のスイッチだけをオンさせる。尚、図7は、逓倍数レジスタ43にセットされた逓倍数Nが256である場合の接続状態(つまり、スイッチSW0だけがオンされている状態)を表しており、この接続状態は、第1実施形態の場合のものと同じである。 Further, the multiplication number N set in the multiplication number register 43 is represented by 4 n values (32 = 2 5 , 64 = 2 6 , 128 = 2) represented by 2 n (n is an integer of 5 to 8). 7, 256 = the 2 p (p of 2 8) and is any) of 5-8, also the first switch SW0, 2-th switches SW1, 3-th switch SW2, a switch SW3 4 Assuming that the clock path is switched, the clock path switching circuit 45 turns on only the “9-p” -th switch among the switches SW0 to SW3 in accordance with the multiplication number N (= 2 p ) set in the multiplication register 43. FIG. 7 shows the connection state when the multiplication number N set in the multiplication number register 43 is 256 (that is, the state where only the switch SW0 is turned on). The same as in the case of the embodiment.

よって、下位カウンタ25bでは、逓倍数レジスタ43にセットされた逓倍数Nが2p(pは5〜8の何れか)であれば、最上位ビットから数えてpビット目(最下位ビットから数えたならば「9−p」ビット目)が、逓倍クロックに応じたカウント動作の最下位ビットとなる。つまり、下位カウンタ25bにおいて、最上位ビットから数えてpビット目よりも下位のビットは変化せずに、そのpビット目と該pビット目よりも上位のビットからなる部分が、逓倍クロックに応じてカウントアップ動作することとなる。 Thus, the lower counter 25b, if the multiplication factor N set in the multiplication factor register 43 is 2 p (p is any of 5-8), counted from the p-th bit (least significant bit counted from the highest bit In this case, the “9-p” bit) is the least significant bit of the count operation corresponding to the multiplied clock. That is, in the lower counter 25b, the bits lower than the p-th bit counted from the most significant bit do not change, and the portion composed of the p-th bit and the higher-order bits than the p-th bit corresponds to the multiplied clock. Counting up.

このため、逓倍数レジスタ43にセットされる逓倍数Nが「32,64,128,256」のうちの何れに変更されても、角度カウンタ25のLSB(下位カウンタ25bの1ビット目bo)が示す重み(クランク角分解能)は、常に、逓倍数Nが256(=28)である場合の重み(=10°CA/256)となり、角度カウンタ25のカウント値の連続性を確実に保つことができる。 For this reason, the LSB of the angle counter 25 (the first bit bo of the lower counter 25b) is changed regardless of which of the “32, 64, 128, 256” the multiplication number N set in the multiplication number register 43 is changed to. The weight (crank angle resolution) shown is always the weight (= 10 ° CA / 256) when the multiplication number N is 256 (= 2 8 ), and the continuity of the count value of the angle counter 25 is reliably maintained. Can do.

(4):入力切り換え回路49が設けられている。そして、この入力切り換え回路49は、NAND回路33の入力端子のうち、下位カウンタ25bの下位3ビットb0〜b2を入力するための各入力端子を、逓倍数レジスタ43にセットされた逓倍数Nに応じて、下位カウンタ25bからの各ビットb0〜b2の信号ラインから切り離すと共に、論理“1”の電圧レベルに接続する。   (4): An input switching circuit 49 is provided. The input switching circuit 49 sets the input terminals for inputting the lower 3 bits b0 to b2 of the lower counter 25b among the input terminals of the NAND circuit 33 to the multiplication number N set in the multiplication register 43. Accordingly, the signal lines of the respective bits b0 to b2 from the lower counter 25b are disconnected and connected to the voltage level of logic “1”.

具体的に説明すると、入力切り換え回路49は、逓倍数Nが256であれば、下位カウンタ25bの下位3ビットb0〜b2をNAND33にそのまま入力させるが、逓倍数Nが128であれば、NAND回路33にて1ビット目b0を入力するための入力端子(以下、1ビット目入力端子という)を、その1ビット目b0の信号ラインから切り離すと共に、その1ビット目入力端子を論理“1”に相当するハイレベル(例えば5V)に接続する。   More specifically, if the multiplication number N is 256, the input switching circuit 49 inputs the lower 3 bits b0 to b2 of the lower counter 25b as they are to the NAND 33, but if the multiplication number N is 128, the NAND circuit At 33, the input terminal for inputting the first bit b0 (hereinafter referred to as the first bit input terminal) is disconnected from the signal line of the first bit b0, and the first bit input terminal is set to logic “1”. Connect to the corresponding high level (eg 5V).

また、入力切り換え回路49は、逓倍数Nが64であれば、上記1ビット目入力端子とNAND回路33にて2ビット目b1を入力するための入力端子(以下、2ビット目入力端子という)とを、1ビット目b0及び2ビット目b1の各信号ラインから切り離すと共に、その1ビット目入力端子と2ビット目入力端子とを論理“1”に相当するハイレベルに接続する。   Further, when the multiplication number N is 64, the input switching circuit 49 inputs the first bit input terminal and the second bit b1 in the NAND circuit 33 (hereinafter referred to as the second bit input terminal). Are disconnected from the signal lines of the first bit b0 and the second bit b1, and the first bit input terminal and the second bit input terminal are connected to a high level corresponding to logic “1”.

また更に、入力切り換え回路49は、逓倍数Nが32であれば、上記1ビット目入力端子及び2ビット目入力端子と、NAND回路33にて3ビット目b2を入力するための入力端子(以下、3ビット目入力端子という)とを、1ビット目b0,2ビット目b1,及び3ビット目b2の各信号ラインから切り離すと共に、その1ビット目入力端子,2ビット目入力端子,及び3ビット目入力端子を論理“1”に相当するハイレベルに接続する。   Furthermore, if the multiplication number N is 32, the input switching circuit 49 is configured to input the first bit input terminal and the second bit input terminal, and an input terminal for inputting the third bit b2 in the NAND circuit 33 (hereinafter referred to as “input terminal”). The third bit input terminal) from the signal lines of the first bit b0, the second bit b1, and the third bit b2, and the first bit input terminal, the second bit input terminal, and the third bit The eye input terminal is connected to a high level corresponding to logic “1”.

つまり、入力切り換え回路49は、逓倍数Nが2p(pは5〜8の何れか)であるとすると、NAND回路33の入力端子のうち、下位カウンタ25bの最上位ビットから数えてpビット目よりも下位のビットを入力するための入力端子を、そのビットの信号ラインから切り離して論理“1”のレベルに固定するようになっている。 That is, if the multiplication number N is 2 p (p is any one of 5 to 8), the input switching circuit 49 has p bits counted from the most significant bit of the lower counter 25b among the input terminals of the NAND circuit 33. An input terminal for inputting a bit lower than the eye is separated from the signal line of the bit and fixed to a logic “1” level.

そして、この入力切り換え回路49の作用により、逓倍数Nが「32,64,128,256」のうちの何れに変更されても、NAND回路33によるガード機能が発揮されることとなる。逓倍数Nが2p(pは5〜8の何れか)であるとすると、下位カウンタ25bの最上位ビットから数えてpビット目(即ち、逓倍クロックに応じたカウント動作の最下位ビット)と該pビット目よりも上位のビットとが全て“1”になれば、NAND回路33の出力がローレベルになってAND回路31から逓倍クロックが出力されなくなるからである。 Then, by the operation of the input switching circuit 49, the guard function by the NAND circuit 33 is exhibited even if the multiplication number N is changed to any of “32, 64, 128, 256”. If the multiplication number N is 2 p (p is any one of 5 to 8), the p-th bit (that is, the least significant bit of the count operation corresponding to the multiplication clock) counted from the most significant bit of the lower counter 25b This is because if all the bits higher than the p-th bit become “1”, the output of the NAND circuit 33 becomes low level and the AND clock 31 does not output the multiplied clock.

(5):信号出力部29は、設定部として設定値レジスタ27にセットされている設定値と、角度カウンタ25のカウント値(上位カウンタ25aの8ビットと下位カウンタ25bの8ビットとからなる合計16ビットのデータ値)とを大小比較して、「カウント値≧設定値」であったら制御信号を出力する(この例では、制御信号の出力レベルを反転させる)ように構成されている。   (5): The signal output unit 29 is a set value set in the set value register 27 as a setting unit, and the count value of the angle counter 25 (the sum of 8 bits of the upper counter 25a and 8 bits of the lower counter 25b) A 16-bit data value is compared, and if “count value ≧ set value”, a control signal is output (in this example, the output level of the control signal is inverted).

但し、信号出力部29は、設定値レジスタ27内の設定値が変更されたことで「カウント値≧設定値」の関係が成立しても制御信号は出力しないようになっている。つまり、設定値レジスタ27に設定値がセットされる時には、たとえ「カウント値≧設定値」の関係が成立しても制御信号を出力せず、設定値がセットされた後、「カウント値<設定値」の状態から「カウント値≧設定値」の状態に転じて始めて、制御信号を出力するように構成されている。   However, the signal output unit 29 does not output a control signal even if the relationship of “count value ≧ setting value” is established because the setting value in the setting value register 27 is changed. That is, when the set value is set in the set value register 27, even if the relationship of “count value ≧ set value” is established, the control signal is not output, and after the set value is set, “count value <setting The control signal is output only when the state changes from “value” to “count value ≧ set value”.

(6):CPU13は、図2の処理に代えて、逓倍数Nを変更するために図8の処理を実行する。
そこで次に、本第2実施形態のマイコン41において、CPU13が実行する処理の内容について説明する。
(6): The CPU 13 executes the process of FIG. 8 in order to change the multiplication factor N instead of the process of FIG.
Then, next, the contents of the processing executed by the CPU 13 in the microcomputer 41 of the second embodiment will be described.

まず図8(A)は、角度信号の立ち上がりタイミングのうち、エンジン回転数を算出すべきタイミングとして定められた特定のクランク角のタイミング毎(本第2実施形態においても120°CA毎)に実行される回転数算出処理を表すフローチャートである。   First, FIG. 8A is executed at every specific crank angle timing (every 120 ° CA in the second embodiment) determined as a timing at which the engine speed should be calculated among the rising timings of the angle signal. It is a flowchart showing the rotation speed calculation process performed.

この回転数算出処理の実行が開始されると、まずS310にて、当該処理の前回の起動時刻から今回の起動時刻までの時間(120°CA分の時間)に基づき、エンジン回転数を算出する。   When the execution of the rotation speed calculation process is started, first, in S310, the engine rotation speed is calculated based on the time from the previous start time of the process to the current start time (time of 120 ° CA). .

次に、S320にて、今回算出したエンジン回転数と、現在の逓倍数(即ち、逓倍数レジスタ43に現在セットしている逓倍数)とから、その逓倍数を変更する必要があるか否かを判断する。   Next, in S320, whether or not the multiplication number needs to be changed from the currently calculated engine speed and the current multiplication number (that is, the multiplication number currently set in the multiplication number register 43). Judging.

具体的に説明すると、マイコン41内のROM(図示省略)には、図9の上段の如くエンジン回転数と逓倍数との関係を示した回転数対逓倍数データマップが記憶されている。そして、S320では、その回転数対逓倍数データマップにおいて今回算出のエンジン回転数に対応する逓倍数を読み込み、その読み込んだ逓倍数と、現在の逓倍数とが異なっていれば、逓倍数を変更する必要があると判断する。   Specifically, the ROM (not shown) in the microcomputer 41 stores a rotation speed / multiplication number data map showing the relationship between the engine speed and the multiplication number as shown in the upper part of FIG. In S320, the multiplication number corresponding to the engine speed calculated this time is read in the rotation speed / multiplication number data map, and if the read multiplication number is different from the current multiplication number, the multiplication number is changed. Judge that it is necessary.

尚、図9の上段に示すように、回転数対逓倍数データマップは、エンジン回転数が高い場合ほど逓倍数が小さくなるように設定されている。また、回転数対逓倍数データマップは、図9の下段に示すように、逓倍クロックの周期の誤差(角度信号の1パルス間隔時間を「1/逓倍数N」にした本当の時間に対する誤差)の最大値が2%以下となるように設定されている。そして更に、この回転数対逓倍数データマップでは、逓倍数が変更される回転数付近で逓倍数の切り換えが頻繁に行われてしまうことがないように、ヒステリシスが設けられている。   As shown in the upper part of FIG. 9, the rotation speed / multiplication number data map is set such that the higher the engine speed, the smaller the multiplication number. Further, as shown in the lower part of FIG. 9, the rotation speed versus multiplication number data map shows an error in the period of the multiplication clock (an error with respect to a real time in which one pulse interval time of the angle signal is set to “1 / multiplication number N”). Is set to be 2% or less. Further, in this rotation speed / multiplication number data map, a hysteresis is provided so that the multiplication number is not frequently switched around the rotation speed at which the multiplication number is changed.

そして、S320にて、逓倍数を変更する必要がないと判断した場合には、そのまま当該回転数算出処理を終了するが、逓倍数を変更する必要があると判断した場合には(S320:YES)、S330に進んで、変更すべき新たな逓倍数(つまり、S320で回転数対逓倍数データマップから読み込んだ逓倍数)を記憶する。そして更に、続くS340にて、フラグFbに“1”をセットした後、当該回転数算出処理を終了する。   When it is determined in S320 that it is not necessary to change the multiplication number, the rotation number calculation process is terminated as it is. However, when it is determined that the multiplication number needs to be changed (S320: YES) ), The process proceeds to S330, and the new multiplication number to be changed (that is, the multiplication number read from the rotation speed versus multiplication data map in S320) is stored. Further, in subsequent S340, “1” is set in the flag Fb, and then the rotation speed calculation process is terminated.

次に、図8(B)は、図8(A)の回転数算出処理が終了した後、次の角度信号の立ち上がりタイミングで実行される逓倍数変更処理を表すフローチャートである。
この逓倍数変更処理の実行が開始されると、まずS410にて、フラグFbが“1”であるか否かを判定し、フラグFbが“1”でなければ、そのまま当該逓倍数変更処理を終了するが、フラグFbが“1”であれば(S410:YES)、S420に進む。
Next, FIG. 8B is a flowchart showing a multiplication number changing process executed at the rising timing of the next angle signal after the rotation speed calculation process of FIG.
When the execution of the multiplication number changing process is started, it is first determined in S410 whether or not the flag Fb is “1”. If the flag Fb is not “1”, the multiplication number changing process is performed as it is. If the flag Fb is “1” (S410: YES), the process proceeds to S420.

そして、S420では、図8(A)のS330で記憶された逓倍数を読み出し、その逓倍数を逓倍数レジスタ43にセットし直す。そして更に、続くS430にて、フラグFbをクリア(フラグFbに“0”をセット)し、その後、当該逓倍数変更処理を終了する。   In S420, the multiplication number stored in S330 of FIG. 8A is read, and the multiplication number is reset in the multiplication number register 43. Further, in the subsequent S430, the flag Fb is cleared (“0” is set in the flag Fb), and then the multiplication number changing process is ended.

尚、イグニッションスイッチのオンに伴いエンジン制御装置に電源が投入されてマイコン41が動作を開始した際に逓倍数レジスタ43へセットされる逓倍数(つまり、逓倍数の初期値)は、図9からも分かるように、切り換えバリエーションのなかで最も大きい256である。   Note that the multiplication number (that is, the initial value of the multiplication number) that is set in the multiplication number register 43 when the microcomputer 41 starts operating when the engine control device is turned on when the ignition switch is turned on is shown in FIG. As can be seen, 256 is the largest among the switching variations.

このような第2実施形態のマイコン41では、図10に示すように、角度信号の立ち上がり毎に、角度カウンタ25の上位8ビット(上位カウンタ25aの値)が1ずつアップすると共に、角度カウンタの下位8ビット(下位カウンタ25bの値)が逓倍クロックによって0から10進数で1,2,4,8の何れかずつアップする。つまり、上記(3)で説明した構成及び作用により、下位カウンタ25bの値は、逓倍数レジスタ43にセットされた逓倍数Nが256であれば、逓倍クロックによって1ずつアップし、逓倍数Nが128であれば、逓倍クロックによって2ずつアップし、逓倍数Nが64であれば、逓倍クロックによって4ずつアップし、逓倍数Nが32であれば、逓倍クロックによって8ずつアップする。   In such a microcomputer 41 of the second embodiment, as shown in FIG. 10, every time the angle signal rises, the upper 8 bits (value of the upper counter 25a) of the angle counter 25 are incremented by 1 and the angle counter The lower 8 bits (the value of the lower counter 25b) are incremented from 0 to a decimal number of 1, 2, 4, or 8 by the multiplication clock. In other words, due to the configuration and operation described in (3) above, if the multiplication number N set in the multiplication register 43 is 256, the value of the lower counter 25b is incremented by one by the multiplication clock, and the multiplication number N is If it is 128, it is incremented by 2 by the multiplied clock, if the multiplication number N is 64, it is incremented by 4 by the multiplication clock, and if the multiplication number N is 32, it is incremented by 8 by the multiplication clock.

このため、角度カウンタ25の合計16ビットのカウント値は、逓倍数Nに拘わらず、逓倍クロックに応じて、角度信号の1パルス間隔(10°CA間隔)当たり256の割合で増加すると共に、角度信号が立ち上がる毎に256の整数倍の値に補正されることとなる。そして、角度カウンタ25のカウント値が設定値レジスタ27内の設定値以上になると制御信号が出力されることとなる。   Therefore, the count value of a total of 16 bits of the angle counter 25 increases at a rate of 256 per one pulse interval (10 ° CA interval) of the angle signal according to the multiplied clock regardless of the multiplication number N. Every time the signal rises, it is corrected to an integer multiple of 256. When the count value of the angle counter 25 becomes equal to or greater than the set value in the set value register 27, a control signal is output.

そして特に、本実施形態のマイコン41では、逓倍数Nを、エンジン回転数に応じて、低回転時には大きくし、高回転時には小さくするようにしている。例えば、図10に示すように、エンジン回転数が1500rpmの場合には、逓倍数Nが256に設定される。そして、エンジン回転数が2100rpmよりも高く(この例では2500rpm)になり、そのことが図8(A)の回転数算出処理で検出されると、角度信号の次の立ち上がりタイミングで実行される図8(B)の逓倍数変更処理により、逓倍数Nが256よりも小さい値(この例では128)に変更されることとなる(図9参照)。   In particular, in the microcomputer 41 of the present embodiment, the multiplication number N is increased at low speeds and decreased at high speeds according to the engine speed. For example, as shown in FIG. 10, when the engine speed is 1500 rpm, the multiplication number N is set to 256. Then, when the engine speed becomes higher than 2100 rpm (in this example, 2500 rpm), and this is detected by the rotation speed calculation process of FIG. 8A, the chart is executed at the next rising timing of the angle signal. By the multiplication number changing process of 8 (B), the multiplication number N is changed to a value smaller than 256 (in this example, 128) (see FIG. 9).

以上のような制御信号処理装置としてのマイコン41によっても、エンジン回転数に拘わらず角度カウンタ25のカウント値とクランク角との対応を正確なものにすることができ、制御信号を精度良く出力することができるようになる。   Even with the microcomputer 41 as the control signal processing apparatus as described above, the correspondence between the count value of the angle counter 25 and the crank angle can be made accurate regardless of the engine speed, and the control signal is output with high accuracy. Will be able to.

つまり、前述したように、逓倍クロックの周期には、最大で「(逓倍数N−1)/パルス間隔カウンタ17による角度信号の1パルス間隔分のカウント値T」だけの誤差が生じるが、Tが大きくなる低回転時よりも、Tが小さくなる高回転時の方が、逓倍数Nを小さくすることにより、その誤差を、高回転時においても低回転時と同等に小さく抑えることができる。そして、逓倍クロックの周期誤差が小さくなれば、角度カウンタ25のカウント値とクランク角との対応が一層正確になり、そのカウント値に基づき出力される制御信号の出力精度が向上するのである。   That is, as described above, in the cycle of the multiplied clock, an error of “(multiplier number N−1) / count value T for one pulse interval of the angle signal by the pulse interval counter 17” occurs at the maximum. By reducing the multiplication factor N in the high rotation at which T becomes small, the error can be suppressed to be as small in the high rotation as in the low rotation. If the cycle error of the multiplied clock is reduced, the correspondence between the count value of the angle counter 25 and the crank angle becomes more accurate, and the output accuracy of the control signal output based on the count value is improved.

また、このマイコン41によれば、計測用クロックCLKの周波数を大きくする必要がないため、パルス間隔カウンタ17がカウントすべき最大値が大きくなったり、消費電流の増加を招くこともない。   Further, according to the microcomputer 41, since it is not necessary to increase the frequency of the measurement clock CLK, the maximum value to be counted by the pulse interval counter 17 is not increased, and the current consumption is not increased.

尚、高回転時に逓倍数Nを小さくすると、角度カウンタ25のカウント値が表す時間の分解能(即ち、角度信号の1パルス間隔時間tpを逓倍数Nで割った値=「tp/逓倍数N」)が大きくなるが、図5における「丸数字6」の欄に示しているように、10000rpm付近の時に逓倍数Nが16という小さい値であったとしても、その時間分解能は11μs(逓倍数N=32ならば5.5μs)であり、500rpm付近の時に逓倍数Nを256とした場合の13μsと大きな差はないため、制御信号の出力精度に影響はない。つまり、逓倍数Nを、低回転時には大きくし高回転時には小さくすることで、角度カウンタ25のカウント値が表す時間分解能を、回転数によらず一定範囲にすることができる。   If the multiplication number N is reduced during high rotation, the time resolution represented by the count value of the angle counter 25 (that is, a value obtained by dividing one pulse interval time tp of the angle signal by the multiplication number N = “tp / multiplication number N”). However, as shown in the column of “circle numeral 6” in FIG. 5, even when the multiplication number N is a small value of 16 at around 10000 rpm, the time resolution is 11 μs (multiplication number N). = 5.5 μs if = 32), and there is no significant difference from 13 μs when the multiplication factor N is set to 256 at around 500 rpm, so that the output accuracy of the control signal is not affected. That is, the time resolution represented by the count value of the angle counter 25 can be set within a certain range regardless of the number of rotations by increasing the multiplication number N at the time of low rotation and decreasing it at the time of high rotation.

ところで、逓倍数Nを角度信号の1パルス間隔の途中で、それまでよりも小さい値に変更すると、角度カウンタ25のカウント値が、変更後の逓倍数Nに合わない値をとってしまう可能性がある。   By the way, if the multiplication number N is changed to a value smaller than that in the middle of one pulse interval of the angle signal, the count value of the angle counter 25 may take a value that does not match the changed multiplication number N. There is.

例えば、図11(A)に示すように、逓倍数Nを角度信号の1パルス間隔の途中(即ち、角度カウンタ25の下位カウンタ25bがカウントアップしている途中)で、それまでの256から128に変更した場合を例に挙げると、逓倍数Nが256に設定されている時点では、角度カウンタ25における下位カウンタ25bの1ビット目b0が逓倍クロックに応じたカウント動作の最下位ビットとなるが、逓倍数Nが128に変更されると、下位カウンタ25bの2ビット目b1が逓倍クロックに応じたカウント動作の最下位ビットとなり、その下位カウンタ25bの1ビット目b0は変化しなくなる。   For example, as shown in FIG. 11A, the multiplication number N is in the middle of one pulse interval of the angle signal (that is, in the middle of counting up the lower counter 25b of the angle counter 25), and the previous 256 to 128 For example, when the multiplication number N is set to 256, the first bit b0 of the lower counter 25b in the angle counter 25 is the least significant bit of the count operation corresponding to the multiplication clock. When the multiplication number N is changed to 128, the second bit b1 of the lower counter 25b becomes the least significant bit of the counting operation corresponding to the multiplied clock, and the first bit b0 of the lower counter 25b does not change.

そして、逓倍数Nが切り換えられるタイミングとしては、図11(B)の如く下位カウンタ25bの1ビット目b0が“1”である時(即ち、角度カウンタ25のカウント値が奇数である時)と、図11(C)の如く下位カウンタ25bの1ビット目b0が“0”である時(即ち、角度カウンタ25のカウント値が偶数である時)との2通りがあるが、図11(B)のように、角度カウンタ25のカウント値が奇数である時に逓倍数Nが256から128に変更されたとすると、その後、角度信号に立ち上がりエッジが発生して下位カウンタ25bがクリアされるまでは、その下位カウンタ25bの値(延いては、角度カウンタ25の値)が奇数になってしまう。   The timing at which the multiplication number N is switched is when the first bit b0 of the lower counter 25b is “1” as shown in FIG. 11B (that is, when the count value of the angle counter 25 is an odd number). As shown in FIG. 11C, there are two cases when the first bit b0 of the lower counter 25b is “0” (that is, when the count value of the angle counter 25 is an even number). ), When the count value of the angle counter 25 is an odd number and the multiplication number N is changed from 256 to 128, until the rising edge occurs in the angle signal and the lower counter 25b is cleared, The value of the lower counter 25b (and hence the value of the angle counter 25) becomes an odd number.

そして、このような場合には、本来、逓倍数Nが128であるならば、角度カウンタ25のカウント値は偶数である(即ち、下位カウンタ25bの1ビット目b0は“0”である)ということと矛盾してしまう。よって、例えば、「背景技術」の欄で述べたように角度カウンタ25のカウント値が設定値と一致したら制御信号を出力する、といった構成の場合には、制御信号が出力されなくなってしまう可能性が生じる。   In such a case, if the multiplication number N is originally 128, the count value of the angle counter 25 is an even number (that is, the first bit b0 of the lower counter 25b is “0”). It contradicts that. Therefore, for example, in the case of a configuration in which a control signal is output when the count value of the angle counter 25 matches the set value as described in the “Background Art” column, the control signal may not be output. Occurs.

しかし、本第2実施形態では、逓倍数Nを、角度信号の立ち上がりタイミング(即ち、下位カウンタ25bがクリアされるタイミング)で変更するようにしているため、上記矛盾が発生するのを確実に避けることができる。   However, in the second embodiment, since the multiplication number N is changed at the rising timing of the angle signal (that is, the timing at which the lower counter 25b is cleared), the occurrence of the inconsistency is surely avoided. be able to.

一方、例えば図12に示すように、エンジン回転数が8000rpmで逓倍数Nが64に設定されている場合に、設定値レジスタ27内の設定値が、角度信号に立ち上がりエッジが発生する角度間隔(=10°CA)を現在の逓倍数(=64)で割った値を分解能(増減単位)として更新されたとする。尚、図12の「設定値」の段と、後述する図13とにおける「LSB」とは、最下位ビットの意味ではなく、増減単位としての分解能のことである。   On the other hand, as shown in FIG. 12, for example, when the engine speed is set to 8000 rpm and the multiplication number N is set to 64, the set value in the set value register 27 is set to an angular interval at which a rising edge occurs in the angle signal ( Suppose that the value obtained by dividing (= 10 ° CA) by the current multiplication number (= 64) is updated as the resolution (increase / decrease unit). Note that “LSB” in the “set value” stage of FIG. 12 and FIG. 13 to be described later does not mean the least significant bit but the resolution as an increment / decrement unit.

そして、その後、エンジン回転数が8000rpmから9000rpmになったことにより逓倍数Nが32に変更され、更にその後、角度カウンタ25のカウント値が設定値レジスタ27内の設定値に到達したとする。   After that, when the engine speed is changed from 8000 rpm to 9000 rpm, the multiplication number N is changed to 32, and then the count value of the angle counter 25 reaches the set value in the set value register 27.

ここで、この場合、図13(D)に示すように、角度カウンタ25のカウント値は、変更後の逓倍数Nに応じた「10°CA/32」の分解能で増加するが、設定値の分解能は、変更前の逓倍数Nに応じた「10°CA/64」であり、角度カウンタ25のカウント値は設定値の分解能よりも荒い分解能で増加していくこととなる。よって、角度カウンタ25のカウント値が設定値を跨いでしまう可能性がある。このため、角度カウンタ25のカウント値が設定値と一致したら制御信号を出力するといった構成では、制御信号が出力されなくなってしまう可能性がある。   Here, in this case, as shown in FIG. 13D, the count value of the angle counter 25 increases with a resolution of “10 ° CA / 32” corresponding to the multiplication number N after the change. The resolution is “10 ° CA / 64” corresponding to the multiplication number N before the change, and the count value of the angle counter 25 increases with a resolution that is rougher than the resolution of the set value. Therefore, the count value of the angle counter 25 may straddle the set value. For this reason, in the configuration in which the control signal is output when the count value of the angle counter 25 matches the set value, the control signal may not be output.

そして、この可能性は、逓倍数Nが64から32に変更された場合に限らず、それまでよりも小さい値に変更される場合に共通のものである。尚、図13(A)〜(C)に例示するように、角度カウンタ25のカウント値の増加分解能が設定値の分解能と同じかそれよりも細かければ、こうした懸念はない。   This possibility is common not only when the multiplication number N is changed from 64 to 32 but also when the multiplication number N is changed to a smaller value than before. As illustrated in FIGS. 13A to 13C, there is no such concern as long as the increment resolution of the angle counter 25 is the same as or smaller than the resolution of the set value.

ここで、本第2実施形態のマイコン41では、上記(5)で述べたように、信号出力部29は「角度カウンタ25のカウント値≧設定値」となったら制御信号を出力するように構成されているため、図14に示すように、角度カウンタ25のカウント値が設定値の分解能よりも荒い分解能で進んでいく、といった状況が発生した場合でも、必ず制御信号を出力することができる。このため、逓倍数Nを変更した場合でも、設定値を変更する必要はない。   Here, in the microcomputer 41 of the second embodiment, as described in the above (5), the signal output unit 29 is configured to output a control signal when “the count value of the angle counter 25 ≧ the set value”. Therefore, as shown in FIG. 14, even when a situation occurs in which the count value of the angle counter 25 advances at a resolution that is rougher than the resolution of the set value, a control signal can be output without fail. For this reason, even when the multiplication number N is changed, it is not necessary to change the set value.

また、設定値の分解能は、角度信号に立ち上がりエッジが発生する角度間隔(=10°CA)を一番大きい逓倍数(=256)で割った分解能(=10°CA/256)に固定しておくことが好ましい。このようにすれば、設定値の分解能を逓倍数Nに応じて変更しなくても、常に逓倍数Nに応じた最大限の精度で制御信号を出力することができるからである。   Further, the resolution of the set value is fixed to the resolution (= 10 ° CA / 256) obtained by dividing the angular interval (= 10 ° CA) where the rising edge occurs in the angle signal by the largest multiplication number (= 256). It is preferable to keep it. This is because the control signal can always be output with the maximum accuracy according to the multiplication number N without changing the resolution of the set value according to the multiplication number N.

尚、サンプリング周波数を変更する第1実施形態では、周波数変更直後の10°CA期間中には制御信号を出力しないようにしていたが、サンプリング周波数が一定の本第2実施形態では、そのようにする必要はない。   In the first embodiment in which the sampling frequency is changed, the control signal is not output during the 10 ° CA period immediately after the frequency change. However, in the second embodiment in which the sampling frequency is constant, that is the case. do not have to.

一方、本第2実施形態では、パルス間隔カウンタ17が計測手段に相当し、カウント値レジスタ19,逓倍演算部21,逓倍カウンタ23,及び逓倍数レジスタ43が逓倍信号生成手段に相当し、角度カウンタ25が角度カウンタに相当し、設定値レジスタ27及び信号出力部29が信号出力手段に相当している。また、計測用クロックCLKの周期が計測用周期に相当している。そして、図8(A)におけるS320〜S340の処理と図8(B)の処理とが、逓倍数変更手段に相当している。   On the other hand, in the second embodiment, the pulse interval counter 17 corresponds to measurement means, the count value register 19, the multiplication operation unit 21, the multiplication counter 23, and the multiplication number register 43 correspond to multiplication signal generation means, and the angle counter. Reference numeral 25 corresponds to an angle counter, and the set value register 27 and the signal output unit 29 correspond to signal output means. Further, the cycle of the measurement clock CLK corresponds to the measurement cycle. And the process of S320-S340 in FIG. 8 (A) and the process of FIG. 8 (B) are equivalent to a multiplication number change means.

以上、本発明の一実施形態について説明したが、本発明は、種々の形態を採り得ることは言うまでもない。
例えば、上記各実施形態では、エンジン回転数を120°CA分の時間から算出するようにしたが、それ以外の時間(10°CA分の時間や30°CA分の時間)からエンジン回転数を算出するようにしても良い。また、エンジン回転数の算出タイミングも、120°CA毎に限らず、10°CA毎や30°CA毎のタイミングでも良い。
As mentioned above, although one Embodiment of this invention was described, it cannot be overemphasized that this invention can take a various form.
For example, in each of the above embodiments, the engine speed is calculated from the time of 120 ° CA. However, the engine speed is calculated from other times (time of 10 ° CA or time of 30 ° CA). It may be calculated. Further, the calculation timing of the engine speed is not limited to every 120 ° CA, and may be every 10 ° CA or every 30 ° CA.

一方、上記各実施形態では、角度信号の立ち上がりエッジが特定エッジとなっていたが、立ち下がりエッジの方が特定エッジとなる構成であっても良い。
また、角度信号が、所定角度間隔毎(例えば5°CA毎)に立ち上がりエッジと立ち下がりエッジとが交互に発生する信号であるならば、その角度信号の立ち上がりエッジと立ち下がりエッジの両方を使えば良く、この場合には、立ち上がりエッジと立ち下がりエッジとの両方が、特定エッジとなる。つまり、例えば所定角度が5°CAであるとすると、立ち上がりエッジから次の立下りエッジまでの5°CAの間隔、および、立ち下がりエッジから次の立ち上がりエッジまでの5°CAの間隔が、それぞれ1パルス間隔となり、そのそれぞれをパルス間隔カウンタ17により計測するように構成すれば良い。
On the other hand, in each of the above embodiments, the rising edge of the angle signal is the specific edge, but the falling edge may be the specific edge.
Further, if the angle signal is a signal in which a rising edge and a falling edge are alternately generated at every predetermined angular interval (for example, every 5 ° CA), both the rising edge and the falling edge of the angle signal can be used. In this case, both the rising edge and the falling edge are specific edges. That is, for example, if the predetermined angle is 5 ° CA, the interval of 5 ° CA from the rising edge to the next falling edge and the interval of 5 ° CA from the falling edge to the next rising edge are respectively One pulse interval may be set and each of them may be measured by the pulse interval counter 17.

また更に、上記各実施形態では、パルス間隔カウンタ17の計測値(カウント値)Tを逓倍数Nで割った商(=T/N)の整数部分を、計測値Tが逓倍数Nの何倍であるかを示す整数値Mとして逓倍カウンタ23にカウントさせるようにしたが、例えば、その商の小数点以下(余りの部分)を四捨五入した整数値を、計測値Tが逓倍数Nの何倍であるかを示す整数値Mとして逓倍カウンタ23にカウントさせるようにしても良い。   Furthermore, in each of the above embodiments, the integer part of the quotient (= T / N) obtained by dividing the measurement value (count value) T of the pulse interval counter 17 by the multiplication number N is the number of times that the measurement value T is the multiplication number N. The multiplication counter 23 counts as an integer value M indicating whether or not, for example, an integer value obtained by rounding off the decimal point (remainder part) of the quotient is obtained by multiplying the multiplication value N by the measured value T. You may make it make the multiplication counter 23 count as the integer value M which shows whether it exists.

また、上記各実施形態では、ダウンカウントする逓倍カウンタ23を用いたが、アップカウントするカウンタを用いても良い。つまり、計測用クロックCLKによって上記整数値Mだけカウントする毎に逓倍クロックとしての信号を発生させる構成であれば、カウントの方向はダウンとアップとのどちらでも良い。   In each of the above embodiments, the multiplication counter 23 that counts down is used. However, a counter that counts up may be used. That is, the count direction may be either down or up as long as a signal as a multiplied clock is generated each time the integer M is counted by the measurement clock CLK.

一方、上記各実施形態では、角度カウンタ25を、制御信号の出力タイミングを決定するために用いていたが、角度カウンタ25は他の様々な用途に使用することができる。例えば、マイコンの外部又は内部でトリガ信号が発生すると角度カウンタ25のカウント値をラッチし、そのラッチしたカウント値からトリガ信号発生時のクランク角を把握する、といった構成を採ることもできる。   On the other hand, in each of the above embodiments, the angle counter 25 is used for determining the output timing of the control signal, but the angle counter 25 can be used for various other purposes. For example, when a trigger signal is generated outside or inside the microcomputer, the count value of the angle counter 25 is latched, and the crank angle when the trigger signal is generated can be grasped from the latched count value.

第1実施形態のエンジン制御装置のマイコンの構成を表す構成図である。It is a block diagram showing the structure of the microcomputer of the engine control apparatus of 1st Embodiment. 第1実施形態のマイコンにおけるCPUが実行する処理を表すフローチャートである。It is a flowchart showing the process which CPU in the microcomputer of 1st Embodiment performs. 回転数対周波数データマップを説明する説明図である。It is explanatory drawing explaining a rotation speed versus frequency data map. 第1実施形態の作用を表すタイムチャートである。It is a time chart showing the effect | action of 1st Embodiment. 第1実施形態の効果を表す図である。It is a figure showing the effect of 1st Embodiment. 第2実施形態のエンジン制御装置のマイコンの構成を表す構成図である。It is a block diagram showing the structure of the microcomputer of the engine control apparatus of 2nd Embodiment. 第2実施形態のマイコンにおけるCPUが実行する処理を表すフローチャートである。It is a flowchart showing the process which CPU in the microcomputer of 2nd Embodiment performs. 角度カウンタの下位カウンタ及びクロック経路切り換え回路を表す説明図である。It is explanatory drawing showing the low-order counter of an angle counter, and a clock path switching circuit. 回転数対逓倍数データマップを説明する説明図である。It is explanatory drawing explaining a rotation speed versus multiplication number data map. 第2実施形態の作用を表すタイムチャートである。It is a time chart showing the effect | action of 2nd Embodiment. 逓倍数を角度信号の1パルス間隔の途中で小さい値に変更した場合を表す説明図である。It is explanatory drawing showing the case where a multiplication number is changed into the small value in the middle of 1 pulse interval of an angle signal. 逓倍数が小さい値に変更された場合の一例を表すタイムチャートである。It is a time chart showing an example when the multiplication number is changed to a small value. 角度カウンタのカウント値が設定値と一致したら制御信号を出力するようにした場合の問題を説明する説明図である。It is explanatory drawing explaining the problem at the time of making it output a control signal when the count value of an angle counter corresponds with a setting value. 第2実施形態の効果を説明する説明図である。It is explanatory drawing explaining the effect of 2nd Embodiment. 課題を説明するための説明図である。It is explanatory drawing for demonstrating a subject.

符号の説明Explanation of symbols

11,41…マイコン、13…CPU、15…分周回路、17…パルス間隔カウンタ、19…カウント値レジスタ、21…逓倍演算部、23…逓倍カウンタ、25…角度カウンタ、25a…上位カウンタ、25b…下位カウンタ、27…設定値レジスタ、29…信号出力部、31…AND回路、33…NAND回路、43…逓倍数レジスタ、45…クロック経路切り換え回路、47…信号ライン、FF0〜FF7…Dフリップフロップ、SW0〜SW3…スイッチ、49…入力切り換え回路   DESCRIPTION OF SYMBOLS 11, 41 ... Microcomputer, 13 ... CPU, 15 ... Frequency dividing circuit, 17 ... Pulse interval counter, 19 ... Count value register, 21 ... Multiplication calculating part, 23 ... Multiplication counter, 25 ... Angle counter, 25a ... Upper counter, 25b ... Lower counter, 27 ... Set value register, 29 ... Signal output unit, 31 ... AND circuit, 33 ... NAND circuit, 43 ... Multiplier register, 45 ... Clock path switching circuit, 47 ... Signal line, FF0 to FF7 ... D flip-flop SW, SW3 to SW3, switch 49, input switching circuit

Claims (8)

エンジンのクランク軸の回転に対応して所定角度間隔毎にパルスエッジが発生する角度信号を入力し、該角度信号に前記所定角度間隔毎のパルスエッジ(以下、特定エッジという)が発生してから該特定エッジが次に発生するまでの間隔(以下、1パルス間隔という)毎に、該1パルス間隔よりも短い所定の計測用周期でカウント動作を行って、その1パルス間隔の間にカウントしたカウント値を前記1パルス間隔の計測値として出力する計測手段と、
該計測手段による前記計測値を所定の逓倍数で除算して、該計測値が前記逓倍数の何倍であるかを示す整数値Mを求め、周期が「前記計測用周期×M」である逓倍信号を生成する逓倍信号生成手段と、
前記逓倍信号によりカウント動作する角度カウンタと、
を備えた信号処理装置において、
前記計測用周期を、前記クランク軸の回転数に応じて変更する計測用周期変更手段を備えていること、
を特徴とする信号処理装置。
An angle signal that generates a pulse edge at every predetermined angle interval corresponding to the rotation of the crankshaft of the engine is input, and a pulse edge at each predetermined angle interval (hereinafter referred to as a specific edge) is generated in the angle signal. At each interval until the specific edge occurs next (hereinafter referred to as one pulse interval), a counting operation is performed at a predetermined measurement cycle shorter than the one pulse interval, and the counting is performed during the one pulse interval. Measuring means for outputting a count value as a measured value of the one-pulse interval;
The measurement value obtained by the measurement means is divided by a predetermined multiplication number to obtain an integer value M indicating how many times the measurement value is the multiplication number, and the cycle is “the measurement cycle × M”. A multiplied signal generating means for generating a multiplied signal;
An angle counter that counts in response to the multiplied signal;
In a signal processing apparatus comprising:
Comprising a measurement cycle changing means for changing the measurement cycle according to the number of rotations of the crankshaft;
A signal processing device.
請求項1に記載の信号処理装置において、
前記計測用周期変更手段は、前記クランク軸の回転数が高い場合ほど、前記計測用周期を短くすること、
を特徴とする信号処理装置。
The signal processing device according to claim 1,
The measurement cycle changing means shortens the measurement cycle as the number of rotations of the crankshaft is higher.
A signal processing device.
請求項1又は請求項2に記載の信号処理装置において、
前記計測用周期変更手段は、前記計測用周期を、大きいものが小さいものの2z倍(zは1以上の整数)の関係にある複数通りの周期のうちの何れかに切り換えるように構成されていること、
を特徴とする信号処理装置。
In the signal processing device according to claim 1 or 2,
The measurement cycle changing means is configured to switch the measurement cycle to any one of a plurality of cycles having a relationship of 2 z times (z is an integer of 1 or more) larger than smaller. Being
A signal processing device.
エンジンのクランク軸の回転に対応して所定角度間隔毎にパルスエッジが発生する角度信号を入力し、該角度信号に前記所定角度間隔毎のパルスエッジ(以下、特定エッジという)が発生してから該特定エッジが次に発生するまでの間隔(以下、1パルス間隔という)毎に、該1パルス間隔よりも短い所定の計測用周期でカウント動作を行って、その1パルス間隔の間にカウントしたカウント値を前記1パルス間隔の計測値として出力する計測手段と、
該計測手段による前記計測値を所定の逓倍数で除算して、該計測値が前記逓倍数の何倍であるかを示す整数値Mを求め、周期が「前記計測用周期×M」である逓倍信号を生成する逓倍信号生成手段と、
前記逓倍信号によりカウント動作する角度カウンタと、
を備えた信号処理装置において、
前記逓倍数を、前記クランク軸の回転数に応じて変更する逓倍数変更手段を備えていること、
を特徴とする信号処理装置。
An angle signal that generates a pulse edge at every predetermined angle interval corresponding to the rotation of the crankshaft of the engine is input, and a pulse edge at each predetermined angle interval (hereinafter referred to as a specific edge) is generated in the angle signal. At each interval until the specific edge occurs next (hereinafter referred to as one pulse interval), a counting operation is performed at a predetermined measurement cycle shorter than the one pulse interval, and the counting is performed during the one pulse interval. Measuring means for outputting a count value as a measured value of the one-pulse interval;
The measurement value obtained by the measurement means is divided by a predetermined multiplication number to obtain an integer value M indicating how many times the measurement value is the multiplication number, and the cycle is “the measurement cycle × M”. A multiplied signal generating means for generating a multiplied signal;
An angle counter that counts in response to the multiplied signal;
In a signal processing apparatus comprising:
A multiplication number changing means for changing the multiplication number according to the number of rotations of the crankshaft;
A signal processing device.
請求項4に記載の信号処理装置において、
前記逓倍数変更手段は、前記クランク軸の回転数が高い場合ほど、前記逓倍数を小さくすること、
を特徴とする信号処理装置。
The signal processing device according to claim 4,
The multiplication number changing means reduces the multiplication number as the rotation speed of the crankshaft is higher.
A signal processing device.
請求項4又は請求項5に記載の信号処理装置において、
前記角度カウンタは、上位複数ビットの上位カウンタと、下位kビット(kは2以上の整数)の下位カウンタとからなり、
前記逓倍数変更手段は、前記逓倍数を、2n(nは1からkまでの整数のうちの何れか)で表される複数個の数値のうちの何れかに切り換えるように構成されており、
前記上位カウンタは、前記角度信号に前記特定エッジが発生する毎にカウント動作し、
前記下位カウンタは、前記逓倍信号によってカウント動作すると共に、前記角度信号に前記特定エッジが発生するとクリアされ、
更に、前記下位カウンタは、前記逓倍数変更手段により変更される逓倍数に応じて、該逓倍数が前記複数個の数値のうちの2p(pは1からkまでの整数のうちの何れか)であるとすると、当該下位カウンタの最上位ビットから数えてpビット目が、前記逓倍信号に応じたカウント動作の最下位ビットとなるように構成されていること、
を特徴とする信号処理装置。
In the signal processing device according to claim 4 or 5,
The angle counter is composed of an upper counter of upper multiple bits and a lower counter of lower k bits (k is an integer of 2 or more),
The multiplication number changing means is configured to switch the multiplication number to any one of a plurality of numerical values represented by 2 n (where n is an integer from 1 to k). ,
The upper counter counts every time the specific edge occurs in the angle signal,
The lower counter is counted by the multiplication signal, and cleared when the specific edge occurs in the angle signal,
Further, the low-order counter has a multiplication number 2 p (p is an integer from 1 to k) of the plurality of numerical values according to the multiplication number changed by the multiplication number changing means. ), The p-th bit counted from the most significant bit of the lower counter is configured to be the least significant bit of the counting operation according to the multiplied signal,
A signal processing device.
請求項6に記載の信号処理装置において、
前記逓倍数変更手段は、前記逓倍数を、前記角度信号に前記特定エッジが発生したタイミングで変更すること、
を特徴とする信号処理装置。
The signal processing apparatus according to claim 6,
The multiplication number changing means changes the multiplication number at a timing when the specific edge occurs in the angle signal.
A signal processing device.
請求項4ないし請求項7の何れか1項に記載の信号処理装置において、
前記角度カウンタのカウント値に基づき制御信号を出力する信号出力手段を備え、
更に、前記信号出力手段は、前記クランク軸の回転角度を指定した設定値が設定される設定部を有すると共に、該設定部に設定された設定値と、前記角度カウンタのカウント値とを大小比較して、それら両値が予め定められた大小関係にある場合に前記制御信号を出力するように構成されていること、
を特徴とする信号処理装置。
The signal processing device according to any one of claims 4 to 7,
Signal output means for outputting a control signal based on the count value of the angle counter;
Furthermore, the signal output means has a setting unit for setting a setting value that specifies the rotation angle of the crankshaft, and compares the setting value set in the setting unit with the count value of the angle counter The control signal is output when the two values are in a predetermined magnitude relationship;
A signal processing device.
JP2003282912A 2003-07-30 2003-07-30 Signal processor Pending JP2005048698A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003282912A JP2005048698A (en) 2003-07-30 2003-07-30 Signal processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003282912A JP2005048698A (en) 2003-07-30 2003-07-30 Signal processor

Publications (1)

Publication Number Publication Date
JP2005048698A true JP2005048698A (en) 2005-02-24

Family

ID=34267975

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003282912A Pending JP2005048698A (en) 2003-07-30 2003-07-30 Signal processor

Country Status (1)

Country Link
JP (1) JP2005048698A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013104337A (en) * 2011-11-11 2013-05-30 Denso Corp Signal processor
JP2013160043A (en) * 2012-02-01 2013-08-19 Toyota Motor Corp Engine control device
JP2014227892A (en) * 2013-05-21 2014-12-08 トヨタ自動車株式会社 Crank angle sensor, crank angle detection device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013104337A (en) * 2011-11-11 2013-05-30 Denso Corp Signal processor
JP2013160043A (en) * 2012-02-01 2013-08-19 Toyota Motor Corp Engine control device
JP2014227892A (en) * 2013-05-21 2014-12-08 トヨタ自動車株式会社 Crank angle sensor, crank angle detection device

Similar Documents

Publication Publication Date Title
US5541506A (en) Rotational position detector having initial setting function
JP2004274157A (en) Nonlinearity correction method and nonlinearity correction apparatus for a/d converted output data
JP4168907B2 (en) Engine control device
JPH1049251A (en) Microcontroller and its control method
JP2003513249A (en) Apparatus for measuring the spacing between signal edges
JP3123931B2 (en) Time measuring system and time measuring method
JPH01201168A (en) Driving circuit for cross coil type instrument
JP2005048698A (en) Signal processor
JP3203909B2 (en) A / D converter
JP3473165B2 (en) Frequency-voltage converter
JPH08271284A (en) Waveform shaping device
JP3372860B2 (en) Signal phase difference detection circuit and signal phase difference detection method
JPH0946194A (en) Waveform shaping device
JP4519183B2 (en) AB phase signal generator, RD converter and angle detection device
KR100372946B1 (en) Control device of motor
JP5678868B2 (en) Signal processing device
JP4321432B2 (en) Clock signal output circuit
JP2010074637A (en) Up/down counter device
JPH0730429A (en) Pulse phase difference encoding circuit
JPH01320468A (en) Method and apparatus for measuring revolutions of machine
JPH06104740A (en) Measuring circuit for edge time of input signal and digital pll device
JPH07301685A (en) Clock circuit
JP3733385B2 (en) Pulse width measuring circuit and pulse width measuring method
JP2000180210A (en) Encoder pulse generating device
JPH0571909A (en) Rotating position detecting apparatus for internal combustion engine