JPH11264741A - Encoder device - Google Patents

Encoder device

Info

Publication number
JPH11264741A
JPH11264741A JP7020498A JP7020498A JPH11264741A JP H11264741 A JPH11264741 A JP H11264741A JP 7020498 A JP7020498 A JP 7020498A JP 7020498 A JP7020498 A JP 7020498A JP H11264741 A JPH11264741 A JP H11264741A
Authority
JP
Japan
Prior art keywords
phase
output
signal
phase signal
displacement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7020498A
Other languages
Japanese (ja)
Inventor
Teruhisa Kojima
輝久 小島
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP7020498A priority Critical patent/JPH11264741A/en
Publication of JPH11264741A publication Critical patent/JPH11264741A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an encoder device capable of enhancing reliability, by increasing frequency of checkup on counted values. SOLUTION: A C-phase signal of an encoder is outputted a plurality of times during one rotation cycle of a servomotor, an output period of one specific C-phase signal among them is set up to differ from output periods of the other C-phase signals, and a CPU can determine, with high frequency, whether a counter performs normal counting action based on proper output timing of an A-phase signal and a B-phase signal, by detecting the shift amount of rotational position data counted by the counter every time the C-phase signal is detected. By discriminating the output period of the C-phase signals, an origin/C- phase detecting circuit detects the specific C-phase signal, as reference point, and can easily determine a origin of the servomotor.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、変位体の直線変位
若しくは回転変位に伴って、互いに90度位相の異なる
パルス信号をA相信号及びB相信号として出力すると共
に、変位体の変位位置が基準点に達するとC相信号を出
力するエンコーダ装置に関する。
BACKGROUND OF THE INVENTION The present invention relates to a method of outputting pulse signals having phases different from each other by 90 degrees as an A-phase signal and a B-phase signal in accordance with a linear displacement or a rotational displacement of a displacement body. The present invention relates to an encoder device that outputs a C-phase signal when a reference point is reached.

【0002】[0002]

【従来の技術】例えば光学式のロータリエンコーダ(以
下、エンコーダと称す)は、変位体たる例えば電動機の
回転軸に、外周部に複数のスリットを有する円盤状のス
ケールを設け、そのスケールを挟んでA,B及びC相に
対応する発光素子と受光素子とを配置してなるものであ
る。
2. Description of the Related Art For example, an optical rotary encoder (hereinafter, referred to as an encoder) is provided with a disk-shaped scale having a plurality of slits on an outer peripheral portion thereof, for example, on a rotating shaft of a motor as a displacement body, and sandwiching the scale. The light emitting device and the light receiving device corresponding to the A, B, and C phases are arranged.

【0003】そして、電動機の回転に伴ってスケールが
回転すると、発光素子による投光を受光素子がスリット
を介して受光することにより、互いに位相が90度異な
るA相及びB相信号、並びに電動機が一回転する毎に一
回だけ出力されるC相信号が出力される。
When the scale rotates with the rotation of the motor, the light-receiving element receives the light emitted from the light-emitting element through the slit, so that the A-phase and B-phase signals having phases different from each other by 90 degrees, and A C-phase signal that is output only once for each rotation is output.

【0004】電動機の駆動制御を行う制御装置は、エン
コーダからこれらのA,B及びC相信号を得ると、C相
信号の出力時を原点として、例えばA相及びB相信号の
エッジ出力をカウントすることにより回転子の回転位置
を検出すると共に、A相及びB相信号の位相関係より回
転子の回転方向を検出して、電動機に関する各種の制御
を行うようになっている。
When the control device for controlling the driving of the electric motor obtains these A, B and C phase signals from the encoder, it counts, for example, the edge output of the A and B phase signals with the origin at the time of outputting the C phase signal. By doing so, the rotational position of the rotor is detected, and the rotational direction of the rotor is detected from the phase relationship between the A-phase and B-phase signals, thereby performing various controls related to the electric motor.

【0005】この様なエンコーダに対しては、C相信号
が出力される毎に、前記カウント動作によるカウント値
の差分を求めて、その差分値とエンコーダの分解能から
決定される正常値とを比較することによるカウント値の
チェックを行うようにしている。
For such an encoder, every time a C-phase signal is output, a difference between the count values obtained by the counting operation is obtained, and the difference value is compared with a normal value determined from the resolution of the encoder. In this case, the count value is checked.

【0006】そして、エンコーダは、一般にノイズが発
生しやすい環境で使用されることが多くA,B及びC相
信号に外来ノイズがのったり、或いはスリットにゴミな
どが付着することによるパルス抜け等による誤検出(誤
カウント)が比較的高い頻度で発生する。
In general, the encoder is generally used in an environment where noise is likely to occur. In many cases, extraneous noise is applied to the A, B, and C phase signals, or a pulse is missing due to dust adhering to the slit. Erroneous detection (erroneous count) occurs at a relatively high frequency.

【0007】従って、実用上問題ない程度の検出誤差は
許容することとして、前記異常検出処理においても、カ
ウント値と正常値との差分が許容範囲を超えた場合に異
常判定を行うようにしている。
Accordingly, a detection error that does not cause a problem in practical use is allowed, and in the above-described abnormality detection process, an abnormality is determined when the difference between the count value and the normal value exceeds an allowable range. .

【0008】[0008]

【発明が解決しようとする課題】しかしながら、従来
は、電動機がどのような環境下で動作している場合であ
っても、異常判定は、電動機が一回転する毎に一回だけ
しか行っていないため、チェック頻度が低く信頼性に問
題があった。
However, conventionally, no matter what environment the motor is operating in, the abnormality determination is performed only once each time the motor rotates once. Therefore, the check frequency is low and there is a problem in reliability.

【0009】本発明は上記事情に鑑みてなされたもので
あり、その目的は、エンコーダの出力信号に基づくカウ
ント値のチェック頻度を高めて、信頼性を向上させるこ
とができるエンコーダ装置を提供することにある。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an encoder device capable of improving the reliability by increasing the frequency of checking a count value based on an output signal of an encoder. It is in.

【0010】[0010]

【課題を解決するための手段】上記目的を達成するた
め、請求項1記載のエンコーダ装置は、変位体の直線変
位若しくは回転変位に伴って、互いに90度位相の異な
るパルス信号をA相信号及びB相信号として出力すると
共に、前記変位体の変位位置が基準点に達するとC相信
号を出力するものにおいて、前記C相信号を、変位体の
一変位周期の間に複数回出力することを特徴とする。斯
様に構成すれば、複数のC相信号の出力タイミングに基
づいて、例えばA相信号及びB相信号の出力タイミング
が正常であるか否かを変位体の一変位周期よりも短い期
間で、即ち、従来よりも高い頻度で判定することができ
る。
According to a first aspect of the present invention, there is provided an encoder device comprising: an A-phase signal and a pulse signal having a phase difference of 90 degrees from each other in accordance with a linear displacement or a rotational displacement of a displacement body; Outputting the C-phase signal when the displacement position of the displacement body reaches a reference point, and outputting the C-phase signal a plurality of times during one displacement cycle of the displacement body. Features. With such a configuration, based on the output timings of the plurality of C-phase signals, for example, whether the output timings of the A-phase signal and the B-phase signal are normal is determined in a period shorter than one displacement cycle of the displacement body. That is, the determination can be performed with higher frequency than in the related art.

【0011】この場合、請求項2に記載したように、前
記A相及びB相信号をカウントすることにより前記変位
体の変位位置データを出力する位置データ出力手段と、
前記C相信号の出力タイミングを検出してC相検出信号
を出力するC相信号検出手段と、このC相信号検出手段
により前記C相検出信号が出力されるタイミングにおい
て前記位置データ出力手段により出力される前記変位位
置データの変化量に基づいて、前記変位位置データ出力
手段がカウントする変位位置データのずれ量を検出する
位置ずれ量検出手段とを備えると良い。
In this case, as described in claim 2, position data output means for outputting displacement position data of the displacement body by counting the A-phase and B-phase signals,
C-phase signal detection means for detecting the output timing of the C-phase signal and outputting a C-phase detection signal; and outputting the C-phase signal at a timing at which the C-phase detection signal is output by the C-phase signal detection means. The displacement position data output means may include a displacement amount detecting means for detecting a displacement amount of the displacement position data counted by the displacement position data output means based on the amount of change in the displacement position data.

【0012】斯様に構成すれば、位置ずれ量検出手段
は、変位体の一変位周期の間に複数回C相信号が検出さ
れるタイミングで、変位位置データ出力手段がカウント
する変位位置データのずれ量を検出するので、そのずれ
量の検出によって、A相信号及びB相信号の出力タイミ
ングに基づく変位位置データ出力手段のカウント動作が
正常に行われているか否かを、高い頻度でチェックする
ことができる。
[0012] According to this structure, the displacement detection means detects the displacement position data counted by the displacement position data output means at the timing when the C-phase signal is detected a plurality of times during one displacement cycle of the displacement body. Since the shift amount is detected, it is frequently checked whether or not the counting operation of the displacement position data output means based on the output timing of the A-phase signal and the B-phase signal is normally performed by detecting the shift amount. be able to.

【0013】また、請求項3に記載したように、前記複
数回出力されるC相信号の内の一つである特定C相信号
の出力期間を、その他のC相信号の出力期間と異なるよ
うにするのが好ましい。斯様に構成すれば、C相信号の
出力期間を判別することで、特定C相信号を例えば変位
周期の基準点として検出することができる。
Further, the output period of the specific C-phase signal, which is one of the C-phase signals output a plurality of times, is different from the output periods of the other C-phase signals. It is preferred that With this configuration, by determining the output period of the C-phase signal, the specific C-phase signal can be detected as, for example, a reference point of the displacement cycle.

【0014】この場合、請求項4に記載したように、前
記C相信号検出手段に、前記特定C相信号の出力タイミ
ング基づいて前記変位体の原点を検出する原点検出手段
を備えても良い。斯様に構成すれば、原点検出手段によ
って変位体の原点を容易且つ確実に定めることができ
る。
In this case, as described in claim 4, the C-phase signal detecting means may include an origin detecting means for detecting an origin of the displacement body based on an output timing of the specific C-phase signal. With such a configuration, the origin of the displacement body can be easily and reliably determined by the origin detecting means.

【0015】また、請求項5に記載したように、前記位
置ずれ量検出手段を、前記C相信号検出手段によって出
力されるC相検出信号の全ての出力タイミングに基づい
て前記ずれ量を検出する構成としても良く、斯様に構成
すれば、変位位置データのずれ量検出の頻度を最大にす
ることができる。
According to a fifth aspect of the present invention, the displacement detecting means detects the displacement based on all output timings of the C-phase detection signal output by the C-phase signal detecting means. A configuration may be used. With this configuration, the frequency of detecting the amount of displacement of the displacement position data can be maximized.

【0016】更に、請求項6に記載したように、前記位
置ずれ量検出手段を、前記C相信号検出手段によって検
出される、前記特定C相信号以外のC相信号に対応する
C相検出信号の出力タイミングのみに基づいて前記ずれ
量を検出する構成としても良い。斯様に構成しても、請
求項5と略同様の効果が得られる。
Further, as set forth in claim 6, the position shift amount detection means detects a C-phase detection signal corresponding to a C-phase signal other than the specific C-phase signal detected by the C-phase signal detection means. The shift amount may be detected based only on the output timing of the above. Even with such a configuration, substantially the same effects as those of the fifth aspect can be obtained.

【0017】請求項7に記載したように、前記複数回出
力されるC相信号の少なくとも片側のエッジ出力間隔を
全て等しくなるように設定するのが好適である。斯様に
構成すれば、例えば、C相信号検出手段がC相信号の検
出を出力間隔が等しい側のエッジに基づいて行うこと
で、そのC相信号が検出される間隔内におけるA相及び
B相信号の出力数は全て等しくなる。従って、ずれ量検
出手段は、C相信号の何れの検出タイミングにおいて
も、その等しい出力数に基づいて変位位置データのずれ
量検出を容易に行うことができる。
Preferably, at least one edge output interval of at least one side of the C-phase signal output a plurality of times is set to be equal. With such a configuration, for example, the C-phase signal detection means detects the C-phase signal based on the edge on the side having the same output interval, so that the A-phase signal and the B-phase within the interval in which the C-phase signal is detected. The output numbers of the phase signals are all equal. Therefore, the shift amount detecting means can easily detect the shift amount of the displacement position data based on the equal output number at any detection timing of the C-phase signal.

【0018】請求項8記載のエンコーダ装置は、位置ず
れ量検出手段により検出される前記位置ずれ量を累積す
る位置ずれ量累積手段とを備えたことを特徴とする。斯
様に構成すれば、例えば、エンコーダのスリットにゴミ
などが付着することによって、A相信号若しくはB相信
号の1パルス抜けが原点位置の検出毎に生じる場合で
も、その1パルス抜けによる位置ずれ量は、位置ずれ量
累積手段によって累積されることで確実に検出される。
The encoder device according to the present invention is characterized in that the encoder device further comprises a displacement amount accumulating means for accumulating the displacement amount detected by the displacement amount detecting means. According to this structure, even if dust or the like adheres to the slit of the encoder and one pulse of the A-phase signal or the B-phase signal is lost every time the origin position is detected, for example, the position shift due to the one pulse is lost. The amount is reliably detected by being accumulated by the displacement amount accumulating means.

【0019】この場合、請求項9に記載したように、前
記位置ずれ量累積手段により累積された位置ずれ量が、
予め設定された累積ずれ量許容値を超えた場合に異常と
判定する異常判定手段を備えるのが好ましく、斯様に構
成すれば、僅かなずれ量が毎回確実に生じるような状態
でも、異常判定手段によって確実に異常判定を行うこと
ができる。
In this case, as described in claim 9, the displacement amount accumulated by the displacement amount accumulating means is:
It is preferable to include an abnormality determination unit that determines that an abnormality has occurred when the accumulated deviation amount exceeds a preset allowable value of the accumulated deviation amount. The means can reliably determine the abnormality.

【0020】また、請求項10に記載したように、前記
位置ずれ量累積手段により累積された位置ずれ量を表示
する表示手段を備えても良く、斯様に構成すれば、累積
された位置ずれ量の表示を参照することによって、変位
体が動作している環境のノイズ発生頻度を、視覚的に把
握することができる。
[0020] Further, as set forth in claim 10, a display means for displaying the displacement amount accumulated by the displacement amount accumulating means may be provided. With such a configuration, the accumulated displacement amount may be provided. By referring to the display of the amount, it is possible to visually grasp the frequency of noise generation in the environment in which the displacement body is operating.

【0021】請求項11に記載したように、前記位置ず
れ量検出手段により検出された前記エンコーダの位置ず
れ量が予め設定された補正許容値以下である場合は、前
記位置ずれ量に基づいて所定の補正動作を行う位置補正
手段を備えるのが好ましい。斯様に構成すれば、補正許
容値以下の位置ずれ量に基づいて例えば変位体の位置デ
ータを補正することによって、変位体の正確な変位位置
を得ることができる。
According to another aspect of the present invention, when the displacement of the encoder detected by the displacement detecting means is equal to or less than a preset allowable correction value, a predetermined value is determined based on the displacement. It is preferable to provide a position correcting means for performing the correcting operation of (1). With such a configuration, for example, by correcting the position data of the displacement body based on the displacement amount equal to or less than the correction allowable value, an accurate displacement position of the displacement body can be obtained.

