JP5146963B2 - Encoder error correction method - Google Patents
Encoder error correction method Download PDFInfo
- Publication number
- JP5146963B2 JP5146963B2 JP2008243892A JP2008243892A JP5146963B2 JP 5146963 B2 JP5146963 B2 JP 5146963B2 JP 2008243892 A JP2008243892 A JP 2008243892A JP 2008243892 A JP2008243892 A JP 2008243892A JP 5146963 B2 JP5146963 B2 JP 5146963B2
- Authority
- JP
- Japan
- Prior art keywords
- output
- value
- pulse
- generation circuit
- absolute 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
Links
Images
Landscapes
- Transmission And Conversion Of Sensor Element Output (AREA)
Description
本発明は、可動被検出物の変位の絶対値を検出し、その絶対値に基づきパルス発生回路から出力される出力パルスの補正方法に関する The present invention relates to a method for correcting an output pulse output from a pulse generation circuit based on the absolute value of a displacement of a movable object to be detected.
従来より、可動被検出物の変位量や変位の絶対値を検出する装置として、磁気式エンコーダが知られている。例えば、磁気式エンコーダの一態様としては、1極対のマグネットを回転させ、その磁界変化をMR素子で検出し、得られたSin信号及びCos信号をAD変換してマイコンに取り込み、両信号の逆正接(アークタンジェント)信号を計算し、その逆正接信号を利用することによってマグネットの回転位置の絶対値を検出するものがある(例えば特許文献1)。このような磁気式エンコーダにおいて、その絶対値に基づきパルス発生回路を通じてパルスを出力する場合には、マイコン内部で今回の絶対値から前回(1サンプル前)の絶対値を減算した差分値をパルス発生回路に入力するようにしている。 2. Description of the Related Art Conventionally, a magnetic encoder is known as a device that detects the amount of displacement of a movable object to be detected and the absolute value of the displacement. For example, as one aspect of the magnetic encoder, one pole pair of magnets is rotated, the magnetic field change is detected by an MR element, and the obtained Sin signal and Cos signal are AD-converted into a microcomputer, There is one that detects an absolute value of a rotational position of a magnet by calculating an arc tangent signal and using the arc tangent signal (for example, Patent Document 1). In such a magnetic encoder, when a pulse is output through the pulse generation circuit based on the absolute value, the difference value obtained by subtracting the previous absolute value (one sample previous) from the current absolute value is generated in the microcomputer. Input to the circuit.
しかしながら、マイコンの内部でパルス出力を高分解能化するように設定されている絶対値に対して出力分解能を変換(補正)する場合には、今回の絶対値から前回の絶対値を差し引いた差分値に対してシフト演算等により低分解能化を行う。低分解能化されて出力されるパルス数は、低分解能演算時に切り捨てられた小数部分によりマイコン内部の絶対値から位置がずれてしまうため、分解能変換したことに起因して出力パルスの精度が低下する。具体的には、図7を用いて説明する。図7は、従来のエンコーダにおける出力パルスの補正方法を説明するためのブロック図である。 However, when converting (correcting) the output resolution to the absolute value that is set to increase the resolution of the pulse output inside the microcomputer, the difference value obtained by subtracting the previous absolute value from the current absolute value The resolution is reduced by shift operation or the like. The number of pulses output with low resolution is shifted from the absolute value inside the microcomputer due to the fractional part that was discarded during low-resolution calculations, so the accuracy of the output pulse decreases due to resolution conversion. . Specifically, this will be described with reference to FIG. FIG. 7 is a block diagram for explaining an output pulse correction method in a conventional encoder.
図7に示すように、マイコンの内部でパルス出力を高分解能化するように設定されているABS_POSは、遅延器101の機能により、前回(1サンプル前)のABS_POSが減算される。そして、その差分値δが、2xで除算する演算器102によって低分解能化される。最後に、演算器102の出力値の整数部分がパルス発生回路103に入力される。このような一連の処理によって出力パルスを補正する場合、パルス発生回路103の入力は小数部が切り捨てられているため、ABS_POSに対して出力パルスの中に誤差が累積することになる。その結果、出力パルスの精度低下を招来してしまう。
As shown in FIG. 7, the ABS_POS set to increase the resolution of the pulse output inside the microcomputer is subtracted from the ABS_POS of the previous time (one sample before) by the function of the
本発明は、このような点に鑑みてなされたものであり、その目的は、分解能変換等の処理を行った場合であっても、出力パルスの精度低下を防ぐことが可能な出力パルスの補正方法を提供することにある。 The present invention has been made in view of such points, and its purpose is to correct an output pulse that can prevent a decrease in accuracy of the output pulse even when processing such as resolution conversion is performed. It is to provide a method.
以上のような課題を解決するために、本発明は、以下のものを提供する。 In order to solve the above problems, the present invention provides the following.
(1) 可動被検出物の変位に対応してA相センサから出力される正弦波状のA相信号と、当該可動被検出物の変位に対応してB相センサから出力される正弦波状のB相信号と、を解析することによって当該可動被検出物の変位の絶対値を検出し、当該絶対値に基づきパルス発生回路から出力される出力パルスの補正方法において、前記パルス発生回路の入力値の整数部分を累積加算する第1ステップと、前記第1ステップの出力値に、所定数の整数乗からなる分解能変換値を乗ずる第2ステップと、前記絶対値から、前記第2ステップの出力値を減算する第3ステップと、前記第3ステップの出力値を前記分解能変換値で除算する第4ステップと、前記第4ステップの出力値の整数部分を前記パルス発生回路に入力する第5ステップと、を含むことを特徴とする出力パルスの補正方法。 (1) A sine wave A phase signal output from the A phase sensor in response to the displacement of the movable object to be detected, and a sine wave B to be output from the B phase sensor in response to the displacement of the movable object to be detected. In the method for correcting the output pulse output from the pulse generation circuit based on the absolute value, the absolute value of the displacement of the movable detection object is detected by analyzing the phase signal, and the input value of the pulse generation circuit A first step of accumulatively adding integer parts; a second step of multiplying an output value of the first step by a resolution conversion value comprising a predetermined number of integer powers; and an output value of the second step from the absolute value. A third step of subtracting, a fourth step of dividing the output value of the third step by the resolution conversion value, a fifth step of inputting an integer part of the output value of the fourth step to the pulse generating circuit, The Method of correcting the output pulse characterized by Mukoto.
本発明によれば、まず、A相センサ及びB相センサから出力される正弦波状のA相信号及びB相信号を用いて、可動被検出物の変位の絶対値を検出する。そして、その絶対値に基づきパルス発生回路から出力される出力パルスを補正(ここでは分解能変換)するにあたって、パルス発生回路の入力値の整数部分を累積加算した後、所定数(例えば2)の整数乗からなる分解能変換値を乗ずる。その結果得られた値を、上述の絶対値から減算した後、分解能変換値で除算する(ここで低分解能化する)。最後に、その結果得られた値の整数部分をパルス発生回路に入力する。このような一連の処理によって、出力パルスの精度低下を防ぐことができる。 According to the present invention, first, the absolute value of the displacement of the movable object to be detected is detected using the sinusoidal A phase signal and B phase signal output from the A phase sensor and the B phase sensor. Then, when correcting (in this case, resolution conversion) the output pulse output from the pulse generation circuit based on the absolute value, the integer part of the input value of the pulse generation circuit is cumulatively added, and then a predetermined number (for example, 2) integers Multiply the resolution conversion value consisting of power. The value obtained as a result is subtracted from the above absolute value and then divided by the resolution conversion value (here, the resolution is lowered). Finally, the integer part of the resulting value is input to the pulse generation circuit. By such a series of processes, it is possible to prevent a reduction in accuracy of the output pulse.
すなわち、補正の一つとして分解能を変換する場合、従来のように今回絶対値と前回絶対値の差分をとるのではなく、切り捨て誤差を含む差分値を積算することで推定出力位置(所定数の整数乗からなる分解能変換値を乗じた結果得られた値)を作成し、これと今回絶対値との差分をとるようにしている(誤差を含む推定出力位置をフィードバックし、これと今回絶対値との差分をとるようにしている)。したがって、マイコン内部の絶対値と出力した位置との位置のズレが一定範囲以上になるのを防ぐことができ、ひいては出力パルスの精度低下を防ぐことができる。 That is, when converting the resolution as one of the corrections, instead of taking the difference between the current absolute value and the previous absolute value as in the prior art, the estimated output position (predetermined number of A value obtained by multiplying the resolution conversion value consisting of an integer power) is created, and the difference between this value and the current absolute value is calculated (feedback of the estimated output position including the error, and this absolute value) The difference is taken between). Therefore, it is possible to prevent the positional deviation between the absolute value inside the microcomputer and the output position from exceeding a certain range, and thus to prevent the accuracy of the output pulse from being lowered.
なお、パルス発生回路の入力値の整数部分を「累積加算」する第1ステップについて、例えば、パルス発生回路の入力値の整数部分が1,1,1,2,2とした場合、第1ステップの出力は、1,2,3,5,7となる。このように、第1ステップは累積的に加算していくことを意味する。 The first step of “cumulatively adding” the integer part of the input value of the pulse generation circuit is, for example, the first step when the integer part of the input value of the pulse generation circuit is 1, 1, 1, 2, 2. Are 1, 2, 3, 5, and 7. As described above, the first step means cumulative addition.
(2) 可動被検出物の変位に対応してA相センサから出力される正弦波状のA相信号と、当該可動被検出物の変位に対応してB相センサから出力される正弦波状のB相信号と、を解析することによって当該可動被検出物の変位の絶対値を検出し、当該絶対値に基づきパルス発生回路から出力される出力パルスの補正方法において、前記パルス発生回路の入力値を累積加算する第1ステップと、前記絶対値から、前記第1ステップの出力値を減算する第2ステップと、前記第2ステップの出力値を、前記パルス発生回路の最大周波数を制限するためのリミット回路に入力する第3ステップと、前記リミット回路の出力を前記パルス発生回路に入力する第4ステップと、を含むことを特徴とする出力パルスの補正方法。 (2) A sine wave A phase signal output from the A phase sensor in response to the displacement of the movable object to be detected, and a sine wave B to be output from the B phase sensor in response to the displacement of the movable object to be detected. In the method of correcting the output pulse output from the pulse generation circuit based on the absolute value, the input value of the pulse generation circuit is obtained by detecting the absolute value of the displacement of the movable detection object by analyzing the phase signal. A first step for cumulative addition; a second step for subtracting the output value of the first step from the absolute value; and a limit for limiting the maximum frequency of the pulse generating circuit to the output value of the second step. A method for correcting an output pulse, comprising: a third step of inputting to a circuit; and a fourth step of inputting an output of the limit circuit to the pulse generating circuit.
本発明によれば、上述同様、まず、A相センサ及びB相センサから出力される正弦波状のA相信号及びB相信号を用いて、可動被検出物の変位の絶対値を検出する。そして、その絶対値に基づきパルス発生回路から出力される出力パルスを補正(ここではリミット処理)するにあたって、パルス発生回路の入力値を累積加算した後、その結果得られた値を、上述の絶対値から減算する。そして、その結果得られた値を、パルス発生回路の最大周波数を制限するためのリミット回路に入力し、最後に、リミット回路の出力をパルス発生回路に入力する。このような一連の処理によって、出力パルスの精度低下を防ぐことができる。 According to the present invention, as described above, first, the absolute value of the displacement of the movable object to be detected is detected using the sine wave A phase signal and B phase signal output from the A phase sensor and the B phase sensor. Then, in correcting the output pulse output from the pulse generation circuit based on the absolute value (here, limit processing), after accumulating the input values of the pulse generation circuit, the resulting value is used as the absolute value described above. Subtract from the value. Then, the value obtained as a result is input to a limit circuit for limiting the maximum frequency of the pulse generation circuit, and finally, the output of the limit circuit is input to the pulse generation circuit. By such a series of processes, it is possible to prevent a reduction in accuracy of the output pulse.
すなわち、補正の一つとしてリミット処理を施す場合、一度でもリミット処理にかかると差分値に誤差が発生することになるが、本発明では、上述同様、誤差を含む推定出力位置をフィードバックするようにしているので、マイコン内部の絶対値と出力した位置との位置のズレが一定範囲以上になるのを防ぐことができ、ひいては出力パルスの精度低下を防ぐことができる。 In other words, when the limit process is performed as one of the corrections, an error occurs in the difference value if the limit process is performed even once. In the present invention, as described above, the estimated output position including the error is fed back. As a result, it is possible to prevent the positional deviation between the absolute value in the microcomputer and the output position from exceeding a certain range, and thus to prevent a reduction in the accuracy of the output pulse.
(3) 前記可動被検出物はS極とN極の磁極が一対着磁された永久磁石であることを特徴とする出力パルスの補正方法。 (3) The output pulse correction method, wherein the movable object to be detected is a permanent magnet in which a pair of S and N poles are magnetized.
本発明によれば、上述した可動被検出物はS極とN極の磁極が一対着磁された永久磁石であることとしたので、一対着磁された永久磁石の変位の絶対値を検出する場合においても、出力パルスの精度低下を防ぐことができる。特に、多極の磁気式エンコーダと比べて一極対の磁気式エンコーダは、メカ構造がシンプルである。したがって、メカコストを低廉化しつつ、小型化にも対応しやすい。その反面、回路コストは嵩む傾向がある。このような場合であっても、本発明に係る出力パルスの補正方法によれば、回路コストを増大させることなく、ソフトウェア的に出力パルスの精度低下を防ぐことができる。 According to the present invention, since the above-mentioned movable object to be detected is a permanent magnet with a pair of S and N poles magnetized, the absolute value of the displacement of the pair of magnetized permanent magnets is detected. Even in this case, it is possible to prevent a reduction in accuracy of the output pulse. In particular, a single pole pair magnetic encoder has a simple mechanical structure compared to a multipole magnetic encoder. Therefore, it is easy to cope with downsizing while reducing the mechanical cost. On the other hand, circuit cost tends to increase. Even in such a case, according to the output pulse correction method of the present invention, it is possible to prevent a decrease in accuracy of the output pulse in terms of software without increasing the circuit cost.
本発明によれば、演算誤差を含む差分値を積算して推定出力位置をフィードバックするようにしているので、分解能変換やリミット処理などを行った場合であっても、マイコン内部の絶対値と出力した位置のズレが一定範囲以上に大きくなるのを防ぐことができ、ひいては出力パルスの精度低下を防ぐことができる。 According to the present invention, the difference value including the calculation error is integrated and the estimated output position is fed back. Therefore, even when resolution conversion or limit processing is performed, the absolute value and output in the microcomputer are output. It is possible to prevent the deviation of the position from becoming larger than a certain range, and consequently to prevent the accuracy of the output pulse from being lowered.
以下、本発明を実施するための最良の形態について、図面を参照しながら説明する。なお、本明細書中で、低分解能化とは、マイコンの内部で設定している高分解能出力機能に対し、各顧客の出力分解能要求に合わせる為、必要な分解能に落とすことを意味する。また、「顧客が要求する出力分解能(出力分解能)」と「マイコンの内部で設定した分解能」を一致させた場合、シフト演算等の処理は不要となるが、顧客から数種類の出力分解能を要求された場合、要求ごとに対応したマイコンプログラムをラインアップすることとなり、複数機種の開発が必要となる。それに対し、本願機種のように、マイコンの内部を高分解能出力に対応可能にしておけば、顧客要求に合わせた出力分解能をシフト演算処理で対応でき、1機種で複数機種対応が可能となり、開発機種の煩雑さを回避できる。 The best mode for carrying out the present invention will be described below with reference to the drawings. In the present specification, low resolution means that the high resolution output function set inside the microcomputer is reduced to a necessary resolution in order to meet the output resolution requirement of each customer. Also, if the “output resolution required by the customer (output resolution)” and the “resolution set in the microcomputer” are matched, processing such as shift calculation is not required, but the customer requires several types of output resolution. In this case, a microcomputer program corresponding to each request will be lined up, and it will be necessary to develop multiple models. On the other hand, if the inside of the microcomputer can support high-resolution output as in the model of this application, the output resolution matched to customer requirements can be handled by shift calculation processing, and one model can support multiple models. The complexity of the model can be avoided.
[ハードウェア構成]
図1は、本発明の実施の形態に係る出力パルスの補正方法が行われるエンコーダ1のハードウェア構成を示すブロック図である。特に、図1(a)は、ハードウェア構成の概略を示し、図1(b)は、ハードウェア構成のイメージ図を示している。
[Hardware configuration]
FIG. 1 is a block diagram showing a hardware configuration of an
図1(a)及び図1(b)に示すように、エンコーダ1は、MR素子(MR Element)10とマイコン20を有しており、MR素子10からマイコン20に向けて、Cos信号とSin信号が入力される。より具体的には、MR素子10は、可動被検出物の変位に対応して正弦波状のSin信号を出力するA相センサと、可動被検出物の変位に対応して正弦波状のCos信号を出力するB相センサと、を有している。
As shown in FIGS. 1A and 1B, the
ここで、本実施形態では、「可動被検出物」として、S極とN極の磁極が一対着磁された永久磁石50を採用している(図1(b)参照)。また、図1(a)では、A相センサ及びB相センサの一構成要素となるMR素子10しか図示していないが、その他、例えば、整流回路,ローパスフィルタ,差動増幅アンプ,MR素子10に励磁電流を供給するドライバなどの各種電気要素によって、A相センサ及びB相センサが構成される。
Here, in the present embodiment, a
マイコン20は、InterpolatorやRS422ドライバ(Open Collectorでもよい)などの電気要素を有しているが、その他如何なる要素を有していてもよい。また、図1(a)に示すように、A/D変換回路(ADC21)を有しており、ADC21によってアナログ信号はデジタル化される。また、図1では特に図示していないが、マイコン20は、CPU,ROM,RAM等の各種電機要素を有しており、可動被検出物の変位の絶対値を検出する機能はもちろん、出力パルスを補正する機能をも有する。すなわち、ROM等の記憶媒体に出力パルスの補正方法を実行する各種プログラムが格納されており、CPUは、適宜そのプログラムを読み出して、RAMをワーキングエリアとしつつ補正処理を実行する。このように、マイコン20は、A相信号(Sin信号)とB相信号(Sin信号と位相差がπ/2のCos信号)とを解析することによって、永久磁石50の変位の絶対値を検出する機能を有するとともに、分解能変換やリミット処理などの補正処理を行う機能をも有している。なお、図1では図示を省略しているが、マイコン20は、パルス発生回路14(図2参照)を有しており、パルスを出力する機能も有している。
The
[出力パルスの補正方法]
図2は、本発明の第1の実施の形態に係る出力パルスの補正方法を説明するためのブロック図である。図3は、図2に示すブロック図の状態遷移を説明するための説明図である。
[Output pulse correction method]
FIG. 2 is a block diagram for explaining an output pulse correction method according to the first embodiment of the present invention. FIG. 3 is an explanatory diagram for explaining the state transition of the block diagram shown in FIG.
図2において、マイコン20は、2xで除算する演算器11と、2xを乗算する演算器12と、(1サンプル)遅延器13と、パルス発生回路14と、を有している。なお、演算器11や演算器12、遅延器13等は、別個独立の演算器であってもよいし、ソフト的に1個のチップで実現してもよい。また、図中のABS_POSは、マイコンの内部でパルス出力を高分解能化するように設定されている絶対値を示し、図中のδは、ABS_POSからフィードバック値(推定出力位置)を減算した値を示している。
2, the
まず、フィードバックループについて説明する。パルス発生回路14へ入力される値は、第4ステップの処理によって出力された小数を含む出力値S4を、0に近い整数に丸められた値にするための処理を第5ステップにて行う(「0に近い整数に丸められた値にするための処理」を図2中の第5ステップの点線枠内における「Int」で示す)。この処理結果で小数を含む値から0に近い整数に丸められた値(この出力値の状態をS5で定義する)、すなわち、整数部分を累積加算する(図2中の第1ステップの点線枠参照)。この出力値の状態をS6で定義する。
First, the feedback loop will be described. Value input to the
次に、この出力値S6に2のx乗からなる分解能変換値2xを乗ずる(図2中の第2ステップの点線枠)。これは、パルス発生回路14へ入力するために低分解能化した値を、フィードバックループの中で元の高分解能値に戻すためのもので、次のステップでの演算処理の次元を合わせるためのものであり、この出力値の状態をS2で定義する。そして、ABS_POSから、S2の状態にある値を減算する(図2中の第3ステップの点線枠)。そうすると、差分値δが得られる。ABS_POSの状態をS1で定義し、差分値δの状態をS3で定義する。
Then, multiplying the
次に、差分値δを分解能変換値1/2xで除算する(図2中の第4ステップの点線枠)。この出力値は小数を含むものであって、この出力値の状態をS4で定義する。次にS4を前記の0に近い整数にまるめる処理を行う。(図2中の第4ステップの点線枠)。最後に、この小数を含む出力値S4を0に近い整数に丸められた値にするための処理intを行い、整数部分をパルス発生回路14に入力する(図2中の第5ステップの点線枠)。 Next, the difference value δ is divided by the resolution conversion value ½ x (dotted line frame in the fourth step in FIG. 2). The output value is comprise a fraction, to define the state of the output value S 4. Then it performs processing to round the S 4 to an integer close to zero of the. (Dotted line frame in the fourth step in FIG. 2). Finally, a process int for the output value S 4 including the decimal to the value rounded to an integer closer to 0, inputs the integer part to the pulse generation circuit 14 (broken line in the fifth step in FIG. 2 frame).
このような一連の処理を、マイコンの内部でパルス出力を高分解能化するように設定されている絶対値ABS_POSに対して演算器11によって分解能変換を行ったとしても、マイコン20内部で設定している高分解能な絶対値と、低分解能化して出力した位置との位置のズレが一定範囲以上になるのを防ぐことができ、ひいては出力パルスの精度低下を防ぐことができる。
Even if the
図3を用いて、より具体的に説明する。なお、ここでは分解能変換値を1/2としている(すなわち、x=1としている)。例えば、2段目に示すように、ABS_POSの最初の状態S1が2.2であった場合、最初はフィードバックはないためS2=0となる一方で、S3は2.2(=S1−S2)、S4は1.1(=S3/2)、S5は1(=S4の整数部分)、S6は1となる(遅延器13の初期値は0とする)。
This will be described more specifically with reference to FIG. Here, the resolution conversion value is set to 1/2 (that is, x = 1). For example, as shown in the second row, when the first state S 1 of ABS_POS is 2.2, there is no feedback at first, so S 2 = 0, while S 3 is 2.2 (= S 1 -S 2), S 4 is 1.1 (= S 3/2) ,
次に、3段目に示すように、ABS_POSの状態S1が4.4であった場合、演算器12によって、上述したS6の状態(=1)の2倍の値S2がフィードバックされてくるため、差分値δの状態S3は、2.4になる(=S1−S2=4.4−2)。そして、S4は1.2(=S3/2)、S5は1(=S4の整数部分)、S6は2(=S5+遅延器13による1サンプル前のS6=1+1)となる。
Next, as shown in the third row, when the ABS_POS state S 1 is 4.4, the
次に、4段目に示すように、ABS_POSの状態S1が6.6であった場合、演算器12によって、上述したS6の状態(=2)の2倍の値S2がフィードバックされてくるため、差分値δの状態S3は、2.6になる(=S1−S2=6.6−4)。そして、S4は1.3(=S3/2)、S5は1(=S4の整数部分)、S6は3(=S5+遅延器13による1サンプル前のS6=1+2)となる。
Next, as shown in the fourth stage, when the state S 1 of ABS_POS was 6.6, the
以下同様にして演算を進めていく。そして、上から10段目に達すると、ABS_POSの状態S1が19.8であった場合、演算器12によって、1サンプル前のS6の状態(=8)の2倍の値S2がフィードバックされてくるため、差分値δの状態S3は、3.8になる(=S1−S2=19.8−16)。そして、S4は1.9(=S3/2)、S5は1(=S4の整数部分)、S6は9(=S5+遅延器13による1サンプル前のS6=1+8)となる。
Thereafter, the calculation proceeds in the same manner. When reaching the 10 stage from the top, when the state S 1 of ABS_POS was 19.8, the
ここで、累積誤差を計算する。ABS_POSの状態S1が19.8であるため、本来、推定出力位置に対して所定数の整数乗からなる分解能変換値を乗じる前の値、すなわち本実施例では2を乗じる前の値(S6の状態)は19.8÷2=9.9でなければならない。しかし、実際のS6の状態は9となっていることから、累積誤差は0.9であることが分かる。 Here, the cumulative error is calculated. Since the state S 1 of ABS_POS is 19.8 originally value before multiplying the resolution conversion values of a predetermined integer number of power for the estimated output position, i.e. the value before multiplying the 2 in the present embodiment (S 6 state) must be 19.8 ÷ 2 = 9.9. However, since the actual state of S 6 is 9, it can be seen that the cumulative error is 0.9.
しかし、上から11段落目に示すように、ABS_POSの状態S1が22.0であった場合、演算器12によって、1サンプル前のS6の状態(=9)の2倍の値S2がフィードバックされてくるため、差分値δの状態S3は、4.0になる(=S1−S2=22−18)。そして、S4は2(=S3/2)、S5は2(=S4の整数部分)、S6は11(=S5+遅延器13による1サンプル前のS6=2+9)となる。
However, as shown in 11 paragraph from the top, when the state S 1 of ABS_POS was 22.0,
ここで、再び累積誤差を計算する。ABS_POSの状態S1が22.0であるため、推定出力位置に対し所定数の整数乗からなる分解能変換値を乗じる前の値、すなわち本例では2を乗じる前の値(S6の状態)は22÷2=11でなければならないところ、実際のS6の状態は11となっており、累積誤差は0であることが分かる。このように、S5の状態の整数部分が1上がるタイミングで、累積誤差がキャンセルされていることが分かる。 Here, the cumulative error is calculated again. Since the state S 1 of ABS_POS is 22.0, the value before multiplying the resolution conversion values of a predetermined number of integral power with respect to the estimated output position, i.e. the value before multiplying the 2 in this example (the state S 6) Where 22 ÷ 2 = 11, the actual state of S 6 is 11, and it can be seen that the cumulative error is 0. Thus, at the timing when the integer part of the state of the S 5 increases 1, it can be seen that the accumulated error is canceled.
[実施形態の主な効果]
以上説明したように、本実施形態に係る出力パルスの補正方法によれば、演算誤差を含む差分値を積算して推定出力位置(図2ではS6の状態)をフィードバックするようにしているので、演算器11によって分解能変換(図2では1/2の低分解能化)を行った場合であっても、マイコン内部の絶対値と出力した位置のズレが一定範囲(図2では0.9)以上に大きくなるのを防ぐことができ、ひいては出力パルスの精度低下を防ぐことができる。また、本実施形態では一極対の(永久磁石50を用いた)磁気式エンコーダを想定しており、回路コストを抑えつつ、出力パルスの精度低下を防ぐことができる。
[Main effects of the embodiment]
As described above, according to the method of correcting the output pulse according to the present embodiment, since the estimated output position by multiplying the difference value comprising a calculation error are to be fed back (the state in FIG. 2 S 6) Even when resolution conversion is performed by the computing unit 11 (in FIG. 2, the resolution is reduced to 1/2), the deviation between the absolute value in the microcomputer and the output position is within a certain range (0.9 in FIG. 2). It can be prevented from becoming larger than that, and as a result, a reduction in accuracy of the output pulse can be prevented. Further, in the present embodiment, a magnetic encoder of a single pole pair (using the permanent magnet 50) is assumed, and a reduction in the accuracy of the output pulse can be prevented while suppressing the circuit cost.
具体的には、本実施形態に係る出力パルスの補正方法によれば、図8(b)に示すように段階状に出力パルスの補正ができる。図8(a)は従来の補正方法による結果をグラフ化したものであり、図8(b)は本実施形態に係る補正方法による結果をグラフ化したものである。 Specifically, according to the output pulse correction method according to the present embodiment, the output pulse can be corrected stepwise as shown in FIG. FIG. 8A is a graph of the result of the conventional correction method, and FIG. 8B is a graph of the result of the correction method according to the present embodiment.
図8(a)、(b)において破線で示す線は、累積誤差がない場合の出力パルスの累積数の変化を表わしており、本来であれば、この累積数の変化となることが好ましい。しかしながら、図(8a)に示すように、従来の補正方法では、サンプリングステップの度、すなわち、時間が経つにつれて(永久磁石50が回転するにつれて)、次第に、誤差が大きくなっていくのが分かる。
8A and 8B, the line indicated by a broken line represents a change in the cumulative number of output pulses when there is no cumulative error. Originally, the cumulative number is preferably changed. However, as shown in FIG. 8A, it can be seen that in the conventional correction method, the error gradually increases with each sampling step, that is, with time (as the
一方、図8(b)に示すように、本実施形態に係る補正方法では、階段状に補正されるので、破線で示す線に追従しているのが分かる。すなわち、誤差は累積されることなく、一定の誤差が生じた場合であっても、本来の累積誤差のない範囲に補正されるので、出力パルスの精度低下を防ぐことができる。 On the other hand, as shown in FIG. 8B, the correction method according to the present embodiment corrects in a staircase pattern, so that it follows that the line indicated by the broken line follows. In other words, the error is not accumulated, and even if a certain error occurs, the error is corrected to a range without the original accumulated error, so that it is possible to prevent a reduction in accuracy of the output pulse.
[変形例]
図4〜図6は、本発明の第2の実施の形態に係る出力パルスの補正方法を説明するためのブロック図である。図4は、リミット処理を行わない場合における従来のブロック図を示し、図5は、リミット処理を行う場合における従来のブロック図を示し、図6は、リミット処理を行う場合における本実施形態のブロック図を示している。
[Modification]
4 to 6 are block diagrams for explaining the output pulse correction method according to the second embodiment of the present invention. FIG. 4 shows a conventional block diagram when the limit process is not performed, FIG. 5 shows a conventional block diagram when the limit process is performed, and FIG. 6 shows a block of the present embodiment when the limit process is performed. The figure is shown.
図4に示すように、従来は、差分値に対して分解能変換を行うのではなく、絶対値ABS_POSに対して分解能変換21(低分解能化)を行っている。そして、パルス発生回路23には、遅延器22により、分解能変換後のPOS'から、1サンプル前の分解能変換後のPOS'が減算された値δが入力されるようになっている。
As shown in FIG. 4, conventionally, resolution conversion 21 (lower resolution) is performed on the absolute value ABS_POS, instead of performing resolution conversion on the difference value. The
この場合は、特に誤差は生じない。しかし、図5に示すように、パルス発生回路23の最大周波数制限のため、δの値にリミット値が必要になると、問題が生ずる。具体的には、分解能変換31によって低分解能化されたPOS'は、遅延器32によってδとなった後、リミット回路33を経てδlimとなった後に、パルス発生回路34に入力されている。そうすると、δとδlimとは異なる値になるため、一度でもリミットにかかってしまうと誤差が発生することになる。
In this case, no particular error occurs. However, as shown in FIG. 5, a problem arises when a limit value is required for the value of δ due to the maximum frequency limitation of the
そこで、図6に示すように、本発明の第2の実施の形態に係る出力パルスの補正方法によれば、この誤差を減らすことができる。具体的には、分解能変換41によって低分解能化されたPOS'から、演算誤差を含む差分値δlimを遅延器44によって積算してフィードバックした推定出力を減算する。そうして得られたδをリミット回路42に入力するようにしている。
Therefore, as shown in FIG. 6, according to the output pulse correction method according to the second embodiment of the present invention, this error can be reduced. Specifically, the estimated output obtained by integrating and feeding back the difference value δlim including the calculation error by the
すなわち、パルス発生回路43の入力値δlimを累積加算し(図6中の第1ステップの点線枠)、絶対値POS'から、第1ステップの出力値を減算してδを求め(図6中の第2ステップの点線枠)、このδを、パルス発生回路43の最大周波数を制限するためのリミット回路42に入力し(図6中の第3ステップの点線枠)、最後に、リミット回路42の出力をパルス発生回路43に入力している(図6中の第4ステップの点線枠)。これにより、リミット処理を行った場合であっても、上述した第1の実施の形態のように、マイコン内部の絶対値と出力した位置のズレが一定範囲以上に大きくなるのを防ぐことができ、ひいては出力パルスの精度低下を防ぐことができる。
That is, the input value δlim of the
本発明に係る出力パルスの補正方法は、分解能変換やリミット処理などの補正を行った場合であっても、精度低下を防ぐことが可能なものとして有用である。 The output pulse correction method according to the present invention is useful as a method capable of preventing a decrease in accuracy even when corrections such as resolution conversion and limit processing are performed.
11,12 演算器
13 遅延器
14 パルス発生回路
11, 12
Claims (3)
前記パルス発生回路の入力値の整数部分を累積加算する第1ステップと、
前記第1ステップの出力値に、所定数の整数乗からなる分解能変換値を乗ずる第2ステップと、
前記絶対値から、前記第2ステップの出力値を減算する第3ステップと、
前記第3ステップの出力値を前記分解能変換値で除算する第4ステップと、
前記第4ステップの出力値の整数部分を前記パルス発生回路に入力する第5ステップと、を含むことを特徴とする出力パルスの補正方法。 A sinusoidal A-phase signal output from the A-phase sensor corresponding to the displacement of the movable detection object, and a sine-wave B-phase signal output from the B-phase sensor corresponding to the displacement of the movable detection object In the method of correcting the output pulse output from the pulse generation circuit based on the absolute value, the absolute value of the displacement of the movable detection object is detected by analyzing
A first step of cumulatively adding an integer part of an input value of the pulse generation circuit;
A second step of multiplying the output value of the first step by a resolution conversion value consisting of a predetermined number of integer powers;
A third step of subtracting the output value of the second step from the absolute value;
A fourth step of dividing the output value of the third step by the resolution conversion value;
And a fifth step of inputting an integer part of the output value of the fourth step to the pulse generation circuit.
前記パルス発生回路の入力値を累積加算する第1ステップと、
前記絶対値から、前記第1ステップの出力値を減算する第2ステップと、
前記第2ステップの出力値を、前記パルス発生回路の最大周波数を制限するためのリミット回路に入力する第3ステップと、
前記リミット回路の出力を前記パルス発生回路に入力する第4ステップと、を含むことを特徴とする出力パルスの補正方法。 A sinusoidal A-phase signal output from the A-phase sensor corresponding to the displacement of the movable detection object, and a sine-wave B-phase signal output from the B-phase sensor corresponding to the displacement of the movable detection object In the method of correcting the output pulse output from the pulse generation circuit based on the absolute value, the absolute value of the displacement of the movable detection object is detected by analyzing
A first step of cumulatively adding the input values of the pulse generation circuit;
A second step of subtracting the output value of the first step from the absolute value;
A third step of inputting the output value of the second step to a limit circuit for limiting the maximum frequency of the pulse generation circuit;
And a fourth step of inputting the output of the limit circuit to the pulse generation circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008243892A JP5146963B2 (en) | 2008-09-24 | 2008-09-24 | Encoder error correction method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008243892A JP5146963B2 (en) | 2008-09-24 | 2008-09-24 | Encoder error correction method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010078341A JP2010078341A (en) | 2010-04-08 |
JP5146963B2 true JP5146963B2 (en) | 2013-02-20 |
Family
ID=42208984
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008243892A Active JP5146963B2 (en) | 2008-09-24 | 2008-09-24 | Encoder error correction method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5146963B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101700486B1 (en) * | 2014-12-23 | 2017-01-26 | 창원대학교 산학협력단 | A method for removing encoder error in wireless manual pulse generator |
DE102014119531B4 (en) | 2014-12-23 | 2019-06-27 | Infineon Technologies Ag | sensor circuit |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61207920A (en) * | 1985-03-11 | 1986-09-16 | Shinko Electric Co Ltd | Revolution detector for resolver |
JP4352189B2 (en) * | 1998-08-20 | 2009-10-28 | 株式会社安川電機 | Magnetic encoder and motor with magnetic encoder |
JP2005098735A (en) * | 2003-09-22 | 2005-04-14 | Canon Inc | Position-detecting means and position control means using the same |
JP4682968B2 (en) * | 2006-11-14 | 2011-05-11 | パナソニック株式会社 | Encoder position information interpolation circuit |
-
2008
- 2008-09-24 JP JP2008243892A patent/JP5146963B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2010078341A (en) | 2010-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5281102B2 (en) | Resolver device, resolver angle detection device and method | |
US10429208B2 (en) | Position sensor device and method for providing a filtered position signal | |
CN107860404B (en) | Rotary encoder and absolute angle position detection method for rotary encoder | |
JP2016161530A (en) | Resolver device | |
JP5249158B2 (en) | Encoder offset correction method | |
JP5744567B2 (en) | Motor control device, motor control device manufacturing program, and motor control device manufacturing method | |
JP3372450B2 (en) | Encoder output signal processing device | |
JP5176208B2 (en) | Rotation angle detection method and rotation angle sensor | |
JP5146963B2 (en) | Encoder error correction method | |
JP4515120B2 (en) | Resolver digital angle conversion apparatus and method, and program | |
JP6737999B2 (en) | Control device that outputs voltage command value | |
JP4763329B2 (en) | Control device for power converter | |
JP5190644B2 (en) | Encoder error correction method | |
JP2013238431A (en) | Resolver device | |
JP3312504B2 (en) | Position detection device | |
JP6112832B2 (en) | Angle correction device and rotation angle sensor | |
JP4648243B2 (en) | AC signal measuring instrument and offset adjustment method thereof | |
JP6305573B2 (en) | Angular error correction device and angular error correction method for position detector | |
JP7200560B2 (en) | Servo controller and servo system | |
JP2008008739A (en) | Signal processing system, speed detection system, servomechanism | |
JP6119389B2 (en) | Rotation angle detection device, image processing device, and rotation angle detection method | |
JP6360380B2 (en) | Displacement measuring device, signal processing device and signal processing method | |
JP4763821B2 (en) | Angle correction circuit, RD converter, and angle detection device | |
JP3206273B2 (en) | Digital calculation method of AC electricity quantity | |
JP5124936B2 (en) | POSITION DETECTION DEVICE AND ITS OFFSET CORRECTION METHOD |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110809 |
|
TRDD | Decision of grant or rejection written | ||
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120801 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20120816 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120913 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20121120 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5146963 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: 20151207 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20151207 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20151207 Year of fee payment: 3 |