JPH0625922B2 - How to save the current position of the controller - Google Patents

How to save the current position of the controller

Info

Publication number
JPH0625922B2
JPH0625922B2 JP7114287A JP7114287A JPH0625922B2 JP H0625922 B2 JPH0625922 B2 JP H0625922B2 JP 7114287 A JP7114287 A JP 7114287A JP 7114287 A JP7114287 A JP 7114287A JP H0625922 B2 JPH0625922 B2 JP H0625922B2
Authority
JP
Japan
Prior art keywords
pulses
counter
current position
movable part
counted
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.)
Expired - Lifetime
Application number
JP7114287A
Other languages
Japanese (ja)
Other versions
JPS63236101A (en
Inventor
正恭 大西
佳一 鳥山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Daihatsu Motor Co Ltd
Original Assignee
Daihatsu Motor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Daihatsu Motor Co Ltd filed Critical Daihatsu Motor Co Ltd
Priority to JP7114287A priority Critical patent/JPH0625922B2/en
Publication of JPS63236101A publication Critical patent/JPS63236101A/en
Publication of JPH0625922B2 publication Critical patent/JPH0625922B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Safety Devices In Control Systems (AREA)
  • Control Of Position Or Direction (AREA)

Description

【発明の詳細な説明】 産業上の利用分野 本発明は自動機の可動部の位置検出をインクリメンタル
エンコーダを用いて行う制御装置の現在位置保存方法に
関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for storing the current position of a control device that detects the position of a movable part of an automatic machine by using an incremental encoder.

従来の技術 自動機、例えば産業用ロボットの可動部を予め設定され
たプログラムに従って移動させるためには、可動部の現
在位置を検出する必要がある。この可動部の位置検出に
は一般に一定回転角毎にパルスを出力するインクリメン
タルエンコーダが用いられ、可動部の移動に共なってイ
ンクリメンタルエンコーダから出力するパルス信号のパ
ルス数をカウンタによってカウントし、演算することに
より、可動部の現在位置を検出するようにしている。
2. Description of the Related Art In order to move a movable part of an automatic machine, for example, an industrial robot according to a preset program, it is necessary to detect the current position of the movable part. In general, an incremental encoder that outputs a pulse at a constant rotation angle is used to detect the position of the movable part, and the counter counts the number of pulses of the pulse signal output from the incremental encoder along with the movement of the movable part, and calculates the position. Thus, the current position of the movable part is detected.

第2図は、上記インクリメンタルエンコーダを用いて可
動部の現在位置を検出し、可動部の動きを制御する時に
用いる制御装置(A)の1例を示すブロック図である。
同図に於いて、(1)は可動部の駆動源となるモータ、
(2)はモータ(1)の回転速度を検出するためのタコ
ジェネレータ、(3)はタコジェネレータ(2)からの
出力信号と、後述するCPU(6)よりの速度指令信号
とによりモータ(1)の回転速度を制御するモータドラ
イバである。(4)はモータ(1)の回転に共なってパ
ルス信号を出力するインクリメンタルエンコーダ、
(5)はインクリメンタルエンコーダ(4)から出力す
るパルス信号のパルス数をカウントするカウンタ、
(6)はカウンタ(5)から出力するカウント数を元に
可動部の現在位置を演算すると同時に、この値と予め入
力された可動部の移動に関するデータとを比較し、可動
部を所定の箇所に移動させるのに現在必要なモータ
(1)の回転速度を演算し、速度指令信号をD/Aコン
バータ(7)を介してモータドライバ(3)に出力する
CPUである。
FIG. 2 is a block diagram showing an example of a control device (A) used when detecting the current position of the movable part using the incremental encoder and controlling the movement of the movable part.
In the figure, (1) is a motor which is a drive source of the movable part,
(2) is a tacho-generator for detecting the rotation speed of the motor (1), (3) is an output signal from the tacho-generator (2) and a speed command signal from a CPU (6) which will be described later. ) Is a motor driver for controlling the rotation speed. (4) is an incremental encoder that outputs a pulse signal in conjunction with the rotation of the motor (1),
(5) is a counter that counts the number of pulses of the pulse signal output from the incremental encoder (4),
In (6), the current position of the movable part is calculated based on the count number output from the counter (5), and at the same time, this value is compared with previously input data regarding the movement of the movable part, and the movable part is moved to a predetermined position. It is a CPU that calculates the rotation speed of the motor (1) currently required to move the motor to (1) and outputs a speed command signal to the motor driver (3) via the D / A converter (7).

