JP5249158B2 - Encoder offset correction method - Google Patents

Encoder offset correction method Download PDF

Info

Publication number
JP5249158B2
JP5249158B2 JP2009197249A JP2009197249A JP5249158B2 JP 5249158 B2 JP5249158 B2 JP 5249158B2 JP 2009197249 A JP2009197249 A JP 2009197249A JP 2009197249 A JP2009197249 A JP 2009197249A JP 5249158 B2 JP5249158 B2 JP 5249158B2
Authority
JP
Japan
Prior art keywords
offset value
correction
encoder
unit
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
JP2009197249A
Other languages
Japanese (ja)
Other versions
JP2011047824A (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.)
Nidec Sankyo Corp
Original Assignee
Nidec Sankyo Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nidec Sankyo Corp filed Critical Nidec Sankyo Corp
Priority to JP2009197249A priority Critical patent/JP5249158B2/en
Publication of JP2011047824A publication Critical patent/JP2011047824A/en
Application granted granted Critical
Publication of JP5249158B2 publication Critical patent/JP5249158B2/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 an offset value correction technique for correcting an error in the detection result of an angular position in an encoder that detects the angular position of a rotating body.

可動被検出物の変位量や変位の絶対値を検出する装置として、磁気式エンコーダーなどが知られている。かかる磁気式エンコーダーでは、例えば、可動被検出物に連動して1極対の永久磁石(回転体)を回転させ、その磁界変化をMR素子などのセンサ素子で検出することによって得られたSin信号およびCos信号をAD変換した後、Sin信号およびCos信号の逆正接(アークタンジェント)信号を計算し、その逆正接信号を利用することによって永久磁石の角度位置の絶対値を検出する。   2. Description of the Related Art A magnetic encoder or the like is known as a device that detects the amount of displacement of a movable detection object and the absolute value of the displacement. In such a magnetic encoder, for example, a Sin signal obtained by rotating a single pole pair of permanent magnets (rotating bodies) in conjunction with a movable object to be detected and detecting a change in the magnetic field by a sensor element such as an MR element. After the AD conversion of the Cos signal and the Cos signal, an arctangent signal of the Sin signal and the Cos signal is calculated, and the absolute value of the angular position of the permanent magnet is detected by using the arctangent signal.

ここで、逆正接信号の位相をパラメータとし、Sin信号を直交座標系のY座標、Cos信号を直交座標系のX座標としてプロットすると、いわゆるリサージュ波形が得られる(例えば、特許文献1参照)。   Here, when the phase of the arctangent signal is used as a parameter, the Sin signal is plotted as the Y coordinate of the orthogonal coordinate system, and the Cos signal is plotted as the X coordinate of the orthogonal coordinate system, a so-called Lissajous waveform is obtained (see, for example, Patent Document 1).

このようなリサージュ波形は、Sin信号とCos信号がノイズ等のない理想的な信号と仮定すると、中心ズレや歪のない円形となる。しかしながら、実際は、センサ素子のばらつき等によって、中心がずれた円形、すなわち、Y座標とX座標の交点からリサージュ波形の円周上までの距離が異なる場合がある。そのため、エンコーダーを工場から出荷する際には、オフセット値補正幅をかけておくのが一般的である。   If such a Lissajous waveform is assumed that the Sin signal and the Cos signal are ideal signals without noise or the like, the Lissajous waveform has a circular shape with no center shift or distortion. However, in practice, the distance from the intersection of the Y-coordinate and the X-coordinate to the circumference of the Lissajous waveform may differ due to variations in sensor elements or the like. Therefore, when the encoder is shipped from the factory, it is common to apply an offset value correction width.

特開2008−2904号公報JP 2008-2904 A

しかしながら、エンコーダーを工場から出荷する際にオフセット値補正幅をかけた場合でも、MR素子の温度特性や、MR素子の検出信号をAD変換器に入力するまでの増幅回路の温度特性等によって、角度位置の検出結果に誤差が発生するという問題点がある。より具体的には、出荷時のオフセット調整環境と異なる温度条件下でエンコーダーが使用されると、Sin信号とCos信号にオフセット誤差が生じるが、かかる誤差は、使用環境の影響を受けるため、予め予測して対処するのが困難である。   However, even when an offset value correction width is applied when the encoder is shipped from the factory, the angle depends on the temperature characteristics of the MR element, the temperature characteristics of the amplifier circuit until the MR element detection signal is input to the AD converter, and the like. There is a problem that an error occurs in the position detection result. More specifically, when the encoder is used under a temperature condition different from the offset adjustment environment at the time of shipment, an offset error occurs in the Sin signal and the Cos signal. Difficult to predict and deal with.

ここに本願発明者は、出荷以降、エンコーダーを実際に使用している間、オフセット値を逐次補正することを提案するものである。但し、エンコーダーを実際に使用している間にオフセット値を補正する場合、オフセット値を急峻に補正するとエンコーダー出力が大きく変動してエンコーダーを搭載した機器が誤作動するという問題がある一方、オフセット値の補正を緩やかに行なうと検出誤差が発生した状態がいつまでも続くという問題がある。   Here, the present inventor proposes to sequentially correct the offset value while actually using the encoder after shipment. However, when the offset value is corrected while the encoder is actually used, there is a problem that if the offset value is sharply corrected, the encoder output will fluctuate greatly and the device with the encoder will malfunction. If the correction of (2) is performed slowly, there is a problem that a state in which a detection error occurs continues indefinitely.

以上の問題点に鑑みて、本発明の課題は、エンコーダーを実際に使用する度にオフセット値を補正する場合でも、エンコーダー出力を大きく変動させることなく、オフセット値を適正な値に迅速に補正することのできるエンコーダーのオフセット値補正方法を提供することにある。   In view of the above problems, an object of the present invention is to quickly correct an offset value to an appropriate value without greatly changing the encoder output even when the offset value is corrected every time the encoder is actually used. Another object of the present invention is to provide a method for correcting an offset value of an encoder.

上記課題を解決するために、本発明を適用したエンコーダーのオフセット値補正方法では、回転体の回転に連動して変化するセンサ素子の出力信号に基づいて前記回転体の角度位置を検出するエンコーダーにおいて、前記角度位置の検出結果の誤差を解消するために前記出力信号を補正するオフセット値を最適化するにあたって、前記エンコーダーへの電源供給を開始する度に前記オフセット値を補正する補正工程を行ない、当該補正工程では、前記出力信号の理想状態からのズレ量を検出し、当該ズレ量に基づいて前記オフセット値を補正する第1補正工程と、該第1補正工程の後、当該第1補正工程よりも小さなゲインで前記オフセット値を補正する第2補正工程と、を行なうことを特徴とする。   In order to solve the above problems, in an encoder offset value correction method to which the present invention is applied, an encoder that detects an angular position of the rotating body based on an output signal of a sensor element that changes in conjunction with the rotation of the rotating body. In order to optimize the offset value for correcting the output signal in order to eliminate the error in the detection result of the angular position, a correction process for correcting the offset value is performed every time power supply to the encoder is started, In the correction step, a first correction step for detecting a deviation amount of the output signal from an ideal state and correcting the offset value based on the deviation amount; and after the first correction step, the first correction step And a second correction step of correcting the offset value with a smaller gain.

本発明では、エンコーダーを工場から出荷した以降、エンコーダーを実際に使用している期間中、オフセット値の補正を行なう。このため、出荷時のオフセット調整環境と異なる温度環境下でエンコーダーが使用された場合でも、オフセット値は、かかる温度環境に応じた最適な値に更新される。このため、出荷時のオフセット調整環境と異なる温度環境下でエンコーダーが使用された場合でも、オフセット誤差が発生することを防止することができる。また、オフセット値を更新するにあたっては、エンコーダーでの検出動作を開始した際の出力信号の理想状態からのズレ量を検出し、当該ズレ量に基づいて第1補正工程を行なった後、第1補正工程よりも小さなゲインでオフセット値を補正する第2補正工程を行なう。このため、エンコーダーの動作を開始した直後、第1補正工程でオフセット値の補正を急峻に行い、その後、第2補正工程ではオフセット値を穏やかに補正することになる。このため、オフセット値を適正な値に迅速に補正することができるとともに、エンコーダーの出力が大きく変動するという事態が発生しない。   In the present invention, after the encoder is shipped from the factory, the offset value is corrected while the encoder is actually used. For this reason, even when the encoder is used under a temperature environment different from the offset adjustment environment at the time of shipment, the offset value is updated to an optimum value according to the temperature environment. For this reason, even when the encoder is used under a temperature environment different from the offset adjustment environment at the time of shipment, it is possible to prevent an offset error from occurring. Further, when updating the offset value, the amount of deviation of the output signal from the ideal state when the detection operation at the encoder is started is detected, and after performing the first correction step based on the amount of deviation, A second correction step for correcting the offset value with a smaller gain than the correction step is performed. For this reason, immediately after the operation of the encoder is started, the offset value is sharply corrected in the first correction step, and thereafter, the offset value is gently corrected in the second correction step. For this reason, the offset value can be quickly corrected to an appropriate value, and a situation in which the output of the encoder greatly fluctuates does not occur.

本発明において、前記第2補正工程では、該第2補正工程を行なう度に前記出力信号の理想状態からのズレ量を検出するとともに、当該ズレ量に基づいて、前記オフセット値を補正することが好ましい。   In the present invention, in the second correction step, each time the second correction step is performed, a deviation amount from the ideal state of the output signal is detected, and the offset value is corrected based on the deviation amount. preferable.

本発明において、前記第2補正工程では、前記出力信号の理想状態からのズレ量を検出する度に当該ズレ量の総和を算出し、当該総和に基づいて、前記オフセット値に対する補正幅を決定することが好ましい。このように構成すると、オフセット値を最適な値に徐々に近づけることができる。   In the present invention, in the second correction step, the total sum of the shift amounts is calculated every time the shift amount from the ideal state of the output signal is detected, and a correction width for the offset value is determined based on the total sum. It is preferable. If comprised in this way, an offset value can be gradually approached to an optimal value.

