JP2022115007A - Motor control device, motor control system, and motor control method - Google Patents

Motor control device, motor control system, and motor control method Download PDF

Info

Publication number
JP2022115007A
JP2022115007A JP2021011553A JP2021011553A JP2022115007A JP 2022115007 A JP2022115007 A JP 2022115007A JP 2021011553 A JP2021011553 A JP 2021011553A JP 2021011553 A JP2021011553 A JP 2021011553A JP 2022115007 A JP2022115007 A JP 2022115007A
Authority
JP
Japan
Prior art keywords
motor
speed
encoder
position signal
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
Application number
JP2021011553A
Other languages
Japanese (ja)
Inventor
洋平 荒川
Yohei Arakawa
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.)
MinebeaMitsumi Inc
Original Assignee
MinebeaMitsumi Inc
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 MinebeaMitsumi Inc filed Critical MinebeaMitsumi Inc
Priority to JP2021011553A priority Critical patent/JP2022115007A/en
Priority to PCT/JP2021/041470 priority patent/WO2022163066A1/en
Publication of JP2022115007A publication Critical patent/JP2022115007A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P23/00Arrangements or methods for the control of AC motors characterised by a control method other than vector control
    • H02P23/14Estimation or adaptation of motor parameters, e.g. rotor time constant, flux, speed, current or voltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P29/00Arrangements for regulating or controlling electric motors, appropriate for both AC and DC motors

Abstract

To provide a motor control device capable of stabilizing rotation of a motor even if an encoder pulse temporarily shifts upward.SOLUTION: A motor control device has a position signal counter (41), a frequency signal generation unit (42), and a speed determination unit (43) for determining a rotation speed of a motor calculated based on a count number when the count number of the position signal counter (41) is equal to or more than a predetermined value as a rotation speed of the motor, and determining a smaller speed of the rotation speed of the motor determined based on the position signal counter and a speed upper limit value as the speed of the motor when the position signal counter (41) does not count. The speed determination unit (43) determines the speed upper limit value so that the rotation speed of the motor determined may be smaller according to a continuous frequency of a low count period that is a period when the position signal counter (41) does not count in the predetermined period.SELECTED DRAWING: Figure 2

Description

本発明は、モータ制御装置、モータ制御システムおよびモータ制御方法に関する。 The present invention relates to a motor control device, a motor control system, and a motor control method.

特許文献1には、エンコ-ダによってモ-タ回転をモニタしてモータ速度と駆動量とを制御するモ-タ制御装置が記載されている。このモ-タ制御装置は、高速制御の間にセンサにより出力されるパルス信号の片側エッジによってモータ回転を示すパルスを検出する。このモータ制御装置は、低速制御の間にセンサにより出力されるパルス信号の両側エッジによってモータ回転を示すパルスを検出する。さらにモ-タ制御装置は、検出したパルスによって割込み処理をすることで、モータ速度と駆動量を制御している。 Japanese Unexamined Patent Application Publication No. 2002-200002 describes a motor control device that monitors motor rotation by an encoder to control motor speed and drive amount. The motor controller detects pulses indicative of motor rotation by single-sided edges of the pulse signal output by the sensor during high speed control. The motor controller detects pulses indicative of motor rotation by both edges of the pulse signal output by the sensor during low speed control. Furthermore, the motor control device controls the motor speed and drive amount by performing interrupt processing based on the detected pulses.

特開平9-266686号公報JP-A-9-266686

モータ制御装置においては、所定の時間間隔で生じる周期割込み間隔ごとにモータの回転速度を決定し、決定したモータの回転速度に基づいて速度制御を実行することができる。速度の決定手法には、周期割込み間隔ごとにモータの回転速度の算出を行う手法と、所定の場合のみモータの回転速度の算出を行う手法とがある。所定の場合のみモータの回転速度の算出を行う手法では、例えば、周期割込み間隔におけるエンコーダパルスがカウントされた場合にモータ制御装置はモータの回転速度の算出を行う。カウントされない場合、次の周期割込み間隔では、モータ制御装置は前回のモータの回転速度を用いる。 In the motor control device, the rotational speed of the motor is determined for each periodic interrupt interval that occurs at predetermined time intervals, and speed control can be executed based on the determined rotational speed of the motor. Methods of determining the speed include a method of calculating the rotational speed of the motor at each periodic interrupt interval and a method of calculating the rotational speed of the motor only in a predetermined case. In the method of calculating the rotation speed of the motor only in a predetermined case, the motor control device calculates the rotation speed of the motor, for example, when encoder pulses are counted in the periodic interrupt interval. If not, then at the next periodic interrupt interval, the motor controller uses the previous motor rotation speed.

しかしながら、前回のモータの回転速度を次の周期割込み間隔でも用いる場合、エンコーダパルスが振動等で一時的に上振れすると、モータ制御装置は、モータの実際の回転速度よりもはるかに高い速度であると誤認識してしまうことがある。誤認識の結果、速度の制御が不安定になる場合があった。 However, if the previous rotation speed of the motor is also used in the next periodic interrupt interval, if the encoder pulse temporarily overshoots due to vibration or the like, the motor controller will detect that the speed is much higher than the actual rotation speed of the motor. may be misunderstood. As a result of misrecognition, speed control may become unstable.

本発明は上記従来の問題に鑑みなされたものであって、本発明の課題は、エンコーダパルスが一時的に上振れしても、モータの回転を安定させることが可能なモータ制御装置、モータ制御システムおよびモータ制御方法を提供することにある。 SUMMARY OF THE INVENTION The present invention has been made in view of the above-described conventional problems. It is to provide a system and a motor control method.

上記課題を解決するために、一実施形態に記載されたモータ制御装置は、モータが所定の角度回転するごとに生成される位置信号を受け取った回数をカウントする位置信号カウンタと、所定の周期ごとに周期信号を生成する周期信号生成部と、前記所定の周期における前記位置信号カウンタのカウント数が所定値以上の場合は、前記カウント数に基づいて算出した速度を今回の周期信号の生成タイミングにおける速度と決定し、前記所定の周期における前記位置信号カウンタのカウントがされなかった場合には、位置信号カウンタにおいて最後に前記位置信号を受け取った時刻から当該最後の直前に前記位置信号を受け取った時刻までの時間に基づいて決定されるモータの回転速度と今回の周期信号の生成タイミングにおける速度として決定できる速度の上限となる速度上限値とのうちの小さい方の速度を今回の周期信号の生成タイミングにおける速度と決定する速度決定部と、前記決定した速度に応じて前記モータを駆動するための駆動信号を生成する駆動信号生成部とを備え、前記速度決定部は、前記決定するモータの回転速度が、前記所定の周期における前記位置信号カウンタのカウントがされなかった周期であるローカウント周期が連続した回数に応じて小さくなるように前記速度上限値を決定する。 In order to solve the above problems, the motor control device described in one embodiment includes a position signal counter that counts the number of times a position signal is received each time the motor rotates by a predetermined angle, and a and a periodic signal generating unit that generates a periodic signal at the current timing of generating the periodic signal when the count number of the position signal counter in the predetermined period is equal to or greater than a predetermined value. If it is determined as velocity and the position signal counter does not count in the predetermined period, the time from the time when the position signal counter last received the position signal to the time when the position signal was received immediately before the last time. The smaller one of the motor rotation speed determined based on the time until the current periodic signal generation timing and the speed upper limit value that is the upper limit of the speed that can be determined as the speed at the current periodic signal generation timing. and a drive signal generator for generating a drive signal for driving the motor according to the determined speed, wherein the speed determination unit determines the rotation speed of the motor to be determined However, the upper speed limit value is determined so that the low count period, which is the period during which the position signal counter does not count in the predetermined period, decreases according to the number of consecutive times.

本発明のモータ制御装置、モータ制御システムおよびモータ制御方法では、モータの回転速度が一時的に上振れしても、モータの回転を安定させることが可能となる。 INDUSTRIAL APPLICABILITY According to the motor control device, motor control system, and motor control method of the present invention, it is possible to stabilize the rotation of the motor even if the rotation speed of the motor temporarily increases.

第1の実施形態のモータ制御システムの一例を示す概略構成図である。1 is a schematic configuration diagram showing an example of a motor control system according to a first embodiment; FIG. モータ制御装置3の制御部4の構成例を示す概略構成図である。2 is a schematic configuration diagram showing a configuration example of a control unit 4 of a motor control device 3; FIG. モータ制御システムの動作におけるエンコーダ割込み動作の一例を示すフローチャートである。4 is a flow chart showing an example of encoder interrupt operation in the operation of the motor control system; モータ制御システムの動作における周期割込み動作の一例を示すフローチャートである。5 is a flow chart showing an example of periodic interrupt operation in operation of the motor control system; エンコーダから出力される信号について説明するための図である。FIG. 4 is a diagram for explaining a signal output from an encoder; FIG. 振動、回転ムラが生じた場合におけるモータの回転速度の制御例を示す図である。FIG. 5 is a diagram showing an example of controlling the rotation speed of a motor when vibration and rotation unevenness occur; エンコーダ割込みおよび周期割込みと速度との関係を示す図である。FIG. 4 is a diagram showing the relationship between encoder interrupts and periodic interrupts and speed;