そして、CPU(6)に予め入力されたデータに基づい
て可動部を所定の位置まで移動させるため、モータ
(1)が始動すると、インクリメンタルエンコーダ
(4)はモータ(1)の回転に共なってパルス信号を出
力し、このパルス信号のパルス数はカウンタ(5)によ
ってカウントされその値はCPU(6)に入力する。す
るとCPU(6)はカウンタ(5)によるカウント数か
ら可動部の現在位置を演算し、この値と予め入力された
可動部の移動に関するデータとを比較し、可動部を所定
の個所に移動させるのに現在必要なモータ(1)の回転
速度を演算し、速度指令信号をD/Aコンバータ(7)
を介してモータドライバ(3)に送る。すると、モータ
ドライバ(3)はタコジェネレータ(2)からの出力信
号と速度指令信号とによりモータ(1)の回転速度が所
定の値となるように制御するため、可動部は所定の位置
へ向けて所定の速度で移動して行く。そして、可動部が
所定の位置に達するとCPU(6)からの速度指令信号
によってモータ(1)は停止し、可動部は所定の位置に
停止する。
Then, since the movable part is moved to a predetermined position based on the data previously input to the CPU (6), when the motor (1) is started, the incremental encoder (4) is rotated along with the rotation of the motor (1). A pulse signal is output, the number of pulses of this pulse signal is counted by the counter (5), and the value is input to the CPU (6). Then, the CPU (6) calculates the current position of the movable part from the count number of the counter (5), compares this value with the previously input data regarding the movement of the movable part, and moves the movable part to a predetermined position. Calculates the rotation speed of the motor (1) currently required for the D / A converter (7)
To the motor driver (3). Then, the motor driver (3) controls the rotation speed of the motor (1) to a predetermined value by the output signal from the tachogenerator (2) and the speed command signal, so that the movable portion is directed to a predetermined position. And move at a predetermined speed. When the movable part reaches a predetermined position, the motor (1) is stopped by the speed command signal from the CPU (6), and the movable part is stopped at the predetermined position.

又、上記制御装置(A)には、装置の作動中に万一停電
事故が発生した場合、モータ(1)を停止させると同時
に、この時カウンタ(5)によってカウントされたパル
ス数を一日記憶装置に記憶させることにより、停電事故
の終了後、可動部を停電事故発生直前の状態から再スタ
ートさせるための現在位置保存装置(B)が組込まれて
いる。この現在位置保存装置(B)は、制御装置(A)
に供給される電源電圧が停電の初期状態に於いて、基準
電圧値より例えば5%低下するとこれを検出する電源電
圧検出器(8)と、この電源電圧検出器(8)が電源電
圧の低下を検出すると、CPU(6)及びカウンタ
(5)に向けてリセット信号を出力するリセット装置
(9)と、リセット装置(9)が作動した時、カウンタ
(5)内のカウント数を一旦記憶するための記憶装置(1
0)とからなっている。
Further, in the case where a power failure accident occurs during the operation of the control device (A), the motor (1) is stopped and at the same time, the number of pulses counted by the counter (5) at this time is set to one day. By storing the current position in the storage device, a current position storage device (B) is incorporated for restarting the moving part from the state immediately before the occurrence of the power failure accident after the power failure accident. This current position storage device (B) is a control device (A).
In the initial state of the power failure, the power supply voltage supplied to the power supply voltage detector (8) detects when the power supply voltage drops by 5% from the reference voltage value, and the power supply voltage detector (8) lowers the power supply voltage. When a reset signal is detected, a reset device (9) that outputs a reset signal to the CPU (6) and the counter (5) and the count number in the counter (5) are temporarily stored when the reset device (9) is activated. Storage for (1
0) and.