本発明において、前記出力信号は、例えば、互いにπ/2の位相差あるいは略π/2の位相差を有するA相信号、およびB相信号であり、前記第1補正工程および前記第2補正工程では、前記A相信号と前記B相信号とに基づいてXY座標軸上にリサージュ波形を形成した際、当該リサージュ波形と前記Y軸とが交差する2つの交点のX軸からの距離が等しく、かつ、前記リサージュ波形と前記X軸とが交差する2つの交点のY軸からの距離が等しくなる方向に前記オフセット値を補正する。このように構成すると、回転体が電気角で270°回転するだけで、リサージュ波形がY軸およびY軸が交差する点を求めることができ、かかる検出結果からズレ量を算出することができる。   In the present invention, the output signals are, for example, an A-phase signal and a B-phase signal having a phase difference of π / 2 or a phase difference of approximately π / 2, and the first correction step and the second correction step. Then, when a Lissajous waveform is formed on the XY coordinate axis based on the A phase signal and the B phase signal, the distance from the X axis at the two intersections where the Lissajous waveform and the Y axis intersect is equal, and The offset value is corrected in a direction in which the distances from the Y axis at the two intersections where the Lissajous waveform and the X axis intersect are equal. With this configuration, the point where the Lissajous waveform intersects the Y axis and the Y axis can be obtained only by rotating the rotating body by an electrical angle of 270 °, and the deviation amount can be calculated from the detection result.

本発明において、前記A相信号はSin波であり、前記B相信号はCos波であることが好ましい。このように構成すると、Sin波のA相信号のピーク値、およびCos波のB相信号のピーク値が各々、リサージュ波形がY軸およびY軸が交差する点に相当する。従って、Sin波のA相信号のピーク値、およびCos波のB相信号のピーク値を求めるだけで、ズレ量を算出することができる。   In the present invention, the A phase signal is preferably a Sin wave, and the B phase signal is preferably a Cos wave. With this configuration, the peak value of the A phase signal of the Sin wave and the peak value of the B phase signal of the Cos wave respectively correspond to the points where the Lissajous waveform intersects the Y axis and the Y axis. Therefore, it is possible to calculate the amount of deviation only by obtaining the peak value of the S-phase A-phase signal and the peak value of the Cos-wave B-phase signal.

本発明では、エンコーダーを工場から出荷した以降、エンコーダーを実際に使用している期間中、オフセット値の補正を行なう。このため、出荷時のオフセット調整環境と異なる温度環境下でエンコーダーが使用された場合でも、オフセット値は、かかる温度環境に応じた最適な値に更新される。このため、出荷時のオフセット調整環境と異なる温度環境下でエンコーダーが使用された場合でも、オフセット誤差が発生することを防止することができる。また、オフセット値を更新するにあたっては、エンコーダーでの検出動作を開始した際の出力信号の理想状態からのズレ量を検出し、当該ズレ量に基づいて第1補正工程を行なった後、第1補正工程よりも小さなゲインでオフセット値を補正する第2補正工程を行なう。このため、エンコーダーの動作を開始した直後、第1補正工程でオフセット値の補正を急峻に行い、その後、第2補正工程ではオフセット値を穏やかに補正することになる。このため、オフセット値を適正な値に迅速に補正することができるとともに、エンコーダーの出力が大きく変動するという事態が発生しない。   In the present invention, after the encoder is shipped from the factory, the offset value is corrected while the encoder is actually used. For this reason, even when the encoder is used under a temperature environment different from the offset adjustment environment at the time of shipment, the offset value is updated to an optimum value according to the temperature environment. For this reason, even when the encoder is used under a temperature environment different from the offset adjustment environment at the time of shipment, it is possible to prevent an offset error from occurring. Further, when updating the offset value, the amount of deviation of the output signal from the ideal state when the detection operation at the encoder is started is detected, and after performing the first correction step based on the amount of deviation, A second correction step for correcting the offset value with a smaller gain than the correction step is performed. For this reason, immediately after the operation of the encoder is started, the offset value is sharply corrected in the first correction step, and thereafter, the offset value is gently corrected in the second correction step. For this reason, the offset value can be quickly corrected to an appropriate value, and a situation in which the output of the encoder greatly fluctuates does not occur.

本発明の実施の形態に係るオフセット値補正方法が行われるエンコーダーのハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the encoder with which the offset value correction method which concerns on embodiment of this invention is performed. 本発明を適用したエンコーダーで用いたマイクロコンピューターの機能を示すブロック図である。It is a block diagram which shows the function of the microcomputer used with the encoder to which this invention is applied. 本発明を適用したエンコーダーで用いたズレ量検出部でズレ量を検出する際に用いられるリサージュ波形の説明図である。It is explanatory drawing of the Lissajous waveform used when detecting the deviation | shift amount with the deviation | shift amount detection part used with the encoder to which this invention is applied. 本発明を適用したエンコーダーで用いたズレ量検出部で行なわれるズレ量検出処理の内容を示すフローチャートである。It is a flowchart which shows the content of the deviation amount detection process performed in the deviation amount detection part used with the encoder to which this invention is applied. 本発明を適用したエンコーダーにおいてオフセット値を補正した場合の具体例を示す説明図である。It is explanatory drawing which shows the specific example at the time of correct | amending an offset value in the encoder to which this invention is applied. 本発明を適用したエンコーダーにおける永久磁石の検出誤差のシミュレーション結果を示す説明図である。It is explanatory drawing which shows the simulation result of the detection error of the permanent magnet in the encoder to which this invention is applied.

図面を参照しながら、本発明を適用したエンコーダーのオフセット値補正方法を説明する。   An encoder offset value correction method to which the present invention is applied will be described with reference to the drawings.

[ハードウェア構成]
図1は、本発明の実施の形態に係るオフセット値補正方法が行われるエンコーダーのハードウェア構成を示すブロック図であり、図1(a)、(b)は、ハードウェア構成の概略を示す説明図、およびハードウェア構成のイメージ図である。
[Hardware configuration]
FIG. 1 is a block diagram showing a hardware configuration of an encoder in which an offset value correction method according to an embodiment of the present invention is performed, and FIGS. 1A and 1B are diagrams showing an outline of the hardware configuration. It is a figure and an image figure of hardware constitutions.

図1(a)、(b)に示すように、本発明を適用したエンコーダー1は、回転体の回転に連動して出力信号が変化するMR素子10(MR Element/センサ素子)と、マイクロコンピューター20とを有しており、本形態では、「回転体」として、S極とN極の磁極が一対着磁された永久磁石11が用いられている。このため、エンコーダー1では、MR素子10からマイクロコンピューター20に向けて、互いにπ/2の位相差あるいは略π/2の位相差を有するSin信号(A相信号)とCos信号(B相信号)とが入力される。より具体的には、MR素子10は、回転体の回転に対応して正弦波状のSin信号を出力するA相センサと、回転体の回転に対応して正弦波状のCos信号を出力するB相センサとを有している。なお、図1(a)では、A相センサおよびB相センサの一構成要素となるMR素子10しか図示していないが、その他、例えば、整流回路、ローパスフィルタ、差動増幅アンプ、MR素子10に励磁電流を供給するドライバなどの各種電気要素によって、A相センサおよびB相センサが構成される。マイクロコンピューター20は、Interpolatorと、RS422ドライバやオープンコレクタなどの電気要素を有しているが、その他如何なる要素を有していてもよい。   As shown in FIGS. 1A and 1B, an encoder 1 to which the present invention is applied includes an MR element 10 (MR Element / sensor element) whose output signal changes in conjunction with the rotation of a rotating body, a microcomputer, and the like. In this embodiment, a permanent magnet 11 in which a pair of S poles and N poles are magnetized is used as the “rotating body”. For this reason, in the encoder 1, the Sin signal (A phase signal) and the Cos signal (B phase signal) having a phase difference of π / 2 or substantially π / 2 from the MR element 10 toward the microcomputer 20. Are entered. More specifically, the MR element 10 includes an A phase sensor that outputs a sinusoidal Sin signal corresponding to the rotation of the rotating body, and a B phase that outputs a sinusoidal Cos signal corresponding to the rotation of the rotating body. And a sensor. In FIG. 1A, only the MR element 10 which is one component of the A-phase sensor and the B-phase sensor is shown, but for example, a rectifier circuit, a low-pass filter, a differential amplifier, and an MR element 10 A phase sensor and a B phase sensor are constituted by various electric elements such as a driver for supplying an exciting current to the. The microcomputer 20 has an interpolator and electrical elements such as an RS422 driver and an open collector, but may have any other elements.

図1(a)に示すように、マイクロコンピューター20は、A/D変換部21を有しており、A/D変換部21によってアナログ信号はデジタル化される。また、図1では特に図示していないが、マイクロコンピューター20は、CPU、ROM、RAM等の各種電気要素を有しており、永久磁石11の角度位置を算出する機能、リサージュ波形を算出する機能に加えて、後述するオフセット値補正機能を有している。すなわち、マイクロコンピューター20では、RAM/ROM等の記憶媒体に上記の機能(永久磁石11の角度位置の算出、リサージュ波形の算出、オフセット値の補正)を実行する各種プログラムが格納されており、CPUは、適宜そのプログラムを読み出して、RAMをワーキングエリアとしつつ、各種処理を実行する。   As shown in FIG. 1A, the microcomputer 20 has an A / D conversion unit 21, and the analog signal is digitized by the A / D conversion unit 21. Although not particularly shown in FIG. 1, the microcomputer 20 has various electric elements such as a CPU, a ROM, and a RAM, and has a function for calculating the angular position of the permanent magnet 11 and a function for calculating a Lissajous waveform. In addition, it has an offset value correction function to be described later. That is, in the microcomputer 20, various programs for executing the above functions (calculation of the angular position of the permanent magnet 11, calculation of the Lissajous waveform, correction of the offset value) are stored in a storage medium such as a RAM / ROM. Reads out the program as appropriate and executes various processes while using the RAM as a working area.

[マイクロコンピューター20の構成]
図2は、本発明を適用したエンコーダーで用いたマイクロコンピューター20の機能を示すブロック図である。
[Configuration of Microcomputer 20]
FIG. 2 is a block diagram showing functions of the microcomputer 20 used in the encoder to which the present invention is applied.

図1に示すエンコーダー1では、MR素子10のばらつき等によって、永久磁石11(回転体)の回転と、MR素子10からの出力信号の波形との関係にズレが発生する場合があるため、エンコーダー1を工場から出荷する際、エンコーダー1には、オフセット値(固定オフセット値)が設定されている。但し、出荷時のオフセット調整環境と異なる温度環境下でエンコーダー1が使用された場合、出荷時に設定された固定オフセット値では、誤差が生じてしまう。そこで、本形態のエンコーダー1では、エンコーダー1を実際に使用している間、オフセット値を逐次補正することができるように、マイクロコンピューター20は以下のように構成されている。   In the encoder 1 shown in FIG. 1, a deviation may occur in the relationship between the rotation of the permanent magnet 11 (rotating body) and the waveform of the output signal from the MR element 10 due to variations in the MR element 10. When the 1 is shipped from the factory, the encoder 1 is set with an offset value (fixed offset value). However, when the encoder 1 is used under a temperature environment different from the offset adjustment environment at the time of shipment, an error occurs with the fixed offset value set at the time of shipment. Therefore, in the encoder 1 of the present embodiment, the microcomputer 20 is configured as follows so that the offset value can be sequentially corrected while the encoder 1 is actually used.

