JP2000078891A - Motor controller - Google Patents

Motor controller

Info

Publication number
JP2000078891A
JP2000078891A JP24517198A JP24517198A JP2000078891A JP 2000078891 A JP2000078891 A JP 2000078891A JP 24517198 A JP24517198 A JP 24517198A JP 24517198 A JP24517198 A JP 24517198A JP 2000078891 A JP2000078891 A JP 2000078891A
Authority
JP
Japan
Prior art keywords
motor
control device
excitation signal
command
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
JP24517198A
Other languages
Japanese (ja)
Inventor
Kunihiko Sasaki
佐々木  邦彦
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.)
Olympus Corp
Original Assignee
Olympus Optical 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 Olympus Optical Co Ltd filed Critical Olympus Optical Co Ltd
Priority to JP24517198A priority Critical patent/JP2000078891A/en
Publication of JP2000078891A publication Critical patent/JP2000078891A/en
Pending legal-status Critical Current

Links

Landscapes

  • Control Of Stepping Motors (AREA)

Abstract

PROBLEM TO BE SOLVED: To control the speed and the position of a motor by forming an excitation switching signal without forming a command pulse, reduce circuit scale, miniaturize an apparatus, reduce the cost, and facilitate manufacturing, in motor control equipment of decentralized control system. SOLUTION: A plurality of motor control units 26 are coupled with a host control apparatus 21 via SCB 25. Data concerning a plurality of excitation signal sequences corresponding to the kinds of motors 33 as objects to be controlled are stored in storage devices 30. Excitation signals of the motors 33 are outputted from excitation signal generating parts 31. In response to a control command outputted from the host control apparatus 21, CPU 28 refers to the data of the storage devices 30, and controls the excitation signal generating parts 31.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明はモータ制御装置に
関し、より詳細には、単一のホスト制御装置によって多
数軸のモータの制御を行う各モータ制御装置を、シリア
ル通信を介して制御する分散制御システムのモータ制御
装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a motor control device, and more particularly, to a distributed control for controlling, via serial communication, each motor control device that controls a multi-axis motor by a single host control device. The present invention relates to a motor control device of a system.

【0002】[0002]

【従来の技術】従来より、ステップピングモータの駆動
装置と、その駆動方法が種々開発されている。例えば、
特開平6−209598号公報には、図8に示されるよ
うな装置が開示されている。
2. Description of the Related Art Various types of stepping motor driving devices and driving methods have been developed. For example,
JP-A-6-209598 discloses an apparatus as shown in FIG.

【0003】図8に於いて、指令パルス発生器1から
は、図9(A)、(B)に示される指令パルス列aが駆
動装置2に出力される。駆動装置2内では、先ず、安定
化装置5にて指令パルス列aが変調され、変調された信
号が励磁切替信号発生回路6に出力される。次に、励磁
切替信号発生回路6では、この信号が入力され、駆動部
7に信号が出力される。そして、駆動部7により、この
信号に従ってステッピングモータ3が駆動される。
In FIG. 8, a command pulse train a shown in FIGS. 9A and 9B is output from a command pulse generator 1 to a driving device 2. In the driving device 2, first, the command pulse train a is modulated by the stabilizing device 5, and the modulated signal is output to the excitation switching signal generation circuit 6. Next, this signal is input to the excitation switching signal generation circuit 6, and a signal is output to the drive unit 7. Then, the drive unit 7 drives the stepping motor 3 according to this signal.

【0004】上記安定化装置5は、単発負パルス発生回
路9と、遅延回路10を構成するのこぎり波発生回路1
2及びコンパレータ13と、論理積ゲート11とを有し
て成る。
The stabilizing device 5 includes a single-shot negative pulse generating circuit 9 and a sawtooth wave generating circuit 1 constituting a delay circuit 10.
2 and a comparator 13 and an AND gate 11.

【0005】単発負パルス発生回路9は指令パルスaに
よりトリガされ、図9(A)、(B)に示される単発負
パルスdが出力される。遅延回路10では、指令パルス
aが変調されて、図9(A)、(B)に示される変調パ
ルスeが出力される。また、論理積ゲート11では、単
発負パルス発生回路9の出力と遅延回路10の出力との
論理積がとられる。
The single-shot negative pulse generating circuit 9 is triggered by a command pulse a, and outputs a single-shot negative pulse d shown in FIGS. 9A and 9B. In the delay circuit 10, the command pulse a is modulated, and a modulated pulse e shown in FIGS. 9A and 9B is output. In the AND gate 11, the output of the single-shot negative pulse generation circuit 9 and the output of the delay circuit 10 are ANDed.

【0006】上記のこぎり波発生回路12では、パルス
列aからのこぎり波電圧bが作成されて出力される。こ
ののこぎり波発生回路12は、少なくともコンデンサ
と、該コンデンサに直列または並列に接続されたスイッ
チ手段と、該コンデンサに直列または並列に接続された
電流源または抵抗から構成される。また、コンパレータ
13は、のこぎり波電圧bと速度誤差電圧cとが比較さ
れ、のこぎり波電圧の値が速度誤差電圧の値より大きい
場合はハイレベルの信号が、小さい場合はローレベルの
信号が出力される(図9(A)、(B)のf)。
In the sawtooth wave generating circuit 12, a sawtooth voltage b is generated from the pulse train a and output. The sawtooth wave generating circuit 12 includes at least a capacitor, switch means connected in series or parallel to the capacitor, and a current source or resistor connected in series or parallel to the capacitor. The comparator 13 compares the sawtooth voltage b with the speed error voltage c, and outputs a high-level signal when the value of the sawtooth voltage is greater than the value of the speed error voltage, and outputs a low-level signal when the value is smaller. (F in FIGS. 9A and 9B).

【0007】指令パルスが入力されない定常状態に於い
ては、のこぎり波発生回路12の出力bは0Vである。
また、この信号bが0Vのときは、コンパレータ13に
於いて、この信号bと閾値である速度誤差電圧cとの比
較結果fはローレベルとなり、遅延回路10の出力eも
ローレベルとなる。
In a steady state where no command pulse is input, the output b of the sawtooth wave generating circuit 12 is 0V.
When the signal b is 0 V, the comparison result f of the comparator 13 between the signal b and the speed error voltage c, which is a threshold, becomes low level, and the output e of the delay circuit 10 also becomes low level.

【0008】一方、指令パルスaが入力された場合に、
のこぎり波発生回路12では、後縁に傾きをもったのこ
ぎり波bが1つ出力される。そして、コンパレータ13
では、のこぎり波電圧bが閾値(速度誤差電圧)cを超
えている場合はハイレベルが、閾値cを下回る場合はロ
ーレベルが、その出力fとして出力される。
On the other hand, when the command pulse a is input,
The sawtooth wave generating circuit 12 outputs one sawtooth wave b having a trailing edge. And the comparator 13
When the sawtooth voltage b exceeds the threshold (speed error voltage) c, the high level is output as the output f, and when the sawtooth voltage b is lower than the threshold c, the low level is output as the output f.

【0009】したがって、遅延回路10の出力eは正の
単発パルスとなって、該遅延回路10の出力eは正の単
発パルスとなる。また、単発負パルス発生回路9では、
指令パルスaが入力されることによって、十分に幅の短
い負の単発パルスdが出力される。
Therefore, the output e of the delay circuit 10 is a single positive pulse, and the output e of the delay circuit 10 is a single positive pulse. In the single-shot negative pulse generation circuit 9,
When the command pulse a is input, a single negative pulse d having a sufficiently short width is output.

【0010】そして、図9(A)に示されるように、こ
れら信号dと信号eの論理積がとられた値、すなわち安
定化装置5の出力gは、コンパレータ13の出力である
正の単発パルスeの前縁部分が単発負パルスdの分だけ
欠けたものとなる。ここで、単発負パルスdの幅は、上
述したように十分に短いので、変調パルスeに与える影
響は無視することができる。したがって、指令パルスが
比較的低速に出力される場合に於いては、この従来例の
回路は、ステッピングモータを指令パルスに従って適正
に駆動することができる。
As shown in FIG. 9A, the value obtained by calculating the logical product of the signal d and the signal e, that is, the output g of the stabilizing device 5 is a positive single shot which is the output of the comparator 13. The leading edge of the pulse e is missing for the single negative pulse d. Here, since the width of the single-shot negative pulse d is sufficiently short as described above, the influence on the modulation pulse e can be ignored. Therefore, when the command pulse is output at a relatively low speed, the conventional circuit can appropriately drive the stepping motor according to the command pulse.