1.実施形態の概要
先ず、本願において開示される発明の代表的な実施形態について概要を説明する。なお、以下の説明では、一例として、発明の構成要素に対応する図面上の参照符号を、括弧を付して記載している。
1. Outline of Embodiment First, an outline of a representative embodiment of the invention disclosed in the present application will be described. In the following description, as an example, reference numerals on the drawings corresponding to constituent elements of the invention are described with parentheses.

〔1〕本発明の代表的な実施形態に係るモータ制御装置は、モータが所定の角度回転するごとに生成される位置信号を受け取った回数をカウントする位置信号カウンタ(41)と、所定の周期ごとに周期信号を生成する周期信号生成部(42)と、前記所定の周期における前記位置信号カウンタ(41)のカウント数が所定値以上の場合は、前記カウント数に基づいて算出したモータの回転速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定し、前記所定の周期における前記位置信号カウンタ(41)のカウントがされなかった場合には、位置信号カウンタにおいて最後に前記位置信号を受け取った時刻から当該最後の直前に前記位置信号を受け取った時刻までの時間に基づいて決定されるモータの回転速度と今回の周期信号の生成タイミングにおける速度として決定できる速度の上限となる速度上限値とのうちの小さい方の速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定する速度決定部(43)と、前記決定したモータの回転速度に応じて前記モータを駆動するための駆動信号を生成する駆動信号生成部(50)とを備え、前記速度決定部(43)は、前記決定するモータの回転速度が、前記所定の周期における前記位置信号カウンタ(41)のカウントがされなかった周期であるローカウント周期が連続した回数に応じて小さくなるように前記速度上限値を決定する。 [1] A motor control device according to a representative embodiment of the present invention includes a position signal counter (41) for counting the number of times a position signal is received each time the motor rotates by a predetermined angle, and a periodic signal generator (42) for generating a periodic signal every time, and when the count number of the position signal counter (41) in the predetermined period is equal to or greater than a predetermined value, the rotation of the motor calculated based on the count number. The speed is determined as the rotational speed of the motor at the current period signal generation timing, and if the position signal counter (41) does not count in the predetermined period, the position signal counter finally outputs the position signal. Motor rotation speed determined based on the time from the time when the position signal was received until the time when the position signal was received immediately before the last time, and the speed upper limit value that is the upper limit of the speed that can be determined as the speed at the timing of generating the current periodic signal and a speed determination unit (43) for determining the smaller speed of the motor as the rotation speed of the motor at the current timing of generating the periodic signal, and a drive for driving the motor according to the determined rotation speed of the motor a drive signal generator (50) for generating a signal, and the speed determination unit (43) determines whether the rotational speed of the motor to be determined is not counted by the position signal counter (41) in the predetermined period. The speed upper limit value is determined so that the low count period, which is the period of the low count, becomes smaller according to the number of consecutive times.

〔2〕上記〔1〕に記載のモータ制御装置であって、前記周期信号生成部は、前記モータの回転速度に関わらず同じ時間間隔で周期信号を生成してもよい。 [2] In the motor control device described in [1] above, the periodic signal generator may generate the periodic signal at the same time intervals regardless of the rotation speed of the motor.

〔3〕上記〔1〕または〔2〕に記載のモータ制御装置であって、前記速度決定部は、前記所定の周期における前記位置信号カウンタのカウント数が所定値以上の場合は、前記モータの1回転当たりに前記位置信号が生成される回数と、前記所定の周期と、前記所定の周期における前記位置信号カウンタのカウント数と、に基づいて、今回の周期信号の生成タイミングにおけるモータの回転速度を決定してもよい。 [3] In the motor control device described in [1] or [2] above, the speed determining unit, when the number of counts of the position signal counter in the predetermined cycle is equal to or greater than a predetermined value, controls the speed of the motor. Based on the number of times the position signal is generated per rotation, the predetermined period, and the number of counts of the position signal counter in the predetermined period, the rotational speed of the motor at the current period signal generation timing is determined. may be determined.

〔4〕上記〔1〕から〔3〕のいずれか1つに記載のモータ制御装置であって、前記速度決定部は、前記モータの1回転当たりに前記位置信号が生成される回数と、前記所定の周期と、前記所定の周期における前記位置信号カウンタのカウント数と、前記ローカウント周期の連続回数と、に基づいて前記速度上限値を決定する。 [4] The motor control device according to any one of [1] to [3] above, wherein the speed determination unit determines the number of times the position signal is generated per rotation of the motor; The upper speed limit is determined based on a predetermined cycle, the number of counts of the position signal counter in the predetermined cycle, and the number of consecutive low count cycles.

〔5〕本発明の代表的な実施形態に係るモータ制御システムは、上記〔1〕から〔4〕のいずれか1つに記載のモータ制御装置と、前記モータ制御装置から出力される駆動信号に基づいて回転駆動されるモータと、前記モータの回転位置を検出するエンコーダと、を備えている。 [5] A motor control system according to a representative embodiment of the present invention includes the motor control device according to any one of [1] to [4] above, and a drive signal output from the motor control device. and an encoder for detecting the rotational position of the motor.

〔6〕本発明の代表的な実施形態に係るモータ制御方法は、モータが所定の角度回転するごとに生成される位置信号を受け取った回数をカウントする位置信号カウントステップと、所定の周期ごとに周期信号を生成する周期信号生成ステップと、前記所定の周期における前記位置信号カウントステップのカウント数に基づいて算出したモータの回転速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定し、前記所定の周期における前記位置信号カウントステップのカウントがされなかった場合には、位置信号カウンタにおいて最後に前記位置信号を受け取った時刻から当該最後の直前に前記位置信号を受け取った時刻までの時間に基づいて決定されるモータの回転速度と今回の周期信号の生成タイミングにおける速度として決定できる速度の上限となる速度上限値とのうちの小さい方の速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定する速度決定ステップと、前記決定したモータの回転速度となるように前記モータを駆動するための駆動信号を生成する駆動信号生成ステップとを備え、前記速度決定ステップでは、前記決定するモータの回転速度が、前記所定の周期における前記位置信号カウントステップのカウントがされなかった周期であるローカウント周期が連続した回数に応じて小さくなるように前記速度上限値を決定する。 [6] A motor control method according to a representative embodiment of the present invention includes a position signal counting step for counting the number of times a position signal is received each time the motor rotates by a predetermined angle; determining the rotational speed of the motor calculated based on the number of counts of the periodic signal generating step for generating the periodic signal and the position signal counting step in the predetermined period as the rotational speed of the motor at the current timing of generating the periodic signal; If the position signal count step in the predetermined cycle is not counted, the position signal counter is used during the time from the time when the position signal was last received to the time when the position signal was received immediately before the last time. The motor rotation speed at the current periodic signal generation timing is the smaller one of the motor rotation speed determined based on the current frequency and the speed upper limit value that is the upper limit of the speed that can be determined as the speed at the current periodic signal generation timing. and a drive signal generation step of generating a drive signal for driving the motor so as to achieve the determined rotation speed of the motor, wherein the speed determination step includes: is determined such that the rotational speed of is decreased according to the number of consecutive low count cycles, which are cycles in which the position signal count steps are not counted in the predetermined cycle.

2.実施形態の具体例
以下、本発明の実施の形態の具体例について図を参照して説明する。なお、以下の説明において、各実施の形態において共通する構成要素には同一の参照符号を付し、繰り返しの説明を省略する。
2. Specific Examples of Embodiments Specific examples of embodiments of the present invention will be described below with reference to the drawings. In the following description, constituent elements common to each embodiment are denoted by the same reference numerals, and repeated descriptions are omitted.

(第1の実施形態)
まず、第1の実施形態のモータ制御装置、モータ制御システムおよびモータ制御方法について説明する。
(First embodiment)
First, the motor control device, motor control system, and motor control method of the first embodiment will be described.

図1は、第1の実施形態のモータ制御システムの一例を示す概略構成図である。本実施形態のモータ制御システムは、モータの駆動を制御する。本実施形態のモータ制御システムは、図1に示すように、モータ1と、モータ1の回転角度を検出するエンコーダ2と、エンコーダ2からの位置信号を受け取り、モータ1を制御するモータ制御装置3とを備えて構成される。 FIG. 1 is a schematic configuration diagram showing an example of the motor control system of the first embodiment. The motor control system of this embodiment controls the driving of the motor. As shown in FIG. 1, the motor control system of this embodiment includes a motor 1, an encoder 2 that detects the rotation angle of the motor 1, and a motor control device 3 that receives a position signal from the encoder 2 and controls the motor 1. and

モータ1は、モータ制御装置3から出力される駆動電流がコイルに流れることによって、主軸を中心にロータが回転する。本明細書においては、モータ1内のロータが回転することをモータ1が回転するともいう。モータ1の回転速度(以下、単に「速度」ともいう。)は、モータ制御装置3によってコイルに流れる駆動電流を調整することによって制御される。 The rotor of the motor 1 rotates around the main shaft when the drive current output from the motor control device 3 flows through the coils. In this specification, the rotation of the rotor in the motor 1 is also referred to as the rotation of the motor 1 . The rotational speed of the motor 1 (hereinafter also simply referred to as “speed”) is controlled by the motor control device 3 by adjusting the drive current flowing through the coils.

