JP4998789B2 - Speed detection device - Google Patents

Speed detection device Download PDF

Info

Publication number
JP4998789B2
JP4998789B2 JP2007259720A JP2007259720A JP4998789B2 JP 4998789 B2 JP4998789 B2 JP 4998789B2 JP 2007259720 A JP2007259720 A JP 2007259720A JP 2007259720 A JP2007259720 A JP 2007259720A JP 4998789 B2 JP4998789 B2 JP 4998789B2
Authority
JP
Japan
Prior art keywords
edge
speed
time
rotation direction
value
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.)
Active
Application number
JP2007259720A
Other languages
Japanese (ja)
Other versions
JP2009085924A (en
Inventor
以久也 佐藤
章弘 小高
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2007259720A priority Critical patent/JP4998789B2/en
Publication of JP2009085924A publication Critical patent/JP2009085924A/en
Application granted granted Critical
Publication of JP4998789B2 publication Critical patent/JP4998789B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Transmission And Conversion Of Sensor Element Output (AREA)

Description

本発明は、例えば電動機を可変速駆動する電動機駆動装置において、電動機に取り付けたエンコーダの出力パルスを用いて電動機速度を検出する速度検出装置に関するものである。   The present invention relates to a speed detection device that detects a motor speed using an output pulse of an encoder attached to the motor, for example, in a motor drive device that drives the motor at a variable speed.

電動機を可変速駆動する装置として、インバータが知られている。インバータの機能の中で、電動機の速度を高精度に制御するために、電動機に取り付けたエンコーダの出力パルス信号に基づいて電動機速度を検出し、速度指令値との偏差をゼロにする速度調節機能を用いて制御を行うものがある。   An inverter is known as a device for driving an electric motor at a variable speed. Speed control function that detects the motor speed based on the output pulse signal of the encoder attached to the motor and makes the deviation from the speed command value zero in order to control the motor speed with high accuracy. There is something that controls using.

しかし、エンコーダの出力パルスは通常、1回転あたりのパルス数が決められており、パルスは回転速度によって粗密が発生する。パルスが粗となる低速領域では、検出精度が悪化して速度検出値に誤差が生じるため、速度制御性能を悪化させる原因となる。速度制御性能が悪化すると、例えばクレーンなどでは、速度制御誤差がトルクのリプルとなり、積荷に振動が伝わって問題になる。あるいは速度制御誤差により、自動運転中に積荷の停止位置に誤差が生じ、他の機器に影響を及ぼす等の問題が生じる。
また、エンコーダの取り付け方により、出力パルスの位相誤差が発生し、この出力パルスに基づく検出方法では、速度検出値に位相誤差の影響が現れ、上述したようなトルクリプル等の問題を引き起こす。
However, the number of pulses per rotation is usually determined for the output pulses of the encoder, and the density of the pulses varies depending on the rotation speed. In the low speed region where the pulse is rough, the detection accuracy is deteriorated and an error occurs in the speed detection value, which causes the speed control performance to deteriorate. When the speed control performance deteriorates, for example, in a crane or the like, the speed control error becomes a torque ripple, and vibration is transmitted to the load, which becomes a problem. Alternatively, the speed control error causes an error in the load stop position during automatic operation, which causes problems such as affecting other devices.
Further, the phase error of the output pulse is generated depending on how the encoder is attached, and in the detection method based on this output pulse, the influence of the phase error appears on the speed detection value, causing problems such as torque ripple as described above.

そこで、上述の問題を解決するため、特許文献1には、エンコーダの出力パルスの立ち上がりエッジ、立ち下がりエッジを利用して速度を検出する方法が開示されている。以下、この従来技術について簡単に説明する。   Therefore, in order to solve the above-described problem, Patent Document 1 discloses a method for detecting the speed by using the rising edge and the falling edge of the output pulse of the encoder. The prior art will be briefly described below.

図10は、特許文献1に記載された従来技術の構成図である。
図10において、ラッチ信号作成部21は、エンコーダから出力されるA相、B相という位相の異なった2種類のパルスからそれぞれの立ち上がりエッジ、立ち下がりエッジを検出し、合計4種類のラッチ信号ED0〜ED3を作成する。角度計測カウンタ22は、ラッチ信号(4F)と電動機の回転方向を示すUP/DOWN信号を用いてカウンタのUP,DOWNを行う。
FIG. 10 is a configuration diagram of the prior art described in Patent Document 1. In FIG.
In FIG. 10, the latch signal generating unit 21 detects the rising edge and the falling edge from two types of pulses having different phases of A phase and B phase output from the encoder, and a total of four types of latch signals ED0. Create ED3. The angle measurement counter 22 performs UP / DOWN of the counter using the latch signal (4F) and the UP / DOWN signal indicating the rotation direction of the electric motor.

時間計測カウンタ23は、速度演算周期に同期してゼロになるダウンカウンタである。4種類のラッチ信号ED0〜ED3のそれぞれに対応させて、角度計測カウンタ22の値をラッチして保存する第1データラッチ24−1〜24−4と、時間計測カウンタ23の値をラッチして保存する第2データラッチ25−1〜25−4とを設け、更に、速度演算周期毎に入力データをラッチする角度データラッチ27−1〜27−4,時間データラッチ28−1〜28−4を設ける。
なお、CPU30では、速度演算周期毎に角度計測値(データラッチ27−1〜27−4の値)と時間計測値(データラッチ28−1〜28−4の値)とを読み込み、検出フローチャートに従って電動機の速度を検出する。
The time measurement counter 23 is a down counter that becomes zero in synchronization with the speed calculation cycle. Corresponding to each of the four types of latch signals ED0 to ED3, the first data latch 24-1 to 24-4 that latches and stores the value of the angle measurement counter 22, and the value of the time measurement counter 23 are latched. Second data latches 25-1 to 25-4 for storing are provided, and angle data latches 27-1 to 27-4 and time data latches 28-1 to 28-4 for latching input data for each speed calculation cycle. Is provided.
The CPU 30 reads the angle measurement values (values of the data latches 27-1 to 27-4) and the time measurement values (values of the data latches 28-1 to 28-4) for each speed calculation cycle, and follows the detection flowchart. Detect the speed of the motor.

また、26は、ラッチ信号ED0〜ED3からA相パルス、B相パルスのエッジ変化を検出して保持するエッジ保持部、29は、エッジ保持部26の出力信号FIL0〜FIL3から、エッジの変化が1回でもあれば「1」を、変化が1回もなければ「0」を設定して保持することによりエッジの変化情報を保持するエッジ変化情報保持部、31はコントローラ、32は第3データラッチを示す。   Reference numeral 26 denotes an edge holding unit that detects and holds edge changes of the A-phase pulse and B-phase pulse from the latch signals ED0 to ED3, and 29 denotes an edge change from the output signals FIL0 to FIL3 of the edge holding unit 26. An edge change information holding unit for holding edge change information by setting and holding “1” if there is even one change and “0” if there is no change once, 31 is a controller, and 32 is third data. Indicates a latch.

図11は、上記従来技術による速度検出動作を示すフローチャートである。
速度演算周期毎にエッジの変化の有無を図10のエッジ保持部26により検出し、速度演算周期毎にラッチしたエッジ変化情報保持部29の出力値F0〜F3をCPU30が読み込む。速度演算周期において一度でもエッジを検出していたら、カウント値の大小から最新のエッジを検索し、最新エッジに対応するデータラッチ27−1〜27−4の角度計測値とデータラッチ28−1〜28−4の時間計測値とを用いて、数式1に基づき速度ωを演算する。
FIG. 11 is a flowchart showing the speed detection operation according to the conventional technique.
The edge holding unit 26 in FIG. 10 detects the presence or absence of an edge change for each speed calculation cycle, and the CPU 30 reads the output values F0 to F3 of the edge change information holding unit 29 latched for each speed calculation cycle. If the edge is detected even once in the speed calculation cycle, the latest edge is searched from the magnitude of the count value, and the angle measurement values of the data latches 27-1 to 27-4 corresponding to the latest edge and the data latches 28-1 to 28-1 are searched. The speed ω is calculated based on Equation 1 using the time measurement value 28-4.

Figure 0004998789
Figure 0004998789

ただし、θNewは今回のサンプルタイミングで読み込んだ角度計測値、θOLDは前回のサンプルタイミングで読み込んだ角度計測値、Tはサンプリング周期、TNewは今回のサンプルタイミングで読み込んだ時間計測値、TOLDは前回のサンプルタイミングで読み込んだ時間計測値である。
また、回転速度が低く、速度演算周期内にパルスが一度も存在しなかった場合は、TOLDにサンプリング周期Tを加えて速度ωを推定する。
However, θ New angle measurement value read in the current sample timing, θ OLD angle measurement value read in the previous sample timing, T S is the sampling period, T New time measurement value read in the current sample timing, T OLD is a time measurement value read at the previous sample timing.
If the rotation speed is low and no pulse exists within the speed calculation period, the sampling period T S is added to T OLD to estimate the speed ω S.

特開平6−118090号公報([0024]〜[0043]、図2,図14)JP-A-6-1118090 ([0024] to [0043], FIGS. 2 and 14)

上記の従来技術では、低速域において速度演算周期内にエンコーダからパルスが発生せず、エッジが存在しない場合には、サンプルタイミングを基準として最新のエッジに対応する時間にサンプリング周期Tを加算することで時間計測値を補正し、速度ωを推定している。
しかしながら、速度演算周期の2〜3回にわたってエンコーダからパルスが発生しないような極低速域では、速度の真値に対して誤差が発生し、電動機のトルクリプル等の問題を生じることになる。
そこで、本発明の解決課題は、極低速域においても高精度に速度を検出可能とした速度検出装置を提供することにある。
In the above prior art, a pulse from the encoder is not generated in the speed calculation cycle in the low speed range, if the edge is not present, adds the sampling period T S in time corresponding to the latest edge sample timing as a reference Thus, the time measurement value is corrected, and the speed ω S is estimated.
However, in an extremely low speed region where no pulse is generated from the encoder over two or three times of the speed calculation cycle, an error occurs with respect to the true value of the speed, causing problems such as torque ripple of the motor.
Therefore, a problem to be solved by the present invention is to provide a speed detection device capable of detecting a speed with high accuracy even in an extremely low speed region.

上記課題を解決するため、請求項1に係る発明は、速度検出対象としての回転体に取り付けられたエンコーダの出力パルスから、回転体の回転速度を検出する速度検出装置において、
前記出力パルスのエッジを検出するエッジ検出手段と、
検出されたエッジに基づいて回転体の回転方向を検出する回転方向検出手段と、
速度演算周期に同期した時間を計測する時間計測手段と、
前記エッジ検出手段の出力により前記時間計測手段の時間計測値を保持する時間記憶手段と、
速度演算周期内の前記エッジの変化状態を検出しエッジ変化情報として保持するエッジ変化情報保持手段と、
前記回転方向及びエッジ変化情報から、速度演算周期内に前記エッジの変化がない場合に次に発生するエッジを予測するエッジ予測手段と、
このエッジ予測手段により予測したエッジに対応する時間補正値と、前記時間計測値及び前記回転方向とを用いて回転体の回転速度を演算する演算手段と、
を備え
前回以前の速度演算により得た速度検出値を用いて前記時間補正値を求めるものである。
In order to solve the above-mentioned problem, the invention according to claim 1 is a speed detection device for detecting a rotation speed of a rotating body from an output pulse of an encoder attached to the rotating body as a speed detection target.
Edge detection means for detecting an edge of the output pulse;
Rotation direction detection means for detecting the rotation direction of the rotating body based on the detected edge;
A time measuring means for measuring time synchronized with the speed calculation cycle;
Time storage means for holding the time measurement value of the time measurement means by the output of the edge detection means;
Edge change information holding means for detecting a change state of the edge within a speed calculation cycle and holding it as edge change information;
Edge prediction means for predicting the next edge generated when there is no change in the edge within the speed calculation cycle from the rotation direction and edge change information;
A calculation means for calculating the rotational speed of the rotating body using the time correction value corresponding to the edge predicted by the edge prediction means, the time measurement value and the rotation direction;
Equipped with a,
The time correction value is obtained using the speed detection value obtained by the speed calculation before the previous time .

請求項2に係る発明は、請求項1において、前記演算手段は、前記エッジ予測手段により予測したエッジが将来の速度演算周期内の所定時点に発生すると仮定して前記時間補正値を求め、この時間補正値を前記時間計測値及び前記回転方向と共に用いて回転体の回転速度を演算するものである。   According to a second aspect of the present invention, in the first aspect, the calculation unit obtains the time correction value on the assumption that an edge predicted by the edge prediction unit occurs at a predetermined time point in a future speed calculation cycle. The rotational speed of the rotating body is calculated using the time correction value together with the time measurement value and the rotation direction.

本発明によれば、速度演算周期内にエンコーダからパルスが発生せず、エッジが存在しないような極低速域においても、回転方向及びエッジ変化情報から次に発生するエッジを予測して時間補正値を求め、この時間補正値を時間計測値及び回転方向と共に用いることで、高精度な速度検出を行うことができる。   According to the present invention, even in a very low speed region where no pulse is generated from the encoder within the speed calculation cycle and no edge exists, the next generated edge is predicted from the rotation direction and edge change information, and the time correction value is set. By using the time correction value together with the time measurement value and the rotation direction, highly accurate speed detection can be performed.

以下、図に沿って本発明の実施形態を説明する。
ここで、本実施形態の特徴は、速度演算周期内にパルスが発生しないような極低速域においては次に発生するエッジを予測し、この予測エッジに応じた時間補正値を用いて速度演算用の時間計測値を補正することにある。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
Here, the feature of this embodiment is that the next occurring edge is predicted in an extremely low speed region where no pulse is generated within the speed calculation cycle, and the time correction value corresponding to the predicted edge is used for speed calculation. It is to correct the time measurement value.

図1は、本発明の実施形態の主要部を示す構成図である。なお、図10の従来技術と同一の部分には同一の参照符号を付してある。
図1において、21はエッジ検出手段としてのラッチ信号作成部であり、エンコーダ(図示せず)から出力される位相の異なったA相パルス、B相パルスの立ち上がりエッジと立ち下がりエッジとを検出し、ラッチ信号ED0,ED1,ED2,ED3を作成する。上記エンコーダは、例えば速度を検出するべき回転体である電動機回転軸に連結されて、その回転速度に比例した数のA相パルス、B相パルスを出力する。
ここで、エンコーダはA相,B相の2相に限定されず、3相以上であっても良いが、本実施形態では、2相エンコーダから出力されるA相パルス、B相パルスの立ち上がりエッジ及び立ち下がりエッジの4種類のエッジを用いて速度を検出する場合について説明する。
Figure 1 is a block diagram showing a main part of the implementation of the invention. Note that the same reference numerals are assigned to the same parts as those in the prior art in FIG.
In FIG. 1, reference numeral 21 denotes a latch signal generation unit as an edge detection means, which detects an A-phase pulse and a rising edge and a falling edge of a B-phase pulse output from an encoder (not shown). The latch signals ED0, ED1, ED2, and ED3 are generated. The encoder is connected to, for example, a motor rotation shaft that is a rotating body whose speed is to be detected, and outputs A-phase pulses and B-phase pulses in a number proportional to the rotation speed.
Here, the encoder is not limited to two phases of A phase and B phase, but may be three or more phases, but in this embodiment, rising edges of A phase pulse and B phase pulse output from the two phase encoder A case where the speed is detected using four types of edges, that is, falling edges, will be described.

上記A相パルス、B相パルスは、回転方向検出部32にも入力されている。この回転方向検出部32は、後述するように、A相パルス、B相パルス及びラッチ信号ED0,ED1,ED2,ED3から、電動機の回転方向(CW:正転,CCW:逆転)を検出するものである。
回転方向検出部32から出力される信号CW/CCWは、回転方向保持部33に入力され、速度演算周期信号(サンプリング信号)SMPLによりラッチされて回転方向検出信号CWDETとして出力される。
The A-phase pulse and B-phase pulse are also input to the rotation direction detector 32. As will be described later, the rotation direction detector 32 detects the rotation direction (CW: forward rotation, CCW: reverse rotation) of the motor from the A-phase pulse, the B-phase pulse, and the latch signals ED0, ED1, ED2, ED3. It is.
The signal CW / CCW output from the rotation direction detection unit 32 is input to the rotation direction holding unit 33, is latched by a speed calculation period signal (sampling signal) SMPL, and is output as a rotation direction detection signal CWDET.

また、回転方向検出部32からは、回転方向が変化したことを示す回転方向変化検出信号CHNGも出力されており、この信号CHNGは、回転方向変化エッジ記憶部34に入力されている。回転方向変化エッジ記憶部34は、回転方向が変化した際のエッジ情報を保持し、回転方向変化エッジ信号CHNGEDとしてCPU30Aに出力する。   The rotation direction detection unit 32 also outputs a rotation direction change detection signal CHNG indicating that the rotation direction has changed. This signal CHNG is input to the rotation direction change edge storage unit 34. The rotation direction change edge storage unit 34 holds edge information when the rotation direction changes, and outputs it to the CPU 30A as a rotation direction change edge signal CHNGED.

前記ラッチ信号ED0,ED1,ED2,ED3は、時間記憶手段としてのデータラッチ25−1〜25−4に入力されていると共に、エッジ保持部26にも入力されている。
データラッチ25−1〜25−4には、図10と同様に時間計測カウンタ23から出力された時間計測値(時間カウント値)TDE0EN〜TDE3ENが入力されており、ラッチ信号ED0,ED1,ED2,ED3によってこれらの時間計測値TDE0EN〜TDE3ENを記憶し、次段のデータラッチ28−1〜28−4に送るように構成されている。上記時間計測カウンタ23は、速度演算周期に同期してゼロになるダウンカウンタである。
データラッチ28−1〜28−4では、速度演算周期信号SMPLによりラッチした時間計測値TDE0EN〜TDE3ENを、時間計測値T0EN〜T3ENとしてCPU30Aに送出する。
The latch signals ED0, ED1, ED2, and ED3 are input to the data latches 25-1 to 25-4 as time storage means and also input to the edge holding unit 26.
The data latches 25-1 to 25-4 receive time measurement values (time count values) T DE0EN to T DE3EN output from the time measurement counter 23 as in FIG. 10, and latch signals ED0, ED1, These time measurement values TDE0EN to TDE3EN are stored by ED2 and ED3 and sent to the data latches 28-1 to 28-4 in the next stage. The time measurement counter 23 is a down counter that becomes zero in synchronization with the speed calculation cycle.
The data latches 28-1 to 28-4 send the time measurement values T DE0EN to T DE3EN latched by the speed calculation cycle signal SMPL to the CPU 30A as the time measurement values T 0EN to T 3EN .

ラッチ信号ED0,ED1,ED2,ED3は、J−Kフリップフロップ等からなるエッジ保持部26に入力され、速度演算周期における各エッジの変化の有無が検出される。エッジ保持部26では、各ラッチ信号ED0,ED1,ED2,ED3について、エッジの変化が1回でもあれば「1」を設定して保持し、変化が1回もなければ「0」を設定して保持する。これらの保持データは、エッジ変化情報保持部29に送られ、速度演算周期信号SMPLによりラッチされてエッジ変化検出信号EDF0〜EDF3としてCPU30Aに送出される。   The latch signals ED0, ED1, ED2, and ED3 are input to the edge holding unit 26 including a J-K flip-flop, and the presence / absence of a change in each edge in the speed calculation cycle is detected. The edge holding unit 26 sets and holds “1” for each latch signal ED0, ED1, ED2, and ED3 if the edge changes even once, and sets “0” if there is no change. Hold. These held data are sent to the edge change information holding unit 29, latched by the speed calculation cycle signal SMPL, and sent to the CPU 30A as edge change detection signals EDF0 to EDF3.

図2は、前記回転方向検出部32の動作を示すタイミングチャートである。
回転方向検出部32は、ラッチ信号ED0,ED1,ED2,ED3が発生した際の、A相パルス,B相パルスの状態から回転方向を検出する。
FIG. 2 is a timing chart showing the operation of the rotation direction detector 32.
The rotation direction detector 32 detects the rotation direction from the state of the A-phase pulse and the B-phase pulse when the latch signals ED0, ED1, ED2, and ED3 are generated.

すなわち、図2において、例えば時点(3)でA相パルスの立ち上がりエッジを信号ED0により検出したときに(ED0が「1」)、B相パルスが検出されない場合(B相パルスが「0」)は、正回転と判断して信号CW(=「1」)を出力する。一方、時点(4)においてB相パルスの立ち下がりエッジを信号ED3により検出したときに(ED3が「1」)、A相パルスが検出された場合(A相パルスが「1」)には、逆回転と判断して信号CCW(=「0」)を出力する。
こうして得られた回転方向検出信号は、回転方向保持部33において速度演算周期信号SMPLによりラッチされ、回転方向検出信号CWDETとしてCPU30Aに送られる。
なお、図2において、TCHNGは回転方向が変化した時点を示している。
That is, in FIG. 2, for example, when the rising edge of the A-phase pulse is detected by the signal ED0 at time (3) (ED0 is “1”), the B-phase pulse is not detected (B-phase pulse is “0”). Determines that the rotation is normal, and outputs a signal CW (= “1”). On the other hand, when the falling edge of the B phase pulse is detected by the signal ED3 at the time point (4) (ED3 is “1”), when the A phase pulse is detected (the A phase pulse is “1”), It is determined that the rotation is reverse, and a signal CCW (= “0”) is output.
The rotation direction detection signal thus obtained is latched by the speed calculation period signal SMPL in the rotation direction holding unit 33 and sent to the CPU 30A as the rotation direction detection signal CWDET.
In FIG. 2, T CHNG indicates the time when the rotation direction has changed.

CPU30Aでは、速度演算周期毎に、データラッチ28−1〜28−4からの時間計測値T0EN〜T3ENと、回転方向保持部33からの回転方向検出信号CWDETと、エッジ変化情報保持部29からのエッジ変化検出信号EDF0〜EDF3とを用いて、電動機の速度を検出する。
ここで、回転方向変化エッジ信号CHNGEDは、逆回転時も考慮して速度を検出する場合に用いられるが、その詳細については後述する。
In the CPU 30A, the time measurement values T 0EN to T 3EN from the data latches 28-1 to 28-4 , the rotation direction detection signal CWDET from the rotation direction holding unit 33, and the edge change information holding unit 29 are provided for each speed calculation cycle. The speed of the motor is detected using the edge change detection signals EDF0 to EDF3.
Here, the rotation direction change edge signal CHNGED is used when the speed is detected in consideration of reverse rotation, and details thereof will be described later.

図3は、正回転時における速度検出動作を示すタイミングチャートである。ここでは、一例として、図3における時点(1)のサンプルタイミング(速度演算周期信号SMPLのタイミング)で速度を検出するものとして説明する。
図3の時点(1)において、図示するサンプルタイミングによれば、最新のエッジは信号ED0によるA相パルスの立ち上がりエッジである。これは、エッジ変化検出信号EDF0〜EDF3から、EDF0が「1」であり、その他のEDF1〜EDF3が「0」であることから判断する。なお、図3ではEDF0の値のみを図示し、EDF1〜EDF3を省略してある。
FIG. 3 is a timing chart showing the speed detection operation during forward rotation. Here, as an example, description will be made assuming that the speed is detected at the sample timing (timing of the speed calculation cycle signal SMPL) at the time point (1) in FIG.
At the time (1) in FIG. 3, according to the illustrated sample timing, the latest edge is the rising edge of the A-phase pulse by the signal ED0. This is determined from the edge change detection signals EDF0 to EDF3 because EDF0 is “1” and the other EDF1 to EDF3 are “0”. In FIG. 3, only the value of EDF0 is shown, and EDF1 to EDF3 are omitted.

このため、信号ED0によりラッチした時間計測値TDE0EN=T0EN1が最新の時間計測値(今回値)であり、前回の信号ED0が発生した時の時間計測値TDE0EN=T0EN0を前回値として使用する。このT0EN0の値は、時点(1)でデータラッチ28−1から読み込むことはできないが、前回のエッジ変化検出信号EDF0が「1」であった時点(1)’でCPU30A内のメモリに保存しておくことにより使用可能である。
また、速度演算周期に対応する時間計測カウンタ23の最大値をTmaxとし、前回値T0EN0から今回値T0EN1までの間にEDF0がゼロであったサンプリング回数をNとして、これらをCPU30Aのメモリに記憶しておき、数式2に基づいて速度nを演算する。
Therefore, the time measurement value T DE0EN = T 0EN1 latched by the signal ED0 is the latest time measurement value (current value), and the time measurement value T DE0EN = T 0EN0 when the previous signal ED0 is generated is the previous value. use. The value of T 0EN0 cannot be read from the data latch 28-1 at the time (1), but is stored in the memory in the CPU 30A at the time (1) ′ when the previous edge change detection signal EDF0 is “1”. It is possible to use it by keeping it.
Further, the maximum value of the time measurement counter 23 corresponding to the speed calculation cycle is set to T max, and the number of samplings in which EDF 0 was zero between the previous value T 0EN0 and the current value T 0EN 1 is set to N 0 , and these are set in the CPU 30A. The speed n is calculated on the basis of Formula 2 after being stored in the memory.

Figure 0004998789
Figure 0004998789

なお、数式2において、CWsignは回転方向を示し、正回転(CW)を「1」、逆回転(CCW)を「−1」とする。また、Kはエンコーダの1回転あたりの出力パルス数に関係する定数である。 In Equation 2, CW sign indicates a rotation direction, and forward rotation (CW) is “1” and reverse rotation (CCW) is “−1”. K is a constant related to the number of output pulses per rotation of the encoder.

図3に示すように、回転方向が変化していない場合には、A相パルス、B相パルスは順序通り発生する。例えば、図3において、A相パルスの立ち上がり→B相パルスの立ち上がり→A相パルスの立ち下がり→B相パルスの立ち下がりという順序は不変である。このため、図3の時点(1)のサンプルタイミングで速度検出を行う場合、回転方向が変化していなければ、前回のA相パルスの立ち上がりから今回のA相パルスの立ち上がりまでに計4回のエッジが発生したことがわかる。   As shown in FIG. 3, when the rotation direction is not changed, the A-phase pulse and the B-phase pulse are generated in order. For example, in FIG. 3, the order of rising edge of A phase pulse → rising edge of B phase pulse → falling edge of A phase pulse → falling edge of B phase pulse is unchanged. For this reason, when speed detection is performed at the sample timing at the time point (1) in FIG. 3, if the rotation direction has not changed, a total of four times from the rise of the previous A-phase pulse to the rise of the current A-phase pulse. It can be seen that an edge has occurred.

よって、数式2の分子を、A相パルス1周期内に存在するA相,B相パルスのエッジ数とおいて速度nを検出することができる。なお、数式2における分子の4は、本実施形態のように、A相パルス,B相パルスを出力する2相エンコーダの場合に、A相パルス(またはB相パルス)の1周期内に存在する全相(つまりA相,B相)パルスのエッジ数であり、エンコーダの相数によって異なるのは明らかである。また、数式2における定数Kは、前述した如く、使用するエンコーダの1回転あたりの出力パルス数によって変化する。
従って、エンコーダの相数や出力パルス数に応じて上記エッジ数(数式2における分子の数値)や定数KをCPU30が変更すれば、数式2により、エンコーダの相数や出力パルス数に関係なく速度を検出することができる。
Therefore, the velocity n can be detected by using the numerator of Equation 2 as the number of edges of the A-phase and B-phase pulses existing within one period of the A-phase pulse. In the case of a two-phase encoder that outputs an A-phase pulse and a B-phase pulse as in this embodiment, the numerator 4 in Equation 2 exists within one cycle of the A-phase pulse (or B-phase pulse). This is the number of edges of all-phase (ie, A-phase, B-phase) pulses. In addition, the constant K in Equation 2 varies depending on the number of output pulses per rotation of the encoder used as described above.
Therefore, if the CPU 30 A changes the number of edges (numerical value in Equation 2) and the constant K according to the number of encoder phases and the number of output pulses, Equation 2 does not affect the number of encoder phases or the number of output pulses. Speed can be detected.

さて、前述した図2の時点TCHNGにおいて回転方向が変化すると、各相パルスのエッジが出現する順序が崩れる。例えば、時点TCHNGより後で今回のラッチ信号ED3の後にサンプルタイミングが発生した際に、今回のラッチ信号ED3によりラッチした時間計測値T3EN1と前回のラッチ信号ED3によりラッチした時間計測値T3EN0とを使用しても、B相パルスの立ち下がりエッジに対応する前回及び今回のラッチ信号ED3の間に発生したエッジは、ラッチ信号ED0,ED1に対応するエッジ(A相パルスの立ち上がりエッジ,B相パルスの立ち上がりエッジ)と、今回のラッチ信号ED3に対応するB相パルスの立ち下がりエッジだけであるから、合計3個である。つまり、A相パルスの立ち下がりエッジに対応するラッチ信号ED2が、前回及び今回のラッチ信号ED3の間に存在しない。 Now, when the rotation direction changes at the time T CHNG in FIG. 2 described above, the order in which the edges of the respective phase pulses appear is broken. For example, when the sample timing after the later time of the latch signal from the time T CHNG ED3 occurs, this latch signal time measurements latched by the time the latched measured values T 3EN1 and the previous latch signals ED3 by ED3 T 3EN0 , The edge generated between the previous and current latch signals ED3 corresponding to the falling edge of the B-phase pulse is the edge corresponding to the latch signals ED0 and ED1 (the rising edge of the A-phase pulse, B Phase pulse rising edge) and the falling edge of the B-phase pulse corresponding to the current latch signal ED3. That is, the latch signal ED2 corresponding to the falling edge of the A-phase pulse does not exist between the previous and current latch signals ED3.

すなわち、図3に示した如く回転方向に変化がない場合には、前回及び今回のラッチ信号の間に4個のエッジが存在するため数式2の分子の値は4で良いが、回転方向が変化した場合には、数式2の分子の値を3にする必要があり、数式2をそのまま使用すると速度演算値に誤差が生じる。
そこで、回転方向の変化検出要因となったエッジ情報を記憶する回転方向変化エッジ記憶部34を設け、この記憶部34による回転方向変化エッジ情報(回転方向変化エッジ信号CHNGED)を加味してCPU30Aが速度を演算する。
That is, when there is no change in the rotation direction as shown in FIG. 3, since there are four edges between the previous and current latch signals, the numerator value of Equation 2 may be 4, but the rotation direction is When changed, the value of the numerator of Formula 2 needs to be 3, and if Formula 2 is used as it is, an error occurs in the speed calculation value.
In view of this, a rotation direction change edge storage unit 34 for storing edge information that causes a change in rotation direction is provided, and the CPU 30A takes into account the rotation direction change edge information (rotation direction change edge signal CHNGED) by the storage unit 34. Calculate the speed.

図4は、回転方向変化エッジ記憶部34の動作を示すタイミングチャートである。時点TCHNGにおいて、回転方向が正転(CW)から逆転(CCW)に変化したとする。なお、サンプルタイミングは、図4に▽で示したタイミングであるとする。 FIG. 4 is a timing chart showing the operation of the rotation direction change edge storage unit 34. It is assumed that the rotation direction changes from forward rotation (CW) to reverse rotation (CCW) at time T CHNG . The sample timing is assumed to be the timing indicated by ▽ in FIG.

回転方向が変化したことをCPU30Aが知り得るのは、時点TCHNGの直後のサンプルタイミングの時点(2)である。このとき、エンコーダパルスのエッジの最新情報はラッチ信号ED3から取得される。また、回転方向に変化がなく正転のままであれば、ラッチ信号ED1の次に信号ED2が検出されるが、図4の例では信号ED1の次に信号ED3が検出されるので、回転方向が変化したこともラッチ信号ED3から検出される。 The direction of rotation can know that CPU30A that has changed is the time the sample timing immediately after time point T CHNG (2). At this time, the latest information on the edge of the encoder pulse is acquired from the latch signal ED3. If there is no change in the rotation direction and the rotation is normal, the signal ED2 is detected next to the latch signal ED1, but the signal ED3 is detected next to the signal ED1 in the example of FIG. Is also detected from the latch signal ED3.

そこで、回転方向の変化検出要因となったエッジ(ラッチ信号)を回転方向変化エッジ信号CHNGEDとして回転方向変化エッジ記憶部34が保存し、CPU30Aによる速度検出に使用する。なお、上述したようにエッジの最新情報を与えるラッチ信号と回転方向の変化を検出した(変化検出要因となった)ラッチ信号とが常に同一とは限らないため、回転方向変化エッジ信号CHNGEDを用いる必要がある。   Therefore, the rotation direction change edge storage unit 34 stores the edge (latch signal) that has become the rotation direction change detection factor as the rotation direction change edge signal CHNGED and uses it for speed detection by the CPU 30A. Note that the rotation direction change edge signal CHNGED is used because the latch signal that gives the latest edge information and the latch signal that detects the change in the rotation direction (which is the change detection factor) are not always the same as described above. There is a need.

図5は、回転方向が変化した場合も含む速度検出のフローチャートである。
回転方向の変化の有無(ステップS1)は、信号CWDETの前回値と今回値とが一致しているか否かによって判断する。信号CWDETの今回値と前回値とが一致していれば(S1 NO)、ステップS5,S6を経て数式2により速度nを演算する(S7)。
FIG. 5 is a flowchart of speed detection including the case where the rotation direction changes.
The presence / absence of a change in the rotation direction (step S1) is determined based on whether or not the previous value and the current value of the signal CWDET match. If the current value of the signal CWDET coincides with the previous value (NO in S1), the speed n is calculated by Equation 2 through steps S5 and S6 (S7).

信号CWDETの今回値と前回値とが一致していない場合は(S1 YES)、速度演算周期の間で回転方向が変化しているとみなす。そして、回転方向変化エッジ信号CHNGEDを読み込み、回転方向が変化した際のエッジ(ラッチ信号)の情報を検索する(S2)。ここで、図4の例では、回転方向変化エッジ信号CHNGEDとして「3」が保持されている。この信号CHNGEDの「3」はラッチ信号ED3を意味しており、B相パルスの立ち下がりエッジによって回転方向に変化が起きたことがわかる。   When the current value and the previous value of the signal CWDET do not match (S1 YES), it is considered that the rotation direction has changed during the speed calculation cycle. Then, the rotation direction change edge signal CHNGED is read, and information on the edge (latch signal) when the rotation direction is changed is searched (S2). Here, in the example of FIG. 4, “3” is held as the rotation direction change edge signal CHNGED. “3” of the signal CHNGED means the latch signal ED3, and it can be seen that a change occurs in the rotation direction due to the falling edge of the B-phase pulse.

次に、上記信号CHNGED(B相パルスの立ち下がりに対応する)に応じた時間計測値T3ENを用いて、速度nを演算する。すなわち、回転方向が変化している場合は、回転方向変化を検出した際のエッジ情報に応じた時間計測値と、前回の時間計測値とからエッジ間隔を求め、その間に発生するエッジの数は4ではなく3であるとして、数式3により速度nを演算する(S3,S4)。 Next, the speed n is calculated using the time measurement value T 3EN corresponding to the signal CHNGED (corresponding to the falling edge of the B phase pulse). That is, when the rotation direction is changing, the edge interval is obtained from the time measurement value according to the edge information when the rotation direction change is detected and the previous time measurement value, and the number of edges generated during that time is Assuming 3 instead of 4, the speed n is calculated by Equation 3 (S3, S4).

Figure 0004998789
Figure 0004998789

なお、数式3以外にも、回転方向の変化を検出したエッジがわかっていれば、回転方向が変化する直前のエッジに対応する時間計測値(図4の例ではED1に対応するT1ENの値)を用いて、エッジ数を2として計算しても良い。いずれにしても、速度演算式は数式3に限定されるものではない。 In addition to Equation 3, if the edge where the change in the rotation direction is detected is known, the time measurement value corresponding to the edge immediately before the change in the rotation direction (the value of T 1EN corresponding to ED1 in the example of FIG. 4). ) To calculate the number of edges as 2. In any case, the speed calculation formula is not limited to Formula 3.

