JP2008160900A - Stepping motor controller and printer - Google Patents

Stepping motor controller and printer Download PDF

Info

Publication number
JP2008160900A
JP2008160900A JP2006343478A JP2006343478A JP2008160900A JP 2008160900 A JP2008160900 A JP 2008160900A JP 2006343478 A JP2006343478 A JP 2006343478A JP 2006343478 A JP2006343478 A JP 2006343478A JP 2008160900 A JP2008160900 A JP 2008160900A
Authority
JP
Japan
Prior art keywords
phase
switching
excitation method
stepping motor
excitation
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
JP2006343478A
Other languages
Japanese (ja)
Inventor
Naoya Sato
直也 佐藤
Satoshi Hanzawa
聡 半沢
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.)
Oki Electric Industry Co Ltd
Oki Data Systems Co Ltd
Original Assignee
Oki Data Corp
Oki Data Systems 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 Oki Data Corp, Oki Data Systems Co Ltd filed Critical Oki Data Corp
Priority to JP2006343478A priority Critical patent/JP2008160900A/en
Publication of JP2008160900A publication Critical patent/JP2008160900A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prevent step-out of a motor by correcting discontinuity of control due to difference in a basic step angle of each of excitation systems switched during driving the motor. <P>SOLUTION: A controller is provided with an excitation switching correcting section 27 for correcting a phase switching step value in switching a phase excitation system, so that even when the phase excitation system is changed, the difference of the basic step angle of each of the excitation systems can be corrected. Alternatively, an interrupt control section 57 is further provided to minimize the occurrence of interruption and the frequency of step value correcting processing in switching the phase excitation system. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、プリンタ、複写機、ファクシミリ等の印刷装置における媒体搬送やヘッドを駆動するステッピングモータの制御技術に関する。   The present invention relates to a technique for controlling a stepping motor that drives a medium and a head in a printing apparatus such as a printer, a copying machine, and a facsimile machine.

従来より、印刷装置の媒体搬送やヘッドを駆動するステッピングモータの電流リップルを小さくでき、ステッピングモータの発熱を抑えることができる技術としてマイクロステップ駆動技術があった。そして、特に、低速回転時および高速回転時の低周波加速・減速領域における振動を抑えたステッピングモータの駆動方法を提供する技術として、以下のような技術があった(例えば、特許文献1参照。)。   Conventionally, there has been a micro-step driving technique as a technique that can reduce the current ripple of a stepping motor that drives a medium of a printing apparatus and drives a head and can suppress heat generation of the stepping motor. In particular, as a technique for providing a stepping motor driving method that suppresses vibration in a low-frequency acceleration / deceleration region during low-speed rotation and high-speed rotation, there is the following technique (see, for example, Patent Document 1). ).

まず、前記ステッピングモータの構成・動作を説明すると、ステッピングモータは、一般に、図5に示したように、90度間隔で配置された4個の固定子41と、当該固定子の内側に回転自在な永久磁石からなる回転子(以下「ロータ40」という)が設けられており、ロータ40にモータ出力軸が連結された構成となっている。   First, the configuration and operation of the stepping motor will be described. As shown in FIG. 5, the stepping motor generally has four stators 41 arranged at intervals of 90 degrees and is rotatable inside the stator. A rotor made of a permanent magnet (hereinafter referred to as “rotor 40”) is provided, and a motor output shaft is connected to the rotor 40.

そして、対向する2個の固定子には同一コイルが巻かれ、当該コイルに電磁電流としてA相電流、B相電流の相電流を流すことにより発生する磁界により永久磁石である回転子が反発して回転するトルクを発生するようになっている。   The same coil is wound around the two opposing stators, and the rotor, which is a permanent magnet, is repelled by the magnetic field generated by passing phase currents of phase A and phase B as electromagnetic currents through the coils. To generate rotating torque.

前記相電流の供給パターンには1相励磁、1−2相励磁、2−2相励磁などがあり、1相励磁は、1相ごとに順に励磁し、基本ステップ角度で回転させる駆動方式であり、2−2相励磁は、常に相互に隣接する2相(A相・B相)を同時に励磁する駆動方式であり、1−2相励磁は、前記1相励磁と2−2相励磁を交互の繰り返す駆動方式である。   The phase current supply pattern includes 1-phase excitation, 1-2-phase excitation, 2-2-phase excitation, etc. 1-phase excitation is a drive method in which excitation is performed sequentially for each phase and rotated at a basic step angle. 2-2 phase excitation is a drive system that always excites two phases (A phase and B phase) adjacent to each other at the same time. 1-2 phase excitation alternates between the 1 phase excitation and 2-2 phase excitation. It is a driving method that repeats.

そして、高速回転時の振動や騒音を防止するための駆動方式として、ステップ角をさらに細かく分割し回転を滑らかに駆動するマイクロステップ駆動方式があり、1−2相励磁を2倍細かくしたW1−2励磁、さらに2倍細かくした2W1−2励磁方式などがある。   As a driving method for preventing vibration and noise during high-speed rotation, there is a micro-step driving method in which the step angle is further finely divided and the rotation is driven smoothly. There are two excitations, and a 2W1-2 excitation method that is two times finer.

以上の各駆動方式による基本ステップを図8に示す。同図の数字は、右下45度の方向を「0」ステップとした相切替ステップ値(以下「ステップ値」という)を表している。同図に示したように、2−2相励磁方式では、相互に隣接する2相(A相・B相)を同時に励磁する励磁方式であるので、4つの45度方向へのステップとして表される。   FIG. 8 shows basic steps according to each of the above driving methods. The numbers in the figure represent phase switching step values (hereinafter referred to as “step values”) in which the direction of 45 degrees at the lower right is set to “0” steps. As shown in the figure, the 2-2 phase excitation method is an excitation method for exciting two phases (A phase and B phase) adjacent to each other at the same time, and is expressed as four steps in the 45 degree direction. The

1−2相励磁方式は2−2相励磁方式のステップを2分割し、W1−2相励磁方式ではさらに2分割し、2W1−2相励磁方式ではさらに2分割したステップとなっている。   In the 1-2 phase excitation method, the steps of the 2-2 phase excitation method are divided into two, the W1-2 phase excitation method is further divided into two, and the 2W1-2 phase excitation method is further divided into two steps.

従って、2−2相励磁方式は、基本ステップ角度は粗いが制御部の処理量が少ないので、高速回転での制御に適しており、逆に2W1−2相励磁方式では制御部の処理量は多くなるが、細かい駆動制御ができるので振動を抑えることのできる制御となる。   Therefore, the 2-2 phase excitation method is suitable for control at high speed rotation because the basic step angle is rough but the processing amount of the control unit is small. Conversely, in the 2W1-2 phase excitation method, the processing amount of the control unit is Although the number is increased, fine drive control can be performed, so that vibration can be suppressed.

これら各励磁方式の特徴を生かし、高速回転時では2−2相励磁方式或いは1−2相励磁を用い、低速回転時では、マイクロステップ駆動であるW1−2励磁や2W1−2励磁方式等を用い、モータの回転速度に応じて相励磁方式を切り替えることにより、低速回転時では低周波加速領域および減速領域における振動を抑え、高速回転時ではトルク不足を補うようにしている。
特開平9−313000号公報
Taking advantage of the characteristics of each of these excitation methods, 2-2 phase excitation method or 1-2 phase excitation is used at high speed rotation, and W1-2 excitation or 2W1-2 excitation method that is microstep drive is used at low speed rotation. By switching the phase excitation method according to the rotation speed of the motor, vibrations in the low frequency acceleration region and deceleration region are suppressed during low-speed rotation, and insufficient torque is compensated for during high-speed rotation.
JP 9-313000 A

しかしながら、上記従来の制御装置では、モータが高速回転しているときであっても、振動をできるだけ少なくする制御を行う必要のある処理を行う場合などでは、2−2相励磁から1−2相励磁に切り替えを行ったり、或いは当該処理後、1−2相励磁から2−2相励磁に戻すように制御する場合がある。   However, in the conventional control device described above, even when the motor is rotating at a high speed, when performing a process that needs to perform control to reduce vibration as much as possible, 2-2 phase excitation to 1-2 phase is performed. In some cases, switching to excitation is performed, or after the processing, control is performed so as to return from 1-2 phase excitation to 2-2 phase excitation.