エンコーダ2は、モータ1が所定の角度回転するごとにエンコーダパルスを出力する。エンコーダパルスは、モータ1が所定の角度回転したことを示す位置信号である。エンコーダパルスは、モータ1が所定の角度回転するごとに生成される。生成されたエンコーダパルスは、モータ制御装置3に出力される。エンコーダ2としては、インクリメンタル形ロータリーエンコーダとアブソリュート形ロータリーエンコーダのいずれを用いてもよい。エンコーダ2の検出方式としては、光学式、磁気式、のいずれでもよく、光学式でも、透過式、反射式のいずれでもよい。なお、本明細書の以下の説明では、透過式のインクリメンタル形ロータリーエンコーダを例に挙げて説明するが、これに限定されない。 The encoder 2 outputs encoder pulses each time the motor 1 rotates by a predetermined angle. An encoder pulse is a position signal indicating that the motor 1 has rotated by a predetermined angle. An encoder pulse is generated each time the motor 1 rotates by a predetermined angle. The generated encoder pulse is output to the motor control device 3 . Either an incremental rotary encoder or an absolute rotary encoder may be used as the encoder 2 . The detection method of the encoder 2 may be optical or magnetic, and may be optical, transmissive, or reflective. In the following description of this specification, a transmissive incremental rotary encoder will be described as an example, but the present invention is not limited to this.

モータ制御装置3は、制御部4と各種プログラムおよびパラメータ群を記憶した記憶部5とを備えている。モータ制御装置3は、エンコーダ2から出力されるエンコーダパルスを受け取って、モータ1の回転速度を決定し、決定した回転速度に応じてモータ1のコイルに流れる電流を制御することによりモータ1の回転を制御する。 The motor control device 3 includes a control section 4 and a storage section 5 storing various programs and parameter groups. The motor control device 3 receives encoder pulses output from the encoder 2, determines the rotational speed of the motor 1, and controls the current flowing through the coils of the motor 1 in accordance with the determined rotational speed to rotate the motor 1. to control.

図2は、モータ制御装置3の制御部4の構成例を示す概略構成図である。制御部4は、例えば、CPU(Central Processing Unit)等のプロセッサ、ROM(Read Only Memory)やRAM(Random Access Memory)等の各種メモリ、タイマ(カウンタ)、A/D変換回路、入出力I/F回路、およびクロック生成回路等のハードウェア要素を有し、各構成要素がバスや専用線を介して互いに接続されたプログラム処理装置(例えば、マイクロコントローラ:MCU)によって構成されている。または、制御部4は、プログラム処理装置のハードウェア要素と同等の機能を実現するよう構成されたFPGA(Field Programmable Gate Array)によって構成されていてもよい。 FIG. 2 is a schematic configuration diagram showing a configuration example of the control section 4 of the motor control device 3. As shown in FIG. The control unit 4 includes, for example, a processor such as a CPU (Central Processing Unit), various memories such as a ROM (Read Only Memory) and a RAM (Random Access Memory), a timer (counter), an A/D conversion circuit, an input/output I/ It has hardware elements such as an F circuit and a clock generation circuit, and is composed of a program processing unit (for example, a microcontroller: MCU) in which each component is connected to each other via a bus or a dedicated line. Alternatively, the control unit 4 may be configured by an FPGA (Field Programmable Gate Array) configured to implement functions equivalent to the hardware elements of the program processing device.

制御部4は、プロセッサがメモリ等の記憶部5に記憶されたプログラムに従って各種演算を行うとともにA/D変換回路および入出力I/F回路等の周辺回路を制御することによって図2に示す各機能部の構成を実現している。すなわち、図2に示すように、制御部4は、機能部として、速度決定処理部40と、PWM制御部50と、駆動電流制御部60とを備えている。 2 by controlling peripheral circuits such as an A/D conversion circuit and an input/output I/F circuit. The structure of the functional part is realized. That is, as shown in FIG. 2, the control unit 4 includes a speed determination processing unit 40, a PWM control unit 50, and a drive current control unit 60 as functional units.

速度決定処理部40は、エンコーダパルスを受け取ることにより、モータ1の回転速度を決定して、速度情報を生成する処理を実行する。速度決定処理部40は、エンコーダカウンタ41(位置信号カウンタの一例)と、周期信号生成部42と、速度決定部43とを備えている。 The speed determination processing unit 40 determines the rotation speed of the motor 1 by receiving encoder pulses, and executes processing for generating speed information. The speed determination processing section 40 includes an encoder counter 41 (an example of a position signal counter), a periodic signal generation section 42 and a speed determination section 43 .

エンコーダカウンタ41は、エンコーダ割込みの数をカウントする。エンコーダカウンタ41は、前回のエンコーダ割込みが行われた時刻から、今回のエンコーダ割込みが行われた時刻までの時間を測定する。エンコーダカウンタ41は、カウントされたエンコーダ割込みの数をエンコーダカウント値として保持する。エンコーダ割込みをカウントしたエンコーダカウンタ41は、エンコーダ割込み動作を実行する。エンコーダ割込み動作では、エンコーダカウンタ41はエンコーダカウント値と測定した時間とを速度決定部43に通知する。エンコーダカウンタ41は、エンコーダパルスを受け取ったタイミングでエンコーダ割込みの数をカウントする。したがって、エンコーダ割込みの数をカウントしたエンコーダカウント値はエンコーダパルスの回数と等しくなる。同様に、前回のエンコーダ割込みが行われた時刻から、今回のエンコーダ割込みが行われた時刻までの時間は、前回のエンコーダパルスを受け取った時刻から、今回のエンコーダパルスを受け取った時刻までの時間と等しくなる。なお、エンコーダ割込みをカウントするタイミングは、エンコーダパルスの立ち上がりまたはエンコーダパルスの立ち下がりのいずれでもよい。 The encoder counter 41 counts the number of encoder interrupts. The encoder counter 41 measures the time from the time when the previous encoder interrupt was performed to the time when the current encoder interrupt was performed. The encoder counter 41 holds the counted number of encoder interrupts as an encoder count value. The encoder counter 41 that has counted encoder interrupts executes an encoder interrupt operation. In the encoder interrupt operation, the encoder counter 41 notifies the speed determination unit 43 of the encoder count value and the measured time. The encoder counter 41 counts the number of encoder interrupts at the timing of receiving encoder pulses. Therefore, the encoder count value obtained by counting the number of encoder interrupts is equal to the number of encoder pulses. Similarly, the time from the previous encoder interrupt to the current encoder interrupt is equal to the time from the time the previous encoder pulse was received to the time the current encoder pulse was received. be equal. The timing for counting encoder interrupts may be either the rising edge of the encoder pulse or the falling edge of the encoder pulse.

周期信号生成部42は、所定の周期で周期信号を生成する。所定の周期は、一定の時間間隔に設定されている。周期信号は、速度決定部43においてモータの回転速度を決定するトリガとなる信号である。所定の周期は、想定されるモータ1の回転速度に応じて設定される。例えば、通常のアクチュエータとして用いられるステッピングモータでは、所定の周期として1/35,000秒間隔などの任意の時間間隔を設定することができ、1/35,000秒間隔に限定されない。なお、ステッピングモータとしては、VR型のVRステッピングモータ、PM型のPMステッピングモータ又はHB型のHBステッピングモータのいずれのステッピングモータが使用されてもよい。 A periodic signal generator 42 generates a periodic signal at a predetermined period. The predetermined period is set to a constant time interval. The periodic signal is a signal that serves as a trigger for determining the rotational speed of the motor in the speed determining section 43 . The predetermined cycle is set according to the assumed rotation speed of the motor 1 . For example, in a stepping motor used as a normal actuator, any time interval such as 1/35,000 second interval can be set as the predetermined cycle, and is not limited to 1/35,000 second interval. As the stepping motor, any one of a VR type VR stepping motor, a PM type PM stepping motor, and an HB type HB stepping motor may be used.