【0022】この場合、請求項12に記載したように、
前記位置ずれ量検出手段により検出された前記エンコー
ダの位置ずれ量が、連続して前記補正許容値以下となっ
た回数をカウントして、前記カウント値が所定値を超え
た場合に異常と判定する連続補正異常判定手段を備えて
も良い。斯様に構成すれば、補正許容値以下の位置ずれ
量が連続して発生する場合は異常が発生している確率が
高いので、そのような場合を異常として判定することが
できる。
In this case, as described in claim 12,
Count the number of times that the displacement amount of the encoder detected by the displacement amount detecting means continuously becomes equal to or less than the correction allowable value, and determine that the abnormality is abnormal when the count value exceeds a predetermined value. A continuous correction abnormality determination unit may be provided. With such a configuration, when the displacement amount equal to or less than the correction allowable value continuously occurs, the probability of occurrence of the abnormality is high, and such a case can be determined as abnormal.

【0023】この場合、請求項13に記載したように、
前記位置補正手段によって補正が行われた回数を表示す
る補正回数表示手段を備えても良く、斯様に構成すれ
ば、請求項9または10と同様に、変位体が動作してい
る環境の比較的低レベルのノイズ発生頻度を視覚的に把
握することができる。
In this case, as described in claim 13,
It is also possible to provide a correction number display means for displaying the number of corrections performed by the position correction means. With such a configuration, similar to the ninth or tenth aspect, a comparison of the environment in which the displacement body is operating is provided. It is possible to visually grasp the extremely low level noise occurrence frequency.

【0024】以上の場合において、請求項14に記載し
たように、前記C相信号検出手段を、前記C相信号が出
力された期間における前記A相またはB相の一方の信号
レベルと、他方の信号エッジの出力タイミングとに基づ
いて前記C相検出信号を出力する構成とするのが好まし
く、斯様に構成すれば、C相信号は、原点とすべき変位
体の変位位置において、その変位位置に対応するA相ま
たはB相の信号エッジが出力される時に有意であれば良
く、エンコーダにおけるC相信号の出力条件をより緩和
することができ、作り込みが容易となる。そして、経時
変化によるA,B相及びC相信号の出力特性の変化や、
変位体が変位することによる機械的な振動による信号出
力の変動についてもより大きな許容範囲を持たせること
ができる。
In the above case, as described in claim 14, the C-phase signal detecting means determines whether the signal level of one of the A-phase or the B-phase during the period in which the C-phase signal is output and the other signal level. It is preferable to output the C-phase detection signal based on the output timing of the signal edge. With such a configuration, the C-phase signal is output at the displacement position of the displacement body to be the origin. It is only necessary to be significant when the A-phase or B-phase signal edge corresponding to the output is output, and the output condition of the C-phase signal in the encoder can be further relaxed, and the production can be facilitated. And changes in output characteristics of the A, B, and C phase signals due to aging,
It is possible to provide a larger allowable range for signal output fluctuation due to mechanical vibration due to displacement of the displacement body.

【0025】また、請求項15に記載したように、前記
C相信号検出手段を、前記位置データ出力手段がアップ
カウントを行っている期間の前記C相信号の一方のエッ
ジ及び前記位置データ出力手段がダウンカウントを行っ
ている期間の前記C相信号の他方のエッジに基づいて前
記C相検出信号を出力する構成としても良い。斯様に構
成すれば、C相検出信号の出力タイミングは、変位体の
変位方向にかかわらず、常にC相信号の同一エッジの出
力タイミングに基づいて決定される。
Further, as set forth in claim 15, the C-phase signal detection means is provided with one edge of the C-phase signal and the position data output means during a period when the position data output means is counting up. May be configured to output the C-phase detection signal based on the other edge of the C-phase signal during a period in which the counter is counting down. With such a configuration, the output timing of the C-phase detection signal is always determined based on the output timing of the same edge of the C-phase signal regardless of the displacement direction of the displacement body.

【0026】更に、請求項16に記載したように、前記
C相信号を、その出力期間が前記A相信号及びB相信号
間の最短エッジ出力間隔よりも短く設定すると共に、前
記最短エッジ出力間隔内に位置するように設定し、前記
C相信号検出手段を、前記C相信号のみに基づいて前記
C相検出信号を出力する構成としても良い。斯様に構成
すれば、変位体の変位方向を示す信号などを参照するこ
となく、C相信号のみに基づいてC相検出信号を出力す
ることができるので、構成を極めて簡単にすることがで
きる。
Further, as set forth in claim 16, the output period of the C-phase signal is set shorter than the shortest edge output interval between the A-phase signal and the B-phase signal, and the shortest edge output interval is set shorter. And the C-phase signal detection means may output the C-phase detection signal based only on the C-phase signal. According to this configuration, the C-phase detection signal can be output based on only the C-phase signal without reference to a signal indicating the displacement direction of the displacement body, so that the configuration can be extremely simplified. .

【0027】[0027]

【発明の実施の形態】以下、本発明の第1実施例につい
て図1乃至図9を参照して説明する。図4は、全体構成
を示す機能ブロック図である。CPU(位置ずれ量検出
手段,位置ずれ量累積手段,異常判定手段,位置補正手
段,連続補正異常判定手段)1には、ROM2,RAM
3,通信ポート4,I/Oポート5,表示装置(表示手
段,補正回数表示手段)6,操作装置7及びカウンタ回
路8の各デバイスが、アドレスバス9及びデータバス1
0などによって接続されている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A first embodiment of the present invention will be described below with reference to FIGS. FIG. 4 is a functional block diagram showing the overall configuration. The CPU (position shift amount detection means, position shift amount accumulation means, abnormality determination means, position correction means, continuous correction abnormality determination means) includes a ROM 2, a RAM,
3, communication port 4, I / O port 5, display device (display means, correction count display means) 6, operating device 7, and counter circuit 8 are each composed of address bus 9 and data bus 1.
0 and so on.

【0028】そして、CPU1は、ROM2に記憶され
ている制御プログラムを読み出すと、その制御プログラ
ムに従って処理を行うようになっている。RAM3は、
制御プログラムのダウンロードやCPU1の作業領域な
どとして使用される。
When the CPU 1 reads out the control program stored in the ROM 2, the CPU 1 performs processing according to the control program. RAM3 is
It is used as a download of a control program, a work area of the CPU 1, and the like.

【0029】カウンタ回路8には、変位体たるサーボモ
ータ11に取り付けられているエンコーダ12(図5参
照)よりエンコーダ信号(A,B及びC相信号)が与え
られるており、カウンタ回路8は、そのエンコーダ信号
に基づくカウント動作を行うようになっている。
An encoder signal (A, B, and C phase signals) is given to the counter circuit 8 from an encoder 12 (see FIG. 5) attached to a servomotor 11 which is a displacement body. The counting operation based on the encoder signal is performed.

【0030】CPU1は、カウンタ回路8からサーボモ
ータ11の回転位置情報を得ると、制御プログラムに基
づいて、通信ポート4を介してサーボモータ11を駆動
するサーボドライバ(図示せず)に指令を与えるように
なっている。また、CPU1とカウンタ回路8とは、I
/Oポート5を介して後述する各種コントロール信号の
伝送を行うようになっている。
When the CPU 1 obtains the rotational position information of the servo motor 11 from the counter circuit 8, the CPU 1 gives a command to a servo driver (not shown) for driving the servo motor 11 via the communication port 4 based on the control program. It has become. Further, the CPU 1 and the counter circuit 8
Various control signals, which will be described later, are transmitted via the / O port 5.

【0031】ユーザは、例えばキーボードなどで構成さ
れる操作装置7を操作することによって、後述する各種
の許容値などの設定を行うことができる。また、例えば
CRTディスプレイなどからなる表示装置6には、CP
U1から与えられる指令に基づいて、後述する各種の情
報が表示されるようになっている。
The user can set various allowable values, which will be described later, by operating the operation device 7 including, for example, a keyboard. Further, for example, the display device 6 including a CRT display or the like includes a CP.
Various information, which will be described later, is displayed based on a command given from U1.

【0032】図5は、カウンタ回路8の詳細な構成を示
す機能ブロック図である。サーボモータ11の回転子に
は、光学式のエンコーダ12が取付けられている。具体
的には図示しないが、サーボモータ11の回転軸には、
エンコーダ12のA相,B相及びC相信号に夫々対応す
るスリットを同心配置状に有する円盤状のスケールが取
付け固定されている。
FIG. 5 is a functional block diagram showing a detailed configuration of the counter circuit 8. As shown in FIG. An optical encoder 12 is attached to a rotor of the servo motor 11. Although not specifically shown, the rotation axis of the servomotor 11 includes:
A disk-shaped scale having concentrically arranged slits corresponding to the A-phase, B-phase and C-phase signals of the encoder 12 is mounted and fixed.

【0033】各相信号に対応する例えばLEDからなる
発光素子(図示せず)、及び例えばフォトダイオードか
らなる受光素子12A,12B及び12C(A相,B相
及びC相信号出力手段)は、前記スケールのスリットを
挟んで対向するように配設されている。尚、一般的なエ
ンコーダと同様に、A相及びB相信号はデューティ比5
0%で互いに90度の位相差をもって出力されるパルス
信号であり、C相信号はサーボモータ11の回転軸が一
回転する間に複数回出力されるパルス信号である(図9
参照)。
A light emitting element (not shown), such as an LED, corresponding to each phase signal, and light receiving elements 12A, 12B, and 12C (A-phase, B-phase, and C-phase signal output means) including, for example, a photodiode are provided as described above. They are arranged to face each other across the slit of the scale. As in a general encoder, the A-phase and B-phase signals have a duty ratio of 5
At 0%, the pulse signals are output with a phase difference of 90 degrees from each other. The C-phase signal is a pulse signal output a plurality of times during one rotation of the rotation axis of the servo motor 11 (FIG. 9).
reference).

【0034】図9に示すように、C相信号として出力さ
れる複数のパルス信号のパルス幅は、一つだけ特定C相
信号を除いて、A相及びB相信号の周期Tと略等しくな
るように、スケールに設けられているスリットの形状及
び配置が調整されている。また、特定C相信号のパルス
幅は、その他のC相信号のパルス幅の2倍に設定されて
いる。加えて、C相信号パルスの立上がりエッジは、A
相信号及びB相信号の立上がりエッジ間に位置するよう
に調整されている。
As shown in FIG. 9, the pulse width of the plurality of pulse signals output as the C-phase signal is substantially equal to the period T of the A-phase and B-phase signals except for one specific C-phase signal. Thus, the shape and arrangement of the slits provided on the scale are adjusted. Further, the pulse width of the specific C-phase signal is set to twice the pulse width of the other C-phase signals. In addition, the rising edge of the C-phase signal pulse is A
It is adjusted so as to be located between the rising edges of the phase signal and the B-phase signal.

【0035】受光素子12A及び12Bの出力端子は、
4逓倍回路13の入力端子に接続されており、4逓倍回
路13は、A相及びB相信号の立上がり,立下がりエッ
ジが入力される毎にUP/DOWNパルスをアップダウ
ンカウンタ(位置データ出力手段,以下、カウンタと称
す)14に出力するようになっている。即ち、UP/D
OWNパルスは、A相及びB相信号の周波数を4逓倍し
た信号である。
The output terminals of the light receiving elements 12A and 12B are:
It is connected to the input terminal of the quadruple circuit 13. The quadruple circuit 13 outputs an UP / DOWN pulse every time a rising edge or a falling edge of the A-phase signal and the B-phase signal is inputted. , Hereinafter referred to as a counter). That is, UP / D
The OWN pulse is a signal obtained by multiplying the frequency of the A-phase signal and the B-phase signal by four.

【0036】また、4逓倍回路13は、UP/DOWN
信号をもカウンタ14に出力するようになっており、A
相及びB相信号の立上がりエッジ(↑),立下がりエッ
ジ(↓)の入力順がA(↑),B(↓),A(↓),B
(↑),…である場合(即ち、B相進みの場合)は、サ
ーボモータ11の回転が正転であると判別してUP/D
OWN信号をハイレベルにし、また、入力順がA
(↑),B(↑),A(↓),B(↓),…である場合
(即ち、A相進みの場合)は、サーボモータ11の回転
が逆転であると判別してUP/DOWN信号をロウレベ
ルにするようになっている。
The quadruple frequency multiplier 13 is provided with an UP / DOWN
A signal is also output to the counter 14, and A
The input order of the rising edge ()) and falling edge (↓) of the phase and B phase signals is A (↑), B (↓), A (↓), B
(↑),... (Ie, in the case of B-phase advance), it is determined that the rotation of the servomotor 11 is forward rotation, and the UP / D
The OWN signal is set to high level, and the input order is A
(↑), B (↑), A (↓), B (↓),... (That is, in the case of A-phase advance), it is determined that the rotation of the servomotor 11 is in the reverse direction, and UP / DOWN is performed. The signal is set to low level.

【0037】そして、カウンタ14は、UP/DOWN
パルスの入力に応じて、UP/DOWN信号がハイレベ
ルである間はアップカウント動作を行い、ロウレベルで
ある間はダウンカウント動作を行うようになっている。
そして、カウンタ14のカウント値が出力されるデータ
バス15は、2つのカウンタデータラッチ回路(以下、
ラッチ回路と称す)16及び17に接続されている。
Then, the counter 14 sets the UP / DOWN
According to the input of the pulse, the up-count operation is performed while the UP / DOWN signal is at the high level, and the down-count operation is performed while the UP / DOWN signal is at the low level.
The data bus 15 from which the count value of the counter 14 is output is connected to two counter data latch circuits (hereinafter, referred to as two counter data latch circuits).
(Referred to as a latch circuit) 16 and 17.

【0038】また、A相信号の進み位相(正転)時にお
けるC相信号パルスの立上がりエッジの出力タイミング
は、カウンタ14のカウンタ値で全て“16”に相当す
る等間隔となるように設定されている。
The output timing of the rising edge of the C-phase signal pulse at the time of the leading phase (forward rotation) of the A-phase signal is set so that the counter values of the counter 14 are all equal to "16". ing.

【0039】CPU1は、ラッチ回路16に対してラッ
チ信号(1)を定期的に出力することでカウントデータ
のラッチを行うようになっている。そして、CPU1
が、ラッチ回路16に割り当てられているアドレスをア
ドレスバス9に出力すると、そのアドレスがアドレスデ
コーダ18によりデコードされてラッチ回路16にチッ
プセレクト信号が出力される。すると、ラッチ回路16
がイネーブルとなって、ラッチされているデータがデー
タバス10上に出力される。
The CPU 1 outputs the latch signal (1) to the latch circuit 16 periodically to latch the count data. And CPU1
When an address assigned to the latch circuit 16 is output to the address bus 9, the address is decoded by the address decoder 18 and a chip select signal is output to the latch circuit 16. Then, the latch circuit 16
Is enabled, and the latched data is output onto the data bus 10.

【0040】原点/C相検出回路(C相信号検出手段,
原点検出手段)19には、エンコーダ12が出力するC
相信号並びに4逓倍回路13が出力するUP/DOWN
パルス及びUP/DOWN信号が与えられていると共
に、CPU1が出力するラッチ2クリア信号及び原点ラ
ッチクリア信号が与えられている。そして、原点/C相
検出回路19は、これらの信号に基づいてエンコーダ1
2のC相信号及びサーボモータ11の原点を検出し、C
相検出信号及び原点検出信号をラッチ回路(位置検出手
段)17及びCPU1に出力するようになっている。
Origin / C phase detection circuit (C phase signal detection means,
The origin detection means) 19 has a C
UP / DOWN output from phase signal and quadruple circuit 13
A pulse and an UP / DOWN signal are provided, and a latch 2 clear signal and an origin latch clear signal output by the CPU 1 are provided. Then, the origin / C phase detection circuit 19 determines the encoder 1 based on these signals.
2 and the origin of the servo motor 11 are detected.
The phase detection signal and the origin detection signal are output to the latch circuit (position detection means) 17 and the CPU 1.