【0011】他方、図9(B)に示されるように、指令
パルスが高速に入力され、のこぎり波bが閾値cに達す
る前に次の指令パルスaが入力された場合には、コンパ
レータ13の出力f、つまり遅延回路10の出力eはハ
イレベルのままとなる。しかし、論理積ゲート11に於
いて、出力eは単発負パルス発生回路9の出力dとの論
理積がとられる。したがって、単発負パルス発生回路9
の出力dが、そのまま安定化装置5の出力gとなり、励
磁切替信号発生回路6に出力される。
On the other hand, as shown in FIG. 9B, when the command pulse is input at a high speed and the next command pulse a is input before the sawtooth wave b reaches the threshold value c, the comparator 13 The output f, that is, the output e of the delay circuit 10 remains at the high level. However, in the AND gate 11, the output e is ANDed with the output d of the single-shot negative pulse generation circuit 9. Therefore, the single-shot negative pulse generation circuit 9
Is output g of the stabilizing device 5 as it is, and is output to the excitation switching signal generation circuit 6.

【0012】これにより、指令パルスが高速に出力され
る場合に於いても、この従来例の回路は、指令パルスを
励磁切替信号発生回路6に供給することができ、ステッ
ピングモータを指令パルスに従って駆動することができ
る。
Thus, even when the command pulse is output at a high speed, the circuit of the prior art can supply the command pulse to the excitation switching signal generating circuit 6 and drive the stepping motor in accordance with the command pulse. can do.

【0013】[0013]

【発明が解決しようとする課題】しかしながら、上述し
たモータ制御装置では、指令パルス発生器1により指令
パルスを生成してから、安定化装置5を介して励磁切替
信号発生回路6により励磁切替信号を生成しているた
め、回路規模が大きく、モータ制御装置が大きく高価で
あったり、モータ制御装置の製造が複雑であるという課
題を有していた。
However, in the above-described motor control device, after the command pulse is generated by the command pulse generator 1, the excitation switching signal is generated by the excitation switching signal generating circuit 6 via the stabilizing device 5. Due to the generation, the circuit scale is large, the motor control device is large and expensive, and the manufacturing of the motor control device is complicated.

【0014】特に、高速高精度のモータ制御を実現する
場合には、指令パルス発生器1の出力である指令パルス
は高速(高周波数)、高機能(S字駆動、補間等々)が
要求され、上述したような課題が、より顕著になってし
まうものであった。
In particular, when realizing high-speed and high-accuracy motor control, the command pulse output from the command pulse generator 1 requires high speed (high frequency) and high function (S-shaped drive, interpolation, etc.). The above-mentioned problem becomes more remarkable.

【0015】この発明は上記課題に鑑みてなされたもの
で、ホスト制御装置と各モータ制御装置との間をシリア
ル通信にて結合した分散制御システムのモータ制御装置
に於いて、指令パルスを生成することなく励磁切替信号
を生成してモータの速度制御、位置制御を行い、回路規
模が小さく、装置が小さく安価で、且つ、製造が容易な
モータ制御装置を提供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and generates a command pulse in a motor control device of a distributed control system in which a host control device and each motor control device are connected by serial communication. An object of the present invention is to provide a motor control device which generates an excitation switching signal and performs speed control and position control of a motor without generating the same, and has a small circuit scale, a small device, a low cost, and easy manufacture.

【0016】[0016]

【課題を解決するための手段】すなわちこの発明は、シ
リアル通信を介してホスト制御装置と複数のモータ制御
装置とを結合したモータ制御システムに適用可能なモー
タ制御装置であって、制御対象モータの種類に応じた複
数の励磁信号シーケンスに関するデータを記憶した記憶
手段と、制御対象モータの励磁信号を出力する励磁信号
出力手段と、上記ホスト制御装置から出力される制御命
令に応答して、上記記憶手段のデータを参照して上記励
磁信号出力手段を制御する処理手段と、を具備すること
を特徴とする。
That is, the present invention relates to a motor control device applicable to a motor control system in which a host control device and a plurality of motor control devices are connected via serial communication. Storage means for storing data relating to a plurality of excitation signal sequences corresponding to the type; excitation signal output means for outputting an excitation signal of the motor to be controlled; and said storage in response to a control command output from the host control device. Processing means for controlling the excitation signal output means with reference to data of the means.

【0017】この発明は、シリアル通信を介してホスト
制御装置と複数のモータ制御装置とを結合したモータ制
御システムに適用可能なモータ制御装置であって、制御
対象モータの種類に応じた複数の励磁信号シーケンスに
関するデータが記憶手段に記憶され、制御対象モータの
励磁信号が励磁信号出力手段により出力される。そし
て、上記ホスト制御装置から出力される制御命令に応答
して、処理手段により、上記記憶手段のデータが参照さ
れて上記励磁信号出力手段が制御される。
The present invention relates to a motor control device which can be applied to a motor control system in which a host control device and a plurality of motor control devices are connected via serial communication. Data relating to the signal sequence is stored in the storage means, and the excitation signal of the motor to be controlled is output by the excitation signal output means. Then, in response to a control command output from the host control device, the processing unit controls the excitation signal output unit by referring to data in the storage unit.

【0018】[0018]

【発明の実施の形態】以下、図面を参照してこの発明の
実施の形態を説明する。図1は、この発明の第1の実施
の形態に係るモータ制御装置の構成を示すブロック図で
ある。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of the motor control device according to the first embodiment of the present invention.

【0019】図1に於いて、ホスト制御装置21は、通
信コントローラ22と、演算制御部23と、プログラム
メモリ24を備えている。そして、上記ホスト制御装置
21は、シリアル通信バス(SCB)25を介して、複
数のモータ制御装置26と接続されている。モータ制御
装置26は、図1に於いては2つのみ示されているが、
SCB25を介して複数個のモータ制御装置26がホス
ト制御装置21と接続するようにしても良い。
Referring to FIG. 1, the host control device 21 includes a communication controller 22, an arithmetic control unit 23, and a program memory 24. The host controller 21 is connected to a plurality of motor controllers 26 via a serial communication bus (SCB) 25. Although only two motor control devices 26 are shown in FIG.
A plurality of motor controllers 26 may be connected to the host controller 21 via the SCB 25.

【0020】各モータ制御装置26は、通信コントロー
ラ27と、中央処理装置たるCPU28と、タイマ29
と、メモリ30と、励磁信号発生部31と、駆動部32
とを有して内部バスにより接続されて構成される。上記
通信コントローラ27は、ホスト制御装置21からの受
信信号をCPU28が判別できるデータ形式に変換した
り、CPU28がホスト制御装置21や他のモータ制御
装置26へ送信したいデータをSCB25上で扱えるデ
ータ形式に変換する他、ホスト制御装置21からの信号
を受信するとCPU28へ割込みを発生させたり、CP
U28が送信したいデータをSCB25上で他のデータ
と衝突しないように送信するものである。
Each motor control unit 26 includes a communication controller 27, a CPU 28 as a central processing unit, and a timer 29.
, A memory 30, an excitation signal generator 31, and a driver 32
And are connected by an internal bus. The communication controller 27 converts a received signal from the host control device 21 into a data format that can be determined by the CPU 28, and a data format that the CPU 28 can use on the SCB 25 to transmit data to be transmitted to the host control device 21 or another motor control device 26. In addition to the conversion into a CP, when receiving a signal from the host control device 21, an interrupt is generated to the CPU 28,
The U28 transmits the data to be transmitted so as not to collide with other data on the SCB 25.

【0021】タイマ29は、一定クロックを基準にカウ
ントし、カウント値が或る値と一致するとCPU28へ
割込みを発生させたり、CPU28から指令があるとカ
ウント値をクリアすることができる。メモリ30には、
CPU28の処理するソフトウェアプログラムやソフト
ウェアプログラム中の変数が格納されている他、各種モ
ータに応じた励磁信号のシーケンスが格納されている。
The timer 29 counts on the basis of a fixed clock, and can generate an interrupt to the CPU 28 when the count value matches a certain value, or can clear the count value when there is a command from the CPU 28. In the memory 30,
In addition to storing software programs to be processed by the CPU 28 and variables in the software programs, a sequence of excitation signals corresponding to various motors is stored.