速度決定部43は、周期信号の生成をトリガとして、エンコーダカウント値に基づいてモータの回転速度を決定する。具体的には、速度決定部43は、エンコーダカウンタ41からエンコーダカウント値を取得する。速度決定部43は、最後に取得されたエンコーダカウント値から前回に取得されたエンコーダカウント値を減算して、エンコーダカウント値の増加値を算出する。速度決定部43は、エンコーダカウント値の増加値によって異なる手法を用いてモータの回転速度を決定する。例えば、速度決定部43は、エンコーダカウント値の増加値が所定値以上である場合と、エンコーダカウント値の増加値が所定値未満である場合と、で異なる手法でモータの回転速度を決定する。所定値は、速度決定部43によって手法を決めるための閾値である。所定値は、例えばモータ1が低速回転していると判断されるエンコーダパルスの回数と、高速回転していると判断されるエンコーダパルスの回数と、の境界値(例えば、2)であってもよい。 The speed determination unit 43 determines the rotation speed of the motor based on the encoder count value, triggered by the generation of the periodic signal. Specifically, the speed determination unit 43 acquires the encoder count value from the encoder counter 41 . The speed determination unit 43 subtracts the previously acquired encoder count value from the last acquired encoder count value to calculate an increase in the encoder count value. The speed determination unit 43 determines the rotational speed of the motor using different methods depending on the increment of the encoder count value. For example, the speed determining unit 43 determines the rotation speed of the motor by different methods depending on whether the increment of the encoder count value is equal to or greater than a predetermined value or when the increment of the encoder count value is less than the predetermined value. The predetermined value is a threshold for determining the method by the speed determination unit 43 . The predetermined value may be, for example, a boundary value (for example, 2) between the number of encoder pulses for judging that the motor 1 is rotating at a low speed and the number of encoder pulses for judging that the motor 1 is rotating at a high speed. good.

速度決定部43は、エンコーダカウント値が所定値以上である場合、モータ1の1回転当たりにエンコーダ2において生成されるエンコーダパルスの回数と、周期信号生成部42が周期信号を生成する周期と、エンコーダカウント値の増加値と、に基づいて速度を算出する。具体的には、速度決定部43は、(式1)に基づいて速度V1を算出する。速度決定部43は、算出された値V1を今回の周期信号の生成タイミングにおけるモータの回転速度V(以下、単に「速度V」ともいう。)として決定する。 When the encoder count value is equal to or greater than a predetermined value, the speed determination unit 43 determines the number of encoder pulses generated by the encoder 2 per one rotation of the motor 1, the period at which the periodic signal generation unit 42 generates the periodic signal, The speed is calculated based on the increment value of the encoder count value. Specifically, the speed determining unit 43 calculates the speed V1 based on (Equation 1). The speed determination unit 43 determines the calculated value V1 as the rotation speed V of the motor at the current generation timing of the periodic signal (hereinafter also simply referred to as “speed V”).

V1=2πp/αT (式1)
上記(式1)において、αは、モータ1の1回転当たりにエンコーダ2において生成されるエンコーダパルスの回数である。Tは、エンコーダのパルス間隔である。pは、エンコーダカウント値の増加値である。πは円周率である。なお、速度決定部43は、(式1)以外の手段で速度を算出するように構成されても良い。例えば、速度決定部43は、(式1)を用いて得られた値に係数又は定数を用いて速度を算出するように構成されてもよい。
V1=2πp/αT (Formula 1)
In the above (Equation 1), α is the number of encoder pulses generated in the encoder 2 per one rotation of the motor 1 . T is the pulse interval of the encoder. p is the increment value of the encoder count value. π is the circular constant. Note that the speed determination unit 43 may be configured to calculate the speed by means other than (Formula 1). For example, the speed determining unit 43 may be configured to calculate the speed using a coefficient or a constant for the value obtained using (Formula 1).

速度決定部43は、エンコーダカウント値の増加値が所定値未満の場合、さらに増加値が0であるか否かによって異なる手法でモータの回転速度Vを決定する。まず、増加値が0である場合について説明する。速度決定部43は、周期信号カウンタ44を有している。周期信号カウンタ44は、エンコーダカウント値の増加値が連続して0となった回数を、カウントするカウンタである。本実施形態では、エンコーダカウント値の増加値が0になった周期をローカウント周期という。すなわち、周期信号カウンタ44は、ローカウント周期の連続した回数をカウントするカウンタである。速度決定部43は、エンコーダカウント値の増加値が0である場合、周期信号カウンタ44を1つインクリメントすることで、ローカウント周期が連続した回数をカウントする。速度決定部43は、周期信号カウンタ44のカウント値に基づいて速度上限値を算出する。速度決定部43は、エンコーダカウント値の増加値が0ではない場合、周期信号カウンタ44のカウント値を「0」にする。 When the increase value of the encoder count value is less than a predetermined value, the speed determination unit 43 determines the rotation speed V of the motor by different methods depending on whether the increase value is 0 or not. First, the case where the increment value is 0 will be described. The speed determination unit 43 has a periodic signal counter 44 . The periodic signal counter 44 is a counter that counts the number of times the incremented value of the encoder count value becomes 0 consecutively. In the present embodiment, a cycle in which the increment value of the encoder count value becomes 0 is called a low count cycle. That is, the periodic signal counter 44 is a counter that counts the number of consecutive low count periods. When the increment value of the encoder count value is 0, the speed determination unit 43 counts the number of consecutive low count cycles by incrementing the cycle signal counter 44 by one. The speed determination unit 43 calculates the speed upper limit value based on the count value of the periodic signal counter 44 . The speed determining unit 43 sets the count value of the periodic signal counter 44 to "0" when the increment value of the encoder count value is not zero.

速度上限値は、ローカウント周期が連続した回数に応じて小さくなる値である。速度上限値は、例えば、周期信号カウンタ44のカウント値に応じて減少する値である。速度上限値は、速度決定部43においてエンコーダカウント値の増加値が0である場合に、今回の周期信号の生成タイミングにおける速度として決定できる速度の上限となる値Vmである。速度決定部43は、モータ1の1回転当たりにエンコーダ2においてエンコーダパルスが生成される回数と、周期信号生成部42が周期信号を生成する周期と、周期信号カウンタ44のカウント値と、に基づいて速度上限値Vmを算出する。速度決定部43は、具体的には、下記(式2)に基づいて算出した速度上限値Vmを用いることができる。 The speed upper limit value is a value that decreases according to the number of consecutive low count cycles. The speed upper limit value is, for example, a value that decreases according to the count value of the periodic signal counter 44 . The speed upper limit value is a value Vm that is the upper limit of the speed that can be determined as the speed at the current periodic signal generation timing when the increment value of the encoder count value is 0 in the speed determination unit 43 . The speed determination unit 43 is based on the number of times the encoder pulse is generated in the encoder 2 per one rotation of the motor 1, the period in which the periodic signal generation unit 42 generates the periodic signal, and the count value of the periodic signal counter 44. to calculate the speed upper limit value Vm. Specifically, the speed determining unit 43 can use the speed upper limit value Vm calculated based on the following (Equation 2).

Vm=2π/αnT (式2)
上記(式2)において、αは、モータ1の1回転当たりにエンコーダ2においてエンコーダパルスが生成される回数である。Tは、周期信号生成部42において周期信号を生成する所定の周期である。nは、周期信号カウンタ44のカウント値である。πは円周率である。
Vm=2π/αnT (Formula 2)
In the above (Equation 2), α is the number of encoder pulses generated in the encoder 2 per one rotation of the motor 1 . T is a predetermined period for generating the periodic signal in the periodic signal generator 42 . n is the count value of the periodic signal counter 44 . π is the circular constant.

速度決定部43は、エンコーダカウント値の増加値が所定値未満であって、かつ増加値が0である場合、算出された速度上限値Vmと、速度V2とを比較して、小さい方の速度を、モータの回転速度Vとして決定する。なお、速度V2は、エンコーダ割込み動作による通知に基づいて、速度決定部43によって決定される。 When the increment of the encoder count value is less than the predetermined value and the increment is 0, the speed determination unit 43 compares the calculated upper limit speed Vm with the speed V2, and determines the smaller speed. is determined as the rotation speed V of the motor. Note that the speed V2 is determined by the speed determination unit 43 based on the notification by the encoder interrupt operation.

ここで、エンコーダ割込み動作よる通知に基づいて、速度決定部43が決定する速度V2について具体的に説明する。速度決定部43は、周期信号の生成をトリガとしてモータの回転速度を決定する処理以外にも、エンコーダ割込み動作をトリガとして、モータの回転速度を決定する処理をしている。速度決定部43は、エンコーダ割込み動作をトリガとして、モータ1の1回転当たりにエンコーダ2において生成されるエンコーダパルスの回数と、前回のエンコーダパルスを受け取った時刻から今回のエンコーダパルスを受け取った時刻までの時間と、に基づいて速度V2を算出する。具体的には、速度決定部43は、下記(式3)に基づいて速度V2を算出する。 Here, the speed V2 determined by the speed determination unit 43 based on the notification by the encoder interrupt operation will be specifically described. The speed determination unit 43 performs processing for determining the rotation speed of the motor with the generation of the periodic signal as a trigger, as well as processing for determining the rotation speed of the motor with the encoder interrupt operation as a trigger. Triggered by the encoder interrupt operation, the speed determination unit 43 determines the number of encoder pulses generated by the encoder 2 per one rotation of the motor 1 and the time from when the previous encoder pulse was received to when the current encoder pulse is received. and the velocity V2 is calculated based on the time of . Specifically, the speed determination unit 43 calculates the speed V2 based on the following (Equation 3).