【0041】ラッチ回路17は、原点検出信号をラッチ
信号としてカウンタ14のカウントデータをラッチする
ようになっている。そして、ラッチ回路16と同様に、
CPU1によりラッチ回路17に割り当てられているア
ドレスがアドレスバス9に出力され、アドレスデコーダ
18によりチップセレクト信号が出力されるとイネーブ
ルとなって、ラッチされているデータをデータバス10
上に出力する。
The latch circuit 17 latches the count data of the counter 14 using the origin detection signal as a latch signal. And, like the latch circuit 16,
When the address assigned to the latch circuit 17 by the CPU 1 is output to the address bus 9 and the chip select signal is output by the address decoder 18, the address is enabled and the latched data is transferred to the data bus 10.
Output to the top.

【0042】図6は、原点/C相検出回路19の詳細な
電気的構成を示すものであり、図7は、原点/C相検出
回路19各部における信号波形を示すものである。UP
/DOWN信号は、Dフリップフロップ20及び21の
D入力端子(21側は負論理)に与えられていると共
に、ANDゲート22及び23の一方の入力端子(23
側は負論理)に与えられている。C相信号は、Dフリッ
プフロップ20及び21のクロック入力端子(21側は
負論理)に与えられている。
FIG. 6 shows a detailed electrical configuration of the origin / C phase detection circuit 19, and FIG. 7 shows signal waveforms at various parts of the origin / C phase detection circuit 19. UP
The / DOWN signal is supplied to the D input terminals of D flip-flops 20 and 21 (the negative logic is on the 21 side), and one input terminal (23) of AND gates 22 and 23.
Side is given to negative logic). The C-phase signal is supplied to clock input terminals of D flip-flops 20 and 21 (21 side has negative logic).

【0043】UP/DOWNNパルスは、ANDゲート
22及び23の他方の入力端子に与えられており、AN
Dゲート22及び23の出力端子は、Dフリップフロッ
プ24及び25のクロック入力端子並びにNORゲート
26及び27の一方の入力端子に夫々接続されている。
The UP / DOWN pulse is supplied to the other input terminals of the AND gates 22 and 23.
Output terminals of the D gates 22 and 23 are connected to clock input terminals of D flip-flops 24 and 25 and one input terminal of NOR gates 26 and 27, respectively.

【0044】ラッチ2クリア信号は、NORゲート26
及び27の他方の入力端子及びNOTゲート28の入力
端子に与えられており、NORゲート26及び27の出
力端子は、Dフリップフロップ21及び20の負論理の
CLR入力端子に夫々接続されている。また、NOTゲ
ート28の出力端子は、Dフリップフロップ24及び2
5の負論理のCLR入力端子に接続されている。
The latch 2 clear signal is output from the NOR gate 26
27 and the input terminal of a NOT gate 28, and the output terminals of the NOR gates 26 and 27 are connected to the negative logic CLR input terminals of the D flip-flops 21 and 20, respectively. The output terminal of the NOT gate 28 is connected to the D flip-flops 24 and 2
5 is connected to the negative logic CLR input terminal.

【0045】Dフリップフロップ20及び21のQ出力
端子は、Dフリップフロップ24及び25のD入力端子
に夫々接続されており、Dフリップフロップ24及び2
5のQ出力端子は、ORゲート29の入力端子に夫々接
続されている。そして、ORゲート29の出力端子か
ら、C相検出信号が出力されるようになっている。
The Q output terminals of the D flip-flops 20 and 21 are connected to the D input terminals of the D flip-flops 24 and 25, respectively.
5 Q output terminals are connected to the input terminals of the OR gate 29, respectively. The output terminal of the OR gate 29 outputs a C-phase detection signal.

【0046】また、UP/DOWNパルスは、4ビット
カウンタ30及びDフリップフロップ32のクロック入
力端子に接続されており、C相信号は、4ビットカウン
タ30の負論理のCLR入力端子及びDフリップフロッ
プ31の負論理のクロック入力端子に接続されている。
そして、原点ラッチクリア信号は、NOTゲート33を
介してDフリップフロップ31及び32の負論理のCL
R入力端子に接続されている。
The UP / DOWN pulse is connected to the clock input terminals of the 4-bit counter 30 and the D flip-flop 32, and the C-phase signal is input to the negative logic CLR input terminal of the 4-bit counter 30 and the D flip-flop. 31 clock input terminals of negative logic.
Then, the origin latch clear signal is sent to the negative logic CL of the D flip-flops 31 and 32 via the NOT gate 33.
Connected to R input terminal.

【0047】4ビットカウンタ30のQ3出力端子は、
Dフリップフロップ31のD入力端子に接続されてお
り、Dフリップフロップ31のQ出力端子は、Dフリッ
プフロップ32のD入力端子に接続されている。そし
て、Dフリップフロップ32のQ出力端子からは、原点
検出信号が出力されるようになっている。尚、原点/C
相検出回路19において、4ビットカウンタ30並びに
Dフリップフロップ31及び32は原点検出手段19a
を構成しており、その他の部分は、C相信号検出手段1
9bを構成している。
The Q3 output terminal of the 4-bit counter 30
The D input terminal of the D flip-flop 31 is connected to the D input terminal, and the Q output terminal of the D flip-flop 31 is connected to the D input terminal of the D flip-flop 32. The Q output terminal of the D flip-flop 32 outputs an origin detection signal. In addition, origin / C
In the phase detection circuit 19, the 4-bit counter 30 and the D flip-flops 31 and 32 are provided with origin detection means 19a.
The other parts are C-phase signal detecting means 1
9b.

【0048】次に、本実施例の作用について図7乃至図
9をも参照して説明する。原点/C相検出回路19にお
いて、Dフリップフロップ20は、カウンタ14のアッ
プカウント動作時におけるC相信号の立上がりエッジを
検出するものであり、Dフリップフロップ21は、カウ
ンタ14のダウンカウント動作時におけるC相信号の立
下がりエッジを検出するものである。
Next, the operation of this embodiment will be described with reference to FIGS. In the origin / C-phase detection circuit 19, the D flip-flop 20 detects the rising edge of the C-phase signal at the time of the up-counting operation of the counter 14, and the D flip-flop 21 at the time of the down-counting operation of the counter 14. It detects the falling edge of the C-phase signal.

【0049】即ち、図7において、サーボモータ11が
正転しており、B相信号の進み位相でカウンタ14がア
ップカウント動作を行っている期間は、UP/DOWN
信号はハイレベルであり、その状態でC相信号の立上が
りエッジが入力されると、Dフリップフロップ20がト
リガされて信号がハイレベルとなる(図7(g)参
照)。
That is, in FIG. 7, during the period when the servo motor 11 is rotating forward and the counter 14 is performing the up-counting operation with the leading phase of the B-phase signal, the UP / DOWN
The signal is at a high level, and when a rising edge of the C-phase signal is input in this state, the D flip-flop 20 is triggered and the signal goes to a high level (see FIG. 7 (g)).

【0050】そして、Dフリップフロップ24は、アッ
プカウント動作期間にANDゲート22から出力される
アップパルスでトリガされるため、信号がハイレベ
ルとなった次のアップパルスの入力タイミングで信号
がハイレベルとなり(図7(j)参照)、ORゲート
29を介してC相検出信号が出力される(図7(o)参
照)。
Since the D flip-flop 24 is triggered by the up pulse output from the AND gate 22 during the up-count operation period, the signal becomes high level at the input timing of the next up pulse after the signal goes high level. (See FIG. 7 (j)), and the C-phase detection signal is output via the OR gate 29 (see FIG. 7 (o)).

【0051】すると、C相検出信号をトリガとして、ラ
ッチ回路17は、カウンタ14のカウンタ値を基準位置
データとしてラッチする。CPU1は、C相検出信号が
出力されたことを認識すると、ラッチ2クリア信号を出
力して(図7(f)参照)Dフリップフロップ20及び
24をクリアする。
Then, triggered by the C-phase detection signal, the latch circuit 17 latches the counter value of the counter 14 as reference position data. When recognizing that the C-phase detection signal has been output, the CPU 1 outputs a latch 2 clear signal (see FIG. 7F) to clear the D flip-flops 20 and 24.

【0052】一方、サーボモータ11が逆転しており、
A相信号の進み位相でカウンタ14がダウンカウント動
作を行っている期間は、UP/DOWN信号はロウレベ
ルであり、その状態でC相信号の立下がりエッジが入力
されると、ネガティブエッジトリガのDフリップフロッ
プ21がトリガされて信号がハイレベルとなる(図7
(k)参照)。
On the other hand, the servo motor 11 is rotating in the reverse direction,
The UP / DOWN signal is at a low level during the period in which the counter 14 performs the down-counting operation with the leading phase of the A-phase signal, and when the falling edge of the C-phase signal is input in that state, the D of the negative edge trigger is changed. The signal becomes high level when the flip-flop 21 is triggered (see FIG. 7).
(K)).

【0053】そして、Dフリップフロップ25は、ダウ
ンカウント動作期間にANDゲート23から出力される
ダウンパルスでトリガされるため、信号がハイレベ
ルとなった次のダウンパルスの入力タイミングで信号
がハイレベルとなり(図7(n)参照)、ORゲート
28を介してC相検出信号が出力される(図7(o)参
照)。
Since the D flip-flop 25 is triggered by the down pulse output from the AND gate 23 during the down-count operation period, the signal becomes high level at the input timing of the next down pulse after the signal becomes high level. (See FIG. 7 (n)), and the C-phase detection signal is output via the OR gate 28 (see FIG. 7 (o)).

【0054】すると、ラッチ回路17は、カウンタ14
の正転時と同じカウンタ値をラッチし、CPU1は、C
相検出信号が出力されたことを認識すると、ラッチ2ク
リア信号を出力して(図7(f)参照)Dフリップフロ
ップ21及び25をクリアする。
Then, the latch circuit 17 sets the counter 14
Latches the same counter value as in the normal rotation of
When recognizing that the phase detection signal has been output, a latch 2 clear signal is output (see FIG. 7 (f)) to clear the D flip-flops 21 and 25.

【0055】即ち、原点/C相検出回路19は、サーボ
モータ11の正転時にはC相信号の立上がりエッジに基
づいて、逆転時には立ち下がりエッジに基づいてC相検
出信号を出力するので、C相検出信号は、サーボモータ
11の正逆転にかかわらず、C相信号の同一側エッジの
タイミングで出力されることになる。従って、サーボモ
ータ11の正転時と逆転時とでラッチ回路17がラッチ
するカウンタ14のカウンタ値は同じ値となる。
That is, the origin / C-phase detection circuit 19 outputs a C-phase detection signal based on the rising edge of the C-phase signal when the servo motor 11 is rotating forward and based on the falling edge when the servo motor 11 is rotating in the reverse direction. The detection signal is output at the timing of the same side edge of the C-phase signal regardless of whether the servo motor 11 is rotating forward or backward. Therefore, the counter value of the counter 14 latched by the latch circuit 17 at the time of forward rotation and the time of reverse rotation of the servo motor 11 becomes the same value.

【0056】また、例えば図8に示すように、サーボモ
ータ11が逆転している状態(A相進み)で、非検出側
(立上がり)のC相信号エッジが出力された直後に反転
し、UP/DOWN信号のレベルがロウからハイに切り
替わる前に逆転時検出側(立下がり)のC相信号エッジ
が出力された場合を考える。
Also, as shown in FIG. 8, for example, when the servo motor 11 is rotating in the reverse direction (A-phase advance), the signal is inverted immediately after the non-detection side (rising) C-phase signal edge is output, and It is assumed that the C-phase signal edge on the reverse rotation detection side (falling) is output before the level of the / DOWN signal switches from low to high.

【0057】原点/C相検出回路19は、上述のよう
に、正転時には、C相信号の立上がりエッジを検出した
後アップパルスに同期させて、逆転時には、立ち下が
りエッジを検出した後ダウンパルスに同期させてC相
検出信号を出力するようにしている。
As described above, the origin / C phase detection circuit 19 synchronizes with the up pulse after detecting the rising edge of the C phase signal during normal rotation, and detects the falling edge after detecting the falling edge during reverse rotation. In synchronization with the C phase detection signal.

【0058】従って、この場合でも、Dフリップフロッ
プ21はその逆転時検出側の立下がりエッジを検出して
信号はハイレベルとなるが、その後に出力されるのは
アップパルスであり次段のDフリップフロップ24は
トリガされない。また、そのアップパルスは、NOR
ゲート27を介してDフリップフロップ21にCLR信
号として与えられるので、非検出側のエッジ出力に基づ
いて誤ったタイミングでC相検出信号を出力することが
ない。
Therefore, even in this case, the D flip-flop 21 detects the falling edge on the detection side at the time of the reverse rotation, and the signal goes high. Flip-flop 24 is not triggered. The up-pulse is NOR
Since the D flip-flop 21 is supplied to the D flip-flop 21 via the gate 27 as a CLR signal, the C-phase detection signal is not output at an incorrect timing based on the non-detection-side edge output.

【0059】また、原点検出手段19aは、C相信号が
ハイレベルである期間だけ4ビットカウンタ30により
UP/DOWNパルスの出力数をカウントするようにな
っている。ここで、図9に示すように、特定C相信号の
パルス幅は、UP/DOWNパルスの出力数“8”に相
当するものであり、その他のC相信号のパルス幅は、U
P/DOWNパルスの出力数“4”に相当するように設
定されている。
The origin detecting means 19a counts the number of UP / DOWN pulses output by the 4-bit counter 30 only during the period when the C-phase signal is at the high level. Here, as shown in FIG. 9, the pulse width of the specific C-phase signal is equivalent to the number of outputs of the UP / DOWN pulse “8”, and the pulse width of the other C-phase signals is U
The setting is made so as to correspond to the output number “4” of the P / DOWN pulse.

【0060】従って、特定C相信号が入力された場合に
のみ、4ビットカウンタ30のQ3出力端子はハイレベ
ルとなり、Dフリップフロップ31は、D入力端子に与
えられるハイレベルの信号を、特定C相信号の立ち下が
りエッジでトリガする。すると、Dフリップフロップ3
2は、その次に入力されるUP/DOWNパルスの立上
がりに同期させて原点検出信号を出力する。
Therefore, only when the specific C-phase signal is input, the Q3 output terminal of the 4-bit counter 30 becomes high level, and the D flip-flop 31 outputs the high level signal given to the D input terminal to the specific C-phase signal. Trigger on the falling edge of the phase signal. Then, D flip-flop 3
2 outputs an origin detection signal in synchronization with the rising edge of the next input UP / DOWN pulse.