【0022】上記励磁信号発生部31は、メモリ30に
格納されている励磁信号のシーケンスをCPU28に指
令されたタイミングで出力するためのものである。ま
た、駆動部32は、励磁信号発生部31の出力をモータ
33へ印加すべき電力まで増幅するためのものである。
The excitation signal generator 31 is for outputting the sequence of the excitation signal stored in the memory 30 at the timing instructed by the CPU 28. The drive unit 32 is for amplifying the output of the excitation signal generation unit 31 to the power to be applied to the motor 33.

【0023】次に、図2のフローチャートを参照して、
この発明の第1の実施の形態の動作について説明する。
図2は、第1の実施の形態に於けるモータ制御装置26
内のCPU28が処理するソフトウェアプログラムの動
作を説明するフローチャートの一例である。
Next, referring to the flowchart of FIG.
The operation of the first embodiment of the present invention will be described.
FIG. 2 shows a motor control device 26 according to the first embodiment.
3 is an example of a flowchart for explaining the operation of a software program processed by a CPU 28 in the inside.

【0024】尚、ホスト制御装置21からの各種命令に
対するCPU28の処理するソフトウェアプログラム
は、ここでは省略する。モータ33に対する位置決め命
令時には、以下のように動作する。
The software programs processed by the CPU 28 in response to various commands from the host controller 21 are omitted here. When a positioning command is issued to the motor 33, the operation is performed as follows.

【0025】先ず、ホスト制御装置21やモータ制御装
置26、モータ33等に電源が投入されると、ステップ
S1にて、CPU28により各種初期設定の動作が行わ
れる。この動作は、例えば、SCB25、通信コントロ
ーラ27、タイマ29、メモリ30、励磁信号発生部3
1等の設定や初期化が行われる。
First, when the power is turned on to the host control device 21, the motor control device 26, the motor 33, and the like, various initial setting operations are performed by the CPU 28 in step S1. This operation is performed by, for example, the SCB 25, the communication controller 27, the timer 29, the memory 30, the excitation signal generation unit 3
Settings such as 1 and initialization are performed.

【0026】次いで、ステップS2に於いて、各種エラ
ーが発生しているか否かが判定される。ここでは、駆動
部32のオーバーヒート、オーバーロードや通信コント
ローラ27のパリティエラー等の各種エラーが発生して
いるか否かが判定される。各種エラーが発生していれば
ステップS3へ移行し、発生していなければステップS
4へ移行する。
Next, in step S2, it is determined whether various errors have occurred. Here, it is determined whether various errors such as overheating and overload of the drive unit 32 and a parity error of the communication controller 27 have occurred. If various errors have occurred, the process proceeds to step S3, and if not, the process proceeds to step S3.
Move to 4.

【0027】ステップS3では、駆動部32にてモータ
33によって停止されて、エラー発生フラグが立てられ
る。そして、通信コントローラ27へエラー発生フラ
グ、エラーコード等のデータが出力される。その後、上
記ステップS2に戻る。アクティブになったエラー発生
フラグは、通信コントローラ27を介してホスト制御装
置21へ送信され、モータ制御装置26でエラーが発生
したことがホスト制御装置21に伝えられる。
In step S3, the drive unit 32 stops the motor 33, and sets an error occurrence flag. Then, data such as an error occurrence flag and an error code are output to the communication controller 27. Thereafter, the process returns to step S2. The activated error occurrence flag is transmitted to the host control device 21 via the communication controller 27 to inform the host control device 21 that an error has occurred in the motor control device 26.

【0028】一方、各種エラーが発生していない場合
は、ステップS4に移行して受信時に送られてくるホス
ト制御装置21からモータ制御装置26に対しての各種
コマンドの有無、すなわち各種コマンドを受信している
か否かが判定される。
On the other hand, if no various errors have occurred, the flow proceeds to step S4 to receive various commands from the host control device 21 transmitted to the motor control device 26 at the time of reception, that is, to receive various commands. It is determined whether or not it is.

【0029】ステップS4に於いて、コマンドが発生し
ていない、すなわちコマンドが受信されていなければ上
記ステップS2に戻る。一方、コマンドがあれば、ステ
ップS5に移行してコマンドの種類を判別して、どのよ
うな命令かが認識される。そして、ステップS6では、
認識された命令に応じて処理が行われる。この後、上記
ステップS2に戻る。
In step S4, if no command has been generated, that is, if no command has been received, the process returns to step S2. On the other hand, if there is a command, the process proceeds to step S5, the type of command is determined, and what kind of command is recognized. Then, in step S6,
Processing is performed according to the recognized command. Thereafter, the process returns to step S2.

【0030】また、ステップS8は通信コントローラ2
7により発生する通信関連の割込み動作であり、ステッ
プS9はタイマ29により発生するモータ駆動関連の割
込み動作である。これらステップS8及びS9の動作
は、上述したステップS2、S3、S4、S5、S6の
動作よりも優先する。以下、これらの割込み動作につい
て説明する。
In step S8, the communication controller 2
Step S9 is a motor drive related interrupt operation generated by the timer 29. The operations in steps S8 and S9 have priority over the operations in steps S2, S3, S4, S5, and S6 described above. Hereinafter, these interrupt operations will be described.

【0031】ステップS1が終了してからステップS
2、S3、S4、S5、S6の無限ループの間で注目し
ている位置決め命令時には、位置指令コマンドと共に位
置指令値がシリアルデータとしてホスト制御装置21か
らSCB25を介してモータ制御装置26へ送信され
る。位置指令コマンド、位置指令値は、シリアルデータ
として通信コントローラ27へ入力されると、CPU2
8が認識可能な適当なデータ幅のデータへ変換される。
すると、通信コントローラ27では、CPU28に対し
て通信関連動作が行われるべく受信割込みがかけられ
る。これがステップS8の動作である。
After step S1 is completed, step S
At the time of the positioning command that is focused on during the infinite loop of 2, S3, S4, S5, and S6, the position command value is transmitted as serial data from the host control device 21 to the motor control device 26 via the SCB 25 together with the position command command. You. When the position command command and the position command value are input to the communication controller 27 as serial data, the CPU 2
8 is converted into data of an appropriate data width that can be recognized.
Then, in the communication controller 27, a reception interrupt is issued to the CPU 28 so that a communication-related operation is performed. This is the operation of step S8.

【0032】このステップS8の動作は、上述したステ
ップS2、S3、S4、S5、S6及び後述するステッ
プS9よりも優先する動作であり、図示されないエラー
発生フラグの確認を含む状態監視命令、モータ制御命令
等が優先した動作として実行される。
The operation of step S8 is an operation which has a higher priority than the above-described steps S2, S3, S4, S5, S6 and step S9 which will be described later. An instruction or the like is executed as a priority operation.

【0033】同様に、ステップS9は、タイマ29等に
より発生するモータ駆動関連動作の割込みとして入るも
のであり、上述したステップS2、S3、S4、S5及
びS6よりも優先する動作である。
Similarly, step S9 is inserted as an interrupt of the motor drive-related operation generated by the timer 29 and the like, and is an operation having priority over steps S2, S3, S4, S5, and S6 described above.

【0034】モータ制御装置26にて、SCB25を介
して位置指令コマンドが受信されると、CPU28では
受信された位置指令値と予め設定された起動速度、移動
速度、加減速時間に応じた励磁信号の出力タイミングが
演算される(ステップS6参照)。具体的には、受信さ
れた位置指令値と、予め設定された起動速度、移動速
度、加減速時間より、1パルス目から2パルス目までの
時間が演算され、2パルス目の出力タイミング値がタイ
マ29にセットされる。セットされた出力タイミング値
は一定クロックによるカウント値と比較され、一致する
とCPU28へタイマ割込みが発生される(ステップS
9参照)。
When the motor control device 26 receives a position command command via the SCB 25, the CPU 28 causes the received position command value and an excitation signal corresponding to a preset starting speed, moving speed, and acceleration / deceleration time. Is calculated (see step S6). Specifically, the time from the first pulse to the second pulse is calculated from the received position command value and the preset starting speed, moving speed, and acceleration / deceleration time, and the output timing value of the second pulse is calculated. The timer 29 is set. The set output timing value is compared with a count value by a constant clock, and when they match, a timer interrupt is generated to the CPU 28 (step S).
9).