以上のようにモータが回転しているときに励磁方式を切り替えると、各励磁方式の基本ステップ角の違いにより、ロータ40を連続的に駆動制御できず、モータ脱調の原因となることがあった。   If the excitation method is switched while the motor is rotating as described above, the rotor 40 cannot be continuously driven and controlled due to the difference in the basic step angle of each excitation method, which may cause motor step-out. It was.

例えば、2−2相励磁方式を継続してモータが回転しているときでは、基本ステップ角が常に「8ステップ」であるので、初期ステップ「0」において想定する1つ前のロータ40の位置は右上位置となり、実際のロータ位置も同様であるので連続性は維持されるが、図7下段に示したように、2−2相励磁方式から1−2相励磁方式に切り替えを行う場合では、2−2相励磁方式の最後のステップは「ステップ24」であり(タイミングTe)、1−2相励磁方式に切り替えた場合の初期ステップ「0」において想定する1つ前のロータ位置はステップ「28」である右方向であるので、想定する前のロータ40位置が実際のロータ位置と異なってくる。   For example, when the motor continues to rotate in the 2-2 phase excitation method, the basic step angle is always “8 steps”, and therefore the position of the previous rotor 40 assumed in the initial step “0” is assumed. Is the upper right position, and the actual rotor position is the same, so continuity is maintained. However, when switching from the 2-2 phase excitation method to the 1-2 phase excitation method as shown in the lower part of FIG. The last step of the 2-2 phase excitation system is “Step 24” (timing Te), and the rotor position assumed in the initial step “0” when switching to the 1-2 phase excitation system is the step. Since it is the right direction which is “28”, the position of the rotor 40 before the assumption is different from the actual rotor position.

その結果、図7の下段のタイムチャートの(A)として示したように、想定していたロータ回転時間が、半分の4ステップ分となる。逆に、1−2相励磁方式から2相励磁方式に切り換える際にも、同様に基本ステップ角の違いにより、初期位置から1つ前のステップにて予定するロータ位置が異なり、この場合は、ロータ40の回転が進み過ぎており、図7の(B)として示したようにロータ回転が4ステップ進み過ぎ、この場合もモータ脱調の原因となることがあった。   As a result, as shown as (A) in the time chart in the lower part of FIG. 7, the assumed rotor rotation time is half four steps. Conversely, when switching from the 1-2 phase excitation method to the 2-phase excitation method, the rotor position planned in the previous step from the initial position is also different due to the difference in the basic step angle. The rotation of the rotor 40 has progressed too much, and as shown in FIG. 7B, the rotor rotation has progressed by 4 steps, which may cause motor step-out.

本発明は、上記課題を解決するため以下の構成を採用する。すなわち、複数の励磁方式にて、所定の時間間隔ごとに相切替ステップ値を更新しながら相切替を順次行って、ステッピングモータを回転駆動する制御装置において、前記励磁方式を切り替える際に、当該切替前後の各励磁方式の基本ステップ角の差に基づき前記相切替ステップ値の補正を行う励磁切替補正手段を設けた。   The present invention employs the following configuration in order to solve the above problems. That is, when switching the excitation method in a controller that rotates the stepping motor by sequentially performing phase switching while updating the phase switching step value at predetermined time intervals in a plurality of excitation methods, Excitation switching correction means for correcting the phase switching step value based on the difference between the basic step angles of the front and rear excitation methods is provided.

以上の本発明によれば、ステッピングモータ制御装置によれば、励磁方式を切り替える際に基本ステップ角の違いを補正する励磁切替補正部を設け、励磁方式の切替による基本ステップ角の変化を補正できるようにしたので、モータが脱調することがない。   According to the present invention described above, according to the stepping motor control device, the excitation switching correction unit that corrects the difference in the basic step angle when switching the excitation method is provided, and the change in the basic step angle due to the switching of the excitation method can be corrected. As a result, the motor does not step out.

以下、本発明に係る実施例を、図面を用いて詳細に説明する。なお、図面に共通する要素には同一の符号を付す。   Hereinafter, embodiments according to the present invention will be described in detail with reference to the drawings. In addition, the same code | symbol is attached | subjected to the element common to drawing.

実施例1のステッピングモータ制御装置は、励磁方式が切り替わる際にステップ値を補正する励磁切替補正部を設け、励磁方式の切替による基本ステップ角の変化を補正できるようにしたものである。   The stepping motor control apparatus according to the first embodiment includes an excitation switching correction unit that corrects a step value when the excitation method is switched, so that a change in the basic step angle due to switching of the excitation method can be corrected.

(構成)
(印刷装置の構成)
まず、図2を用いて、実施例1の印刷装置の概略構成を説明する。同図に示したように、実施例1の印刷装置15は、印刷装置15を制御するCPU1と、CPU1からの指令により印刷やヘッド3等の各部の移動制御を行う制御部2と、制御部2の制御により各部の駆動を行うドライバ16から構成される。
(Constitution)
(Configuration of printing device)
First, the schematic configuration of the printing apparatus according to the first embodiment will be described with reference to FIG. As shown in FIG. 1, the printing apparatus 15 according to the first embodiment includes a CPU 1 that controls the printing apparatus 15, a control unit 2 that performs printing and movement control of each unit such as the head 3 according to a command from the CPU 1, and a control unit. 2 is constituted by a driver 16 that drives each part under the control of 2.

そして、CPU1には、制御を実行するためのプログラムを格納するプログラムROM9と、印刷するフォントデータを格納するフォントROM10、後述のホストコンピュータ13から送信されたデータを格納するRAM11が接続されており、さらに媒体位置を検出するセンサ12が接続されている。   The CPU 1 is connected with a program ROM 9 for storing a program for executing control, a font ROM 10 for storing font data to be printed, and a RAM 11 for storing data transmitted from a host computer 13 described later. Further, a sensor 12 for detecting the medium position is connected.

そして、制御部2には、ドライバ16として、ヘッド3を駆動して印刷を行うドライバ16a、ヘッド3を移動させるスペースモータ6を駆動制御するドライバ16b、媒体を搬送するフィードモータ7を駆動制御するドライバ16cが接続されている。また、制御部2には、印刷装置15の状態をユーザに知らせるLED4や、ユーザが設定できる各種のオプション指定などを行うSW5が接続されている。なお、以下の説明では、スペースモータ6とドライバ16bを例として説明するが、フィードモータ7とドライバ16cについても同様である。   The control unit 2 controls the driver 16 as a driver 16 to drive the head 3 to perform printing, a driver 16 b to drive and control the space motor 6 that moves the head 3, and a feed motor 7 that transports the medium. A driver 16c is connected. The control unit 2 is connected to an LED 4 that informs the user of the state of the printing apparatus 15 and a SW 5 that performs various option designations that can be set by the user. In the following description, the space motor 6 and the driver 16b will be described as an example, but the same applies to the feed motor 7 and the driver 16c.

そして、ホストコンピュータ13と印刷装置15はIEEE1284、USBやRS232C等のインタフェース8にて接続される。   The host computer 13 and the printing apparatus 15 are connected by an interface 8 such as IEEE1284, USB, RS232C or the like.

以上の構成により、ホストコンピュータ13が、ホストコンピュータ13内のプリンタドライバ14により制御コマンドや文字データを生成すると、印刷装置15にインタフェース8を経由して転送し、これを受信し、RAM11に格納したCPU1は、当該格納した受信データをデコードしフォントデータをフォントROM10から取得しキャラクタやイメージデータの印刷データを作成し、媒体に印刷を行う。   With the above configuration, when the host computer 13 generates a control command or character data by the printer driver 14 in the host computer 13, it is transferred to the printing apparatus 15 via the interface 8, received, and stored in the RAM 11. The CPU 1 decodes the stored received data, acquires font data from the font ROM 10, creates print data of character and image data, and prints on the medium.