【0061】図1乃至図3は、CPU1の制御内容を示
すフローチャートである。図1において、CPU1は、
内部に組み込まれている図示しないシステムタイマが既
定値に達してタイマ割込み信号を出力するのを待つ(ス
テップA1)。このタイマ割込み信号は、ラッチ信号
(1)としてラッチ回路16に出力されるようになって
いる。
FIGS. 1 to 3 are flowcharts showing the control contents of the CPU 1. In FIG. 1, the CPU 1
It waits until a system timer (not shown) incorporated therein reaches a predetermined value and outputs a timer interrupt signal (step A1). This timer interrupt signal is output to the latch circuit 16 as a latch signal (1).

【0062】そして、CPU1は、タイマ割込み信号が
与えられると、ラッチ回路16によりラッチされている
カウンタ14のカウンタ値(a)を読み込んで、RAM
3に書き込み記憶させる(ステップA2)。次に、ステ
ップA2で読み込んだ今回のカウンタ値と、RAM3に
記憶されている前回のカウンタ値との差分をとり、その
差分値を既に記憶している前回のカウント値に加算して
現在の回転位置を更新する(ステップA3)。
When the CPU 1 receives the timer interrupt signal, the CPU 1 reads the counter value (a) of the counter 14 latched by the latch
3 is stored (step A2). Next, the difference between the current counter value read in step A2 and the previous counter value stored in the RAM 3 is obtained, and the difference value is added to the previously stored previous count value to obtain the current rotation value. The position is updated (step A3).

【0063】この様にカウンタ値の差分を累積して回転
位置を求めるのは、カウンタ14の最大カウント値は、
サーボモータ11などの変位体のフルストローク(最大
変位量)間で出力されるエンコーダ12のUP/DOW
Nパルス数よりも小さいため、カウンタ値を直接読み込
んでもサーボモータ11の回転位置を判別することがで
きないからである。また、システムタイマの周期は、サ
ーボモータ11が最高速度で回転した場合のカウンタ1
4のオーバーフロー周期よりも十分短くなるように設定
してある。
In order to determine the rotational position by accumulating the difference between the counter values as described above, the maximum count value of the counter 14 is as follows.
UP / DOW of encoder 12 output during full stroke (maximum displacement) of a displacement body such as servo motor 11
This is because the rotation position of the servomotor 11 cannot be determined even if the counter value is directly read because the number of pulses is smaller than the number of N pulses. The cycle of the system timer is determined by the counter 1 when the servo motor 11 rotates at the maximum speed.
4 is set to be sufficiently shorter than the overflow period.

【0064】次に、CPU1は、ステップA3で更新し
た回転位置及びタイマ割り込み周期に基づき計算したサ
ーボモータ11の速度に応じてサーボモータ11の制御
を行うと(ステップA4)、入力ポートを参照し、原点
/C相検出回路19よりC相検出信号が出力されている
か否かを判断する(ステップA5)。C相検出信号が出
力されていない場合はステップA1に移行して、次のタ
イマ割り込みが発生するのを待つ。
Next, when the CPU 1 controls the servo motor 11 according to the rotational position and the speed of the servo motor 11 calculated based on the timer interrupt cycle updated in step A3 (step A4), the CPU 1 refers to the input port. It is determined whether a C-phase detection signal is output from the origin / C-phase detection circuit 19 (step A5). If the C-phase detection signal has not been output, the process proceeds to step A1 and waits for the next timer interrupt to occur.

【0065】判断ステップA5においてC相検出信号が
出力されている場合、CPU1は、ラッチ回路17にラ
ッチされているカウンタ値(b)を読込む。その後に、
ラッチ2クリア信号を出力することによりDフリップフ
ロップ30をクリアしてC相検出信号をインアクティブ
にする(ステップA6,図7(f)参照)。尚、CPU
1がC相検出信号を認識し、ラッチ回路17のラッチデ
ータを読み込み、ラッチ2クリア信号を出力する間の時
間は、C相信号パルスの発生間隔よりも十分短く、C相
信号の検出抜けが生じないように設定されている。
When the C-phase detection signal is output in the judgment step A5, the CPU 1 reads the counter value (b) latched by the latch circuit 17. Then,
By outputting the latch 2 clear signal, the D flip-flop 30 is cleared and the C phase detection signal is made inactive (step A6, see FIG. 7 (f)). In addition, CPU
1 recognizes the C-phase detection signal, reads the latch data of the latch circuit 17, and outputs the latch 2 clear signal. The time between the generation of the C-phase signal pulse is sufficiently shorter than that of the C-phase signal pulse. Is set to not occur.

【0066】次に、CPU1は、カウンタ値(b)と
(a)との差分を求めてC相検出信号が出力された時点
の回転位置(B)を得ると(ステップA7)、RAM3
に記憶されている前回の回転位置(A)と比較する(ス
テップA8)。判断ステップA8において、両回転位置
の差分値{(B)−(A)}が、C相信号の出力間隔の
1/2であるカウント値(パルス数)“8”よりも大で
あれば、サーボモータ11は正転しており、単発ずれ量
(C)を{(B)−(16パルス)−(A)}として求
め(ステップA12)、ステップA11の「ずれ判定処
理」に移行する。
Next, when the CPU 1 obtains the difference between the counter values (b) and (a) to obtain the rotational position (B) at the time when the C-phase detection signal is output (step A7), the RAM 3
Is compared with the previous rotational position (A) stored in (A8). In the determination step A8, if the difference value {(B)-(A)} between the two rotational positions is larger than the count value (number of pulses) “8” which is 1 / of the output interval of the C-phase signal, The servo motor 11 is rotating forward, and the single-shot deviation amount (C) is obtained as {(B) − (16 pulses) − (A)} (step A12), and the process proceeds to the “displacement determination process” of step A11.

【0067】また、判断ステップA8において、両回転
位置の差分値{(B)−(A)}がカウント値“8”以
下である場合は、判断ステップA9に移行する。そし
て、両回転位置の差分値{(A)−(B)}がカウント
値“8”よりも大である場合は、サーボモータ11は逆
転しており、単発ずれ量(C)を、{(B)+(16パ
ルス)−(A)}として求めた後に(ステップA13)
「ずれ判定処理」に移行する。
If the difference value {(B)-(A)} between the two rotational positions is less than or equal to the count value "8" in the judgment step A8, the flow shifts to the judgment step A9. When the difference value {(A) − (B)} between the two rotational positions is larger than the count value “8”, the servo motor 11 is rotating in the reverse direction, and the single-shot deviation amount (C) is calculated as {( B) + (16 pulses) − (A)} (step A13)
The processing shifts to “shift determination processing”.

【0068】更に、判断ステップA9において、両回転
位置の差分値{(A)−(B)}がカウント値“8”以
下である場合は、前回と同じ回転位置に応じたC相信号
を検出したものと判断されるので、単発ずれ量(C)
を、{(B)−(A)}として求めた後(ステップA1
0)「ずれ判定処理」に移行する。以上のずれ量を算出
する処理は、ステップA5においてC相信号が検出され
る毎に、即ち、UP/DOWNパルスが16パルスカウ
ントされる毎に行われる。尚、ステップA8〜A10,
A12及びA13は、位置ずれ量検出手段に対応する。
Further, in the judgment step A9, if the difference value (A)-(B)} between the two rotational positions is equal to or smaller than the count value "8", a C-phase signal corresponding to the same rotational position as the previous time is detected. Since it is determined that the deviation has occurred, the single-shot deviation amount (C)
As {(B)-(A)} (step A1).
0) The process proceeds to “shift determination processing”. The above-described process of calculating the amount of deviation is performed every time a C-phase signal is detected in step A5, that is, every time 16 UP / DOWN pulses are counted. Steps A8 to A10,
A12 and A13 correspond to a displacement amount detecting means.

【0069】図2は、「ずれ判定処理」のフローチャー
トである。尚、以下のカウンタ(G),(H)は、電源
投入後の初期処理においてゼロクリアされた状態から以
下の処理が開始されるようになっている。最初の判断ス
テップB1において、CPU1は、単発ずれ量(C)が
“0”であるか否かを判断する。単発ずれ量(C)が
“0”の場合はずれは発生していないので、後述するよ
うに、連続補正回数をカウントするためのカウンタ
(G)をゼロクリアして(ステップB2)処理を終了す
る。
FIG. 2 is a flowchart of the "shift determination process". The following counters (G) and (H) are configured to start the following processing from a state where the counters are cleared to zero in the initial processing after the power is turned on. In the first determination step B1, the CPU 1 determines whether or not the single-shot deviation amount (C) is “0”. If the single shift amount (C) is "0", no shift has occurred, and therefore, as will be described later, the counter (G) for counting the number of continuous corrections is cleared to zero (step B2), and the process ends.

【0070】単発ずれ量(C)が“0”でない場合は、
位置補正モードであるか否かを判断する(ステップB
3)。位置補正モードは、例えばユーザが、操作装置7
によって予め設定するものである。
If the single shot deviation (C) is not "0",
It is determined whether or not the mode is the position correction mode (step B
3). In the position correction mode, for example, the user
Is set in advance.

【0071】位置補正モードが設定されていない場合、
CPU1は、RAM3に記憶されている前回までの累積
ずれ量に単発ずれ量(C)を足し込んで累積ずれ量を更
新する(ステップB4,位置ずれ量累積手段)。そし
て、その更新した累積ずれ量が、累積ずれ許容値を超え
ているか否かを判断する(ステップB5,異常判定手
段)。累積ずれ量が、累積ずれ許容値以下である場合
は、図1のステップA7で求めた回点位置(B)により
回点位置(A)を更新してRAM3に記憶させてから
(ステップB10)、処理を終了する。また、CPU1
は、累積ずれ量を表示装置6に表示させる。
When the position correction mode is not set,
The CPU 1 updates the cumulative deviation amount by adding the single deviation amount (C) to the previous cumulative deviation amount stored in the RAM 3 (Step B4, position deviation amount accumulating means). Then, it is determined whether or not the updated cumulative deviation amount exceeds the cumulative deviation allowable value (step B5, abnormality determining means). If the cumulative shift amount is equal to or less than the cumulative shift allowable value, the turning point (A) is updated based on the turning point (B) obtained in step A7 of FIG. 1 and stored in the RAM 3 (step B10). , And the process ends. CPU1
Causes the display device 6 to display the accumulated shift amount.

【0072】判断ステップB3において、位置補正モー
ドが設定されている場合、CPU1は、単発ずれ量
(C)が位置補正許容値を超えているか否かを判断し
(ステップB6)、位置補正許容値以下である場合は、
連続補正回数のカウンタ(G)及び電源投入時からの補
正回数表示用のカウンタ(H)を共にインクリメントす
る(ステップB7)。尚、カウンタ(H)の値は、表示
装置6に表示される。
If the position correction mode is set in the determination step B3, the CPU 1 determines whether or not the single displacement amount (C) exceeds the position correction allowable value (step B6). If
The counter (G) for the number of continuous corrections and the counter (H) for displaying the number of corrections since power-on are both incremented (step B7). The value of the counter (H) is displayed on the display device 6.

【0073】そして、カウンタ(G)の値が、所定の連
続補正回数を超えているか否かを判断し(ステップB
8,連続補正異常判定手段)、所定の連続補正回数以下
である場合は、ステップA7で求めた回点位置(B)を
単発ずれ量(C)分だけ補正して(ステップB9,位置
補正手段)、補正した回点位置(B)′を回点位置
(A)として更新すると(ステップB10)処理を終了
する。
Then, it is determined whether or not the value of the counter (G) exceeds a predetermined number of consecutive corrections (step B).
8, continuous correction abnormality determination means), if the number of continuous corrections is less than or equal to the predetermined number of continuous corrections, the turning point position (B) obtained in step A7 is corrected by the single-shot deviation amount (C) (step B9, position correction means). ), When the corrected turning point position (B) 'is updated as the turning point position (A) (step B10), the process ends.

【0074】また、判断ステップB6において、単発ず
れ量(C)が位置補正許容値を超えている場合、及び判
断ステップB8において、カウンタ(G)の値が所定の
連続補正回数を超えている場合は、何れもエンコーダ1
2に異常があると判断し、表示装置6に表示を行うなど
の異常処理を行った後(ステップB11)、処理を終了
する。尚、以上の処理は、以下に述べる原点復帰動作処
理において原点検出が行われた後に開始される。
Further, when the single deviation amount (C) exceeds the position correction allowable value in the judgment step B6, and when the value of the counter (G) exceeds the predetermined number of consecutive corrections in the judgment step B8. Is the encoder 1
It is determined that there is an abnormality in 2 and abnormal processing such as displaying on the display device 6 is performed (step B11), and then the processing is terminated. The above processing is started after the origin detection is performed in the home return operation processing described below.

【0075】図3は、電源投入時にCPU1により行わ
れる原点復帰動作処理の制御内容を示すフローチャート
である。CPU1は、先ず、原点ラッチクリア信号を原
点/C相検出回路19に出力すると(ステップC1)、
次のステップC2〜C5までは、ステップA1〜A4と
同様の処理を行う。
FIG. 3 is a flowchart showing the control contents of the home position return operation process performed by the CPU 1 when the power is turned on. First, the CPU 1 outputs an origin latch clear signal to the origin / C phase detection circuit 19 (step C1).
In the following steps C2 to C5, the same processing as in steps A1 to A4 is performed.

【0076】そして、CPU1は、対応する入力ポート
を参照して、判断ステップC6で原点リミットスイッチ
(図示せず)がONしたか否かを判断する。原点リミッ
トスイッチは、サーボモータ11の機械原点を検出する
ために、サーボモータ11が1回転する間において所定
回転位置に達した時にONするもので、スイッチがO
N,OFF動作する間の誤差の影響を受けないように、
C相信号による原点位置、即ち、特定C相信号が出力さ
れる位置と略反対側でONするように取り付けられてい
る。
Then, referring to the corresponding input port, the CPU 1 determines whether or not the origin limit switch (not shown) is turned on in a determination step C6. The origin limit switch is turned ON when the servo motor 11 reaches a predetermined rotation position during one rotation of the servo motor 11 in order to detect the mechanical origin of the servo motor 11.
In order not to be affected by the error during N, OFF operation,
It is mounted so as to be turned on at the origin position by the C-phase signal, that is, on the side substantially opposite to the position where the specific C-phase signal is output.

【0077】ステップC6において、原点リミットスイ
ッチがONしている場合は、ステップC7で原点リミッ
トフラグを“1”にセットして判断ステップC8に移行
し、また、原点リミットスイッチがONしていない場合
は、そのままステップC8に移行する。
If the origin limit switch is ON in step C6, the origin limit flag is set to "1" in step C7, and the process proceeds to step C8. If the origin limit switch is not ON Directly proceeds to Step C8.

【0078】ステップC8では、原点リミットフラグが
“1”であるか否かを判断して、“1”である場合は判
断ステップC9において、また、“1”でない場合は判
断ステップC17において夫々原点検出信号が出力され
ている(“1”である)か否かを判断する。
In step C8, it is determined whether or not the origin limit flag is "1". If it is "1", it is determined in decision step C9, and if it is not "1", it is determined in decision step C17. It is determined whether the detection signal is output (is "1").

【0079】ステップC9で原点検出信号が出力されて
いる場合は、原点フラグを“1”にセットして(ステッ
プC10)判断ステップC11に移行する。また、ステ
ップC17で原点検出信号が出力されている場合は、原
点ラッチクリア信号を出力して(ステップC18)判断
ステップC11に移行する。そして、ステップC9及び
C17で原点検出信号が出力されていない場合は、何れ
もそのままステップC11に移行する。
If the origin detection signal has been output in step C9, the origin flag is set to "1" (step C10), and the routine goes to a decision step C11. If the origin detection signal has been output in step C17, an origin latch clear signal is output (step C18), and the routine goes to a judgment step C11. If the origin detection signal has not been output in steps C9 and C17, the process directly proceeds to step C11.