【0035】タイマ割込みが入ると、CPU28では、
タイマ割込み回数がカウントされると共に、励磁信号発
生部31へ励磁信号の変化が伝えられる。励磁信号発生
部31では、出力がモータ33の構造に応じた励磁信号
に変化される。例えば、モータ33が2相ステッピング
モータであれば、所望の励磁方式による2系統の信号が
タイミング毎に変化される。また、モータ33が3相A
Cモータであれば、120°ずつ位相のずれた3系統の
sin波信号がタイミング毎に変化される。これらの励
磁信号のシーケンスはメモリ30に格納されており、モ
ータ33の種類に応じて適切なシーケンスが、CPU2
8により選択可能である。
When a timer interrupt occurs, the CPU 28
The number of timer interrupts is counted, and a change in the excitation signal is transmitted to the excitation signal generator 31. In the excitation signal generator 31, the output is changed to an excitation signal according to the structure of the motor 33. For example, when the motor 33 is a two-phase stepping motor, two signals of a desired excitation method are changed at each timing. Also, if the motor 33 has three phases A
In the case of a C motor, three sine wave signals having phases shifted by 120 ° are changed at each timing. The sequence of these excitation signals is stored in the memory 30, and an appropriate sequence according to the type of the motor 33 is determined by the CPU 2.
8 can be selected.

【0036】ここでは、モータ33は検出器を有しない
モータとして示したが、この発明に於いて、モータの種
類は問わない。励磁信号発生部31から励磁信号が出力
されると、駆動部32により電力が増幅されてモータ3
3に印加される。
Here, the motor 33 is shown as a motor having no detector, but in the present invention, the type of the motor is not limited. When the excitation signal is output from the excitation signal generation unit 31, the power is amplified by the drive unit 32 and the motor 3
3 is applied.

【0037】このようにして、1パルス目から2パルス
目までモータ速度が制御された励磁信号がモータ33へ
印加できる。2パルス目の出力タイミングにより発生さ
れたタイマ割込みがCPU28へ入ると、タイマ割込み
回数がカウントされると共に、励磁信号発生部31へ励
磁信号の変化が伝えられる。その後、タイマ割込み回数
のカウント値がホスト制御装置21の指定してきた位置
指令値に達していないことが確認されて、2パルス目か
ら3パルス目までの時間が演算され、3パルス目の出力
タイミング値がタイマ29にセットされる。そして、上
述した動作と同様にして、セットされた出力タイミング
値が一定クロックによるカウント値と比較される。ここ
で、一致するとCPU28へタイマ割込みが発生される
(ステップS9参照)。
Thus, the excitation signal whose motor speed is controlled from the first pulse to the second pulse can be applied to the motor 33. When a timer interrupt generated at the output timing of the second pulse enters the CPU 28, the number of timer interrupts is counted, and a change in the excitation signal is transmitted to the excitation signal generator 31. Thereafter, it is confirmed that the count value of the timer interrupt count has not reached the position command value designated by the host control device 21, the time from the second pulse to the third pulse is calculated, and the output timing of the third pulse is calculated. The value is set in the timer 29. Then, in the same manner as the above-described operation, the set output timing value is compared with a count value by a constant clock. Here, if they match, a timer interrupt is generated to the CPU 28 (see step S9).

【0038】CPU28では、タイマ割込み回数がカウ
ントされると共に、励磁信号発生部31に励磁信号の変
化が伝えらる。励磁信号発生部31では、出力がモータ
33の構造に応じた励磁信号に変化されて、駆動部32
により電力が増幅されて、モータ33に印加される。
The CPU 28 counts the number of timer interrupts and notifies the excitation signal generator 31 of a change in the excitation signal. In the excitation signal generator 31, the output is changed to an excitation signal corresponding to the structure of the motor 33,
The power is amplified and applied to the motor 33.

【0039】このようにして、2パルス目から3パルス
目までモータ速度が制御された励磁信号がモータ33へ
印加できる。同様にして、位置指令値と起動速度、移動
速度、加減速時間に応じた励磁信号の出力タイミングを
演算する動作から、タイマ割込みのタイミングに則って
励磁信号の変化を励磁信号発生部31へ伝える動作まで
の、一連のCPU28の動作は、励磁信号の変化回数、
すなわち出力パルスに等しいタイマ割込み回数がホスト
制御装置21の指定してきた位置指令値に達するまで繰
返される。
In this manner, the excitation signal whose motor speed is controlled from the second pulse to the third pulse can be applied to the motor 33. Similarly, from the operation of calculating the output timing of the excitation signal according to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time, the change of the excitation signal is transmitted to the excitation signal generating unit 31 in accordance with the timer interrupt timing. Up to the operation, the series of operations of the CPU 28 includes the number of changes in the excitation signal,
That is, it is repeated until the number of timer interrupts equal to the output pulse reaches the position command value designated by the host control device 21.

【0040】このことは、CPU28がタイマ割込み回
数をカウントする動作により判別される。位置指令値に
達した場合には、出力タイミング値やタイマ割込み回数
等の値をクリアして一連の動作を終了する。これによ
り、ホスト制御装置21からモータ制御装置26への位
置決め命令コマンドに対する処理が終了する。このと
き、出力パルスに等しいタイマ割込み回数が位置指令値
に一致する動作を行うことで、モータ位置が制御された
励磁信号をモータ33へ印加できる。
This is determined by the operation of the CPU 28 counting the number of timer interrupts. When the position command value has been reached, the output timing value, the timer interrupt count, and other values are cleared, and a series of operations ends. Thus, the processing for the positioning command from the host control device 21 to the motor control device 26 is completed. At this time, by performing an operation in which the number of timer interrupts equal to the output pulse matches the position command value, an excitation signal whose motor position is controlled can be applied to the motor 33.

【0041】このようにして、励磁変化の時間をタイマ
割込みのタイミングにて制御して所望の速度制御を行う
と共に、一連の処理を位置指令値だけ繰返すことで所望
の位置制御を行うことができるので、モータ33は位置
指令値、起動速度、移動速度、加減速時間に沿った回転
が可能となる。
In this way, the desired speed control can be performed by controlling the time of the excitation change at the timing of the timer interrupt, and the desired position control can be performed by repeating a series of processes by the position command value. Therefore, the motor 33 can rotate according to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time.

【0042】次に、この発明の第2の実施の形態を説明
する。図3は、この発明の第2の実施の形態に係るモー
タ制御装置の構成を示すブロック図である。
Next, a second embodiment of the present invention will be described. FIG. 3 is a block diagram illustrating a configuration of a motor control device according to a second embodiment of the present invention.

【0043】図3に於いて、ホスト制御装置21は、通
信コントローラ22と、演算制御部23と、プログラム
メモリ24とを備えている。このホスト制御装置21に
は、SCB25を介して複数種類のモータ制御装置26
a、26bが接続されている。
Referring to FIG. 3, the host control device 21 includes a communication controller 22, an arithmetic control unit 23, and a program memory 24. The host controller 21 has a plurality of types of motor controllers 26 via the SCB 25.
a and 26b are connected.

【0044】モータ制御装置26aは、通信コントロー
ラ27と、モータコントローラ28と、モータ33aを
駆動するためのモータドライバ36aを有して構成され
る。同様に、モータ制御装置26bは、通信コントロー
ラ27と、モータコントローラ28と、モータ33bを
駆動するためのモータドライバ36bを有して、内部バ
スにより接続されて構成される。
The motor controller 26a includes a communication controller 27, a motor controller 28, and a motor driver 36a for driving a motor 33a. Similarly, the motor control device 26b includes a communication controller 27, a motor controller 28, and a motor driver 36b for driving the motor 33b, and is connected to an internal bus.

【0045】ここでは、一例として、モータドライバ2
6aは検出器37の信号をフィードバック信号として、
モータ36aを駆動するためのドライバとし、モータド
ライバ26bは、検出器37を用いずにモータ33bを
駆動するドライバとしている。ここでは、モータドライ
バ36aを有するモータ制御装置を26a、モータドラ
イバ36bを有するモータ制御装置を26bとする。
Here, as an example, the motor driver 2
6a uses the signal of the detector 37 as a feedback signal,
The motor driver 26b is a driver for driving the motor 33a, and the motor driver 26b is a driver for driving the motor 33b without using the detector 37. Here, the motor control device having the motor driver 36a is referred to as 26a, and the motor control device including the motor driver 36b is referred to as 26b.