一方、制御部2は、SW5の設定値や媒体の位置を検出するセンサ12に基づき、作成した印刷データを印刷するために、媒体に印刷を行うヘッド3、当該ヘッド3を移動させるためのスペースモータ6、媒体を搬送するためのフィードモータ7を制御して印刷を行い、必要に応じて前記LED4にてユーザに状態等を知らせるようになっている。   On the other hand, the control unit 2 uses the sensor 12 that detects the setting value of the SW 5 and the position of the medium to print the generated print data, and the head 3 that prints on the medium and the space for moving the head 3. Printing is performed by controlling the motor 6 and the feed motor 7 for transporting the medium, and the LED 4 informs the user of the state and the like as necessary.

(制御部のファームウェア機能構成)
次に、図3のファームウェア機能ブロック図を用いて、CPU1にて実行するファームウェアの機能ブロックについて説明する。
(Control unit firmware function configuration)
Next, firmware function blocks executed by the CPU 1 will be described with reference to the firmware function block diagram of FIG.

同図に示したように、CPU1にて実行するファームウェアは、電源投入によりRAM11等のメモリ、スペースモータ6、LED4などのデバイスの初期化を行う初期化処理部30と、初期化が完了した後、ホストコンピュータ13とのデータ送受信を開始するホストインタフェース送受信処理部31と、受信したデータをデコードして印刷データに展開する受信データデコード・展開処理部32とからなる。   As shown in the figure, the firmware executed by the CPU 1 includes an initialization processing unit 30 that initializes a memory such as the RAM 11 and a device such as the space motor 6 and the LED 4 when the power is turned on, and after the initialization is completed. The host interface transmission / reception processing unit 31 starts data transmission / reception with the host computer 13 and the received data decoding / decompression processing unit 32 decodes the received data and develops it into print data.

さらに、デコード処理により展開したデータを媒体に印刷するための制御を行う印刷制御処理33と、媒体を搬送する制御を行うフィードモータ制御処理34と、展開した印刷データを媒体に印刷するための制御を行うヘッド制御処理35と、媒体の任意の位置に印刷を行うためにヘッド3を移動するための制御を行うスペースモータ制御処理36とからなる。   Further, a print control process 33 for performing control for printing the data developed by the decoding process on the medium, a feed motor control process 34 for controlling the conveyance of the medium, and a control for printing the developed print data on the medium. And a space motor control process 36 for performing control for moving the head 3 to perform printing at an arbitrary position on the medium.

(制御部のハードウェア構成)
次に、図2にて説明した制御部2のうち、本発明に特に関係するステッピングモータ制御のハードウェア構成を図1の制御部2のハードウェア構成図を用いて説明する。
(Hardware configuration of control unit)
Next, of the control unit 2 described with reference to FIG. 2, the hardware configuration of the stepping motor control particularly related to the present invention will be described with reference to the hardware configuration diagram of the control unit 2 of FIG.

同図に示したように、実施例1の制御部2は、相切替信号の切替時間をカウントするためのタイマー部23を有し、当該タイマー部23からの出力によってステップ値の更新を行う相切替ステップ更新部24を有する。そして、CPU1には相切替ステップ更新部24からの出力として割込信号29が接続されている。   As shown in the figure, the control unit 2 of the first embodiment has a timer unit 23 for counting the switching time of the phase switching signal, and the phase value is updated by the output from the timer unit 23. A switching step update unit 24 is included. The CPU 1 is connected with an interrupt signal 29 as an output from the phase switching step update unit 24.

さらに、実施例1の制御部2は、CPU1からの指令に基づき設定する励磁方式と前記更新されたステップ値からA相およびB相の切替信号を生成する相切替信号出力部25aとA相およびB相の電流値に相当するPWM制御のオンデューティ時間を決定する電流制御信号出力部25bと、前記オンデューティ時間に応じたA相及びB相の電流制御信号をモータドライバ16bに出力する電流制御部26とを有する。   Furthermore, the control unit 2 of the first embodiment includes a phase switching signal output unit 25a that generates an A-phase and B-phase switching signal from the excitation method set based on a command from the CPU 1 and the updated step value, an A-phase, A current control signal output unit 25b for determining an on-duty time of PWM control corresponding to the current value of the B-phase, and a current control for outputting A-phase and B-phase current control signals corresponding to the on-duty time to the motor driver 16b. Part 26.

図4は、32ステップに分割した前記ステップ値に対応するA相及びB相の相切替信号及びA相及びB相の電流値をまとめたテーブルである。なお、相切替信号の「1」は正方向の電流を流すことを表し、「0」は逆方向の電流を流すことを表す。また、ステップ値は、「0」から「31」までの整数で表され、タイマー部23からの出力パルスを相切替ステップ更新部24で検出することによりインクリメントされ、ステップ値が「31」のときに「0」にリセットされるようになっている。   FIG. 4 is a table summarizing the A-phase and B-phase phase switching signals and the A-phase and B-phase current values corresponding to the step values divided into 32 steps. Note that “1” in the phase switching signal indicates that a forward current flows, and “0” indicates that a reverse current flows. The step value is represented by an integer from “0” to “31”, and is incremented by detecting the output pulse from the timer unit 23 by the phase switching step update unit 24. When the step value is “31” Is reset to “0”.

そして、各励磁方式によって相切替信号及び電流制御信号の切替タイミングが異なり、「各励磁方式に対する適用」欄の○印のステップ値のときだけ相切替信号、当該出力電流が適用され、相切替信号出力部25a、電流制御信号出力部25bにて当該相切替信号、出力電流に更新される。   The switching timing of the phase switching signal and the current control signal differs depending on each excitation method, and the phase switching signal and the output current are applied only when the step value marked with a circle in the “Applied to each excitation method” column, the phase switching signal The phase switching signal and the output current are updated by the output unit 25a and the current control signal output unit 25b.

例えば、2−2相励磁の場合では、ステップ値が「0」、「8」、「16」、「24」に○印が記載されているので、ステップ値が「0」、「8」、「16」、「24」のときのみ、相切替信号、出力電流が適用される。   For example, in the case of 2-2 phase excitation, since the step values “0”, “8”, “16”, “24” are marked with “、”, the step values “0”, “8”, Only when “16” or “24”, the phase switching signal and the output current are applied.

そして、ステップ値が「0」の場合では、A相切替信号は「0」、B相切替信号は「1」、A相電流値、B相電流値はともに「74%」と記載されているので、図6のステップ「0」のように、ステッピングモータ(図5)のA相には74%の逆方向の電流を流し、B相には74%の正方向の電流を流すように電流制御部26により制御される。   When the step value is “0”, the A phase switching signal is “0”, the B phase switching signal is “1”, and both the A phase current value and the B phase current value are “74%”. Therefore, as shown in step “0” of FIG. 6, the current of the stepping motor (FIG. 5) is such that a reverse current of 74% flows in the A phase and a positive current of 74% flows in the B phase. It is controlled by the control unit 26.

同様に、ステップ値が「0」、「8」、「16」、「24」のみ相切替信号、出力電流が適用されるので図6の破線の波形のように各相に電流が流れることになる。   Similarly, since the phase switching signal and the output current are applied only to the step values “0”, “8”, “16”, and “24”, the current flows in each phase as shown by the broken line waveform in FIG. Become.

また、2W1−2相励磁方式では、ステップ値すべてに○印が記載されているので、すべてのステップ値において、相切替信号および出力電流が適用される。   In the 2W1-2 phase excitation method, since all the step values are marked with ◯, the phase switching signal and the output current are applied to all the step values.

例えば、ステップ値が「1」の場合は、A相切替信号は「0」、B相切替信号は「1」、A相電流値は「83%」、B相電流値は「61%」と記載されているので、図6のステップ値「1」のように、ステッピングモータ(図7)のA相には83%の逆方向の電流を流し、B相には61%の正方向の電流を流すように電流制御部26により制御される。   For example, when the step value is “1”, the A phase switching signal is “0”, the B phase switching signal is “1”, the A phase current value is “83%”, and the B phase current value is “61%”. As shown in the step value “1” of FIG. 6, 83% of the reverse current flows in the A phase of the stepping motor (FIG. 7), and 61% of the positive current flows in the B phase. Is controlled by the current control unit 26.