【0080】ステップC11では、CPU1は、C相信
号を検出したか否かを判断して、C相信号を検出した場
合はラッチ回路17によりラッチされているカウンタ1
4のカウンタ値(b)を読込んでから、ラッチ2クリア
信号を出力する(ステップC12)。また、C相信号を
検出しない場合は判断ステップC14に移行する。
At step C 11, the CPU 1 determines whether or not a C-phase signal has been detected, and if a C-phase signal has been detected, the counter 1 latched by the latch circuit 17.
After reading the counter value (b) of No. 4, a latch 2 clear signal is output (step C12). If the C-phase signal is not detected, the flow shifts to decision step C14.

【0081】ステップC12でカウンタ値(b)を読込
むと、CPU1は、そのカウンタ値(b)とステップC
3で読込んだカウンタ値(a)との差分、及び現在の回
転位置データより、カウンタ値(b)のラッチ時におけ
る回転位置データ(B)を求める。そして、ステップC
14に移行する。
When the counter value (b) is read in step C12, the CPU 1 reads the counter value (b) and the value in step C12.
The rotational position data (B) at the time of latching the counter value (b) is obtained from the difference from the counter value (a) read in 3 and the current rotational position data. And step C
Go to 14.

【0082】ステップC14では、原点フラグが“1”
にセットされているか否かを判断し、“1”にセットさ
れている場合は回転位置(B)を原点位置として設定し
(ステップC15)、原点検出完了フラグを“1”にセ
ットして(ステップC16)処理を終了する。また、原
点フラグが“1”にセットされていない場合は、ステッ
プC2に移行して、次のシステムタイマの割り込み信号
の発生を待つ。
At step C14, the origin flag is set to "1".
Is determined, and if it is set to "1", the rotation position (B) is set as the origin position (step C15), and the origin detection completion flag is set to "1" (step C15). Step C16) The process ends. If the origin flag is not set to "1", the flow shifts to step C2 to wait for the generation of the next system timer interrupt signal.

【0083】ここで、図9を参照すると、サーボモータ
11が逆転しておりA相信号が進み位相である場合に、
原点/C相検出回路19が原点検出信号を出力するタイ
ミングは、特定C相信号の立下がりエッジが入力されて
C相検出信号が出力された時点(例えば、カウンタ値
“33”)と同時である。従って、この場合は、図3の
フローにおいて、ステップC11→C12→C13→C
14→C15と移行して、C相検出信号が検出された時
点の最新のラッチデータを読込んで、ステップC13で
更新した回転位置データ(B)(カウンタ値“33”)
が原点位置として設定される。
Here, referring to FIG. 9, when the servo motor 11 is rotating in the reverse direction and the A-phase signal is in the leading phase,
The origin / C phase detection circuit 19 outputs the origin detection signal at the same time as the time when the falling edge of the specific C phase signal is input and the C phase detection signal is output (for example, the counter value “33”). is there. Therefore, in this case, in the flow of FIG. 3, steps C11 → C12 → C13 → C
The transition is made from 14 to C15, the latest latch data at the time when the C-phase detection signal is detected is read, and the rotational position data (B) updated at step C13 (counter value “33”)
Is set as the origin position.

【0084】一方、サーボモータ11が正転しておりB
相信号が進み位相である場合に、原点/C相検出回路1
9が原点検出信号を出力するタイミングは、特定C相信
号の立上がりエッジが入力されてC相検出信号が出力さ
れた時点(例えば、カウンタ値“33”)から8カウン
ト経過した時点(カウンタ値“41”)である。従っ
て、この場合は、図3のフローにおいて、ステップC1
1→C14→C15と移行して、前回C相検出信号が検
出された時点の更新されていない回転位置データ(B)
(カウンタ値“33”)が原点位置として設定される。
On the other hand, when the servo motor 11 is
When the phase signal is a leading phase, the origin / C phase detection circuit 1
The timing at which the reference point 9 outputs the origin detection signal is the point in time when eight counts have elapsed (counter value “33”) from the point in time when the rising edge of the specific C-phase signal is input and the C-phase detection signal is output (for example, counter value “33”) 41 "). Therefore, in this case, in the flow of FIG.
1 → C14 → C15, and the rotational position data (B) that has not been updated when the C-phase detection signal was detected last time
(Counter value “33”) is set as the origin position.

【0085】以上のように本実施例によれば、エンコー
ダ12のC相信号を、サーボモータ11の一回転周期の
間に複数回出力するようにして、その内の一つである特
定C相信号の出力期間を他のC相信号の出力期間と異な
るように設定し、CPU1は、原点/C相検出回路19
によりC相検出信号が出力される毎に、カウンタ14が
カウントする回転位置データのずれ量を検出するように
した。
As described above, according to the present embodiment, the C-phase signal of the encoder 12 is output a plurality of times during one rotation cycle of the servomotor 11, so that one of the specific C-phase signals is output. The output period of the signal is set to be different from the output periods of the other C-phase signals.
Thus, every time the C-phase detection signal is output, the amount of deviation of the rotational position data counted by the counter 14 is detected.

【0086】従って、複数のC相信号の出力タイミング
に基づいて、カウンタ14がA相信号及びB相信号の正
しい出力タイミングに基づいて正常なカウント動作を行
っているか否かを高い頻度で判定することができる。ま
た、原点/C相検出回路19が、C相信号の出力期間を
判別することで、特定C相信号を基準点として検出し
て、サーボモータ11の原点位置を容易に決定すること
ができる。
Therefore, based on the output timings of the plurality of C-phase signals, it is frequently determined whether or not the counter 14 is performing a normal counting operation based on the correct output timings of the A-phase signal and the B-phase signal. be able to. Further, the origin / C-phase detection circuit 19 determines the output period of the C-phase signal, thereby detecting the specific C-phase signal as a reference point and easily determining the origin position of the servomotor 11.

【0087】更に、本実施例によれば、複数回出力され
るC相信号の片側のエッジ出力間隔が全て等しくなるよ
うにしたので、原点/C相検出回路19が、C相信号の
検出を出力間隔が等しい側のエッジに基づいて行うこと
で、C相信号の検出間隔内におけるA相及びB相信号の
出力数は全て等しくなり、CPU1は、C相信号の何れ
の検出タイミングにおいても、その等しい出力数に基づ
いて変位位置データのずれ量検出を容易に行うことがで
きる。
Further, according to the present embodiment, since the edge output intervals on one side of the C-phase signal output a plurality of times are all equal, the origin / C-phase detection circuit 19 detects the C-phase signal. By performing based on the edge on the side where the output interval is equal, the number of outputs of the A-phase signal and the B-phase signal within the detection interval of the C-phase signal is all equal, and the CPU 1 performs The displacement amount of the displacement position data can be easily detected based on the equal number of outputs.

【0088】加えて、本実施例によれば、原点/C相検
出回路19は、サーボモータ11の正転時にはC相信号
の立上がりエッジに基づいて、逆転時には立ち下がりエ
ッジに基づいてC相検出信号を出力するので、C相検出
信号は、サーボモータ11の正逆転にかかわらず、C相
信号の同一側エッジのタイミングで出力されることにな
る。従って、サーボモータ11の正転時と逆転時とでラ
ッチ回路17がラッチするカウンタ14のカウンタ値は
同じ値となるので、構成を簡単にすることができる。
In addition, according to the present embodiment, the origin / C-phase detection circuit 19 detects the C-phase based on the rising edge of the C-phase signal when the servo motor 11 rotates in the normal direction and based on the falling edge when the servo motor 11 rotates in the reverse direction. Since the signal is output, the C-phase detection signal is output at the timing of the same side edge of the C-phase signal regardless of whether the servo motor 11 rotates normally or not. Therefore, the counter value of the counter 14 latched by the latch circuit 17 at the time of forward rotation and the time of reverse rotation of the servo motor 11 becomes the same value, so that the configuration can be simplified.

【0089】また、本実施例によれば、CPU1は、ラ
ッチ回路17によりサーボモータ11の回点位置が検出
される毎に、前回に検出された回点位置データとの差分
値に基づいてカウンタ14の単発ずれ量(C)を検出す
るとその単発ずれ量(C)を累積して、累積された位置
ずれ量が、予め設定された累積ずれ量許容値を超えた場
合に異常と判定するようにした。
Also, according to the present embodiment, each time the turning point position of the servomotor 11 is detected by the latch circuit 17, the CPU 1 sets the counter based on the difference value from the previously detected turning point position data. When the single-shot deviation amount (C) is detected, the single-shot deviation amount (C) is accumulated, and when the accumulated positional deviation amount exceeds a preset accumulated deviation amount allowable value, it is determined to be abnormal. I made it.

【0090】従って、例えば、エンコーダ12のスリッ
トにゴミなどが付着することによって、A相信号若しく
はB相信号の1パルス抜けが原点位置の検出毎に生じる
場合でも、その1パルス抜けによるずれ量は累積される
ことで確実に検出されるので、確実に異常判定を行うこ
とができる。
Therefore, for example, even if dust or the like adheres to the slit of the encoder 12 and one pulse of the A-phase signal or the B-phase signal is lost each time the origin position is detected, the amount of deviation due to the one pulse is missing. Since the accumulation is reliably detected, the abnormality determination can be reliably performed.

【0091】更に、本実施例によれば、エンコーダ12
の単発ずれ量(C)が予め設定された補正許容値以下で
ある場合は、検出された原点位置データを単発ずれ量
(C)に基づいて補正するので、補正許容値以下のずれ
量で原点位置データを補正することで、正確な回点位置
を得ることができる。
Further, according to the present embodiment, the encoder 12
If the single-shot deviation amount (C) is equal to or smaller than the preset correction allowable value, the detected origin position data is corrected based on the single-shot deviation amount (C). By correcting the position data, an accurate turning point position can be obtained.

【0092】そして、エンコーダ12の単発ずれ量
(C)が連続して前記補正許容値以下となった回数をカ
ウントして、そのカウント値が所定値を超えた場合に異
常と判定するので、補正許容値以下であっても、ずれ量
が連続して発生するという異常が発生している確率が高
い場合についても異常として判定することができる。ま
た、電源投入時から回点位置データの補正が行われた回
数をカウンタ(H)によりカウントして、累積ずれ量と
共に表示装置6に表示させるようにしたので、ユーザ
は、サーボモータ11が動作している環境のノイズ発生
頻度を視覚的に把握することができる。
Then, the number of times that the single-shot deviation amount (C) of the encoder 12 continuously becomes equal to or less than the correction allowable value is counted, and if the count value exceeds a predetermined value, it is determined that there is an abnormality. Even if the difference is equal to or smaller than the allowable value, a case where the probability that the deviation amount continuously occurs has a high probability of occurrence can be determined to be abnormal. In addition, the number of times that the turning point data has been corrected since the power was turned on is counted by the counter (H) and is displayed on the display device 6 together with the accumulated deviation amount. It is possible to visually grasp the frequency of occurrence of noise in the environment in which the noise occurs.

【0093】図10乃至図13は本発明の第2実施例を
示すものであり、第1実施例と同一部分には同一符号を
付して説明を省略し、以下異なる部分についてのみ説明
する。図10は、第1実施例のカウンタ回路8に代わる
カウンタ回路8aの構成を示す機能ブロック図である。
カウンタ回路8aの構成は、第1実施例における原点/
C相検出回路19が、原点/C相検出回路(C相信号検
出手段,原点検出手段)34に置き換わったものであ
る。
FIGS. 10 to 13 show a second embodiment of the present invention. The same portions as those in the first embodiment are denoted by the same reference numerals, and description thereof will be omitted. Only different portions will be described below. FIG. 10 is a functional block diagram showing a configuration of a counter circuit 8a in place of the counter circuit 8 of the first embodiment.
The configuration of the counter circuit 8a is different from the origin /
The C-phase detection circuit 19 is replaced with an origin / C-phase detection circuit (C-phase signal detection means, origin detection means) 34.

【0094】また、エンコーダ12に代わるエンコーダ
12aからは、原点/C相検出回路34に対してA,B
及びC相信号が与えられている。エンコーダ12aが出
力するC相信号のパルス幅は、A相及びB相信号の周期
Tと略等しくなるように、スケールに設けられているス
リットの形状及び配置が調整されている(図13参
照)。加えて、特定C相信号以外のC相信号のパルス
は、そのパルス幅の略中心位相にA相信号パルスの立下
がりエッジが位置するように調整されている。
Further, from the encoder 12a in place of the encoder 12, A, B
And a C-phase signal. The shape and arrangement of the slits provided on the scale are adjusted so that the pulse width of the C-phase signal output from the encoder 12a is substantially equal to the period T of the A-phase and B-phase signals (see FIG. 13). . In addition, the pulses of the C-phase signal other than the specific C-phase signal are adjusted such that the falling edge of the A-phase signal pulse is located at substantially the center phase of the pulse width.

【0095】図11は、原点/C相検出回路34におい
てC相信号の検出を行う部分の詳細な電気的構成を示す
ものであり、図12は、各部の信号波形を示すものであ
る。尚、原点/C相検出回路34における原点検出手段
の構成は、第1実施例の原点検出手段19aと同様であ
り、図示を省略している。
FIG. 11 shows a detailed electrical configuration of a portion for detecting a C-phase signal in the origin / C-phase detection circuit 34, and FIG. 12 shows a signal waveform of each portion. The configuration of the origin detecting means in the origin / C phase detecting circuit 34 is the same as that of the origin detecting means 19a of the first embodiment, and is not shown.

【0096】シリアルに接続されている3つのDフリッ
プフロップ35,36及び37のクロック入力端子CK
には、クロック回路38のクロック信号CLKが与えら
れるようになっている。そして、初段のDフリップフロ
ップ35のD入力端子に与えられるA相信号は、Dフリ
ップフロップ35,36,37のQ出力端子において、
夫々クロック信号CLK1個分ずつシフトされた信号
,,として出力される(図12(c)〜(e)参
照)。
Clock input terminals CK of three D flip-flops 35, 36 and 37 connected serially
Is supplied with a clock signal CLK of the clock circuit 38. The A-phase signal applied to the D input terminal of the first-stage D flip-flop 35 is applied to the Q output terminals of the D flip-flops 35, 36, and 37.
Each of them is output as a signal shifted by one clock signal CLK (see FIGS. 12C to 12E).

【0097】EXORゲート39は、信号及びの排
他的論理和をとって信号を出力する(図12(g)参
照)。即ち、信号は、図12(a)に示すA相信号の
立上がり及び立下がりエッジの出力に応じて出力され
る、クロック信号CLKの1パルス分のパルス幅を有す
る信号である。また、EXORゲート40は、信号及
びの排他的論理和をとって信号を出力する(図12
(f)参照)ので、信号は、信号に対してクロック
信号CLKの1パルス分だけ遅延された信号となってい
る。
The EXOR gate 39 outputs a signal by taking the exclusive OR of the signal and the signal (see FIG. 12 (g)). That is, the signal is a signal having a pulse width of one pulse of the clock signal CLK, which is output according to the rising and falling edges of the A-phase signal shown in FIG. The EXOR gate 40 outputs a signal by taking an exclusive OR of the signal and the signal (FIG. 12).
Therefore, the signal is a signal that is delayed by one pulse of the clock signal CLK with respect to the signal.

