JPH03198683A - Motor controller - Google Patents

Motor controller

Info

Publication number
JPH03198683A
JPH03198683A JP1335516A JP33551689A JPH03198683A JP H03198683 A JPH03198683 A JP H03198683A JP 1335516 A JP1335516 A JP 1335516A JP 33551689 A JP33551689 A JP 33551689A JP H03198683 A JPH03198683 A JP H03198683A
Authority
JP
Japan
Prior art keywords
data
speed
calculated
motor
time
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
JP1335516A
Other languages
Japanese (ja)
Inventor
Hiroyuki Harada
博之 原田
Tetsuji Kajitani
梶谷 哲司
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.)
Kyocera Mita Industrial Co Ltd
Original Assignee
Mita Industrial 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 Mita Industrial Co Ltd filed Critical Mita Industrial Co Ltd
Priority to JP1335516A priority Critical patent/JPH03198683A/en
Publication of JPH03198683A publication Critical patent/JPH03198683A/en
Pending legal-status Critical Current

Links

Landscapes

  • Control Of Electric Motors In General (AREA)

Abstract

PURPOSE:To obtain an accurate rotating speed by deciding whether the data calculated previously is erroneous or not, determining whether the data calculated this time falls within a predetermined range or not, and outputting data corresponding to the result as motor control speed data. CONSTITUTION:When data regarding the rotating speed of a motor 10 calculated previously is decided, for example, to be erroneous, data calculated this time is stored in a latest data storage area, and the data of the previous time stored in a storage means of the controller 14 is discarded. When the data of this time corresponds to the data corresponding to a center of large and small values or falls within a predetermined range to the data corresponding to the center of the large and small values, the data of this time is output as motor 10 control speed data. On the other hand, when the data of this time is out of the predetermined range to the data corresponding to the center, the data of this time is decided to be erroneous, and the data corresponding to the center is output as the motor 10 control speed data.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 この発明は、モータ制御装置に関する。[Detailed description of the invention] <Industrial application field> The present invention relates to a motor control device.

〈発明の背景〉 たとえば複写機等の原稿読取装置における光学系駆動用
のDCサーボモータ制御装置においては、光学系の移動
に伴ない摩擦抵抗等が変化してモータ負荷が変動しても
、追従性よくサーボモータを一定速度に保ち、光学系を
一定速度で移動させる必要がある。
<Background of the Invention> For example, in a DC servo motor control device for driving an optical system in a document reading device such as a copying machine, even if the motor load fluctuates due to changes in frictional resistance etc. as the optical system moves, it is difficult to follow the It is necessary to maintain the servo motor at a constant speed and move the optical system at a constant speed.

サーボモータを一定速度に保つためには、その前提とし
て、サーボモータの実際の回転速度を正確に検出する必
要がある。
In order to keep the servo motor at a constant speed, it is necessary to accurately detect the actual rotational speed of the servo motor.

従来装置では、サーボモータに連結されたエンコーダな
どの速度検出器の出力(速度検出信号)に基づいて、所
定タイミングごとに、サーボモータの回転速度が検出さ
れていた。
In conventional devices, the rotational speed of the servo motor is detected at predetermined timings based on the output (speed detection signal) of a speed detector such as an encoder connected to the servo motor.

しかしながら、従来装置における速度検出の仕方では、
検出された回転速度がノイズ等の影響を受けている場合
、正確にモータ回転速度を検出できないという欠点があ
る。
However, the method of speed detection in conventional devices is
If the detected rotational speed is affected by noise or the like, there is a drawback that the motor rotational speed cannot be detected accurately.

そこで、ノイズ等の影響による誤差をなくするために、
前回検出された速度と今回検出された速度との平均を求
め、それを現在の速度として取出す等の方法が採用され
ているものもあった。
Therefore, in order to eliminate errors caused by noise etc.
Some methods have been adopted, such as finding the average of the previously detected speed and the currently detected speed, and taking that as the current speed.

(発明が解決しようとする課題〉 しかしながら、上記検出速度の平均を求める方法では、
検出速度を平均化することによって誤差を小さくしよう
としているため、正確な回転速度が検出された場合にも
、その速度が平均化されることにより、本来の速度(実
際の速度)に対して一定の偏差を生じることになる。
(Problem to be solved by the invention) However, in the method of calculating the average detection speed,
Since we are trying to reduce the error by averaging the detected speeds, even if an accurate rotational speed is detected, the speed will be averaged and will remain constant relative to the original speed (actual speed). This will result in a deviation of

また、−時的に大きなノイズが発生した場合は、平均化
されてもノイズ誤差を取除けず、平均化後の速度中に比
較的大きな誤差が残ったままである。
Furthermore, if temporally large noise occurs, the noise error cannot be removed even if it is averaged, and a relatively large error remains in the speed after averaging.

このため、たとえば、定常状態でこのような大きなノイ
ズが生じた場合、速度ムラが発生してしまう。
For this reason, for example, if such large noise occurs in a steady state, speed unevenness will occur.

この発明は、上記実情に鑑みてなされたものであって、
ノイズ等によって、−時的に速度検出信号が大きく変動
しても、その変動の影響を受けることなく、正確な速度
を得られるモータ制御装置を提供することを目的とする
This invention was made in view of the above circumstances, and
It is an object of the present invention to provide a motor control device that can obtain an accurate speed without being affected by the fluctuation even if a speed detection signal fluctuates greatly over time due to noise or the like.

〈課題を解決するための手段〉 この発明は、モータ回転速度が指令速度に等しくなるよ
うに、モータをフィードバック制御するモータの制御装
置において、所定タイミングごとに、モータ回転速度に
関するデータを算出する算出手段、モータ回転速度に関
するデータを所定の複数回分、新しいもの順に記憶でき
る複数の記憶エリアを有する記憶手段、モータ回転速度
に関するデータが算出されるごとに、前回算出されたデ
ータが誤データと判定されていたか否かを確認する手段
、前回算出されたデータが誤データと判定されていなか
ったときには、記憶手段に既に記憶されているデータを
順次1つずつシフトして最古データを捨て、かつ今回算
出されたデータを最新データ記憶エリアに記憶させる第
1記憶制御手段、前回算出されたデータが誤データと判
定されていたときには、記憶手段に既に記憶されている
データをシフトすることなく、今回算出されたデータを
前回のデータに代えて最新データ記憶エリアに記憶させ
る第2記憶制御手段、最新データ記憶エリアに記憶され
ている今回の算出データが、記憶手段に記憶されている
複数回分のデータの内、大小中央に相当するデータに該
当するかまたは大小中央に相当するデータに対して所定
範囲内であるか否かを判別する判別手段、今回の算出デ
ータが、大小中央に相当するデータに該当するかまたは
大小中央に相当するデータに対して所定範囲内であると
判別された時、今回の算出データを、モータ制御に用い
るべき速度データとして取出す手段、および今回の算出
データが、大小中央に相当するデータに対して所定範囲
外であると判別された時、今回の算出データが誤データ
であると判定して、大小中央に相当するデータを、モー
タ制御に用いるべき速度データとして取出す手段を含む
ことを特徴するモータ装置装置である。
<Means for Solving the Problems> The present invention provides a calculation method for calculating data regarding the motor rotation speed at each predetermined timing in a motor control device that performs feedback control of the motor so that the motor rotation speed becomes equal to the command speed. a storage means having a plurality of storage areas capable of storing data related to the motor rotation speed for a predetermined plurality of times in chronological order; each time data related to the motor rotation speed is calculated, the previously calculated data is determined to be incorrect data; If the data calculated last time was not determined to be incorrect data, the data already stored in the storage means is shifted one by one, the oldest data is discarded, and the data calculated this time is A first storage control means stores the calculated data in the latest data storage area, and when the previously calculated data is determined to be incorrect data, the data calculated this time is stored without shifting the data already stored in the storage means. A second storage control means stores the calculated data in the latest data storage area instead of the previous data, A determination means for determining whether the data corresponds to the center of the magnitude or is within a predetermined range for the data corresponding to the center of the magnitude; the current calculated data corresponds to the data corresponding to the center of the magnitude. or when it is determined that the data is within a predetermined range with respect to the data corresponding to the center of magnitude, a means for extracting the currently calculated data as speed data to be used for motor control, and a means for extracting the currently calculated data as speed data to be used for motor control; When it is determined that the corresponding data is outside a predetermined range, the presently calculated data is determined to be incorrect data, and means is provided for extracting data corresponding to the center of the magnitude as speed data to be used for motor control. It is a motor device device characterized in that it includes.

く作用〉 所定タイミングごとに、モータ回転速度に関するデータ
が算出される。
Function> Data regarding the motor rotation speed is calculated at each predetermined timing.

また、モータ回転速度に関するデータが算出されるごと
に、前回算出されたデータが誤データと判定されていた
か否かが確認される。
Furthermore, each time data related to the motor rotation speed is calculated, it is checked whether the previously calculated data was determined to be incorrect data.

そして、前回算出されたデータが誤データと判定されて
いなかったときには、記憶手段に既に記憶されている所
定の複数回分のデータが順次1つずつシフトされて最古
データが捨てられ、代わりに今回算出されたデータが最
新データ記憶エリアに記憶される。
Then, if the data calculated last time is not determined to be incorrect data, the data for a predetermined number of times already stored in the storage means are shifted one by one one by one, the oldest data is discarded, and the data calculated this time is replaced instead. The calculated data is stored in the latest data storage area.

前回算出されたデータが誤データと判定されていたとき
には、記憶手段に既に記憶されているデータは、シフト
されることなく、今回算出されたデータが前回のデータ
に代えて最新データ記憶エリアに記憶され、前回のデー
タは捨てられる。
If the data calculated last time was determined to be incorrect data, the data already stored in the storage means is not shifted, and the data calculated this time is stored in the latest data storage area in place of the previous data. The previous data will be discarded.

次に、今回のデータが、記憶手段に記憶されている複数
回分のデータ(これらデータ中には今回のデータも含ま
れている。)の内、大小中央に相当するデータに該当す
るかまたは大小中央に相当するデータに対して所定範囲
内であるか否かが判別される。
Next, check whether the current data corresponds to the data corresponding to the center of the size among the multiple data stored in the storage means (these data include the current data), or It is determined whether or not the data corresponding to the center is within a predetermined range.

そして、今回のデータが、大小中央に相当するデータに
該当するかまたは大小中央に相当するデータに対して所
定範囲内であると判別された時、今回のデータが、モー
タ制御に用いるべき現在の速度データとして取出される
When it is determined that the current data corresponds to the data corresponding to the center of magnitude or is within a predetermined range with respect to the data corresponding to the center of magnitude, the current data is the current data to be used for motor control. Extracted as speed data.

一方、今回のデータが、大小中央に相当するデータに対
して所定範囲外であると判別された時には、今回のデー
タが誤データであると判定され、大小中央に相当するデ
ータが、モータ制御に用いるべき現在の速度データとし
て取出される。
On the other hand, when it is determined that the current data is outside the predetermined range with respect to the data corresponding to the center of magnitude, the current data is determined to be incorrect data, and the data corresponding to the center of magnitude is determined to be outside the predetermined range. It is extracted as the current speed data to be used.

〈実施例〉 以下には、この発明の一実施例として、複写機の光学系
(照明ユニットおよび反射ミラー)駆動用のDCサーボ
モータの制御回路に適用する場合を例にとって説明をす
る。
<Embodiment> An embodiment of the present invention will be described below, taking as an example a case where the present invention is applied to a control circuit of a DC servo motor for driving an optical system (illumination unit and reflection mirror) of a copying machine.

第1図は、複写機の光学系を駆動するためのDCサーボ
モータの制御回路の構成例を示すブロック図である。こ
の制御回路では、DCサーボモータへの印加電圧として
PWM(pulse width modulatio
n)信号が使用されている。
FIG. 1 is a block diagram showing an example of the configuration of a control circuit for a DC servo motor for driving an optical system of a copying machine. This control circuit uses PWM (pulse width modulation) as the voltage applied to the DC servo motor.
n) signals are used.