同様に、すべてのステップ値に相切替信号および出力電流が適用されるので図6の実線の波形のように各相に電流が流れることになる。   Similarly, since the phase switching signal and the output current are applied to all step values, a current flows through each phase as shown by the solid line waveform in FIG.

実施例1の制御部2は、さらに励磁方式が変更されたときに、基本ステップ角の違いを補正するために適正なステップ値に補正する機能を有する励磁切替補正部27を設けている。励磁切替補正部27には、励磁方式が切替わったかどうかを検出する相切替タイミング検出部27aが内蔵されている。   The control unit 2 of the first embodiment further includes an excitation switching correction unit 27 having a function of correcting to an appropriate step value in order to correct a difference in basic step angle when the excitation method is changed. The excitation switching correction unit 27 includes a phase switching timing detection unit 27a that detects whether the excitation method has been switched.

図9は、モータの正回転FOW、逆回転REVごとに、前記励磁切替補正部27にてステップ値を補正する補正値を格納したステップ値補正テーブルである。このステップ値補正テーブルは、例えば、励磁切替補正部27内の図示しないメモリに格納するようにしてもよいし、図示しない制御部2のメモリ等に格納するようにしてもよい。   FIG. 9 is a step value correction table in which correction values for correcting the step value by the excitation switching correction unit 27 are stored for each forward rotation FOW and reverse rotation REV of the motor. For example, the step value correction table may be stored in a memory (not shown) in the excitation switching correction unit 27, or may be stored in a memory of the control unit 2 (not shown).

なお、図9の網掛けの部分は励磁方式が切り替わらなかった場合を示し、FOW方向の回転では、次のステップは1カウントアップするので「+1」となっており、REV方向の回転では次のステップは1カウントダウンするので「−1」となっている。   The shaded portion in FIG. 9 shows the case where the excitation method has not been switched. In the rotation in the FOW direction, the next step is incremented by 1 and is “+1”, and in the rotation in the REV direction, Since the step is counted down by 1, it is “−1”.

そして、例えば、FOW方向の回転において、2−2相励磁方式から1−2相励磁方式に切り替えられたときは、「−3」となっているので4ステップ分、ステップ値を戻すように補正することになる。   And, for example, in the rotation in the FOW direction, when switching from the 2-2 phase excitation method to the 1-2 phase excitation method, it is “−3”, so it is corrected to return the step value by 4 steps. Will do.

同様に、REV方向の回転において、2−2相励磁方式から1−2相励磁方式に切り替えられたときは、「+3」となっているので4ステップ分、ステップ値を進めるように補正することになる。   Similarly, when switching from the 2-2 phase excitation method to the 1-2 phase excitation method in the rotation in the REV direction, it is “+3”, so that the step value is corrected to advance by 4 steps. become.

(動作)
以上の構成により、実施例1のステッピングモータ制御装置は、以下のように動作する。この動作を図7の励磁方式切替時のタイムチャートおよび図10の動作フローチャート図および図11に示した割込み発生のタイムチャートを用いて詳細に説明する。なお、図7の励磁方式切替時のタイムチャートは、上段のチャートが実施例1を適用したときのタイムチャートであり、下段のチャートが従来技術を適用したときのタイムチャートである。
(Operation)
With the above configuration, the stepping motor control apparatus according to the first embodiment operates as follows. This operation will be described in detail with reference to the time chart at the time of switching the excitation method in FIG. 7, the operation flowchart in FIG. 10, and the interrupt generation time chart in FIG. 7 is a time chart when the first chart is applied to the upper chart, and a lower chart is a time chart when the conventional technique is applied.

(タイマー割込発生の動作)
まず、実施例1のステッピングモータ制御装置では、CPU1からのステッピングモータ回転駆動指令を受信すると、図11に示したタイムチャートのように所定のタイミングごとに割込み信号を発生させる。
(Timer interrupt generation operation)
First, when the stepping motor control device of the first embodiment receives a stepping motor rotation drive command from the CPU 1, an interrupt signal is generated at predetermined timings as shown in the time chart of FIG.

すなわち、CPU1から指令されるモータ回転速度に対応したタイマー値を随時セットし、クロック信号の立ち上がりのタイミングでタイマー値をカウントダウンする。   That is, a timer value corresponding to the motor rotation speed commanded from the CPU 1 is set as needed, and the timer value is counted down at the rising timing of the clock signal.

そして、タイマー値が「0」となると、タイマー値ラッチフラッグを「1」として次のタイマー値をラッチし(タイミングTa)、次のクロックにて割込み信号を発生させ(タイミングTb)、ステップ値を更新するように動作する。   When the timer value becomes “0”, the timer value latch flag is set to “1”, the next timer value is latched (timing Ta), an interrupt signal is generated at the next clock (timing Tb), and the step value is set. Works to update.

そして、次のタイマー値への更新準備が終了すると、割込み信号を「0」とし、次のタイマー値を確定して置く(タイミングTc)。   When preparation for updating to the next timer value is completed, the interrupt signal is set to “0”, and the next timer value is determined and set (timing Tc).

なお、ラッチするタイマー値は、同図に示したようにあらかじめ準備して置くようにすれば、次のタイマー値を準備するための更新処理時間後にタイマーをセットするような無駄な処理時間が発生することがない。   If the timer value to be latched is prepared in advance as shown in the figure, a wasteful processing time such as setting the timer after the update processing time for preparing the next timer value occurs. There is nothing to do.

(相切替の動作)
以上のタイマー割込みごとに、以下の処理を行う。この動作を図10の動作フローチャートを用いて説明する。まず、CPU1から励磁方式の切替要求があったかどうかを確認し(ステップS31)、励磁方式の切替要求がなかった場合は、現在の励磁方式のままであるのでステップ値を「+1」してステップS35に進む(ステップS32)。
(Phase switching operation)
The following processing is performed for each timer interrupt described above. This operation will be described with reference to the operation flowchart of FIG. First, it is confirmed whether or not there is a request for switching the excitation method from the CPU 1 (step S31). If there is no request for switching the excitation method, the current excitation method is maintained, so the step value is set to “+1” and step S35 is performed. (Step S32).

そして、現在の励磁方式と更新したステップ値に基づき図4の切替タイミングおよび各出力値テーブルを参照し、相切替信号、電流値を更新するタイミングか行うかどうかを判定し、切替タイミングでないときは、切替タイミングとなるまで待ち(ステップS35)、切替タイミングとなったときに、該当する相切替信号、電流値をセットし(ステップS36)、本処理を終了する。   Then, referring to the switching timing and each output value table in FIG. 4 based on the current excitation method and the updated step value, it is determined whether or not to update the phase switching signal and the current value. The process waits until the switching timing is reached (step S35). When the switching timing is reached, the corresponding phase switching signal and current value are set (step S36), and the process is terminated.

一方、ステップS31にて励磁方式の切替要求があった場合は、前述ステップS35と類似した処理として、要求のあった励磁方式、すなわち、切替後の励磁方式と次のステップ値に基づき図4の切替タイミングおよび各出力値テーブルを参照し、相切替信号、電流値を更新するタイミングか行うかどうかを判定し、切替タイミングでないときは、切替タイミングとなるまで待つ(ステップS33)。   On the other hand, when there is a request for switching the excitation method in step S31, processing similar to that in step S35 is performed as shown in FIG. 4 based on the requested excitation method, that is, the excitation method after switching and the next step value. With reference to the switching timing and each output value table, it is determined whether or not it is time to update the phase switching signal and current value. If it is not the switching timing, the process waits until the switching timing is reached (step S33).