まず、マイクロコンピューター20は、MR素子10からの出力信号(アナログ信号/A相信号およびB相信号)をデジタル信号に変換するA/D変換部21と、最新オフセット値をA/D変換部21の出力から減算するオフセット補正部50とを備えており、オフセット補正部50で算出された信号は角度位置検出部30に出力される。ここで、A/D変換部21は少数部を持たない10ビットのデータであるのに対して、オフセット補正部50で用いられるオフセット値は少数部をもつ14ビットのデータである。このため、MR素子10からの出力信号には、4ビット22が加算されて14ビットのデータに変換される。この4ビット22により0.0625(1/16)の分解能をもつようになる。また、角度位置検出部30は、CORDIC(Coordinate Rotation Digital Computor)アルゴリズムによる角度計算部33を備えている。このため、角度位置検出部30は、14ビットのデータに更に1ビット加算して15ビットに変換する変換部31を備えており、角度計算の精度を上げている。従って、永久磁石11が回転した際の磁界変化をMR素子10で検出し、かかる検出結果(Sin信号およびCos信号)に基づいて、角度計算部33がSin信号およびCos信号の逆正接信号を計算すれば、永久磁石11の角度位置の絶対値を検出することができる。それ故、オフセット補正部50で用いられるオフセット値として、工場出荷前に永久磁石11(回転体)の回転と、MR素子10からの出力信号の波形との関係にズレを補正するためのオフセット値(固定オフセット値COfsA、COfsB)を用いれば、工場出荷前にオフセット調整した環境と同一の温度条件下でエンコーダー1を使用する限り、永久磁石11の角度位置の絶対値を高い精度で検出することができる。   First, the microcomputer 20 includes an A / D converter 21 that converts an output signal (analog signal / A phase signal and B phase signal) from the MR element 10 into a digital signal, and an A / D converter 21 that converts the latest offset value. And an offset correction unit 50 that subtracts from the output of the signal, and the signal calculated by the offset correction unit 50 is output to the angular position detection unit 30. Here, the A / D conversion unit 21 is 10-bit data having no decimal part, whereas the offset value used in the offset correction unit 50 is 14-bit data having a decimal part. For this reason, 4 bits 22 are added to the output signal from the MR element 10 and converted into 14-bit data. This 4 bits 22 has a resolution of 0.0625 (1/16). In addition, the angular position detection unit 30 includes an angle calculation unit 33 based on a CORDIC (Coordinate Rotation Digital Computor) algorithm. For this reason, the angular position detection unit 30 includes a conversion unit 31 that adds 1 bit to 14-bit data and converts it to 15 bits, thereby increasing the accuracy of angle calculation. Therefore, the magnetic field change when the permanent magnet 11 rotates is detected by the MR element 10, and the angle calculation unit 33 calculates the arctangent signal of the Sin signal and the Cos signal based on the detection result (Sin signal and Cos signal). Then, the absolute value of the angular position of the permanent magnet 11 can be detected. Therefore, as an offset value used in the offset correction unit 50, an offset value for correcting a shift in the relationship between the rotation of the permanent magnet 11 (rotating body) and the waveform of the output signal from the MR element 10 before shipment from the factory. By using (fixed offset values COfsA, COfsB), the absolute value of the angular position of the permanent magnet 11 can be detected with high accuracy as long as the encoder 1 is used under the same temperature conditions as the offset adjusted before factory shipment. Can do.

[オフセット値更新部の構成]
本形態では、出荷時のオフセット調整環境と異なる温度環境下でエンコーダー1が使用された場合でも、オフセット値を最適な値に設定することを目的に、エンコーダー1への電源供給を開始する度にオフセット値を補正するオフセット値更新部100が構成されている。かかるオフセット値更新部100は、後述するデータa1、a2とデータb1、b2がそれぞれX軸とY軸の交点から略等距離になるようにオフセット値を加減してそれぞれの誤差を補正するものである。
[Configuration of offset value update unit]
In this embodiment, even when the encoder 1 is used under a temperature environment different from the offset adjustment environment at the time of shipment, every time power supply to the encoder 1 is started for the purpose of setting the offset value to an optimum value. An offset value update unit 100 that corrects the offset value is configured. The offset value update unit 100 corrects each error by adding or subtracting an offset value so that data a1 and a2 and data b1 and b2, which will be described later, are approximately equidistant from the intersection of the X axis and the Y axis, respectively. is there.

本形態において、オフセット値更新部100は概ね、永久磁石11(回転体)の回転と、MR素子10からの出力信号の波形との関係のズレ量ΔA、ΔBを検出するズレ量検出部60と、ズレ量検出部60で検出されたズレ量および固定オフセット値COfsA、COfsBに基づいて最新オフセット値NOfsA、NOfsBを決定する最新オフセット値決定部70と、最新オフセット値決定部70で決定された最新オフセット値NOfsA、NOfsBをオフセット補正部50に出力する最新オフセット値出力部80とを有している。   In the present embodiment, the offset value update unit 100 generally includes a shift amount detection unit 60 that detects the shift amounts ΔA and ΔB of the relationship between the rotation of the permanent magnet 11 (rotary body) and the waveform of the output signal from the MR element 10. The latest offset value determining unit 70 for determining the latest offset values NOfsA and NOfsB based on the amount of deviation detected by the deviation amount detecting unit 60 and the fixed offset values COfsA and COfsB, and the latest determined by the latest offset value determining unit 70 A latest offset value output unit 80 for outputting the offset values NOfsA and NOfsB to the offset correction unit 50;

まず、ズレ量検出部60は、後述するデータa1、a2、b1、b2を取得するデータ取得部61と、データa1、a2、b1、b2が得られたか否かを判別するエラー判別部62と、データa1、a2、b1、b2が適正な位置にあるか否かを確認する取得結果確認部63と、データa1、a2、b1、b2の理想的な位置からのズレ量ΔA、ΔBを算出するズレ量算出部64とを備えている。   First, the deviation amount detection unit 60 includes a data acquisition unit 61 that acquires data a1, a2, b1, and b2, which will be described later, and an error determination unit 62 that determines whether the data a1, a2, b1, and b2 are obtained. The acquisition result confirmation unit 63 for confirming whether or not the data a1, a2, b1, b2 are at appropriate positions, and the deviation amounts ΔA, ΔB from the ideal positions of the data a1, a2, b1, b2 are calculated. And a deviation amount calculation unit 64.

最新オフセット値決定部70は、ズレ量ΔA、ΔBに基づいて今回行なうオフセット更新の際のオフセット値補正幅ΔOfsA、ΔOfsBを決定するオフセット値補正幅決定部78と、オフセット値補正幅決定部78で決定されたオフセット値補正幅ΔOfsA、ΔOfsBに基づいて最新オフセット値NOfsA、NOfsBを算出する最新オフセット値算出部79とを備えている。本形態において、最新オフセット値算出部79は、オフセット値補正幅決定部78で決定されたオフセット値補正幅ΔOfsA、ΔOfsBと、固定オフセット値COfsA、COfsBとを加算して最新オフセット値NOfsA、NOfsBを算出する。   The latest offset value determination unit 70 includes an offset value correction width determination unit 78 that determines offset value correction widths ΔOfsA and ΔOfsB at the time of offset update performed based on the shift amounts ΔA and ΔB, and an offset value correction width determination unit 78. A latest offset value calculation unit 79 that calculates the latest offset values NOfsA and NOfsB based on the determined offset value correction widths ΔOfsA and ΔOfsB. In the present embodiment, the latest offset value calculation unit 79 adds the offset value correction widths ΔOfsA and ΔOfsB determined by the offset value correction width determination unit 78 and the fixed offset values COfsA and COfsB to obtain the latest offset values NOfsA and NOfsB. calculate.

本形態において、オフセット値補正幅決定部78は、電源をオンした以降の補正回数nを監視する補正回数監視部75と、今回の補正が何回目の補正かによって所定のゲインでオフセット値補正幅ΔOfsA、ΔOfsBを算出するオフセット値補正幅算出部72とを備えている。また、本形態において、オフセット値補正幅決定部78は、2回目以降のズレ量ΔA、ΔBを加算してズレ量ΔA、ΔBの積分値SA、SBを求めるズレ量積分部71を備えている。   In this embodiment, the offset value correction width determination unit 78 includes a correction number monitoring unit 75 that monitors the number of corrections n after the power is turned on, and an offset value correction width with a predetermined gain depending on the number of corrections this time. And an offset value correction width calculation unit 72 that calculates ΔOfsA and ΔOfsB. Further, in this embodiment, the offset value correction width determination unit 78 includes a deviation amount integration unit 71 that adds the second and subsequent deviation amounts ΔA and ΔB to obtain the integrated values SA and SB of the deviation amounts ΔA and ΔB. .

ここで、オフセット値補正幅算出部72および最新オフセット値算出部79は、補正回数監視部75での監視結果において、今回の補正が電源をオンした以降、1回目の補正である場合と、2回目以降の補正である場合とでは、処理条件を切り換える。具体的には、今回の補正が電源をオンした以降、1回目の補正である場合、オフセット値補正幅算出部72は、ズレ量ΔA、ΔBに乗じるゲイン2-xのxを1としてオフセット値補正幅ΔOfsA、ΔOfsBを算出し、最新オフセット値算出部79は、かかるオフセット値補正幅ΔOfsA、ΔOfsBと固定オフセット値COfsA、COfsBとを加算して最新オフセット値NOfsA、NOfsBを算出する。 Here, the offset value correction width calculation unit 72 and the latest offset value calculation unit 79 indicate that the current correction is the first correction after the power is turned on in the monitoring result of the correction count monitoring unit 75, and 2 In the case of correction after the first time, the processing conditions are switched. Specifically, when the current correction is the first correction after the power is turned on, the offset value correction width calculation unit 72 sets x of the gain 2- x multiplied by the shift amounts ΔA and ΔB as 1, and the offset value. The correction widths ΔOfsA and ΔOfsB are calculated, and the latest offset value calculator 79 adds the offset value correction widths ΔOfsA and ΔOfsB and the fixed offset values COfsA and COfsB to calculate the latest offset values NOfsA and NOfsB.