V2=2π/αt (式3)
上記(式3)において、αは、モータ1の1回転当たりにエンコーダ2において生成されるエンコーダパルスの回数である。tは、前回のエンコーダパルスを受け取った時刻から今回のエンコーダパルスを受け取った時刻までの時間である。tの単位は秒である。πは円周率である。なお、速度決定部43は、(式3)以外の手段で速度V2を算出するように構成されても良い。例えば、速度決定部43は、(式3)を用いて得られた値に係数又は定数を用いて速度を算出するように構成されてもよい。
V2=2π/αt (Formula 3)
In (Equation 3) above, α is the number of encoder pulses generated in the encoder 2 per one rotation of the motor 1 . t is the time from the time when the previous encoder pulse was received to the time when the current encoder pulse was received. The unit of t is seconds. π is the circular constant. Note that the speed determination unit 43 may be configured to calculate the speed V2 by means other than (Equation 3). For example, the speed determination unit 43 may be configured to calculate the speed using a coefficient or a constant for the value obtained using (Formula 3).

次に、エンコーダカウント値の増加値が所定値未満であって、かつ増加値が0でない場合に、速度決定部43が、周期信号の生成をトリガとして、決定するモータの回転速度ついて説明する。速度決定部43は、エンコーダカウント値の増加値が所定値未満であって、かつ増加値が0ではない場合は、最後のエンコーダ割込み動作に基づいて算出された速度V2をモータの回転速度Vとして決定する。 Next, the rotational speed of the motor determined by the speed determination unit 43 triggered by the generation of the periodic signal when the increment value of the encoder count value is less than the predetermined value and not 0 will be described. If the increment value of the encoder count value is less than the predetermined value and the increment value is not 0, the speed determination unit 43 sets the speed V2 calculated based on the last encoder interrupt operation as the rotation speed V of the motor. decide.

速度決定部43は、決定したモータの回転速度に基づいて速度情報を生成してPWM制御部50に渡す。速度決定部43は、例えば、現在のモータ1の回転速度の予測値を速度情報として生成できる。PWM制御部50は、速度情報と、回転速度の目標値を示す目標速度と、に基づいてPWM信号を生成する。生成されるPWM信号は、速度情報を目標速度に近づけるようなトルクをモータ1に与える信号である。 The speed determination unit 43 generates speed information based on the determined rotational speed of the motor and transfers the speed information to the PWM control unit 50 . The speed determining unit 43 can generate, for example, a predicted value of the current rotational speed of the motor 1 as speed information. The PWM control unit 50 generates a PWM signal based on speed information and a target speed indicating a target value of rotation speed. The generated PWM signal is a signal that gives the motor 1 a torque that brings the speed information closer to the target speed.

PWM制御部50は、速度情報に基づいてPWM信号生成する。PWM制御部50は、速度決定部43において決定した速度に応じた回転速度でモータ1が回転するように制御するPWM信号を生成する。 A PWM control unit 50 generates a PWM signal based on the speed information. The PWM control unit 50 generates a PWM signal for controlling the motor 1 to rotate at a rotation speed corresponding to the speed determined by the speed determination unit 43 .

駆動電流制御部60は、PWM制御部50から受け取ったPWM信号に基づいて、モータ1のコイルに流す電流量を調整する。モータ1のコイルに流す電流量を調整することによって、モータ1の速度を制御することができる。 The drive current control section 60 adjusts the amount of current to be supplied to the coils of the motor 1 based on the PWM signal received from the PWM control section 50 . By adjusting the amount of current flowing through the coils of the motor 1, the speed of the motor 1 can be controlled.

次に、第1の実施形態のモータ制御システムの動作について説明する。 Next, operation of the motor control system of the first embodiment will be described.

図3は、モータ制御システムの動作におけるエンコーダ割込み動作の一例を示すフローチャートである。エンコーダカウンタ41は、エンコーダ割込みの数をカウントし、カウントされたエンコーダ割込みの数をエンコーダカウント値として保持する(ステップS101)。ステップS101において、エンコーダカウンタ41は、最後にエンコーダ割込みが行われた時刻から、今回のエンコーダ割込みが行われた時刻までの時間を測定する。エンコーダカウンタ41は、測定した時間を速度決定部43に渡す(ステップS102)。 FIG. 3 is a flow chart showing an example of encoder interrupt operation in the operation of the motor control system. The encoder counter 41 counts the number of encoder interrupts and holds the counted number of encoder interrupts as an encoder count value (step S101). In step S101, the encoder counter 41 measures the time from the last encoder interrupt to the current encoder interrupt. The encoder counter 41 passes the measured time to the speed determining section 43 (step S102).

速度決定部43は、(式3)に基づいて速度V2を算出する(ステップS103)。速度決定部43は、エンコーダカウンタ41から渡された時間に基づいて速度V2を算出することができる。 The speed determination unit 43 calculates the speed V2 based on (Equation 3) (step S103). The speed determination unit 43 can calculate the speed V2 based on the time passed from the encoder counter 41 .

図4は、モータ制御システムの動作における周期割込み動作の一例を示すフローチャートである。速度決定部43は、最後に取得されたエンコーダカウント値から前回に取得されたエンコーダカウント値を減算して、エンコーダカウント値の増加値を算出する(ステップS201)。 FIG. 4 is a flow chart showing an example of periodic interrupt operation in the operation of the motor control system. The speed determining unit 43 subtracts the previously acquired encoder count value from the last acquired encoder count value to calculate an increase in the encoder count value (step S201).

速度決定部43は、エンコーダカウンタ41のエンコーダカウント値の増加値が所定値以上であるか否かを判断する(ステップS202)。速度決定部43は、エンコーダカウント値の増加値が所定値以上であると判断すると(ステップS202:YES)、(式1)に従って、速度V1を算出する(ステップS203)。速度決定部43は、算出された速度V1をモータの回転速度Vとして決定する。 The speed determination unit 43 determines whether or not the increase in the encoder count value of the encoder counter 41 is equal to or greater than a predetermined value (step S202). When the speed determination unit 43 determines that the increase in the encoder count value is equal to or greater than the predetermined value (step S202: YES), the speed determination unit 43 calculates the speed V1 according to (Equation 1) (step S203). The speed determination unit 43 determines the calculated speed V1 as the rotation speed V of the motor.

速度決定部43は、エンコーダカウント値の増加値が所定値以上ではないと判断すると(ステップS202:NO)、エンコーダカウント値の増加値が0であるか否かを判断する(ステップS204)。速度決定部43は、エンコーダカウント値の増加値が0である場合(ステップS204:YES)、(式2)に従って、速度上限値Vmを算出する(ステップS205)。 When the speed determination unit 43 determines that the increase in the encoder count value is not equal to or greater than the predetermined value (step S202: NO), it determines whether the increase in the encoder count value is 0 (step S204). When the increment value of the encoder count value is 0 (step S204: YES), the speed determination unit 43 calculates the speed upper limit value Vm according to (Equation 2) (step S205).

速度決定部43は、算出された速度上限値Vmと、速度V2とを比較して、小さい方の速度を、モータの回転速度Vとして決定する(ステップS206)。 The speed determination unit 43 compares the calculated speed upper limit value Vm and the speed V2, and determines the smaller speed as the rotation speed V of the motor (step S206).

速度決定部43は、エンコーダカウント値の増加値が所定値未満であり、かつ増加値が0でない場合(ステップS204:NO)、速度V2をモータの回転速度Vとして決定する(ステップS207)。 When the increment of the encoder count value is less than the predetermined value and the increment is not 0 (step S204: NO), the speed determination unit 43 determines the speed V2 as the rotation speed V of the motor (step S207).

速度決定部43は、ステップS203、ステップS206又はステップS207の後、算出または決定したモータの回転速度Vに基づいて速度情報を生成する(ステップS208)。速度決定部43は、生成した速度情報をPWM制御部50に渡すことができる。速度決定部43は、算出または決定したモータの回転速度Vに応じた指令値を速度情報として生成することができる。例えば、決定したモータの回転速度Vがモータ1の目標回転速度となるような値を指令値とすることができる。 After step S203, step S206, or step S207, the speed determining unit 43 generates speed information based on the calculated or determined rotational speed V of the motor (step S208). The speed determination unit 43 can pass the generated speed information to the PWM control unit 50 . The speed determination unit 43 can generate a command value according to the calculated or determined rotational speed V of the motor as speed information. For example, the command value can be set such that the determined motor rotation speed V becomes the target rotation speed of the motor 1 .

PWM制御部50は、速度情報に基づいてPWM信号を生成して駆動電流制御部60に渡す(ステップS209)。駆動電流制御部60は、PWM信号を受け取ると、受け取ったPWM信号に基づいて電流量を調整して、モータ1に出力する(ステップS210)。 The PWM control unit 50 generates a PWM signal based on the speed information and transfers it to the drive current control unit 60 (step S209). Upon receiving the PWM signal, the drive current control unit 60 adjusts the amount of current based on the received PWM signal and outputs it to the motor 1 (step S210).