そして、切替タイミングとなったときに、図9のステップ値補正テーブルを参照し、該当する箇所の補正値にてステップ値を補正する(ステップS34)。例えば、ステップ値「0」となるときに、FOW方向の回転指令があり、2−2相励磁方式から1−2相励磁方式に切り替える指令があったときは、ステップ値補正テーブルに「−3」と格納されているので4ステップ分戻すように補正されステップ値は「29」に補正される。なお、本来であれば4ステップ分戻すので、ステップ値は「32−4=28」となるが、FOW方向の回転であるのでさらにインクリメントされた「29」に補正される。   Then, when the switching timing comes, the step value correction table in FIG. 9 is referred to, and the step value is corrected with the correction value at the corresponding location (step S34). For example, when the step value becomes “0”, there is a rotation command in the FOW direction, and when there is a command to switch from the 2-2 phase excitation method to the 1-2 phase excitation method, “−3” is displayed in the step value correction table. Is stored so that it is corrected by 4 steps, and the step value is corrected to “29”. Since the original value is returned by 4 steps, the step value is “32-4 = 28”, but since it is a rotation in the FOW direction, it is further corrected to “29”.

また、REV方向の回転指令があり、2−2相励磁方式から1−2相励磁方式に切り替える指令があったときは、ステップ値補正テーブルに「+3」と格納されているので実質4ステップ分先に進むように補正する。なお、この場合も、本来であれば4ステップ分先に進むようにするので、ステップ値は「0+4=4」となるが、REV方向の回転であるのでさらにデクリメントされた「3」に補正される。   In addition, when there is a rotation command in the REV direction and there is a command to switch from the 2-2 phase excitation method to the 1-2 phase excitation method, “+3” is stored in the step value correction table, so substantially four steps. Correct to go forward. In this case as well, since it is supposed to advance four steps ahead, the step value is “0 + 4 = 4”. However, since the rotation is in the REV direction, it is further corrected to “3”. The

そして、新たな励磁方式と補正後のステップ値に基づき図4の切替タイミングおよび各出力値テーブルを参照し、相切替信号、電流値を更新するタイミングかどうかを判定し、切替タイミングでないときは、切替タイミングとなるまで待ち、切替タイミングとなったときに、該当する相切替信号、電流値をセットして((ステップS35・S36)、本処理を終了する。   Then, referring to the switching timing and each output value table in FIG. 4 based on the new excitation method and the corrected step value, it is determined whether it is the timing to update the phase switching signal and the current value. Wait until the switching timing is reached. When the switching timing is reached, the corresponding phase switching signal and current value are set ((Steps S35 and S36), and this process is terminated.

以上の動作を図7上段のタイムチャートを用いてさらに詳細に説明する。なお、このタイムチャートでは、2−2相励磁方式にて駆動されているステップ値「24」の後に(タイミングTe)、CPU1から2相励磁方式から1−2相励磁方式に変更する旨の指令があり(タイミングTf)、その後、ステップ値「12」の後に(タイミングTg)、CPU1から再び2相励磁方式に変更する旨の指令があったとき(タイミングTh)の例を示している。   The above operation will be described in more detail with reference to the time chart in the upper part of FIG. In this time chart, after step value “24” driven by the 2-2 phase excitation method (timing Te), the CPU 1 instructs to change from the 2-phase excitation method to the 1-2 phase excitation method. (Timing Tf), then, after the step value “12” (timing Tg), the CPU 1 gives an instruction to change again to the two-phase excitation method (timing Th).

まず、2−2相励磁方式にて駆動されているので、ステップ値「8」、「16」、「24」、「0」にて相切替タイミングとなり、図6の破線のような駆動電流によりロータ40が順次回転する。   First, since it is driven by the 2-2 phase excitation method, the phase switching timing is set at step values “8”, “16”, “24”, “0”, and the drive current as shown by the broken line in FIG. The rotor 40 rotates sequentially.

そして、ステップ値「24」の次の相切替タイミングである「0」となったときに(タイミングTe)、前述のステップ値補正テーブルを参照し、4ステップ分ステップ値を戻し、ステップ値を「29」とする。そして、4ステップ経過後、再びステップ値が「0」となるので(タイミングTf)、1−2相励磁方式に切り替え、以降1−2相励磁方式による制御を継続して行う(図7(A)部)。   When the next phase switching timing of the step value “24” is “0” (timing Te), the step value correction table is referred to the step value correction table described above, and the step value is set to “ 29 ". Then, since the step value becomes “0” again after 4 steps (timing Tf), the control is switched to the 1-2 phase excitation method, and the control by the 1-2 phase excitation method is subsequently performed (FIG. 7A). ) Part).

そして、1−2相励磁に切替わった後では、「0」「4」「8」「12」「16」「20」「24」「28」にて相切替タイミングとなり、図4の各出力値テーブルを参照しながら駆動電流を更新しロータ40を同図のように順次回転させる。   After switching to 1-2 phase excitation, the phase switching timing is reached at “0” “4” “8” “12” “16” “20” “24” “28”. The drive current is updated while referring to the value table, and the rotor 40 is sequentially rotated as shown in FIG.

そして、ステップ値「12」の後に、CPU1から再び2相励磁方式に変更する旨の指令があったときでは、ステップ値「16」にて相切替タイミングとなるので、ステップ値「12」の次の相切替タイミングである「16」となったときに(タイミングTg)、ステップ値補正テーブルを参照し、1−2相励磁から2−2相励磁に切替わるときの補正値「+5」を読出し、ステップ値を「16+5=21」とし4ステップ分先に進むようにする。   Then, after the step value “12”, when the CPU 1 issues a command to change to the two-phase excitation method again, the step value “16” is the phase switching timing. When the phase switching timing of “16” is reached (timing Tg), the correction value “+5” when switching from 1-2 phase excitation to 2-2 phase excitation is read with reference to the step value correction table. The step value is set to “16 + 5 = 21”, and the process proceeds 4 steps ahead.

そして、4ステップ経過後、再びステップ値が「24」となるので(タイミングTh)、2−2相励磁方式に切り替え、以降2−2相励磁方式による制御を継続して行う(図7(B)部)。   After the elapse of 4 steps, the step value becomes “24” again (timing Th), and the control is switched to the 2-2 phase excitation method. Thereafter, the control by the 2-2 phase excitation method is continued (FIG. 7B). ) Part).

以上のように、モータが回転しているときに励磁方式が切替わっても、励磁方式間の基本ステップの違いを補正でき、想定するロータ40の位置と実際のロータ位置を合致させることができるので、連続性のある安定なモータ駆動制御を行うことができる。   As described above, even if the excitation method is switched while the motor is rotating, the difference in basic steps between the excitation methods can be corrected, and the assumed position of the rotor 40 can be matched with the actual rotor position. Therefore, continuous and stable motor drive control can be performed.

以上の実施例の説明では、図11のようにCPU1への割込信号29への割込みを各ステップごとに発生させ、ステップ値を補正するように説明したが、各励磁方式において切替えタイミング(図4の○印のタイミング)のみ割込みを発生させ、ステップ値を補正するようにすれば、補正の効果に加え、CPU1の負荷を軽減することもできる。   In the above description of the embodiment, it has been described that the interrupt to the interrupt signal 29 to the CPU 1 is generated at each step and the step value is corrected as shown in FIG. If an interrupt is generated only at the timing (circled by 4) and the step value is corrected, the load on the CPU 1 can be reduced in addition to the effect of the correction.

また、相切替ステップ更新部24の出力である相切替信号25a・電流制御部信号出力部25bへの出力と、CPU1への割込信号を別にし、例えば、2−2相励磁方式での切替えタイミングにて割込信号29を発生させるようにして、図示しないタイミング分割手段にて補間したタイミングにてステップ値を補正するようにすれば、補正の効果に加え、CPU1の負荷を軽減することもできる。   Further, the output to the phase switching signal 25a and the current control unit signal output unit 25b, which are the outputs of the phase switching step update unit 24, and the interrupt signal to the CPU 1 are separated, for example, switching in the 2-2 phase excitation method. If the interrupt value 29 is generated at the timing and the step value is corrected at the timing interpolated by the timing division means (not shown), the load on the CPU 1 can be reduced in addition to the correction effect. it can.

(実施例1の効果)
以上の実施例1のステッピングモータ制御装置によれば、励磁方式が切り替わる際に基本ステップ角の違いを補正する励磁切替補正部を設け、基本ステップ角の違いによるロータ位置の不連続性を補正できるようにしたので、モータが脱調することがない。
(Effect of Example 1)
According to the stepping motor control device of the first embodiment described above, the excitation switching correction unit that corrects the difference in the basic step angle when the excitation method is switched can be provided, and the discontinuity of the rotor position due to the difference in the basic step angle can be corrected. As a result, the motor does not step out.