このDCサーボモーター0は永久磁石フィールド形であ
って、ドライバ部11によって回転駆動され、光学系1
7を移動させる。
This DC servo motor 0 is of a permanent magnet field type, and is rotationally driven by a driver section 11.
Move 7.

サーボモーター0の回転軸にはロータリエンコーダ12
が連結されている。ロータリエンコーダ12は、既に公
知の通り、サーボモーター0が予め定める微小角度回転
するごとに、速度検出パルスを出力するものである。こ
の実施例のロータリエンコーダ12からは、互いに周期
が等しくかっ位相が90度ずれたA相とB相の速度検出
パルス(速度検出信号)が出力され、サーボモーター0
が1回転することにより、各相、たとえば200個の速
度検出パルスが出力される。
Rotary encoder 12 is installed on the rotation axis of servo motor 0.
are connected. As already known, the rotary encoder 12 outputs a speed detection pulse every time the servo motor 0 rotates by a predetermined minute angle. The rotary encoder 12 of this embodiment outputs A-phase and B-phase speed detection pulses (speed detection signals) that have the same period and are 90 degrees out of phase with each other, and the servo motor 0
When the motor rotates once, each phase, for example, 200 speed detection pulses are output.

0−タリエンコーダ12から出力される速度検出パルス
は、エンコーダ信号入力部13へ与えられる。エンコー
ダ信号入力部13は、後に詳述するように、ロータリエ
ンコーダ12から与えられる速度検出パルスに基づいて
、サーボモータ10の回転速度を検出するための回路で
ある。エンコーダ信号入力部13の出力は制御部14へ
与えられる。
The speed detection pulse outputted from the 0-Tari encoder 12 is given to the encoder signal input section 13. The encoder signal input section 13 is a circuit for detecting the rotational speed of the servo motor 10 based on the speed detection pulse given from the rotary encoder 12, as will be described in detail later. The output of the encoder signal input section 13 is given to the control section 14.

制御部14は、CPU、プログラムなどを記憶するRO
M、必要なデータを記憶するRAMなどを備えており、
指令速度と検出速度との差の算出処理、速度検出信号と
速度指令信号との位相差の算出処理、サーボモータ10
を制御するためのPWMデータの算出処理などを行う。
The control unit 14 includes a CPU, an RO that stores programs, etc.
M, is equipped with RAM etc. to store necessary data,
Calculation process of difference between command speed and detected speed, calculation process of phase difference between speed detection signal and speed command signal, servo motor 10
Performs processing such as calculation of PWM data for controlling.

制御部14には、複写機本体の制御部(図示せず)から
、動作指令信号および速度指令信号(速度指令クロック
)が与えられる。
The control section 14 is given an operation command signal and a speed command signal (speed command clock) from a control section (not shown) of the main body of the copying machine.

制御部14は、各入力信号に基づいて演算処理を実行し
、PWMデータを算出してPWMユニット16へ与える
と共に、前述したドライバ部110 ヘドライバ部駆動信号を与える。
The control section 14 executes arithmetic processing based on each input signal, calculates PWM data, and provides it to the PWM unit 16, and also provides a driver section drive signal to the driver section 110 described above.

PWMユニット16は、制御部14から与えられるPW
Mデータに応じたパルス幅(出力デユーティ)のPWM
信号を発生するためのユニットである。PWMユニット
16から出力されるPWM信号によってサーボモータ1
0の回転速度が制御される。また、ドライバ部駆動信号
は、サーボモータ10の回転方向を決めたり、ブレーキ
ングしたりする。
The PWM unit 16 receives PW from the control unit 14.
PWM of pulse width (output duty) according to M data
This is a unit for generating signals. The servo motor 1 is activated by the PWM signal output from the PWM unit 16.
0 rotation speed is controlled. Further, the driver unit drive signal determines the rotation direction of the servo motor 10 and performs braking.

ところで、す=ボモータ10を所望の指令速度で回転さ
せるためには、前提として、サーボモタ10の回転速度
を正確に検出する必要がある。
By the way, in order to rotate the servo motor 10 at a desired command speed, it is necessary to accurately detect the rotation speed of the servo motor 10.

そこで、この制御回路では、エンコーダ信号入力部]3
の構成を第2図のようにし、かつ制御部14による信号
読出しを工夫して、正確な速度検出が行えるようにされ
ている。
Therefore, in this control circuit, the encoder signal input section]3
The configuration is as shown in FIG. 2, and the signal reading by the control section 14 is devised so that accurate speed detection can be performed.