【0046】同様に、モータの一例として、モータ33
aは検出器37を有するモータ、モータ33bは検出器
37を有しないモータとしている。図4は、図3のモー
タ制御装置26aの詳細な構成の一例を示すブロック図
である。
Similarly, as an example of the motor, the motor 33
a is a motor having the detector 37, and a motor 33b is a motor having no detector 37. FIG. 4 is a block diagram showing an example of a detailed configuration of the motor control device 26a of FIG.

【0047】図4に於いて、通信コントローラ27は、
アドレス設定用DIP−SW40と、シリアルバスイン
ターフェイス41と、シリアル通信ユニット42とによ
り構成されている。また、モータコントローラ35は、
CPU28と、タイマ29と、I/O43と、RAM4
4及びROM45とにより構成される。更に、モータド
ライバ36aは、励磁信号発生部31と、駆動部32
と、検出信号処理部46とにより構成されている。
In FIG. 4, the communication controller 27
It comprises a DIP-SW 40 for address setting, a serial bus interface 41, and a serial communication unit 42. In addition, the motor controller 35
CPU 28, timer 29, I / O 43, RAM 4
4 and the ROM 45. Further, the motor driver 36a includes an excitation signal generating unit 31 and a driving unit 32.
And a detection signal processing unit 46.

【0048】ここで、通信の形態としては、ホスト制御
装置21側の通信コントローラ22が主局になり、各モ
ータ制御装置26a、26b側の通信コントローラ27
が従局となる。結合は、主局が1個で従局がn個の1:
nの結合である。尚、上記ROM45には、励磁シーケ
ンスが格納されている。
Here, as a form of communication, the communication controller 22 of the host control device 21 becomes the main station, and the communication controller 27 of each of the motor control devices 26a and 26b.
Becomes a slave. The connection is made up of one master station and n slave stations.
n. The ROM 45 stores an excitation sequence.

【0049】ホスト制御装置21と各モータ制御装置2
6a、26bとの間のデータ交換という観点に立てば、
通信コントローラ22と通信コントローラ27は、単に
ホスト制御装置21側の演算制御部23と各モータ制御
装置26a、26b側のモータコントローラ35との仲
介をしているにすぎず、演算制御部23とモータコント
ローラ35とは直接に結合されているかの如くふるまえ
るのである。更に、ホスト制御装置21の演算制御部2
3、或いは各モータ制御装置26a、26bのモータコ
ントローラ35が繁雑な通信制御に直接関わることな
く、本来のプログラム実行或いはモータ制御に専念する
ことができる。
The host controller 21 and each motor controller 2
From the viewpoint of data exchange between 6a and 26b,
The communication controller 22 and the communication controller 27 merely mediate between the arithmetic control unit 23 of the host control device 21 and the motor controller 35 of each of the motor control devices 26a and 26b. It behaves as if it were directly coupled to the controller 35. Further, the arithmetic control unit 2 of the host control device 21
3, or the motor controller 35 of each motor control device 26a, 26b can concentrate on the original program execution or motor control without directly involved in complicated communication control.

【0050】以下、多数軸のモータ制御の順序について
説明する。先ず、ホスト制御装置21からは、指定され
たモータ制御装置26a、26bに対し運転モードが指
令される。モータ制御装置26a、26bでは、これに
対して準備が整えられてモード指令の応答がホスト制御
装置21へ返される。ホスト制御装置21では、モード
指令の正常な応答が認識されたならば位置指令値と共に
運転起動信号がアクティブにされる。
Hereinafter, a description will be given of the order of motor control for multiple axes. First, an operation mode is instructed from the host control device 21 to the designated motor control devices 26a and 26b. The motor controllers 26a and 26b are ready for this and return a mode command response to the host controller 21. In the host control device 21, when a normal response to the mode command is recognized, the operation start signal is activated together with the position command value.

【0051】モータ制御装置26a、26bでは、各デ
ータに基いて位置決め制御が実行され、終了したならば
分配完了信号がアクティブにされてホスト制御装置21
へ返される。ホスト制御装置21では、完了が認識され
て運転起動信号がノンアクティブにされる。その後、モ
ータ制御装置26a、26bでは、分配完了信号がノン
アクティブにされる。
In the motor controllers 26a and 26b, the positioning control is executed based on each data, and when the positioning is completed, the distribution completion signal is activated and the host controller 21
Returned to In the host control device 21, the completion is recognized, and the operation start signal is made inactive. Thereafter, in the motor control devices 26a and 26b, the distribution completion signal is made non-active.

【0052】運転モードを変更する場合も、同様な手順
で行われる。以上が、第2の実施の形態に於けるシリア
ル通信を介した分散制御システムの動作であり、多数軸
の位置決め制御装置を含む制御システム全体が完成した
後の通常運転時の動作である。
When changing the operation mode, the same procedure is performed. The above is the operation of the distributed control system via serial communication in the second embodiment, and the operation during normal operation after the entire control system including the multi-axis positioning control device is completed.

【0053】ここで、モータ33aに対する位置決め命
令に注目して、CPU28の処理動作を説明する。図5
は、第2の実施の形態に於けるCPU28が処理するソ
フトウェアプログラムのフローチャートの一例である。
尚、ホスト制御装置21からの各種命令に対するCPU
28の処理するソフトウェアプログラムは、ここでは省
略する。
Here, the processing operation of the CPU 28 will be described focusing on the positioning command for the motor 33a. FIG.
9 is an example of a flowchart of a software program processed by the CPU 28 according to the second embodiment.
The CPU for various commands from the host control device 21
The software program to be processed at 28 is omitted here.

【0054】先ず、ホスト制御装置21やモータ制御装
置26a、モータ33a、検出器37等に電源が投入さ
れると、ステップS11にて、CPU28により、バ
ス、I/O43、タイマ29、RAM44、励磁信号発
生部31、検出信号処理部46、シリアル通信ユニット
42等の設定や初期化が行われる。
First, when the host controller 21, the motor controller 26a, the motor 33a, the detector 37, and the like are turned on, the CPU 28 controls the bus, the I / O 43, the timer 29, the RAM 44, and the excitation in step S11. The settings and initialization of the signal generator 31, the detection signal processor 46, the serial communication unit 42, and the like are performed.

【0055】その後、ステップS12に於いて、モータ
ドライバ36aのオーバーヒート・オーバーロードや通
信コントローラ27のパリティエラー等の各種エラーが
発生しているかが判定される。ここで、各種エラーが発
生していなければステップS12に戻る。各種エラーが
発生していれば、ステップS13に移行する。
Thereafter, in step S12, it is determined whether various errors such as overheating and overload of the motor driver 36a and a parity error of the communication controller 27 have occurred. Here, if various errors have not occurred, the process returns to step S12. If various errors have occurred, the process proceeds to step S13.

【0056】ステップS13では、モータドライバ36
aによってモータ33aが停止されて、エラー発生をホ
スト制御装置21へ伝えるためのエラー発生フラグが立
てられてる。その後、上記ステップS12に戻る。
In step S13, the motor driver 36
The motor 33a is stopped by a, and an error occurrence flag for transmitting an error occurrence to the host control device 21 is set. Then, the process returns to step S12.

【0057】ステップS15は、図示されないエラー発
生フラグの確認を含む状態監視命令、モータ制御命令等
が優先した動作として実行される。このステップS15
は、通信コントローラ27やタイマ29等により発生す
る通信関連の割込み動作であり、ステップS12、S1
3及び後述するステップS16よりも優先される動作で
ある。
Step S15 is executed as an operation in which a state monitoring command including confirmation of an error occurrence flag (not shown), a motor control command, and the like are given priority. This step S15
Is a communication-related interrupt operation generated by the communication controller 27, the timer 29, and the like.
3 and an operation which is prioritized over step S16 described later.

【0058】すなわち、上記ステップS11が終了して
からステップS12、S13の無限ループの間で、注目
している位置決め命令時には、位置指令コマンドと共に
位置指令値がシリアルデータとしてホスト制御装置21
からSCB25を介してモータ制御装置26aへ送信さ
れる。位置指令コマンド、位置指令値は、シリアルデー
タとしてシリアルバスインターフェイス41へ入力され
ると、シリアルデータのままシリアル通信ユニット42
へ入力され、CPU28が認識可能な適当なデータ幅の
データへ変換される。すると、シリアル通信ユニット4
2からは、CPU28に対して、通信関連動作を行うべ
く割込みがかけられる(ステップS15参照)。
In other words, during the endless loop of steps S12 and S13 after the end of step S11, when the focused positioning command is being watched, the position command value together with the position command command is converted into serial data by the host controller 21.
To the motor control device 26a via the SCB 25. When the position command and the position command are input to the serial bus interface 41 as serial data, the serial communication unit 42
And converted into data having an appropriate data width that the CPU 28 can recognize. Then, the serial communication unit 4
From 2, the CPU 28 is interrupted to perform a communication-related operation (see step S15).