実施例2のステッピングモータ制御装置は、励磁方式を変更する際、ステップ値補正処理を実施する最小限の割込みを発生させる割込制御部57を設けたものである   The stepping motor control apparatus according to the second embodiment includes an interrupt control unit 57 that generates a minimum interrupt for performing a step value correction process when changing the excitation method.

(構成)
実施例2のステッピングモータ制御装置の構成は、図12に示したように、実施例1の構成に加え、割込制御部57を新たに設けた構成となっている。その他の構成は、実施例1のステッピングモータ制御装置の構成と同様であるので、簡略化のためにその詳細な説明を省略する。
(Constitution)
As shown in FIG. 12, the configuration of the stepping motor control apparatus according to the second embodiment has a configuration in which an interrupt control unit 57 is newly provided in addition to the configuration of the first embodiment. Other configurations are the same as the configuration of the stepping motor control apparatus of the first embodiment, and thus detailed description thereof is omitted for the sake of brevity.

割込制御部57は、相切替ステップ更新部24からCPU1への割込信号29を制御するもので、現在の励磁方式と次の励磁方式の切替タイミングの間隔の長い方の励磁方式の切替タイミングにおいてのみ、ステップ値補正処理を行う割込みを発生させるように割込信号29を制御するものである。   The interrupt control unit 57 controls the interrupt signal 29 from the phase switching step update unit 24 to the CPU 1 and switches the excitation method with the longer interval between the current excitation method and the next excitation method. The interrupt signal 29 is controlled so as to generate an interrupt for performing the step value correction process only in FIG.

ここで、図15は、モータの回転方向をFOWとした場合で、各励磁方式ごとの、ステップ値に対する相切替タイミングおよびA相、B相切替信号、電流値を示したものであり、実施例1の図9の相切替ステップ値補正テーブルの補正値をあらかじめ適用して順番を並べ替えたものである。   Here, FIG. 15 shows the phase switching timing, the A phase, the B phase switching signal, and the current value with respect to the step value for each excitation method when the rotation direction of the motor is FOW. FIG. 9 is a table in which the correction values in the phase switching step value correction table of FIG.

すなわち、2−2相励磁方式から1−2相励磁方式に切り替えるときは、図9の相切替ステップ値補正テーブルのように、ステップ値を4つ戻すように補正するので、2−2相励磁方式のステップ0に対応する1−2相励磁方式でのステップ値を「28」を基点として並べ替えている。   That is, when switching from the 2-2 phase excitation method to the 1-2 phase excitation method, correction is made so that four step values are returned as in the phase switching step value correction table of FIG. The step values in the 1-2 phase excitation method corresponding to step 0 of the method are rearranged starting from “28”.

同様に、2−2相励磁方式からW1−2相励磁方式に切り替えるときは、相切替ステップ値補正テーブルによりステップ値を6つ戻すように補正するので、2−2相励磁方式のステップ0に対応するW1−2相励磁方式でのステップ値は「26」を基点として並べ替えている。   Similarly, when switching from the 2-2 phase excitation method to the W1-2 phase excitation method, correction is made so that six step values are returned by the phase switching step value correction table, so step 2-2 of the 2-2 phase excitation method is performed. The corresponding step values in the W1-2 phase excitation method are rearranged starting from “26”.

同様に、2−2相励磁方式から2W1−2相励磁方式に切り替えるときは、相切替ステップ値補正テーブルによりステップ値を7つ戻すように補正するので、2−2相励磁方式のステップ0に対応するW1−2相励磁方式でのステップ値は「25」を基点として並べ替えている。   Similarly, when switching from the 2-2 phase excitation method to the 2W1-2 phase excitation method, correction is made so that seven step values are returned by the phase switching step value correction table, so step 2-2 of the 2-2 phase excitation method is performed. The corresponding step values in the W1-2 phase excitation method are rearranged starting from “25”.

モータの回転方向をREVとした場合でも、同様に、2−2相励磁方式から1−2相励磁方式に切り替えるときは、相切替ステップ値補正テーブルによりステップ値を4つ進むように補正するので、2−2相励磁方式のステップ0に対応する1−2相励磁方式でのステップ値は「4」を基点として並べ替えている。   Even when the motor rotation direction is set to REV, similarly, when switching from the 2-2 phase excitation method to the 1-2 phase excitation method, the step value is corrected so that four step values are advanced by the phase switching step value correction table. The step values in the 1-2 phase excitation method corresponding to step 0 of the 2-2 phase excitation method are rearranged starting from “4”.

同様に、2−2相励磁方式からW1−2相励磁方式に切り替えるときは、相切替ステップ値補正テーブルによりステップ値を6つ進むように補正するので、2−2相励磁方式のステップ0に対応するW1−2相励磁方式でのステップ値は「6」を基点として並べ替えている。   Similarly, when switching from the 2-2 phase excitation method to the W1-2 phase excitation method, the step value is corrected so that six step values are advanced by the phase switching step value correction table. The corresponding step values in the W1-2 phase excitation method are rearranged starting from “6”.

同様に、2−2相励磁方式から2W1−2相励磁方式に切り替えるときは、相切替ステップ値補正テーブルによりステップ値を7つ進むように補正するので、2−2相励磁方式のステップ0に対応するW1−2相励磁方式でのステップ値は「7」を基点として並べ替えている。   Similarly, when switching from the 2-2 phase excitation method to the 2W1-2 phase excitation method, correction is made so that seven step values are advanced by the phase switching step value correction table. The corresponding step values in the W1-2 phase excitation method are rearranged starting from “7”.

このように並べ替えると、例えば、2−2相励磁方式から別の相励磁方式に変更する場合および別の相励磁方式から2−2相励磁方式に切り替える場合では、2−2相励磁方式の相切替タイミングにおいてのみ補正処理を行えばよいことがわかる。   When rearranged in this way, for example, when changing from the 2-2 phase excitation method to another phase excitation method and when switching from another phase excitation method to the 2-2 phase excitation method, It can be seen that the correction process only needs to be performed at the phase switching timing.

すなわち、ある励磁方式から別の励磁方式に切り替える場合、相切替タイミングの間隔が長い方の励磁方式の切替タイミングにおいてのみステップ値の補正を行えばよいことがわかる。このように、ステップ値の補正処理の間隔を長くするようにすれば、CPU1の処理量を大幅に削減することができる。   That is, when switching from one excitation method to another excitation method, it is understood that the step value should be corrected only at the switching timing of the excitation method with the longer interval between the phase switching timings. Thus, if the interval of the step value correction process is increased, the processing amount of the CPU 1 can be greatly reduced.

(動作)
以上の実施例2のステッピングモータ制御装置の動作を図13の割込み発生のタイムチャートおよび図14の動作フローチャートを用いて詳細に説明する。なお、割込み信号以外のステップ値、タイマー値、タイマー値(ラッチ)、タイマー値ラッチフラッグ、カウンタ回路内部、クロック信号は、図11のタイムチャートと同様となっている。
(Operation)
The operation of the stepping motor control device according to the second embodiment will be described in detail with reference to the interrupt generation time chart of FIG. 13 and the operation flowchart of FIG. The step value, timer value, timer value (latch), timer value latch flag, counter circuit inside, and clock signal other than the interrupt signal are the same as those in the time chart of FIG.

また、図14の動作フローチャートにおいて、ステップS41・S42、ステップ44・S45の動作は、実施例1のステップS31、S32、ステップ35・S36と同様であるので、簡略化して説明する。   In the operation flowchart of FIG. 14, the operations of steps S41 and S42 and steps 44 and S45 are the same as those of steps S31 and S32 and steps 35 and S36 of the first embodiment.

(タイマー割込発生の動作)
まず、実施例2のステッピングモータ制御装置では、CPU1からのステッピングモータ回転駆動指令を受信すると、図11に示したタイムチャートのようにクロックのタイミングにて所定のタイミングごとに割込み信号をステートカウントフラッグとして発生させる。
(Timer interrupt generation operation)
First, in the stepping motor control device according to the second embodiment, when a stepping motor rotation drive command is received from the CPU 1, an interrupt signal is sent at every predetermined timing at a clock timing as shown in the time chart of FIG. Generate as.