第2図を参照して説明すると、エンコーダ信号入力部1
3は、ロータリエンコーダ12から送られてくるA相の
速度検出パルスの立上りを検出する立上り検出回路13
1、基準タロツクをアップ1 カウントするたとえば16ビツト構成のフリーランニン
グカウンタ]33および立上り検出回路]31の立上り
検出出力をキャプチャ信号とし、該キャプチャ信号をト
リガとしてフリーランニングカウンタ133のカウント
数を読取保持するキャプチャレジスタ]34を備えてい
る。
To explain with reference to FIG. 2, encoder signal input section 1
3 is a rise detection circuit 13 that detects the rise of the A-phase speed detection pulse sent from the rotary encoder 12;
1. For example, use a 16-bit free running counter [33] and rise detection circuit] 31 to count up the reference tally as a capture signal, and use the capture signal as a trigger to read and hold the count number of the free running counter 133. A capture register] 34 is provided.

基準クロックは、第1図に示す回路全体の動作タイミン
グの基準となる基準クロックであり、回路がマイクロコ
ンピュータで構成されている場合はマシンクロックが利
用される。また、そのような基準クロックがない場合、
基準クロック発生回路を設けてもよい。
The reference clock is a reference clock that serves as a reference for the operation timing of the entire circuit shown in FIG. 1, and when the circuit is composed of a microcomputer, a machine clock is used. Also, if there is no such reference clock,
A reference clock generation circuit may also be provided.

エンコーダ信号入力部13は、さらに、アップダウン検
出部135およびアップダウンカウンタ136を備えて
いる。アップダウン検出部135は、立上り検出回路1
31からA相の速度検出パルスの立上り検出出力が与え
られた時にB相の回転パルスのレベルを判断し、B相の
回転パルスがハイレベルかローレベルかによって、サー
ボモータ10(第1図)が正転しているか逆転している
2 かを判別するものである。アップダウンカウンタ136
は、アップダウン検出部135の判別出力に基づいて、
立上り検出回路131の検出出力をアップカウントまた
はダウンカウントするものである。
The encoder signal input section 13 further includes an up/down detection section 135 and an up/down counter 136. The up/down detection section 135 includes a rise detection circuit 1
When the rising detection output of the A-phase speed detection pulse is given from 31, the level of the B-phase rotation pulse is determined, and depending on whether the B-phase rotation pulse is high level or low level, the servo motor 10 (Fig. 1) This is to determine whether 2 is rotating in the forward direction or in the reverse direction. Up/down counter 136
is based on the discrimination output of the up-down detection section 135,
The detection output of the rising edge detection circuit 131 is counted up or down.

次に、第2図の回路の動作説明をする。Next, the operation of the circuit shown in FIG. 2 will be explained.

キャプチャレジスタ134の内容は、キャプチャ信号、
すなわちA相の速度検出パルスの立上りが検出されるご
とに更新されていく。また、アップダウンカウンタ13
6は、速度検出パルスの立上り検出回数、言い換えれば
速度検出パルス数をカウントする。
The contents of the capture register 134 include the capture signal,
That is, it is updated every time the rising edge of the A-phase speed detection pulse is detected. In addition, up/down counter 13
6 counts the number of times the rising edge of the speed detection pulse is detected, in other words, the number of speed detection pulses.

それゆえ、所定のサンプル時間Δτ内において、アップ
ダウンカウンタ136で、回転パルスがn個カウントさ
れ、その間にフリーランニングカウンタ133でカウン
トされる基準パルスのカウント数を計測すれば、それに
基づいて回転数Nを算出することかできる。
Therefore, within a predetermined sampling time Δτ, if the up/down counter 136 counts n rotation pulses, and during that time the free running counter 133 measures the number of reference pulses, the number of rotations will be calculated based on that. It is possible to calculate N.

つまり、サーボモータ10の回転数N[rpm]は、基
準クロックの周波数をf[Hz]、サーボ3 モータ]0が1回転することによりロータリエンコーダ
12から出力されるA相の回転パルス数をC[ppr]
、今回のキャプチャレジスタ131の内容をCPT、、
前回のキャプチャレジスタ]31の内容をCP T n
−1とすると、・・・ (1) で算出することができる。
In other words, the rotation speed N [rpm] of the servo motor 10 is the frequency of the reference clock f [Hz], and the number of A-phase rotation pulses output from the rotary encoder 12 when the servo 3 motor] 0 rotates once is C. [ppr]
, CPT the contents of the current capture register 131, .
CP T n of the contents of [previous capture register] 31
If it is set to -1, it can be calculated as follows (1).

ここで、式(1)は、基準クロック周波数fと回転パル
ス数Cとが定数であるから、 N =     n A     =悶 ・・・(2)
cp’rll−cp′T、、  X 但し、A:LX60 X : CPT、   CPTo−+ となる。
Here, in equation (1), since the reference clock frequency f and the number of rotational pulses C are constants, N = n A = agony (2)
cp'rll-cp'T,, X However, A: LX60 X: CPT, CPTo-+.

第3図は、制御部14によるモータ回転速度検出処理手
順を示し、第4図は、この処理に用いら4 れる2種類のメモリM1およびM2を示している。
FIG. 3 shows the motor rotational speed detection processing procedure by the control section 14, and FIG. 4 shows two types of memories M1 and M2 used in this processing.

第4図において、メモリM1は、5回分の回転数データ
を新しいものから順番に記憶するためのものであり、新
しい回転数データを記憶するためのエリアから古い回転
数データ記憶エリアに向って順に5つの記憶エリアE1
〜E5を有している。
In FIG. 4, the memory M1 is for storing rotational speed data for five times in order from the newest to the oldest rotational speed data storage area. 5 storage areas E1
~E5.

すなわち、Elに今回の回転数データN。が、E2に前
回の回転数データN、。−1)が、E3に2回前の回転
数データN、。−2,が、E4に3回前の回転数データ
N、。−9,が、E5に4回前の回転数データN、。−
4)が、それぞれ記憶される。
In other words, El is the current rotational speed data N. However, E2 contains the previous rotation speed data N. -1) is the rotation speed data N, two times before E3. -2, is the rotation speed data N, three times before E4. -9, is the rotation speed data N, 4 times before E5. −
4) are respectively stored.

メモリM2は、メモリM1に記憶された5つの回転数デ
ータN。−N(n−4+をソーティング、すなわち大き
さ順に並べ替えるためのもので、5つの記憶エリアEl
l〜E15を有している。メモリM1に記憶された5つ
の回転数データN0〜N、。−4)がソーティングされ
、メモリM2に記憶されると、たとえば、エリアE11
に5つの回転数データN、、〜NLn−4)のうち最大
のものが、エリアE12に2番目に大きいものが、エリ
アE135 に3番目に大きいものが、エリアE14に4番目に大き
いものが、エリアEllに最小のものが記憶される。従
って、エリアE13には、メモリM1に記憶された5つ
の回転数データのうち、大小中央に相当する回転数デー
タが記憶される。
Memory M2 contains five rotational speed data N stored in memory M1. -N(n-4+) for sorting, that is, arranging in order of size, five storage areas El
1 to E15. Five rotation speed data N0 to N stored in the memory M1. -4) is sorted and stored in memory M2, for example, area E11
The largest of the five rotational speed data N, ...NLn-4) is in area E12, the third largest is in area E135, and the fourth largest is in area E14. , the smallest one is stored in area Ell. Therefore, the area E13 stores rotation speed data corresponding to the center of the five rotation speed data stored in the memory M1.

第3図に戻って、モータ回転速度検出処理は、サンプル
時間Δtごとに行われる。
Returning to FIG. 3, the motor rotation speed detection process is performed every sample time Δt.

サンプル時間Δtは、 Δt≧X=CPTfi CPTll−+・・・(3)を
満足する適当な時間が設定されている。
The sampling time Δt is set to an appropriate time that satisfies the following equation: Δt≧X=CPTfi CPTll−+ (3).

次に、第1図〜第4図を参照して説明をする。Next, explanation will be given with reference to FIGS. 1 to 4.

制御部14では、内部タイマが一定のサンプル時間Δt
に達するごとに(ステップS1)、タイマがリセットさ
れ(ステップS2)、キャプチャレジスタ134および
アップダウンカウンタ136の内容が読出される(ステ
ップS3)。
In the control unit 14, an internal timer keeps a constant sampling time Δt.
Each time the timer reaches (step S1), the timer is reset (step S2), and the contents of the capture register 134 and up/down counter 136 are read (step S3).