図4で示すように、速度決定部43は、周期信号カウンタ44のカウント値nに応じて減少する速度上限値Vmを超えないように調整したモータの回転速度Vを決定する。モータの振動や回転ムラによってエンコーダパルスが一時的に上振れした場合でも、速度決定部43は、より早く速度を更新することができる。このため、モータ制御装置3は、より安定してモータ1を駆動させることができる。 As shown in FIG. 4 , the speed determining unit 43 determines the rotational speed V of the motor that is adjusted so as not to exceed the speed upper limit value Vm that decreases according to the count value n of the periodic signal counter 44 . Even if the encoder pulse temporarily rises due to motor vibration or rotation unevenness, the speed determination unit 43 can update the speed more quickly. Therefore, the motor control device 3 can drive the motor 1 more stably.

ここで、モータの振動および回転ムラによるエンコーダパルスの一時的な上振れについて説明する。 Temporary upswing of encoder pulses due to motor vibration and rotational unevenness will now be described.

図5および図6は、エンコーダから出力されるエンコーダパルスの例を示す図である。制御部4では、エンコーダ2から2つの相(A相およびB相)に分かれて出力されるエンコーダパルスの立ち上がりエッジまたは立ち下がりのエッジをカウントすることによってモータの回転速度や回転方向を検出している。また一定の回転速度でモータが回転している場合は、エンコーダ2は、A相およびB相において、一定の間隔でエンコーダパルスを出力する。例えば、制御部4は、A相およびB相において所定周期の間に立ち上がりエッジを何回カウントしたかによって、モータの回転速度を検出することができる。また制御部4は、エンコーダパルスをカウントした相の順番によって回転方向を検出することができる。例えば、制御部4は、A相において立ち上がりエッジをカウントした後にB相において立ち上がりエッジをカウントした場合は、モータは正回転であることが検出できる。逆に、制御部4は、B相において立ち上がりエッジをカウントした後にA相において立ち上がりエッジをカウントした場合は、モータは逆回転であることが検出できる。 5 and 6 are diagrams showing examples of encoder pulses output from the encoder. The control unit 4 detects the rotational speed and rotational direction of the motor by counting the rising edges or falling edges of the encoder pulses output in two phases (A phase and B phase) from the encoder 2. there is When the motor rotates at a constant rotational speed, the encoder 2 outputs encoder pulses at constant intervals in the A phase and B phase. For example, the control unit 4 can detect the rotation speed of the motor based on how many rising edges are counted during a predetermined period in the A phase and the B phase. Further, the control unit 4 can detect the rotation direction based on the order of the phases in which the encoder pulses are counted. For example, when the controller 4 counts the rising edge in the A phase and then counts the rising edge in the B phase, it can detect that the motor is rotating forward. Conversely, when the controller 4 counts the rising edge in the A phase after counting the rising edge in the B phase, it can detect that the motor is rotating in the reverse direction.

図5(a)は正回転の場合のエンコーダパルスの出力を示している。図5(a)のAのエンコーダパルスは、A相のエンコーダパルスを示す。図5(a)のBのエンコーダパルスは、B相のエンコーダパルスを示す。図5(b)は逆回転の場合のエンコーダパルスの出力を示している。図5(b)のAのエンコーダパルスは、A相のエンコーダパルスを示す。図5(b)のBのエンコーダパルスは、B相のエンコーダパルスを示す。図5によると、モータ1が正常に回転している場合には、A相のエンコーダパルスと、B相のエンコーダパルスと、が交互に出力される。 FIG. 5(a) shows encoder pulse output in the case of forward rotation. An encoder pulse of A in FIG. 5(a) indicates an A-phase encoder pulse. An encoder pulse of B in FIG. 5A indicates a B-phase encoder pulse. FIG. 5(b) shows the encoder pulse output in the case of reverse rotation. An encoder pulse of A in FIG. 5B indicates an A-phase encoder pulse. The B encoder pulse in FIG. 5B indicates the B-phase encoder pulse. According to FIG. 5, when the motor 1 is rotating normally, A-phase encoder pulses and B-phase encoder pulses are alternately output.

図6(a)は振動が生じた場合のエンコーダパルスの出力を示している。図6(a)のAのエンコーダパルスは、A相のエンコーダパルスを示す。図6(a)のBのエンコーダパルスは、B相のエンコーダパルスを示す。モータ1が正常に回転している場合は、A相のエンコーダパルスa1の立ち上がりパルスの後に、B相のエンコーダパルスb1の立ち上がりパルスが出力される。しかしながら、モータ1に振動が発生すると、エンコーダパルスの出力が変化する。例えば、エンコーダ2は、エンコーダパルスa1の立下りパルスを出力した後に、B相のエンコーダパルスb1の立ち上がりパルス及び立下りパルスを2回出力する。このように、振動が生じた場合、エンコーダ2が同じ回転位置を示すエンコーダパルスb1を連続して出力することがある。この場合、エンコーダ2は、実際の回転の結果として生じるエンコーダパルスの数よりも多くのエンコーダパルスを出力してしまうため、エンコーダパルスの一時的な上振れが生じる。 FIG. 6A shows encoder pulse output when vibration occurs. An encoder pulse of A in FIG. 6A indicates an A-phase encoder pulse. An encoder pulse of B in FIG. 6A indicates a B-phase encoder pulse. When the motor 1 is rotating normally, the rising pulse of the B-phase encoder pulse b1 is output after the rising pulse of the A-phase encoder pulse a1. However, when the motor 1 vibrates, the encoder pulse output changes. For example, the encoder 2 outputs the rising and falling pulses of the B-phase encoder pulse b1 twice after outputting the falling pulse of the encoder pulse a1. Thus, when vibration occurs, the encoder 2 may continuously output encoder pulses b1 indicating the same rotational position. In this case, the encoder 2 outputs more encoder pulses than the number of encoder pulses resulting from the actual rotation, resulting in a temporary upward swing of the encoder pulses.

図6(b)は回転ムラが生じた場合のエンコーダパルスの出力を示している。図6(b)のAのエンコーダパルスは、A相のエンコーダパルスを示す。モータ1に回転ムラが発生すると、エンコーダ2は、局所的に間隔が広かったり、狭かったりするエンコーダパルスを出力する。例えば、図6(b)によると、エンコーダパルスa1、a2、a3、b1及びb2の出力間隔がそれぞれ異なる。このように、回転ムラが生じた場合、エンコーダ2はエンコーダパルスの出力間隔が異なる出力をするため、モータ制御装置3は、安定して速度を制御することが難しくなる。 FIG. 6(b) shows the encoder pulse output when rotation unevenness occurs. An encoder pulse of A in FIG. 6B indicates an A-phase encoder pulse. When rotation unevenness occurs in the motor 1, the encoder 2 outputs encoder pulses whose intervals are locally wide or narrow. For example, according to FIG. 6B, the output intervals of encoder pulses a1, a2, a3, b1 and b2 are different. In this way, when rotation unevenness occurs, the encoder 2 outputs encoder pulses at different intervals, making it difficult for the motor control device 3 to stably control the speed.

モータを常に一定に回転するように制御しても、外乱などの影響により、振動や回転ムラが生じてエンコーダパルスが一時的に上振れしてしまうことがある。本実施形態のモータ制御システムでは、エンコーダパルスの一時的な上振れが生じても、速度決定部43でより早く速度を更新することができる。 Even if the motor is controlled to always rotate constantly, the influence of disturbances and the like may cause vibrations and uneven rotation, resulting in temporary overshoot in encoder pulses. In the motor control system of the present embodiment, the speed determination section 43 can update the speed more quickly even if there is a temporary upward deflection of the encoder pulse.

図7は、エンコーダ割込みおよび周期割込みと速度との関係を示す図である。図7(a)は、周期割り込みタイミングの周期Tの間隔において、振動によるエンコーダ割込みと回転ムラによるエンコーダ割込みとが発生していることを示している。図7(a)において、実線は、周期割り込みタイミングS1、S2、S3・・・S11を示し、破線は、エンコーダ割込みのタイミングを示している。図7(b)は、図7(a)に示す周期割り込みタイミングにおいて速度決定部43が決定するモータの回転速度の時間的変化を示している。 FIG. 7 is a diagram showing the relationship between encoder interrupts and period interrupts and speed. FIG. 7A shows that an encoder interrupt due to vibration and an encoder interrupt due to rotation unevenness occur at intervals of period T of the period interrupt timing. In FIG. 7A, solid lines indicate periodic interrupt timings S1, S2, S3, . . . S11, and broken lines indicate encoder interrupt timings. FIG. 7(b) shows temporal changes in the rotation speed of the motor determined by the speed determining unit 43 at the periodic interrupt timing shown in FIG. 7(a).

図7に示す例では、周期割込みのタイミングS2からS3の間に振動によるエンコーダ割込みが発生し、周期割込みのタイミングS5からS6の間に振動によるエンコーダ割込みが発生している。速度決定部43では、図3に示すように、エンコーダ割込みが発生したタイミングがあると、(式3)で速度V2を算出する。 In the example shown in FIG. 7, an encoder interrupt due to vibration occurs between timings S2 and S3 of the periodic interrupt, and an encoder interrupt due to vibration occurs between timings S5 and S6 of the periodic interrupt. As shown in FIG. 3, the speed determination unit 43 calculates the speed V2 using (Equation 3) when there is a timing at which an encoder interrupt occurs.