すなわち、CPU1から指令されるモータ回転速度に対応したタイマー値を随時セットし、クロック信号の立ち上がりのタイミングでタイマー値をカウントダウンし、タイマー値が「0」となると、ラッチフラッグを「1」とし次のタイマー値をラッチし、次のクロックにてステートカウントフラッグを発生させ、ステップ値を更新するように動作する。そして、次のタイマー値への更新準備が終了すると、ステートカウントフラッグを「0」とし、次のタイマー値を確定する。   That is, a timer value corresponding to the motor rotation speed commanded by the CPU 1 is set as needed, the timer value is counted down at the rising timing of the clock signal, and when the timer value becomes “0”, the latch flag is set to “1” and the next The timer value is latched, the state count flag is generated at the next clock, and the step value is updated. When the preparation for updating to the next timer value is completed, the state count flag is set to “0” and the next timer value is determined.

そして、ステートカウントフラッグに基づき、現在の励磁方式と次の励磁方式の切替タイミングの長い方の励磁方式を選出し、当該励磁方式の相切替タイミングにて割込み信号として発生させる。   Then, based on the state count flag, an excitation method having a longer switching timing between the current excitation method and the next excitation method is selected and generated as an interrupt signal at the phase switching timing of the excitation method.

例えば、2−2相励磁方式から1−2相励磁方式に切り替えるとき或いは逆に1−2相励磁方式から2−2相励磁方式に切り替えるときは、2−2相励磁方式の方が相切替タイミングの間隔が長いので、図13に示した2−2相励磁方式の間隔の割込みを発生させる。   For example, when switching from the 2-2 phase excitation method to the 1-2 phase excitation method, or conversely, when switching from the 1-2 phase excitation method to the 2-2 phase excitation method, the 2-2 phase excitation method is phase switched. Since the timing interval is long, an interruption of the interval of the 2-2 phase excitation method shown in FIG. 13 is generated.

また、W1−2相励磁方式から2W1−2相励磁方式に切り替えるとき或いは逆に2W1−2相励磁方式からW1−2相励磁方式に切り替えるときは、W1−2相励磁方式の方が相切替タイミングの間隔が長いので、W1−2相励磁方式の間隔の割込みを発生させる。なお、励磁方式が同じ場合は、当該励磁方式の間隔にて割込みを発生させる。   Also, when switching from the W1-2 phase excitation method to the 2W1-2 phase excitation method, or conversely, when switching from the 2W1-2 phase excitation method to the W1-2 phase excitation method, the W1-2 phase excitation method is more phase-switched. Since the timing interval is long, an interval interruption of the W1-2 phase excitation method is generated. If the excitation method is the same, an interrupt is generated at intervals of the excitation method.