そして、今回読出されたキャプチャレジスタ134のカ
ウント数CPT、から、すてに記憶されている前回読出
されたキャプチャレジスタ134のカウント数CPT、
、−+を減じることにより、16 サンプル時間Δを内の基準クロック数Xが求められた後
、CPT、が記憶される(ステップS4)。
Then, from the count number CPT of the capture register 134 read this time, the count number CPT of the capture register 134 read last time that has been stored,
, -+, the number of reference clocks X within 16 sample times Δ is determined, and then CPT is stored (step S4).

また、今回読出されたアップダウンカウンタ136のカ
ウント数UDCfiから、すでに記憶されている前回読
出されたアップダウンカウンタ136のカウント数U 
D Cn−1を減じることにより、1サンプル時間Δを
内の回転パルス数nが求められた後、UDC,が記憶さ
れる(ステップS5)。
In addition, from the count number UDCfi of the up-down counter 136 read this time, the count number U of the up-down counter 136 that has already been read last time is calculated.
After the number n of rotational pulses within one sample time Δ is determined by subtracting D Cn-1, UDC is stored (step S5).

その後、上述した式(2)に基づいて、サーボモータの
回転数N、(今回の回転数データN。)が算出される(
ステップS6)。
After that, the rotation speed N of the servo motor (current rotation speed data N) is calculated based on the above-mentioned formula (2).
Step S6).

回転数データNnが算出されると、前回の回転数データ
N+n−++が誤ったデータと判定されていたか否かが
確認される。この確認は、フラグFがセット状態(F=
1)になっているか否かが調べられることによって行わ
れる(ステップS7)。
When the rotation speed data Nn is calculated, it is checked whether the previous rotation speed data N+n-++ was determined to be incorrect data. This confirmation is performed when flag F is set (F=
1) is checked (step S7).

フラグFは、後に明らかになるように、前回の回転数デ
ータN、。−1)が誤ったデータと判定された場合にセ
ット状態(F=1)にされ、前回の回転数データN。−
1)が誤ったデータと判定されない場合には、リセット
状態(F−0)、にされている。
As will become clear later, the flag F is the previous rotation speed data N. -1) is determined to be incorrect data, it is set to the set state (F=1), and the previous rotation speed data N. −
1) is not determined to be incorrect data, it is set to a reset state (F-0).

そして、F=Oの場合、すなわち前回の回転数データN
。−1)か誤データと判定されていない場合には、メモ
リM1にすでに記憶されている5つの回転数データN。
In the case of F=O, that is, the previous rotation speed data N
. -1) If the data is not determined to be incorrect, the five rotational speed data N already stored in the memory M1.

−N +n−41がシフトされる(ステップS8)。こ
の結果、それまでの回転数データN。がN(、、−1+
としてエリアE2に、回転数データN(II−11がN
、。−2,としてエリアE3に、回転数データN。−2
,がNLn−31としてエリアE4に、回転数データN
い−3,がN、。−4,としてエリアE5に記憶され、
最古データであるそれまでの回転数データNLfi−4
,は記憶されなくなる。
-N +n-41 is shifted (step S8). As a result, the rotation speed data up to that point is N. is N(,,-1+
As a result, rotation speed data N (II-11 is N
,. -2, and rotation speed data N in area E3. -2
, is placed in area E4 as NLn-31, and rotation speed data N
I-3, is N. -4, is stored in area E5,
The oldest data is the rotation speed data NLfi-4
, will no longer be remembered.

そして、今回算出された回転数データN、、がメモリM
1のエリアE1に記憶される(ステップS9)。
The rotation speed data N, which was calculated this time, is stored in the memory M.
1 area E1 (step S9).

一方、ステップS7において、F−1の場合、すなわち
前回の回転数データN。−1,が誤データと判定されて
いた場合には、メモリM1に既に記憶されている5つの
回転数データN n −N (n −4)7 8 がシフトされることなく、処理はステップs9へ移り、
今回算出された回転数データN。がメモリM1のエリア
E1に記憶される(ステップS9)。
On the other hand, in step S7, in the case of F-1, that is, the previous rotation speed data N. -1, is determined to be incorrect data, the process continues at step s9 without shifting the five rotational speed data N n -N (n -4)7 8 already stored in the memory M1. Move on to
Rotation speed data N calculated this time. is stored in area E1 of memory M1 (step S9).

この結果、今回の回転数データNnが前回の回転数デー
タN。に代わってエリアE1に記憶されることになる。
As a result, the current rotation speed data Nn is the previous rotation speed data N. Instead, it will be stored in area E1.

なお、エリアE2〜E5に記憶されているデータN。−
1)〜Nun−111は、そのまま保持される。
Note that data N is stored in areas E2 to E5. −
1) to Nun-111 are retained as they are.

つまり、前回算出された誤データがメモリM1がら排除
され、代わりに今回算出された回転数データN、、がメ
モリM1に記憶される。
That is, the previously calculated erroneous data is removed from the memory M1, and the currently calculated rotational speed data N, . . . is stored in the memory M1 instead.

この処理を行うことにより、次のような利点がある。す
なわち、ノイズ等の影響によって、算出されたデータが
、実際のモータ回転数とは大きく異なる誤データである
場合、この誤データをメモリMl内で順にシフトさせる
と、メモリM1内に存在する信頼すべきデータ数が実質
的に減少することになり、データの信頼性が下がる。よ
り具体的には、後述するようにメモリM1に記憶されて
いる5つのデータをソーティングする場合に、誤9 データは必ず端に来る(誤データは極端に大きいか、ま
たは小さいので)ので、結局、誤データを除いたデータ
の中の中央データを取出すことになって、データの信頼
性が下がるのである。特に、連続して誤データが算出さ
れた場合には、誤データがモータ制御に用いるべき現在
の回転数データとして取出されてしまうこともあり、か
かる場合には激しい駆動むらが生じる。
By performing this processing, there are the following advantages. In other words, if the calculated data is erroneous data that differs significantly from the actual motor rotation speed due to the influence of noise, etc., if this erroneous data is sequentially shifted in the memory M1, the reliable data existing in the memory M1 will be This results in a substantial reduction in the number of data to be used, and the reliability of the data decreases. More specifically, when sorting the five data stored in the memory M1 as described later, the false 9 data always comes at the end (because the false data is extremely large or small), so in the end , the reliability of the data decreases because the central data is extracted from the data after removing erroneous data. In particular, if incorrect data is calculated continuously, the incorrect data may be taken out as the current rotational speed data to be used for motor control, and in such a case, severe drive unevenness will occur.

上述の制御によれば、誤データが算出された場合、その
誤データは今回算出された回転数データNゎで置換され
るため、上記不具合が生じることはない。よって、この
実施例に係る制御によれば、後述する中央データNmの
信頼性が高くなると共に、連続して誤った回転数データ
が算出された場合でも、該誤った回転数データが中央デ
ータN。
According to the above-described control, if erroneous data is calculated, the erroneous data is replaced with the currently calculated rotational speed data Nゎ, so the above-mentioned problem does not occur. Therefore, according to the control according to this embodiment, the reliability of the central data Nm, which will be described later, becomes high, and even if incorrect rotational speed data is calculated continuously, the incorrect rotational speed data becomes the central data Nm. .

とじて確定されるのを防止できる。It is possible to prevent it from being closed and confirmed.

次に、メモリM1に記憶されている5つの回転数データ
N、、〜N(II−41が、ソーティングされ、メモリ
M2に記憶される(ステップ510)。この結果、メモ
リM2のエリアEll〜E15には、0 5つの回転数データN。−N(。−4)が、大きい順に
記憶される。この場合、エリアE13には、5つの回転
数データN0〜NIn−4)のうち大小中央に相当する
回転数データ(中央データN□)が記憶される。
Next, the five rotational speed data N, ... ~N (II-41) stored in the memory M1 are sorted and stored in the memory M2 (step 510). 0 to 5 rotation speed data N.-N (.-4) are stored in order of increasing size.In this case, area E13 stores the five rotation speed data N.-N(.-4) in the center of the size among the five rotation speed data N0 to NIn-4). Corresponding rotation speed data (central data N□) is stored.

このメモリM2のエリアE13に記憶されている中央デ
ータN□は、今回および過去4回分の5つの回転数デー
タのうちの、大小中央に相当する回転数データである。
The center data N□ stored in the area E13 of the memory M2 is the rotation speed data corresponding to the center of the magnitude of the five rotation speed data for the current time and the past four times.

よって、この回転数データNff1を現在の回転数Nと
して制御に用いれば、ノイズなどによって速度検出信号
が変動し、誤った回転数データN、、がステップS6で
算出された場合でも、その誤った回転数データNIlを
除去できる。
Therefore, if this rotational speed data Nff1 is used for control as the current rotational speed N, even if the speed detection signal fluctuates due to noise or the like and incorrect rotational speed data N, . The rotation speed data NIl can be removed.

しかしながら、この方法だけでは、ノイズ等による突発
的な変動に基づく誤検出は防止できるが、モータ回転速
度が、長期的に、一方向に変化している場合(たとえば
回転速度が上昇している場合)等においては、次のよう
な問題がある。
However, this method alone can prevent false detections due to sudden fluctuations due to noise, etc. However, if the motor rotation speed is changing in one direction over a long period of time (for example, if the rotation speed is increasing) ) etc., there are the following problems.