これに対して、今回の補正が電源をオンした以降、2回目以降の補正である場合、オフセット値補正幅算出部72は、ズレ量積分部71で算出された値にゲイン2-xに乗じるとともに、ゲイン2-xのxを2としてオフセット値補正幅ΔOfsA、ΔOfsBを算出する。また、最新オフセット値算出部79は、1回目の補正では工場出荷前にオフセット調整された固定オフセット値COfsA、COfsBとし、2回目以降の補正では、1回目の補正で得られた最新オフセット値NOfsA、NOfsBを固定オフセット値COfsA、COfsBとし、かかる固定オフセット値COfsA、COfsBと、オフセット値補正幅ΔOfsA、ΔOfsBとを加算して最新オフセット値NOfsA、NOfsBを算出する。 On the other hand, when the current correction is the second or subsequent correction after the power is turned on, the offset value correction width calculation unit 72 multiplies the value calculated by the deviation amount integration unit 71 by the gain 2- x . At the same time, offset value correction widths ΔOfsA and ΔOfsB are calculated by setting x of gain 2 −x to 2. Further, the latest offset value calculation unit 79 sets the fixed offset values COfsA and COfsB offset adjusted before shipment from the factory in the first correction, and the latest offset value NOfsA obtained in the first correction in the second and subsequent corrections. , NOfsB is set as fixed offset values COfsA and COfsB, and the offset values correction widths ΔOfsA and ΔOfsB are added to the fixed offset values COfsA and COfsB to calculate the latest offset values NOfsA and NOfsB.

(ズレ量検出部60の具体的な構成)
図3は、本発明を適用したエンコーダー1で用いたズレ量検出部60でズレ量ΔA、ΔBを検出する際に用いられるリサージュ波形の説明図である。図4は、本発明を適用したエンコーダー1で用いたズレ量検出部60で行なわれるズレ量検出処理の内容を示すフローチャートである。
(Specific Configuration of Deviation Amount Detection Unit 60)
FIG. 3 is an explanatory diagram of a Lissajous waveform used when the deviation amounts ΔA and ΔB are detected by the deviation amount detection unit 60 used in the encoder 1 to which the present invention is applied. FIG. 4 is a flowchart showing the contents of the shift amount detection process performed by the shift amount detection unit 60 used in the encoder 1 to which the present invention is applied.

本形態のエンコーダー1において、永久磁石11の回転とMR素子10からの出力信号の波形との関係のズレ量を検出するには、以下に説明するように、A相信号とB相信号とに基づいてXY座標軸上にリサージュ波形を形成した際のリサージュ波形とY軸とが交差する2つの交点のX軸からの距離の和に基づいてA相信号のズレ量ΔAが検出される、また、リサージュ波形とX軸とが交差する2つの交点のY軸からの距離の和に基づいてB相信号のズレ量ΔBが検出される。   In the encoder 1 of this embodiment, in order to detect the amount of deviation of the relationship between the rotation of the permanent magnet 11 and the waveform of the output signal from the MR element 10, as described below, the A phase signal and the B phase signal are detected. Based on the sum of the distances from the X-axis of the two intersections where the Lissajous waveform and the Y-axis intersect when the Lissajous waveform is formed on the XY coordinate axis based on the A-phase signal deviation amount ΔA, Based on the sum of the distances from the Y axis at the two intersections where the Lissajous waveform and the X axis intersect, the amount of deviation ΔB of the B phase signal is detected.

より具体的には、まず、ズレ量検出部60において、データ取得部61は、図3(b)、(c)に示すリサージュ波形を算出する。この算出は、マイクロコンピューター20が、A/D変換部21により、所定のサンプリング周期でデジタル化されたSin信号(Sin値)とCos信号(Cos値)を取り込むことで行われる。次に、データ取得部61は、図3(b)、(c)に示すように、第1ステップで算出したXY平面上のリサージュ波形をもとに、リサージュ波形の円周上とX軸で交差する2点のそれぞれの近傍の2点のデータ(b1、b2)を取得する。また、同様にリサージュ波形とY軸で交差する2点のそれぞれの近傍の2点のデータ(a1、a2)を取得する。   More specifically, first, in the deviation amount detection unit 60, the data acquisition unit 61 calculates a Lissajous waveform shown in FIGS. This calculation is performed by the microcomputer 20 taking in the Sin signal (Sin value) and the Cos signal (Cos value) digitized at a predetermined sampling period by the A / D converter 21. Next, as shown in FIGS. 3B and 3C, the data acquisition unit 61 uses the Lissajous waveform on the XY plane calculated in the first step on the circumference of the Lissajous waveform and the X axis. Two points of data (b1, b2) in the vicinity of the two intersecting points are acquired. Similarly, data (a1, a2) of two points in the vicinity of each of the two points intersecting the Lissajous waveform on the Y axis are acquired.

より具体的には、図4(a)において、まず、Cos値がある基準値Lに対し、−L<Cos値<Lを満たすか否かを判断する(ステップS1)。ここで基準値Lは、Cos値が図3(a)に示す0近傍を特定するための値であって、次のような考えで基準値Lの範囲を設定する。図3(a)において、基準値Lの範囲内でのデータのサンプリング数は、永久磁石11の回転速度とA/D変換部21によるサンプリング周期により決定されるが、データa1、a2、b1、b2を特定するためには、データa1、a2、b1、b2の各々に対応する範囲に少なくとも1つ以上は基準値Lの範囲内にサンプリングされたデータが必要である。ここで、基準値Lの範囲を狭く設定した場合、X軸とY軸の「0」近傍により近い範囲を算出することが可能となる。しかしながら、基準値Lの範囲を狭く設定したことにより、サンプリングされたデータがこの基準値Lの範囲に入らない、すなわち、データの欠落のおそれがあり、データa1、a2、b1、b2を特定することができない。このようにデータの欠落が発生した場合には、補正計算が行われない、即ちオフセット値が新しく更新しないため、オフセット値の補正精度が悪くなってしまう。これに対して、基準値Lの範囲を広く設定した場合、サンプリングされたデータが基準値Lの範囲に入りやすくなり、データの欠落のおそれはなくなる。しかしながら、X軸とY軸の「0」近傍の範囲が広がってしまうため、データa1、a2、b1、b2を精度良く特定することができない。そのため、オフセット値の補正の精度も悪くなる。そのため、本実施の形態における基準値Lの範囲の設定は、永久磁石11の回転速度とA/D変換部21によるサンプリング周期の関係から、基準値Lの範囲内において、適切なサンプリング数が確保できるように設定している。   More specifically, in FIG. 4A, first, it is determined whether or not the Cos value satisfies −L <Cos value <L with respect to a certain reference value L (step S1). Here, the reference value L is a value for specifying the vicinity of the Cos value 0 shown in FIG. 3A, and the range of the reference value L is set based on the following idea. In FIG. 3A, the number of data sampling within the range of the reference value L is determined by the rotational speed of the permanent magnet 11 and the sampling period by the A / D conversion unit 21, but the data a1, a2, b1, In order to specify b2, at least one sampled data within the range of the reference value L is required in the range corresponding to each of the data a1, a2, b1, and b2. Here, when the range of the reference value L is set narrow, it is possible to calculate a range closer to the vicinity of “0” on the X axis and the Y axis. However, since the range of the reference value L is set to be narrow, the sampled data does not fall within the range of the reference value L, that is, there is a risk of data loss, and the data a1, a2, b1, b2 are specified. I can't. When data loss occurs in this way, correction calculation is not performed, that is, the offset value is not newly updated, and the correction accuracy of the offset value is deteriorated. On the other hand, when the range of the reference value L is set wide, the sampled data easily enters the range of the reference value L, and there is no fear of data loss. However, since the range in the vicinity of “0” on the X axis and the Y axis is widened, the data a1, a2, b1, b2 cannot be specified with high accuracy. Therefore, the accuracy of offset value correction also deteriorates. Therefore, the setting of the range of the reference value L in the present embodiment ensures an appropriate number of samplings within the range of the reference value L from the relationship between the rotational speed of the permanent magnet 11 and the sampling period by the A / D converter 21. It is set to be possible.

本形態では、図4(a)に示すステップS1の条件式を満たしていなければ(ステップS1:NO)、処理は終了する。一方、この条件を満たしていれば(ステップS1:YES)、データ取得部61は、2点のデータ(a1、a2)を取得する。次にSin値が0以上か否かを判断する(ステップS2)。そして、0以上である場合には(ステップS2:YES)、そのSin値をデータa1として特定し(ステップS3)、0より小さい場合には(ステップS2:NO)、そのSin値をデータa2として特定する(ステップS4)。その際、図2に示すズレ量検出部60において、エラー判別部62は、データa1、a2が適正に得られたか否かを判別し、取得結果確認部63は、データa1、a2の極性が逆であるか否かを確認する。そして、エラー判別部62がデータa1、a2が適正に得られ、かつ、取得結果確認部63がデータa1、a2の極性が逆であると確認したとき、データa1、a2が確定する。   In this embodiment, if the conditional expression in step S1 shown in FIG. 4A is not satisfied (step S1: NO), the process ends. On the other hand, if this condition is satisfied (step S1: YES), the data acquisition unit 61 acquires two points of data (a1, a2). Next, it is determined whether or not the Sin value is 0 or more (step S2). If it is 0 or more (step S2: YES), the Sin value is specified as data a1 (step S3). If it is less than 0 (step S2: NO), the Sin value is used as data a2. Specify (step S4). At that time, in the deviation amount detection unit 60 shown in FIG. 2, the error determination unit 62 determines whether or not the data a1 and a2 are properly obtained, and the acquisition result confirmation unit 63 determines that the polarity of the data a1 and a2 is Check if the opposite is true. Then, when the error determination unit 62 appropriately obtains the data a1 and a2, and the acquisition result confirmation unit 63 confirms that the polarities of the data a1 and a2 are opposite, the data a1 and a2 are determined.

こうして得られたデータa1、a2は、例えば、図3(b)、(c)に示すように、データa1、a2が略円形のリサージュ波形の円周上に位置する。ここで、オフセットがある場合、データa1、a2はそれぞれX軸とY軸の交点Dからの距離が異なる距離となることになる。すなわち、データa1に相当する位置からX軸までの距離と、データa2に相当する位置からX軸までの距離は異なっている。従って、図2に示すズレ量検出部60において、ズレ量算出部64は、データa1、a2のY座標を加算した値(=a1+a2)によりA相のズレ量ΔAを算出する。   For example, as shown in FIGS. 3B and 3C, the data a1 and a2 obtained in this way are located on the circumference of a substantially circular Lissajous waveform. Here, when there is an offset, the data a1 and a2 have different distances from the intersection D of the X axis and the Y axis. That is, the distance from the position corresponding to the data a1 to the X axis is different from the distance from the position corresponding to the data a2 to the X axis. Therefore, in the deviation amount detection unit 60 shown in FIG. 2, the deviation amount calculation unit 64 calculates the deviation amount ΔA of the A phase from the value obtained by adding the Y coordinates of the data a1 and a2 (= a1 + a2).