そして、電源電圧検出器(8)が電源電圧の低下を検出
することによりリセット装置(9)が作動し、リセット
信号がCPU(6)及びカウンタ(5)に向けて出力さ
れると、CPU(6)はモータ(1)を停止させると同
時に、この時カウンタ(5)によってカウントされてい
る可動部の現在位置に対応したパルス数を記憶装置(10)
に記憶させることにより、停電値前の可動部の現在位置
に関するデータの保存を計る。そしてこの後、可動部を
再スタートさせる時には、記憶装置(10)内に記憶させた
カウント数を元に可動部を停電直前の状態から再スター
トさせるようにしている。
Then, when the power supply voltage detector (8) detects the decrease in the power supply voltage, the reset device (9) is activated, and when the reset signal is output toward the CPU (6) and the counter (5), the CPU ( 6) stops the motor (1), and at the same time, stores the number of pulses corresponding to the current position of the movable part, which is counted by the counter (5) at this time, in the storage device (10).
The data regarding the current position of the movable part before the power failure value is stored by storing the data in the. After that, when the movable part is restarted, the movable part is restarted from the state immediately before the power failure based on the count number stored in the storage device (10).

発明が解決しようとする問題点 上述した如く、制御装置(A)に現在位置保存装置
(B)を組込んでおけば、制御装置(A)の作動中に停
電事故が発生しても停電事故発生直前の可動部の現在位
置に関するデータを保存しておくことができるため、電
源電圧が正常値に戻った後、制御装置(A)を再スター
トさせる時には、可動部を停電直前の状態から再スター
トさせることが可能となる。しかし、現在位置保存装置
(B)を上述した如く構成しておくと、電源電圧の低下
によってリセット装置(9)が作動した時、リセット信
号はCPU(6)及びカウンタ(5)に向けてほぼ同時
に出力する。このため、リセット装置(9)からリセッ
ト信号が出力した時の各装置間の電気的接続の状態によ
っては、リセット信号がCPU(6)より先にカウンタ
(5)に入力してしまい、CPU(6)がカウンタ
(5)によってカウントされたパルス数を記憶装置(10)
に送ろうとした時にはカウンタ(5)内のデータは既に
リセットされており、記憶装置(10)内には可動部の現在
位置0パルスとして記憶されてしまうことがある。この
ようにして記憶装置(10)内に現在位置0パルスが記憶さ
れてしまうと、可動部を再スタートさせようとした時、
可動部の実際の現在位置が全く判らなくなってしまい、
結局可動部を初期の状態、即ち原点にまで戻した後再ス
タートさせねばならず、現在位置保存装置を組込んだ意
味が全くなくなるといった問題があった。
Problems to be Solved by the Invention As described above, by incorporating the current position storage device (B) in the control device (A), even if a power outage accident occurs during the operation of the control device (A), a power outage accident will occur. Since the data related to the current position of the moving part immediately before the occurrence can be saved, when the control device (A) is restarted after the power supply voltage returns to the normal value, the moving part is restarted from the state immediately before the power failure. It is possible to start. However, if the current position storage device (B) is configured as described above, when the reset device (9) is activated due to the decrease in the power supply voltage, the reset signal is almost sent to the CPU (6) and the counter (5). Output at the same time. Therefore, depending on the state of electrical connection between the devices when the reset signal is output from the reset device (9), the reset signal may be input to the counter (5) before the CPU (6), and the CPU ( 6) The storage device (10) stores the number of pulses counted by the counter (5).
The data in the counter (5) has already been reset when it is sent to the storage device (10) and may be stored in the storage device (10) as the current position 0 pulse of the movable part. In this way, if the current position 0 pulse is stored in the storage device (10), when the movable part is restarted,
The actual current position of the moving part is completely unknown,
Eventually, the movable part had to be restarted after being returned to the initial state, that is, to the origin, and there was a problem that there was no point in incorporating the current position storage device.