【0098】これらのEXORゲート40及び39が出
力する信号及びは、ANDゲート41及び42の一
方の入力端子に与えられており、そのANDゲート41
及び42の他方の入力端子(ANDゲート41側は負論
理)には、UP/DOWN信号(U/D信号)が与えら
れている。そして、ANDゲート41及び42の出力端
子は、ORゲート43の入力端子に夫々接続されてお
り、ORゲート43の出力信号は、3入力のANDゲ
ート44の1つの入力端子に与えられている。
The signals output from these EXOR gates 40 and 39 are given to one input terminal of AND gates 41 and 42, and the AND gate 41
The UP / DOWN signal (U / D signal) is given to the other input terminal of the AND gate 42 (the negative logic on the AND gate 41 side). The output terminals of the AND gates 41 and 42 are respectively connected to the input terminals of the OR gate 43, and the output signal of the OR gate 43 is provided to one input terminal of the three-input AND gate 44.

【0099】即ち、図12(h)及び(i)に示すよう
に、U/D信号がロウレベル(ダウン)の時には、AN
Dゲート41及びORゲート43を介して信号が信号
として出力され、U/D信号がハイレベル(アップ)
の時には、ANDゲート42及びORゲート43を介し
て信号が信号として選択的に出力されるようになっ
ている。
That is, as shown in FIGS. 12 (h) and 12 (i), when the U / D signal is at a low level (down),
A signal is output as a signal via the D gate 41 and the OR gate 43, and the U / D signal is at a high level (up).
In this case, the signal is selectively output as a signal via the AND gate 42 and the OR gate 43.

【0100】そして、3入力ANDゲート44の残り2
つの入力端子には、エンコーダ12aのB相及びC相信
号が与えられており、ANDゲート44の出力端子はD
フリップフロップ45のクロック入力端子に接続されて
いる。Dフリップフロップ45のD入力端子はハイレベ
ルにプルアップされており、Q出力端子には、C相検出
信号が出力されるようになっている。
Then, the remaining 2 of the 3-input AND gate 44
One input terminal is supplied with the B-phase and C-phase signals of the encoder 12a, and the output terminal of the AND gate 44 is
The flip-flop 45 is connected to a clock input terminal. The D input terminal of the D flip-flop 45 is pulled up to a high level, and the C output terminal outputs a C phase detection signal.

【0101】次に、第2実施例の作用について図13を
も参照して説明する。例えば、サーボモータ11が逆転
している場合は、A相及びB相信号の立上がり,立下が
りエッジの出力に応じて、カウンタ14はダウンカウン
ト動作を行う(図13(a),(b),(e)参照)。
尚、カウンタ14はA相及びB相信号の入力状態が変化
してからクロック信号CLK(図13(d)参照)の2
クロック後にカウントアップ(ダウン)を行うようにな
っている。この時、図13(h)に示すように、U/D
信号はロウレベルであり、図13(f)に示す信号と
しては、図11(g)の信号が出力されている。
Next, the operation of the second embodiment will be described with reference to FIG. For example, when the servo motor 11 is rotating in the reverse direction, the counter 14 performs a down-counting operation in accordance with the output of the rising and falling edges of the A-phase and B-phase signals (FIGS. 13A, 13B, and 13B). (E)).
It should be noted that after the input state of the A-phase signal and the B-phase signal has changed, the counter 14 outputs the clock signal CLK (see FIG. 13D).
It counts up (down) after the clock. At this time, as shown in FIG.
The signal is at a low level, and the signal shown in FIG. 11G is output as the signal shown in FIG.

【0102】そして、逆転の場合は、B相及びC相の信
号レベルが共にハイである期間で、且つ、A相信号の立
下がりエッジが出力されると、ANDゲート44の入力
が全てハイレベルとなってC相検出信号が出力される
(図13(g)参照)。すると、ラッチ回路17は、そ
のC相検出信号の立下がりエッジにおいて、カウンタ1
4がデータバスに出力しているカウント値“3”をラッ
チする。同時に、CPU1にもC相検出信号が与えられ
る。
In the case of the reverse rotation, all the inputs of the AND gate 44 are at the high level during the period when the signal levels of the B phase and the C phase are both high and the falling edge of the A phase signal is output. And a C-phase detection signal is output (see FIG. 13 (g)). Then, at the falling edge of the C-phase detection signal, the latch circuit 17 outputs the counter 1
4 latches the count value “3” output to the data bus. At the same time, the CPU 1 is also supplied with the C-phase detection signal.

【0103】また、サーボモータ11が正転している場
合は、カウンタ14はアップカウント動作を行う(図1
3(a),(b),(e)参照)。そして、正転の場合
は、B相及びC相の信号レベルが共にハイである期間
で、且つ、A相信号の立上がりエッジの出力に基づいて
C相検出信号が出力される(図13(g)参照)。この
時、図13(h)に示すように、U/D信号はハイレベ
ルであり、図13(f)に示す信号としては、図12
(f)の信号が出力されている。すると、ラッチ回路
17は、そのC相検出信号の立上がりエッジにおいて、
カウンタ3がデータバスに出力しているカウント値
“3”をラッチする。
When the servo motor 11 is rotating forward, the counter 14 performs an up-count operation (FIG. 1).
3 (a), (b) and (e)). In the case of normal rotation, the C-phase detection signal is output during a period in which the signal levels of the B-phase and the C-phase are both high and based on the output of the rising edge of the A-phase signal (FIG. 13 (g)). )reference). At this time, as shown in FIG. 13H, the U / D signal is at a high level, and the signal shown in FIG.
The signal (f) is output. Then, at the rising edge of the C-phase detection signal, the latch circuit 17
The counter 3 latches the count value “3” output to the data bus.

【0104】この場合、図13では、カウンタ14のカ
ウント値が変化するタイミングと信号及びC相検出信
号が出力されるタイミングとは等しいように図示されて
いるが、信号は、ANDゲート44及びDフリップフ
ロップ45を経た後出力される信号であるため、実際の
C相検出信号の出力タイミングにはゲート遅延が生じて
いる。従って、カウンタ14のカウント値が変化してラ
ッチ回路17に出力された後にC相検出信号が立上がる
ので、その時出力されているカウンタ3のカウント値
“3”がラッチされるようになっている。
In this case, FIG. 13 shows that the timing at which the count value of the counter 14 changes is equal to the timing at which the signal and the C-phase detection signal are output. Since the signal is output after passing through the flip-flop 45, a gate delay occurs in the output timing of the actual C-phase detection signal. Accordingly, since the C-phase detection signal rises after the count value of the counter 14 changes and is output to the latch circuit 17, the count value "3" of the counter 3 output at that time is latched. .

【0105】以上のように、U/D信号のレベルに応じ
てC相検出信号の出力タイミングを変化させるのは、正
転の場合と逆転の場合とでカウンタ14のカウント値が
等しくなるようにするためである。
As described above, the output timing of the C-phase detection signal is changed according to the level of the U / D signal so that the count value of the counter 14 is equal between the forward rotation and the reverse rotation. To do that.

【0106】また、C相信号は、前述のように、そのパ
ルス幅の略中心位相がA相信号の立下がりエッジに位置
するように調整されている。そこから、C相信号の出力
タイミングが変化した場合でも、図13と同様に、カウ
ント値“3”を検出するためには、少なくともA相信号
の立下がりエッジに基づくC相検出信号が出力されてい
る間にC相信号が有意(ハイレベル)となれば良い。従
って、中心位相のずれの許容範囲は、略±T/2とな
る。
As described above, the C-phase signal is adjusted so that the substantially center phase of the pulse width is located at the falling edge of the A-phase signal. From there, even when the output timing of the C-phase signal changes, in order to detect the count value “3”, a C-phase detection signal based on at least the falling edge of the A-phase signal is output as in FIG. It is sufficient that the C-phase signal becomes significant (high level) during the operation. Therefore, the allowable range of the center phase shift is approximately ± T / 2.

【0107】以上のように第2実施例によれば、原点/
C相検出回路34を、C相信号が出力された期間におけ
るB相の信号レベルと、A相の信号エッジの出力タイミ
ングとに基づいてC相検出信号を出力するように構成し
た。
As described above, according to the second embodiment, the origin /
The C-phase detection circuit 34 is configured to output the C-phase detection signal based on the B-phase signal level during the period in which the C-phase signal is output and the output timing of the A-phase signal edge.

【0108】従って、C相信号は、サーボモータ11の
変位位置に対応するA相またはB相の信号エッジが出力
される時に有意であれば良く、エンコーダ12における
C相信号の出力条件をより緩和することができ、エンコ
ーダ12の作り込みが容易となる。そして、経時変化に
よるA,B相及びC相信号の出力特性の変化や変位体が
変位することによる機械的な振動による信号出力の変動
についても、より大きな許容範囲を持たせることが可能
となる。
Therefore, the C-phase signal only needs to be significant when the A-phase or B-phase signal edge corresponding to the displacement position of the servomotor 11 is output, and the output condition of the C-phase signal in the encoder 12 is further relaxed. And the encoder 12 can be easily manufactured. Further, it is possible to provide a larger tolerance for a change in output characteristics of the A, B, and C phase signals due to a change with time and a change in signal output due to mechanical vibration caused by displacement of the displacement body. .

【0109】図14乃至図16は本発明の第3実施例を
示すものであり、第1実施例と同一部分には同一符号を
付して説明を省略し、以下異なる部分についてのみ説明
する。図14は、第1実施例のカウンタ回路8に代わる
カウンタ回路8bの構成を示す機能ブロック図である。
カウンタ回路8bの構成は、第1実施例における原点/
C相検出回路19が原点/C相検出回路(C相検出手
段,原点検出手段)46に置き換わったものである。
FIGS. 14 to 16 show a third embodiment of the present invention. The same parts as those in the first embodiment are denoted by the same reference numerals, and description thereof will be omitted. Only different parts will be described below. FIG. 14 is a functional block diagram showing a configuration of a counter circuit 8b replacing the counter circuit 8 of the first embodiment.
The configuration of the counter circuit 8b is the same as that of the first embodiment.
The C-phase detection circuit 19 is replaced with an origin / C-phase detection circuit (C-phase detection means, origin detection means) 46.

【0110】また、エンコーダ12aはエンコーダ12
bに置き換わっている。そして、原点/C相検出回路4
6に外部から与えられている信号は、エンコーダ12b
からのC相信号のみである。エンコーダ12bが出力す
る特定C相信号以外のC相信号は、そのパルス幅がA相
信号及びB相信号の周期の1/4未満となるように設定
されており、A相信号とB相信号との最も近いエッジの
間(最小エッジ間隔)に位置するようになっている(図
16(a)〜(c)参照)。
Further, the encoder 12a is
has been replaced by b. Then, the origin / C phase detection circuit 4
6 is supplied to the encoder 12b
Is only the C-phase signal. The C-phase signal other than the specific C-phase signal output from the encoder 12b is set so that the pulse width is less than 1/4 of the period of the A-phase signal and the B-phase signal. (The minimum edge interval) (see FIGS. 16A to 16C).

【0111】原点/C相検出回路46における原点検出
手段の構成は、第1実施例の原点検出手段19aと同様
の構成である。そして、図14は、原点/C相検出回路
46のC相信号検出手段46bのみを示すものであり、
C相信号検出手段46bは、D入力端子がプルアップさ
れ、C相信号がクロック入力端子に与えられるDフリッ
プフロップ47のみで構成されている。
The construction of the origin detecting means in the origin / C phase detecting circuit 46 is the same as that of the origin detecting means 19a of the first embodiment. FIG. 14 shows only the C-phase signal detecting means 46b of the origin / C-phase detecting circuit 46.
The C-phase signal detecting means 46b includes only a D flip-flop 47 whose D input terminal is pulled up and whose C-phase signal is supplied to a clock input terminal.

【0112】以上のように構成された第3実施例によれ
ば、図16(e)に示すように、原点/C相検出回路4
6は、サーボモータ11の正転時,逆転時の何れの場合
もC相信号の立上がりエッジでトリガされてC相検出信
号を出力するが、エンコーダ12bのC相信号がA相信
号とB相信号との最小エッジ間隔内に位置することで、
ラッチ回路17が変位位置データをラッチするタイミン
グとしては、何れの場合も“3”となる。従って、構成
を極めて簡単にすることができる。
According to the third embodiment configured as described above, as shown in FIG.
6 outputs a C-phase detection signal triggered by the rising edge of the C-phase signal in both cases of the forward rotation and the reverse rotation of the servo motor 11, but the C-phase signal of the encoder 12b is changed to the A-phase signal and the B-phase signal. By being located within the minimum edge interval with the signal,
The timing at which the latch circuit 17 latches the displacement position data is “3” in each case. Therefore, the configuration can be extremely simplified.

【0113】本発明は上記し且つ図面に記載した実施例
にのみ限定されるものではなく、次のような変形または
拡張が可能である。第1実施例において、図2に示すス
テップB9で行う所定の補正動作は、カウンタ値を補正
するものに限ることなく、単発ずれ量(C)に応じてC
PU1がサーボドライバに補正指令を与えることによ
り、サーボモータ11側を変位させても良い。また、第
1実施例において、単発ずれ量(C)を累積して判定せ
ずに、単発ずれ量(C)についてのみ、ずれ量許容値を
超えるか否かによって異常判定を行っも良い。表示装置
6による各種の表示は、夫々必要に応じて行えば良い。
The present invention is not limited to the embodiments described above and shown in the drawings, and the following modifications or extensions are possible. In the first embodiment, the predetermined correction operation performed in step B9 shown in FIG. 2 is not limited to the one that corrects the counter value.
The PU 1 may displace the servo motor 11 by giving a correction command to the servo driver. Further, in the first embodiment, the abnormality determination may be performed only for the single-shot deviation amount (C) based on whether or not the deviation amount allowable value is exceeded, without accumulating and determining the single-shot deviation amount (C). Various displays by the display device 6 may be performed as needed.

【0114】ステップB5及びB8における異常判定処
理も夫々必要に応じて行えば良い。第2実施例におい
て、C相信号のパルス幅(ここで、Wとする)は、A相
及びB相信号の周期Tに必ずしも等しくする必要はな
く、T/8<W≦Tの範囲で適宜変更して良い。また、
C相信号の中心位相とエッジ検出信号の出力タイミング
とは必ずしも略一致させる必要はなく、実際の各個別の
装置におけるずれや変動の特性に応じて適宜変更すれば
良い。また、第2実施例において、基準点の選択に応じ
て、C相信号が出力されている期間において、B相信号
がロウレベルでありA相信号のエッジ(正転の場合は立
上がりエッジ)の入力タイミングに基づいて原点検出信
号が出力されるように構成しても良い。また、A相信号
とB相信号とを入れ替えて、A相信号のレベルとB相信
号のエッジとに基づいて、C相検出信号を出力するよう
に構成しても良い。
The abnormality determination processing in steps B5 and B8 may be performed as needed. In the second embodiment, the pulse width (here, W) of the C-phase signal does not necessarily have to be equal to the period T of the A-phase and B-phase signals, and is appropriately set in a range of T / 8 <W ≦ T. You can change it. Also,
It is not always necessary that the center phase of the C-phase signal and the output timing of the edge detection signal substantially coincide with each other, and may be changed as appropriate in accordance with the actual characteristics of deviation and fluctuation in each individual device. In the second embodiment, the B-phase signal is at the low level and the edge of the A-phase signal (the rising edge in the case of normal rotation) is input during the period in which the C-phase signal is output according to the selection of the reference point. The origin detection signal may be output based on the timing. Alternatively, the A-phase signal and the B-phase signal may be exchanged, and the C-phase detection signal may be output based on the level of the A-phase signal and the edge of the B-phase signal.