次いで、本実施形態の特徴である極低速時の速度検出動作を、CPU30Aの構成と共に図1,図6〜図8を参照しつつ説明する。
図1に示したCPU30Aは、速度演算周期毎にデータラッチ28−1〜28−4内の時間計測値T0EN,T1EN,T2EN,T3ENを内部の記憶部35−1〜35−4に読み込み、時間計測値T0MEM1,T1MEM1,T2MEM1,T3MEM1を更新する。
Next, a speed detection operation at an extremely low speed, which is a feature of the present embodiment, will be described with reference to FIGS. 1 and 6 to 8 together with the configuration of the CPU 30A.
CPU30A shown in FIG. 1, the time measurement value T 0EN in the data latches 28-1 to 28-4 for each speed calculation cycle, T 1EN, T 2EN, interior T 3EN storage unit 35-1 to 35-4 And time measurement values T0MEM1 , T1MEM1 , T2MEM1 , and T3MEM1 are updated.

すなわち、CPU内部の時間計測値は、内部の記憶部36に記憶されたエッジ変化情報EDF0MEM,EDF1MEM,EDF2MEM,EDF3MEMに基づいて速度演算周期内にエッジの変化が検出されたとき、前回の時間計測値T0MEM0,T1MEM0,T2MEM0,T3MEM0を今回値T0MEM1,T1MEM1,T2MEM1,T3MEM1に更新する。なお、別の記憶部37内の回転方向情報は、速度演算周期毎に今回値CWMEM1、前回値CWMEM0としてそれぞれ更新される。 In other words, the time measurement value inside the CPU is measured when the change in the edge is detected within the speed calculation cycle based on the edge change information EDF0MEM, EDF1MEM, EDF2MEM, EDF3MEM stored in the internal storage unit 36. The values T0MEM0 , T1MEM0 , T2MEM0 , T3MEM0 are updated to the current values T0MEM1 , T1MEM1 , T2MEM1 , T3MEM1 . The rotation direction information in the other storage unit 37 is updated as the current value CWMEM1 and the previous value CWMEM0 for each speed calculation cycle.