一方で、マイクロコンピューター20のCPUは、図4(b)に示すように、Sin値が、−L<Sin値<Lを満たすか否かを判断する(ステップS11)。この条件式を満たしていなければ(ステップS11:NO)、処理は終了する。一方、この条件を満たしていれば(ステップS11:YES)、データ取得部61は、2点のデータ(b1、b2)を取得する。次にCos値が0以上か否かを判断する(ステップS12)。そして、0以上である場合には(ステップS12:YES)、そのCos値をデータb1として特定し(ステップS13)、0より小さい場合には(ステップS12:NO)、そのCos値をデータb2として特定する(ステップS14)。その際、図2に示すズレ量検出部60において、エラー判別部62は、データb1、b2が得られたか否かを判別し、取得結果確認部63は、データb1、b2の極性が逆であるか否かを確認する。そして、エラー判別部62がデータb1、b2が適正に得られ、かつ、取得結果確認部63がデータb1、b2の極性が逆であると確認したとき、データb1、b2が確定する。   On the other hand, as shown in FIG. 4B, the CPU of the microcomputer 20 determines whether or not the Sin value satisfies −L <Sin value <L (step S11). If this conditional expression is not satisfied (step S11: NO), the process ends. On the other hand, if this condition is satisfied (step S11: YES), the data acquisition unit 61 acquires two points of data (b1, b2). Next, it is determined whether the Cos value is 0 or more (step S12). If it is 0 or more (step S12: YES), the Cos value is specified as data b1 (step S13). If it is smaller than 0 (step S12: NO), the Cos value is used as data b2. Specify (step S14). At that time, in the deviation amount detection unit 60 shown in FIG. 2, the error determination unit 62 determines whether or not the data b1 and b2 are obtained, and the acquisition result confirmation unit 63 reverses the polarities of the data b1 and b2. Check if it exists. Then, when the error discriminating unit 62 appropriately obtains the data b1 and b2, and the acquisition result confirming unit 63 confirms that the polarities of the data b1 and b2 are opposite, the data b1 and b2 are determined.

こうして得られたデータb1、b2は、例えば、図3(b)、(c)に示すように、データb1、b2が第1ステップで算出した略円形のリサージュ波形の円周上に位置する。ここで、オフセットがある場合、データb1、b2はそれぞれX軸とY軸の交点Dからの距離が異なる距離となる。すなわち、データb1に相当する位置からY軸までの距離と、データb2に相当する位置からY軸までの距離は異なっている。従って、図2に示すズレ量検出部60において、ズレ量算出部64は、データb1、b2のX座標を加算した値(=b1+b2)によりB相のズレ量ΔBを算出する。   For example, as shown in FIGS. 3B and 3C, the data b1 and b2 obtained in this way are located on the circumference of the substantially circular Lissajous waveform calculated in the first step. Here, when there is an offset, the data b1 and b2 have different distances from the intersection D of the X axis and the Y axis. That is, the distance from the position corresponding to the data b1 to the Y axis is different from the distance from the position corresponding to the data b2 to the Y axis. Accordingly, in the shift amount detection unit 60 shown in FIG. 2, the shift amount calculation unit 64 calculates the shift amount ΔB of the B phase from the value (= b1 + b2) obtained by adding the X coordinates of the data b1 and b2.

[オフセット値補正方法]
図5は、本発明を適用したエンコーダーにおいてオフセット値を補正した場合の具体例を示す説明図である。図6は、本発明を適用したエンコーダーにおける永久磁石11(回転体)の検出誤差のシミュレーション結果を示す説明図である。
[Offset value correction method]
FIG. 5 is an explanatory diagram showing a specific example when the offset value is corrected in the encoder to which the present invention is applied. FIG. 6 is an explanatory diagram showing a simulation result of a detection error of the permanent magnet 11 (rotating body) in the encoder to which the present invention is applied.

本形態において、図2に示すオフセット値更新部100は、上記のデータa1、a2とデータb1、b2がそれぞれX軸とY軸の交点から略等距離になるようにオフセット値を加減してそれぞれの誤差を補正するものである。   In this embodiment, the offset value update unit 100 shown in FIG. 2 adjusts the offset values so that the data a1, a2 and the data b1, b2 are approximately equidistant from the intersection of the X axis and the Y axis, respectively. The error is corrected.

本形態のエンコーダー1を機器に搭載した後は、エンコーダー1への電源供給を開始する度にオフセット値を補正する補正工程を行なう。その際、補正工程では、以下に説明するように、エンコーダー1での検出動作を開始した際の出力信号の理想状態からのズレ量ΔA、ΔBを検出し、ズレ量ΔA、ΔBを相殺するようにオフセット値を第1ゲインで補正する最初の第1補正工程と、第1補正工程の後、第1補正工程よりも小さな第2ゲインでオフセット値を補正する第2補正工程とを行なう。なお、A相信号およびB相信号に対するオフセット値の補正方法は同一であるため、以下の説明では、A相信号に対するオフセット値の補正方法のみを説明し、B相信号に対するオフセット値の補正方法の説明は省略する。   After the encoder 1 of this embodiment is mounted on a device, a correction process for correcting the offset value is performed every time power supply to the encoder 1 is started. At that time, in the correction step, as described below, the deviation amounts ΔA and ΔB from the ideal state of the output signal when the detection operation in the encoder 1 is started are detected, and the deviation amounts ΔA and ΔB are canceled out. First, a first correction step for correcting the offset value with the first gain, and a second correction step for correcting the offset value with a second gain smaller than the first correction step are performed after the first correction step. Since the offset value correction method for the A phase signal and the B phase signal is the same, in the following description, only the offset value correction method for the A phase signal will be described, and the offset value correction method for the B phase signal will be described. Description is omitted.

(第1補正工程)
まず、エンコーダー1への電源供給を開始し、永久磁石11が少なくとも135°回転すると、A相信号は、オフセット補正部50による補正が行なわれた後、角度位置算出部30に入力される。かかる最初の工程では、オフセット補正部50で用いられるオフセット値は、固定オフセット値COfsAである。
(First correction process)
First, power supply to the encoder 1 is started, and when the permanent magnet 11 rotates at least 135 °, the A-phase signal is input to the angular position calculation unit 30 after being corrected by the offset correction unit 50. In the first step, the offset value used in the offset correction unit 50 is the fixed offset value COfsA.

その際、まず、1回目のオフセット値更新工程(第1補正工程)を行なう。具体的には、オフセット値更新部100において、ズレ量検出部60は、図4を参照して説明したズレ量ΔAを検出する。次に、最新オフセット値決定部70において、補正回数監視部75が、今回の補正が電源供給を開始してから1回目の補正であると判断した場合(n=1)、オフセット値補正幅決定部78および最新オフセット値算出部79は各々、以下の手順でオフセット値補正幅ΔOfsAおよび最新オフセット値NOfsAを算出する。具体的には、オフセット値補正幅算出部72は、ズレ量ΔAに乗じるゲイン2-xのxを1としてオフセット値補正幅ΔOfsAを算出し、最新オフセット値算出部79は、かかるオフセット値補正幅ΔOfsAと固定オフセット値COfsAとを加算して最新オフセット値NOfsAを算出する。 At that time, first, the first offset value update process (first correction process) is performed. Specifically, in the offset value update unit 100, the deviation amount detection unit 60 detects the deviation amount ΔA described with reference to FIG. Next, in the latest offset value determination unit 70, when the correction count monitoring unit 75 determines that the current correction is the first correction since the start of power supply (n = 1), the offset value correction width determination Each of the unit 78 and the latest offset value calculating unit 79 calculates the offset value correction width ΔOfsA and the latest offset value NOfsA in the following procedure. Specifically, the offset value correction width calculation unit 72 calculates the offset value correction width ΔOfsA by setting x of the gain 2- x multiplied by the deviation amount ΔA to 1, and the latest offset value calculation unit 79 calculates the offset value correction width. The latest offset value NOfsA is calculated by adding ΔOfsA and the fixed offset value COfsA.

ここで、図5に示すように、工場出荷時の固定オフセット値COfsAを「512」とし、今回、データa1、a2が以下の条件
a1+a2=0
を満たすようにオフセット値補正幅するためのオフセット値(最適オフセット値)を「516」とする。かかる条件の場合、ズレ量ΔA(=(a1+a2))は「8」である。
Here, as shown in FIG. 5, the fixed offset value COfsA at the time of factory shipment is set to “512”, and the data a1 and a2 are the following conditions a1 + a2 = 0
An offset value (optimum offset value) for offset value correction width so as to satisfy the condition is “516”. In such a condition, the deviation amount ΔA (= (a1 + a2)) is “8”.

従って、最新オフセット値決定部70において、オフセット値補正幅算出部72は、ズレ量ΔA(=8)に対してゲイン2-x(x=1)を乗算して、オフセット値補正幅ΔOfsA(=4)を算出する。 Accordingly, in the latest offset value determination unit 70, the offset value correction width calculation unit 72 multiplies the deviation amount ΔA (= 8) by the gain 2 −x (x = 1) to obtain the offset value correction width ΔOfsA (= 4) is calculated.

次に、最新オフセット値決定部70において、最新オフセット値算出部79は、オフセット値補正幅決定部78で決定されたオフセット値補正幅ΔOfsA(=4)に対して固定オフセット値COfsA(=512)を加算し、最新オフセット値NOfsA(=516)を求め、最新オフセット値出力部80に出力する。その結果、最新オフセット値出力部80は、最新オフセット値NOfsA(=516)をオフセット補正部50に出力する。   Next, in the latest offset value determination unit 70, the latest offset value calculation unit 79 sets the fixed offset value COfsA (= 512) with respect to the offset value correction width ΔOfsA (= 4) determined by the offset value correction width determination unit 78. To obtain the latest offset value NOfsA (= 516), and outputs it to the latest offset value output unit 80. As a result, the latest offset value output unit 80 outputs the latest offset value NOfsA (= 516) to the offset correction unit 50.

かかる第1補正工程における各値は以下の条件
工場出荷時の固定オフセット値COfsA=512
最適オフセット値=516
ズレ量ΔA=8
オフセット値補正幅ΔOfsA=ΔA/ゲイン2-x=ΔA/2=4
最新オフセット値NOfsA
=固定オフセット値COfsA+オフセット値補正幅ΔOfsA
=516
となるので、最新オフセット値NOfsAは、最適オフセット値(=516)と一致することになる。このようにして、1回目のオフセット値更新工程でのオフセット値補正幅が完了する。
Each value in the first correction step is as follows: Fixed offset value COfsA at factory shipment = 512
Optimal offset value = 516
Amount of deviation ΔA = 8
Offset value correction width ΔOfsA = ΔA / gain 2 −x = ΔA / 2 = 4
Latest offset value NOfsA
= Fixed offset value COfsA + offset value correction width ΔOfsA
= 516
Therefore, the latest offset value NOfsA matches the optimum offset value (= 516). In this way, the offset value correction width in the first offset value update process is completed.