【0115】サーボモータ11の変位方向に応じてエッ
ジ検出信号の出力タイミングを遅延させるものに代え
て、以下のように構成することも可能である。カウンタ
14が出力するU/D信号を原点検出回路19に与える
代わりにラッチ回路17に与えそのラッチ回路17に
は、ラッチしたデータをデクリメントすることができる
減算器を備える。そして、U/D信号がロウレベル、即
ちサーボモータ11が逆転している場合には、ラッチ回
路5は、ラッチしたデータをデクリメントしてCPU1
に出力するように構成する。斯様に構成した場合でも、
サーボモータ11の回転方向が変化したことにより生じ
るC相検出位置のずれを補正することができる。また、
カウンタ14を、アップカウント動作時には、A相及び
B相信号の入力状態が変化してからクロック信号CLK
の1クロック後にカウントアップさせ、ダウンカウント
動作時には、A相及びB相信号の入力状態が変化してか
ら2クロック後にカウントダウンさせるように構成して
も良い。即ち、アップカウント動作時に対して、ダウン
カウント動作時のカウントタイミングを1クロック分遅
延させるようにする。
Instead of delaying the output timing of the edge detection signal in accordance with the direction of displacement of the servomotor 11, the following configuration is also possible. Instead of supplying the U / D signal output from the counter 14 to the origin detection circuit 19, the latch circuit 17 is provided with a subtractor capable of decrementing the latched data. When the U / D signal is at the low level, that is, when the servo motor 11 is rotating in the reverse direction, the latch circuit 5 decrements the latched data and outputs
Output to Even with such a configuration,
The displacement of the C-phase detection position caused by the change in the rotation direction of the servo motor 11 can be corrected. Also,
At the time of the up-counting operation, the counter 14 starts the clock signal CLK after the input state of the A-phase signal and the B-phase signal changes.
It may be configured to count up one clock after the above, and to count down two clocks after the input state of the A-phase signal and the B-phase signal changes during the down-counting operation. That is, the count timing in the down-count operation is delayed by one clock with respect to the up-count operation.

【0116】位置ずれ量検出手段は、必ずしも全てのC
相信号の出力タイミングに基づいてずれ量を検出する必
要はなく、C相信号が複数回出力される毎に1回検出を
行うようにしても良い。また、特定C相信号を除いたC
相信号の出力タイミングに基づいてずれ量を検出しても
良い。例えば、原点/C相検出回路19にマルチプレク
サを設けて、ラッチ回路17に対して特定C相信号とそ
の他のC相信号とを選択的に出力可能に構成し、原点復
帰処理では原点信号検出モードとして特定C相信号のみ
でデータラッチを行い、ずれ量検出処理ではC相信号検
出モードとしてその他のC相信号でデータラッチを行う
ようにしても良い。
The displacement detecting means does not necessarily have to detect all C
It is not necessary to detect the shift amount based on the output timing of the phase signal, and the detection may be performed once every time the C-phase signal is output a plurality of times. In addition, C excluding the specific C-phase signal
The shift amount may be detected based on the output timing of the phase signal. For example, a multiplexer is provided in the origin / C phase detection circuit 19 so that a specific C phase signal and other C phase signals can be selectively output to the latch circuit 17. The data latch may be performed only with the specific C-phase signal, and the data latch may be performed with the other C-phase signals in the C-phase signal detection mode in the shift amount detection processing.

【0117】C相信号の出力間隔は、必ずしも全て等し
くなるように設定する必要はない。その場合、位置ずれ
量検出手段は、特定C相信号を基準として、各C相信号
の出力間隔が位置データ出力手段のカウント値で幾つと
なっているかを夫々記憶しておき、その記憶した値に基
づいてずれ量を検出すれば良い。特定C相信号は、必要
に応じて設ければ良い。例えば、工作機械の主軸などダ
イレクトドライブするものであって、原点として定める
位置が0〜180度,180〜360度の何れの側でも
良いものについては、C相信号の位相を180度ずらし
て同じパルス幅としても(即ち、1回転周期において2
パルスだけ出力するようにして)ずれ量の検出頻度を上
げることができ、この場合、原点検出手段は省略するこ
とができる。
The output intervals of the C-phase signals need not always be set to be equal. In this case, the positional deviation amount detecting means stores, based on the specific C-phase signal, how many output intervals of each C-phase signal are counted by the position data output means, and stores the stored value. The shift amount may be detected based on the following. The specific C-phase signal may be provided as needed. For example, for a direct drive such as a main spindle of a machine tool, and the position determined as the origin may be on any side of 0 to 180 degrees or 180 to 360 degrees, the phase of the C-phase signal is shifted by 180 degrees and the same. The pulse width (ie, 2 in one rotation cycle)
The frequency of detection of the deviation amount can be increased (by outputting only the pulse), and in this case, the origin detection means can be omitted.

【0118】ずれ量の検出を、CPU1のソフトウエア
で行うものに代えて、以下のようにハードウエアを構成
して行っても良い。例えば、C相信号が検出される毎に
クリアされ、その間に出力されるパルス数をカウントす
るカウンタを用いて、C相信号を検出する毎にそのカウ
ント値を(クリアされる前に)ラッチするようにする。
そして、そのラッチデータとC相信号の正規の出力間隔
に一致するパルス数とをマグニチュードコンパレータに
より比較して、両者が不一致の場合、或いは、両者の差
が所定値以上の場合は異常と判定するようにする。エン
コーダは、ロータリエンコーダに限らず、リニアエンコ
ーダでも全く同様に適用が可能である。また、エンコー
ダは、光学式のものに限らず磁気式などでも良い。変位
体は、サーボモータ11に限ることなく、回転変位若し
くは直線変位するものであれば適用が可能である。
Instead of performing the detection of the amount of deviation by software of the CPU 1, it is also possible to configure hardware as follows. For example, the counter is cleared each time a C-phase signal is detected, and the counter value is latched (before being cleared) each time a C-phase signal is detected, using a counter that counts the number of pulses output during that time. To do.
Then, the latch data is compared with the number of pulses corresponding to the regular output interval of the C-phase signal by a magnitude comparator, and if they do not match, or if the difference between them is greater than or equal to a predetermined value, it is determined to be abnormal. To do. The encoder is not limited to a rotary encoder, and can be applied to a linear encoder in the same manner. The encoder is not limited to an optical encoder, but may be a magnetic encoder or the like. The displacement body is not limited to the servomotor 11, but may be applied as long as it can be rotated or linearly displaced.

【0119】[0119]

【発明の効果】本発明は以上説明した通りであるので、
以下の効果を奏する。請求項1記載のエンコーダ装置に
よれば、複数のC相信号の出力タイミングに基づいて、
例えばA相信号及びB相信号の出力タイミングが正常で
あるか否か、変位体の一変位周期よりも短い期間で、即
ち、従来よりも高い頻度で判定することができる。
Since the present invention is as described above,
The following effects are obtained. According to the encoder device of claim 1, based on the output timing of the plurality of C-phase signals,
For example, whether or not the output timing of the A-phase signal and the B-phase signal is normal can be determined in a period shorter than one displacement cycle of the displacement body, that is, more frequently than in the related art.

【0120】請求項2記載のエンコーダ装置によれば、
位置ずれ量検出手段は、変位体の一変位周期の間に複数
回C相信号が検出されるタイミングで、変位位置データ
出力手段がカウントする変位位置データのずれ量を検出
するので、そのずれ量の検出によって、A相信号及びB
相信号の出力タイミングに基づく変位位置データ出力手
段のカウント動作が正常に行われているか否かを、高い
頻度でチェックすることができる。
According to the encoder device of the second aspect,
The displacement amount detecting means detects the displacement amount of the displacement position data counted by the displacement position data output means at a timing when the C-phase signal is detected a plurality of times during one displacement cycle of the displacement body. A phase signal and B
It is possible to check at a high frequency whether or not the counting operation of the displacement position data output means based on the output timing of the phase signal is normally performed.

【0121】請求項3記載のエンコーダ装置によれば、
複数回出力されるC相信号の内の一つである特定C相信
号の出力期間を、その他のC相信号の出力期間と異なる
ようにするので、C相信号の出力期間を判別すること
で、特定C相信号を例えば基準点として検出することが
できる。
According to the encoder device of the third aspect,
Since the output period of the specific C-phase signal, which is one of the C-phase signals output a plurality of times, is made different from the output periods of the other C-phase signals, the output period of the C-phase signal is determined. , The specific C-phase signal can be detected, for example, as a reference point.

【0122】請求項4記載のエンコーダ装置によれば、
原点検出手段は、特定C相信号の出力タイミングに基づ
いて変位体の原点を容易且つ確実に定めることができ
る。
According to the encoder device of the fourth aspect,
The origin detection means can easily and reliably determine the origin of the displacement body based on the output timing of the specific C-phase signal.

【0123】請求項5記載のエンコーダ装置によれば、
位置ずれ量検出手段は、C相信号検出手段によって出力
されるC相検出信号の全ての出力タイミングに基づいて
ずれ量を検出するので、変位位置データのずれ量検出の
頻度を最大にすることができる。
According to the encoder device of the fifth aspect,
Since the displacement amount detecting means detects the displacement amount based on all output timings of the C-phase detection signal output by the C-phase signal detecting means, it is possible to maximize the frequency of the displacement amount detection of the displacement position data. it can.

【0124】請求項6記載のエンコーダ装置によれば、
位置ずれ量検出手段は、C相信号検出手段によって検出
される、特定C相信号以外のC相信号に対応するC相検
出信号の出力タイミングのみに基づいてずれ量を検出す
るので、請求項4と略同様の効果が得られる。
According to the encoder device of the sixth aspect,
The position shift amount detecting means detects the shift amount based only on the output timing of the C-phase detection signal corresponding to the C-phase signal other than the specific C-phase signal detected by the C-phase signal detecting means. The same effect can be obtained.

【0125】請求項7記載のエンコーダ装置によれば、
複数回出力されるC相信号の少なくとも片側のエッジ出
力間隔を全て等しくなるように設定するので、例えば、
C相信号検出手段がC相信号の検出を出力間隔が等しい
側のエッジに基づいて行うことで、そのC相信号が検出
される間隔内におけるA相及びB相信号の出力数は全て
等しくなり、ずれ量検出手段は、C相信号の何れの検出
タイミングにおいてもその等しい出力数に基づいて変位
位置データのずれ量検出を容易に行うことができる。
According to the encoder device of the seventh aspect,
Since at least one edge output interval of at least one side of the C-phase signal output a plurality of times is set to be equal, for example,
Since the C-phase signal detecting means detects the C-phase signal based on the edge on the side where the output interval is equal, the output numbers of the A-phase and B-phase signals in the interval where the C-phase signal is detected become equal. The shift amount detecting means can easily detect the shift amount of the displacement position data based on the equal output number at any detection timing of the C-phase signal.

【0126】請求項8記載のエンコーダ装置によれば、
例えば、エンコーダのスリットにゴミなどが付着するこ
とによって、A相信号若しくはB相信号の1パルス抜け
が原点位置の検出毎に生じる場合でも、その1パルス抜
けによるずれ量は、位置ずれ量累積手段によって累積さ
れることで確実に検出することができる。
According to the encoder device of the eighth aspect,
For example, even if one pulse missing of the A-phase signal or the B-phase signal occurs every time the origin position is detected due to the attachment of dust or the like to the slit of the encoder, the displacement amount due to the one pulse missing is calculated by the positional displacement amount accumulating means. , It is possible to reliably detect it.

【0127】請求項9記載のエンコーダ装置によれば、
異常判定手段は、位置ずれ量累積手段により累積された
ずれ量が予め設定された累積ずれ量許容値を超えた場合
に異常と判定するので、僅かなずれ量が毎回確実に生じ
るような状態でも、確実に異常判定を行うことができ
る。
According to the encoder device of the ninth aspect,
The abnormality determining means determines that the abnormality is abnormal when the deviation amount accumulated by the positional deviation amount accumulating means exceeds a preset accumulated deviation amount allowable value. Therefore, even in a state where a slight deviation amount surely occurs every time. Thus, the abnormality determination can be reliably performed.

【0128】請求項10記載のエンコーダ装置によれ
ば、表示手段は、位置ずれ量累積手段により累積された
ずれ量を表示するので、累積されたずれ量の表示を参照
することによって、変位体が動作している環境のノイズ
発生頻度を視覚的に把握することができる。
According to the encoder device of the tenth aspect, the display means displays the displacement amount accumulated by the positional displacement amount accumulating means. Therefore, by referring to the display of the accumulated displacement amount, the displacement body can be displayed. The noise occurrence frequency of the operating environment can be visually grasped.

【0129】請求項11記載のエンコーダ装置によれ
ば、位置補正手段は、位置ずれ量検出手段により検出さ
れた位置データ出力手段の位置データずれ量が予め設定
された補正許容値以下である場合は、ずれ量に基づいて
所定の補正動作を行うので、補正許容値以下のずれ量に
基づいて例えば変位体の位置データを補正することによ
って、変位体の正確な変位位置を得ることができる。
According to the encoder device of the eleventh aspect, the position correcting means is provided when the position data shift amount of the position data output means detected by the position shift amount detecting means is equal to or less than a preset allowable correction value. Since the predetermined correction operation is performed based on the amount of displacement, an accurate displacement position of the displacement body can be obtained by correcting, for example, the position data of the displacement body based on the amount of displacement equal to or less than the correction allowable value.

【0130】請求項12記載のエンコーダ装置によれ
ば、連続補正異常判定手段は、位置ずれ量検出手段によ
り検出されたずれ量が、連続して補正許容値以下となっ
た回数をカウントして、カウント値が所定値を超えた場
合に異常と判定するので、補正許容値以下のずれ量が連
続して発生する場合をも異常として判定することができ
る。
According to the encoder device of the twelfth aspect, the continuous correction abnormality judging means counts the number of times that the amount of deviation detected by the positional deviation amount detecting means has continuously become equal to or less than the allowable correction value. Since the abnormality is determined when the count value exceeds the predetermined value, it is possible to determine the abnormality even when the deviation amount equal to or less than the correction allowable value continuously occurs.

【0131】請求項13記載のエンコーダ装置によれ
ば、補正回数表示手段は、位置補正手段によって補正が
行われた回数を表示するので、請求項10または13と
同様に、変位体が動作している環境の比較的低レベルの
ノイズ発生頻度を視覚的に把握することができる。
According to the encoder device of the thirteenth aspect, the number-of-corrections display means displays the number of times the correction has been performed by the position correction means. It is possible to visually grasp the relatively low-level noise occurrence frequency of the environment in which it is located.

【0132】請求項14記載のエンコーダ装置によれ
ば、C相信号は、原点とすべき変位体の変位位置におい
て、その変位位置に対応するA相またはB相の信号エッ
ジが出力される時に有意であれば良く、C相信号の出力
条件をより緩和することができエンコーダの作り込みが
容易となる。そして、経時変化によるA,B相及びC相
信号の出力特性の変化や、変位体が変位することによる
機械的な振動による信号出力の変動についても、より大
きな許容範囲を持たせることが可能となる。
According to the encoder device of the fourteenth aspect, the C-phase signal is significant when the A- or B-phase signal edge corresponding to the displacement position of the displacement body to be the origin is output. The output condition of the C-phase signal can be further relaxed and the encoder can be easily manufactured. Further, it is possible to provide a larger tolerance with respect to a change in output characteristics of the A, B, and C phase signals due to a change with time and a change in signal output due to mechanical vibration due to displacement of the displacement body. Become.