最新エッジ検出部38は、記憶部36のエッジ変化情報から、一つだけエッジが検出された場合はそれを最新エッジとみなし、そのエッジに対応する記憶部35−1〜35−4内の時間計測値を最新エッジの時間計測値とみなす。仮に、速度演算周期内に複数のエッジが検出された場合は、時間計測値が小さいエッジの方がサンプルタイミングに近いものとして、そのエッジを最新エッジとみなす。   When only one edge is detected from the edge change information in the storage unit 36, the latest edge detection unit 38 regards it as the latest edge, and the time in the storage units 35-1 to 35-4 corresponding to the edge. The measurement value is regarded as the time measurement value of the latest edge. If a plurality of edges are detected within the speed calculation cycle, the edge with the smaller time measurement value is considered to be closer to the sample timing, and the edge is regarded as the latest edge.

これは、サンプルタイミングに同期する時間計測カウンタ23がダウンカウンタであり、カウンタの値が小さい方がサンプルタイミングに近いとみなせるからである。なお、時間計測カウンタ23はダウンカウンタに限定されるわけではなく、アップカウンタであっても良い。アップカウンタの場合は、サンプルタイミングに近い方が時間計測値は大きくなるので、カウンタの種類に合わせて最新エッジを検出すればよい。
最新エッジ検出部38により得た最新エッジ判別信号(EDF0〜EDF3に対応させて、「0」〜「3」の値をとる)と、最新エッジに対応する時間計測値とは、記憶部37からの回転方向判別信号及び記憶部36からのエッジ有無判別信号と共にエッジ予測・速度演算部39に送られる。
This is because the time measurement counter 23 synchronized with the sample timing is a down counter, and the smaller counter value can be regarded as closer to the sample timing. The time measurement counter 23 is not limited to a down counter, and may be an up counter. In the case of an up-counter, the time measurement value becomes larger near the sample timing, so the latest edge may be detected according to the type of counter.
The latest edge discrimination signal obtained by the latest edge detection unit 38 (takes values of “0” to “3” corresponding to EDF0 to EDF3) and the time measurement value corresponding to the latest edge are stored in the storage unit 37. The rotation direction determination signal and the edge presence / absence determination signal from the storage unit 36 are sent to the edge prediction / speed calculation unit 39.