(相切替の動作)
実施例2のステッピングモータ制御装置では、以上の割込みごとに、図14に示した動作フローチャートの処理を行う。すなわち、まず、CPU1から励磁方式の切替要求があったかどうかを確認し、励磁方式の切替要求がなかった場合は、現在の励磁方式のままであるのでステップ値をインクリメントしてステップS44に進む((ステップS41・S42)。
(Phase switching operation)
In the stepping motor control apparatus according to the second embodiment, the process of the operation flowchart shown in FIG. 14 is performed for each interrupt described above. That is, first, it is confirmed whether or not there has been a request for switching the excitation method from the CPU 1, and if there is no request for switching the excitation method, the current excitation method is maintained, so the step value is incremented and the process proceeds to step S44 (( Steps S41 and S42).

そして、現在の励磁方式と更新後のステップ値に基づき図4の切替タイミングおよび各出力値テーブルを参照し、相切替信号、電流値を更新するタイミングか行うかどうかを判定し、切替タイミングでないときは、切替タイミングとなるまで待ち、切替タイミングとなったときに、該当する相切替信号、電流値をセットし((ステップS44・S45)、本処理を終了する。   Then, referring to the switching timing and each output value table in FIG. 4 based on the current excitation method and the updated step value, it is determined whether or not the timing for updating the phase switching signal and the current value is performed. Waits until the switching timing is reached, and when the switching timing is reached, the corresponding phase switching signal and current value are set (steps S44 and S45), and this process ends.

一方、励磁方式の切替要求があった場合は、実施例1のステップS33のような相切替タイミングの確認処理は行わず、図9のステップ値補正テーブルを参照し、該当する箇所の補正値にてステップ値を補正する。例えば、FOW方向の回転指令があり、2−2相励磁方式から1−2相励磁方式に切り替える指令があったときは、ステップ値補正テーブルに「−3」と格納されているので4ステップ分ステップ値を戻すように補正されステップ値は「29」に補正される。   On the other hand, when there is a request for switching the excitation method, the phase switching timing confirmation processing as in step S33 of the first embodiment is not performed, and the correction value of the corresponding portion is referred to by referring to the step value correction table of FIG. Correct the step value. For example, when there is a rotation command in the FOW direction, and there is a command to switch from the 2-2 phase excitation method to the 1-2 phase excitation method, “−3” is stored in the step value correction table, so 4 steps. The step value is corrected to return, and the step value is corrected to “29”.

一方、REV方向の回転指令があり、2−2相励磁方式から1−2相励磁方式に切り替える指令があったときは、ステップ値補正テーブルに「+3」と格納されているので実質4ステップ分先に進むように補正され、「3」に補正される。   On the other hand, when there is a rotation command in the REV direction and there is a command to switch from the 2-2 phase excitation method to the 1-2 phase excitation method, “+3” is stored in the step value correction table, so that it is substantially equivalent to 4 steps. Correction is made so as to proceed, and correction is made to “3”.

そして、新たな励磁方式と補正されたステップ値に基づき図4の切替タイミングおよび各出力値テーブルを参照し、相切替信号、電流値を更新するタイミングか行うかどうかを判定し、切替タイミングでないときは、切替タイミングとなるまで待ち、切替タイミングとなったときに、該当する相切替信号、電流値をセットして(ステップS44・S45)、本処理を終了する。   Then, based on the new excitation method and the corrected step value, the switching timing and each output value table in FIG. 4 are referred to determine whether or not to update the phase switching signal and the current value. Waits until the switching timing is reached, and when the switching timing is reached, the corresponding phase switching signal and current value are set (steps S44 and S45), and the process is terminated.

(実施例2の効果)
以上のように実施例2のステッピングモータ制御装置によれば、励磁方式を変更する際、ステップ値補正処理を実施する最小限の割込みを発生させる割込制御部57を設け、ステップ値補正処理を最小限としたので、実施例1の効果に加え、CPU等の負荷を大幅に減らすことができる。
(Effect of Example 2)
As described above, according to the stepping motor control apparatus of the second embodiment, when changing the excitation method, the interrupt control unit 57 that generates a minimum interrupt for performing the step value correction process is provided, and the step value correction process is performed. Since it is minimized, in addition to the effects of the first embodiment, the load on the CPU and the like can be greatly reduced.

本発明は、プリンタ、複写機、ファクシミリ等の印刷装置など、媒体搬送やヘッドを駆動するステッピングモータを用いる機器に広く用いることができる。   The present invention can be widely used in devices using a stepping motor for driving a medium and a head, such as a printing apparatus such as a printer, a copying machine, and a facsimile machine.

実施例1の印刷装置の制御部の構成図である。FIG. 3 is a configuration diagram of a control unit of the printing apparatus according to the first embodiment. 実施例1の印刷装置の構成図である。1 is a configuration diagram of a printing apparatus according to a first embodiment. 実施例1の印刷装置のファームウェア機能ブロック図である。FIG. 3 is a firmware function block diagram of the printing apparatus according to the first embodiment. 実施例1の印刷装置の各ステップ値における切替タイミングおよび各出力値テーブルである。5 is a switching timing and output value table for each step value of the printing apparatus according to the first exemplary embodiment. ステッピングモータのA相・B相を説明する図である。It is a figure explaining the A phase and B phase of a stepping motor. 実施例1の印刷装置の各ステップ値における電流波形を説明する図である。FIG. 6 is a diagram illustrating current waveforms at each step value of the printing apparatus according to the first exemplary embodiment. 従来および実施例1の励磁方式切替時のタイムチャート図である。It is a time chart figure at the time of the excitation system switching of the prior art and Example 1. FIG. 各相励磁方式を説明する図である。It is a figure explaining each phase excitation system. 実施例1の印刷装置の相切替ステップ値補正テーブルである。3 is a phase switching step value correction table of the printing apparatus according to the first exemplary embodiment. 実施例1の印刷装置の動作フローチャート図である。FIG. 5 is an operation flowchart of the printing apparatus according to the first embodiment. 実施例1の印刷装置の割込み発生のタイムチャート図である。FIG. 4 is a time chart diagram of interrupt generation of the printing apparatus according to the first exemplary embodiment. 実施例2の印刷装置の制御部の構成図である。FIG. 6 is a configuration diagram of a control unit of a printing apparatus according to a second embodiment. 実施例2の印刷装置の割込み発生のタイムチャート図である。FIG. 10 is a time chart diagram of interrupt generation of the printing apparatus according to the second embodiment. 実施例2の印刷装置の動作フローチャート図である。FIG. 10 is an operation flowchart of the printing apparatus according to the second embodiment. 実施例2の各ステップ値における切替タイミングおよび各出力値テーブルである。It is the switching timing in each step value of Example 2, and each output value table. 実施例2の各ステップ値における切替タイミングおよび各出力値テーブルである。It is the switching timing in each step value of Example 2, and each output value table.

符号の説明Explanation of symbols

1 CPU
2 制御部
6 スペースモータ
7 フィードモータ
13 ホストコンピュータ
16b モータドライバ部
23 タイマー部
24 相切替ステップ更新部
25a 相切替出力部
25b 電流制御信号出力部
26 電流制御部
27 相励磁切替補正部
27a 相切替タイミング検出部
29 割込信号
33 印刷制御処理
34 フィードモータ制御処理
35 ヘッド制御処理
36 スペースモータ制御処理
40 ロータ
41 固定子
57 割込制御部
1 CPU
2 Control unit 6 Space motor 7 Feed motor 13 Host computer 16b Motor driver unit 23 Timer unit 24 Phase switching step update unit 25a Phase switching output unit 25b Current control signal output unit 26 Current control unit 27 Phase excitation switching correction unit 27a Phase switching timing Detector 29 Interrupt signal 33 Print control process 34 Feed motor control process 35 Head control process 36 Space motor control process 40 Rotor 41 Stator 57 Interrupt control part

Claims (6)

複数の励磁方式にて、所定の時間間隔ごとに相切替ステップ値を更新しながら相切替を順次行って、ステッピングモータを回転駆動するステッピングモータ制御装置であって、
前記励磁方式を切り替える際に、当該切替前後の各励磁方式の基本ステップ角の差に基づき前記相切替ステップ値の補正を行う励磁切替補正手段を設けたことを特徴とするステッピングモータ制御装置。
A stepping motor control device for rotating and driving a stepping motor by sequentially performing phase switching while updating a phase switching step value at predetermined time intervals with a plurality of excitation methods,
A stepping motor control device comprising excitation switching correction means for correcting the phase switching step value based on a difference in basic step angle of each excitation method before and after the switching when the excitation method is switched.
前記相切替ステップ値の補正は、正回転のときは基本ステップ角の差を加算し、逆回転のときは、基本ステップ角の差を減算するようにしたことを特徴とする請求項1記載のステッピングモータ制御装置。   2. The phase switching step value is corrected by adding a difference in basic step angle during forward rotation and subtracting a difference in basic step angle during reverse rotation. Stepping motor control device. 前記所定の時間間隔を、切替前後の各励磁方式の基本ステップ角が大きい励磁方式の相切替の間隔とする割込制御手段を設け、
当該間隔にて発生させる割込みごとに、前記相切替ステップ値の補正を行うようにしたことを特徴とする請求項1および請求項2記載のステッピングモータ制御装置。
An interruption control means for setting the predetermined time interval as an interval of phase switching of an excitation method having a large basic step angle of each excitation method before and after switching,
3. The stepping motor control device according to claim 1, wherein the phase switching step value is corrected for each interrupt generated at the interval.
前記励磁切替補正手段は、モータ回転中に励磁方式が切替わったときに、前記相切替ステップ値の補正を行うようにしたことを特徴とする請求項1ないし請求項3いずれか記載のステッピングモータ制御装置。   The stepping motor according to any one of claims 1 to 3, wherein the excitation switching correction means corrects the phase switching step value when an excitation method is switched during motor rotation. Control device. 複数の励磁方式を切替えてステッピングモータを制御するステッピングモータ制御装置であって、
第1の励磁方式から第2の励磁方式に切替える際に、ロータの現在位置、またはロータの移動時間に基づいて該第2の励磁方式の制御を行う相切替部を有することを特徴とするステッピングモータ制御装置。
A stepping motor control device that controls a stepping motor by switching a plurality of excitation methods,
A stepping unit comprising a phase switching unit that controls the second excitation method based on a current position of the rotor or a moving time of the rotor when switching from the first excitation method to the second excitation method. Motor control device.
請求項1ないし請求項5いずれか記載のステッピングモータ制御装置を設けたことを特徴とする印刷装置。   A printing apparatus comprising the stepping motor control apparatus according to claim 1.
JP2006343478A 2006-12-20 2006-12-20 Stepping motor controller and printer Pending JP2008160900A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006343478A JP2008160900A (en) 2006-12-20 2006-12-20 Stepping motor controller and printer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006343478A JP2008160900A (en) 2006-12-20 2006-12-20 Stepping motor controller and printer

Publications (1)

Publication Number Publication Date
JP2008160900A true JP2008160900A (en) 2008-07-10

Family

ID=39661178

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006343478A Pending JP2008160900A (en) 2006-12-20 2006-12-20 Stepping motor controller and printer

Country Status (1)

Country Link
JP (1) JP2008160900A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009175384A (en) * 2008-01-24 2009-08-06 Canon Inc Focusing device and optical equipment using the same
JP2011035990A (en) * 2009-07-30 2011-02-17 Canon Inc Motor controller and image forming apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009175384A (en) * 2008-01-24 2009-08-06 Canon Inc Focusing device and optical equipment using the same
JP2011035990A (en) * 2009-07-30 2011-02-17 Canon Inc Motor controller and image forming apparatus

Similar Documents

Publication Publication Date Title
JP4386815B2 (en) Motor driving apparatus and driving method
JPH11215894A (en) Stepping motor controller
JP2008160900A (en) Stepping motor controller and printer
JP2006262584A (en) Stepping motor control device and method, image reader, image forming device, program, and recording medium
JP4678434B2 (en) Stepping motor control device and program
JP5658475B2 (en) Stepping motor drive control apparatus and image forming apparatus
JP4850639B2 (en) Motor control device, motor control method, and electrophotographic image forming apparatus
KR960005692B1 (en) Drive controller and drive control method for a stepping motor without a step out error
JP2008111942A (en) Lens driver
JP3316299B2 (en) Stepping motor drive circuit
JP2007160847A (en) Recording device
JP4715397B2 (en) Motor control device, electronic device and printer device
JP5469848B2 (en) Stepping motor driving method and stepping motor driving device
KR20110002204A (en) Motor controlling apparatus and method for controlling thereof
JP2009107219A (en) Printer apparatus
JP5431115B2 (en) Motor drive device
JP2009011087A (en) Micro step control method of stepping motor, and dynamo-electric apparatus
JP2019022421A (en) Stepping motor drive device and printer device
US9780708B2 (en) Control device and method for stepper motor that ensure improved performance of stepper motor during activation period
JP2003189691A (en) Driving method for step motor
JP3223110B2 (en) Stepping motor drive circuit
JP2016025769A (en) Motor controller and printing apparatus
JPH06153593A (en) Stepping-motor control circuit
JP2000184790A (en) Motor controller
JP4667767B2 (en) Motor control device