次に、永久磁石11が次の回転を行なうと、A相信号は、オフセット補正部50による補正が行なわれた後、角度位置算出部30に入力される。今回の工程では、オフセット値補正幅部50で用いられるオフセット値は、最新オフセット値NOfsA(=516)である。   Next, when the permanent magnet 11 performs the next rotation, the A-phase signal is input to the angular position calculation unit 30 after being corrected by the offset correction unit 50. In this process, the offset value used in the offset value correction width unit 50 is the latest offset value NOfsA (= 516).

(第2補正工程)
次に、2回目以降のオフセット値更新工程(第2補正工程)を説明する。2回目以降のオフセット値更新工程(第2補正工程)でも、オフセット値更新部100において、ズレ量検出部60は、1回目と同様、図4を参照して説明したズレ量ΔAを検出する。
(Second correction step)
Next, the second and subsequent offset value update steps (second correction step) will be described. In the offset value update process (second correction process) after the second time, in the offset value update unit 100, the shift amount detection unit 60 detects the shift amount ΔA described with reference to FIG. 4 as in the first time.

次に、最新オフセット値決定部70において、補正回数監視部75が、今回の補正が電源供給を開始してから2回目の補正であると判断すると(n>2)、オフセット値補正幅決定部78および最新オフセット値算出部79は各々、以下の手順でオフセット値補正幅ΔOfsAおよび最新オフセット値NOfsAを算出する。具体的には、ズレ量積分部71は、2回目以降のズレ量ΔAを加算してズレ量ΔAの積分値SAを求め、オフセット値補正幅算出部72は、ズレ量ΔAに乗じるゲイン2-xのxを2としてオフセット値補正幅ΔOfsAを算出し、最新オフセット値算出部79は、かかるオフセット値補正幅ΔOfsAと固定オフセット値COfsAとを加算して最新オフセット値NOfsAを算出する。ここで、最新オフセット値算出部79は、1回目の補正で得られた最新オフセット値NOfsA(=516)を固定オフセット値COfsAとして最新オフセット値NOfsAを算出する。 Next, in the latest offset value determining unit 70, when the correction count monitoring unit 75 determines that the current correction is the second correction after starting the power supply (n> 2), the offset value correction width determining unit 78 and the latest offset value calculation unit 79 respectively calculate the offset value correction width ΔOfsA and the latest offset value NOfsA in the following procedure. Specifically, the deviation amount integration unit 71 adds the second and subsequent deviation amounts ΔA to obtain an integral value SA of the deviation amount ΔA, and the offset value correction width calculation unit 72 gains 2 to multiply the deviation amount ΔA. The offset value correction width ΔOfsA is calculated by setting x of x to 2, and the latest offset value calculation unit 79 adds the offset value correction width ΔOfsA and the fixed offset value COfsA to calculate the latest offset value NOfsA. Here, the latest offset value calculation unit 79 calculates the latest offset value NOfsA using the latest offset value NOfsA (= 516) obtained by the first correction as the fixed offset value COfsA.

かかる2回目の補正では、第1回目のオフセット値補正幅が既に実施され、かつ、最適オフセット値に変化がないため、積分値SAが0である。このため、各値は以下の条件
固定オフセット値COfsA=516
最適オフセット値=516
ズレ量ΔAの積分値=0
オフセット値補正幅ΔOfsA=ΔA/ゲイン2-x=ΔA/4=0
最新オフセット値NOfsA
=固定オフセット値COfsA+オフセット値補正幅ΔOfsA
=516
となる。従って、最新オフセット値算出部79は、最新オフセット値NOfsA(=516)を最新オフセット値出力部80に出力し、最新オフセット値出力部80は、最新オフセット値NOfsA(=516)をオフセット補正部50に出力する。その結果、A相信号は、オフセット値補正幅部50によって最新オフセット値NOfsA(=516)での補正が行なわれた後、角度位置算出部30に入力される。
In the second correction, since the first offset value correction width has already been performed and the optimum offset value has not changed, the integral value SA is zero. Therefore, each value has the following condition Fixed offset value COfsA = 516
Optimal offset value = 516
Integral value of deviation amount ΔA = 0
Offset value correction width ΔOfsA = ΔA / gain 2 −x = ΔA / 4 = 0
Latest offset value NOfsA
= Fixed offset value COfsA + offset value correction width ΔOfsA
= 516
It becomes. Therefore, the latest offset value calculation unit 79 outputs the latest offset value NOfsA (= 516) to the latest offset value output unit 80, and the latest offset value output unit 80 outputs the latest offset value NOfsA (= 516) to the offset correction unit 50. Output to. As a result, the A phase signal is corrected by the offset value correction width unit 50 with the latest offset value NOfsA (= 516) and then input to the angular position calculation unit 30.

次に、最新オフセット値決定部70において、補正回数監視部75が、今回の補正が電源供給を開始してから3回目の補正であると判断すると、オフセット値補正幅決定部78および最新オフセット値算出部79は各々、2回目の補正と同様の手順でオフセット値補正幅ΔOfsAおよび最新オフセット値NOfsAを算出する。かかる3回目の補正では、第1回目のオフセット値補正幅が既に実施され、かつ、最適オフセット値に変化がないため、積分値SAが0である。このため、各値は以下の条件
固定オフセット値COfsA=516
最適オフセット値=516
ズレ量ΔAの積分値=0
オフセット値補正幅ΔOfsA=ΔA/ゲイン2-x=ΔA/4=0
最新オフセット値NOfsA
=固定オフセット値COfsA+オフセット値補正幅ΔOfsA
=516
となる。従って、最新オフセット値算出部79は、最新オフセット値NOfsA(=516)を最新オフセット値出力部80に出力し、最新オフセット値出力部80は、最新オフセット値NOfsA(=516)をオフセット補正部50に出力する。その結果、A相信号は、オフセット値補正幅部50によって最新オフセット値NOfsA(=516)での補正が行なわれた後、角度位置算出部30に入力される。
Next, in the latest offset value determining unit 70, when the correction count monitoring unit 75 determines that the current correction is the third correction since the start of power supply, the offset value correction width determining unit 78 and the latest offset value are determined. The calculation unit 79 calculates the offset value correction width ΔOfsA and the latest offset value NOfsA in the same procedure as in the second correction. In the third correction, since the first offset value correction width has already been performed and the optimum offset value has not changed, the integral value SA is zero. Therefore, each value has the following condition Fixed offset value COfsA = 516
Optimal offset value = 516
Integral value of deviation amount ΔA = 0
Offset value correction width ΔOfsA = ΔA / gain 2 −x = ΔA / 4 = 0
Latest offset value NOfsA
= Fixed offset value COfsA + offset value correction width ΔOfsA
= 516
It becomes. Therefore, the latest offset value calculation unit 79 outputs the latest offset value NOfsA (= 516) to the latest offset value output unit 80, and the latest offset value output unit 80 outputs the latest offset value NOfsA (= 516) to the offset correction unit 50. Output to. As a result, the A phase signal is corrected by the offset value correction width unit 50 with the latest offset value NOfsA (= 516) and then input to the angular position calculation unit 30.

次に、機器を継続動作させることにより、機器内部の温度が上昇しエンコーダー1での最適オフセットが変化した場合、例えば4回目のオフセット更新工程(第2補正工程)で最適オフセットが「516」から「520」に変化した場合を説明する。かかる条件では、ズレ量ΔAは「8」であるため、オフセット値補正幅決定部78のズレ量積分部71において、2回目以降のズレ量ΔAを加算して得たズレ量ΔAの積分値SAが「8」である。また、オフセット値補正幅決定部78のオフセット値補正幅算出部72は、ズレ量ΔAに乗じるゲイン2-xのxを2としてオフセット値補正幅ΔOfsAを算出し、最新オフセット値算出部79は、かかるオフセット値補正幅ΔOfsAと固定オフセット値COfsAとを加算して最新オフセット値NOfsAを算出する。ここで、最新オフセット値算出部79は、1回目の補正で得られた最新オフセット値NOfsA(=516)を固定オフセット値COfsAとして最新オフセット値NOfsAを算出する。従って、各値は以下の条件
固定オフセット値COfsA=516
最適オフセット値=520
ズレ量ΔAの積分値=8
オフセット値補正幅ΔOfsA=ΔA/ゲイン2-x=ΔA/4=2
最新オフセット値NOfsA
=固定オフセット値COfsA+オフセット値補正幅ΔOfsA
=518
となる。それ故、最新オフセット値算出部79は、最新オフセット値NOfsA(=518)を最新オフセット値出力部80に出力し、最新オフセット値出力部80は、最新オフセット値NOfsA(=518)をオフセット補正部50に出力する。その結果、A相信号は、オフセット値補正幅部50によって最新オフセット値NOfsA(=518)での補正が行なわれた後、角度位置算出部30に入力される。
Next, by continuously operating the device, when the temperature inside the device rises and the optimum offset in the encoder 1 changes, the optimum offset is changed from “516” in the fourth offset update process (second correction process), for example. The case where it changes to “520” will be described. Under such conditions, since the deviation amount ΔA is “8”, the integral value SA of the deviation amounts ΔA obtained by adding the second and subsequent deviation amounts ΔA in the deviation amount integration unit 71 of the offset value correction width determination unit 78. Is “8”. Further, the offset value correction width calculation unit 72 of the offset value correction width determination unit 78 calculates the offset value correction width ΔOfsA by setting x of the gain 2- x multiplied by the deviation amount ΔA to 2, and the latest offset value calculation unit 79 The latest offset value NOfsA is calculated by adding the offset value correction width ΔOfsA and the fixed offset value COfsA. Here, the latest offset value calculation unit 79 calculates the latest offset value NOfsA using the latest offset value NOfsA (= 516) obtained by the first correction as the fixed offset value COfsA. Therefore, each value is as follows: Fixed offset value COfsA = 516
Optimal offset value = 520
Integral value of deviation amount ΔA = 8
Offset value correction width ΔOfsA = ΔA / gain 2 −x = ΔA / 4 = 2
Latest offset value NOfsA
= Fixed offset value COfsA + offset value correction width ΔOfsA
= 518
It becomes. Therefore, the latest offset value calculation unit 79 outputs the latest offset value NOfsA (= 518) to the latest offset value output unit 80, and the latest offset value output unit 80 outputs the latest offset value NOfsA (= 518) to the offset correction unit. Output to 50. As a result, the A-phase signal is corrected to the latest offset value NOfsA (= 518) by the offset value correction width unit 50 and then input to the angular position calculation unit 30.