【0059】また、ステップS16は、タイマ29等に
より発生するモータ駆動関連の割込み動作であり、上述
したステップS12、S13よりも優先される動作であ
る。モータ制御装置26aにて、通信を介して位置指令
コマンドが受信されると、CPU28では受信された位
置指令値と予め設定された起動速度、移動速度、加減速
時間に応じた励磁信号の出力タイミングが演算される。
励磁信号を変化させる出力タイミングはタイマ29によ
り生成されるもので、所望の時間が経過すると、CPU
28からは励磁信号発生部31へ励磁信号の変化が伝え
られる。この出力タイミングを演算し、励磁信号の変化
を伝える動作は、ステップS16のモータ駆動関連動作
として割込みで動作するが、割込み処理時間が軽減する
ように、一部の動作を、適宜ステップS12、S13の
無限ループの動作へ移行しても良い。
Step S16 is an interrupt operation related to motor drive generated by the timer 29 and the like, and has higher priority than the above-described steps S12 and S13. When the motor control device 26a receives a position command command via communication, the CPU 28 outputs the received position command value and the output timing of the excitation signal according to the preset starting speed, moving speed, and acceleration / deceleration time. Is calculated.
The output timing for changing the excitation signal is generated by the timer 29.
The change in the excitation signal is transmitted from 28 to the excitation signal generator 31. The operation of calculating the output timing and transmitting the change in the excitation signal is performed by an interrupt as a motor drive-related operation in step S16, but some operations are appropriately performed in steps S12 and S13 so as to reduce the interrupt processing time. May move to an infinite loop operation.

【0060】CPU28から励磁信号発生部31へ励磁
信号の変化が伝えられると、励磁信号発生部31では、
出力がモータ33aの構造に応じた励磁信号に変化され
る。励磁信号発生部31から励磁信号が出力されると、
駆動部32により電力が増幅されてモータ33aに印加
される。これにより、モータ33aは、位置指令値、起
動速度、移動速度、加減速時間に沿った回転がなされ
る。
When a change in the excitation signal is transmitted from the CPU 28 to the excitation signal generator 31, the excitation signal generator 31
The output is changed to an excitation signal according to the structure of the motor 33a. When the excitation signal is output from the excitation signal generator 31,
The power is amplified by the drive unit 32 and applied to the motor 33a. Thus, the motor 33a rotates according to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time.

【0061】図4に示されるように、モータ33aに検
出器37が取付けられている場合には、検出器37に於
いてモータ33aの回転状態が検出され、検出信号処理
部46にて検出状態がCPU28が解読できるデータ形
式に変換される。この検出状態はフィードバック制御等
に利用され、タイマ29による励磁信号の出力タイミン
グや駆動部32による電力増幅量が補正されるが、その
方法に関しては本発明では問わないものとする。
As shown in FIG. 4, when the detector 37 is attached to the motor 33a, the rotation state of the motor 33a is detected by the detector 37, and the detection state is detected by the detection signal processing unit 46. Is converted into a data format that the CPU 28 can decode. This detection state is used for feedback control and the like, and the output timing of the excitation signal by the timer 29 and the power amplification amount by the drive unit 32 are corrected. However, the method is not limited to the present invention.

【0062】以上のように、モータ制御装置26a、2
6b内にCPU28、タイマ29、励磁シーケンスを格
納したROM45を有することで、励磁シーケンスを変
化させるタイミングと励磁シーケンスを変化させる回数
を制御し、所望の速度、位置に応じた励磁信号を生成で
き、指令パルスを生成することなく励磁信号を生成する
ことができる。更に、CPU28、ROM45にて励磁
信号発生部31を形成していることから、回路規模をよ
り小さく簡単に構成することができる。
As described above, the motor control devices 26a,
By having the CPU 28, the timer 29, and the ROM 45 storing the excitation sequence in 6b, it is possible to control the timing of changing the excitation sequence and the number of times the excitation sequence is changed, and generate an excitation signal corresponding to a desired speed and position. An excitation signal can be generated without generating a command pulse. Further, since the excitation signal generating section 31 is formed by the CPU 28 and the ROM 45, the circuit scale can be made smaller and simple.

【0063】次に、この発明の第3の実施の形態とし
て、5相ステッピングモータを指令パルスを生成せずに
制御する例について、図6及び図7を参照して説明す
る。図6は、第3の実施の形態に於けるモータ制御装置
の構成を示すブロック図である。尚、この第3の実施の
形態に於いて、上述した第1及び第2の実施の形態と同
一の部分には同一の参照番号を付してその説明は省略す
る。
Next, as a third embodiment of the present invention, an example of controlling a five-phase stepping motor without generating a command pulse will be described with reference to FIGS. FIG. 6 is a block diagram illustrating a configuration of a motor control device according to the third embodiment. In the third embodiment, the same parts as those in the above-described first and second embodiments are denoted by the same reference numerals, and description thereof is omitted.

【0064】図6に於いて、モータ制御装置26は、ア
ドレス設定DIP−SW40と、シリアルバスインター
フェイス41と、シリアル通信ユニット42と、I/O
43と、CPU28と、タイマ29と、RAM44と、
ROM45及び定電流回路48とを有して構成されてい
る。また、シリアル通信ユニット42、I/O43、C
PU28、タイマ29、RAM44、ROM45は、内
部バスで接続されている。尚、49は5相ステッピング
モータである。
In FIG. 6, the motor control device 26 includes an address setting DIP-SW 40, a serial bus interface 41, a serial communication unit 42, an I / O
43, a CPU 28, a timer 29, a RAM 44,
It has a ROM 45 and a constant current circuit 48. Also, the serial communication unit 42, the I / O 43, and the C
The PU 28, timer 29, RAM 44, and ROM 45 are connected by an internal bus. Incidentally, 49 is a five-phase stepping motor.

【0065】ROM45は、CPU28が動作するソフ
トウェアプログラムが格納されている他、5相ステッピ
ングモータ49への5系統の励磁信号状態とその状態が
変化する順番である励磁シーケンスが格納されている。
また、定電流回路48は、図示されない電流検出部、電
流補償部、スイッチング部等から成っている。
The ROM 45 stores a software program for operating the CPU 28, and also stores the state of excitation signals of five systems to the five-phase stepping motor 49 and an excitation sequence in which the states change.
The constant current circuit 48 includes a current detector, a current compensator, and a switching unit (not shown).

【0066】図7は、第3の実施の形態に於けるCPU
28が処理するソフトウェアプログラムのフローチャー
トの一例である。尚、ホスト制御装置21からの各種命
令に対するCPU28の処理するソフトウェアプログラ
ムは、ここでは説明を省略する。
FIG. 7 shows a CPU according to the third embodiment.
28 is an example of a flowchart of a software program to be processed. The description of the software programs processed by the CPU 28 in response to various commands from the host control device 21 is omitted here.

【0067】先ず、モータ制御装置26や5相ステッピ
ングモータ49等に電源が投入されると、ステップS2
1にて、CPU28により内部バス、I/O43、タイ
マ29、RAM44、シリアル通信ユニット42等の設
定や初期化が行われ、シリアル通信ユニット42等の周
辺割込みが許可状態にされる。
First, when power is turned on to the motor control device 26, the five-phase stepping motor 49, and the like, step S2
At 1, the CPU 28 sets and initializes the internal bus, the I / O 43, the timer 29, the RAM 44, the serial communication unit 42, and the like, and enables the peripheral interrupts of the serial communication unit 42 and the like.

【0068】次いで、ステップS22に於いて、各種エ
ラーが発生しているか否かが判定される。ここで、エラ
ーが発生していなければステップS22にに戻る。ま
た、エラーが発生していれば、ステップS23に移行し
てモータ49が停止されてエラーフラグが立てられる。
その後、上記ステップS22に戻る。
Next, in step S22, it is determined whether various errors have occurred. If no error has occurred, the process returns to step S22. If an error has occurred, the process proceeds to step S23, where the motor 49 is stopped and an error flag is set.
Thereafter, the process returns to step S22.