【0133】請求項15記載のエンコーダ装置によれ
ば、C相信号検出手段は、位置データ出力手段がアップ
カウントを行っている期間のC相信号の一方のエッジ及
び位置データ出力手段がダウンカウントを行っている期
間のC相信号の他方のエッジに基づいてC相検出信号を
出力するので、変位体の変位方向にかかわらず常にC相
信号の同一エッジの出力タイミングに基づいて検出が行
われる。
According to the encoder device of the fifteenth aspect, the C-phase signal detection means includes one edge of the C-phase signal during the period in which the position data output means is counting up, and the position data output means counts down. Since the C-phase detection signal is output based on the other edge of the C-phase signal during the operation, the detection is always performed based on the output timing of the same edge of the C-phase signal regardless of the displacement direction of the displacement body.

【0134】請求項16記載のエンコーダ装置によれ
ば、C相信号を、A相信号及びB相信号間の最短エッジ
出力間隔内に位置するように設定し、C相信号検出手段
は、C相信号のみに基づいてC相検出信号を出力するの
で、変位体の変位方向を示す信号などを参照する必要が
なく、構成を極めて簡単にすることができる。
According to the encoder device of the sixteenth aspect, the C-phase signal is set to be located within the shortest edge output interval between the A-phase signal and the B-phase signal, and the C-phase signal detection means Since the C-phase detection signal is output based only on the signal, there is no need to refer to a signal indicating the displacement direction of the displacement body, and the configuration can be extremely simplified.

【図面の簡単な説明】[Brief description of the drawings]

【図1】CPUの制御内容を示すフローチャートFIG. 1 is a flowchart showing control contents of a CPU.

【図2】ずれ判定処理の制御内容を示すフローチャートFIG. 2 is a flowchart showing control contents of a shift determination process.

【図3】原点復帰処理の制御内容を示すフローチャートFIG. 3 is a flowchart showing control contents of an origin return process.

【図4】全体構成を示す機能ブロック図FIG. 4 is a functional block diagram showing an overall configuration.

【図5】カウンタ回路の詳細な構成を示す機能ブロック
FIG. 5 is a functional block diagram showing a detailed configuration of a counter circuit.

【図6】原点/C相検出回路の詳細な電気的構成を示す
FIG. 6 is a diagram showing a detailed electrical configuration of an origin / C phase detection circuit.

【図7】原点/C相検出回路の各部におけるタイミング
チャート
FIG. 7 is a timing chart of each part of the origin / C phase detection circuit.

【図8】非検出側のC相信号エッジが出力された直後に
サーボモータが反転し、UP/DOWN信号のレベルが
切り替わる前に検出側のC相信号エッジが出力された場
合を説明するタイミングチャート
FIG. 8 is a timing chart for explaining a case where the servomotor is inverted immediately after the non-detection-side C-phase signal edge is output and the detection-side C-phase signal edge is output before the level of the UP / DOWN signal is switched; chart

【図9】アップダウンカウンタのカウンタ値と原点検出
信号との出力タイミングを示すタイミングチャート
FIG. 9 is a timing chart showing output timings of a counter value of an up / down counter and an origin detection signal.

【図10】本発明の第2実施例を示す図5相当図FIG. 10 is a view corresponding to FIG. 5, showing a second embodiment of the present invention.

【図11】図6相当図FIG. 11 is a diagram corresponding to FIG. 6;

【図12】図7相当図FIG. 12 is a diagram corresponding to FIG. 7;

【図13】図9相当図FIG. 13 is a diagram corresponding to FIG. 9;

【図14】本発明の第3実施例を示す図5相当図FIG. 14 is a view corresponding to FIG. 5, showing a third embodiment of the present invention.

【図15】図6相当図FIG. 15 is a diagram corresponding to FIG. 6;

【図16】図7相当図FIG. 16 is a diagram corresponding to FIG. 7;

【符号の説明】[Explanation of symbols]

1はCPU(位置ずれ量検出手段,位置ずれ量累積手
段,異常判定手段,位置補正手段,連続補正異常判定手
段)、6は表示装置(表示手段,補正回数表示手段)、
11はサーボモータ(変位体)、12,12a及び12
bはエンコーダ、14はアップダウンカウンタ(位置デ
ータ出力手段)、17はカウンタデータラッチ回路(位
置検出手段)、19,34及び46は原点/C相検出回
路(C相信号検出手段,原点検出手段)を示す。
1 is a CPU (position shift amount detecting means, position shift amount accumulating means, abnormality determining means, position correcting means, continuous correction abnormality determining means), 6 is a display device (display means, correction number displaying means),
11 is a servo motor (displacement body), 12, 12a and 12
b is an encoder, 14 is an up / down counter (position data output means), 17 is a counter data latch circuit (position detection means), 19, 34 and 46 are origin / C phase detection circuits (C phase signal detection means, origin detection means) ).

Claims (16)

【特許請求の範囲】[Claims] 【請求項1】 変位体の直線変位若しくは回転変位に伴
って、互いに90度位相の異なるパルス信号をA相信号
及びB相信号として出力すると共に、前記変位体の変位
位置が基準点に達するとC相信号を出力するエンコーダ
装置において、 前記C相信号を、変位体の一変位周期の間に複数回出力
することを特徴とするエンコーダ装置。
When a displacement signal of a displacement body reaches a reference point, pulse signals having phases different from each other by 90 degrees are output as an A-phase signal and a B-phase signal according to a linear displacement or a rotational displacement of the displacement body. An encoder device for outputting a C-phase signal, wherein the C-phase signal is output a plurality of times during one displacement cycle of the displacement body.
【請求項2】 前記A相及びB相信号をカウントするこ
とにより前記変位体の変位位置データを出力する位置デ
ータ出力手段と、 前記C相信号の出力タイミングを検出してC相検出信号
を出力するC相信号検出手段と、 このC相信号検出手段により前記C相検出信号が出力さ
れるタイミングにおいて前記位置データ出力手段により
出力される前記変位位置データの変化量に基づいて、前
記位置データ出力手段がカウントする変位位置データの
ずれ量を検出する位置ずれ量検出手段とを備えたことを
特徴とする請求項1記載のエンコーダ装置。
2. A position data output means for outputting displacement position data of the displacement body by counting the A-phase and B-phase signals, and outputting a C-phase detection signal by detecting an output timing of the C-phase signal. C-phase signal detecting means, and outputting the position data based on a change amount of the displacement position data output by the position data output means at a timing at which the C-phase detection signal is output by the C-phase signal detecting means. 2. The encoder device according to claim 1, further comprising: a position shift amount detecting unit that detects a shift amount of the displacement position data counted by the unit.
【請求項3】 前記複数回出力されるC相信号の内の一
つである特定C相信号の出力期間は、その他のC相信号
の出力期間と異なっていることを特徴とする請求項1ま
たは2記載のエンコーダ装置。
3. The output period of a specific C-phase signal, which is one of the C-phase signals output a plurality of times, is different from the output periods of other C-phase signals. Or the encoder device according to 2.
【請求項4】 前記C相信号検出手段は、前記特定C相
信号の出力タイミングに基づいて前記変位体の原点を検
出する原点検出手段を備えていることを特徴とする請求
項3記載のエンコーダ装置。
4. The encoder according to claim 3, wherein said C-phase signal detecting means includes origin detecting means for detecting an origin of said displacement body based on an output timing of said specific C-phase signal. apparatus.
【請求項5】 前記位置ずれ量検出手段は、前記C相信
号検出手段によって出力されるC相検出信号の全ての出
力タイミングに基づいて前記ずれ量を検出することを特
徴とする請求項2乃至4の何れかに記載のエンコーダ装
置。
5. The apparatus according to claim 2, wherein the displacement detecting means detects the displacement based on all output timings of the C-phase detection signal output by the C-phase signal detecting means. 5. The encoder device according to any one of 4.
【請求項6】 前記位置ずれ量検出手段は、前記C相信
号検出手段によって検出される、前記特定C相信号以外
のC相信号に対応するC相検出信号の出力タイミングの
みに基づいて前記ずれ量を検出することを特徴とする請
求項4記載のエンコーダ装置。
6. The position shift amount detection means detects the shift based on only an output timing of a C-phase detection signal detected by the C-phase signal detection means and corresponding to a C-phase signal other than the specific C-phase signal. The encoder device according to claim 4, wherein the amount is detected.
【請求項7】 前記複数回出力されるC相信号の少なく
とも片側のエッジ出力間隔が、全て等しくなるように設
定されていることを特徴とする請求項1乃至6の何れか
に記載のエンコーダ装置。
7. The encoder device according to claim 1, wherein at least one edge output interval of at least one side of the C-phase signal output a plurality of times is set to be equal. .
【請求項8】 前記位置ずれ量検出手段により検出され
る前記ずれ量を累積する位置ずれ量累積手段を備えたこ
とを特徴とする請求項2乃至7の何れかに記載のエンコ
ーダ装置。
8. The encoder device according to claim 2, further comprising a displacement amount accumulating unit that accumulates the displacement amount detected by the displacement amount detecting unit.
【請求項9】 前記位置ずれ量累積手段により累積され
たずれ量が、予め設定された累積ずれ量許容値を超えた
場合に異常と判定する異常判定手段を備えたことを特徴
とする請求項8記載のエンコーダ装置。
9. An abnormality judging means for judging an abnormality when the displacement amount accumulated by the displacement amount accumulating means exceeds a preset accumulated displacement amount allowable value. 9. The encoder device according to 8.
【請求項10】 前記位置ずれ量累積手段により累積さ
れたずれ量を表示する表示手段を備えたことを特徴とす
る請求項8または9記載のエンコーダ装置。
10. The encoder device according to claim 8, further comprising a display unit that displays a displacement amount accumulated by the displacement amount accumulation unit.
【請求項11】 前記位置ずれ量検出手段により検出さ
れた前記ずれ量が予め設定された補正許容値以下である
場合は、前記ずれ量に基づいて所定の補正動作を行う位
置補正手段を備えたことを特徴とする請求項8乃至10
の何れかに記載のエンコーダ装置。
11. When the displacement detected by the displacement detecting means is equal to or less than a preset allowable correction value, a position correcting means for performing a predetermined correction operation based on the displacement is provided. 11. The method according to claim 8, wherein:
The encoder device according to any one of the above.
【請求項12】 前記位置ずれ量検出手段により検出さ
れた前記ずれ量が、連続して前記補正許容値以下となっ
た回数をカウントして、前記カウント値が所定値を超え
た場合に異常と判定する連続補正異常判定手段を備えた
ことを特徴とする請求項11記載のエンコーダ装置。
12. Counting the number of times the amount of displacement detected by the displacement amount detecting means continuously becomes equal to or less than the correction allowable value, and when the count value exceeds a predetermined value, it is determined that an abnormality has occurred. The encoder device according to claim 11, further comprising a continuous correction abnormality determination unit for determining.
【請求項13】 前記位置補正手段によって補正が行わ
れた回数を表示する補正回数表示手段を備えたことを特
徴とする請求項11または12記載のエンコーダ装置。
13. The encoder device according to claim 11, further comprising a correction number display means for displaying the number of times correction has been performed by said position correction means.
【請求項14】 前記C相信号検出手段は、前記C相信
号が出力された期間における前記A相またはB相の一方
の信号レベルと、他方の信号エッジの出力タイミングと
に基づいて前記C相検出信号を出力することを特徴とす
る請求項8乃至13の何れかに記載のエンコーダ装置。
14. The C-phase signal detecting means, based on one signal level of the A-phase or the B-phase during a period in which the C-phase signal is output, and the output timing of the other signal edge. 14. The encoder device according to claim 8, wherein the encoder device outputs a detection signal.
【請求項15】 前記C相信号検出手段は、前記位置デ
ータ出力手段がアップカウントを行っている期間の前記
C相信号の一方のエッジ及び前記位置データ出力手段が
ダウンカウントを行っている期間の前記C相信号の他方
のエッジに基づいて前記C相検出信号を出力することを
特徴とする請求項8乃至13の何れかに記載のエンコー
ダ装置。
15. The C-phase signal detection means includes one edge of the C-phase signal during a period when the position data output means is counting up and a period during which the position data output means is counting down. 14. The encoder device according to claim 8, wherein the C-phase detection signal is output based on the other edge of the C-phase signal.
【請求項16】 前記C相信号は、その出力期間が前記
A相信号及びB相信号間の最短エッジ出力間隔よりも短
く設定されると共に、前記最短エッジ出力間隔内に位置
するように設定されており、 前記C相信号検出手段は、前記C相信号のみに基づいて
前記C相検出信号を出力をすることを特徴とする請求項
8乃至13の何れかに記載のエンコーダ装置。
16. The C-phase signal is set so that its output period is shorter than the shortest edge output interval between the A-phase signal and the B-phase signal, and is positioned within the shortest edge output interval. The encoder device according to any one of claims 8 to 13, wherein the C-phase signal detection unit outputs the C-phase detection signal based on only the C-phase signal.
JP7020498A 1998-03-19 1998-03-19 Encoder device Pending JPH11264741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7020498A JPH11264741A (en) 1998-03-19 1998-03-19 Encoder device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7020498A JPH11264741A (en) 1998-03-19 1998-03-19 Encoder device

Publications (1)

Publication Number Publication Date
JPH11264741A true JPH11264741A (en) 1999-09-28

Family

ID=13424769

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7020498A Pending JPH11264741A (en) 1998-03-19 1998-03-19 Encoder device

Country Status (1)

Country Link
JP (1) JPH11264741A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003315100A (en) * 2002-04-24 2003-11-06 Okuma Corp Rotation point detector

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003315100A (en) * 2002-04-24 2003-11-06 Okuma Corp Rotation point detector

Similar Documents

Publication Publication Date Title
US6496786B1 (en) Method and apparatus for measuring a frequency datum
KR100400609B1 (en) Position encoder
US20020186622A1 (en) Analog electronic clock
US10921767B2 (en) Encoder system
JP3423211B2 (en) Encoder misalignment detector
CN110806224B (en) Incremental encoder position correction system and method
JP6205219B2 (en) Pointer meter device
JPH11264741A (en) Encoder device
JP3173174B2 (en) Speed detector
US4440502A (en) Electronic timepiece
US20110249536A1 (en) Chronograph timepiece
EP0221648A1 (en) Electronic analog timepiece with DC magnetic field detector
JPH0787768A (en) Detection apparatus of electrical angle of variable-reluctance motor
JP3144877B2 (en) Backup type absolute position encoder
JPH1164040A (en) Device for detecting abnormality in encoder
JP4716463B2 (en) Multi-turn absolute encoder
JP3413053B2 (en) Encoder origin detection device
US20010019517A1 (en) Electronic timepiece
JPH065175B2 (en) Absolute type encoder
JP2002084791A (en) Stepping motor driving circuit
JP3067235B2 (en) Timing device
JPH11248488A (en) Method and device for processing signal of encoder
JP6205220B2 (en) Pointer meter device
JP2692976B2 (en) Synchronous counter
JPS6126491A (en) Commutatorless motor