次に、5回目のオフセット更新工程(第2補正工程)では、ズレ量ΔAは「4」であるため、ズレ量積分部71において、2回目以降のズレ量ΔAを加算して得たズレ量ΔAの積分値SAが「12」である。また、オフセット値補正幅算出部72は、ズレ量ΔAに乗じるゲイン2-xのxを2としてオフセット値補正幅ΔOfsAを算出し、最新オフセット値算出部79は、かかるオフセット値補正幅ΔOfsAと固定オフセット値COfsAとを加算して最新オフセット値NOfsAを算出する。ここで、最新オフセット値算出部79は、1回目の補正で得られた最新オフセット値NOfsA(=516)を固定オフセット値COfsAとして最新オフセット値NOfsAを算出する。従って、各値は以下の条件
固定オフセット値COfsA=516
最適オフセット値=520
ズレ量ΔAの積分値=12
オフセット値補正幅ΔOfsA=ΔA/ゲイン2-x=ΔA/4=3
最新オフセット値NOfsA
=固定オフセット値COfsA+オフセット値補正幅ΔOfsA
=519
となる。それ故、最新オフセット値算出部79は、最新オフセット値NOfsA(=519)を最新オフセット値出力部80に出力し、最新オフセット値出力部80は、最新オフセット値NOfsA(=519)をオフセット補正部50に出力する。その結果、A相信号は、オフセット値補正幅部50によって最新オフセット値NOfsA(=518)での補正が行なわれた後、角度位置算出部30に入力される。
Next, in the fifth offset update process (second correction process), the deviation amount ΔA is “4”, and thus the deviation amount obtained by adding the second and subsequent deviation amounts ΔA in the deviation amount integration unit 71. The integrated value SA of ΔA is “12”. Further, the offset value correction width calculation unit 72 calculates the offset value correction width ΔOfsA by setting x of the gain 2- x multiplied by the deviation amount ΔA to 2, and the latest offset value calculation unit 79 is fixed to the offset value correction width ΔOfsA. The latest offset value NOfsA is calculated by adding the offset value COfsA. Here, the latest offset value calculation unit 79 calculates the latest offset value NOfsA using the latest offset value NOfsA (= 516) obtained by the first correction as the fixed offset value COfsA. Therefore, each value is as follows: Fixed offset value COfsA = 516
Optimal offset value = 520
Integral value of deviation amount ΔA = 12
Offset value correction width ΔOfsA = ΔA / gain 2 −x = ΔA / 4 = 3
Latest offset value NOfsA
= Fixed offset value COfsA + offset value correction width ΔOfsA
= 519
It becomes. Therefore, the latest offset value calculation unit 79 outputs the latest offset value NOfsA (= 519) to the latest offset value output unit 80, and the latest offset value output unit 80 outputs the latest offset value NOfsA (= 519) to the offset correction unit. Output to 50. As a result, the A-phase signal is corrected to the latest offset value NOfsA (= 518) by the offset value correction width unit 50 and then input to the angular position calculation unit 30.

次に、6回目のオフセット更新工程(第2補正工程)では、ズレ量ΔAは「2」であるため、ズレ量積分部71において、2回目以降のズレ量ΔAを加算して得たズレ量ΔAの積分値SAが「14」である。また、オフセット値補正幅算出部72は、ズレ量ΔAに乗じるゲイン2-xのxを2としてオフセット値補正幅ΔOfsAを算出し、最新オフセット値算出部79は、かかるオフセット値補正幅ΔOfsAと固定オフセット値COfsAとを加算して最新オフセット値NOfsAを算出する。ここで、最新オフセット値算出部79は、1回目の補正で得られた最新オフセット値NOfsA(=516)を固定オフセット値COfsAとして最新オフセット値NOfsAを算出する。従って、各値は以下の条件
固定オフセット値COfsA=516
最適オフセット値=520
ズレ量ΔAの積分値=14
オフセット値補正幅ΔOfsA=ΔA/ゲイン2-x=ΔA/4=3.5
最新オフセット値NOfsA
=固定オフセット値COfsA+オフセット値補正幅ΔOfsA
=519.5
となる。それ故、最新オフセット値算出部79は、最新オフセット値NOfsA(=519.5)を最新オフセット値出力部80に出力し、最新オフセット値出力部80は、最新オフセット値NOfsA(=519)をオフセット補正部50に出力する。その結果、A相信号は、オフセット値補正幅部50によって最新オフセット値NOfsA(=518)での補正が行なわれた後、角度位置算出部30に入力される。
Next, in the sixth offset update process (second correction process), the shift amount ΔA is “2”, and thus the shift amount obtained by adding the second and subsequent shift amounts ΔA in the shift amount integration unit 71. The integrated value SA of ΔA is “14”. Further, the offset value correction width calculation unit 72 calculates the offset value correction width ΔOfsA by setting x of the gain 2- x multiplied by the deviation amount ΔA to 2, and the latest offset value calculation unit 79 is fixed to the offset value correction width ΔOfsA. The latest offset value NOfsA is calculated by adding the offset value COfsA. Here, the latest offset value calculation unit 79 calculates the latest offset value NOfsA using the latest offset value NOfsA (= 516) obtained by the first correction as the fixed offset value COfsA. Therefore, each value is as follows: Fixed offset value COfsA = 516
Optimal offset value = 520
Integral value of deviation amount ΔA = 14
Offset value correction width ΔOfsA = ΔA / gain 2 −x = ΔA / 4 = 3.5
Latest offset value NOfsA
= Fixed offset value COfsA + offset value correction width ΔOfsA
= 519.5
It becomes. Therefore, the latest offset value calculation unit 79 outputs the latest offset value NOfsA (= 519.5) to the latest offset value output unit 80, and the latest offset value output unit 80 offsets the latest offset value NOfsA (= 519). Output to the correction unit 50. As a result, the A-phase signal is corrected to the latest offset value NOfsA (= 518) by the offset value correction width unit 50 and then input to the angular position calculation unit 30.

それ以降の補正内容は図5に示すとおりである。従って、エンコーダー1が動作している限り、上記のオフセット値の第2補正工程が行なわれ、オフセット値は逐次、更新される。   The correction contents thereafter are as shown in FIG. Therefore, as long as the encoder 1 is operating, the second correction process of the offset value is performed, and the offset value is sequentially updated.

このような補正方法によれば、図6に示すように、第1回目の補正(第1補正工程)でオフセット値補正幅が完了する、従って、本形態によれば、永久磁石11の回転角度が135°を通過した直後にオフセット値が最適な値に大きく近づく。そして、2回目以降の補正(第2補正工程)では、第1回目の補正での第1ゲイン(=1/2)より小さな第2ゲイン(=1/4)での補正を行なう。従って、4回以降の第2補正工程では、ズレ量ΔAは、8、4、2、1、0.5、0.25、・・と小さくなる一方、固定オフセット値COfsAを基準にしたオフセット値補正幅ΔOfsAは、2、3、3.5、3.75、3.875、3.9375、・・・と徐々に大きくなっていく。このため、永久磁石11の角度位置の結果の誤差は、徐々に小さな値となる。   According to such a correction method, as shown in FIG. 6, the offset value correction width is completed in the first correction (first correction step). Therefore, according to this embodiment, the rotation angle of the permanent magnet 11 Immediately after passing 135 °, the offset value approaches the optimum value greatly. In the second and subsequent corrections (second correction step), correction is performed with a second gain (= 1/4) smaller than the first gain (= 1/2) in the first correction. Accordingly, in the second correction process after the fourth time, the deviation amount ΔA is reduced to 8, 4, 2, 1, 0.5, 0.25,..., While the offset value based on the fixed offset value COfsA. The correction width ΔOfsA is gradually increased to 2, 3, 3.5, 3.75, 3.875, 3.9375,. For this reason, the error of the result of the angular position of the permanent magnet 11 gradually becomes a small value.

なお、上記の補正工程は、エンコーダー1への電源供給が停止された時点で停止する。そして、エンコーダー1への電源供給が行われると、固定オフセット値COfsA以外の値が全て初期化されて、上記の補正工程が再び行なわれる。   The correction process is stopped when power supply to the encoder 1 is stopped. When power is supplied to the encoder 1, all values other than the fixed offset value COfsA are initialized, and the above correction process is performed again.

[本形態の主な効果]
以上説明したように、本形態では、エンコーダー1を工場から出荷した以降、エンコーダー1を実際に使用している期間中、オフセット値の補正を行なう。このため、出荷時のオフセット調整環境と異なる温度環境下でエンコーダー1が使用された場合でも、オフセット値更新部100によって、オフセット値は、温度環境に応じた最適な値に更新される。このため、出荷時のオフセット調整環境と異なる温度環境下でエンコーダー1が使用された場合でも、オフセット誤差が発生することを防止することができるので、高い検出精度を得ることができる。
[Main effects of this embodiment]
As described above, in this embodiment, after the encoder 1 is shipped from the factory, the offset value is corrected during the period in which the encoder 1 is actually used. For this reason, even when the encoder 1 is used under a temperature environment different from the offset adjustment environment at the time of shipment, the offset value is updated by the offset value updating unit 100 to an optimum value according to the temperature environment. For this reason, even when the encoder 1 is used under a temperature environment different from the offset adjustment environment at the time of shipment, it is possible to prevent the occurrence of an offset error, so that high detection accuracy can be obtained.

また、オフセット値を更新するにあたっては、エンコーダー1での検出動作を開始した際の出力信号の理想状態からのズレ量ΔA、ΔBを検出し、ズレ量ΔA、ΔBを相殺するようにオフセット値を大きな第1ゲインで最初の第1補正工程を行なった後、第2補正工程では、第1補正工程よりも小さな第2ゲインでオフセット値を補正する第2補正工程を行なう。このため、エンコーダー1の動作を開始した直後、第1補正工程でオフセット値の補正を急峻に行い、その後、第2補正工程ではオフセット値を穏やかに補正することになる。このため、オフセット値を適正な値に迅速に補正することができるとともに、エンコーダー1の出力が大きく変動するという事態が発生しない。   Further, when updating the offset value, the offset values ΔA and ΔB from the ideal state of the output signal when the detection operation in the encoder 1 is started are detected, and the offset values are set so as to cancel the deviation amounts ΔA and ΔB. After performing the first first correction step with a large first gain, in the second correction step, a second correction step for correcting the offset value with a second gain smaller than the first correction step is performed. For this reason, immediately after the operation of the encoder 1 is started, the offset value is sharply corrected in the first correction step, and thereafter, the offset value is gently corrected in the second correction step. For this reason, the offset value can be quickly corrected to an appropriate value, and a situation in which the output of the encoder 1 fluctuates greatly does not occur.

