Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0732638B2 - Driving device for stepping motor - Google Patents
[go: Go Back, main page]

JPH0732638B2 - Driving device for stepping motor - Google Patents

Driving device for stepping motor

Info

Publication number
JPH0732638B2
JPH0732638B2 JP60259432A JP25943285A JPH0732638B2 JP H0732638 B2 JPH0732638 B2 JP H0732638B2 JP 60259432 A JP60259432 A JP 60259432A JP 25943285 A JP25943285 A JP 25943285A JP H0732638 B2 JPH0732638 B2 JP H0732638B2
Authority
JP
Japan
Prior art keywords
pulse
data
stepping motor
deceleration
pulse interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP60259432A
Other languages
Japanese (ja)
Other versions
JPS62118796A (en
Inventor
伸一 麻生
昇 仁田
房生 保里
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tec Corp
Original Assignee
Tec Corp
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 Tec Corp filed Critical Tec Corp
Priority to JP60259432A priority Critical patent/JPH0732638B2/en
Publication of JPS62118796A publication Critical patent/JPS62118796A/en
Publication of JPH0732638B2 publication Critical patent/JPH0732638B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

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
    • H02P8/00Arrangements for controlling dynamo-electric motors rotating step by step
    • H02P8/14Arrangements for controlling speed or speed and torque

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Stepping Motors (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、外部から入力したステップパルス数分だけ回
転駆動するステッピングモータの駆動装置に係わり、特
に、前記ステップパルス数分の駆動期間中の回転速度を
加速,一定速,減速に制御するステッピングモータの駆
動装置に関する。
TECHNICAL FIELD The present invention relates to a driving device for a stepping motor that is rotationally driven by the number of step pulses input from the outside, and particularly, in a driving period for the number of step pulses. The present invention relates to a drive device for a stepping motor that controls the rotation speed to be accelerated, fixed, or decelerated.

[従来の技術] 例えば電子タイプライターや印字装置における印字ヘッ
ドを搭載したキャリッジを移動制御するキャリッジモー
タ,磁気記録装置における磁気ベツドを移動させるキャ
リアモータ等には一般にステッピングモータが使用され
ている。このステッピングモータは駆動装置によって外
部から入力したステップパルス数分だけ回転駆動され
る。
[Prior Art] For example, a stepping motor is generally used as a carriage motor for moving and controlling a carriage having a print head in an electronic typewriter or a printing device, a carrier motor for moving a magnetic bed in a magnetic recording device, and the like. The stepping motor is rotationally driven by the number of step pulses input from the outside by the driving device.

このようなステッピングモータを回転駆動する駆動装置
のなかには、モータが回転駆動するに要する時間を短縮
するために回転速度を第7図に示すようにステップ数に
応じて変化させるようにしたものがある。すなわち、例
えばCステップパルス数分だけ回転させる場合、回転開
始からAステップまでは回転速度を加速し、Aステップ
からBステップまでは一定速度で駆動し、Bステップか
ら最後のCステップまでは減速する。一般に上記速度制
御はステッピングモータに加えるステップパルスのパル
ス間隔を変化させる。例えば加速する場合はパルス間隔
を徐々に減少し、減速する場合は徐々に増加する。
Among such drive devices for rotationally driving a stepping motor, there is one in which the rotational speed is changed according to the number of steps as shown in FIG. 7 in order to shorten the time required for the motor to rotationally drive. . That is, for example, when rotating by the number of C step pulses, the rotational speed is accelerated from the start of rotation to the A step, is driven at a constant speed from the A step to the B step, and is decelerated from the B step to the last C step. . Generally, the speed control changes the pulse interval of the step pulse applied to the stepping motor. For example, when accelerating, the pulse interval is gradually decreased, and when decelerating, the pulse interval is gradually increased.

第8図は第7図に示した速度制御を実施するための回路
である。前記第7図の各ステップ数Xにおけるパルス間
隔に対応するカウント値(速度データ)はROM1内に設定
されている。このROM1およびRAM2はデータバス3,アドレ
スバス4,制御バス5を介してCPU6に接続されている。ま
た、ROM1から読出された速度を示すカウント値はラッチ
回路7にラッチされたのちカウンタ8に設定される。こ
のカウンタ8にセットされたカウント値はクロック発生
器9から出力されるクロック信号にて減算される。そし
て、計数値が0に達するとステッピングモータ10を駆動
するモータ駆動回路11へ1個の駆動パルスを送出する。
同時にオアゲート12を介してCPU6に割込信号を送出す
る。
FIG. 8 shows a circuit for implementing the speed control shown in FIG. The count value (speed data) corresponding to the pulse interval at each step number X in FIG. 7 is set in the ROM1. The ROM1 and RAM2 are connected to the CPU 6 via the data bus 3, address bus 4, and control bus 5. The count value indicating the speed read from the ROM 1 is latched by the latch circuit 7 and then set in the counter 8. The count value set in the counter 8 is subtracted by the clock signal output from the clock generator 9. When the count value reaches 0, one drive pulse is sent to the motor drive circuit 11 that drives the stepping motor 10.
At the same time, an interrupt signal is sent to the CPU 6 via the OR gate 12.

割込信号が入力されたCPU6は第9図に示す割込処理を実
行する。すなわち、入力したステップパルス数をカウン
トする計数値をXとすると、割込信号が入力する度に1
だけ増加する。そして、増加後の計数値Xが第7図に示
すAステップ未満、又はBステップ以上であれば、ROM1
に記憶した該当ステップ数に対応するカウント値(速度
データ)を読出してラッチ回路7に設定し、Aステップ
以上Bステップ未満の場合は所定の一定カウント値をラ
ッチ回路7に設定し、Cステップに達した場合はモータ
を停止する。なお、一定速度に達したときは最初に一定
カウント値のデータをラッチ回路7に設定するのみの場
合もある。
The CPU 6 to which the interrupt signal is input executes the interrupt processing shown in FIG. That is, when the count value for counting the number of input step pulses is X, it is set to 1 each time an interrupt signal is input.
Only increase. If the count value X after the increase is less than the A step shown in FIG.
The count value (speed data) corresponding to the number of corresponding steps stored in is read out and set in the latch circuit 7, and when it is equal to or more than A step and less than B step, a predetermined constant count value is set in the latch circuit 7 and is set in C step. If it reaches, stop the motor. In some cases, when the constant speed is reached, the data of the constant count value is first set in the latch circuit 7.

[発明が解決しようとする問題点] しかしながら、上記のような構成であると、ステッピン
グモータ10が1ステップパルス分回転する度にCPU6に対
して割込信号が入力し、CPU6は割込信号が入力する度に
第9図に示した、データの読出し、ラッチ回路7への設
定を含む割込処理を実施する必要がある。このようにス
テッピングモータ10を1ステップパルス分回転させる度
に所定の割込処理を実施する装置においては、加速時に
おける回転速度を上昇するためにパルス間隙を短く設定
すると、CPU6の割込処理に要する時間がカウンタ8のカ
ウントアップ時間より長くなり、結果的に速度を一定の
許容限界値以上に設定できない問題が生じる。したがっ
て、全体のモータ回転駆動に要する時間を短縮すること
は困難であった。
[Problems to be Solved by the Invention] However, with the above configuration, an interrupt signal is input to the CPU 6 every time the stepping motor 10 rotates by one step pulse, and the CPU 6 outputs the interrupt signal. Each time an input is made, it is necessary to carry out the interrupt processing shown in FIG. 9 including the reading of data and setting to the latch circuit 7. Thus, in a device that executes a predetermined interrupt process every time the stepping motor 10 is rotated by one step pulse, if the pulse gap is set to be short in order to increase the rotation speed at the time of acceleration, the CPU6 interrupts the interrupt process. The required time becomes longer than the count-up time of the counter 8, resulting in a problem that the speed cannot be set above a certain allowable limit value. Therefore, it is difficult to reduce the time required to drive the entire motor rotation.

本発明はこのような事情に基づいてなされたものであ
り、その目的とするところは、記憶部に記憶された加速
減速時の各パルス間隔値をDMA制御部を介して順次デー
タバス上へ出力することによって、CPUに対する各ステ
ップ毎の割込動作を行なわずにステッピングモータの加
速,定速,減速制御を実施でき、モータの回転駆動に要
する時間を短縮できるとともに、CPUにおける余裕時間
が増加することによる同時実施の他処理の処理能率を向
上できるステッピングモータの駆動装置を提供すること
にある。
The present invention has been made based on such a situation, and an object thereof is to sequentially output each pulse interval value during acceleration / deceleration stored in a storage unit to a data bus via a DMA control unit. By doing so, acceleration, constant speed, and deceleration control of the stepping motor can be performed without performing an interrupt operation for each step of the CPU, the time required for rotational driving of the motor can be shortened, and the margin time in the CPU increases. It is an object of the present invention to provide a stepping motor drive device that can improve the processing efficiency of other processes simultaneously performed.

[問題点を解決するための手段] 本発明は、加速時における各パルス間隔,一定速度時に
おけるパルス間隔および減速時における各パルス間隔の
データを加速時および減速時におけるパルス間隔のデー
タか否かを示す変速フラグと減速時における最終パルス
間隔のデータか否かを示す最終フラグともにアドレス番
号順に記憶する速度メモリと、外部から入力されたステ
ップパルス数から速度メモリの減速時におけるパルス間
隔のデータ数を減算したステップパルス数をラッチする
パルス数ラッチ回路と、速度メモリに記憶されたパルス
間隔のデータをそのデータに対応する変速フラグおよび
最終フラグとともにアドレス番号順に順次データバスへ
出力するDMA制御部と、データバスへ出力された変速フ
ラグが加速時および減速時におけるパルス間隔のデータ
を示すとき次のアドレス番号のデータを読出すDMA要求
信号をDMA制御部へ送出する第1の論理回路と、データ
バスへ送出されたパルス間隔のデータをラッチするデー
タラッチ回路と、このデータラッチ回路にラッチされた
データのパルス間隔を計時するデータカウンタと、この
データカウンタから計時終了する度に出力される駆動パ
ルスを受けてステッピングモータを回転駆動するモータ
駆動回路と、駆動パルスのパルス数を計数するパルス数
カウンタと、このパルス数カウンタの計数値がパルス数
ラッチ回路にラッチされたパルス数に一致したときDMA
要求信号をDMA制御部へ送出するパルス数一致回路と、
データバスへ出力された最終フラグが減速時における最
終パルス間隔のデータを示すときステッピングモータ駆
動停止の割込信号を出力する第2の論理回路とを備えた
ステッピングモータの駆動装置である。
[Means for Solving Problems] In the present invention, whether the data of each pulse interval at the time of acceleration, the pulse interval at a constant speed, and the pulse interval at the time of deceleration is the data of the pulse interval at the time of acceleration and deceleration is used. The speed memory that stores both the shift flag indicating the number and the final pulse interval data during deceleration in the order of address numbers, and the number of pulse interval data during deceleration in the speed memory from the number of step pulses input from the outside. A pulse number latch circuit for latching the step pulse number obtained by subtracting, and a DMA control unit for sequentially outputting the data of the pulse interval stored in the speed memory to the data bus in order of address number together with the shift flag and the final flag corresponding to the data. , The shift flag output to the data bus is the pulse at acceleration and deceleration A first logic circuit which sends a DMA request signal to the DMA control unit for reading the data of the next address number when indicating the data of the interval, and a data latch circuit which latches the data of the pulse interval sent to the data bus, A data counter that counts the pulse interval of the data latched in this data latch circuit, a motor drive circuit that receives the drive pulse output from the data counter each time the timing ends, and drives the stepping motor to rotate. A pulse counter that counts the number of pulses, and DMA when the count value of this pulse counter matches the number of pulses latched in the pulse latch circuit.
A pulse number matching circuit that sends a request signal to the DMA control unit,
And a second logic circuit that outputs an interrupt signal for stopping the stepping motor drive when the final flag output to the data bus indicates data of the final pulse interval during deceleration.

[作用] このように構成されたステッピングモータの駆動装置で
あれば、外部から任意数のステップパルスが入力される
と、このステップパルス数から速度メモリの減速時にお
けるパルス間隔のデータ数を減算したステップ数がパル
ス数ラッチ回路にラッチされる。次いで、DMA制御部の
制御により、先ず速度メモリから先頭アドレス番号のパ
ルス間隔データ,変速フラグおよび最終フラグがデータ
バスへ出力される。そして、パルス間隔データはデータ
ラッチ回路にラッチされる。これにより、データカウン
タではラッチされたパルス間隔の計時が行われ、計時が
終了するとモータ駆動回路へ駆動パルスが送出されて、
ステッピングモータが1ステップ分回転する。このと
き、データバスへ出力された変速フラグは加速時のデー
タであることを示すので、第1の論理回路よりDMA制御
部へDMA要求信号が送出される。これにより、速度メモ
リから次のアドレス番号のパルス間隔データ,変速フラ
グおよび最終フラグがデータバスへ出力され、上述した
如く出力データのパルス間隔で駆動パルスが送出され
る。こうして、速度メモリに記憶された加速時の各パル
ス間隔データに基づき順次モータ駆動回路へ駆動パルス
が送出されて、ステッピングモータが加速される。
[Operation] With the stepping motor drive device configured as described above, when an arbitrary number of step pulses are input from the outside, the number of data of the pulse interval at the time of deceleration of the speed memory is subtracted from the number of step pulses. The step number is latched in the pulse number latch circuit. Next, under the control of the DMA controller, first, the pulse interval data of the leading address number, the shift flag and the final flag are output from the speed memory to the data bus. Then, the pulse interval data is latched by the data latch circuit. As a result, the data counter measures the latched pulse interval, and when the time measurement ends, the drive pulse is sent to the motor drive circuit,
The stepping motor rotates one step. At this time, since the shift flag output to the data bus indicates that the data is data at the time of acceleration, a DMA request signal is sent from the first logic circuit to the DMA control unit. As a result, the pulse interval data of the next address number, the shift flag and the final flag are output from the speed memory to the data bus, and the drive pulses are sent out at the pulse intervals of the output data as described above. In this way, drive pulses are sequentially sent to the motor drive circuit based on each pulse interval data at the time of acceleration stored in the speed memory, and the stepping motor is accelerated.

その後、一定速度時におけるパルス間隔データがデータ
バスに出力されると、そのデータとともに出力された変
速フラグは加速時および減速時におけるデータでないこ
とを示すので、DMA制御部へDMA要求信号が送出されなく
なる。これにより、データラッチ回路のデータはその一
定速度時におけるパルス間隔データから変化しないので
駆動パルスは一定間隔で送出され、ステッピングモータ
は定速駆動される。
After that, when the pulse interval data at a constant speed is output to the data bus, the shift flag output together with the data indicates that the data is not data during acceleration and deceleration, and therefore a DMA request signal is sent to the DMA control unit. Disappear. As a result, the data of the data latch circuit does not change from the pulse interval data at the constant speed, so that drive pulses are sent at constant intervals and the stepping motor is driven at a constant speed.

その後、モータ駆動回路へ送出する駆動パルス数がパル
ス数ラッチ回路にラッチされているパルス数と一致する
と、パルス数一致回路からDMA制御部へDMA要求信号が送
出される。これにより、速度メモリの次のパルス間隔デ
ータおよびそれに対応する変速フラグ,最終フラグがデ
ータバスへ出力される。そして、パルス間隔データはデ
ータラッチ回路にラッチされ、このラッチされたパルス
間隔で駆動パルスが送出される。このとき、データバス
へ出力された変速フラグが減速時のデータであることを
示すので、第1の論理回路からDMA制御部へDMA要求信号
が送出される。これにより、速度メモリからさらに次の
アドレス番号のパルス間隔データ,変速フラグおよび最
終フラグがデータバスに出力され、そのパルス間隔で駆
動パルスが送出される。こうして、速度メモリに記憶さ
れた減速時の各パルス間隔データに基づき順次モータ駆
動回路へ駆動パルスが送出されて、ステッピングモータ
が減速される。
After that, when the number of drive pulses to be sent to the motor drive circuit matches the number of pulses latched in the pulse number latch circuit, a DMA request signal is sent from the pulse number matching circuit to the DMA controller. As a result, the next pulse interval data in the speed memory and the corresponding shift flag and final flag are output to the data bus. Then, the pulse interval data is latched by the data latch circuit, and the drive pulse is transmitted at the latched pulse interval. At this time, since the shift flag output to the data bus indicates that the data is for deceleration, a DMA request signal is sent from the first logic circuit to the DMA control unit. As a result, the pulse interval data of the next address number, the shift flag and the final flag are further output from the speed memory to the data bus, and the drive pulse is transmitted at the pulse interval. In this way, drive pulses are sequentially sent to the motor drive circuit based on the pulse interval data at the time of deceleration stored in the speed memory, and the stepping motor is decelerated.

そして、データバスへ出力された最終フラグが減速時に
おける最終データであることを示すと、第2の論理回路
よりステッピングモータ駆動停止の割込信号が出力され
て、ステッピングモータが停止する。
When the final flag output to the data bus indicates the final data at the time of deceleration, the stepping motor drive stop interrupt signal is output from the second logic circuit, and the stepping motor is stopped.

[実施例] 以下本発明の一実施例を図面を用いて説明する。[Embodiment] An embodiment of the present invention will be described below with reference to the drawings.

第1図は実施例のステッピングモータの駆動装置を示す
ブロック図である。図中20はCPU(中央処理装置)であ
り、このCPU20はデータバス21,アドレスバス22,制御バ
ス23を介して速度メモリや各種制御プログラムを記憶し
たROM24,このROM24から転送した速度メモリ等の可変デ
ータを一時記憶するRAM25,CPU20を介さずにRAM25に記憶
された前記速度メモリの各パルス間隔のカウント値を直
接データバス21へ出力するDMA制御部26等を制御する。
前記データバス21には外部から入力したステップパルス
数から後述する減速時のパルス間隔のデータ数を減算し
た値をラッチするパルス数ラッチ回路27が接続され、こ
のパルス数ラッチ回路27の出力信号は複数の排他的論理
和ゲート等で構成されたパルス数一致回路28の一方の入
力端子へ入力される。
FIG. 1 is a block diagram showing a driving device of a stepping motor according to an embodiment. In the figure, 20 is a CPU (central processing unit), and this CPU 20 has a speed memory and a ROM 24 storing various control programs via a data bus 21, an address bus 22 and a control bus 23, a speed memory transferred from this ROM 24, etc. It controls the RAM 25, which temporarily stores variable data, and the DMA controller 26, which directly outputs the count value of each pulse interval of the speed memory stored in the RAM 25 to the data bus 21 without passing through the CPU 20.
Connected to the data bus 21 is a pulse number latch circuit 27 that latches a value obtained by subtracting the number of data of pulse intervals during deceleration described later from the number of step pulses input from the outside, and the output signal of this pulse number latch circuit 27 is It is inputted to one input terminal of a pulse number matching circuit 28 composed of a plurality of exclusive OR gates or the like.

また、前記データバス21のD0信号は第2の論理回路とし
てのD型のフリップフロップ29のD入力端子へ入力さ
れ、D1信号は第1の論理回路としてのD型のフリップフ
ロップ30のD入力端子へ入力される。また、データバス
21のD2〜Dn+2信号は速度メモリの各パルス間隔(カウン
ト値)がラッチされるデータラッチ回路31のデータ端子
へ入力される。このデータラッチ回路31にラッチされた
パルス間隔のカウント値はデータカウンタ32へ設定され
る。
The D 0 signal of the data bus 21 is input to the D input terminal of a D-type flip-flop 29 as the second logic circuit, and the D 1 signal is input to the D-type flip-flop 30 as the first logic circuit. Input to the D input terminal. Also, the data bus
The D 2 to Dn +2 signals of 21 are input to the data terminal of the data latch circuit 31 in which each pulse interval (count value) of the speed memory is latched. The count value of the pulse interval latched by the data latch circuit 31 is set in the data counter 32.

前記DMA制御部26はDMA要求端子REQにHレベルのDMA要求
信号が入力すると、CPU20に対してホールド要求信号を
送出し、CPU20からはホールド応答信号が返送される。
そして、DMA制御部26から出力されるHレベルのDMA応答
信号ACKはアンドゲート33の一方の入力端子を介して前
記データラッチ回路31のロード端子へ入力されるととも
に各フリップフロップ29,30のトリガ端子Tへ入力され
る。さらに、DMA応答信号ACKはR/Sフリップフロップ34
のクリア端子へ入力される。フリップフロップ30のQ出
力端子の出力信号はR/Sフリップフロップ34のQ出力端
子の出力信号とともにアンドゲート35を介してDMA制御
部26のDMA要求端子REQへ入力される。またフリップフロ
ップ29のQ出力端子の出力信号はアンドゲート36の一方
の入力端子を介してCPU20の割込端子INTへ割込信号とし
て入力される。
When the H level DMA request signal is input to the DMA request terminal REQ, the DMA control unit 26 sends a hold request signal to the CPU 20, and the CPU 20 returns a hold response signal.
The H-level DMA response signal ACK output from the DMA control unit 26 is input to the load terminal of the data latch circuit 31 via one input terminal of the AND gate 33 and triggers the flip-flops 29 and 30. Input to the terminal T. Further, the DMA response signal ACK is the R / S flip-flop 34
Input to the clear terminal of. The output signal of the Q output terminal of the flip-flop 30 is input to the DMA request terminal REQ of the DMA control unit 26 via the AND gate 35 together with the output signal of the Q output terminal of the R / S flip-flop 34. The output signal from the Q output terminal of the flip-flop 29 is input as an interrupt signal to the interrupt terminal INT of the CPU 20 via one input terminal of the AND gate 36.

CPU20のP1出力ポートから出力されるパルス信号はR/Sフ
リップフロップ34のプリセット入力端子へ入力されると
ともにオアゲート37を介してフリップフロップ30のプリ
セット入力端子へ入力される。また、CPU20のP2出力ポ
ートから出力されるゲート信号はクロック発振器38のゲ
ート端子Gへ入力される。このクロック発振器38はゲー
ト端子GにHレベルのゲート信号が印加期間中は所定周
波数CLKのクロック信号を前記データカウンタ32のクロ
ック端子へ送出する。また、このデータカウンタ32のロ
ード端子にはCPU20のP3出力ポートから出力されたパル
ス信号がオアゲート39を介して印加されている。このデ
ータカウンタ32はロード端子にパルス信号が入力する
と、データラッチ回路31にラッチされたパルス間隔を示
すカウント値をレジスタに取込み、このカウント値をク
ロック端子にクロック信号が入力する度に減算してい
き、カウント値が0に達すると、CY出力端子から駆動パ
ルスを前記オアゲート39の一方の入力端子を介して自己
のロード端子へ印加するとともに、オアゲート40を介し
てステッピングモータ41を回転駆動するモータ駆動回路
42へ印加する。なお、このオアゲート40の他方の入力端
子にはCPU20のP4出力ポートから出力されたパルス信号
が入力される。そして、オアゲート40の出力信号はモー
タ駆動回路42へ入力するとともに、パルス数カウンタ43
のクロック端子へ入力される。パルス数カウンタ43の出
力信号は前記パルス数一致回路28の他方の入力端子へ入
力される。また、パルス数カウンタ43の出力信号はステ
ッピングモータ41の実際の回転位置を示す情報として外
部へモニター信号として送出される。パルス数一致回路
28はパルス数カウンタ43から送出されたパルス数がパル
ス数ラッチ回路27から送出されたパルス数と一致した時
点で出力端子からHレベルのパルス信号を前記オアゲー
ト37を介してフリップフロップ30のプリセット端子へ入
力される。
The pulse signal output from the P1 output port of the CPU 20 is input to the preset input terminal of the R / S flip-flop 34 and the preset input terminal of the flip-flop 30 via the OR gate 37. The gate signal output from the P2 output port of the CPU 20 is input to the gate terminal G of the clock oscillator 38. The clock oscillator 38 sends a clock signal of a predetermined frequency CLK to the clock terminal of the data counter 32 while the gate signal of H level is applied to the gate terminal G. The pulse signal output from the P3 output port of the CPU 20 is applied to the load terminal of the data counter 32 via the OR gate 39. When a pulse signal is input to the load terminal of the data counter 32, the count value indicating the pulse interval latched by the data latch circuit 31 is fetched in a register, and this count value is subtracted each time the clock signal is input to the clock terminal. Then, when the count value reaches 0, a drive pulse is applied from the CY output terminal to its own load terminal via one input terminal of the OR gate 39, and a stepping motor 41 is rotationally driven via the OR gate 40. Drive circuit
Apply to 42. The pulse signal output from the P4 output port of the CPU 20 is input to the other input terminal of the OR gate 40. The output signal of the OR gate 40 is input to the motor drive circuit 42 and the pulse number counter 43
Input to the clock terminal of. The output signal of the pulse number counter 43 is input to the other input terminal of the pulse number matching circuit 28. The output signal of the pulse number counter 43 is sent to the outside as a monitor signal as information indicating the actual rotational position of the stepping motor 41. Pulse number matching circuit
28 is a preset terminal of the flip-flop 30 via the OR gate 37 from the output terminal when the number of pulses transmitted from the pulse number counter 43 matches the number of pulses transmitted from the pulse number latch circuit 27. Is input to.

また、外部から入力されたシステムリセット信号SRはCP
U20,DMA制御部26のリセット端子へ入力するとともにR/S
フリップフロップ34のクリア端子へ入力される。
Also, the system reset signal SR input from the outside is CP
U20, input to reset terminal of DMA control unit 26 and R / S
It is input to the clear terminal of the flip-flop 34.

前記ROM24内には第2図に示す速度メモリ44が形成され
ている。この速度メモリ44は第3図の速度制御を具体化
するためのデータを記憶する。すなわち、第3図の横軸
はモータ駆動回路42へ印加される駆動パルスのステップ
数を示す。通常この数値がステッピングモータ41が移動
させる物体の物理的位置を示すことになる。Xはステッ
ピングモータ41の停止位置までのステップ数である。縦
軸は前記モータ駆動回路42へ送出する駆動パルスのパル
ス送出間隔、すなわちステッピングモータ41の速度をク
ロック発振器38から出力されるクロック信号の周波数CL
Kのパルス比で示すものであり、CLK/3〜CLK/8は、それ
ぞれパルス比がCLKの1/3〜1/8である。第3図において
はCLK/8の低速から加速を5段階実施し、6段階目にCLK
/3になったところで、一定速度となり、(X−3)ステ
ップ目の位置で減速を開始して、3段階の減速を実施し
たのち、位置Xで停止する。
A speed memory 44 shown in FIG. 2 is formed in the ROM 24. The speed memory 44 stores data for embodying the speed control shown in FIG. That is, the horizontal axis of FIG. 3 shows the number of steps of the drive pulse applied to the motor drive circuit 42. Normally, this numerical value indicates the physical position of the object moved by the stepping motor 41. X is the number of steps to the stop position of the stepping motor 41. The vertical axis represents the pulse transmission interval of the drive pulse transmitted to the motor drive circuit 42, that is, the speed CL of the clock signal output from the clock oscillator 38 to the speed of the stepping motor 41.
The pulse ratio of CLK / 3 to CLK / 8 is 1/3 to 1/8 of CLK. In Fig. 3, acceleration is carried out in 5 steps from the low speed of CLK / 8, and CLK is executed in the 6th step.
When it becomes / 3, the speed becomes constant, the deceleration is started at the position of the (X-3) th step, the deceleration is carried out in three stages, and then stopped at the position X.

第2図の速度メモリ44の開始アドレス番号A0からアドレ
ス番号AE-1のビット2〜n+2には、8,7,6,5,4の5段
階の加速時のパルス間隔を示すカウント値,3の一定速時
のカウント値,および6,4,8の減速時の3段階のカウン
ト値が格納されている。また、最終のアドレス番号AE
は2n−1が格納されている。そして、ビット1におい
て、一定速度の3および最終の停止時の2n−1のアドレ
ス番号以外には1の変速フラグ45が格納されている。さ
らに、ビット0において、最終のアドレス番号AEには1
の最終フラグ46が格納されている。
In the speed memory 44 shown in FIG. 2, bits 2 to n + 2 of the start address number A 0 to the address number AE-1 have count values indicating pulse intervals at the time of accelerating in five stages of 8, 7, 6, 5, and 4. , 3 at a constant speed and 6, 4 and 8 deceleration at three stages are stored. Also, 2n-1 is stored in the final address number A E. Then, in bit 1, a shift flag 45 of 1 is stored in addition to the address number of 3 at a constant speed and 2n-1 at the final stop. Furthermore, at bit 0, the final address number A E is 1
The final flag 46 of is stored.

しかして、外部から任意数を有したステップパルスが入
力すると、前記CPU20は第5図の初期設定処理を実行す
る。すなわち、流れ図が開始されると、ROM24内の第2
図の速度メモリ44の各データをRAM25内に転送する。次
にDMA制御部26を初期化する。そして、開始アドレス番
号A0をDMA開始アドレスに設定するとともに、最終アド
レス番号AEをDMA終了アドレスに設定する。次に入力し
たステップパルス数から減速開始位置から1ステップ減
算した値を差引いたステップ数をパルス数ラッチ回路27
へ設定する。実施例においては(X−4)となる。
Then, when a step pulse having an arbitrary number is input from the outside, the CPU 20 executes the initialization process of FIG. That is, when the flow chart is started, the second
Each data in the speed memory 44 shown in the figure is transferred into the RAM 25. Next, the DMA control unit 26 is initialized. Then, the start address number A 0 is set as the DMA start address, and the final address number A E is set as the DMA end address. The step number obtained by subtracting the value obtained by subtracting one step from the deceleration start position from the next input step pulse number is used as the pulse number latch circuit 27
Set to. In the example, it is (X-4).

以上の処理が終了すると、P1出力ポートよりHレベルの
1パルスを出力する。すると、フリップフロップ30およ
びR/Sフリップフロップ34がセットされ、アンドゲート3
5からHレベルのDMA要求信号がDMA制御部26へ印加され
る。DMA制御部26はCPU20にホールド要求信号を送出し、
CPU20はホールド応答信号をDMA制御部26を返送して、DM
A制御部26はDMA処理を開始する。すなわち、RAM25の開
始アドレス番号A0を指定して読出信号RDと書込信号WRお
よびDMA応答信号ACKを送出する。すると、アンドゲート
33が成立し、フリップフロップ29,30のトリガ端子およ
びデータラッチ回路31のロード端子へパルス信号が入力
される。すると、データバス21へ出力された第2図の速
度メモリ44の開始アドレスA0のビット0,ビット1,ビット
2〜n+2の各データ0,1,8がセットされる。また、R/S
フリップフロップ34はクリアされる。その結果、R/Sフ
リップフロップ34のQ出力端子の出力信号はLレベルに
なり、DMA制御部26のDMA要求端子REQはLレベルとな
る。したがって、DMA制御部26はCPU20へ送出していたホ
ールド信号を解除するので、CPU20は第5図の流れ図の
実行を再開する。
When the above processing is completed, one pulse of H level is output from the P1 output port. Then, the flip-flop 30 and the R / S flip-flop 34 are set, and the AND gate 3
A DMA request signal of H level from 5 is applied to the DMA control unit 26. The DMA control unit 26 sends a hold request signal to the CPU 20,
The CPU 20 returns the hold response signal to the DMA control unit 26, and the DM
The A control unit 26 starts the DMA processing. That is, the start address number A 0 of the RAM 25 is designated and the read signal RD, the write signal WR, and the DMA response signal ACK are transmitted. Then And Gate
33 is established, and the pulse signal is input to the trigger terminals of the flip-flops 29 and 30 and the load terminal of the data latch circuit 31. Then, the data 0, 1, 8 of bit 0, bit 1, bit 2 to n + 2 of the start address A 0 of the speed memory 44 of FIG. 2 output to the data bus 21 are set. Also, R / S
The flip-flop 34 is cleared. As a result, the output signal of the Q output terminal of the R / S flip-flop 34 becomes L level, and the DMA request terminal REQ of the DMA control unit 26 becomes L level. Therefore, the DMA control unit 26 releases the hold signal sent to the CPU 20, so that the CPU 20 restarts the execution of the flowchart of FIG.

流れ図が再開されると、CPU20はP3出力ポートからHレ
ベルの1パルスを出力する。すると、このパルスはオア
ゲート39を介してデータカウンタ32のロード端子に入力
するので、データラッチ回路31にラッチされたカウント
値、すなわち速度メモリ44の開始アドレスA0のパルス間
隔に対応するカウント値8がデータカウンタ32のレジス
タに初期設定される。
When the flow chart is restarted, the CPU 20 outputs one H level pulse from the P3 output port. Then, since this pulse is input to the load terminal of the data counter 32 via the OR gate 39, the count value latched by the data latch circuit 31, that is, the count value 8 corresponding to the pulse interval of the start address A 0 of the speed memory 44 is set. Is initialized to the register of the data counter 32.

次に、CPU20はP1出力ポートより再び1パルス出力す
る。すると、R/Sフリップフロップ34,フリップフロップ
30が再びプリセットされ、DMA制御部26に再びDMA要求信
号が入力される。するとDMA制御部26内の読出しアドレ
スは1だけ増加しているので、速度メモリ44の次のアド
レス番号A1のデータ0,1.7がそれぞれフリップフロップ2
9,30,データラッチ回路31へセットされる。
Next, the CPU 20 outputs one pulse again from the P1 output port. Then R / S flip-flop 34, flip-flop
30 is preset again, and the DMA request signal is input to the DMA control unit 26 again. Then, since the read address in the DMA control unit 26 is incremented by 1 , the data 0 and 1.7 at the next address number A 1 in the speed memory 44 are respectively flip-flop 2
9, 30, set in the data latch circuit 31.

次に、CPU20はP4出力ポートからHレベルの1パルスを
送出する。すると、このパルスはオアゲート40を介して
モータ駆動回路42へ駆動パルスとして印加されるので、
ステッピングモータ41は1ステップパルス分だけ回転す
る。同時にパルス数カウンタ43が1パルスだけ増加す
る。
Next, the CPU 20 sends out one pulse of H level from the P4 output port. Then, this pulse is applied as a drive pulse to the motor drive circuit 42 via the OR gate 40.
The stepping motor 41 rotates by one step pulse. At the same time, the pulse number counter 43 increments by one pulse.

さらに、CPU20はP2出力ポートをHレベルに変化させる
と、この初期設定処理を終了する。そして、以上の初期
設定処理が終了すると、CPU20のプログラム的介入なし
に、第1図の各回路が動作し、ステッピングモータ41は
速度メモリ44の設定データに従って、加速,定速,減速
動作を実施する。
Further, when the CPU 20 changes the P2 output port to the H level, this initialization process ends. When the above initial setting processing is completed, each circuit of FIG. 1 operates without the program intervention of the CPU 20, and the stepping motor 41 performs acceleration, constant speed, and deceleration operations according to the setting data of the speed memory 44. To do.

すなわち、P2出力ポートがHレベルになると、クロック
発振器38のゲート端子GがHレベルになるので、このク
ロック発振器38は所定周波数CLKのクロック信号をデー
タカウンタ32へ入力する。すると、データカウンタ32は
レジスタにセットされたカウント値を減算カウントす
る。そして、カウント値が0に達した時点で、出力端子
CYから駆動パルスがオアゲート40を介してモータ駆動回
路42へ印加される。するとステッピングモータ41は1パ
ルス分だけ回転する。同時にパルス数カウンタ43のカウ
ント値が1だけ増加される。さらに駆動パルスはオアゲ
ート39を介して自己のロード端子に入力されるので、こ
のデータカウンタ32にはデータラッチ回路31から次のカ
ウント値、すなわち速度メモリ44のアドレス番号A1のパ
ルス間隔に対応するカウント値7がセットされると同時
にクロック信号にて減算される。前記駆動パルスはR/S
フリップフロップ34のプリセット端子へ入力されるの
で、このR/Sフリップフロップ34は成立し、DMA制御部26
に次のDMA要求信号を送出する。なお、この駆動パルス
はアンドゲート36にも入力するが、この時のフリップフ
ロップ29の出力信号はLレベルであるので、CPU20に割
込信号が印加されることはない。
That is, when the P2 output port becomes H level, the gate terminal G of the clock oscillator 38 becomes H level, so that the clock oscillator 38 inputs the clock signal of the predetermined frequency CLK to the data counter 32. Then, the data counter 32 subtracts and counts the count value set in the register. Then, when the count value reaches 0, the output terminal
A drive pulse from CY is applied to the motor drive circuit 42 via the OR gate 40. Then, the stepping motor 41 rotates by one pulse. At the same time, the count value of the pulse number counter 43 is incremented by 1. Further, since the drive pulse is input to its own load terminal via the OR gate 39, the data counter 32 corresponds to the next count value from the data latch circuit 31, that is, the pulse interval of the address number A 1 of the speed memory 44. At the same time that the count value 7 is set, it is subtracted by the clock signal. The drive pulse is R / S
Since this is input to the preset terminal of the flip-flop 34, this R / S flip-flop 34 is established and the DMA control unit 26
The next DMA request signal is sent to. Although this drive pulse is also input to the AND gate 36, since the output signal of the flip-flop 29 at this time is at L level, no interrupt signal is applied to the CPU 20.

以上のようにデータカウンタ32は速度メモリ44に設定さ
れたパルス間隔(カウント値)を順次セットし、減算し
て、ステッピングモータ41の回転速度を加速していく。
そして、アドレス番号AがA5まで達すると、フリップフ
ロップ30に0が入力されるので、アンドゲート35はR/S
フリップフロップ34の出力レベルにかかわらず成立しな
い。したがって、次回からは駆動パルスがデータカウン
タ32から出力されたとしても、DMA制御部26は動作を行
なわない。そして、この期間中はデータラッチ回路31に
アドレス番号A5の一定速に対応するカウント値3がセッ
トされたままであるので、データカウンタ32はこの一定
速のカウント値をカウントアップする度に駆動パルスを
モータ駆動回路42およびパルス数カウンタ43へ送出す
る。しかして、ステッピングモータ41は一定速度で回転
する。
As described above, the data counter 32 sequentially sets and subtracts the pulse interval (count value) set in the speed memory 44, and accelerates the rotation speed of the stepping motor 41.
Then, when the address number A reaches A 5 , 0 is input to the flip-flop 30, so that the AND gate 35 becomes R / S.
It does not hold regardless of the output level of the flip-flop 34. Therefore, from the next time, even if the drive pulse is output from the data counter 32, the DMA control unit 26 does not operate. Then, during this period, the count value 3 corresponding to the constant speed of the address number A 5 remains set in the data latch circuit 31, so that the data counter 32 drives the drive pulse every time the count value of the constant speed is counted up. To the motor drive circuit 42 and the pulse number counter 43. Then, the stepping motor 41 rotates at a constant speed.

そして、パルス数カウンタ43のカウント値がパルス数ラ
ッチ回路27のパルス数に一致すると、第3図においてス
テッピングモータ41は減速開始位置(X−4)に達した
ので、パルス数一致回路28からフリップフロップ30のプ
リセット端子にパルスが送出される。すると、アンドゲ
ート35は成立して、DMA制御部26にDMA要求信号が印加さ
れる。そして、DMA制御部26は速度メモリ44の次のアド
レス番号A6の各データ0,1,4をそれぞれフリップフロッ
プ29,30,データラッチ回路31にセットする。そして、そ
れ以後ビット1には変速フラグ1がセットされているの
で、加速時と同様に速度メモリ44の各パルス間隔のカウ
ント値が順次データラッチ回路31に設定される。したが
って、データカウンタ32から出力される駆動パルスの送
出間隔は順次短くなる。そして、アドレス番号Aが最終
のアドレス番号AEに達すると、フリップフロップ29が成
立して、データカウンタ32から駆動パルスが送出された
タイミングでアンドゲート36を介してCPU20の割込端子I
NTにステッピングモータ駆動停止の割込信号が入力され
る。
When the count value of the pulse number counter 43 matches the pulse number of the pulse number latch circuit 27, the stepping motor 41 has reached the deceleration start position (X-4) in FIG. A pulse is sent to the preset terminal of the flip-flop 30. Then, the AND gate 35 is established and the DMA request signal is applied to the DMA control unit 26. Then, the DMA control unit 26 sets each data 0, 1, 4 of the next address number A 6 of the speed memory 44 in the flip-flops 29, 30, and the data latch circuit 31, respectively. Since the shift flag 1 is set in bit 1 thereafter, the count value of each pulse interval of the speed memory 44 is sequentially set in the data latch circuit 31 as in the acceleration. Therefore, the transmission intervals of the drive pulses output from the data counter 32 are sequentially shortened. When the address number A reaches the final address number A E , the flip-flop 29 is established, and at the timing when the drive pulse is sent from the data counter 32, the interrupt terminal I of the CPU 20 is passed through the AND gate 36.
An interrupt signal for stopping the stepping motor drive is input to NT.

割込端子INTに割込信号が入力された時点でCPU20は第6
図の流れ図を実行する。すなわち、P2出力ポートの出力
レベルを元のLレベルへ戻す。すると、クロック発振器
38のゲート端子GがLレベルに戻るので、データカウン
タ32はカウント動作を停止し、駆動パルスの出力は停止
される。その結果、ステッピングモータ41は回転停止す
る。
When the interrupt signal is input to the interrupt terminal INT, the CPU20
Run the flowchart in the figure. That is, the output level of the P2 output port is returned to the original L level. Then the clock oscillator
Since the gate terminal G of 38 returns to the L level, the data counter 32 stops the counting operation and the output of the drive pulse is stopped. As a result, the stepping motor 41 stops rotating.

なお、この際、第6図の流れ図を実施するには実行時間
が必要となり、この実行時間中にデータカウンタ32がカ
ウント値の計数を終了してしまうと、モータ駆動回路42
に駆動パルスが1個余分に印加される。この事態を避け
るためにデータラッチ回路31およびデータカウンタ32の
桁数をnとすると、このデータラッチ回路31およびデー
タカウンタ32にセットできる最大値(2n−1)が設定さ
れる。したがって、この最大値のカウントダウンが終了
する以前に必ず第6図の処理を終了させることが可能で
ある。
At this time, an execution time is required to implement the flowchart of FIG. 6, and if the data counter 32 finishes counting the count value during this execution time, the motor drive circuit 42
An extra drive pulse is applied to the. In order to avoid this situation, assuming that the number of digits of the data latch circuit 31 and the data counter 32 is n, the maximum value (2n-1) that can be set in the data latch circuit 31 and the data counter 32 is set. Therefore, it is always possible to end the process of FIG. 6 before the end of the countdown of the maximum value.

なお、第4図は前述したCPU20の各出力ポートP1,P2,P3,
P4の出力状態,DMA制御部26のDMA要求信号REQの発生タイ
ミングおよびCPU20に対する割込信号の発生タイミング
を示すタイムチャートである。
Note that FIG. 4 shows the output ports P1, P2, P3,
6 is a time chart showing the output state of P4, the generation timing of a DMA request signal REQ of the DMA control unit 26, and the generation timing of an interrupt signal for the CPU 20.

このように構成されたステッピングモータの駆動装置で
あれば、CPU20はステッピングモータ41の回転開始時に
第5図に示した初期設定処理を実施するのみで、ステッ
ピングモータ41が加速,一定速,減速動作を実行する。
そして、CPU20は割込信号が入力した時点で第6図に示
すステッピングモータの停止処理をするのみでよい。
In the case of the stepping motor driving device configured as described above, the CPU 20 only performs the initialization process shown in FIG. 5 when the stepping motor 41 starts rotating, and the stepping motor 41 performs acceleration, constant speed, and deceleration operations. To execute.
Then, the CPU 20 need only perform the stepping motor stop processing shown in FIG. 6 when the interrupt signal is input.

したがって、ステッピングモータ41のモータ駆動回路42
に印加する駆動パルス(ステップパルス)毎にCPU20に
対して割込信号を送出することなしに、ステッピングモ
ータ41の加速,定速,減速制御を実施できる。その結
果、速度メモリ44に設定する回転速度を示すパルス間隔
に対応したカウント値を、CPU20の処理速度に関係なく
小さく設定することが可能であるので、ステッピングモ
ータ41の加速,減速に要する時間を短縮でき、全体のモ
ータ回転駆動に要する時間を短縮することができる。
Therefore, the motor drive circuit 42 of the stepping motor 41 is
The acceleration, constant speed, and deceleration control of the stepping motor 41 can be performed without sending an interrupt signal to the CPU 20 for each drive pulse (step pulse) applied to the. As a result, the count value corresponding to the pulse interval indicating the rotation speed set in the speed memory 44 can be set small regardless of the processing speed of the CPU 20, so that the time required for the acceleration and deceleration of the stepping motor 41 can be reduced. Therefore, it is possible to shorten the time required to drive the entire motor.

また、CPU20の処理量が大幅に低減されるので、その間
に他の処理を実施できる。例えば印字装置等においては
外部から入力した文字コードに対応する文字パターンを
キャラクタジェネレータから読出し、編集する処理等を
実施できる。
Moreover, since the processing amount of the CPU 20 is significantly reduced, other processing can be performed during that time. For example, in a printing device or the like, a process of reading out a character pattern corresponding to a character code input from the outside from a character generator and editing it can be performed.

[発明の効果] 以上説明したように本発明によれば、加速時における各
パルス間隔,一定速度時におけるパルス間隔および減速
時における各パルス間隔のデータを加速時および減速時
におけるパルス間隔のデータか否かを示す変速フラグと
減速時における最終パルス間隔のデータか否かを示す最
終フラグとともにアドレス番号順に記憶する速度メモリ
を設けるとともに、この速度メモリのパルス間隔デー
タ,変速フラグおよび最終フラグをアドレス番号順に読
出すDMA制御部を設け、外部から任意のステップパルス
数が入力されると、そのステップパルス数から速度メモ
リにおける減速時のパルス間隔データ数を減算したステ
ップパルス数をパルス数ラッチ回路でラッチするととも
に、DMA制御部により速度メモリからパルス間隔デー
タ,変速フラグおよび最終フラグを読出し、そのパルス
間隔の計時が終了する毎に駆動パルスを出力してステッ
ピングモータを回転駆動するようにしている。また、読
出された変速フラグが加速時および減速時のパルス間隔
データであることを示す場合および駆動パルス数を計数
するパルス数カウンタの計数値がパルス数ラッチ回路に
ラッチされたパルス数に一致した場合には次のアドレス
番号のパルス間隔を読出すDMA要求信号をDMA制御部へ送
出し、読出された最終フラグが減速時におけるパルス間
隔の最終データであることを示す場合にはステッピング
モータ駆動停止の割込信号を出力するようにしている。
したがって、CPUに対する各ステップ毎の割込動作を行
なわずにステッピングモータの加速,定速,減速制御を
実施でき、モータの回転駆動に要する時間を短縮できる
とともに、CPUにおける余裕時間が増加することによる
同時実施の他処理の処理能率を向上できる。しかも、減
速メモリからパルス間隔データとともに読出される変速
フラグによって加速時から定速時への状態変化を自動的
に起こすことができるので、起動から加速終了までのス
テップ数を意識する必要がない。また、外部より入力さ
れたステップパルス数から減速時におけるパルス間隔の
データ数を減算したステップパルス数をパルス数ラッチ
回路でラッチし、このラッチされたステップパルス数と
駆動パルス数との一致を検出することによって定速時か
ら減速時への状態変化を自動的に起こすことができるの
で、起動から減速開始までのステップ数を意識する必要
もない。したがって、様々なスローアップまたはスロー
ダウンのパターンにも容易に対応できるようになる。
[Effect of the Invention] As described above, according to the present invention, the data of each pulse interval at the time of acceleration, the pulse interval at a constant speed, and the pulse interval at the time of deceleration are the data of the pulse interval at the time of acceleration and deceleration. A speed memory that stores in order of address number together with a speed change flag indicating whether or not and a final flag indicating whether or not the final pulse interval during deceleration is provided, and the pulse interval data, speed change flag and final flag of this speed memory A DMA controller that reads sequentially is provided. When an arbitrary step pulse number is input from the outside, the pulse number latch circuit latches the step pulse number obtained by subtracting the pulse interval data number during deceleration in the speed memory from the step pulse number. At the same time, the DMA controller uses the speed memory to output the pulse interval data and The lag and the final flag are read out, and a driving pulse is output each time the timing of the pulse interval is completed to drive the stepping motor to rotate. Further, when the read shift flag indicates that it is pulse interval data during acceleration and deceleration, and the count value of the pulse number counter that counts the number of drive pulses matches the number of pulses latched in the pulse number latch circuit. In this case, the DMA request signal for reading the pulse interval of the next address number is sent to the DMA control unit, and if the read final flag indicates the final data of the pulse interval during deceleration, stop the stepping motor drive. The interrupt signal of is output.
Therefore, the acceleration, constant speed, and deceleration control of the stepping motor can be performed without performing the interrupt operation for each step to the CPU, and the time required for rotational driving of the motor can be shortened and the margin time in the CPU is increased. It is possible to improve the processing efficiency of other processing simultaneously performed. Moreover, since the shift flag read from the deceleration memory together with the pulse interval data can automatically cause a state change from acceleration to constant speed, it is not necessary to be aware of the number of steps from the start to the end of acceleration. Also, the pulse number latch circuit latches the step pulse number obtained by subtracting the data number of the pulse interval during deceleration from the step pulse number input from the outside, and detects the match between this latched step pulse number and the drive pulse number. By doing so, it is possible to automatically cause a state change from constant speed to deceleration, so it is not necessary to be aware of the number of steps from startup to deceleration start. Therefore, it becomes possible to easily cope with various slow-up or slow-down patterns.

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

第1図は本発明の一実施例に係わるステッピングモータ
の駆動装置を示すブロック図、第2図は同実施例の速度
メモリを示す図、第3図は同実施例のステッピングモー
タの速度制御を示す図、第4図は同実施例の動作を示す
タイムチャート、第5図および第6図は同実施例の動作
を示す流れ図、第7図は従来装置のステッピングモータ
の速度制御を示す図、第8図は従来装置を示すブロック
図、第9図は同従来装置の動作を示す流れ図である。 20……CPU、21……データバス、22……アドレスバス、2
3……制御バス、24……ROM、25……RAM、26……DMA制御
部、27……パルス数ラッチ回路、28……パルス数一致回
路、29……フリップフロップ(第2の論理回路)、30…
…フリップフロップ(第1の論理回路)、31……データ
ラッチ回路、32……データカウンタ、34……R/Sフリッ
プフロップ、38……クロック発振器、41……ステッピン
グモータ、42……モータ駆動回路、43……パルス数カウ
ンタ、44……速度メモリ、45……変速フラグ、45……終
了フラグ。
FIG. 1 is a block diagram showing a stepping motor drive device according to an embodiment of the present invention, FIG. 2 is a diagram showing a speed memory of the same embodiment, and FIG. 3 is a speed control of the stepping motor of the same embodiment. FIG. 4, FIG. 4 is a time chart showing the operation of the embodiment, FIGS. 5 and 6 are flow charts showing the operation of the embodiment, and FIG. 7 is a view showing the speed control of the stepping motor of the conventional apparatus, FIG. 8 is a block diagram showing a conventional device, and FIG. 9 is a flow chart showing the operation of the conventional device. 20 …… CPU, 21 …… Data bus, 22 …… Address bus, 2
3 ... Control bus, 24 ... ROM, 25 ... RAM, 26 ... DMA control unit, 27 ... Pulse number latch circuit, 28 ... Pulse number matching circuit, 29 ... Flip-flop (second logic Circuit), 30 ...
… Flip-flop (first logic circuit), 31 …… Data latch circuit, 32 …… Data counter, 34 …… R / S flip-flop, 38 …… Clock oscillator, 41 …… Stepping motor, 42 …… Motor drive Circuit, 43 ... pulse number counter, 44 ... speed memory, 45 ... shift flag, 45 ... end flag.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】加速時にステッピングモータに印加するス
テップパルス信号のパルス送出間隔を順次減少し、所定
速度に達した後前記パルス送出間隔を一定値に維持し、
減速時に前記パルス送出間隔を順次増加することによっ
て、外部から入力したステップパルス数分だけ前記ステ
ッピングモータを回転駆動するステッピングモータの駆
動装置において、 前記加速時における各パルス間隔,一定速度時における
パルス間隔および減速時における各パルス間隔のデータ
を前記加速時および減速時におけるパルス間隔のデータ
か否かを示す変速フラグと減速時における最終パルス間
隔のデータか否かを示す最終フラグとともにアドレス番
号順に記憶する速度メモリと、前記外部から入力された
ステップパルス数から前記速度メモリの減速時における
パルス間隔のデータ数を減算したステップパルス数をラ
ッチするパルス数ラッチ回路と、前記速度メモリに記憶
されたパルス間隔のデータをそのデータに対応する変速
フラグおよび最終フラグとともに前記アドレス番号順に
順次データバスへ出力するDMA制御部と、前記データバ
スへ出力された前記変速フラグが加速時および減速時に
おけるパルス間隔のデータを示すとき次のアドレス番号
のデータを読出すDMA要求信号を前記DMA制御部へ送出す
る第1の論理回路と、前記データバスへ送出されたパル
ス間隔のデータをラッチするデータラッチ回路と、この
データラッチ回路にラッチされたデータのパルス間隔を
計時するデータカウンタと、このデータカウンタから計
時終了する度に出力される駆動パルスを受けて前記ステ
ッピングモータを回転駆動するモータ駆動回路と、前記
駆動パルスのパルス数を計数するパルス数カウンタと、
このパルス数カウンタの計数値が前記パルス数ラッチ回
路にラッチされたパルス数に一致したとき前記DMA要求
信号を前記DMA制御部へ送出するパルス数一致回路と、
前記データバスへ出力された前記最終フラグが減速時に
おける最終パルス間隔のデータを示すときステッピング
モータ駆動停止の割込信号を出力する第2の論理回路と
を備えたことを特徴とするステッピングモータの駆動装
置。
1. A pulse transmission interval of a step pulse signal applied to a stepping motor at the time of acceleration is sequentially decreased, and the pulse transmission interval is maintained at a constant value after reaching a predetermined speed,
In a stepping motor driving device that rotationally drives the stepping motor by the number of step pulses input from the outside by sequentially increasing the pulse transmission interval during deceleration, each pulse interval during the acceleration and the pulse interval during the constant speed And the data of each pulse interval at the time of deceleration are stored in the order of address numbers together with the shift flag indicating whether it is the data of the pulse interval at the time of acceleration and deceleration and the final flag indicating the data of the final pulse interval at the time of deceleration. A speed memory, a pulse number latch circuit for latching a step pulse number obtained by subtracting the number of pulse interval data during deceleration of the speed memory from the step pulse number input from the outside, and a pulse interval stored in the speed memory Of the data corresponding to that data A DMA control unit that sequentially outputs to the data bus in the order of the address number together with a flag and a final flag, and when the shift flag output to the data bus indicates the data of the pulse interval during acceleration and deceleration, the data of the next address number A first logic circuit for sending out a DMA request signal for reading out to the DMA control section, a data latch circuit for latching the data of the pulse interval sent out to the data bus, and a data latch circuit for latching the data latched in the data latch circuit. A data counter for counting the pulse intervals, a motor drive circuit for driving the stepping motor in rotation upon receipt of a drive pulse output from the data counter each time the timing of the time is completed, and a pulse number counter for counting the number of the drive pulses. When,
A pulse number matching circuit that sends the DMA request signal to the DMA control unit when the count value of the pulse number counter matches the number of pulses latched in the pulse number latch circuit,
A second logic circuit that outputs an interrupt signal for stopping the stepping motor drive when the final flag output to the data bus indicates data of the final pulse interval during deceleration. Drive.
JP60259432A 1985-11-19 1985-11-19 Driving device for stepping motor Expired - Lifetime JPH0732638B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60259432A JPH0732638B2 (en) 1985-11-19 1985-11-19 Driving device for stepping motor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60259432A JPH0732638B2 (en) 1985-11-19 1985-11-19 Driving device for stepping motor

Publications (2)

Publication Number Publication Date
JPS62118796A JPS62118796A (en) 1987-05-30
JPH0732638B2 true JPH0732638B2 (en) 1995-04-10

Family

ID=17334005

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60259432A Expired - Lifetime JPH0732638B2 (en) 1985-11-19 1985-11-19 Driving device for stepping motor

Country Status (1)

Country Link
JP (1) JPH0732638B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3972724B2 (en) * 2002-05-10 2007-09-05 セイコーエプソン株式会社 Motor control device
JP6167672B2 (en) * 2013-05-31 2017-07-26 株式会社リコー Motor control device and motor control method
JP7155653B2 (en) * 2018-06-22 2022-10-19 コニカミノルタ株式会社 Drive device, image forming device, and control program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5389924A (en) * 1977-01-18 1978-08-08 Brother Ind Ltd Device for generating clock pulses of pulse motor
JPS59177631A (en) * 1983-03-29 1984-10-08 Fujitsu Ltd Dma control system

Also Published As

Publication number Publication date
JPS62118796A (en) 1987-05-30

Similar Documents

Publication Publication Date Title
US4506201A (en) Microprocessor controlled pulse motor
US4489260A (en) Method of driving a stepping motor and a drive circuit thereof
US4143980A (en) Shifting arrangement for exact space positioning of a writing carriage in typewriters
CN112889218A (en) Automated speed ramp control for stepper motors
JPH0732638B2 (en) Driving device for stepping motor
JP2790273B2 (en) Drive
US4144447A (en) Interval timer
JP3188976B2 (en) Print control device and method
US4278021A (en) Magnetic interference prevention system
US2983357A (en) Electronic counter control for continuous forms feeding
JPS6013488A (en) Digital phase servo circuit
US3961162A (en) Method and apparatus for interrupting a device for a preselected interval of time
JP2638855B2 (en) Motor speed control device
KR950005674B1 (en) Motor Drive Device and Method of Electronic Typewriter
JPH02131614A (en) Pulse generator
JP3251344B2 (en) Pulse output circuit
JP2714910B2 (en) Flexible disk unit
JPS6356199A (en) Control unit of pulse motor
JP2621477B2 (en) In-circuit emulator
JP2619016B2 (en) Digital control device
SU1387165A1 (en) Device for programmed acceleration of stepping motor
JPH1056797A (en) Pulse generator
JPS59139898A (en) Speed controller for pulse motor
JPS6027578B2 (en) printing device
JPS6148360B2 (en)