【0069】ステップS25は、上記ステップS21が
終了した後のステップS22、S23の無限ループの間
に、シリアル通信ユニット42等により発生される通信
関連動作が割込みとして入るものである。このステップ
S25は、上記ステップS22、S23及び後述するス
テップS26よりも優先する動作であり、図示されない
状態監視命令、モータ制御命令等が優先された動作とし
て実行される。また、エラーフラグのチェックも行わ
れ、エラーフラグが立っていれば、ホスト制御装置21
へシリアル通信を介してモータ制御装置26の分散制御
システム内でのアドレスとエラー内容が送信される。
In step S25, during the infinite loop of steps S22 and S23 after the end of step S21, a communication-related operation generated by the serial communication unit 42 or the like enters as an interrupt. This step S25 is an operation having a higher priority than the above-mentioned steps S22 and S23 and a step S26 to be described later, and a state monitoring command, a motor control command and the like (not shown) are executed as prioritized operations. An error flag is also checked. If the error flag is set, the host control device 21
Then, the address and the content of the error in the distributed control system of the motor control device 26 are transmitted via serial communication.

【0070】更に、上記ステップS22、S23の無限
ループの間には、上述したステップS25の動作の他
に、ステップS26として、タイマ29により発生する
モータ駆動関連動作が割込みとして入る。このステップ
S26は、ステップS22、S23よりも優先する動作
であり、シリアル通信ユニット42にて図示されないモ
ータ制御命令が受信されると、指定された位置指令値ま
でのCPU28の処理が終了するまでタイマ29が割込
み許可状態にされる。
Further, during the infinite loop of steps S22 and S23, in addition to the operation of step S25 described above, a motor drive related operation generated by the timer 29 is interrupted as step S26. This step S26 is an operation that takes precedence over steps S22 and S23. When the serial communication unit 42 receives a motor control command (not shown), a timer is executed until the processing of the CPU 28 up to the designated position command value ends. 29 is set to the interrupt enabled state.

【0071】許可状態の割込みで、CPU28では、先
ず位置指令値、起動速度、移動速度、加減速時間に応じ
た励磁信号の出力タイミングが演算される。すなわち、
許可状態になってからのステップS26の割込み回数が
カウントされる。そして、位置指令値のうちで、今回の
割込みが何回目かにより、所望の起動速度、移動速度、
加減速時間に合わせて次回の割込みに入る時間が決定さ
れる。
In the interruption of the permission state, the CPU 28 first calculates the output timing of the excitation signal according to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time. That is,
The number of interrupts in step S26 after the permission state is counted. Then, depending on how many times this interrupt is performed among the position command values, a desired starting speed, moving speed,
The time to enter the next interrupt is determined according to the acceleration / deceleration time.

【0072】次に、次回割込み時間に応じたタイマ29
の設定にされ、次回割込みの設定がなされる。そして、
許可状態になってからのステップS26の割込み回数に
合わせて、ROM45に格納されている励磁シーケンス
が参照されて、参照された励磁信号状態がI/O43の
出力ポートから出力される。
Next, the timer 29 according to the next interruption time
Is set, and the next interrupt is set. And
The excitation sequence stored in the ROM 45 is referred to in accordance with the number of interruptions in step S26 after the permission state is reached, and the referenced excitation signal state is output from the output port of the I / O 43.

【0073】更に、許可状態になってからのステップS
26の割込み回数が位置指令値と一致するかどうかが判
定される。ここで、割込み回数が位置指令値と一致すれ
ば、タイマ29が割込み禁止状態にされる。モータ駆動
関連動作であるステップS26の割込みへ入る毎に、C
PU28では上述した動作が繰返される。これにより、
所望の励磁信号状態が位置指令値、起動速度、移動速
度、加減速時間に応じたパルス周波数として、I/O4
3の出力ポートから出力される。
Further, step S after the permission state is set.
It is determined whether or not the number of interruptions at 26 matches the position command value. Here, if the number of interrupts matches the position command value, the timer 29 is disabled. Each time an interrupt of step S26, which is a motor drive related operation, is entered, C
In the PU 28, the above-described operation is repeated. This allows
The desired excitation signal state is defined as a pulse frequency corresponding to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time, and I / O4
3 output port.

【0074】I/O43の出力ポートから励磁信号状態
が出力されると、定電流回路48により5系統共に定電
流化される。そして、5相ステッピングモータ49に印
加され、5相ステッピングモータ49が位置指令値、起
動速度、移動速度、加減速時間に沿った回転がなされ
る。
When the state of the excitation signal is output from the output port of the I / O 43, the five currents are made constant by the constant current circuit 48. Then, the voltage is applied to the five-phase stepping motor 49, and the five-phase stepping motor 49 is rotated according to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time.

【0075】以上のように、モータ制御装置26内にC
PU28、タイマ29、励磁シーケンスを格納したRO
M45を有することにより、指令パルスを生成すること
なく励磁信号を生成することができる。
As described above, C is stored in the motor control device 26.
PU28, timer 29, RO storing excitation sequence
By having M45, an excitation signal can be generated without generating a command pulse.

【0076】更に、CPU28、ROM45にて励磁信
号発生部を形成していることから、回路規模をより小さ
く簡単に構成することができる。尚、この発明の上記実
施態様によれば、以下の如き構成を得ることができる。
Further, since the excitation signal generating section is formed by the CPU 28 and the ROM 45, the circuit scale can be made smaller and simple. According to the above embodiment of the present invention, the following configuration can be obtained.

【0077】(1) ホスト制御装置と複数のモータ制
御装置とをシリアル通信を介して結合したモータ制御シ
ステムに適用可能なモータ制御装置であって、所定時間
を計時するタイマ手段と、このタイマ手段の信号に同期
して、制御対象モータの励磁信号を発生する励磁信号発
生手段と、上記ホスト制御装置から出力される第1命令
に応答して、上記タイマ手段の計時時間を設定すると共
に、上記タイマ手段設定動作と上記励磁信号発生手段の
制御動作とを上記ホスト制御装置から出力される第2命
令に応じた回数行う処理手段とを具備したことを特徴と
するモータ制御装置。
(1) A motor control device applicable to a motor control system in which a host control device and a plurality of motor control devices are connected via serial communication, wherein a timer means for measuring a predetermined time, and the timer means An excitation signal generating means for generating an excitation signal of the motor to be controlled in synchronization with the signal of the control means; and a timer for setting the time measured by the timer means in response to a first command output from the host control device. A motor control device comprising: a processing unit that performs a timer unit setting operation and a control operation of the excitation signal generation unit a number of times in accordance with a second command output from the host control unit.

【0078】(2) 上記ホスト制御装置から出力され
る第1命令、第2命令は、それぞれ速度指令、位置指令
であることを特徴とする上記(1)に記載のモータ制御
装置。
(2) The motor control device according to (1), wherein the first command and the second command output from the host control device are a speed command and a position command, respectively.

【0079】(3) 制御対象モータの種類に応じた複
数の励磁信号シーケンスを記憶したメモリ手段を更に具
備し、上記メモリ手段に記憶された複数の励磁信号シー
ケンスのうちの1つが、制御対象モータの種類に応じて
選択されることを特徴とする上記(1)に記載のモータ
制御装置。
(3) Further, there is provided a memory means for storing a plurality of excitation signal sequences corresponding to the type of the motor to be controlled, and one of the plurality of excitation signal sequences stored in the memory means is used for controlling the motor to be controlled. The motor control device according to the above (1), which is selected according to the type of the motor control device.

【0080】[0080]

【発明の効果】以上のようにこの発明によれば、励磁変
化の時間をタイマ割込みのタイミングにて制御して所望
の速度制御を行うと共に、一連の処理を位置指令値だけ
繰返すことで所望の位置制御を行うことができ、モータ
が位置指令値、起動速度、移動速度、加減速時間に沿っ
た回転をする。したがって、指令パルスを生成すること
なく励磁切替信号を生成することで、回路規模が小さ
く、装置が小さく安価で、且つ、製造が容易である分散
制御システムのモータ制御装置を提供することができ
る。
As described above, according to the present invention, the desired speed control is performed by controlling the time of the excitation change at the timing of the timer interrupt, and a series of processes are repeated by the position command value to thereby obtain the desired speed. Position control can be performed, and the motor rotates according to the position command value, the starting speed, the moving speed, and the acceleration / deceleration time. Therefore, by generating the excitation switching signal without generating the command pulse, it is possible to provide a motor control device of a distributed control system having a small circuit size, a small device, low cost, and easy manufacture.

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