問題点を解決するための手段 機械系の可動部の位置検出にインクリメンタルエンコー
ダを用い、インクリメンタルエンコーダから出力するパ
ルス数をカウンタによってカウントし、このカウントし
たパルス数を元にCPU内で可動部の現在位置を演算
し、かつ、電源電圧の低下によってCPU及びカウンタ
にリセット信号が入力すると、この時、カウンタによっ
てカウントされているカウント数を記憶装置に送り、可
動部の現在位置に関するデータを保存するものに於い
て、カウンタによってカウントされるカウント数が可動
部の移動範囲の全域に渡って常に正のパルス数となるよ
うにしておき、カウンタによってカウントされるパルス
数を所定のタイミングで順次CPU内に読み込み、今回
のカウント数Pと、前回のカウント数Pとを比較
し、両者が一致している時は、カウント数Pの再読み
込みを行い、両者が不一致の値となっている場合に於い
て、パルス数Pが0パルスでなければ、パルス数P
を現在位置とし、リセット信号によりパルス数Pが0
パルスにリセットされた時には、パルス数Pを現在位
置とするものである。
Means for Solving the Problems An incremental encoder is used to detect the position of the moving part of the mechanical system, the number of pulses output from the incremental encoder is counted by a counter, and based on this counted number of pulses, the current part of the moving part in the CPU is detected. When the position is calculated and a reset signal is input to the CPU and the counter due to the drop in the power supply voltage, the count number counted by the counter is sent to the storage device at this time, and data regarding the current position of the movable part is stored. In this case, the count number counted by the counter is always set to be a positive pulse number over the entire moving range of the movable part, and the pulse number counted by the counter is sequentially stored in the CPU at a predetermined timing. read, and the current number of counts P 1, the previous count the number of P 0 Comparison, when both are coincident, rereads the count number P 1, In the case where both are a value of mismatch, if the number of pulses P 1 is not zero pulses, number of pulses P 1
Is the current position, and the number of pulses P 1 is 0 due to the reset signal.
When reset to the pulse, the number of pulses P 0 is set as the current position.

作用 上記した如く、カウンタによってカウントされるパルス
数を正のパルス数としておき、カウンタによってカウン
トされるパルス数を所定のタイミングで順次CPU内に
読み込み、今回のカウント数Pと、前回のカウント数
とを比較し、両者が不一致の値となっている状態に
於いて、パルス数Pが0パルスでなければ、パルス数
を現在位置とし、リセット信号によりパルス数P
が0パルスにリセットされた時には、パルス数Pを現
在位置とするようにしたから、電源電圧の低下によって
出力するリセット信号により、記憶装置へのデータ転送
以前にカウンタ内のパルス数が0パルスにリセットされ
ていても、記憶装置には0パルス数直前のパルス数を記
憶させることができる。
Action As described above, the number of pulses counted by the counter is set as a positive number of pulses, the number of pulses counted by the counter is sequentially read into the CPU at a predetermined timing, and the current count number P 1 and the previous count number are read. comparing the P 0, in the state where both are a value of mismatch, if the number of pulses P 1 is not zero pulses, the pulse number P 1 and the current position, the pulse number P 1 by a reset signal
When the pulse number is reset to 0 pulse, the pulse number P 0 is set to the current position. Therefore, the reset signal output due to the decrease of the power supply voltage causes the pulse number in the counter to be 0 pulse before the data transfer to the storage device. Even if it is reset to 0, the number of pulses immediately before the number of 0 pulses can be stored in the storage device.

実施例 第1図は、停電事故の発生等によって生じる電源電圧の
低下時、第2図に示した現在位置保存装置(B)を組込
んだ制御装置(A)によって可動部の現在位置を常に正
確に記憶させるための現在位置保存方法を説明するため
のフローチャートであり、以下このフローチャートに従
って本願発明の説明を行う。
Example FIG. 1 shows that the current position of the movable part is always controlled by the control device (A) incorporating the current position storage device (B) shown in FIG. 2 when the power supply voltage drops due to the occurrence of a power failure accident or the like. It is a flowchart for explaining a current position storing method for accurately storing, and the present invention will be described below according to this flowchart.