速度決定部43では、図4に示すように、周期割込みのタイミングにおけるエンコーダカウント値の増加値が所定値以上の場合に速度V1を算出する。したがって速度決定部43は、振動や回転ムラが発生して、周期割り込みのタイミングでエンコーダカウント値の増加値が所定値以上となると、一時的に上振れしたエンコーダカウント値に基づいて速度V1を算出する。その周期割込みのタイミングではモータの回転速度VはV1に決定される。 As shown in FIG. 4, the speed determination unit 43 calculates the speed V1 when the increment of the encoder count value at the timing of the periodic interrupt is equal to or greater than a predetermined value. Therefore, when vibration or rotation unevenness occurs and the increment of the encoder count value becomes equal to or greater than a predetermined value at the timing of the periodic interrupt, the speed determination unit 43 calculates the speed V1 based on the temporary overrun encoder count value. do. The rotation speed V of the motor is determined to be V1 at the timing of the periodic interrupt.

図7に示す例では、周期割り込みのタイミングS3ではエンコーダカウント値の増加値が「2」となっており、周期割り込みのタイミングS6ではエンコーダカウント値の増加値が「3」となっていると考えられる。エンコーダカウント値の所定値が「2」という条件の下では、速度決定部43は、周期割り込みのタイミングS3、S6の両方ともにおいてエンコーダカウント値の増加値が所定値以上と判断する。したがって、速度決定部43は、周期割り込みのタイミングS3では、(式1)に基づいて算出したV11をモータの回転速度Vと決定し、周期割り込みのタイミングS6では、(式1)に基づいて算出したV12をモータの回転速度Vと決定する。 In the example shown in FIG. 7, it is considered that the increment value of the encoder count value is "2" at the timing S3 of the periodic interrupt, and the increment value of the encoder count value is "3" at the timing S6 of the periodic interrupt. be done. Under the condition that the predetermined value of the encoder count value is "2", the speed determining unit 43 determines that the increment of the encoder count value is equal to or greater than the predetermined value at both the periodic interrupt timings S3 and S6. Therefore, the speed determination unit 43 determines V11 calculated based on (Equation 1) as the rotational speed V of the motor at the timing S3 of the periodic interrupt, and calculates based on (Equation 1) at the timing S6 of the periodic interrupt. The resulting V12 is determined as the rotation speed V of the motor.

本実施形態のモータ制御システムでは、振動や回転ムラによる一時的な上振れの場合、次の周期割り込みのタイミングでエンコーダカウント値が所定値未満となる。したがって、速度決定部43は、次の周期割り込みのタイミングでは、エンコーダカウント値の増加値が0であるか否かに応じて、モータの回転速度V2をモータの回転速度Vと決定するか、または速度上限値Vmを算出してモータの回転速度Vを調整する。 In the motor control system of this embodiment, in the case of a temporary overrun due to vibration or rotation unevenness, the encoder count value becomes less than the predetermined value at the timing of the next periodic interrupt. Therefore, at the timing of the next periodic interrupt, the speed determination unit 43 determines the motor rotation speed V2 as the motor rotation speed V depending on whether the increment value of the encoder count value is 0 or not. The rotational speed V of the motor is adjusted by calculating the speed upper limit value Vm.

図7に示す例では、周期割り込みのタイミングS3、S6の次の周期割り込みのタイミングS4、S7では、エンコーダカウント値の増加値が0であると考えられる。したがって、速度決定部43は、周期割り込みのタイミングS4では、速度上限値Vm1を算出し、エンコーダ割込みのタイミングで算出していたV2と速度上限値Vm1とを比べての小さい方を、モータの回転速度Vと決定する。同様に、速度決定部43は、周期割り込みのタイミングS7では、速度上限値Vm2を算出し、エンコーダ割込みのタイミングで算出していたV2と速度上限値Vm2とを比べての小さい方を、モータの回転速度Vと決定する。図7では、エンコーダ割込みのタイミングで算出していたV2よりも周期割り込みのタイミングS3、S7において算出したVm1、Vm2の方が小さいものとして示している。 In the example shown in FIG. 7, it is considered that the increment value of the encoder count value is 0 at the timings S4 and S7 of the periodic interrupts subsequent to the timings S3 and S6 of the periodic interrupts. Therefore, the speed determination unit 43 calculates the upper limit speed Vm1 at the timing S4 of the periodic interrupt, and compares V2 calculated at the timing of the encoder interrupt with the upper limit speed Vm1 , and selects the smaller one as the motor speed. is determined as the rotation speed V of . Similarly, the speed determination unit 43 calculates the upper limit speed Vm2 at the timing S7 of the periodic interrupt, and compares V2 calculated at the timing of the encoder interrupt with the upper limit speed Vm2 , and selects the smaller one. Determine the rotation speed V of the motor. In FIG. 7, V m1 and V m2 calculated at the timings S3 and S7 of the periodic interrupt are shown to be smaller than V2 calculated at the timing of the encoder interrupt.

一時的な上振れの場合、図7の周期割り込みのタイミングS4からS5およびS7からS10のように、ローカウント周期は連続することとなる。したがって、速度決定部43は、連続する周期割り込みのタイミングS4からS5で速度上限値VmはVm1、(1/2)Vm1であると算出し、モータの回転速度Vを決定している。同様に、速度決定部43は、連続する周期割り込みのタイミングS7からS10で、速度上限値VmはVm2、(1/2)Vm2、(1/3)Vm2、(1/n)Vm2であると算出し、モータの回転速度Vを決定している。この速度上限値Vm1、Vm2は、ローカウント周期が連続した回数に応じて減少している。したがって、ローカウント周期が連続するごとに、速度決定部43で決定するモータの回転速度Vは次第に低下して、本来の速度に近い値に更新されていく。 In the case of a temporary upswing, the low count cycle continues like the cycle interrupt timings S4 to S5 and S7 to S10 in FIG. Therefore, the speed determining unit 43 determines the rotational speed V of the motor by calculating that the speed upper limit value Vm is V m1 and (1/2)V m1 at the timings S4 to S5 of successive periodic interrupts. Similarly, the speed determination unit 43 sets the speed upper limit value Vm to Vm2 , (1/2) Vm2 , (1/3) Vm2 , (1/n)V m2 , and the rotational speed V of the motor is determined. The speed upper limit values V m1 and V m2 decrease according to the number of consecutive low count cycles. Therefore, every time the low count cycle continues, the motor rotation speed V determined by the speed determination unit 43 gradually decreases and is updated to a value close to the original speed.

以上で説明したように、本実施形態のモータ制御システムでは、エンコーダパルスの一時的な上振れが生じても、一時的に上昇した速度を本来の速度に近い値に周期割込みのタイミングで更新していくので、モータの回転を安定させることができる。 As described above, in the motor control system of this embodiment, even if the encoder pulse temporarily rises, the temporarily increased speed is updated to a value close to the original speed at the timing of the periodic interrupt. Therefore, the rotation of the motor can be stabilized.

(実施形態の変形例)
以上の実施形態では、図1の構成のモータ制御システムを用いて、具体的な一例について説明したが、図1の構成に限定されない。同様に、モータ1、エンコーダ2、モータ制御装置3の構成についても説明した例に特に限定されない。
(Modification of embodiment)
In the above embodiment, a specific example has been described using the motor control system having the configuration shown in FIG. 1, but the configuration is not limited to that shown in FIG. Similarly, the configurations of the motor 1, the encoder 2, and the motor control device 3 are not particularly limited to the examples described above.

以上の実施形態において、図3,4に示した処理フローは具体例であって、処理フローはこれらに限定されない。例えば、図4に示すように周期信号カウンタ44のカウント値nを0にリセットする処理(ステップS203)をモータの回転速度Vの算出する処理(ステップS202)より前に実行してもよい。 In the above embodiment, the processing flows shown in FIGS. 3 and 4 are specific examples, and the processing flows are not limited to these. For example, as shown in FIG. 4, the process of resetting the count value n of the periodic signal counter 44 to 0 (step S203) may be executed before the process of calculating the rotation speed V of the motor (step S202).

1…モータ、2…エンコーダ、3…モータ制御装置、4…制御部、5…記憶部、40…速度決定処理部、41…エンコーダカウンタ、42…周期信号生成部、43…速度決定部、44…周期信号カウンタ、50…PWM制御部、60…駆動電流制御部 REFERENCE SIGNS LIST 1 Motor 2 Encoder 3 Motor control device 4 Control unit 5 Storage unit 40 Speed determination processing unit 41 Encoder counter 42 Periodic signal generation unit 43 Speed determination unit 44 ... periodic signal counter, 50 ... PWM control section, 60 ... drive current control section

Claims (6)

