JPH0336608A - Position detecting circuit - Google Patents
Position detecting circuitInfo
- Publication number
- JPH0336608A JPH0336608A JP16987089A JP16987089A JPH0336608A JP H0336608 A JPH0336608 A JP H0336608A JP 16987089 A JP16987089 A JP 16987089A JP 16987089 A JP16987089 A JP 16987089A JP H0336608 A JPH0336608 A JP H0336608A
- Authority
- JP
- Japan
- Prior art keywords
- phase
- value
- counter
- cycle counter
- circuit
- 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
Links
- 238000001514 detection method Methods 0.000 claims abstract description 28
- 230000007423 decrease Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 11
- 238000000034 method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Landscapes
- Control Of Position Or Direction (AREA)
Abstract
Description
【発明の詳細な説明】
[産業上の利用分野]
この発明は、例えば数値制御装置によって制御される工
作機械の位置を検出する位置検出回路に関し、特にノイ
ズ等が原因で発生する位置検出誤りの検知に関するもの
である。[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a position detection circuit that detects the position of a machine tool controlled by a numerical control device, for example, and particularly to a position detection circuit that detects position detection errors caused by noise or the like. It is about detection.
[従来の技術]
第3図は従来の位置検出回路におけるカウンタの部分を
示すブロック図、第4図は原点復帰の動作を説明するタ
イミング図、第5図は原点復帰の動作を説明する説明図
である。[Prior Art] Fig. 3 is a block diagram showing a counter portion in a conventional position detection circuit, Fig. 4 is a timing diagram illustrating the operation of returning to the origin, and Fig. 5 is an explanatory diagram explaining the operation of returning to the origin. It is.
図において、(()はフリーランカウンタで、図示しな
い位置センサとしてのインクリメンタル型エンコーダの
出力であるA相信号及びB相信号を位相判別して得られ
る正転パルスでアップし、逆転パルスでダウンするカウ
ンタである。(2)はフリーランカウンタ(1)のデー
タをラッチするデータラッチFである。(3〉はサイク
ルカウンタで、上述した正転パルスでアップし、逆転パ
ルスでダウンするカウンタである。(4)はサイクルカ
ウンタ(3)のデータをラッチするデータラッチSであ
る。(5)はA相信号、(6)はB相信号、(7)はZ
相信号、(8)はラッチ信号である。In the figure, (() is a free-run counter, which increases with forward rotation pulses obtained by phase discrimination of the A-phase signal and B-phase signal, which are outputs of an incremental encoder as a position sensor (not shown), and decreases with reverse rotation pulses. (2) is a data latch F that latches the data of the free run counter (1). (3) is a cycle counter, which is a counter that increases with the forward rotation pulse and decreases with the reverse rotation pulse as described above. (4) is the data latch S that latches the data of the cycle counter (3). (5) is the A-phase signal, (6) is the B-phase signal, and (7) is the Z-phase signal.
The phase signal (8) is a latch signal.
なお、第3図は簡略化して示したため、上述の位相判別
を行なう回路は図示を省略しである。Note that since FIG. 3 is shown in a simplified manner, the circuit for performing the above-mentioned phase discrimination is not shown.
第4図において、(9〉は電源オン(ON)のタイミン
グを示している。αは電源オンから最初のZ相までの距
離、RNGはZ相から2相までの距離で、1回転Nパル
スのエンコーダであればNに相当する。In Fig. 4, (9> indicates the timing of turning on the power. α is the distance from turning on the power to the first Z phase, RNG is the distance from the Z phase to the second phase, and N pulses per rotation. This corresponds to N if the encoder is N.
第5図において、■は機械を駆動するモータの速度、(
]1)はドグの動作範囲、(12)はドグオン(ON〉
のタイミング、(13)はドグオフ(OFF)のタイミ
ングを示している。In Figure 5, ■ is the speed of the motor that drives the machine, (
]1) is the dog's operating range, (12) is the dog's ON (ON)
(13) indicates the dog-off (OFF) timing.
ところで、数値制御(NC)工作機械においては、機械
の位置を基準として座標系を組む必要があるため、電源
オン(ON)時に必ず原点復帰動作を行ない機械の特定
の位置に軸を移動し、座標系をプリセットする必要があ
る。By the way, in numerically controlled (NC) machine tools, it is necessary to set up a coordinate system based on the machine position, so when the power is turned on, the origin return operation is always performed to move the axis to a specific position on the machine. It is necessary to preset the coordinate system.
この原点復帰動作を行なうためには、エンコーダの1回
転パルス(Z相)が使われ、機械の特定位置としては機
械にドグとよばれる検出手段(マイクロスイッチ等)が
設けられ、第5図に示すようにドグを通過した時に減速
を開始し、ある一定の速度に減速した後、ドグをはなれ
た最初のZ相を機械原点Pとして停止する。この方法に
より機械原点を求め、座標系のプリセットを行なう。In order to perform this return-to-origin operation, a one-rotation pulse (Z phase) of the encoder is used, and a detection means called a dog (micro switch, etc.) is installed on the machine to determine the specific position of the machine. As shown, the machine starts decelerating when it passes the dog, and after decelerating to a certain speed, it stops at the first Z phase that leaves the dog as the mechanical origin P. Using this method, the mechanical origin is determined and the coordinate system is preset.
次に動作について説明する。Next, the operation will be explained.
第4図に示すように、電源オン時にイニシャライズ処理
によって、フリーランカウンタ(1)の初期化が行なわ
れ、その時点から゛フリーランカウンタ(1)は動作を
開始する。また、サイクルカウンタ(3)は初期化時に
、通常サイクルカウンタ〈3)ではカウントしない特定
の値、即ちNパルスのエンコーダではサイクルカウンタ
(3〉はOからNに変化し続けるのでO−Nまでの値以
上の値をv′J期値としてセットしておく。そして、Z
相が通過するのを待っている。最初のZ相が通過したと
きにサイクルカウンタ(3)は、リセットされ、かっA
相及びB相をカウントし始め、Z相がくるたびにリセッ
トされる。As shown in FIG. 4, the free run counter (1) is initialized by initialization processing when the power is turned on, and from that point on, the free run counter (1) starts operating. In addition, when the cycle counter (3) is initialized, the cycle counter (3) is set to a specific value that is not normally counted by the cycle counter (3). In other words, in the case of an N pulse encoder, the cycle counter (3) keeps changing from O to N, so the cycle counter (3) continues to change from O to N. A value greater than or equal to the value is set as the v′J period value.Then, Z
Waiting for the phase to pass. The cycle counter (3) is reset when the first Z phase passes and
It starts counting the phase and B phase, and is reset every time the Z phase comes.
ここで、サイクルカウンタ(3)の値を検出して、初期
値であれば、Z相は通過していないためカウンタはラッ
チしない。初期値以外(0〜N)であれば、Z相を通過
したと判断して、フリーランカウンタ(1)とサイクル
カウンタ(3)をラッチ信号(81)により同時にラッ
チする。データラッチ(2)のラッチデータAとデータ
ラッチ(4)のラッチデータBとの差(A−B)を演算
することにより、電源オンから最初のZ相までの距離α
が検出される。このαが検出できることにより、フリー
ランカウンタ(1)の値のどの位置に2相がくるかが前
もって検出でき、その中でどのZ相が機械原点かは前記
機械ドグで判断する。Here, the value of the cycle counter (3) is detected, and if it is the initial value, the counter does not latch because the Z phase has not passed. If the value is other than the initial value (0 to N), it is determined that the Z phase has passed, and the free run counter (1) and cycle counter (3) are latched simultaneously by the latch signal (81). By calculating the difference (A-B) between latch data A of data latch (2) and latch data B of data latch (4), distance α from power-on to the first Z phase can be calculated.
is detected. By being able to detect this α, it is possible to detect in advance at which position of the value of the free run counter (1) the two phases are located, and which Z phase among them is the machine origin is determined by the mechanical dog.
また、フリーランカウンタ(1)の値のどの位置にZ相
がくるかが前もって検出できることにより絶対位置が検
出できる。Further, since it is possible to detect in advance at which position of the value of the free run counter (1) the Z phase will be, the absolute position can be detected.
[9!明が解決しようとする3題コ
上記のような従来の位置検出回路では、もしもエンコー
ダにノイズ等が乗り、パルスのカウントを誤ったときに
は、誤った分だけ位置ずれが起き、この位置ずれを検出
することはできないという問題点があった。[9! Three problems that Akira is trying to solve: In the conventional position detection circuit as described above, if the encoder is affected by noise and the pulse count is incorrect, a position shift occurs by the amount of error, and this position shift is detected. The problem was that it could not be done.
この発明は、かかる問題点を解決するためになされたも
ので、原点復帰動作で得られたデータであって、電源オ
ンから最初のZ相までの距離を示す値を使用し、フリー
ランカウンタの値をサイクルカウンタの値と照合するこ
とにより位置検出誤りを検知することができる位置検出
回路を得ることを目的とする。This invention was made to solve this problem, and uses the data obtained during the home return operation, which indicates the distance from power-on to the first Z phase, to calculate the free run counter. It is an object of the present invention to provide a position detection circuit capable of detecting a position detection error by comparing the value with the value of a cycle counter.
[課題を解決するための手段]
この発明に係る位置検出回路は、通常行なう原点復帰動
作で得られるデータであって、電源オンから最初のZ相
までの距離を示す値を用いて、位置センサであるエンコ
ーダから出力されるA相及びB相信号に応じてアップ又
はダウンするフリーランカウンタの値を、A相及びB相
信号に応じてアップまたはダウンしZ相で毎回リセット
されるサイクルカウンタの値で照合することにより位置
検出誤りを検知するものである。[Means for Solving the Problems] A position detection circuit according to the present invention detects a position sensor using data obtained during a normally performed home return operation, which is a value indicating the distance from power-on to the first Z phase. The value of a free-run counter that goes up or down according to the A-phase and B-phase signals output from the encoder, and the cycle counter that goes up or down according to the A-phase and B-phase signals and is reset every time at the Z-phase. By comparing the values, position detection errors are detected.
[作 用]
この発明においては、サイクルカウンタはZ相で毎回リ
セットされるため検出誤りが累積されないため、フリー
ランカウンタの値をサイクルカウンタの値と照合するこ
とにより、フリーランカウンタの検出誤りが検知できる
。[Function] In this invention, since the cycle counter is reset every time in the Z phase, detection errors are not accumulated. Therefore, by comparing the value of the free run counter with the value of the cycle counter, the detection error of the free run counter is eliminated. Can be detected.
[実施例]
第1図はこの発明の一実施例を示すタイミング図である
。[Embodiment] FIG. 1 is a timing diagram showing an embodiment of the present invention.
第1図において、第4図と同一符号の部分は同一部分を
示し、N1.はフリーランカウンタのラッチデータ、N
sはサイクルカウンタのラッチデータ、(82)はラッ
チ信号である。In FIG. 1, parts with the same symbols as in FIG. 4 indicate the same parts, and N1. is the latch data of the free run counter, N
s is latch data of the cycle counter, and (82) is a latch signal.
次に動作について説明する。Next, the operation will be explained.
電源オン時(9)にフリーランカウンタ(1)が動作し
始め、また、サイクルカウンタ(3)は最初のz+ti
;y1通過から動作を開始し、このとき前述の方法によ
りZ相までの距離αが求められる。また、Z相からZ相
までの距#RNGはシステム構成時パラメータより入力
されている。When the power is turned on (9), the free run counter (1) starts operating, and the cycle counter (3) starts operating at the first z+ti.
; The operation starts from passing through y1, and at this time, the distance α to the Z phase is determined by the method described above. Further, the distance #RNG from Z phase to Z phase is input from the parameters at the time of system configuration.
動作開始後、任意のタイミングでフリーランカウンタ(
1)とサイクルカウンタ(3)の値をラッチ信号(82
)により同時にラッチすると、それぞれの値であるN、
とN8が得られる。このとき、N。After the operation starts, the free run counter (
1) and cycle counter (3) to the latch signal (82
), the respective values N,
and N8 are obtained. At this time, N.
(α十N s )のデータはRNGの整数倍になるはず
である。もしも、A相B相の検出を誤った場合は、フリ
ーランカウンタは指令と同じ値まで動こうとし、結果的
に位置ずれが発生する。The data of (α+N s ) should be an integral multiple of RNG. If phase A and phase B are detected incorrectly, the free run counter will try to move to the same value as the command, resulting in a positional shift.
このとき、サイクルカウンタはZ相で毎回リセットされ
るため、検出誤りが累積されない。そのため、位置検出
誤りを起したときには、N。At this time, since the cycle counter is reset every time in the Z phase, detection errors are not accumulated. Therefore, when a position detection error occurs, N.
(α+NS)はRNGの整数倍とならない。(α+NS) is not an integral multiple of RNG.
この演算はNC装置に含まれるコンピュータにより、予
め記憶させたプログラムに従ってなされる。第2図は演
算回路の一例を示すブロック図である。第2図において
、(15)は中央処理装置(CPU) 、(l[i)は
プログラムやその他のデータを記憶するメモリ、(17
)はパラメータでエンコーダの1回転パルス数RNGや
、機械のポールネジピッチ、機械のギヤ比等の機械情報
を予め設定しておくものである。(18)はバスである
。This calculation is performed by a computer included in the NC device according to a pre-stored program. FIG. 2 is a block diagram showing an example of an arithmetic circuit. In Figure 2, (15) is a central processing unit (CPU), (l[i) is a memory that stores programs and other data, and (17) is a memory that stores programs and other data.
) is a parameter that presets machine information such as the number of pulses per revolution RNG of the encoder, the machine's pole screw pitch, and the machine's gear ratio. (18) is a bus.
フリーランカウンタ(1〉とサイクルカウンタ(3)は
バス(18)でじかに接続されており、カウンタの値は
直接CP U (15)が読むことができ、メモリ(1
6)に記憶できる。このメモリ(16)に記憶されたカ
ウンタの値を使い、下式の演算をCP U (15)か
実行する。The free run counter (1) and the cycle counter (3) are directly connected by a bus (18), and the value of the counter can be directly read by the CPU (15) and stored in the memory (1).
6). Using the counter value stored in this memory (16), the CPU (15) executes the following calculation.
N −(α十NS)/RNG
このとき、位置が正しく制御されているときには、商の
あまりが零になる。ノイズなどにより、位置検出誤りが
発生したときは、零にならないので、誤りと判断するこ
とができる。N - (α0NS)/RNG At this time, when the position is correctly controlled, the remainder of the quotient becomes zero. When a position detection error occurs due to noise or the like, the value does not become zero, so it can be determined that there is an error.
カウンタの値をラッチするタイミングは、位置検出誤り
を検知したいときに、両カウンタが同時にラッチできれ
ばよいが、位置ずれは、ひんばんに起るものではないか
ら、ある一定周期で確認を行なうようにすればよい。The timing of latching the counter values should be such that both counters can be latched at the same time when you want to detect a position detection error, but since position deviations do not occur frequently, it is recommended to check them at certain intervals. do it.
[発明の効果]
この発明は以上説明したとおり、通常行なう原点復帰動
作で得られるデータであって、電源オンから最初の2相
が通過するまでの距離を用いて、フリーランカウンタの
値を、Z相で毎回リセットされるサイクルカウンタの値
と照合することにより位置検出誤りを検知するから、回
路が安価に構成でき、精度の高い検出ができるという効
果がある。[Effects of the Invention] As explained above, the present invention calculates the value of the free run counter by using the data obtained during the normal return-to-home operation and the distance from when the power is turned on until the first two phases pass. Since a position detection error is detected by comparing the value of a cycle counter that is reset each time in the Z phase, the circuit can be constructed at low cost and the detection can be performed with high precision.
第1図はこの発明の一実施例を示すタイミング図、第2
図は演算回路の一例を示すブロック図、第3図は従来の
位置検出回路におけるカウンタの部分を示すブロック図
、第4図は原点復帰の動作を説明するタイミング図、第
5図は原点復帰の動作を説明する説明図である。
図において、(1)はフリーランカウンタ、(2)はデ
ータラッチF、(3)はサイクルカウンタ、(4)はデ
ータラッチS、(5)はA相信号、(6)はB相信号、
(7)はZ相信号、(8)、(81)、(82)はラッ
チ信号、αは電源オンから最初の2相までの距離、RN
Gはエンコーダの1回転パルス数である。
なお、図中、同一符号は同一または相当部分を示す。FIG. 1 is a timing diagram showing one embodiment of the present invention, and FIG.
Figure 3 is a block diagram showing an example of an arithmetic circuit, Figure 3 is a block diagram showing a counter part in a conventional position detection circuit, Figure 4 is a timing diagram explaining the operation of returning to the origin, and Figure 5 is a diagram showing the operation of returning to the origin. It is an explanatory diagram explaining operation. In the figure, (1) is a free run counter, (2) is a data latch F, (3) is a cycle counter, (4) is a data latch S, (5) is an A phase signal, (6) is a B phase signal,
(7) is the Z phase signal, (8), (81), (82) are the latch signals, α is the distance from power on to the first two phases, RN
G is the number of pulses per revolution of the encoder. In addition, in the figures, the same reference numerals indicate the same or corresponding parts.
Claims (1)
びB相信号に応じてアップ又はダウンし、運転中の機械
の現在位置データを出力するフリーランカウンタと、 前記エンコーダから出力されるA相信号及びB相信号に
応じてアップ又はダウンし、Z相信号で毎回リセットさ
れるサイクルカウンタと、 通常行なう原点復帰動作で得られるデータであって、電
源オンから最初のZ相までの距離を示す値を用いて、前
記フリーランカウンタの値を前記サイクルカウンタの値
と照合することにより位置検出誤りを検知する位置検出
誤り検知手段とを備えた位置検出回路。[Scope of Claims] A free-run counter that increases or decreases in response to an A-phase signal and a B-phase signal output from an encoder that is a position sensor, and outputs current position data of an operating machine; and an output from the encoder. A cycle counter that goes up or down depending on the A-phase signal and B-phase signal that is sent, and is reset each time with the Z-phase signal, and data obtained from the normal return-to-origin operation, from power-on to the first Z-phase. a position detection error detection means for detecting a position detection error by comparing the value of the free run counter with the value of the cycle counter using a value indicating a distance of the position detection circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP16987089A JPH0336608A (en) | 1989-07-03 | 1989-07-03 | Position detecting circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP16987089A JPH0336608A (en) | 1989-07-03 | 1989-07-03 | Position detecting circuit |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0336608A true JPH0336608A (en) | 1991-02-18 |
Family
ID=15894481
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP16987089A Pending JPH0336608A (en) | 1989-07-03 | 1989-07-03 | Position detecting circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0336608A (en) |
-
1989
- 1989-07-03 JP JP16987089A patent/JPH0336608A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4882529A (en) | Pulse encoder | |
US10921767B2 (en) | Encoder system | |
JP3370845B2 (en) | Absolute encoder | |
JP2845730B2 (en) | Position information discriminating device of position control system and its discriminating method | |
JP3047809B2 (en) | Rotary encoder | |
JP3989767B2 (en) | Multi-turn encoder | |
JPH0336608A (en) | Position detecting circuit | |
JP2010169556A (en) | Speed monitoring device | |
JPH0662322U (en) | Absolute encoder device | |
JP4280051B2 (en) | Origin return method and control program in positioning system | |
JPH109894A (en) | Method for detecting abnormality of encoder signal in motor control device | |
JPH03120419A (en) | Method for reducing power consumption of steering angle sensor for vehicle | |
JP2597977B2 (en) | Reference point setting method for position detection circuit | |
JPH01239417A (en) | Pulse reading-in circuit for pulse encoder | |
KR930007778B1 (en) | Zero point setting device of robot | |
JPH0580846A (en) | Open circuit detecting means | |
KR890003637B1 (en) | Errormovement-prevention of nc | |
JPS633217A (en) | Absolute value detection method | |
KR20000055856A (en) | Method for detecting a position of a rotor in a motor controller | |
KR100252079B1 (en) | Apparatus for detecting position | |
JPS60129803A (en) | Method for detecting location detecting error of control system | |
JPH05248893A (en) | Backup type absolute position encoder | |
JPH01239415A (en) | Detecting device for abnormality of encoder | |
JPH04353711A (en) | Position detecting apparatus | |
JPH0850033A (en) | Multiple-rotation type absolute encoder |