尚、本願発明の前提条件として、可動部が原点を中心と
して可動範囲内を移動し、この移動に共なってインクリ
メンタルエンコーダ(A)からパルス信号が出力し、こ
のパルス数がカウンタ(5)によってカウントされる
時、このカウントされるパルス数は装置が正常に動いて
いるかぎり、可動部の移動範囲の全域に渡って常に正の
パルス数としてカウントされるように予めプログラミン
グしておく。即ち、可動部が原点に位置する時のパルス
数を0パルスではなく、例えば1000、10000等といった
正の値となるようにカウンタ(5)に予め設定してお
き、可動部が原点を中心として可動範囲内を移動するこ
とによりインクリメンタルエンコーダ(4)が正転或い
は逆転し、インクリメンタルエンコーダ(4)から出力
されるパルス信号のパルス数がカウンタ(5)内で上記
値に加算或いは減算されても、カウンタ(5)によって
カウントされたカウント数が常に正の値となるようにし
ておく。
As a precondition of the present invention, the movable part moves within a movable range around the origin, and a pulse signal is output from the incremental encoder (A) along with this movement, and the number of pulses is counted by the counter (5). When counting, the pulse number to be counted is programmed in advance so that it is always counted as a positive pulse number over the entire moving range of the movable part as long as the device is operating normally. That is, the number of pulses when the movable portion is located at the origin is not 0 pulse but is set in advance in the counter (5) so as to be a positive value such as 1000 or 10000, and the movable portion is centered on the origin. Even if the incremental encoder (4) is rotated in the normal direction or the reverse direction by moving in the movable range and the pulse number of the pulse signal output from the incremental encoder (4) is added or subtracted to the above value in the counter (5). , The count number counted by the counter (5) is always a positive value.

上記前提条件に於いて、制御装置(A)が作動し、イン
クリメンタルエンコーダ(4)から出力したパルス信号
がカウンタ(5)によってカウントされ、このカウント
されたパルス数をCPU(6)が読み込み、可動部の現
在位置を演算する時、CPU(6)内では先ずステップ
(20)にて可動部の現在位置に対応したパルス数Pを入
力する。次にステップ(21)にてこのパルス数Pが正の
値か否かの検出を行い、正の値でない時はステップ(22)
に移行してカウンタ(5)の異常と判断する。又パルス
数Pが正の値の時にはステップ(23)に移行し、可動部
の現在位置に対応したパルス数Pを再入力する。次に
ステップ(24)にてパルス数PとPとの比較を行い、
両者に差のない場合、即ちステップ(20)からステップ(2
3)に移行する間にパルス数が変化していない場合は、再
びステップ(23)に戻り、現在位置に対応したパルス数P
を再入力する。又パルス数PとPとの間に差が生
じた場合、即ちステップ(20)からステップ(23)間に移行
する間にパルス数が変化した場合はステップ(24)に移行
し、パルス数Pがリセット装置(9)から出力される
リセット信号によってリセットされ0パルスになってい
ないかを判断する。そして、パルス数Pが正のパルス
数の時には、ステップ(26)に移行し、このパルス数P
を可動部の現在位置に対応したパルス数として以後の制
御動作を行う。又パルス数Pが0パルスにリセットさ
れている時には、ステップ(27)に移行し、リセット信号
のタイミングエラーと判断した後ステップ(28)に移行
し、パルス数Pを入力する以前に入力したパルス数P
を可動部の現在位置に対応したパルス数として以後の
制御動作を行う。
Under the above-mentioned precondition, the control device (A) operates, the pulse signal output from the incremental encoder (4) is counted by the counter (5), and the counted number of pulses is read by the CPU (6) to move. When calculating the current position of the copy, first step in the CPU (6)
At (20), input the number of pulses P 0 corresponding to the current position of the movable part. Next, in step (21), it is detected whether or not this pulse number P 0 is a positive value, and if it is not a positive value, step (22)
Then, it is judged that the counter (5) is abnormal. When the number of pulses P 0 is a positive value, the process proceeds to step (23) and the number of pulses P 1 corresponding to the current position of the movable part is input again. Next, in step (24), the number of pulses P 0 and P 1 are compared,
If there is no difference between the two, that is, from step (20) to step (2
If the number of pulses has not changed during the transition to 3), return to step (23) again and set the number of pulses P corresponding to the current position.
Enter 1 again. If there is a difference between the pulse numbers P 0 and P 1 , that is, if the pulse number changes during the transition from step (20) to step (23), the process proceeds to step (24) and the pulse It is determined whether or not the number P 1 is reset by the reset signal output from the reset device (9) and becomes 0 pulse. When the pulse number P 1 is a positive pulse number, the process proceeds to step (26), and the pulse number P 1
The subsequent control operation is performed with the pulse number corresponding to the current position of the movable part. When the number of pulses P 1 is reset to 0 pulse, the process proceeds to step (27), after determining that there is a timing error in the reset signal, the process proceeds to step (28) and is input before the number of pulses P 1 is input. Number of pulses P
The subsequent control operation is performed with 0 as the number of pulses corresponding to the current position of the movable part.