たとえば、モータ回転速度が、第10図に示す1 ように指令速度N。に向かって上昇している場合、現時
点t。で、メモリM1には、時点1n〜時点j Ln−
41の5回分の回転数データN、 〜NLn−4+が記
憶されている。
For example, if the motor rotational speed is 1 as shown in FIG. 10, the commanded speed N. If it is rising towards the current time t. Then, the memory M1 stores data from time 1n to time j Ln-
41 rotation speed data N, ~NLn-4+ for five times are stored.

そうすると、これらのデータのうち大小中央に相当する
データN、。−2,は、最新データN。よりも必ず小さ
い値であるため、実際のモータ回転速度がほぼ指令速度
N。に達しても、現在の回転速度は指令速度N。より低
いと判断され、モータ回転速度がさらに上昇するように
制御されてしまう。
Then, among these data, data N corresponds to the center of the size. -2, is the latest data N. Since the value is always smaller than N, the actual motor rotation speed is almost the command speed N. Even if the current rotational speed reaches the commanded speed N. It is determined that the motor rotation speed is lower, and the motor rotation speed is controlled to further increase.

この結果、モータ回転速度は指令速度N。より大きくな
ってしまう。すると今度は、速度が下降するように制御
されるが、この場合にも、実際のモータ回転速度がほぼ
指令速度N。に達しても、現在の回転速度は指令速度N
。よりも高いと判断され、モータ回転速度がさらに下降
するように制御されてしまう。
As a result, the motor rotation speed is the command speed N. It becomes bigger. Then, the speed is controlled to decrease, but in this case as well, the actual motor rotational speed is approximately the commanded speed N. Even if the current rotation speed reaches the command speed N
. It is determined that the motor rotation speed is higher than that, and the motor rotation speed is controlled to further decrease.

従って、モータ回転速度は、第11図に示すように、指
令速度N。を中心としたうねり(ハンチング)を生じて
しまう。
Therefore, the motor rotation speed is the command speed N, as shown in FIG. This results in undulations (hunting) centered around .

2 そこで、この実施例では、このようなハンチング現象を
防止するため、以下のステップ811〜313の制御が
行われる。
2. Therefore, in this embodiment, in order to prevent such a hunting phenomenon, the following steps 811 to 313 are controlled.

メモリM1のエリアE1に記憶されている今回の回転数
データNnは、メモリM2のエリアE13に記憶されて
いる中央データN□に対して一定範囲内か否かが判別さ
れる(ステップ511)。
It is determined whether the current rotational speed data Nn stored in area E1 of memory M1 is within a certain range with respect to central data N□ stored in area E13 of memory M2 (step 511).

つまり、最新回転数データN。が次式で示される範囲内
に入っているか否かが判別される。
In other words, the latest rotation speed data N. It is determined whether or not is within the range shown by the following formula.

Nm (1−p)≦N、≦N、(1+q)・・・(4) 但し、pおよびqは、モータ回転速度を変化させる場合
におけるモータの追従特性等を考慮して決められた値で
ある。
Nm (1-p)≦N,≦N, (1+q)...(4) However, p and q are values determined in consideration of the following characteristics of the motor when changing the motor rotation speed. be.

最新回転数データN0が式(4)で示される範囲内に入
っていない場合には(ステップS11でNo)、ノイズ
等の影響により、今回の回転数データN、、が正確なも
のではないと判断され、メモリM2のエリアE13に記
憶されている中央データN、が現在のモータ回転数Nと
して取出され、3 たとえばバッファに記憶され、制御に使用される。
If the latest rotation speed data N0 is not within the range shown by equation (4) (No in step S11), it is determined that the current rotation speed data N, is not accurate due to the influence of noise etc. The central data N, determined and stored in area E13 of memory M2, is taken out as the current motor rotation speed N, stored in a buffer, for example, and used for control.

また、フラグFがセット(F=1)される(ステップ5
12)。このため、ノイズ等によって速度検出信号が突
然大きく変動しても、それは回転数Nとして制御に利用
されないので、ノイズ等による誤った制御動作を防止で
きる。
Also, flag F is set (F=1) (step 5
12). Therefore, even if the speed detection signal suddenly fluctuates greatly due to noise or the like, it is not used as the rotational speed N for control, so that erroneous control operations due to noise or the like can be prevented.

また、最新回転数データN。が式(4)で示される範囲
内に入っている場合には(ステ・ツブS11でYES)
、最新回転数データN。は、ノイズ等の影響を受けたも
のではないと判断され、メモリM1のエリアE1に記憶
されている最新回転数データN、が現在のモータ回転数
Nとして取出され、たとえばバッファに記憶され、制御
に使用される。また、フラグFがリセット(F−0)さ
れル(ステップ813)。このため、第10図に示すよ
うに、モータ回転速度が長期的に一方向に変化している
場合においても、正確な速度データが得られ、ハンチン
グ現象が生じるのを防止できる。
Also, the latest rotation speed data N. is within the range shown by formula (4) (YES in step S11)
, latest rotation speed data N. is determined not to have been affected by noise etc., and the latest rotation speed data N stored in area E1 of memory M1 is taken out as the current motor rotation speed N, stored in a buffer, for example, and controlled. used for. Further, flag F is reset (F-0) (step 813). Therefore, as shown in FIG. 10, even when the motor rotational speed changes in one direction over a long period of time, accurate speed data can be obtained and the hunting phenomenon can be prevented from occurring.

なお、速度検出パルスが出力されるごとに、キャプチャ
レジスタ134のカウント数CPT、、を4 読みだし、前回のカウント数CPT−+を減じて、最新
の速度検出パルスの周期を算出し、この周期に基づいて
回転数データNイを求めるようにしても良い。
In addition, each time a speed detection pulse is output, the count number CPT, . The rotation speed data N may be obtained based on the following.

次に、速度指令信号入力部15について詳しく説明をす
る。
Next, the speed command signal input section 15 will be explained in detail.

第5図は、速度指令信号入力部15の具体的な構成例を
示すブロック図である。速度指令信号入力部15には、
速度指令クロックの立上りを検出するための立上り検出
回路151、基準クロックをアップカウントするフリー
ランニングカウンタ152、立上り検出回路151の立
上り検出出力をキャプチャ信号とし、該キャプチャ信号
をトリガとしてフリーランニングカウンタ152のカウ
ント数を読取保持するキャプチャレジスタ153および
、立上り検出回路151の出力パルスをアップカウント
するためのアップカウンタ154を備えている。
FIG. 5 is a block diagram showing a specific example of the configuration of the speed command signal input section 15. As shown in FIG. In the speed command signal input section 15,
A rise detection circuit 151 for detecting the rise of the speed command clock, a free running counter 152 for up-counting the reference clock, and a rise detection output of the rise detection circuit 151 are used as a capture signal, and the capture signal is used as a trigger to control the free running counter 152. It includes a capture register 153 that reads and holds a count number, and an up counter 154 that counts up the output pulse of the rising edge detection circuit 151.

フリーランニングカウンタ152は、たとえば16ビツ
ト構成のカウンタである。このフリーラ5 ンニングカウンタ152は、前述したエンコーダ信号入
力部13のフリーランニングカウンタ133と共用して
もよい。
Free running counter 152 is, for example, a 16-bit counter. This free running counter 152 may be used in common with the free running counter 133 of the encoder signal input section 13 described above.

この回路の動作は、次の通りである。The operation of this circuit is as follows.