また、本形態では、A相信号がSin波でB相信号がCos波であるため、Sin波のA相信号のピーク値、およびCos波のB相信号のピーク値が各々、リサージュ波形がY軸およびY軸が交差する点に相当する。従って、Sin波のA相信号のピーク値、およびCos波のB相信号のピーク値を求めるだけで、ズレ量ΔA、ΔBを算出することができる。また、A相信号とB相信号は、π/2の位相差あるいは略π/2の位相差を有しているため、永久磁石11が135°回転するだけで、リサージュ波形がY軸およびY軸が交差する点を求めることができ、かかる検出結果からズレ量ΔA、ΔBを算出することができる。それ故、永久磁石11が電気角で270°回転するだけで第1補正工程を行なうことができる。   In this embodiment, since the A-phase signal is a Sin wave and the B-phase signal is a Cos wave, the peak value of the A-phase signal of the Sin wave and the peak value of the B-phase signal of the Cos wave are respectively Y and the Lissajous waveform is Y. This corresponds to the point where the axis and the Y axis intersect. Therefore, the shift amounts ΔA and ΔB can be calculated only by obtaining the peak value of the A phase signal of the Sin wave and the peak value of the B phase signal of the Cos wave. Further, since the A phase signal and the B phase signal have a phase difference of π / 2 or a phase difference of approximately π / 2, the Lissajous waveform can be converted into the Y axis and the Y axis only by rotating the permanent magnet 11 by 135 °. The points where the axes intersect can be obtained, and the deviation amounts ΔA and ΔB can be calculated from the detection result. Therefore, the first correction process can be performed only by rotating the permanent magnet 11 by an electrical angle of 270 °.

1 エンコーダー
10 MR素子
11 永久磁石(回転体)
20 マイクロコンピューター
21 A/D変換部
30 角度位置検出部
50 オフセット補正部
60 ズレ量検出部
61 データ取得部
62 エラー判別部
63 取得結果確認部
64 ズレ量算出部
70 最新オフセット値決定部
71 ズレ量積分部
72 オフセット値補正幅算出部
75 補正回数監視部
78 オフセット値補正幅決定部
79 最新オフセット値算出部
80 最新オフセット値出力部
100 オフセット値更新部
1 Encoder 10 MR element 11 Permanent magnet (rotating body)
20 Microcomputer 21 A / D conversion unit 30 Angular position detection unit 50 Offset correction unit 60 Deviation amount detection unit 61 Data acquisition unit 62 Error discrimination unit 63 Acquisition result confirmation unit 64 Deviation amount calculation unit 70 Latest offset value determination unit 71 Deviation amount Integration unit 72 Offset value correction width calculation unit 75 Correction frequency monitoring unit 78 Offset value correction width determination unit 79 Latest offset value calculation unit 80 Latest offset value output unit 100 Offset value update unit

Claims (5)

回転体の回転に連動して変化するセンサ素子の出力信号に基づいて前記回転体の角度位置を検出するエンコーダーにおいて、前記角度位置の検出結果の誤差を解消するために前記出力信号を補正するオフセット値を最適化するにあたって、
前記エンコーダーへの電源供給を開始する度に前記オフセット値を補正する補正工程を行ない、
当該補正工程では、前記出力信号の理想状態からのズレ量を検出し、当該ズレ量に基づいて前記オフセット値を補正する第1補正工程と、該第1補正工程の後、当該第1補正工程よりも小さなゲインで前記オフセット値を補正する第2補正工程と、を行なうことを特徴とするエンコーダーのオフセット値補正方法。
In an encoder that detects the angular position of the rotating body based on the output signal of the sensor element that changes in conjunction with the rotation of the rotating body, an offset that corrects the output signal to eliminate an error in the detection result of the angular position In optimizing the value,
A correction process for correcting the offset value every time power supply to the encoder is started,
In the correction step, a first correction step for detecting a deviation amount of the output signal from an ideal state and correcting the offset value based on the deviation amount; and after the first correction step, the first correction step And a second correction step of correcting the offset value with a smaller gain than the encoder offset value correction method.
前記第2補正工程では、該第2補正工程を行なう度に前記出力信号の理想状態からのズレ量を検出するとともに、当該ズレ量に基づいて、前記オフセット値を補正することを特徴とする請求項1に記載のエンコーダーのオフセット値補正方法。   In the second correction step, a deviation amount from an ideal state of the output signal is detected every time the second correction step is performed, and the offset value is corrected based on the deviation amount. Item 4. The encoder offset value correction method according to Item 1. 前記第2補正工程では、前記出力信号の理想状態からのズレ量を検出する度に当該ズレ量の総和を算出し、当該総和に基づいて、前記オフセット値に対する補正幅を決定することを特徴とする請求項2に記載のエンコーダーのオフセット値補正方法。   In the second correction step, every time the amount of deviation from the ideal state of the output signal is detected, the sum of the amount of deviation is calculated, and a correction width for the offset value is determined based on the sum. The encoder offset value correction method according to claim 2. 前記出力信号は、互いにπ/2の位相差あるいは略π/2の位相差を有するA相信号およびB相信号であり、
前記第1補正工程および前記第2補正工程では、前記A相信号と前記B相信号とに基づいてXY座標軸上にリサージュ波形を形成した際、当該リサージュ波形と前記Y軸とが交差する2つの交点のX軸からの距離が等しく、かつ、前記リサージュ波形と前記X軸とが交差する2つの交点のY軸からの距離が等しくなる方向に前記オフセット値を補正することを特徴とする請求項1乃至3の何れか一項に記載のエンコーダーのオフセット値補正方法。
The output signals are an A-phase signal and a B-phase signal having a phase difference of π / 2 or a phase difference of approximately π / 2.
In the first correction step and the second correction step, when a Lissajous waveform is formed on the XY coordinate axes based on the A phase signal and the B phase signal, the Lissajous waveform and the Y axis intersect with each other. The offset value is corrected in a direction in which the distance from the X-axis of the intersection is equal and the distance from the Y-axis of two intersections where the Lissajous waveform and the X-axis intersect is equal. The encoder offset value correction method according to any one of claims 1 to 3.
前記A相信号はSin波であり、前記B相信号はCos波であることを特徴とする請求項4に記載のエンコーダーのオフセット値補正方法。   5. The encoder offset value correction method according to claim 4, wherein the A-phase signal is a Sin wave and the B-phase signal is a Cos wave.
JP2009197249A 2009-08-27 2009-08-27 Encoder offset correction method Active JP5249158B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009197249A JP5249158B2 (en) 2009-08-27 2009-08-27 Encoder offset correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009197249A JP5249158B2 (en) 2009-08-27 2009-08-27 Encoder offset correction method

Publications (2)

Publication Number Publication Date
JP2011047824A JP2011047824A (en) 2011-03-10
JP5249158B2 true JP5249158B2 (en) 2013-07-31

Family

ID=43834297

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009197249A Active JP5249158B2 (en) 2009-08-27 2009-08-27 Encoder offset correction method

Country Status (1)

Country Link
JP (1) JP5249158B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013117430A (en) * 2011-12-02 2013-06-13 Semiconductor Components Industries Llc Position detection circuit and position controller
JP6238514B2 (en) * 2012-10-12 2017-11-29 三菱電機株式会社 Servo valve monitoring control system
JP6595755B2 (en) * 2014-12-02 2019-10-23 日本電産サンキョー株式会社 Correction table creation device, encoder, and correction table creation method
JP2017161553A (en) * 2017-06-22 2017-09-14 株式会社リコー Rotation angle detector, motor system, image processing device, and rotation angle detection method
CN114593754B (en) * 2020-12-04 2024-01-19 小华半导体有限公司 Data analysis/correction/method and system, storage medium and magnetic encoder
CN115355937B (en) * 2022-10-24 2022-12-27 泉州昆泰芯微电子科技有限公司 Self-calibration method of magnetic encoder and motor
CN117782187B (en) * 2024-02-23 2024-05-07 泉州昆泰芯微电子科技有限公司 Nonlinear error correction method of encoder and encoder

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3372450B2 (en) * 1997-05-09 2003-02-04 株式会社ミツトヨ Encoder output signal processing device
JP4768248B2 (en) * 2004-10-13 2011-09-07 株式会社ミツトヨ Encoder output signal correction apparatus and method
JP4119460B2 (en) * 2006-06-21 2008-07-16 ファナック株式会社 Encoder output signal amplitude calculation device and encoder output signal amplitude calculation program
JP5177639B2 (en) * 2008-01-21 2013-04-03 株式会社安川電機 Magnetic encoder device and position detection method using the same

Also Published As

Publication number Publication date
JP2011047824A (en) 2011-03-10

Similar Documents

Publication Publication Date Title
JP5249158B2 (en) Encoder offset correction method
JP4768248B2 (en) Encoder output signal correction apparatus and method
JP5333863B2 (en) Rotation angle detector
US10876862B2 (en) Rotary encoder
CN108375391B (en) Sine and cosine signal processing method and system
JP2017161391A (en) Rotary encoder and method for correcting angle of rotary encoder
JP2011033602A (en) Resolver/digital converter, and resolver/digital conversion method
WO2015029427A1 (en) Angular position detection device
JP5190644B2 (en) Encoder error correction method
JP5177639B2 (en) Magnetic encoder device and position detection method using the same
KR101885275B1 (en) Angle determinating method using encoder signal with noise suppression, adjusting method for output signal of encoder and absolute encoder
JP6668082B2 (en) Encoder
JP5857347B2 (en) Encoder
JP4515120B2 (en) Resolver digital angle conversion apparatus and method, and program
CN113661375B (en) Angle detecting device
CN111089610B (en) Signal processing method and device of encoder and related components
JP2013238431A (en) Resolver device
JP2014013209A (en) Angle detection device
JP6112832B2 (en) Angle correction device and rotation angle sensor
JP2015219096A (en) Multiple-rotation encoder
JP5146963B2 (en) Encoder error correction method
KR102119847B1 (en) Method and module of error compensation between the mr sensor output signal for an rotor position sensing of the electric motor
JP2019132603A (en) Rotation detection circuit, rotation detection apparatus, and rotation detection method
JP5184590B2 (en) Rotation detector and phase error correction method thereof
JP2012251879A (en) Optical absolute encoder and device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120705

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130213

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: 20130319

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130411

R150 Certificate of patent or registration of utility model

Ref document number: 5249158

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: 20160419

Year of fee payment: 3