CPU(6)によりカウンタ(5)によってカウントし
たカウント数を読み込むことによって可動部の現在位置
を決定するプログラムを上記のようにしておけば、制御
装置が作動中に電源電圧が低下し、CPU(6)及びカ
ウンタ(5)にリセット信号が入力することによりCP
U(6)がカウンタ(5)によってカウントしたパルス
数を記憶装置(10)に送る時、リセット信号がカウンタ
(5)よりCPU(6)に先に入力し、この時点ではカ
ウンタ(5)内のパルス数がリセットされていない時に
は、パルス数Pを可動部の現在位置して記憶装置(10)
に送る。又リセット信号のタイミングエラーによりリセ
ット信号がCPU(6)よりカウンタ(5)に先に入力
してしまい、CPU(6)がパルス数を記憶装置(10)に
送ろうとした時、既にカウンタ(5)内のパルス数が0
パルスとなっている時には、この直前のパルス数P
可動部の現在位置として記憶装置(10)に送ることができ
る。従って、リセット信号がCPU(6)より先にカウ
ンタ(5)に入力してしまい、記憶装置(10)にパルス数
を記憶させる以前にカウンタ(5)内のパルス数が0パ
ルスにリセットされていても、カウンタ(5)がリセッ
トされる直前のパルス数を記憶装置(10)に送ることが可
能となり、停電事故発生時の可動部の現在位置に関する
データを確実に保存することが可能となる。
If the program for determining the current position of the movable part by reading the count number counted by the counter (5) by the CPU (6) is set as described above, the power supply voltage decreases during the operation of the control device, and the CPU ( By inputting a reset signal to 6) and the counter (5), CP
When the U (6) sends the number of pulses counted by the counter (5) to the storage device (10), the reset signal is input to the CPU (6) earlier than the counter (5), and at this point, the counter (5) When the number of pulses of P is not reset, the number of pulses P 1 is set at the current position of the movable part and the storage device (10)
Send to. When the reset signal is input to the counter (5) earlier than the CPU (6) due to the timing error of the reset signal, and the CPU (6) tries to send the pulse number to the storage device (10), the counter (5 The number of pulses in) is 0
When it is a pulse, the immediately preceding pulse number P 0 can be sent to the storage device (10) as the current position of the movable part. Therefore, the reset signal is input to the counter (5) before the CPU (6), and the number of pulses in the counter (5) is reset to 0 before the number of pulses is stored in the storage device (10). Even if the number of pulses immediately before the counter (5) is reset can be sent to the storage device (10), the data regarding the current position of the movable part at the time of a power failure accident can be reliably saved. .