装置本体側、たとえば複写機本体の制御側マイクロコン
ピュータから出力される速度指令クロックは立上り検出
回路151へ与えられ、立上りが検出される。立上り検
出回路151の出力はキャプチャ信号としてフリーラン
ニングカウンタ152へ与えられるので、キャプチャレ
ジスタ153の内容は、速度指令クロックの立上りに応
答して更新されて行く。よって、ある立上り検出信号に
基づいてキャプチャレジスタ153の内容を読出し、次
の立上り検出信号に基づいてキャプチャレジスタ153
の内容を読出して、その差を求めれば、速度指令クロッ
ク1周期におけるフリーランニングカウンタ152のカ
ウント数を計測することができる。つまり、指令速度で
ある回転数N。
A speed command clock outputted from a control side microcomputer on the apparatus main body side, for example, a copying machine main body, is applied to a rising edge detection circuit 151, and a rising edge is detected. Since the output of the rising edge detection circuit 151 is given to the free running counter 152 as a capture signal, the contents of the capture register 153 are updated in response to the rising edge of the speed command clock. Therefore, the contents of the capture register 153 are read based on a certain rising detection signal, and the contents of the capture register 153 are read based on the next rising detection signal.
By reading out the contents of and finding the difference between them, it is possible to measure the count number of the free running counter 152 in one cycle of the speed command clock. In other words, the rotation speed N is the command speed.

を得ることができる。can be obtained.

なおこの実施例では、キャプチャレジスタ156 3の内容が更新されるごとに、更新後のカウント数と更
新前のカウント数との差のカウント数を求めるというや
り方ではなく、より検出精度を向上させるために、エン
コーダ信号入力部13におけるキャプチャレジスタ15
3のカウント数読出しと同様の読出方法がとられている
Note that in this embodiment, each time the contents of the capture register 1563 are updated, the difference between the counted number after updating and the counted number before updating is not calculated, but in order to further improve detection accuracy. , the capture register 15 in the encoder signal input section 13
A reading method similar to the count reading in step 3 is used.

すなわち、制御部14は、所定のサンプル時間Δtごと
にキャプチャレジスタ153の内容およびアップカウン
タ154の内容を読出し、キャプチャレジスタ153に
おける今回読出したカウント数と前回読出したカウント
数との差を求め、その差を、アップカウンタにおける今
回読出したカウント数から前回読出したカウント数との
差で除算することで、速度指令クロック1周期内におけ
るより正確な基準クロック数を求めるようにしている。
That is, the control unit 14 reads the contents of the capture register 153 and the contents of the up counter 154 at every predetermined sampling time Δt, calculates the difference between the count number read this time and the count number read last time in the capture register 153, and calculates the difference between the count number read this time and the count number read last time in the capture register 153. By dividing the difference by the difference between the count number read this time and the count number read last time in the up counter, a more accurate reference clock number within one cycle of the speed command clock is obtained.

第6図は、制御部14による速度指令クロックと速度検
出パルスとの位相差算出処理手順を示している。
FIG. 6 shows a procedure for calculating the phase difference between the speed command clock and the speed detection pulse by the control unit 14.

まず、エンコーダ信号入力部13の立上り検出7 回路131によって速度検出パルスの立上りが検出され
ると(ステップ521)、フリーランニングカウンタ1
33のカウント値か読込まれ、その値が位相比較値PD
T、として記憶される(ステップ522)。フリーラン
ニングカウンタ133は、モータ制御開始時から基準ク
ロックのカウントを開始しているので、位相比較値PD
Toの値は、モータ制御開始時から今回のパルス立上り
検出時点までの時間に応じた値となる。
First, when the rising edge of the speed detection pulse is detected by the rising edge detection circuit 131 of the encoder signal input section 13 (step 521), the free running counter 1
33 count value is read, and that value is the phase comparison value PD.
T, (step 522). Since the free running counter 133 starts counting the reference clock from the start of motor control, the phase comparison value PD
The value of To is a value corresponding to the time from the start of motor control to the current pulse rise detection time.

次に、位相基準値PPI。が、次式により計算されかつ
記憶される(ステップ823)。
Next, the phase reference value PPI. is calculated and stored according to the following equation (step 823).

PPll1=PPI、、−1)+SPD   −(5)
ここで、 P P I (、−1)  :前回記憶された位相基準
値SPD    :速度指令クロック1周期間の基準ク
ロック数(SPDは固定値 である。) である。
PPll1=PPI,,-1)+SPD-(5)
Here, P P I (, -1): Previously stored phase reference value SPD: Number of reference clocks during one period of speed command clock (SPD is a fixed value).

ただし、PPII。−1)の初期値は、零であるため、
上記ステップS21で、モータ制御開始後節8 1回目の速度検出パルスの立上りが検出されたときに対
応する位相基準値PPI、の値は、SPDとなる。
However, PPII. The initial value of -1) is zero, so
In step S21, the value of the phase reference value PPI corresponding to when the first rising edge of the speed detection pulse is detected in section 8 after the start of motor control becomes SPD.

この後、位相差PHDTが次式により算出されかつ記憶
される(ステップ524)。
Thereafter, the phase difference PHDT is calculated using the following equation and stored (step 524).

SPD そして、以上の処理が繰返される。すなわち、速度検出
パルスの立上りが検出されるごとに(ステップ521)
、フリーランニングカウンタ133のカウント値の読込
みおよび位相比較値PDT。の更新(ステップ522)
、位相基準値PPI。の計算および更新(ステップ82
3)ならびに位相差PHDTの算出(ステップ524)
が繰返し行われる。
SPD Then, the above processing is repeated. That is, every time the rising edge of the speed detection pulse is detected (step 521)
, reading the count value of the free running counter 133 and the phase comparison value PDT. update (step 522)
, phase reference value PPI. calculation and update (step 82
3) and calculation of phase difference PHDT (step 524)
is repeated.

モータ制御開始後、ステップS21で、第2回目の速度
検出パルスの立上りが検出されたときには、ステップ8
23で算出される位相基準値PP工。の値は2SPDと
なり、第3回目の速度検出パルスの立上りが検出された
ときには3SPDと9 なる。つまり、ステップ823で算出される位相基準値
PPI、の値は、モータ制御開始時から今回の速度検出
パルス立上り時点までの間に出力された速度検出パルス
総数とSPDとの積値になる。
After the start of motor control, when the second rise of the speed detection pulse is detected in step S21, step 8
Phase reference value PP calculated in 23. The value becomes 2SPD, and when the third rising edge of the speed detection pulse is detected, it becomes 3SPD and 9. In other words, the value of the phase reference value PPI calculated in step 823 is the product of SPD and the total number of speed detection pulses output from the start of motor control to the current rise of the speed detection pulse.

SPDは、速度指令クロックの周期に応じた固定値であ
るから、ステップ323で算出される位相基準値PPI
、は、モータ制御開始時から今回立上りが検出された速
度検出パルスに対応する速度指令クロックの立上がり時
点までの時間に応じた値となる。
Since SPD is a fixed value depending on the period of the speed command clock, the phase reference value PPI calculated in step 323
, is a value corresponding to the time from the start of motor control to the time of the rise of the speed command clock corresponding to the speed detection pulse whose rise was detected this time.

そして、モータ制御開始時から今回の速度検出パルスの
立上り検出時点までの時間に応じた値(位相比較値PD
T、)と、モータ制御開始時から今回立上りが検出され
た速度検出パルスに対応する速度指令クロックの立上が
り時点までの時間に応じた値(位相基準値PP1.)と
の差を、速度指令クロックの周期に応じた値(SPD)
で除することにより、位相差PHDTが求められている
。よって、速度指令クロックと速度検出パルスとの位相
差が、速度指令クロックの1周期以上で0 ある場合でも、その位相差PHDTが正確に検出される
Then, a value (phase comparison value PD
T, ) and the value (phase reference value PP1.) corresponding to the time from the start of motor control to the time of the rise of the speed command clock corresponding to the speed detection pulse whose rise was detected this time is calculated as the speed command clock. Value according to the period of (SPD)
The phase difference PHDT is obtained by dividing by . Therefore, even if the phase difference between the speed command clock and the speed detection pulse is 0 for one cycle or more of the speed command clock, the phase difference PHDT is accurately detected.

次に、制御部14から出力されるPWMデータの算出方
法について説明する。
Next, a method for calculating PWM data output from the control unit 14 will be explained.

サーボモータ10の回転速度Nを指令速度N。The rotation speed N of the servo motor 10 is the command speed N.

に追従させるためにサーボモータ10に出力すべき電圧
vOは、速度差ΔN (=No−N)による制御電圧を
Vl、位相差PHDTによる制御電圧をv2とすると、
次式で表される。
The voltage vO that should be output to the servo motor 10 to make it follow
It is expressed by the following formula.