図6は、最新エッジ検出部38、エッジ予測・速度演算部39等の動作を示すタイミングチャートである。
最新エッジ判別信号及び最新エッジ時間計測値は、前述のように最新エッジ検出部38にて作成され、図6の時点(1)のように、エンコーダパルスのエッジが発生した直後のサンプルタイミングで更新される。いま、時点(1)’に着目すると、時点(1)から(1)’までの速度演算周期内にエンコーダパルスのエッジは検出されず、CPU30Aの内部のエッジ変化情報EDF0MEM,EDF1MEM,EDF2MEM,EDF3MEMは、全てゼロである。ここで、時点(1)以後は、最新エッジ検出部38から出力される最新エッジ判別信号が、A相パルスの立ち上がりエッジを示す「0」となっている。
FIG. 6 is a timing chart showing operations of the latest edge detection unit 38, the edge prediction / speed calculation unit 39, and the like.
The latest edge determination signal and the latest edge time measurement value are created by the latest edge detection unit 38 as described above, and updated at the sample timing immediately after the edge of the encoder pulse is generated as shown in FIG. 6 (1). Is done. Now, focusing on the time point (1) ′, the edge of the encoder pulse is not detected within the speed calculation period from the time point (1) to (1) ′, and the edge change information EDF0MEM, EDF1MEM, EDF2MEM, EDF3MEM inside the CPU 30A. Are all zero. Here, after the time point (1), the latest edge determination signal output from the latest edge detector 38 is “0” indicating the rising edge of the A-phase pulse.