発明の効果 上記した如く、本願発明はカウンタによってカウントさ
れるパルス数を正のパルス数としておき、カウンタによ
ってカウントされるパルス数を所定のタイミングで順次
CPU内に読み込み、今回のカウント数Pと、前回の
カウント数Pとを比較し、両者が不一致の値となって
いる状態に於いて、パルス数Pが0パルスでなけれ
ば、パルス数Pを現在位置とし、リセット信号により
パルス数Pが0パルスにリセットされた時には、パル
ス数Pを現在位置とするようにしたから電源電圧の低
下によってCPU及びカウンタにリセット信号が入力
し、カウンタによってカウントされているパルス数を記
憶装置に送って可動部の現在位置に関するデータの保存
を計る場合に於いて、リセット信号がCPUより先にカ
ウンタに入力してしまい、カウンタによってカウントさ
れたパルス数を記憶装置に転送する以前にカウンタ内の
パルス数が既に0パルスになっていても、カウンタが0
パルスにリセットされる直前のパルス数を記憶装置に記
憶させることができる。従って電源電圧の低下に共なっ
てリセット信号が出力した時、CPU及びカウンタのい
ずれにリセット信号が先に入力しても、常にリセット信
号が出力する直前のパルス数を記憶装置に記憶させるこ
とが可能となり、可動部の現在位置に関するデータの保
存を確実に行えるようになる。
As described above, according to the present invention, the number of pulses counted by the counter is set as a positive number of pulses, the number of pulses counted by the counter is sequentially read into the CPU at a predetermined timing, and the current number of counts P 1 is set. , The previous count number P 0 is compared, and in the state where the two values do not match, if the pulse number P 1 is not 0 pulse, the pulse number P 1 is set as the current position, and the pulse is generated by the reset signal. When the number P 1 is reset to 0 pulse, the pulse number P 0 is set to the current position, so that the reset signal is input to the CPU and the counter due to the decrease in the power supply voltage, and the number of pulses counted by the counter is stored. When sending the data to the device and storing the data related to the current position of the movable part, the reset signal is sent to the counter before the CPU. If the number of pulses in the counter has already become 0 before the number of pulses counted by the counter is transferred to the storage device,
The number of pulses immediately before being reset to a pulse can be stored in a storage device. Therefore, when the reset signal is output due to the decrease of the power supply voltage, the number of pulses immediately before the reset signal is output can always be stored in the storage device regardless of which of the CPU and the counter receives the reset signal first. It becomes possible, and it becomes possible to surely save the data regarding the current position of the movable part.

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