VO=V1+V2         −(7)つまり、
この実施例では、速度差ΔN (=N。
VO=V1+V2-(7) That is,
In this example, the speed difference ΔN (=N.

N)による制御電圧V1を、位相差PHDTによる制御
電圧■2で補正している。この理由は、速度差ΔNによ
る比例制御だけでは、実際の検出速度から目標速度まで
モータ速度を増加させる場合の加速度が、目標速度の大
小によって変わり、目標速度が大きい程加速度が小さく
、目標速度に達するまでの時間が長くなり、追従性が良
くないからである。
The control voltage V1 based on the phase difference PHDT is corrected by the control voltage V1 based on the phase difference PHDT. The reason for this is that with only proportional control based on the speed difference ΔN, the acceleration when increasing the motor speed from the actual detected speed to the target speed changes depending on the size of the target speed. This is because it takes a long time to reach the target position and the followability is not good.

そこで、追従性をよくするため、この実施例で1 は、速度差ΔN (””No−N)による制御電圧V1
を、位相差PHDTによる制御電圧V2て補正している
のである。
Therefore, in order to improve followability, in this embodiment, 1 is the control voltage V1 due to the speed difference ΔN (""No-N).
is corrected using the control voltage V2 based on the phase difference PHDT.

位相差PHDTによる制御電圧v2は、予め定められた
制御電圧v2の最大値をαとすると、たとえば次のよう
にして求められる。
The control voltage v2 due to the phase difference PHDT is obtained, for example, as follows, assuming that the predetermined maximum value of the control voltage v2 is α.

(a)位相差が1周期より小さい場合 (−1<PHDT<+1) V2−α・PHDT         ・・・(8)(
b)位相差が1周期以上でありかつ速度検出信号の位相
が速度指令信号の位相より進んでいる場合 (PHDT≦−1) V2−−α            ・・・(9)(C
)位相差が1周期以上でありかつ速度検出信号の位相が
速度指令信号の位相より遅れている場合 (PHDT≧+1) V2−+α           ・・・(10)従っ
て、位相差PHDTと、制御電圧v2との2 関係は、第7図に示される関係になる。
(a) When the phase difference is smaller than one cycle (-1<PHDT<+1) V2-α・PHDT...(8)(
b) When the phase difference is one cycle or more and the phase of the speed detection signal is ahead of the phase of the speed command signal (PHDT≦-1) V2--α ... (9) (C
) When the phase difference is one cycle or more and the phase of the speed detection signal lags the phase of the speed command signal (PHDT≧+1) V2-+α (10) Therefore, the phase difference PHDT and the control voltage v2 The relationship between 2 and 2 is shown in FIG.

なお、速度差ΔNによる制御電圧■1は、次式%式% ) (11) Ra:アマチュア抵抗[Ω] KT:トルク定数[kgmハ] Ke:誘起電圧定数[V/rpmコ ■o:無負荷電流[A] GD2 :負荷とモータによる慣性モーメント[kg 
m2] TBIじ摺動負荷[kgml である。
In addition, the control voltage ■1 due to the speed difference ΔN is calculated using the following formula (%) (11) Ra: amateur resistance [Ω] KT: torque constant [kgm] Ke: induced voltage constant [V/rpm ■o: nothing Load current [A] GD2: Moment of inertia due to load and motor [kg
m2] TBI and sliding load [kgml].

制御部14は、サーボモータ10の回転速度Nを検出し
く第3図のステップS6)、指令速度N3 ゜との速度差ΔNを算出するごとに、または位相差PH
DTを算出(第6図のステップ524)するごとに、上
記式(7)〜(11)に基づいて、vOを算出して、こ
れに応じたPWMデータを出力する。このPWMデータ
は、PWMユニット16に送られ、ドライバ部11を介
して、サーボモータ10が制御される。
The control unit 14 detects the rotational speed N of the servo motor 10 (step S6 in FIG.
Each time DT is calculated (step 524 in FIG. 6), vO is calculated based on the above equations (7) to (11), and PWM data corresponding to this is output. This PWM data is sent to the PWM unit 16, and the servo motor 10 is controlled via the driver section 11.

第8図は、PWMユニット16の具体的な構成例を示す
ブロック図であり、第9図はPWMユニット16の動作
を説明するためのタイミングチャートである。
FIG. 8 is a block diagram showing a specific example of the configuration of the PWM unit 16, and FIG. 9 is a timing chart for explaining the operation of the PWM unit 16.

PWMユニット16には、セット信号発生部]61と、
PWMデータレジスタ162と、ダウンカウンタ163
とRSフリップフロップ164とが備えられている。
The PWM unit 16 includes a set signal generating section] 61,
PWM data register 162 and down counter 163
and an RS flip-flop 164.

セット信号発生部161は、一定の周期ごとにセット信
号を発生するものである。このセット信号発生部16]
はたとえばリングカウンタで構成されており、一定数の
基準クロックを計数するごとにセット信号を発生するよ
うにされている。
The set signal generator 161 generates a set signal at regular intervals. This set signal generating section 16]
is composed of, for example, a ring counter, and is configured to generate a set signal every time a certain number of reference clocks are counted.

4 PWMデータレジスタ162は、制御部14から与えら
れるPWMデータを保持するためのものである。制御部
14から与えられるPWMデータとは、前述した式(7
)によって求められた電圧データである。すなわち、式
(11)の電圧v1を位相差データPHDTによる制御
電圧v2で補正した電圧vOである。このPWMデータ
は、PWMユニット16から出力されるPWM出力信号
のデユーティを決めるのに用いられる。
4. The PWM data register 162 is for holding PWM data given from the control section 14. The PWM data given from the control unit 14 is expressed by the above-mentioned formula (7
) is the voltage data determined by That is, it is the voltage vO obtained by correcting the voltage v1 of equation (11) with the control voltage v2 based on the phase difference data PHDT. This PWM data is used to determine the duty of the PWM output signal output from the PWM unit 16.

ダウンカウンタ163は、PWM基準クロック(この実
施例では、PWM基準クロックは、エンコーダ信号入力
部13や速度指令信号入力部15で用いられる基準クロ
ックが共用されている。)が与えられごとにダウンカウ
ントをし、設定された数を計測するとリセット信号を出
力するものである。
The down counter 163 counts down every time a PWM reference clock (in this embodiment, the PWM reference clock is a reference clock used in the encoder signal input section 13 and the speed command signal input section 15) is provided. When the set number is counted, a reset signal is output.

PWMユニット16の動作は次のようになる。The operation of the PWM unit 16 is as follows.

セット信号発生部161からセット信号が出力されると
、PWMデータレジスタ162の内容、つまり制御部1
4から与えられたPWMデータが、5 ダウンカウンタ163にセットされ、また、セット信号
によってフリップフロップ164がセットされる。従っ
て、フリップフロップ164の出力、つまりPWM信号
はハイレベルとなる。
When the set signal is output from the set signal generating section 161, the contents of the PWM data register 162, that is, the control section 1
The PWM data given from 4 is set in the 5 down counter 163, and the flip-flop 164 is set by the set signal. Therefore, the output of the flip-flop 164, that is, the PWM signal becomes high level.

次に、ダウンカウンタ163はPWM基準クロックに基
づいてダウンカウントを行い、設定されたカウント値が
「0」になると、フリップフロップ164ヘリセツト信
号を与える。よって、フリップフロップ164の出力は
ローレベルに反転する。
Next, the down counter 163 counts down based on the PWM reference clock, and when the set count value reaches "0", a heliset signal is given to the flip-flop 164. Therefore, the output of flip-flop 164 is inverted to low level.

この結果、PWMユニット16からは、PWMデータレ
ジスタ162で保持された値、つまり式(7)で算出さ
れた電圧データでデユーティが決められ、PWM信号が
導出される。
As a result, the duty is determined by the value held in the PWM data register 162, that is, the voltage data calculated by equation (7), and a PWM signal is derived from the PWM unit 16.

この発明は、複写機の光学系制御用に限らず、ファクシ
ミリ装置の読取装置制御用モータ、ロボットの動作制御
用モータや、その他の一般的なモータ制御回路に採用で
きる。
The present invention is applicable not only to the optical system control of a copying machine, but also to a motor for controlling a reading device of a facsimile machine, a motor for controlling the operation of a robot, and other general motor control circuits.