このとき、時点(1)ではA相パルスの立ち上がりエッジを検出しているので、時点(1)’では、回転方向が正であれば、次に発生するのはB相パルスの立ち上がりエッジであると予測できる。従って、時点(1)以後にエッジ予測・速度演算部39から出力される次のエッジ予測値(最新エッジ判別信号と同様に、EDF0〜EDF3に対応させて「0」〜「3」の値をとる)は、B相パルスの立ち上がりエッジを示す「1」となる。
なお、回転方向が逆のときは、次に発生するのはB相パルスの立ち下がりエッジであるから、次のエッジ予測値が「3」となる。
以下、回転方向が正回転であるものとして説明を続ける。
At this time, since the rising edge of the A-phase pulse is detected at the time point (1), if the rotation direction is positive at the time point (1) ′, it is the rising edge of the B-phase pulse that occurs next. Can be predicted. Therefore, the next edge prediction value output from the edge prediction / speed calculation unit 39 after time (1) (similar to the latest edge determination signal, values “0” to “3” corresponding to EDF0 to EDF3 are set. Is taken as “1” indicating the rising edge of the B-phase pulse.
When the rotation direction is reversed, the next edge prediction value is “3” because the next occurrence is the falling edge of the B-phase pulse.
Hereinafter, the description will be continued assuming that the rotation direction is forward rotation.

時点(1)’におけるエッジ予測値から、エッジ時間補正値T1cmpを数式4により演算する。 The edge time correction value T 1 cmp is calculated by Equation 4 from the predicted edge value at time (1) ′.

Figure 0004998789
Figure 0004998789

ただし、Nは、前回、B相立ち上がりエッジを検出してから時点(1)’までのサンプリング回数を表し、Tmaxは、サンプリング周期に同期した時間計測カウンタ23の最大値である。 However, N 1 represents the number of times of sampling from the previous detection of the B-phase rising edge to the time point (1) ′, and T max is the maximum value of the time measurement counter 23 synchronized with the sampling period.

数式4における定数(1/2)は、次のエッジが、サンプリング周期の中央で発生すると予測したためである。図6のa点に着目すると、予測誤差は次に発生するエンコーダパルスがサンプリング周期内のどの点であっても、サンプリング周期の1/2以内となり、検出誤差を最小にすることができる。なお、上記の定数は1/2に限定されるものではなく、状況に応じて変更してもよい。   The constant (1/2) in Equation 4 is because the next edge is predicted to occur at the center of the sampling period. Focusing on point a in FIG. 6, the prediction error is within ½ of the sampling period at any point within the sampling period of the next encoder pulse to be generated, and the detection error can be minimized. In addition, said constant is not limited to 1/2, You may change according to a condition.

エッジ予測・速度演算部39は、前回のB相パルスの立ち上がりエッジに対応する時間計測値、数式4のエッジ時間補正値、及び回転方向から、数式5により速度nを計算する。   The edge prediction / speed calculation unit 39 calculates the speed n according to Expression 5 from the time measurement value corresponding to the rising edge of the previous B-phase pulse, the edge time correction value of Expression 4, and the rotation direction.

Figure 0004998789
Figure 0004998789

ただし、T1MEM1は、前回のB相パルスの立ち上がりエッジを検出した際の時間計測値であり、今回のサンプルタイミングではエッジを検出していないので、更新されない。 However, T1MEM1 is a time measurement value when the rising edge of the previous B-phase pulse is detected, and is not updated because the edge is not detected at the current sample timing.

ここで、本実施形態によるエッジ時間補正値を用いた時間計測方法と従来技術による時間計測方法との違いについて説明する。
図6の時点(1)’において、従来技術では、最新エッジであるA相パルスの立ち上がりエッジに対応する時間計測値T0MEM1にサンプリング周期に応じた時間計測値Tmaxを加え、数式6により速度nを演算している。
Here, the difference between the time measurement method using the edge time correction value according to the present embodiment and the time measurement method according to the prior art will be described.
At time (1) ′ in FIG. 6, in the prior art, the time measurement value T max corresponding to the sampling period is added to the time measurement value T 0MEM1 corresponding to the rising edge of the A-phase pulse which is the latest edge, n is calculated.

Figure 0004998789
Figure 0004998789

ここで、図7は、従来技術により速度を演算した場合と、本実施形態により速度を演算した場合の時間計測誤差の関係を示したタイミングチャートである。いま、真のパルス幅の時間計測値をTとし、どのエッジで検出してもパルス幅は同一、すなわち真の速度に変化がないものとする。図7において、▽はサンプルタイミングを表し、このタイミング▽の各点で速度検出演算を行う。 Here, FIG. 7 is a timing chart showing the relationship between the time measurement error when the speed is calculated according to the conventional technique and when the speed is calculated according to the present embodiment. Now, assume that the time measurement value of the true pulse width is T 0, and the pulse width is the same regardless of which edge is detected, that is, the true speed does not change. In FIG. 7, ▽ represents a sample timing, and speed detection calculation is performed at each point of this timing タ イ ミ ン グ.

図7の時点(1)においては、従来技術でも本実施形態でもA相パルスの立ち上がりエッジを検出しているため、前回及び今回の時間計測値T0MEM0,T0MEM1を用いて演算した速度検出値は同一であり、理論上誤差は発生しない。
しかし、時点(2)では、時点(1)と(2)との間にエッジを検出していないため、従来技術と本実施形態では、時間計測値に差異が生じる。すなわち、従来技術では、直前のA相パルスの立ち上がりエッジに対応する時間計測値を用いて計算するので、図7に示すように、真の時間計測値に対して数式7で示す誤差Errconvが発生する。
Since the rising edge of the A-phase pulse is detected at the time point (1) in FIG. 7 in both the conventional technique and the present embodiment, the speed detection value calculated using the previous and current time measurement values T 0MEM0 and T 0MEM1. Are the same and theoretically no error occurs.
However, since no edge is detected between the time points (1) and (2) at the time point (2), there is a difference in time measurement values between the conventional technique and the present embodiment. In the conventional art, since calculated using the time measurement value corresponding to the rising edge of the immediately preceding A-phase pulse, as shown in FIG. 7, error E Rrconv indicated by Equation 7 with respect to true time measurements appear.

Figure 0004998789
Figure 0004998789

一方、本実施形態における誤差Errpropは、図7より、数式8によって表される。 On the other hand, the error E rrprop in the present embodiment is expressed by Equation 8 from FIG.

Figure 0004998789
Figure 0004998789

図7から明らかなように、ErrTc(=Errprop)はErrT+ErrTa(=Errconv)より小さく、時間計測誤差が大幅に低減できていることが分かる。これは、従来技術では、最新のエッジからサンプリング周期分のTmaxを加えるため、エッジを検出したサンプルタイミングの次のサンプルタイミングで、少なくともErrTという時間計測誤差が生まれる。この誤差ErrTは時間計測値の真値Tの3/4に相当し、速度検出誤差に大きく影響する。
一方、本実施形態では、次に発生するエッジをもとに時間計測を行い、かつ予測エッジの位置をサンプリング周期の中央とするためErrTは発生せず、時間計測値の誤差は真値Tの1/4未満となり、従来技術に対して少なくとも1/3に誤差を縮小できる。
As is apparent from FIG. 7, E rrTc (= E rrprop ) is smaller than E rrT + E rrTa (= E rrconv ), and it can be seen that the time measurement error can be greatly reduced. This is because, in the prior art, since T max corresponding to the sampling period is added from the latest edge, a time measurement error of at least E rrT is generated at the sample timing next to the sample timing at which the edge is detected. This error E rrT corresponds to 3/4 of the true value T 0 of the time measurement value, and greatly affects the speed detection error.
On the other hand, in the present embodiment, time measurement is performed based on the next occurring edge and the position of the predicted edge is set to the center of the sampling period, so that ErrT does not occur, and the error of the time measurement value is the true value T It becomes less than 1/4 of 0 , and the error can be reduced to at least 1/3 of the prior art.

図8は、本実施形態と従来技術により速度検出を行った場合のシミュレーション結果を示しており、横軸は時間を、縦軸は速度を示している。このシミュレーションでは、真の速度を10r/min(1分間あたり10回転)とし、演算方式のみ従来技術と本実施形態との二通りにして演算結果を比較した。なお、エッジの検出方法やカウンタのクロック周波数などは同一とした。   FIG. 8 shows a simulation result when speed detection is performed according to the present embodiment and the prior art, in which the horizontal axis indicates time and the vertical axis indicates speed. In this simulation, the true speed was set to 10 r / min (10 revolutions per minute), and the calculation results were compared in only two ways, the conventional technique and the present embodiment. The edge detection method and counter clock frequency are the same.

図8より、従来技術では、エッジを検出した次の速度演算周期内にエッジが存在しない場合に誤差が大きくなり、階段状に真値に収束する。一方、本実施形態では、従来技術に比べて誤差が小さく、良好に検出できている。
従来技術のように検出値に誤差が大きいと、検出値をもとにして速度制御を行っている場合には、トルクリプルが増大する恐れがあり好ましくない。これに対し、本実施形態では、検出値の誤差を従来技術に対して大幅に低減できるため、トルクリプルなどの影響を低減することができる。
From FIG. 8, in the prior art, when there is no edge within the next speed calculation period after detecting the edge, the error increases and converges to a true value in a stepwise manner. On the other hand, in the present embodiment, the error is smaller than that of the prior art, and the detection is good.
If the detected value has a large error as in the prior art, torque ripple may increase when speed control is performed based on the detected value, which is not preferable. On the other hand, in this embodiment, since the error of the detected value can be greatly reduced as compared with the prior art, the influence of torque ripple and the like can be reduced.

次に、図9に示す実施形態は、前記数式4による時間補正値演算用の係数1/2を、前回以前の速度検出値に応じて可変とする予測補正値演算部40をCPU30B内に備えている。
前述したように、時間計測値の誤差は、最大で真値Tの1/4発生する。この誤差はTによって変わるため、図9では、予測エッジの補正値をTに応じて最小となるように演算する。
時間計測値の真値Tは、前回以前に演算した速度検出値をnとすると、数式9によって表すことができる。
Then, in the embodiment shown in FIG. 9, the coefficient 1/2 for time correction value calculation by Equation 4, the prediction correction value calculation unit 40, variable according to the previous previous speed detection value in CPU30B Ru with Tei.
As described above, the error of the time measurement value is 1/4 the occurrence of a true value T 0 at the maximum. Since this error varies depending on T 0 , in FIG. 9 , calculation is performed so that the correction value of the predicted edge is minimized according to T 0 .
The true value T 0 of the time measurement value can be expressed by Equation 9 when the speed detection value calculated before the previous time is n 0 .

Figure 0004998789
Figure 0004998789

ただし、Kは、エンコーダの1回転あたりのパルス数に関係する定数であり、数式5を例にとると、K=4Kが成り立つ。前回以前に演算した速度検出値nとは、エッジを検出したときの誤差が小さい速度検出値でもよいし、前回のサンプルタイミングにおける速度検出値でもよい。
予測補正値演算部40により求められる補正値をk(ただし、0<k<1/2)とすると、図7における時点(2)のように、速度演算周期内にエッジを検出しなかった場合の真値Tとの間の誤差ΔTは、数式10によって表される。
However, K 4 is a constant related to the number of pulses per rotation of the encoder. Taking Equation 5 as an example, K 4 = 4K is established. The speed detection value n 0 calculated before the previous time may be a speed detection value with a small error when an edge is detected, or may be a speed detection value at the previous sample timing.
When the correction value obtained by the predicted correction value calculation unit 40 is k (where 0 <k <1/2), the edge is not detected within the speed calculation cycle as shown in time point (2) in FIG. The error ΔT with respect to the true value T 0 is expressed by Equation 10.

Figure 0004998789
Figure 0004998789

数式10から、ΔT=0となるkを求めると、数式11となる。   When k that satisfies ΔT = 0 is obtained from Equation 10, Equation 11 is obtained.

Figure 0004998789
Figure 0004998789

数式11に数式9を代入すると、数式12が求まる。   Substituting Equation 9 into Equation 11 yields Equation 12.

Figure 0004998789
Figure 0004998789

従って、予測補正値演算部40は数式12により補正値kを演算し、数式4のエッジ時間補正値T1cmpを数式13のように演算する。 Therefore, the prediction correction value calculation unit 40 calculates the correction value k according to Expression 12, and calculates the edge time correction value T 1 cmp of Expression 4 as Expression 13.

Figure 0004998789
Figure 0004998789

数式13の時間補正値をもとに前記同様に数式5を演算し、速度nを求める。なお、Tが非常に大きい(nが非常に小さい)極低速領域では、複数の速度演算周期内でエッジを検出しないときがあるので、Nは1とは限らない。よって、補正値kの上限を1/2として演算すれば、どの速度領域においても誤差を最小にすることができる。
Based on the time correction value of Equation 13, Equation 5 is calculated in the same manner as described above to obtain the speed n. In the extremely low speed region where T 0 is very large (n 0 is very small), an edge may not be detected within a plurality of speed calculation cycles, and thus N 1 is not necessarily 1. Therefore, if the upper limit of the correction value k is calculated as 1/2, the error can be minimized in any speed region.

なお、本発明は数式13の演算方法に限定されるものではなく、使用するエンコーダのパルス数やサンプリング周期に応じてリアルタイムに計算してもよいし、演算量を低減するために、制御開始時に補正値kを一度計算してメモリに記憶しておいてもよい。
また、本発明は、例えば特許文献1の回路構成により複数のエッジの時間計測値を用いて速度を検出する場合にも適用することができ、図1や図9に示した回路構成に何ら限定されるものではない。
Note that the present invention is not limited to the calculation method of Equation 13, and may be calculated in real time according to the number of pulses of the encoder used and the sampling period, or at the start of control in order to reduce the amount of calculation. The correction value k may be calculated once and stored in the memory.
The present invention can also be applied to the case where the speed is detected using the time measurement values of a plurality of edges using the circuit configuration of Patent Document 1, for example, and is not limited to the circuit configurations shown in FIGS. Is not to be done.

本発明の実施形態の主要部を示す構成図である。The main part of the implementation of the invention is a configuration diagram showing. 図1における回転方向検出部の動作を示すタイミングチャートである。Is a timing chart showing the operation of the rotation direction detection unit in FIG. 図1における速度検出動作を示すタイミングチャートである。Is a timing chart showing the velocity detection operation in FIG. 図1における回転方向変化エッジ記憶部の動作を示すタイミングチャートである。Is a timing chart showing the operation of the rotation direction changing edge storage unit in FIG. 図1における速度検出動作を示すフローチャートである。Is a flowchart showing the speed detection operation in FIG. 図1における最新エッジ検出部、エッジ予測・速度演算部等の動作を示すタイミングチャートである。 2 is a timing chart illustrating operations of a latest edge detection unit, an edge prediction / speed calculation unit, and the like in FIG. 1 . 従来技術及び図1による時間計測誤差の関係を示したタイミングチャートである。2 is a timing chart showing a relationship between a conventional technique and a time measurement error according to FIG. 1 . 従来技術及び図1により速度を検出した場合のシミュレーション結果を示す図である。It is a figure which shows the simulation result at the time of detecting a speed by a prior art and FIG . 本発明の実施形態を示す構成図である。Is a block diagram showing an implementation form of the present invention. 従来技術を示す構成図である。It is a block diagram which shows a prior art. 従来技術による速度検出動作を示すフローチャートである。It is a flowchart which shows the speed detection operation | movement by a prior art.

符号の説明Explanation of symbols

21:ラッチ信号作成部
23:時間計測カウンタ
25−1〜25−4:データラッチ
26:エッジ保持部
28−1〜28−4:データラッチ
29:エッジ変化情報保持部
30A,30B:CPU
31:コントローラ
32:回転方向検出部
33:回転方向保持部
34:回転方向変化エッジ記憶部
35−1〜35−4,36,37:記憶部
38:最新エッジ検出部
39:エッジ予測・速度演算部
40:予測補正値演算部
21: Latch signal creation unit 23: Time measurement counter 25-1 to 25-4: Data latch 26: Edge holding unit 28-1 to 28-4: Data latch 29: Edge change information holding unit 30A, 30B: CPU
31: Controller 32: Rotation direction detection unit 33: Rotation direction holding unit 34: Rotation direction change edge storage unit 35-1 to 35-4, 36, 37: Storage unit 38: Latest edge detection unit 39: Edge prediction / speed calculation Unit 40: Prediction correction value calculation unit

Claims (2)

速度検出対象としての回転体に取り付けられたエンコーダの出力パルスから、回転体の回転速度を検出する速度検出装置において、
前記出力パルスのエッジを検出するエッジ検出手段と、
検出されたエッジに基づいて回転体の回転方向を検出する回転方向検出手段と、
速度演算周期に同期した時間を計測する時間計測手段と、
前記エッジ検出手段の出力により前記時間計測手段の時間計測値を保持する時間記憶手段と、
速度演算周期内の前記エッジの変化状態を検出しエッジ変化情報として保持するエッジ変化情報保持手段と、
前記回転方向及びエッジ変化情報から、速度演算周期内に前記エッジの変化がない場合に次に発生するエッジを予測するエッジ予測手段と、
このエッジ予測手段により予測したエッジに対応する時間補正値と、前記時間計測値及び前記回転方向とを用いて回転体の回転速度を演算する演算手段と、
を備え
前回以前の速度演算により得た速度検出値を用いて前記時間補正値を求めることを特徴とする速度検出装置。
In the speed detection device that detects the rotational speed of the rotating body from the output pulse of the encoder attached to the rotating body as a speed detection target,
Edge detection means for detecting an edge of the output pulse;
Rotation direction detection means for detecting the rotation direction of the rotating body based on the detected edge;
A time measuring means for measuring time synchronized with the speed calculation cycle;
Time storage means for holding the time measurement value of the time measurement means by the output of the edge detection means;
Edge change information holding means for detecting a change state of the edge within a speed calculation cycle and holding it as edge change information;
Edge prediction means for predicting the next edge generated when there is no change in the edge within the speed calculation cycle from the rotation direction and edge change information;
A calculation means for calculating the rotational speed of the rotating body using the time correction value corresponding to the edge predicted by the edge prediction means, the time measurement value and the rotation direction;
Equipped with a,
A speed detection apparatus characterized in that the time correction value is obtained using a speed detection value obtained by speed calculation before the previous time .
請求項1に記載した速度検出装置において、
前記演算手段は、前記エッジ予測手段により予測したエッジが将来の速度演算周期内の所定時点に発生すると仮定して前記時間補正値を求め、この時間補正値を前記時間計測値及び前記回転方向と共に用いて回転体の回転速度を演算することを特徴とする速度検出装置。
The speed detection device according to claim 1,
The calculation means obtains the time correction value on the assumption that the edge predicted by the edge prediction means occurs at a predetermined time in a future speed calculation cycle, and calculates the time correction value together with the time measurement value and the rotation direction. A speed detection device using the rotation speed of a rotating body.
JP2007259720A 2007-10-03 2007-10-03 Speed detection device Active JP4998789B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007259720A JP4998789B2 (en) 2007-10-03 2007-10-03 Speed detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007259720A JP4998789B2 (en) 2007-10-03 2007-10-03 Speed detection device

Publications (2)

Publication Number Publication Date
JP2009085924A JP2009085924A (en) 2009-04-23
JP4998789B2 true JP4998789B2 (en) 2012-08-15

Family

ID=40659514

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007259720A Active JP4998789B2 (en) 2007-10-03 2007-10-03 Speed detection device

Country Status (1)

Country Link
JP (1) JP4998789B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4952631B2 (en) * 2008-03-28 2012-06-13 富士電機株式会社 Speed detection device
JP2010117150A (en) * 2008-11-11 2010-05-27 Fuji Electric Systems Co Ltd Velocity detector

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3173174B2 (en) * 1992-10-06 2001-06-04 株式会社明電舎 Speed detector

Also Published As

Publication number Publication date
JP2009085924A (en) 2009-04-23

Similar Documents

Publication Publication Date Title
JP6107557B2 (en) Angle detection device and angle detection method
JP6235505B2 (en) Encoder signal processing apparatus having automatic adjustment function
JP2012042411A (en) Sensor error correction device, sensor error correction method, and program for sensor error correction
Ilmiawan et al. An easy speed measurement for incremental rotary encoder using multi stage moving average method
JP4253372B2 (en) Elevator speed control apparatus and recording medium recording elevator speed detection program
JP4998789B2 (en) Speed detection device
KR102440689B1 (en) Method for computating motor rotor position using hall sensor
JPH06118090A (en) Speed detector
JP4952631B2 (en) Speed detection device
JP2009095154A (en) Motor controller and its speed detection method
JP4998788B2 (en) Speed detection device
JP2010008235A (en) Speed detection device
JP2010117150A (en) Velocity detector
JP5865059B2 (en) Waveform measuring instrument
JP5664895B2 (en) Electric motor control device
JP2003319682A (en) Controller for permanent magnet synchronous motor
KR101056476B1 (en) Low speed mode control device of BCD motor and its control method
EP2651028B1 (en) Estimation of cogging torque
JPH061279B2 (en) Digital speed detector
JP3949134B2 (en) Stepping motor control device
JP2008089409A (en) Rotational speed detector
JP5018793B2 (en) Rotational speed measuring device
JP7327222B2 (en) SPEED DETECTION DEVICE AND SPEED DETECTION METHOD
JP2024000028A (en) Speed detection device and speed detection method
JP4362488B2 (en) Stepping motor drive device

Legal Events

Date Code Title Description
A625 Written request for application examination (by other person)

Free format text: JAPANESE INTERMEDIATE CODE: A625

Effective date: 20100812

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20110422

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120126

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120131

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120402

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120419

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120502

R150 Certificate of patent or registration of utility model

Ref document number: 4998789

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150525

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D02

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250