【図1】この発明の第1の実施の形態に係るモータ制御
装置の構成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a motor control device according to a first embodiment of the present invention.

【図2】第1の実施の形態に於けるモータ制御装置26
内のCPU28が処理するソフトウェアプログラムの動
作を説明するフローチャートの一例である。
FIG. 2 is a motor control device 26 according to the first embodiment;
3 is an example of a flowchart for explaining the operation of a software program processed by a CPU 28 in the inside.

【図3】この発明の第2の実施の形態に係るモータ制御
装置の構成を示すブロック図である。
FIG. 3 is a block diagram showing a configuration of a motor control device according to a second embodiment of the present invention.

【図4】図3のモータ制御装置26aの詳細な構成の一
例を示すブロック図である。
FIG. 4 is a block diagram illustrating an example of a detailed configuration of a motor control device 26a of FIG.

【図5】第2の実施の形態に於けるCPU28が処理す
るソフトウェアプログラムのフローチャートの一例であ
る。
FIG. 5 is an example of a flowchart of a software program processed by a CPU 28 according to the second embodiment.

【図6】第3の実施の形態に於けるモータ制御装置の構
成を示すブロック図である。
FIG. 6 is a block diagram illustrating a configuration of a motor control device according to a third embodiment.

【図7】第3の実施の形態に於けるCPU28が処理す
るソフトウェアプログラムのフローチャートの一例であ
る。ートの一例である。
FIG. 7 is an example of a flowchart of a software program processed by a CPU 28 according to the third embodiment. It is an example of a chart.

【図8】従来のモータ制御装置の構成を示すブロック図
である。
FIG. 8 is a block diagram showing a configuration of a conventional motor control device.

【図9】従来のモータ制御装置における各ブロック間で
入出力される信号の波形図であり、(A)は低速にパル
スが発生されている場合の波形図、(B)は高速にパル
スが発せられている場合の波形図である。
9A and 9B are waveform diagrams of signals input and output between blocks in a conventional motor control device, wherein FIG. 9A is a waveform diagram when a pulse is generated at a low speed, and FIG. FIG. 7 is a waveform diagram in the case of being emitted.

【符号の説明】[Explanation of symbols]

21 ホスト制御装置、 22 通信コントローラ、 23 演算制御部、 24 プログラムメモリ、 25 シリアル通信バス(SCB)、 26、26a、26b モータ制御装置、 27 通信コントローラ、 28 CPU、 29 タイマ、 30 メモリ、 31 励磁信号発生部、 32 駆動部、 33、33a、33b モータ、 35 モータコントローラ、 36a、36b モータドライバ、 37 検出器、 40 アドレス設定DIP−SW、 41 シリアルバスインターフェイス、 42 シリアル通信ユニット、 43 入出力、 44 RAM、 45 ROM、 46 検出信号処理部。 Reference Signs List 21 host control device, 22 communication controller, 23 operation control unit, 24 program memory, 25 serial communication bus (SCB), 26, 26a, 26b motor control device, 27 communication controller, 28 CPU, 29 timer, 30 memory, 31 excitation Signal generator, 32 drive unit, 33, 33a, 33b motor, 35 motor controller, 36a, 36b motor driver, 37 detector, 40 address setting DIP-SW, 41 serial bus interface, 42 serial communication unit, 43 input / output, 44 RAM, 45 ROM, 46 detection signal processing unit.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 シリアル通信を介してホスト制御装置と
複数のモータ制御装置とを結合したモータ制御システム
に適用可能なモータ制御装置であって、 制御対象モータの種類に応じた複数の励磁信号シーケン
スに関するデータを記憶した記憶手段と、 制御対象モータの励磁信号を出力する励磁信号出力手段
と、 上記ホスト制御装置から出力される制御命令に応答し
て、上記記憶手段のデータを参照して上記励磁信号出力
手段を制御する処理手段と、 を具備することを特徴とするモータ制御装置。
1. A motor control device applicable to a motor control system in which a host control device and a plurality of motor control devices are connected via serial communication, wherein a plurality of excitation signal sequences corresponding to a type of a motor to be controlled are provided. Storage means for storing data relating to the motor to be controlled, excitation signal output means for outputting an excitation signal for the motor to be controlled, and in response to a control command output from the host control device, referring to the data in the storage means for the excitation. A motor control device comprising: a processing unit that controls a signal output unit.
【請求項2】 上記処理手段は、所定時間毎に割込み信
号を発生するタイマ割込み手段を有し、この割込みタイ
マの設定時間を上記ホスト制御装置からの命令に応じて
決定することを特徴とする請求項1に記載のモータ制御
装置。
2. The method according to claim 1, wherein the processing unit includes a timer interrupt unit that generates an interrupt signal at predetermined time intervals, and determines a set time of the interrupt timer according to a command from the host control device. The motor control device according to claim 1.
【請求項3】 上記制御対象モータは、多相ステッピン
グモータを含むことを特徴とする請求項1に記載のモー
タ制御装置。
3. The motor control device according to claim 1, wherein the control target motor includes a polyphase stepping motor.
JP24517198A 1998-08-31 1998-08-31 Motor controller Pending JP2000078891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24517198A JP2000078891A (en) 1998-08-31 1998-08-31 Motor controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24517198A JP2000078891A (en) 1998-08-31 1998-08-31 Motor controller

Publications (1)

Publication Number Publication Date
JP2000078891A true JP2000078891A (en) 2000-03-14

Family

ID=17129672

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24517198A Pending JP2000078891A (en) 1998-08-31 1998-08-31 Motor controller

Country Status (1)

Country Link
JP (1) JP2000078891A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008005664A (en) * 2006-06-26 2008-01-10 Fuji Mach Mfg Co Ltd Motor control system
CN102857166A (en) * 2012-08-03 2013-01-02 武汉理工大学 8-shaft coaction stepping motor control system based on serial communication
US8892932B2 (en) 2010-03-15 2014-11-18 Canon Kabushiki Kaisha Image forming apparatus and control apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008005664A (en) * 2006-06-26 2008-01-10 Fuji Mach Mfg Co Ltd Motor control system
US8892932B2 (en) 2010-03-15 2014-11-18 Canon Kabushiki Kaisha Image forming apparatus and control apparatus
CN102857166A (en) * 2012-08-03 2013-01-02 武汉理工大学 8-shaft coaction stepping motor control system based on serial communication

Similar Documents

Publication Publication Date Title
EP3361635B1 (en) Control system and pulse output device
US10162673B2 (en) Controller preventing communication collisions between parallel control programs
CN109639187B (en) Driving and control integrated servo implementation method and system
EP2555068B1 (en) Synchronization control apparatus
US10579031B2 (en) Controller
JP6029433B2 (en) Microcomputer
JPH1117712A (en) Communication control equipment
US10606225B2 (en) Motor drive system, motor control system, and self-propelled robot
JP2001016081A (en) Pulse-width modulated signal generator
JP2000078891A (en) Motor controller
WO2017203776A1 (en) Motor drive system, motor control system, and self-propelled robot
US8164295B2 (en) Stepping motor controlling device, method, and storage medium
US10379526B2 (en) Control device and control method for servo motor system
CN116318508A (en) EtherCAT slave station servo synchronization device, etherCAT slave station servo synchronization method, electronic equipment and storage medium
JP3538358B2 (en) Programmable controller
CN105227041A (en) The control method of motor driver and motor driven systems
US9905264B2 (en) Servo control system having function of switching learning memory
CN115001325B (en) Timed interrupt control method and multi-step motor synchronous control system and method
US11509430B2 (en) Method for operating an automation network having packet-based communication between a host and client
JP2001119996A (en) Method of controlling acceleration and deceleration of motor for distributed control system
JP2002108414A (en) Method and device for synchronously establishing plural servo-drive devices
JP2580575B2 (en) Moving object control device
CN115051768A (en) Method, device, equipment and storage medium for synchronizing clocks of slave station and master station
WO2018179165A1 (en) Communication device, communication system, and communication method
JPH03222696A (en) Motor controller and control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050708

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080227

A131 Notification of reasons for refusal

Effective date: 20080304

Free format text: JAPANESE INTERMEDIATE CODE: A131

A02 Decision of refusal

Effective date: 20080701

Free format text: JAPANESE INTERMEDIATE CODE: A02