JPH109894A - Method for detecting abnormality of encoder signal in motor control device - Google Patents
Method for detecting abnormality of encoder signal in motor control deviceInfo
- Publication number
- JPH109894A JPH109894A JP8161323A JP16132396A JPH109894A JP H109894 A JPH109894 A JP H109894A JP 8161323 A JP8161323 A JP 8161323A JP 16132396 A JP16132396 A JP 16132396A JP H109894 A JPH109894 A JP H109894A
- Authority
- JP
- Japan
- Prior art keywords
- phase
- signal
- microcomputer
- encoder
- encoder signal
- 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
Landscapes
- Indicating Or Recording The Presence, Absence, Or Direction Of Movement (AREA)
- Transmission And Conversion Of Sensor Element Output (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、モータ制御装置に
おいてエンコーダ信号の異常をマイコンの汎用ポート入
力を用いて検出する方法に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for detecting an abnormality of an encoder signal in a motor control device by using a general-purpose port input of a microcomputer.
【0002】[0002]
【従来の技術】図5はエンコーダ信号の信号形態図で、
図5において、1はエンコーダ信号のA相、2はエンコ
ーダ信号のB相を示しており、1a,2aは信号レベル
のHigh、1b,2bは信号レベルのLowの状態を
示す。2. Description of the Related Art FIG. 5 is a diagram showing a signal form of an encoder signal.
In FIG. 5, 1 indicates the A phase of the encoder signal, 2 indicates the B phase of the encoder signal, 1a and 2a indicate the high signal levels, and 1b and 2b indicate the low signal levels.
【0003】エンコーダ信号のA相,B相はモータの回
転数や回転方向を知らせるパルス信号で、デューティ比
が50%で同じ周期のA相,B相がπ/2位相がずれた
状態で入力される。The A-phase and B-phase of the encoder signal are pulse signals indicating the number of rotations and the direction of rotation of the motor. The duty ratio is 50%, and the A-phase and the B-phase having the same period are input with a π / 2 phase shift. Is done.
【0004】デューティ比とは、パルス信号の1周期分
の中でパルス信号レベルがHighになっている時間の
比率のことで、デューティ比50%とはパルス信号レベ
ルのHighとLowの時間とが同じであることを意味
する。[0004] The duty ratio is the ratio of the time during which the pulse signal level is high in one cycle of the pulse signal, and the duty ratio of 50% is the time when the pulse signal level is high and the time when the pulse signal level is low. Means the same.
【0005】従来のエンコーダ信号異常検出方法として
は、 (1)エンコーダ信号をモータ制御装置のマイコンの外
部割り込み端子に入力し、信号レベルのHighからL
ow、LowからHighの変化エッジがA相1,B相
2が交互に発生しているか確認する。 (2)上記信号をモータ制御装置のマイコンのパルス幅
測定用端子に入力し、マイコンでこの信号のパルス幅を
測定してデューティ比が50%になっているか確認す
る。という方法があった。Conventional encoder signal abnormality detection methods include the following: (1) An encoder signal is input to an external interrupt terminal of a microcomputer of a motor control device, and the signal level is changed from high to low.
It is checked whether a changing edge from ow and Low to High alternates between A-phase 1 and B-phase 2. (2) The above signal is input to a pulse width measuring terminal of the microcomputer of the motor control device, and the pulse width of this signal is measured by the microcomputer to check whether the duty ratio is 50%. There was a method.
【0006】[0006]
【発明が解決しようとする課題】しかしながら上記の方
法では、外部割り込み端子やパルス幅測定用端子の2つ
が内蔵されたマイコンでしか異常検出を行うことができ
ず、高価なマイコンを使用しなければならないという問
題点を有していた。However, in the above method, the abnormality can be detected only by a microcomputer having two built-in terminals, an external interrupt terminal and a pulse width measurement terminal, and an expensive microcomputer must be used. There was a problem that it did not become.
【0007】本発明は上記従来の問題点を解決するもの
で、通常どの種類のマイコンにも内蔵されている汎用ポ
ート入力を使用することによって、安価なマイコンでエ
ンコーダ信号の異常検出機能を実現することを目的とす
る。The present invention solves the above-mentioned conventional problems, and realizes an encoder signal abnormality detection function with an inexpensive microcomputer by using a general-purpose port input normally incorporated in any type of microcomputer. The purpose is to:
【0008】[0008]
【課題を解決するための手段】この課題を解決するため
に本発明は、エンコーダのA相,B相信号をマイコンの
汎用ポートに入力し、このA相,B相信号レベルのHi
ghとLowの時間をマイコンが内蔵しているタイマを
用いて計測し、ある一定時間のA相信号レベルがHig
hの時間とB相信号レベルがHighの時間との比率が
2:1以上のときに異常とみなすものである。SUMMARY OF THE INVENTION In order to solve this problem, the present invention is to input an A-phase signal and a B-phase signal of an encoder to a general-purpose port of a microcomputer, and to obtain a Hi-level signal of the A-phase and B-phase signals.
The time of gh and Low is measured using a timer built in the microcomputer, and the A-phase signal level for a certain period of time is High.
When the ratio between the time h and the time when the B-phase signal level is High is 2: 1 or more, it is regarded as abnormal.
【0009】[0009]
【発明の実施の形態】本発明は、エンコーダからのパル
ス信号によりモータの回転数や正転/逆転の制御を行う
モータ制御装置において、エンコーダのA相,B相信号
をマイコンの汎用ポートに入力し、前記A相,B相信号
レベルのHigh/Low時間を前記マイコンが内蔵し
ているタイマを用いて計測し、ある一定時間の前記A相
信号レベルがHighの時間と前記B相信号レベルがH
ighの時間との比率が2:1以上のときに異常と判定
するモータ制御装置のエンコーダ信号異常検出方法であ
り、マイコンの汎用ポート入力に入力されたエンコーダ
のA相,B相信号をタイマ割り込み処理を用いて異常検
出を行うので、外部割り込み端子やパルス幅測定用端子
を内蔵した高価なマイコンを使用することなく、安価な
マイコンでエンコーダ信号の異常検出機能を実現できる
作用を有する。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention relates to a motor control device for controlling the number of rotations of the motor and the forward / reverse rotation of the motor by a pulse signal from the encoder. Then, the High / Low time of the A-phase and B-phase signal levels is measured using a timer built in the microcomputer, and the time when the A-phase signal level is High and the B-phase signal level for a certain time are measured H
This is a method for detecting an encoder signal abnormality of a motor control device which determines that an abnormality has occurred when the ratio of time to high is 2: 1 or more. Since the abnormality detection is performed by using the processing, it is possible to realize an encoder signal abnormality detection function with an inexpensive microcomputer without using an expensive microcomputer having a built-in external interrupt terminal or pulse width measurement terminal.
【0010】[0010]
【実施例】以下本発明の実施例について、図面を参照し
て説明する。Embodiments of the present invention will be described below with reference to the drawings.
【0011】図1は本発明のエンコーダ信号の異常判定
説明図で、エンコーダ信号が正常な場合を示し、図1に
おいて、1はエンコーダ信号のA相、2はエンコーダ信
号のB相で、位相がπ/2ずれているだけで周期とデュ
ーティ比は同じである。FIG. 1 is a diagram for explaining an abnormality judgment of an encoder signal according to the present invention, and shows a case where the encoder signal is normal. In FIG. 1, 1 is an A phase of the encoder signal, 2 is a B phase of the encoder signal and the phase is The cycle and the duty ratio are the same only by shifting by π / 2.
【0012】したがって、ある一定時間Tの範囲内のA
相1,B相2の信号レベルがHighの時間はA相,B
相ともt1+t2+t3となる。Therefore, A within a certain time period T
During the time when the signal levels of Phase 1 and Phase 2 are High, Phase A and Phase B
Both phases are t1 + t2 + t3.
【0013】つまり、モータ制御装置のマイコンのタイ
マ割り込み処理を用いて汎用ポート入力に入力されたA
相1,B相2の信号レベルがHighになっている時間
をカウントし、その時間が同じ場合はエンコーダ信号は
正常とみなし、同じにならない場合は異常とみなすので
異常判定ができる。That is, A is input to the general-purpose port input using the timer interrupt processing of the microcomputer of the motor control device.
The time during which the signal levels of phase 1 and phase B 2 are high is counted. If the time is the same, the encoder signal is regarded as normal, and if not the same, it is regarded as abnormal.
【0014】図2は本発明の実施例の機器接続図で、3
はモータ、4はモータ3の回転軸に装着したエンコー
ダ、5はエンコーダ4の信号でA相の信号入力、6はエ
ンコーダ4の信号でB相の信号入力、7はモータ制御装
置、8はモータ制御装置7に組込まれたマイコンで、A
相の信号入力とB相の信号入力が入力される。FIG. 2 is a device connection diagram of an embodiment of the present invention.
Is a motor, 4 is an encoder mounted on the rotating shaft of the motor 3, 5 is an A-phase signal input as a signal from the encoder 4, 6 is a B-phase signal input as a signal from the encoder 4, 7 is a motor control device, and 8 is a motor. A microcomputer built into the control device 7
A phase signal input and a B phase signal input are input.
【0015】図3は本発明のタイマ割り込み処理のフロ
ーチャートで、図2で説明した機器の接続にして、マイ
コンのタイマ割り込み処理が100μsの周期でかかる
ようにソフトウェアで設定しておく。FIG. 3 is a flowchart of the timer interrupt process of the present invention. The software is set so that the timer interrupt process of the microcomputer is performed at a period of 100 μs by connecting the devices described in FIG.
【0016】そして100μsのタイマ割り込み処理中
は、25msの時間カウント処理、A相のHigh時間
カウント処理、B相のHigh時間カウント処理を行
う。During the timer interruption process of 100 μs, a 25 ms time counting process, an A-phase high time counting process, and a B-phase high time counting process are performed.
【0017】図4は本発明のメインルーチンのフローチ
ャートで、メインルーチンの処理はタイマ割り込み処理
でカウントした25msの時間を利用して25msに一
回の割合で処理を実行するようにしておく。FIG. 4 is a flowchart of a main routine according to the present invention. The processing of the main routine is executed once every 25 ms using the time of 25 ms counted in the timer interrupt processing.
【0018】そしてメインルーチンの中でタイマ割り込
み処理内でカウントしたA相のHigh時間データ、B
相のHigh時間データを参照する。In the main routine, A-phase High time data counted in the timer interrupt processing;
Reference the High time data of the phase.
【0019】すなわち25ms中でA相,B相の信号が
どれくらいの時間Highレベルだったかを参照してい
ることになる。That is, it refers to how long the A-phase and B-phase signals have been at the High level within 25 ms.
【0020】エンコーダ信号が正常であればこのA相,
B相信号の2つのデータの比率は2:1以上にならない
はずなので、2つのデータを比較して比率が2:1以下
ならば正常、2:1以上であれば異常と判定する。If the encoder signal is normal, this A phase,
Since the ratio of the two data of the B-phase signal should not exceed 2: 1, the two data are compared, and if the ratio is 2: 1 or less, it is determined to be normal, and if the ratio is 2: 1 or more, it is determined to be abnormal.
【0021】[0021]
【発明の効果】以上のように本発明によれば、エンコー
ダのA相,B相信号をマイコンの汎用ポート入力に入力
してエンコーダ信号の異常を検出するので、外部割り込
み端子やパルス幅測定用端子を内蔵した高価なマイコン
を使用しなくても安価なマイコンでエンコーダ信号の異
常検出機能を実現することができる。As described above, according to the present invention, the A-phase and B-phase signals of the encoder are input to the general-purpose port input of the microcomputer to detect the abnormality of the encoder signal. Even if an expensive microcomputer with a built-in terminal is not used, an inexpensive microcomputer can realize the abnormality detection function of the encoder signal.
【図1】本発明のエンコーダ信号の異常判定説明図FIG. 1 is an explanatory diagram of an abnormality determination of an encoder signal according to the present invention.
【図2】本発明の実施例の機器接続図FIG. 2 is a device connection diagram according to an embodiment of the present invention.
【図3】本発明のタイマ割り込み処理のフローチャートFIG. 3 is a flowchart of a timer interrupt process according to the present invention;
【図4】本発明のメインルーチンのフローチャートFIG. 4 is a flowchart of a main routine of the present invention.
【図5】エンコーダ信号の信号形態図FIG. 5 is a diagram showing a signal form of an encoder signal.
1 エンコーダ信号のA相 2 エンコーダ信号のB相 1a,2a 信号レベルHigh 1b,2b 信号レベルLow 3 モータ 4 エンコーダ 7 モータ制御装置 8 マイコン Reference Signs List 1 A phase of encoder signal 2 B phase of encoder signal 1a, 2a Signal level High 1b, 2b Signal level Low 3 Motor 4 Encoder 7 Motor controller 8 Microcomputer
Claims (1)
の回転数や正転/逆転の制御を行うモータ制御装置にお
いて、エンコーダのA相,B相信号をマイコンの汎用ポ
ートに入力し、前記A相,B相信号レベルのHigh/
Low時間を前記マイコンが内蔵しているタイマを用い
て計測し、ある一定時間の前記A相信号レベルがHig
hの時間と前記B相信号レベルがHighの時間との比
率が2:1以上のときに異常と判定するモータ制御装置
のエンコーダ信号異常検出方法。In a motor control device for controlling the number of rotations of a motor and the forward / reverse rotation by a pulse signal from an encoder, an A-phase signal and a B-phase signal of an encoder are inputted to a general-purpose port of a microcomputer, and the A-phase and B-phase signals are inputted. High / phase B signal level
The Low time is measured using a timer built in the microcomputer, and the A-phase signal level for a certain period of time is Hig.
An encoder signal abnormality detection method for a motor control device that determines that an abnormality has occurred when the ratio of the time h and the time when the B-phase signal level is High is 2: 1 or more.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8161323A JPH109894A (en) | 1996-06-21 | 1996-06-21 | Method for detecting abnormality of encoder signal in motor control device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8161323A JPH109894A (en) | 1996-06-21 | 1996-06-21 | Method for detecting abnormality of encoder signal in motor control device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH109894A true JPH109894A (en) | 1998-01-16 |
Family
ID=15732914
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP8161323A Pending JPH109894A (en) | 1996-06-21 | 1996-06-21 | Method for detecting abnormality of encoder signal in motor control device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH109894A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100383994B1 (en) * | 2000-12-28 | 2003-05-14 | 현대자동차주식회사 | A error detecting method of incremental encoder |
KR100680466B1 (en) | 2005-07-05 | 2007-02-08 | 현대모비스 주식회사 | Encoder defect diagnosis circuit for AGCS actuator |
KR100902147B1 (en) | 2007-10-23 | 2009-06-10 | 강원대학교산학협력단 | Error detecting circuit of incremental encoder |
CN101833049A (en) * | 2009-02-09 | 2010-09-15 | 富士电机系统株式会社 | Abnormality monitoring apparatus |
JP2010203903A (en) * | 2009-02-09 | 2010-09-16 | Fuji Electric Systems Co Ltd | Anomaly monitoring device |
JP2012095846A (en) * | 2010-11-02 | 2012-05-24 | Mitsubishi Electric Corp | Encoder abnormality detector |
CN104898763A (en) * | 2015-04-15 | 2015-09-09 | 广东好帮手电子科技股份有限公司 | Turn button control-adjustment method and system of vehicle-mounted encoder |
CN108027250A (en) * | 2016-06-09 | 2018-05-11 | 日立汽车系统株式会社 | The diagnostic device and diagnostic method of angular sensor and the control device of actuator |
-
1996
- 1996-06-21 JP JP8161323A patent/JPH109894A/en active Pending
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100383994B1 (en) * | 2000-12-28 | 2003-05-14 | 현대자동차주식회사 | A error detecting method of incremental encoder |
KR100680466B1 (en) | 2005-07-05 | 2007-02-08 | 현대모비스 주식회사 | Encoder defect diagnosis circuit for AGCS actuator |
KR100902147B1 (en) | 2007-10-23 | 2009-06-10 | 강원대학교산학협력단 | Error detecting circuit of incremental encoder |
CN101833049A (en) * | 2009-02-09 | 2010-09-15 | 富士电机系统株式会社 | Abnormality monitoring apparatus |
JP2010203903A (en) * | 2009-02-09 | 2010-09-16 | Fuji Electric Systems Co Ltd | Anomaly monitoring device |
JP2012095846A (en) * | 2010-11-02 | 2012-05-24 | Mitsubishi Electric Corp | Encoder abnormality detector |
CN104898763A (en) * | 2015-04-15 | 2015-09-09 | 广东好帮手电子科技股份有限公司 | Turn button control-adjustment method and system of vehicle-mounted encoder |
CN108027250A (en) * | 2016-06-09 | 2018-05-11 | 日立汽车系统株式会社 | The diagnostic device and diagnostic method of angular sensor and the control device of actuator |
CN108027250B (en) * | 2016-06-09 | 2020-10-30 | 日立汽车系统株式会社 | Diagnostic device and diagnostic method for rotation angle sensor, and control device for actuator |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH109894A (en) | Method for detecting abnormality of encoder signal in motor control device | |
US7034495B2 (en) | Indicating instrument | |
JPH06288791A (en) | Encoder device | |
US7460030B2 (en) | System and method for encoder failure detection | |
US6265891B1 (en) | Apparatus for detecting a coil short circuit in an electric motor | |
JP2001249154A (en) | Disconnection detecting device for encoder and method for disconnection detection | |
JP2511539B2 (en) | Abnormality detection device for motor rotation control device | |
US20050006966A1 (en) | Drive device for stepper motor and indicating apparatus using the same | |
JP3250356B2 (en) | Rotational position detector | |
JP2501110B2 (en) | Select position detection device for automatic transmission | |
JP2002145552A (en) | Safety device for elevator | |
JPH1164040A (en) | Device for detecting abnormality in encoder | |
KR100383994B1 (en) | A error detecting method of incremental encoder | |
EP4181386A1 (en) | Method for implementing brushless direct current motor hall position sensor fault processing | |
JP3426974B2 (en) | Speed detector and checking method thereof | |
JPH04285815A (en) | Position counter circuit of rotary encoder | |
JP3387175B2 (en) | Time erroneous measurement prevention device | |
JP2002357456A (en) | Encoder | |
JPS648766B2 (en) | ||
JPH09236612A (en) | Rotating speed sensor | |
JPH0478123B2 (en) | ||
CN116859081A (en) | Gear rotation direction detection device, method and sensor | |
JPS62185172A (en) | System for detecting direction of rotation | |
JPH10108354A (en) | Method of judging inversive connection of motor, and motor position detector | |
JPH0993993A (en) | Device for detecting step-out of stepping motor |