また、この発明は、PWM信号以外で印加電圧を算出す
る場合にも適用できる。
Further, the present invention can be applied to the case where the applied voltage is calculated using other than PWM signals.

6 〈発明の効果〉 この発明は、以上のように構成されているので、ノイズ
等によって、−時的に速度検出信号が変動しても、その
変動の影響を受けることなく、正確な速度を得ることが
でき、良好なモータ制御が可能である。
6 <Effects of the Invention> Since the present invention is configured as described above, even if the speed detection signal fluctuates over time due to noise etc., it is possible to accurately determine the speed without being affected by the fluctuation. good motor control is possible.

また、この発明によれば、長期的に、モータ回転速度が
一方向に変化している場合においても良好なモータ制御
が行える。
Further, according to the present invention, good motor control can be performed even when the motor rotational speed changes in one direction over a long period of time.

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

第1図は、この発明の実施例が適用された光学系駆動用
DCサーボモータの駆動制御回路の電気的構成を示すブ
ロック図である。 第2図は、この発明の実施例に係るエンコーダ入力部の
電気的構成を示す回路ブロック図である。 第3図は、この発明の実施例における回転速度検出処理
手順を表わすフローチャートである。 第4図は、この発明の実施例における回転速度検出処理
に用いられる2つのメモリM1およびM2を示す図であ
る。 7 第5図は、速度指令信号入力部の電気的構成を示すブロ
ック図である。 第6図は、この発明の実施例における位相差検出処理手
順を表わすフローチャートである。 第7図は、位相差PHDTと位相差に基づく制御電圧v
2との関係を表わすグラフである。 第8図は、PWMユニットの具体的な電気的構成を示す
ブロック図である。 第9図は、pWMユニットの動作を表わすタイミングチ
ャートである。 第10図は、この実施例によって解決されている課題の
1つを説明するための図であって、長期的に、モータ回
転速度が一方向に変化している場合のモータ検出信号の
内容を示す図である。 第11図は、ハンチング現象を説明するための図である
。 図において、10・・・DCサーボモータ、11・・・
ドライバ部、12・・・ロークリエンコーダ、13・・
・エンコーダ信号入力部、14・・・制御部、15・・
・速度指令信号入力部、16・・・PWMユニット、M
l、8 M2・・・メモリ、 を示す。 (ほか2名)
FIG. 1 is a block diagram showing the electrical configuration of a drive control circuit for an optical system drive DC servo motor to which an embodiment of the present invention is applied. FIG. 2 is a circuit block diagram showing the electrical configuration of the encoder input section according to the embodiment of the invention. FIG. 3 is a flowchart showing the rotational speed detection processing procedure in the embodiment of the present invention. FIG. 4 is a diagram showing two memories M1 and M2 used for rotational speed detection processing in the embodiment of the present invention. 7 FIG. 5 is a block diagram showing the electrical configuration of the speed command signal input section. FIG. 6 is a flowchart showing a phase difference detection processing procedure in an embodiment of the present invention. FIG. 7 shows the phase difference PHDT and the control voltage v based on the phase difference.
2 is a graph showing the relationship with 2. FIG. 8 is a block diagram showing a specific electrical configuration of the PWM unit. FIG. 9 is a timing chart showing the operation of the pWM unit. FIG. 10 is a diagram for explaining one of the problems solved by this embodiment, and shows the contents of the motor detection signal when the motor rotation speed changes in one direction over a long period of time. FIG. FIG. 11 is a diagram for explaining the hunting phenomenon. In the figure, 10...DC servo motor, 11...
Driver section, 12...Low reencoder, 13...
・Encoder signal input section, 14...control section, 15...
・Speed command signal input section, 16...PWM unit, M
l, 8 M2...Memory. (2 others)

Claims (1)

【特許請求の範囲】 1、モータ回転速度が指令速度に等しくなるように、モ
ータをフィードバック制御するモータの制御装置におい
て、 所定タイミングごとに、モータ回転速度に関するデータ
を算出する算出手段、 モータ回転速度に関するデータを所定の複数回分、新し
いもの順に記憶できる複数の記憶エリアを有する記憶手
段、 モータ回転速度に関するデータが算出されるごとに、前
回算出されたデータが誤データと判定されていたか否か
を確認する手段、 前回算出されたデータが誤データと判定されていなかっ
たときには、記憶手段に既に記憶されているデータを順
次1つずつシフトして最古データを捨て、かつ今回算出
されたデータを最新データ記憶エリアに記憶させる第1
記憶制御手段、 前回算出されたデータが誤データと判定されていたとき
には、記憶手段に既に記憶されているデータをシフトす
ることなく、今回算 出されたデータを前回のデータに
代えて最新データ記憶エリアに記憶させる第2記憶制御
 手段、 最新データ記憶エリアに記憶されている今回の算出デー
タが、記憶手段に記憶されている複数回分のデータの内
、大小中央に相当するデータに該当するかまたは大小中
央に相当するデータに対して所定範囲内であるか否かを
判別する判別手段、 今回の算出データが、大小中央に相当するデータに該当
するかまたは大小中央に相当するデータに対して所定範
囲内であると判別された時、今回の算出データを、モー
タ制御に用いるべき速度データとして取出す手段、およ
び 今回の算出データが、大小中央に相当するデータに対し
て所定範囲外であると判別された時、今回の算出データ
が誤データであると判定して、大小中央に相当するデー
タを、モータ制御に用いるべき速度データとして取出す
手段、 を含むことを特徴するモータ制御装置。
[Scope of Claims] 1. In a motor control device that performs feedback control of the motor so that the motor rotation speed becomes equal to the command speed, a calculation means for calculating data regarding the motor rotation speed at each predetermined timing, a motor rotation speed. A storage means having a plurality of storage areas capable of storing data related to the motor rotation speed for a predetermined plurality of times in order of the newest; If the data calculated last time was not determined to be incorrect data, the data already stored in the storage means is shifted one by one, the oldest data is discarded, and the data calculated this time is The first data to be stored in the latest data storage area.
Storage control means, when the data calculated last time was determined to be incorrect data, stores the latest data by replacing the data calculated this time with the previous data without shifting the data already stored in the storage means. A second storage control means for storing the current calculated data in the latest data storage area corresponds to the data corresponding to the middle of the plurality of data stored in the storage means; A determination means for determining whether or not the data corresponding to the center of magnitude is within a predetermined range; When it is determined that it is within the range, means for extracting the currently calculated data as speed data to be used for motor control, and determining that the currently calculated data is outside a predetermined range with respect to data corresponding to the center of the magnitude. A motor control device comprising: means for determining that the current calculated data is erroneous data and extracting data corresponding to the center of magnitude as speed data to be used for motor control.
JP1335516A 1989-12-25 1989-12-25 Motor controller Pending JPH03198683A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1335516A JPH03198683A (en) 1989-12-25 1989-12-25 Motor controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1335516A JPH03198683A (en) 1989-12-25 1989-12-25 Motor controller

Publications (1)

Publication Number Publication Date
JPH03198683A true JPH03198683A (en) 1991-08-29

Family

ID=18289447

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1335516A Pending JPH03198683A (en) 1989-12-25 1989-12-25 Motor controller

Country Status (1)

Country Link
JP (1) JPH03198683A (en)

Similar Documents

Publication Publication Date Title
US5187420A (en) Method of calculating motor control voltage and motor control device using the method
JPH1038907A (en) Period detector for pulse signal
JPH03198683A (en) Motor controller
US5130626A (en) Device for controlling rotational speed of motor
JPH03198682A (en) Motor controller
JPH03198684A (en) Motor controller
JPH03198677A (en) Motor controller
JP2820757B2 (en) Motor control device
JP2781232B2 (en) Steady-state reach detection device in motor controller
JPH07122639B2 (en) Speed calculation control method
JP2820747B2 (en) Steady-state reach detection device in motor controller
JPH03218287A (en) Motor controller
JP2735324B2 (en) Motor rotation speed control device
JP2670162B2 (en) Motor rotation speed control device
JP2820755B2 (en) Motor control device
JPH03198680A (en) Motor controller
JPH03218283A (en) Motor controller
JPH03218281A (en) Motor controller
JPH03173382A (en) Motor controller
JP2820756B2 (en) Motor control device
JPS6223548B2 (en)
JP3320454B2 (en) Motor position control device and motor position control method
JPH03173385A (en) Rotating speed controller for motor
JPH03218288A (en) Motor controller
JPH03218282A (en) Motor controller