第1図は本発明に係る制御装置の現在位置保存方法を説
明するためのフローチャート、第2図は現在位置保存装
置を有する制御装置の1例を示すブロック図である。 (A)……制御装置、 (B)……現在位置保存装置、 (1)……モータ、 (4)……インクリメンタルエンコーダ、 (5)……カウンタ、(6)……CPU、 (8)……電源電圧検出器、 (9)……リセット装置、(10)……記憶装置。
FIG. 1 is a flow chart for explaining a present position saving method of a control device according to the present invention, and FIG. 2 is a block diagram showing an example of a control device having a present position saving device. (A) ... Control device, (B) ... Current position storage device, (1) ... Motor, (4) ... Incremental encoder, (5) ... Counter, (6) ... CPU, (8) ...... Power supply voltage detector, (9) …… Reset device, (10) …… Memory device.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】機械系の可動部の位置検出にインクリメン
タルエンコーダを用い、インクリメンタルエンコーダか
ら出力するパルス数をカウンタによってカウントし、こ
のカウントしたパルス数を元にCPU内で可動部の現在
位置を演算し、かつ、電源電圧の低下によってCPU及
びカウンタにリセット信号が入力すると、この時、カウ
ンタによってカウントされているカウント数を記憶装置
に送り、可動部の現在位置に関するデータを保存するも
のに於いて、カウンタによってカウントされるカウント
数が可動部の移動範囲の全域に渡って常に正のパルス数
となるようにしておき、カウンタによってカウントされ
るパルス数を所定のタイミングで順次CPU内に読み込
み、今回のカウント数Pと、前回のカウント数P
を比較し、両者が一致している時は、カウント数P
再読み込みを行い、両者が不一致の値となっている場合
に於いて、パルス数Pが0パルスでなければ、パルス
数Pを現在位置とし、リセット信号によりパルス数P
が0パルスにリセットされた時には、パルス数P
現在位置とすることを特徴とする制御装置の現在位置保
存方法。
1. An incremental encoder is used to detect the position of a movable part of a mechanical system, the number of pulses output from the incremental encoder is counted by a counter, and the current position of the movable part is calculated in the CPU based on the counted number of pulses. In addition, when a reset signal is input to the CPU and the counter due to the drop in the power supply voltage, the count number counted by the counter is sent to the storage device at this time, and data relating to the current position of the movable part is stored. , The number of counts counted by the counter is always a positive number of pulses over the entire moving range of the movable part, and the number of pulses counted by the counter is sequentially read into the CPU at a predetermined timing, and this time the count number P 1, compared with the previous count number P 0, both When it matches, rereads the count number P 1, In the case where both are a value of mismatch, if the number of pulses P 1 is not zero pulses, the pulse number P 1 and the current position , Number of pulses P by reset signal
When the 1 is reset to 0 pulse, the current position saving method of the control device is characterized in that the number of pulses P 0 is set as the current position.
JP7114287A 1987-03-24 1987-03-24 How to save the current position of the controller Expired - Lifetime JPH0625922B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7114287A JPH0625922B2 (en) 1987-03-24 1987-03-24 How to save the current position of the controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7114287A JPH0625922B2 (en) 1987-03-24 1987-03-24 How to save the current position of the controller

Publications (2)

Publication Number Publication Date
JPS63236101A JPS63236101A (en) 1988-10-03
JPH0625922B2 true JPH0625922B2 (en) 1994-04-06

Family

ID=13452045

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7114287A Expired - Lifetime JPH0625922B2 (en) 1987-03-24 1987-03-24 How to save the current position of the controller

Country Status (1)

Country Link
JP (1) JPH0625922B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03253902A (en) * 1990-03-05 1991-11-13 Masahiko Kurata Reset device of electronic control apparatus

Also Published As

Publication number Publication date
JPS63236101A (en) 1988-10-03

Similar Documents

Publication Publication Date Title
US4609868A (en) Circuit for detecting the failure of a step motor to respond to energization commands
US4815007A (en) Apparatus for controlling a robot
US4101817A (en) Position-correctable numerical control system
JPH0625922B2 (en) How to save the current position of the controller
US5046467A (en) System for setting the throttle flap angle for an internal combustion engine
US5663622A (en) Positioning control system
EP0245522B1 (en) Metering device for injection molding machine
JPS6220564B2 (en)
JP2827893B2 (en) Step motor drive controller
JPH0739190A (en) Brake malfunction detecting method for automatic machine
JPH06269941A (en) Method and device for controlling arc welding robot
JPH05252778A (en) Method for controlling speed malfunction time of copying machine optical system
JP4280051B2 (en) Origin return method and control program in positioning system
US8175834B2 (en) Measurement system and method for monitoring the measurement system
US4586152A (en) Method and apparatus for counting an infinite length with a counter of finite length
JP3010107B2 (en) Encoder system
JPH0565352B2 (en)
JP3173848B2 (en) Motor drive controller
JPH0895621A (en) Original point control method for mobile part and device therefor
EP0915403A1 (en) Numerical control unit
JP2740953B2 (en) Spindle fixed position stop control device
JPS63168707A (en) Closed loop system position controller
EP0574931A1 (en) Device for controlling reverse rotation of motor and method of judging time point where motor is actually rotated in reverse direction
KR0165444B1 (en) Malfunction preventing method in location control apparatus
RU2023568C1 (en) Method and apparatus to control loading on tool