モータが所定の角度回転するごとに生成される位置信号を受け取った回数をカウントする位置信号カウンタと、
所定の周期ごとに周期信号を生成する周期信号生成部と、
前記所定の周期における前記位置信号カウンタのカウント数が所定値以上の場合は、前記カウント数に基づいて算出したモータの回転速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定し、前記所定の周期における前記位置信号カウンタのカウントがされなかった場合には、位置信号カウンタにおいて最後に前記位置信号を受け取った時刻から当該最後の直前に前記位置信号を受け取った時刻までの時間に基づいて決定されるモータの回転速度と今回の周期信号の生成タイミングにおける速度として決定できる速度の上限となる速度上限値とのうちの小さい方の速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定する速度決定部と、
前記決定したモータの回転速度に応じて前記モータを駆動するための駆動信号を生成する駆動信号生成部とを備え、
前記速度決定部は、前記決定するモータの回転速度が、前記所定の周期における前記位置信号カウンタのカウントがされなかった周期であるローカウント周期が連続した回数に応じて小さくなるように前記速度上限値を決定する、モータ制御装置。
a position signal counter that counts the number of times a position signal that is generated each time the motor rotates by a predetermined angle is received;
a periodic signal generation unit that generates a periodic signal for each predetermined period;
If the number of counts of the position signal counter in the predetermined cycle is equal to or greater than a predetermined value, the rotation speed of the motor calculated based on the number of counts is determined as the rotation speed of the motor at the current generation timing of the periodic signal, and If the position signal counter does not count in a predetermined cycle, the time from the time when the position signal counter last received the position signal to the time when the position signal was received immediately before the last time is used. The smaller one of the determined motor rotation speed and the speed upper limit value that is the upper limit of the speed that can be determined as the speed at the current periodic signal generation timing is the motor rotation speed at the current periodic signal generation timing. a speed determining unit for determining;
a drive signal generator that generates a drive signal for driving the motor according to the determined rotation speed of the motor,
The speed determination unit controls the speed upper limit so that the rotational speed of the motor to be determined becomes smaller according to the number of consecutive low count cycles, which are cycles in which the position signal counter does not count in the predetermined cycle. A motor controller that determines the value.
請求項1に記載のモータ制御装置であって、
前記周期信号生成部は、前記モータの回転速度に関わらず同じ時間間隔で周期信号を生成する、
モータ制御装置。
The motor control device according to claim 1,
The periodic signal generator generates periodic signals at the same time intervals regardless of the rotation speed of the motor.
motor controller.
請求項1または2に記載のモータ制御装置であって、
前記速度決定部は、前記所定の周期における前記位置信号カウンタのカウント数が所定値以上の場合は、前記モータの1回転当たりに前記位置信号が生成される回数と、前記所定の周期と、前記所定の周期における前記位置信号カウンタのカウント数と、に基づいて、今回の周期信号の生成タイミングにおけるモータの回転速度を決定する、
モータ制御装置。
The motor control device according to claim 1 or 2,
When the number of counts of the position signal counter in the predetermined cycle is equal to or greater than a predetermined value, the speed determination unit determines the number of times the position signal is generated per rotation of the motor, the predetermined cycle, and the determining the rotational speed of the motor at the timing of generating the current periodic signal based on the number of counts of the position signal counter in a predetermined period;
motor controller.
請求項1から3のいずれか1項に記載のモータ制御装置であって、
前記速度決定部は、前記モータの1回転当たりに前記位置信号が生成される回数と、前記所定の周期と、前記所定の周期における前記位置信号カウンタのカウント数と、前記ローカウント周期の連続回数と、に基づいて前記速度上限値を決定する、
モータ制御装置。
The motor control device according to any one of claims 1 to 3,
The speed determination unit includes the number of times the position signal is generated per rotation of the motor, the predetermined period, the count number of the position signal counter in the predetermined period, and the number of consecutive low count periods. and determining the upper speed limit based on
motor controller.
請求項1から4のいずれか1項に記載のモータ制御装置と、
前記モータ制御装置から出力される駆動信号に基づいて回転駆動されるモータと、
前記モータの回転位置を検出するエンコーダと、を備える、
モータ制御システム。
a motor control device according to any one of claims 1 to 4;
a motor rotationally driven based on a drive signal output from the motor control device;
an encoder that detects the rotational position of the motor;
motor control system.
モータが所定の角度回転するごとに生成される位置信号を受け取った回数をカウントする位置信号カウントステップと、所定の周期ごとに周期信号を生成する周期信号生成ステップと、前記所定の周期における前記位置信号カウントステップのカウント数に基づいて算出したモータの回転速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定し、前記所定の周期における前記位置信号カウントステップのカウントがされなかった場合には、位置信号カウンタにおいて最後に前記位置信号を受け取った時刻から当該最後の直前に前記位置信号を受け取った時刻までの時間に基づいて決定されるモータの回転速度と今回の周期信号の生成タイミングにおける速度として決定できる速度の上限となる速度上限値とのうちの小さい方の速度を今回の周期信号の生成タイミングにおけるモータの回転速度と決定する速度決定ステップと、
前記決定したモータの回転速度となるように前記モータを駆動するための駆動信号を生成する駆動信号生成ステップとを備え、
前記速度決定ステップでは、前記決定するモータの回転速度が、前記所定の周期における前記位置信号カウントステップのカウントがされなかった周期であるローカウント周期が連続した回数に応じて小さくなるように前記速度上限値を決定する
を含む、モータ制御方法。
a position signal counting step of counting the number of times a position signal is received each time the motor rotates a predetermined angle; a periodic signal generating step of generating a periodic signal every predetermined period; The rotation speed of the motor calculated based on the number of counts of the signal count step is determined as the rotation speed of the motor at the time when the periodic signal is generated this time. is the rotation speed of the motor determined based on the time from the time when the position signal counter received the last position signal to the time when the position signal was received immediately before the last time, and the timing of generating the current periodic signal. a speed determination step of determining, as the rotation speed of the motor at the current generation timing of the periodic signal, the smaller one of the speed upper limit, which is the upper limit of the speed that can be determined as the speed;
a drive signal generating step for generating a drive signal for driving the motor so as to achieve the determined rotational speed of the motor;
In the speed determination step, the rotational speed of the motor to be determined is reduced according to the number of consecutive low count cycles, which are cycles in which the position signal count step is not counted in the predetermined cycle. A motor control method, including determining an upper limit.
JP2021011553A 2021-01-27 2021-01-27 Motor control device, motor control system, and motor control method Pending JP2022115007A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2021011553A JP2022115007A (en) 2021-01-27 2021-01-27 Motor control device, motor control system, and motor control method
PCT/JP2021/041470 WO2022163066A1 (en) 2021-01-27 2021-11-11 Motor control device, motor control system, and motor control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021011553A JP2022115007A (en) 2021-01-27 2021-01-27 Motor control device, motor control system, and motor control method

Publications (1)

Publication Number Publication Date
JP2022115007A true JP2022115007A (en) 2022-08-08

Family

ID=82653104

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021011553A Pending JP2022115007A (en) 2021-01-27 2021-01-27 Motor control device, motor control system, and motor control method

Country Status (2)

Country Link
JP (1) JP2022115007A (en)
WO (1) WO2022163066A1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008187770A (en) * 2007-01-26 2008-08-14 Hitachi Ltd Motor position controller
JP6387629B2 (en) * 2013-04-16 2018-09-12 株式会社リコー Motor control apparatus, image forming apparatus, and motor control method
JP6975632B2 (en) * 2017-12-21 2021-12-01 ルネサスエレクトロニクス株式会社 Semiconductor device and its rotation abnormality detection method

Also Published As

Publication number Publication date
WO2022163066A1 (en) 2022-08-04

Similar Documents

Publication Publication Date Title
JP5491207B2 (en) Stepping motor drive device
US5939851A (en) Position control device
US6831431B1 (en) Method for regulating the rotational speed of a motor and a motor for carrying out a method of this type
WO2022163066A1 (en) Motor control device, motor control system, and motor control method
JP6841336B2 (en) Motor control device and storage medium
JP2009095154A (en) Motor controller and its speed detection method
JP7153767B2 (en) power converter
JP2017003467A (en) Rotation detection device, rotation drive device, image formation apparatus and rotation detection method
JP2016039748A (en) Motor controller, motor control system, motor control method, and motor control program
JP4657435B2 (en) Brushless motor drive control method and apparatus
JP5521866B2 (en) Motor control device
JP6723197B2 (en) Motor drive control device and motor drive control method
JP3815238B2 (en) Motor rotation control method
JP2005526982A (en) Method for determining rotational speed and apparatus for determining rotational speed
JP6758494B2 (en) Rotation angle detector and AC rotor control device
JP2781232B2 (en) Steady-state reach detection device in motor controller
JP7461848B2 (en) MOTOR DRIVE CONTROL DEVICE AND CONTROL METHOD FOR MOTOR DRIVE CONTROL DEVICE
JPH0344506B2 (en)
JP2022084100A (en) Motor drive device and motor drive method
KR100300131B1 (en) velocity control system and velocity command generating method for motor
JP2007028774A (en) Driver of brushless motor
JPH06225580A (en) Controller for motor
JPH0352581A (en) Rotational speed detector for motor
JP2001352775A (en) Rotational speed detector for induction motor
JP2820747B2 (en) Steady-state reach detection device in motor controller

Legal Events

Date Code Title Description
RD07 Notification of extinguishment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7427

Effective date: 20210811

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211112