JP6665645B2 - Numerical control device and control method - Google Patents

Numerical control device and control method Download PDF

Info

Publication number
JP6665645B2
JP6665645B2 JP2016077854A JP2016077854A JP6665645B2 JP 6665645 B2 JP6665645 B2 JP 6665645B2 JP 2016077854 A JP2016077854 A JP 2016077854A JP 2016077854 A JP2016077854 A JP 2016077854A JP 6665645 B2 JP6665645 B2 JP 6665645B2
Authority
JP
Japan
Prior art keywords
block
execution
tool
tool change
cpu
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.)
Active
Application number
JP2016077854A
Other languages
Japanese (ja)
Other versions
JP2017188005A (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.)
Brother Industries Ltd
Original Assignee
Brother Industries 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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2016077854A priority Critical patent/JP6665645B2/en
Priority to CN201710225651.4A priority patent/CN107272575B/en
Publication of JP2017188005A publication Critical patent/JP2017188005A/en
Application granted granted Critical
Publication of JP6665645B2 publication Critical patent/JP6665645B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/19Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by positioning or contouring control systems, e.g. to control position from one programmed point to another or to control movement along a programmed continuous path
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/35Nc in input of data, input till input file format
    • G05B2219/35349Display part, programmed locus and tool path, traject, dynamic locus
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P70/00Climate change mitigation technologies in the production process for final industrial or consumer products
    • Y02P70/10Greenhouse gas [GHG] capture, material saving, heat recovery or other energy efficient measures, e.g. motor control, characterised by manufacturing processes, e.g. for rolling metal or metal working

Description

本発明は、数値制御装置と制御方法に関する。   The present invention relates to a numerical control device and a control method.

数値制御装置はNCプログラムに基づき工作機械の動作を制御する。工作機械は工具交換装置を備える。工具交換装置は工作機械の主軸の工具交換を行う。工具交換装置はマガジンモータで駆動する。数値制御装置はNCプログラム中の工具交換指令を解釈した時、マガジンモータを駆動し工具交換を実行する。工作機械が被削材を加工する間、工具交換装置は動作しない。特許文献1に記載の数値制御装置は、工作機械が被削材を加工する間、工具交換装置(ロボット)を休止することで、工具交換装置の電力消費を抑制する。NCプログラムは必要箇所に休止指令を予め登録する。休止指令は被削材加工前の状態であることを通知する為の指令である。数値制御装置はNCプログラムの実行中に休止指令を解析した時、被削材加工前であると判断し、工具交換装置の電源を遮断する。   The numerical controller controls the operation of the machine tool based on the NC program. The machine tool includes a tool changing device. The tool changing device performs tool change of a main shaft of a machine tool. The tool changer is driven by a magazine motor. When interpreting the tool change command in the NC program, the numerical controller drives the magazine motor to execute tool change. The tool changer does not operate while the machine tool is processing the workpiece. The numerical control device described in Patent Literature 1 suppresses power consumption of the tool changing device by suspending the tool changing device (robot) while the machine tool processes a work material. The NC program registers a pause command in a necessary place in advance. The stop command is a command for notifying that it is in a state before the work material is processed. When the numerical controller analyzes the stop command during execution of the NC program, it determines that the workpiece is not being machined, and shuts off the power of the tool changer.

特開2010−176503号公報JP 2010-176503 A

工具交換装置を休止する時刻は、工具交換装置の電源を投入してから起動するまでに必要な時間を考慮すると、次の工具交換までの間隔の長短に応じて決定する必要がある。使用者は工具交換装置を休止する時刻を決定し、NCプログラムの必要箇所に休止指令を予め登録する必要があるので手間であった。   The time at which the tool changer is paused needs to be determined according to the length of the interval until the next tool change, in consideration of the time required from turning on the power of the tool changer to activating it. The user has to decide the time to suspend the tool changer and register the pause command in a necessary place in the NC program in advance, which is troublesome.

本発明の目的は、次の工具交換までの時間に応じて工具交換装置を駆動するモータの電源を自動で切断できる数値制御装置と制御方法を提供することである。   An object of the present invention is to provide a numerical controller and a control method capable of automatically turning off a power supply of a motor for driving a tool changer in accordance with a time until a next tool change.

請求項1に係る数値制御装置は、制御指令を有する複数のブロックで構成したNCプログラムに基づき、工具と被削材の相対移動により前記被削材の切削加工を行う機械の動作と、前記機械の主軸に装着する前記工具の工具交換を行う工具交換装置の動作を制御する数値制御装置において、前記NCプログラムの読込時に、前記複数のブロックの夫々の処理時間と、前記複数のブロックの夫々の前記制御指令の種類とを判定する判定手段と、前記判定手段が判定した前記複数のブロックの夫々の前記処理時間と前記種類の情報であるブロック情報を記憶する記憶手段と、前記NCプログラムの実行開始後、前記記憶手段が記憶した前記ブロック情報に基づき、現在実行を開始するブロックである実行ブロック以降で且つ直近のブロックであって、前記工具交換を指示する前記制御指令である工具交換指令を有する工具交換ブロックを検索する検索手段と、前記実行ブロックの実行開始から前記検索手段が検索した前記工具交換ブロックの実行開始までの各ブロックの前記処理時間を積算する積算手段と、前記積算手段が積算した前記処理時間が所定時間以上の場合、前記工具交換装置を駆動するモータの電源を切断する切断手段とを備えたことを特徴とする。それ故、数値制御装置は、次の工具交換までの間隔が長い場合にモータの電源を切断するので、消費電力を抑制できる。   The numerical control device according to claim 1, wherein the operation of the machine for cutting the work material by relative movement between a tool and the work material is performed based on an NC program including a plurality of blocks having control commands; In a numerical control device for controlling the operation of a tool changing device that performs tool change of the tool mounted on the main spindle, at the time of reading the NC program, a processing time of each of the plurality of blocks, and a processing time of each of the plurality of blocks. Determination means for determining the type of the control command; storage means for storing the processing time of each of the plurality of blocks determined by the determination means and block information as the type information; and execution of the NC program After the start, based on the block information stored in the storage unit, the block immediately after the execution block which is the block to start the execution and the latest block. A search means for searching for a tool change block having a tool change command which is the control command for instructing the tool change; and a search means for starting the execution of the execution block and starting the execution of the tool change block searched by the search means. An accumulating means for accumulating the processing time of the block; and a cutting means for cutting off a power supply of a motor for driving the tool changing device when the processing time accumulated by the accumulating means is equal to or longer than a predetermined time. And Therefore, the numerical controller cuts off the power of the motor when the interval until the next tool change is long, so that the power consumption can be suppressed.

請求項2に係る数値制御装置は、請求項1に記載の発明の構成に加え、前記切断手段が前記モータの電源を切断した後、前記工具交換ブロックの実行開始より少なくとも前記モータの起動に必要な起動時間前に、前記モータの電源を投入する投入手段を備えたこと
を特徴とする。数値制御装置はモータの電源を切断した後、工具交換ブロックの実行開始より少なくとも所定時間前にモータの電源を投入するので、モータを確実に起動してから工具交換装置による工具交換を実行できる。
According to a second aspect of the present invention, in addition to the configuration of the first aspect of the present invention, after the cutting means turns off the power of the motor, it is necessary to start the motor at least from the start of execution of the tool change block. A turning-on means for turning on the power of the motor before an appropriate starting time is provided. Since the numerical controller turns on the power of the motor at least a predetermined time before the execution of the tool change block after turning off the power of the motor, the tool change can be executed by the tool changing device after the motor is reliably started.

請求項3に係る数値制御装置は、請求項2に記載の発明の構成に加え、前記投入手段は、前記工具交換ブロックの実行開始よりも前記起動時間前のブロックの実行開始前に前記電源を投入することを特徴とする。数値制御装置はモータの電源の切断と投入のタイミングをブロック単位で行うので、制御が容易である。   According to a third aspect of the present invention, in addition to the configuration of the second aspect of the invention, the input means switches the power supply before the execution of the block before the start time before the execution of the tool change block. It is characterized by throwing. Since the numerical controller performs the timing of turning off and on the power of the motor in block units, the control is easy.

請求項4に係る数値制御装置は、請求項1から3の何れかに記載の発明の構成に加え、前記所定時間は、少なくとも前記モータの起動に必要な起動時間よりも長く、前記切断手段は、前記積算手段が積算した前記処理時間が前記所定時間未満の場合、前記モータの電源を切断しないことを特徴とする。数値制御装置はモータの電源を切断した後であっても、工具交換の前にはモータを確実に起動できるので工具交換を速やかに実行できる。   According to a fourth aspect of the present invention, in addition to the configuration of the first aspect, the predetermined time is at least longer than a start time required for starting the motor, and When the processing time integrated by the integrating means is shorter than the predetermined time, the power of the motor is not turned off. Even after the power of the motor is turned off, the numerical controller can surely start the motor before the tool change, so that the tool change can be executed quickly.

請求項5に係る制御方法は、工具を装着する主軸の工具交換を行う工具交換装置を備え、制御指令を有する複数のブロックで構成したNCプログラムに基づき、前記工具と被削材の相対移動により、前記被削材の切削加工を行う機械の動作を制御する数値制御装置の制御方法において、前記NCプログラムの読込時に、前記複数のブロックの夫々の処理時間と、前記複数のブロックの夫々の前記制御指令の種類とを判定する判定工程と、前記判定工程で判定した前記複数のブロックの夫々の前記処理時間と前記種類の情報であるブロック情報を記憶する記憶工程と、前記NCプログラムの実行開始後、前記記憶工程で記憶した前記ブロック情報に基づき、現在実行を開始するブロックである実行ブロック以降で且つ直近のブロックであって、前記工具交換を指示する前記制御指令である工具交換指令を有する工具交換ブロックを検索する検索工程と、前記実行ブロックの実行開始から前記検索工程で検索した前記工具交換ブロックの実行開始までの各ブロックの前記処理時間を積算する積算工程と、前記積算工程で積算した前記処理時間が所定時間以上の場合、前記工具交換装置を駆動するモータの電源を切断する切断工程とを備えたことを特徴とする。数値制御装置は上記方法を行うことで請求項1に記載の効果を得ることができる。   The control method according to claim 5, further comprising a tool changing device for performing tool change of a spindle on which a tool is mounted, based on an NC program configured by a plurality of blocks having control commands, based on a relative movement between the tool and the work material. A control method of a numerical control device that controls an operation of a machine that performs a cutting process on the work material, wherein at the time of reading the NC program, the processing time of each of the plurality of blocks; and the processing time of each of the plurality of blocks. A determining step of determining the type of the control command; a storing step of storing the processing time of each of the plurality of blocks determined in the determining step and block information that is information of the type; and starting execution of the NC program Thereafter, based on the block information stored in the storage step, based on the block immediately after the execution block is the block to start the current execution, A search step of searching for a tool change block having a tool change command, which is the control command instructing the tool change, and each block from the start of execution of the execution block to the start of execution of the tool change block searched in the search step An accumulating step of accumulating the processing time, and a cutting step of cutting off a power supply of a motor for driving the tool changing device when the processing time integrated in the accumulating step is equal to or longer than a predetermined time. I do. The numerical controller can obtain the effect described in claim 1 by performing the above method.

工作機械1の斜視図。FIG. 2 is a perspective view of the machine tool 1. 数値制御装置30と工作機械1の電気的構成を示すブロック図。FIG. 2 is a block diagram showing an electrical configuration of the numerical controller 30 and the machine tool 1. RAM33の各種記憶領域を示す概念図。FIG. 3 is a conceptual diagram showing various storage areas of a RAM 33. NCプログラムP1の図。The figure of NC program P1. ブロック情報3311の概念図。The conceptual diagram of the block information 3311. ブロック情報作成処理の流れ図。5 is a flowchart of block information creation processing. マガジンモータ電源制御処理(第一実施形態)の流れ図。9 is a flowchart of a magazine motor power control process (first embodiment). 工具交換指令検索処理の流れ図。5 is a flowchart of a tool change command search process. N01〜N09までのブロック処理時間とマガジンモータの電源投入と切断の時刻を示す時間図。FIG. 9 is a time chart showing block processing times from N01 to N09 and power-on and power-off times of a magazine motor. RAM133の各種記憶領域を示す概念図。FIG. 3 is a conceptual diagram showing various storage areas of a RAM 133. タイマ処理の流れ図。9 is a flowchart of a timer process. マガジンモータ電源制御処理(第二実施形態)の流れ図。9 is a flowchart of a magazine motor power control process (second embodiment). 第二実施形態におけるN01〜N09までのブロック処理時間とマガジンモータの電源投入と切断の時刻を示す時間図。FIG. 12 is a time chart showing block processing times from N01 to N09 and power-on and power-off times of a magazine motor in the second embodiment.

図1〜図9を参照し、本発明の第一実施形態を説明する。以下説明は、図1中に矢印で示す左右、前後、上下を使用する。工作機械1の左右方向、前後方向、上下方向は夫々工作機械1のX軸方向、Y軸方向、Z軸方向である。図1に示す工作機械1は主軸9に装着した工具4を回転し、テーブル13上面に保持した被削材3に切削加工を施す機械である。数値制御装置30(図2参照)は工作機械1の動作を制御するものである。   A first embodiment of the present invention will be described with reference to FIGS. The following description uses left and right, front and rear, and up and down indicated by arrows in FIG. The left-right direction, the front-back direction, and the up-down direction of the machine tool 1 are the X-axis direction, the Y-axis direction, and the Z-axis direction of the machine tool 1, respectively. A machine tool 1 shown in FIG. 1 is a machine that rotates a tool 4 mounted on a main shaft 9 and performs a cutting process on a workpiece 3 held on an upper surface of a table 13. The numerical controller 30 (see FIG. 2) controls the operation of the machine tool 1.

図1を参照し工作機械1の構造を説明する。工作機械1は、基台2、コラム5、主軸ヘッド7、主軸9、テーブル装置10、工具交換装置20、制御箱6、操作パネル15(図2参照)等を備える。基台2は金属製の略直方体状の土台である。コラム5は基台2上部後方に立設する。主軸ヘッド7はコラム5前面に沿ってZ軸方向に移動可能に設ける。主軸ヘッド7は内部に主軸9を回転可能に支持する。主軸9は主軸ヘッド7下部に装着穴(図示略)を有する。主軸9は該装着穴に工具4を装着し、主軸モータ52(図2参照)の駆動で回転する。主軸モータ52は主軸ヘッド7に設ける。主軸ヘッド7はコラム5前面に設けたZ軸移動機構(図示略)でZ軸方向に移動する。数値制御装置30はZ軸モータ51の駆動を制御することで、主軸ヘッド7をZ軸方向に移動制御する。   The structure of the machine tool 1 will be described with reference to FIG. The machine tool 1 includes a base 2, a column 5, a spindle head 7, a spindle 9, a table device 10, a tool changing device 20, a control box 6, an operation panel 15 (see FIG. 2), and the like. The base 2 is a substantially rectangular parallelepiped base made of metal. The column 5 stands upright on the upper part of the base 2. The spindle head 7 is provided movably in the Z-axis direction along the front surface of the column 5. The spindle head 7 rotatably supports the spindle 9 therein. The spindle 9 has a mounting hole (not shown) below the spindle head 7. The spindle 9 has the tool 4 mounted in the mounting hole, and is rotated by driving a spindle motor 52 (see FIG. 2). The spindle motor 52 is provided on the spindle head 7. The spindle head 7 is moved in the Z-axis direction by a Z-axis moving mechanism (not shown) provided on the front surface of the column 5. The numerical controller 30 controls the movement of the spindle head 7 in the Z-axis direction by controlling the driving of the Z-axis motor 51.

テーブル装置10は、Y軸移動機構(図示略)、Y軸テーブル12、X軸移動機構(図示略)、テーブル13等を備える。Y軸移動機構は基台2上面前側に設け、一対のY軸レール、Y軸ボール螺子、Y軸モータ54(図2参照)等を備える。一対のY軸レールとY軸ボール螺子はY軸方向に延びる。一対のY軸レールは上面にY軸テーブル12をY軸方向に案内する。Y軸テーブル12は略直方体状に形成し、底部外面にナット(図示略)を備える。該ナットはY軸ボール螺子に螺合する。Y軸モータ54がY軸ボール螺子を回転すると、Y軸テーブル12はナットと共に一対のY軸レールに沿って移動する。故にY軸移動機構はY軸テーブル12をY軸方向に移動可能に支持する。   The table device 10 includes a Y-axis moving mechanism (not shown), a Y-axis table 12, an X-axis moving mechanism (not shown), a table 13, and the like. The Y-axis moving mechanism is provided on the front side of the upper surface of the base 2 and includes a pair of Y-axis rails, Y-axis ball screws, a Y-axis motor 54 (see FIG. 2) and the like. The pair of Y-axis rails and the Y-axis ball screw extend in the Y-axis direction. The pair of Y-axis rails guide the Y-axis table 12 on the upper surface in the Y-axis direction. The Y-axis table 12 is formed in a substantially rectangular parallelepiped shape, and includes a nut (not shown) on the outer surface of the bottom. The nut is screwed onto a Y-axis ball screw. When the Y-axis motor 54 rotates the Y-axis ball screw, the Y-axis table 12 moves along with the nuts along the pair of Y-axis rails. Therefore, the Y-axis moving mechanism supports the Y-axis table 12 so as to be movable in the Y-axis direction.

X軸移動機構はY軸テーブル12上面に設け、一対のX軸レール(図示略)、X軸ボール螺子(図示略)、X軸モータ53(図2参照)等を備える。X軸レールとX軸ボール螺子はX軸方向に延びる。テーブル13は平面視矩形板状に形成し、Y軸テーブル12上面に設ける。テーブル13は底部にナット(図示略)を備える。該ナットはX軸ボール螺子に螺合する。X軸モータ53がX軸ボール螺子を回転すると、テーブル13はナットと共に一対のX軸レールに沿って移動する。故にX軸移動機構はテーブル13をX軸方向に移動可能に支持する。故にテーブル13は、Y軸移動機構、Y軸テーブル12、X軸移動機構により、基台2上をX軸方向とY軸方向に移動可能である。   The X-axis moving mechanism is provided on the upper surface of the Y-axis table 12, and includes a pair of X-axis rails (not shown), X-axis ball screws (not shown), an X-axis motor 53 (see FIG. 2), and the like. The X-axis rail and the X-axis ball screw extend in the X-axis direction. The table 13 is formed in a rectangular plate shape in a plan view, and is provided on the upper surface of the Y-axis table 12. The table 13 has a nut (not shown) at the bottom. The nut is screwed onto the X-axis ball screw. When the X-axis motor 53 rotates the X-axis ball screw, the table 13 moves along with the nuts along the pair of X-axis rails. Therefore, the X-axis moving mechanism supports the table 13 so as to be movable in the X-axis direction. Therefore, the table 13 can be moved on the base 2 in the X-axis direction and the Y-axis direction by the Y-axis moving mechanism, the Y-axis table 12, and the X-axis moving mechanism.

工具交換装置20は主軸ヘッド7の前側に設け、円盤型の工具マガジン21を備える。工具マガジン21は外周に複数の工具(図示略)を放射状に保持し、マガジンモータ55(図2参照)の駆動により、工具交換指令が指示する工具を工具交換位置に位置決めする。工具交換指令はNCプログラムで指令する。工具交換位置は工具マガジン21の最下部位置である。工具交換装置20は主軸9に装着する工具4と工具交換位置にある工具とを入れ替え交換する。   The tool changer 20 is provided in front of the spindle head 7 and includes a disk-shaped tool magazine 21. The tool magazine 21 radially holds a plurality of tools (not shown) on the outer periphery, and positions a tool specified by a tool change command at a tool change position by driving a magazine motor 55 (see FIG. 2). The tool change command is issued by the NC program. The tool change position is the lowermost position of the tool magazine 21. The tool changing device 20 exchanges and exchanges the tool 4 mounted on the spindle 9 with the tool at the tool changing position.

制御箱6は数値制御装置30(図2参照)を格納する。数値制御装置30は、工作機械1に設けたZ軸モータ51、主軸モータ52、X軸モータ53、Y軸モータ54を夫々制御し、テーブル13上に保持した被削材3と主軸9に装着した工具4を相対移動することで各種加工を被削材3に施す。各種加工とは、例えばドリル、タップ等を用いた穴空け加工、エンドミル、フライス等を用いた側面加工等である。   The control box 6 stores a numerical controller 30 (see FIG. 2). The numerical control device 30 controls the Z-axis motor 51, the main shaft motor 52, the X-axis motor 53, and the Y-axis motor 54 provided on the machine tool 1, respectively, and mounts them on the work material 3 and the main shaft 9 held on the table 13. The workpiece 4 is subjected to various types of processing by relatively moving the tool 4. The various types of processing include, for example, drilling using a drill, a tap, or the like, and side processing using an end mill, a milling machine, or the like.

操作パネル15は例えば工作機械1を覆うカバー(図示略)の外壁に設ける。操作パネル15は入力部16と表示部17(図2参照)を備える。入力部16は各種情報、操作指示等の入力を受け付け、後述する数値制御装置30に出力する。表示部17は後述する数値制御装置30からの指令に基づき、各種画面を表示する。   The operation panel 15 is provided on, for example, an outer wall of a cover (not shown) that covers the machine tool 1. The operation panel 15 includes an input unit 16 and a display unit 17 (see FIG. 2). The input unit 16 receives inputs of various information, operation instructions, and the like, and outputs them to a numerical control device 30 described later. The display unit 17 displays various screens based on a command from the numerical controller 30 described later.

図2を参照し、数値制御装置30と工作機械1の電気的構成を説明する。数値制御装置30と工作機械1は、CPU31、ROM32、RAM33、記憶装置34、入出力部35、駆動回路51A〜55A等を備える。CPU31は数値制御装置30を統括制御する。ROM32は、メインプログラム、ブロック情報作成プログラム、マガジンモータ電源制御プログラム、工具交換指令検索プログラム等を記憶する。メインプログラムは、メイン処理を実行する。メイン処理はNCプログラムを一ブロックずつ読み込んで各種動作を実行するものである。NCプログラムは各種制御指令を含む複数ブロックで構成し、工作機械1の軸移動、工具交換等を含む各種動作をブロック単位で制御するものである。ブロック情報作成プログラムは、後述するブロック情報作成処理(図6参照)を実行するものである。マガジンモータ電源制御プログラムは、後述するマガジンモータ電源制御処理(図7参照)を実行するものである。工具交換指令検索プログラムは、マガジンモータ電源制御処理のサブプログラムであり、後述する工具交換指令検索処理(図8参照)を実行するものである。RAM33は後述する各種記憶領域(図3参照)を有し、各種情報を一時的に記憶する。記憶装置34は不揮発性であり、NCプログラム等の各種情報を記憶する。CPU31は作業者が操作パネル15の入力部16で入力したNCプログラムに加え、外部入力で読み込んだNCプログラム等を記憶装置34に記憶できる。   The electrical configuration of the numerical control device 30 and the machine tool 1 will be described with reference to FIG. The numerical controller 30 and the machine tool 1 include a CPU 31, a ROM 32, a RAM 33, a storage device 34, an input / output unit 35, drive circuits 51A to 55A, and the like. The CPU 31 totally controls the numerical controller 30. The ROM 32 stores a main program, a block information creation program, a magazine motor power control program, a tool change command search program, and the like. The main program executes a main process. The main process is to read the NC program block by block and execute various operations. The NC program is composed of a plurality of blocks including various control commands, and controls various operations including axis movement of the machine tool 1, tool exchange, and the like in block units. The block information creation program executes a block information creation process (see FIG. 6) described later. The magazine motor power control program executes a later-described magazine motor power control process (see FIG. 7). The tool change command search program is a subprogram of the magazine motor power control process, and executes a tool change command search process (see FIG. 8) described later. The RAM 33 has various storage areas (see FIG. 3) described later, and temporarily stores various information. The storage device 34 is nonvolatile and stores various information such as an NC program. The CPU 31 can store the NC program and the like read by an external input in the storage device 34 in addition to the NC program input by the operator through the input unit 16 of the operation panel 15.

駆動回路51AはZ軸モータ51とエンコーダ51Bに接続する。駆動回路52Aは主軸モータ52とエンコーダ52Bに接続する。駆動回路53AはX軸モータ53とエンコーダ53Bに接続する。駆動回路54AはY軸モータ54とエンコーダ54Bに接続する。駆動回路55Aはマガジンモータ55とエンコーダ55Bに接続する。Z軸モータ51、主軸モータ52、X軸モータ53、Y軸モータ54、マガジンモータ55は何れもサーボモータである。駆動回路51A〜55AはCPU31から指令を受け、対応する各モータ51〜55に駆動電流を夫々出力する。駆動回路51A〜55Aはエンコーダ51B〜55Bからフィードバック信号を受け、位置と速度のフィードバック制御を行う。入出力部35は操作パネル15の入力部16と表示部17に夫々接続する。   The drive circuit 51A is connected to the Z-axis motor 51 and the encoder 51B. The drive circuit 52A is connected to the spindle motor 52 and the encoder 52B. The drive circuit 53A is connected to the X-axis motor 53 and the encoder 53B. The drive circuit 54A is connected to the Y-axis motor 54 and the encoder 54B. The drive circuit 55A is connected to the magazine motor 55 and the encoder 55B. The Z-axis motor 51, the main shaft motor 52, the X-axis motor 53, the Y-axis motor 54, and the magazine motor 55 are all servo motors. Drive circuits 51A to 55A receive a command from CPU 31 and output drive currents to corresponding motors 51 to 55, respectively. The drive circuits 51A to 55A receive feedback signals from the encoders 51B to 55B and perform feedback control of position and speed. The input / output unit 35 is connected to the input unit 16 and the display unit 17 of the operation panel 15, respectively.

図3を参照し、RAM33の各種記憶領域を説明する。RAM33は、ブロック情報記憶領域331、積算時間記憶領域332等を備える。ブロック情報記憶領域331は、NCプログラムに基づき作成した後述するブロック情報3311(図5参照)を記憶する。積算時間記憶領域332は、NCプログラムにおける実行ブロックの実行開始から工具交換ブロックの実行開始までの各ブロックのブロック処理時間を積算した時間(以下積算時間と呼ぶ)を記憶する。実行ブロックとは、NCプログラムで実行するブロックである。工具交換ブロックとは、工具交換指令(G100)を含むブロックである。   Various storage areas of the RAM 33 will be described with reference to FIG. The RAM 33 includes a block information storage area 331, an accumulated time storage area 332, and the like. The block information storage area 331 stores block information 3311 (see FIG. 5), which will be described later, created based on the NC program. The accumulated time storage area 332 stores the time obtained by accumulating the block processing time of each block from the start of execution of the execution block to the start of execution of the tool change block in the NC program (hereinafter, referred to as accumulated time). The execution block is a block executed by the NC program. The tool change block is a block including a tool change command (G100).

図4を参照し、NCプログラムP1を説明する。NCプログラムP1は一般的なNCプログラムの一例であり、N01〜Nnブロックで構成する。工具4又は主軸9の位置を示すx、y、z座標はワーク座標であり、絶対位置座標を示し、単位はmmである。N01のG0X−100.Y−100.;は(X,Y)=(−100,−100)への早送り指令である。N02のG4X1.0;は、1.0秒待機するドウエル指令である。N03のG100T1X−150.Y−150.Z200.;は、工具T1への工具交換指令と、(X,Y,Z)=(−150,−150,200)への位置決め指令である。N04のM140;は信号出力指令であり、例えば確認信号を通信相手先(例えば駆動回路51A〜55A等)に出力してOK信号を通信相手先から受信して確認した場合に次の処理に進む指令である。例えば確認信号を出力してから規定時間が経過するまでにOK信号を受信しない、又は確認できなかった場合、CPU31はエラーを出力し、例えば工作機械1の動作を停止する。規定時間は信号出力確認時間として、ROM32又は記憶装置34等に予め設定すればよい。   The NC program P1 will be described with reference to FIG. The NC program P1 is an example of a general NC program, and includes N01 to Nn blocks. The x, y, and z coordinates indicating the position of the tool 4 or the main shaft 9 are work coordinates and absolute position coordinates, and the unit is mm. G0X-100 of N01. Y-100. Is a fast-forward command to (X, Y) = (-100, -100). G4X1.0; of N02 is a dwell command to wait 1.0 second. G100T1X-150 of N03. Y-150. Z200. Are a tool change command to the tool T1 and a positioning command to (X, Y, Z) = (− 150, −150, 200). M140; of N04 is a signal output command. For example, when the confirmation signal is output to the communication partner (for example, the drive circuits 51A to 55A) and the OK signal is received from the communication partner and confirmed, the process proceeds to the next processing. Directive. For example, if the OK signal is not received or the confirmation is not completed before the specified time elapses after the output of the confirmation signal, the CPU 31 outputs an error and stops the operation of the machine tool 1, for example. The specified time may be set in advance in the ROM 32 or the storage device 34 as the signal output confirmation time.

N05のG0X−120.;はX=−120への早送り指令である。N06のG1X−200F10000;は送り速度=10000mm/minでX=−200への切削移動指令である。N07のG4X00.5;は0.5秒待機するドウエル指令である。N08のG0Y−100.;はY=−100への早送り指令である。N09のG100T2X−200.Y−200.Z300.は工具T2への工具交換指令と、(X,Y,Z)=(−200,−200,300)への位置決め指令である。N10のG01Z250.F2000は送り速度=2000mm/minで、Z=250への切削移動指令である。NnのM30は終了指令である。   G0X-120 of N05. Is a fast-forward command to X = -120. G1X-200F10000; of N06 is a cutting movement command to X = −200 at a feed rate = 10000 mm / min. G4X00.5; of N07 is a dwell command to wait 0.5 seconds. G08-100 of N08. Is a fast-forward command to Y = -100. G100T2X-200 of N09. Y-200. Z300. Are a tool change command to the tool T2 and a positioning command to (X, Y, Z) = (− 200, −200, 300). G01Z250 of N10. F2000 is a cutting movement command to Z = 250 at a feed speed of 2000 mm / min. N30 is an end command.

図5を参照し、ブロック情報3311を説明する。ブロック情報3311は、図4に示すNCプログラムP1のブロック情報であり、ブロック番号(N)、ブロック処理時間、ブロック種類を対応づけた情報である。ブロック処理時間は、NCプログラムP1の各ブロックの処理時間である。ブロック種類は、NCプログラムP1の各ブロックの種類である。N01のブロック処理時間は0.2秒、ブロック種類はG0(早送り指令)である。N02のブロック処理時間は1秒、ブロック種類はG4(ドウエル指令)である。N03のブロック処理時間は空欄(−)、ブロック種類はG100(工具交換指令)である。N04のブロック処理時間は0.5秒、ブロック種類はM140(信号出力指令)である。   The block information 3311 will be described with reference to FIG. The block information 3311 is block information of the NC program P1 shown in FIG. 4, and is information in which a block number (N), a block processing time, and a block type are associated. The block processing time is the processing time of each block of the NC program P1. The block type is the type of each block of the NC program P1. The block processing time of N01 is 0.2 seconds, and the block type is G0 (fast-forward command). The block processing time of N02 is 1 second, and the block type is G4 (dwell command). The block processing time of N03 is blank (-), and the block type is G100 (tool change command). The block processing time of N04 is 0.5 seconds, and the block type is M140 (signal output command).

N05のブロック処理時間は0.15秒、ブロック種類はG0である。N06のブロック処理時間は1秒、ブロック種類はG1である。N07のブロック処理時間は0.5秒、ブロック種類はG4である。N08のブロック処理時間は0.25秒、ブロック種類はG0である。N09のブロック処理時間は空欄(−)、ブロック種類はG100である。N10のブロック処理時間は1.25秒、ブロック種類はG1である。Nnのブロック処理時間は空欄(−)、ブロック種類はM30(終了指令)である。CPU31は、後述するブロック情報作成処理(図6参照)を実行することで、ブロック情報3311を作成する。ブロック処理時間の算出方法は後述する。   The block processing time of N05 is 0.15 seconds, and the block type is G0. The block processing time of N06 is 1 second, and the block type is G1. The block processing time of N07 is 0.5 seconds, and the block type is G4. The block processing time of N08 is 0.25 seconds, and the block type is G0. The block processing time of N09 is blank (-), and the block type is G100. The block processing time of N10 is 1.25 seconds, and the block type is G1. The block processing time of Nn is blank (-), and the block type is M30 (end command). The CPU 31 creates block information 3311 by executing block information creation processing (see FIG. 6) described later. The method of calculating the block processing time will be described later.

図6を参照し、ブロック情報作成処理を説明する。CPU31は記憶装置34からNCプログラムを読み込む時、ROM32からブロック情報作成プログラムを読み込んで本処理を実行する。本実施形態は、図4に示すNCプログラムP1の読込時を例に説明する。   The block information creation processing will be described with reference to FIG. When reading the NC program from the storage device 34, the CPU 31 reads the block information creation program from the ROM 32 and executes this processing. In the present embodiment, an example will be described in which the NC program P1 shown in FIG. 4 is read.

CPU31はNCプログラムP1を一ブロック読み込む(S1)。CPU31は読み込んだブロックが工具交換指令か否か判断する(S2)。N01は工具交換指令では無いので(S2:NO)、CPU31は読み込んだブロックが軸移動指令か否か判断する(S3)。軸移動指令は、例えば早送り指令、切削移動指令、位置決め指令等を含む。切削移動指令は、例えばタップ、ドリル等の穴空け指令、フライス、エンドミル等の側面加工指令等の固定サイクル指令を含む。N01の早送り指令は軸移動指令であるので(S3:YES)、CPU31は予め設定した送り速度に基づき、軸移動(早送り)の始点から終点までの移動時間(例えば0.2秒)を算出し、ブロック情報3311におけるN01のブロック処理時間に登録する(S9)。CPU31はブロック情報3311におけるN01のブロック種類にG0を登録する(S13)。なお、本実施形態はブロック種類にGコード、Mコード等の制御コードを登録するがこれ以外でもよく、例えばブロック種類を識別可能な識別コードを登録するようにしてもよい。CPU31はブロック情報3311に登録するブロックを次へ移動する(S14)。CPU31は次に読み込むブロックを選択する(S15)。   The CPU 31 reads one block of the NC program P1 (S1). The CPU 31 determines whether the read block is a tool change command (S2). Since N01 is not a tool change command (S2: NO), the CPU 31 determines whether the read block is an axis movement command (S3). The axis movement command includes, for example, a rapid traverse command, a cutting movement command, a positioning command, and the like. The cutting movement command includes, for example, a fixed cycle command such as a drilling command such as a tap or a drill, and a side processing command such as a milling machine or an end mill. Since the fast-forward command of N01 is an axis movement command (S3: YES), the CPU 31 calculates the movement time (for example, 0.2 seconds) from the start point to the end point of the axis movement (fast-forward) based on a preset feed speed. Is registered in the block processing time of N01 in the block information 3311 (S9). The CPU 31 registers G0 as the block type of N01 in the block information 3311 (S13). In the present embodiment, a control code such as a G code or an M code is registered as a block type. However, other types may be registered. For example, an identification code capable of identifying a block type may be registered. The CPU 31 moves the block registered in the block information 3311 to the next (S14). The CPU 31 selects a block to be read next (S15).

CPU31はS1に戻り、次ブロックのN02を読み込む。N02は工具交換指令、軸移動指令の何れでも無いので(S2:NO、S3:NO)、CPU31はN02がドウエル指令か否か判断する(S4)。N02はドウエル指令であるので(S4:YES)、CPU31はドウエル指令に設定する待機時間(例えば1秒)を、ブロック情報3311におけるN02のブロック処理時間に登録する(S10)。CPU31はブロック情報3311におけるN02のブロック種類にG04を登録する(S13)。CPU31はブロック情報3311に登録するブロックを次へ移動する(S14)。CPU31は次に読み込むブロックを選択する(S15)。   The CPU 31 returns to S1, and reads N02 of the next block. Since N02 is neither a tool change command nor an axis movement command (S2: NO, S3: NO), the CPU 31 determines whether or not N02 is a dowel command (S4). Since N02 is the dwell command (S4: YES), the CPU 31 registers the standby time (for example, 1 second) set in the dwell command in the block processing time of N02 in the block information 3311 (S10). The CPU 31 registers G04 as the block type of N02 in the block information 3311 (S13). The CPU 31 moves the block registered in the block information 3311 to the next (S14). The CPU 31 selects a block to be read next (S15).

CPU31はS1に戻り、次ブロックのN03を読み込む。N03は工具交換指令である(S2:YES)。本実施形態は、実行ブロックの実行開始から直近の工具交換ブロックまでの各ブロックのブロック処理時間を必要とするので、工具交換ブロックのブロック処理時間は必要ない。それ故、CPU31はブロック情報3311におけるN03のブロック処理時間を空欄にする(S8)。CPU31はブロック情報3311に登録するブロックを次へ移動する(S14)。CPU31は次に読み込むブロックを選択する(S15)。   The CPU 31 returns to S1, and reads N03 of the next block. N03 is a tool change command (S2: YES). This embodiment requires block processing time for each block from the start of execution of an execution block to the nearest tool change block, and thus does not require block processing time for a tool change block. Therefore, the CPU 31 leaves the block processing time of N03 in the block information 3311 blank (S8). The CPU 31 moves the block registered in the block information 3311 to the next (S14). The CPU 31 selects a block to be read next (S15).

CPU31はS1に戻り、次ブロックのN04を読み込む。N04は工具交換指令、軸移動指令、ドウエル指令の何れでも無いので(S2:NO、S3:NO、S4:NO)、CPU31は読み込んだブロックが信号出力指令か否か判断する(S6)。N04は信号出力指令であるので(S6:YES)、CPU31はROM32又は記憶装置34に予め設定する信号出力確認時間(例えば0.25秒)を、ブロック情報3311におけるN04のブロック処理時間に登録する(S12)。CPU31はブロック情報3311におけるN04のブロック種類にM140を登録する(S13)。CPU31はブロック情報3311に登録するブロックを次へ移動する(S14)。CPU31は次に読み込むブロックを選択する(S15)。CPU31はS1に戻り、N05以降についても上記同様に処理を実行する。   The CPU 31 returns to S1, and reads N04 of the next block. Since N04 is neither a tool change command, an axis movement command, nor a dwell command (S2: NO, S3: NO, S4: NO), the CPU 31 determines whether the read block is a signal output command (S6). Since N04 is a signal output command (S6: YES), the CPU 31 registers the signal output confirmation time (for example, 0.25 seconds) preset in the ROM 32 or the storage device 34 in the block processing time of N04 in the block information 3311. (S12). The CPU 31 registers M140 as the block type of N04 in the block information 3311 (S13). The CPU 31 moves the block registered in the block information 3311 to the next (S14). The CPU 31 selects a block to be read next (S15). The CPU 31 returns to S1 and executes the same processing as described above for N05 and thereafter.

S1の処理で読み込んだブロックが工具交換指令、軸移動指令、ドウエル指令、信号出力指令の何れでも無い場合(S2:NO、S3:NO、S4:NO、S6:NO)、CPU31は終了指令か否か判断する(S7)。Nnは終了指令であるので(S7:YES)、CPU31は本処理を終了する。ブロック情報3311の作成は完了する。なお、読み込んだブロックが、上記の工具交換指令、軸移動指令、ドウエル指令、信号出力指令以外の制御指令の場合、CPU31は、ブロック処理時間に0を登録してもよい。   If the block read in the process of S1 is not any of a tool change command, an axis movement command, a dwell command, and a signal output command (S2: NO, S3: NO, S4: NO, S6: NO), the CPU 31 determines whether an end command has been issued. It is determined whether or not it is (S7). Since Nn is an end command (S7: YES), the CPU 31 ends this processing. The creation of the block information 3311 is completed. When the read block is a control command other than the above-described tool change command, axis movement command, dwell command, and signal output command, the CPU 31 may register 0 as the block processing time.

図7〜図9を参照し、マガジンモータ電源制御処理を説明する。CPU31は記憶装置34から読み込んだNCプログラムの実行時に、ROM32からマガジンモータ制御プログラムを読み込んで本処理を実行する。本実施形態は図4に示すNCプログラムP1の実行時を例に説明する。本処理実行開始時、RAM33は、図5に示すブロック情報3311をブロック情報記憶領域331に記憶する。CPU31は本処理実行開始時に、RAM33の積算時間記憶領域332(以下RAM33と呼ぶ)に記憶する積算時間を0に初期化する。   The magazine motor power control process will be described with reference to FIGS. When executing the NC program read from the storage device 34, the CPU 31 reads the magazine motor control program from the ROM 32 and executes this processing. The present embodiment will be described by taking as an example the execution of the NC program P1 shown in FIG. At the start of the execution of this processing, the RAM 33 stores the block information 3311 shown in FIG. The CPU 31 initializes the integrated time stored in the integrated time storage area 332 (hereinafter, referred to as the RAM 33) of the RAM 33 to 0 at the start of the execution of this processing.

図7に示す如く、CPU31はNCプログラムP1を一ブロック読み込む(S21)。CPU31は読み込んだブロックが終了指令か否か判断する(S22)。N01は早送り指令であり、終了指令では無いので(S22:NO)、CPU31は読み込んだブロックが工具交換指令か否か判断する(S23)。N01は工具交換指令では無いので(S23:NO)、CPU31はRAM33に記憶する積算時間は0か否か判断する(S24)。積算時間は0であるので(S24:YES)、CPU31は、RAM33に記憶するブロック情報3311から、N01のブロック処理時間である0.2秒を取得する(S25)。CPU31は取得したブロック処理時間をRAM33に加算する(S26)。積算時間は0.2秒となり、t0〜t1までの時間(図9参照)となる。CPU31はROM32から工具交換指令検索プログラムを読出し、工具交換検索処理を実行する(S27)。   As shown in FIG. 7, the CPU 31 reads one block of the NC program P1 (S21). The CPU 31 determines whether the read block is an end command (S22). Since N01 is a fast-forward command and not an end command (S22: NO), the CPU 31 determines whether or not the read block is a tool change command (S23). Since N01 is not a tool change command (S23: NO), the CPU 31 determines whether the accumulated time stored in the RAM 33 is 0 (S24). Since the integrated time is 0 (S24: YES), the CPU 31 acquires 0.2 seconds as the block processing time of N01 from the block information 3311 stored in the RAM 33 (S25). The CPU 31 adds the obtained block processing time to the RAM 33 (S26). The integration time is 0.2 seconds, which is the time from t0 to t1 (see FIG. 9). The CPU 31 reads the tool change command search program from the ROM 32 and executes a tool change search process (S27).

図8を参照し、工具交換指令検索処理を説明する。CPU31はRAM33に記憶するブロック情報3311から、次ブロックのブロック情報を読み取る(S41)。CPU31は次ブロックは終了指令か否か判断する(S42)。終了指令の場合(S42:YES)、CPU31は本処理を終了し、図7のS30に処理を進める。   With reference to FIG. 8, the tool change command search processing will be described. The CPU 31 reads the block information of the next block from the block information 3311 stored in the RAM 33 (S41). The CPU 31 determines whether the next block is an end command (S42). In the case of an end command (S42: YES), the CPU 31 ends this processing, and proceeds to S30 of FIG.

次ブロックのN02はG4のドウエル指令であり、終了指令では無いので(S42:NO)、CPU31は、N02は工具交換指令か否か判断する(S43)。N02は工具交換指令では無いので(S43:NO)、CPU31は取得した次ブロックのブロック処理時間(1秒)を、RAM33に記憶する積算時間に加算する(S44)。積算時間は、0.2+1=1.2秒となり、t0〜t2までの時間(図9参照)となる。CPU41は、さらに次ブロックであるN03のブロック情報を、ブロック情報3311から読み取り(S45)、S42の処理に戻る。読み取った次ブロックのN03は工具交換指令であるので(S42:NO、S43:YES)、CPU31は本処理を終了し、図7のS30に処理を進める。   Since N02 in the next block is a G4 dwell command and not an end command (S42: NO), the CPU 31 determines whether N02 is a tool change command (S43). Since N02 is not a tool change command (S43: NO), the CPU 31 adds the acquired block processing time (1 second) of the next block to the accumulated time stored in the RAM 33 (S44). The integration time is 0.2 + 1 = 1.2 seconds, which is the time from t0 to t2 (see FIG. 9). The CPU 41 further reads the block information of the next block N03 from the block information 3311 (S45), and returns to the processing of S42. Since N03 of the read next block is a tool change command (S42: NO, S43: YES), the CPU 31 ends this processing and proceeds to S30 in FIG.

図7に戻り、CPU31は、RAM33に記憶する積算時間は所定時間以上か否か判断する(S30)。所定時間は、少なくともマガジンモータ55の起動時間よりも長い時間であるのが好ましく、本実施形態では0.5秒とする。積算時間はt0〜t2までの1.2秒であり、0.5秒以上であるので(S30:YES)、CPU41は、次ブロックは工具交換指令か否か判断する(S31)。次ブロックの種類はドウエル指令であるので(S31:NO)、CPU31はt0でマガジンモータ55の電源を切断する(S32)。それ故、数値制御装置30は次の工具交換までのマガジンモータ55の消費電力を節約できる。   Returning to FIG. 7, the CPU 31 determines whether the accumulated time stored in the RAM 33 is equal to or longer than a predetermined time (S30). The predetermined time is preferably longer than at least the start time of the magazine motor 55, and is set to 0.5 second in the present embodiment. Since the integration time is 1.2 seconds from t0 to t2 and is 0.5 seconds or more (S30: YES), the CPU 41 determines whether or not the next block is a tool change command (S31). Since the type of the next block is a dwell command (S31: NO), the CPU 31 turns off the power of the magazine motor 55 at t0 (S32). Therefore, the numerical controller 30 can save the power consumption of the magazine motor 55 until the next tool change.

CPU31はN02を読み込む(S21)。N02はドウエル指令であるので(S22:NO、S23:NO)、CPU31は、RAM33に記憶する積算時間は0か否か判断する(S24)。積算時間は1.2秒であり、0では無いので(S24:NO)、CPU31は、積算時間から前ブロックであるN01のブロック処理時間(0.2秒)を差し引く(S29)。それ故、積算時間は1.2−0.2=1.0秒となり、t1〜t2までの時間(図9参照)となる。CPU31は、積算時間は所定時間以上か否か判断する(S30)。積算時間はt1〜t2までの1.0秒であり、0.5秒以上であるので(S30:YES)、CPU31は、次ブロックは工具交換指令か否か判断する(S31)。次ブロックのN03は工具交換指令であるので(S31:YES)、N03で工具交換を実行する為、CPU31はt1で、マガジンモータ55の電源を投入する(S33)。それ故、CPU31は、工具交換ブロックの実行開始よりも起動時間前であるブロックの実行開始前に、マガジンモータ55の電源を投入できる。   The CPU 31 reads N02 (S21). Since N02 is a dowel command (S22: NO, S23: NO), the CPU 31 determines whether or not the integrated time stored in the RAM 33 is 0 (S24). Since the integration time is 1.2 seconds and not 0 (S24: NO), the CPU 31 subtracts the block processing time (0.2 seconds) of the previous block N01 from the integration time (S29). Therefore, the integration time is 1.2-0.2 = 1.0 second, which is the time from t1 to t2 (see FIG. 9). The CPU 31 determines whether the integrated time is equal to or longer than a predetermined time (S30). Since the integrated time is 1.0 second from t1 to t2 and 0.5 second or more (S30: YES), the CPU 31 determines whether the next block is a tool change command (S31). Since N03 of the next block is a tool change command (S31: YES), the CPU 31 turns on the power of the magazine motor 55 at t1 to execute tool change at N03 (S33). Therefore, the CPU 31 can turn on the power of the magazine motor 55 before the start of execution of the block, which is a start time before the start of execution of the tool change block.

CPU31はN03を読み込む(S21)。N03は工具交換指令であるので(S22:NO、S23:YES)、CPU31はRAM33に記憶する積算時間を0に初期化する(S28)。CPU31は、積算時間は所定時間以上か否か判断する(S30)。積算時間は0であるので(S30:NO)、CPU31は引き続き、マガジンモータ55の電源を投入した状態にする(S32)。N03の前ブロックであるN02で、マガジンモータ55の電源を先に投入するので、数値制御装置30はN03で工具交換を速やかに実行できる。   The CPU 31 reads N03 (S21). Since N03 is a tool change command (S22: NO, S23: YES), the CPU 31 initializes the accumulated time stored in the RAM 33 to 0 (S28). The CPU 31 determines whether the integrated time is equal to or longer than a predetermined time (S30). Since the accumulated time is 0 (S30: NO), the CPU 31 continues to turn on the power of the magazine motor 55 (S32). At N02, which is a block before N03, the power of the magazine motor 55 is turned on first, so that the numerical controller 30 can quickly execute the tool change at N03.

CPU31はN04を読み込む(S21)。N04は信号出力指令であるので(S22:NO、S23:NO)、CPU31は、RAM33に記憶する積算時間は0か否か判断する(S24)。積算時間は0であるので(S24:YES)、CPU31はRAM33に記憶するブロック情報3311から、読み込んだN04のブロック処理時間(0.5秒)を取得し(S25)、積算時間記憶領域332に加算する(S26)。積算時間は0.5秒となり、t3〜t4までの時間(図9参照)となる。CPU31はROM32から工具交換指令検索プログラムを読出し、上記と同様に、工具交換検索処理を実行する(S27)。   The CPU 31 reads N04 (S21). Since N04 is a signal output command (S22: NO, S23: NO), the CPU 31 determines whether the integrated time stored in the RAM 33 is 0 (S24). Since the integration time is 0 (S24: YES), the CPU 31 acquires the read block processing time of N04 (0.5 seconds) from the block information 3311 stored in the RAM 33 (S25), and stores it in the integration time storage area 332. It is added (S26). The integration time is 0.5 seconds, which is the time from t3 to t4 (see FIG. 9). The CPU 31 reads out the tool change command search program from the ROM 32 and executes a tool change search process in the same manner as described above (S27).

図8に示す如く、CPU31は、RAM33に記憶するブロック情報3311から、次ブロックのN05のブロック情報を読み取る(S41)。読み取ったN05はドウエル指令であり、終了指令及び工具交換指令の何れでも無いので、(S42:NO、S43:NO)、CPU31はN05のブロック処理時間(0.15秒)を、RAM33に記憶する積算時間に加算する(S44)。積算時間は0.5+0.15=0.65秒となり、t3〜t5までの時間(図9参照)となる。CPU41は、次ブロックのブロック情報をブロック情報3311から読み取り(S45)、S42に戻って処理を繰り返す。   As shown in FIG. 8, the CPU 31 reads the block information of the next block N05 from the block information 3311 stored in the RAM 33 (S41). Since the read N05 is a dowel command and is neither an end command nor a tool change command (S42: NO, S43: NO), the CPU 31 stores the block processing time (0.15 seconds) of N05 in the RAM 33. It is added to the accumulated time (S44). The integration time is 0.5 + 0.15 = 0.65 seconds, which is the time from t3 to t5 (see FIG. 9). The CPU 41 reads the block information of the next block from the block information 3311 (S45), returns to S42, and repeats the processing.

N05〜N08は終了指令、工具交換指令では無いので(S42:NO、S43:NO)、CPU31はN05〜N08についてS44の処理を実行することで、RAM33に記憶する積算時間に各ブロック処理時間を加算する。それ故、積算時間は0.65+1+0.5+0.25=2.4秒となり、t3〜t8までの時間(図9参照)となる。N09は工具交換指令であるので(S42:NO、S43:YES)、CPU31は本処理を終了し、図7のS30に処理を進める。   Since N05 to N08 are not an end command or a tool change command (S42: NO, S43: NO), the CPU 31 executes the processing of S44 for N05 to N08, thereby adding each block processing time to the accumulated time stored in the RAM 33. to add. Therefore, the integration time is 0.65 + 1 + 0.5 + 0.25 = 2.4 seconds, which is the time from t3 to t8 (see FIG. 9). Since N09 is a tool change command (S42: NO, S43: YES), the CPU 31 ends this processing and proceeds to S30 in FIG.

図7に戻り、CPU31は、RAM33に記憶する積算時間は所定時間以上か否か判断する(S30)。積算時間はt3〜t8までの2.4秒であり、0.5秒以上であるので(S30:YES)、次の工具交換までの間隔が長い。そこで、CPU41は次ブロックの種類は工具交換指令か否か判断する(S31)。次ブロックであるN05は信号出力指令であり、工具交換指令では無いので(S31:NO)、CPU31はマガジンモータ55の電源を切断する(S32)。それ故、数値制御装置30はマガジンモータ55の消費電力を節約できる。   Returning to FIG. 7, the CPU 31 determines whether the accumulated time stored in the RAM 33 is equal to or longer than a predetermined time (S30). The integration time is 2.4 seconds from t3 to t8, and is 0.5 seconds or more (S30: YES), so that the interval until the next tool change is long. Thus, the CPU 41 determines whether the type of the next block is a tool change command (S31). Since the next block N05 is a signal output command and not a tool change command (S31: NO), the CPU 31 turns off the power of the magazine motor 55 (S32). Therefore, the numerical controller 30 can save the power consumption of the magazine motor 55.

CPU31はN05を読み込む(S21)。N05は信号出力指令であるので(S22:NO、S23:NO)、CPU31はRAM33に記憶する積算時間は0か否か判断する(S24)。RAM33に記憶する積算時間は2.4秒であり、0では無いので(S24:NO)、CPU31は、積算時間から前ブロックであるN04のブロック処理時間(0.5秒)を差し引く(S29)。それ故、積算時間は2.4−0.5=1.9秒となり、t4〜t8までの時間(図9参照)となる。積算時間は0.5秒以上であり(S30:YES)、次ブロックであるN06の種類は工具交換指令では無いので(S31:NO)、CPU31はマガジンモータ55の電源を引き続き切断する(S32)。   The CPU 31 reads N05 (S21). Since N05 is a signal output command (S22: NO, S23: NO), the CPU 31 determines whether the integrated time stored in the RAM 33 is 0 (S24). Since the accumulated time stored in the RAM 33 is 2.4 seconds and is not 0 (S24: NO), the CPU 31 subtracts the block processing time (0.5 seconds) of the previous block N04 from the accumulated time (S29). . Therefore, the integration time is 2.4-0.5 = 1.9 seconds, which is the time from t4 to t8 (see FIG. 9). The integration time is 0.5 seconds or longer (S30: YES), and since the type of N06 as the next block is not a tool change command (S31: NO), the CPU 31 continues to turn off the power of the magazine motor 55 (S32). .

CPU31はN06を読み込む(S21)。N06は切削移動指令であるので(S22:NO、S23:NO)、CPU31はRAM33に記憶する積算時間は0か否か判断する(S24)。RAM33に記憶する積算時間は1.9秒であり、0では無いので(S24:NO)、CPU31は、積算時間から前ブロックであるN05のブロック処理時間(0.15秒)を差し引く(S29)。それ故、積算時間は1.9−0.15=1.75秒となり、t5〜t8までの時間(図9参照)となる。積算時間は0.5秒以上であり(S30:YES)、次ブロックであるN07の種類は工具交換指令では無いので(S31:NO)、CPU31はマガジンモータ55の電源を引き続き切断する(S32)。   The CPU 31 reads N06 (S21). Since N06 is a cutting movement command (S22: NO, S23: NO), the CPU 31 determines whether the integrated time stored in the RAM 33 is 0 (S24). Since the accumulated time stored in the RAM 33 is 1.9 seconds and is not 0 (S24: NO), the CPU 31 subtracts the block processing time (0.15 seconds) of the previous block N05 from the accumulated time (S29). . Therefore, the integration time is 1.9−0.15 = 1.75 seconds, which is the time from t5 to t8 (see FIG. 9). The integration time is 0.5 seconds or longer (S30: YES), and since the type of N07 as the next block is not a tool change command (S31: NO), the CPU 31 continues to cut off the power of the magazine motor 55 (S32). .

CPU31はN07を読み込む(S21)。N07はドウエル指令であるので(S22:NO、S23:NO)、CPU31はRAM33に記憶する積算時間は0か否か判断する(S24)。RAM33に記憶する積算時間は1.75秒であり、0では無いので(S24:NO)、CPU31は、積算時間から前ブロックであるN06のブロック処理時間(1秒)を差し引く(S29)。それ故、積算時間は1.75−1=0.75秒となり、t6〜t8までの時間(図9参照)となる。積算時間は0.5秒以上であり(S30:YES)、次ブロックであるN08の種類は工具交換指令では無いので(S31:NO)、CPU31はマガジンモータ55の電源を引き続き切断する(S32)。   The CPU 31 reads N07 (S21). Since N07 is a dowel command (S22: NO, S23: NO), the CPU 31 determines whether the integrated time stored in the RAM 33 is 0 (S24). Since the accumulated time stored in the RAM 33 is 1.75 seconds and is not 0 (S24: NO), the CPU 31 subtracts the block processing time (1 second) of the previous block N06 from the accumulated time (S29). Therefore, the integration time is 1.75-1 = 0.75 seconds, which is the time from t6 to t8 (see FIG. 9). The accumulated time is 0.5 seconds or more (S30: YES), and since the type of N08 as the next block is not a tool change command (S31: NO), the CPU 31 continues to turn off the power of the magazine motor 55 (S32). .

CPU31はN08を読み込む(S21)。N08は早送り指令であるので(S22:NO、S23:NO)、CPU31はRAM33に記憶する積算時間は0か否か判断する(S24)。RAM33に記憶する積算時間は0.75秒であり、0では無いので(S24:NO)、CPU31は、積算時間から前ブロックであるN07のブロック処理時間(0.5秒)を差し引く(S29)。それ故、積算時間は1.75−0.5=0.25秒となり、t7〜t8までの時間(図9参照)となる。積算時間は0.5秒未満であるので(S30:NO)、CPU31はマガジンモータ55の電源を投入する(S32)。工具交換ブロックのN09ではなく、その前ブロックのN08の実行開始時に、マガジンモータ55の電源を投入するので、数値制御装置30はN09で工具交換を速やかに実行できる。CPU31はS21に戻り、次ブロック以降、処理を繰り返す。   The CPU 31 reads N08 (S21). Since N08 is a fast-forward command (S22: NO, S23: NO), the CPU 31 determines whether the integrated time stored in the RAM 33 is 0 (S24). Since the accumulated time stored in the RAM 33 is 0.75 seconds and is not 0 (S24: NO), the CPU 31 subtracts the block processing time (0.5 seconds) of the previous block N07 from the accumulated time (S29). . Therefore, the integration time is 1.75-0.5 = 0.25 seconds, which is the time from t7 to t8 (see FIG. 9). Since the integration time is less than 0.5 seconds (S30: NO), the CPU 31 turns on the power of the magazine motor 55 (S32). The power of the magazine motor 55 is turned on at the start of execution of N08 of the preceding block instead of N09 of the tool exchange block, so that the numerical controller 30 can quickly execute the tool exchange at N09. The CPU 31 returns to S21 and repeats the processing from the next block.

CPU31はNnを読み込む(S21)。Nnは終了指令であるので(S22:YES)、CPU31は本処理を終了する。   The CPU 31 reads Nn (S21). Since Nn is an end command (S22: YES), the CPU 31 ends this processing.

以上説明にて、図6のS2〜S6の処理を実行するCPU31は本発明の判定手段の一例である。S8〜S12の処理を実行するCPU31は本発明の記憶手段の一例である。図8のS43の処理を実行するCPU31は本発明の検索手段の一例である。S44の処理を実行するCPU31は本発明の積算手段の一例である。図7のS30、S32の処理を実行するCPU31は本発明の切断手段の一例である。S30、S33の処理を実行するCPU31は本発明の投入手段の一例である。   In the above description, the CPU 31 executing the processing of S2 to S6 in FIG. 6 is an example of the determination unit of the present invention. The CPU 31 executing the processing of S8 to S12 is an example of the storage unit of the present invention. The CPU 31 executing the process of S43 in FIG. 8 is an example of a search unit of the present invention. The CPU 31 executing the process of S44 is an example of the integrating means of the present invention. The CPU 31 executing the processing of S30 and S32 in FIG. 7 is an example of the cutting unit of the present invention. The CPU 31 executing the processes of S30 and S33 is an example of the input unit of the present invention.

以上説明したように、第一実施形態の数値制御装置30はNCプログラムに基づき、工作機械1と工具交換装置20の夫々の動作を制御する。工具交換装置20は工具マガジン21とマガジンモータ55を備える。工具マガジン21はマガジンモータ55の駆動で動作する。数値制御装置30のCPU31は、NCプログラムの読込時に、ブロック情報作成処理を実行する。該処理では、CPU31はNCプログラムを構成する複数のブロックの夫々のブロック処理時間とブロック種類を判定し、ブロック情報3311としてRAM33に記憶する。CPU31はNCプログラムの実行開始後、マガジンモータ電源制御処理を実行する。該処理の中で、CPU31はNCプログラムを一ブロックずつ読み込み、ブロック情報3311に基づき、実行ブロック以降で且つ直近の工具交換ブロックを検索する。CPU31は、実行ブロックの実行開始から工具交換ブロックの実行開始までの各ブロックのブロック処理時間を積算する。該積算時間が所定時間より大きい場合、CPU31はマガジンモータ55の電源を切断する。数値制御装置30は次の工具交換までの間隔が長い場合にマガジンモータ55の電源を切断するので、マガジンモータ55の消費電力を節約できる。   As described above, the numerical control device 30 of the first embodiment controls the operations of the machine tool 1 and the tool changing device 20 based on the NC program. The tool changing device 20 includes a tool magazine 21 and a magazine motor 55. The tool magazine 21 operates by driving a magazine motor 55. The CPU 31 of the numerical control device 30 executes a block information creation process when reading the NC program. In this process, the CPU 31 determines the block processing time and the block type of each of a plurality of blocks constituting the NC program, and stores the block processing time and the block type in the RAM 33 as block information 3311. After starting execution of the NC program, the CPU 31 executes a magazine motor power control process. In the process, the CPU 31 reads the NC program one block at a time, and searches for the latest tool change block after the execution block based on the block information 3311. The CPU 31 accumulates the block processing time of each block from the start of execution of the execution block to the start of execution of the tool change block. If the accumulated time is longer than the predetermined time, the CPU 31 turns off the power of the magazine motor 55. Since the numerical controller 30 turns off the power of the magazine motor 55 when the interval between the next tool change is long, the power consumption of the magazine motor 55 can be reduced.

第一実施形態のCPU31は、マガジンモータ55の電源を切断した後、次の工具交換ブロックまでの積算時間が所定時間未満になった場合、マガジンモータ55の電源を投入する。所定時間は、少なくともマガジンモータ55の起動時間よりも長い。それ故、数値制御装置30は、工具交換ブロックの実行開始よりも起動時間前のブロックの実行開始前に電源を投入できる。数値制御装置30は、マガジンモータ55の電源の切断と投入のタイミングをブロック単位で行うので、制御が容易である。   The CPU 31 of the first embodiment turns on the power of the magazine motor 55 when the integrated time until the next tool change block becomes shorter than a predetermined time after the power of the magazine motor 55 is turned off. The predetermined time is at least longer than the activation time of the magazine motor 55. Therefore, the numerical controller 30 can turn on the power before the execution of the block before the start time of the execution of the tool change block is started. Since the numerical controller 30 performs the timing of turning off and on the power of the magazine motor 55 in block units, the control is easy.

第一実施形態のCPU31は、マガジンモータ55の電源が切断した状態で、実行ブロックから次の工具交換ブロックまでの積算時間が所定時間以上であっても、次ブロックの種類が工具交換ブロックの場合、マガジンモータ55の電源を投入する。それ故、数値制御装置30は、工具交換ブロックにおいて工具交換を速やかに開始できる。   In the state where the power of the magazine motor 55 is turned off, the CPU 31 of the first embodiment is configured such that even if the integrated time from the execution block to the next tool change block is a predetermined time or more, the type of the next block is the tool change block. Then, the power of the magazine motor 55 is turned on. Therefore, the numerical controller 30 can immediately start the tool change in the tool change block.

第一実施形態のCPU31は、実行ブロックの実行開始から工具交換ブロックまでの積算時間が所定時間以下の場合、マガジンモータ55の電源を切断しない。それ故、数値制御装置30は、工具交換ブロックにおいて工具交換を速やかに実行できる。   The CPU 31 of the first embodiment does not turn off the power of the magazine motor 55 when the accumulated time from the start of execution of the execution block to the tool change block is equal to or shorter than a predetermined time. Therefore, the numerical controller 30 can quickly execute the tool change in the tool change block.

図10〜図13を参照し、本発明の第二実施形態を説明する。第二実施形態は第一実施形態の変形例である。第一実施形態は、NCプログラムの実行ブロックの実行開始から工具交換ブロックの実行開始までのブロック処理時間を積算し、該積算時間に基づき、マガジンモータ55の電源の投入と切断をブロック単位で制御する。第二実施形態は、マガジンモータ55の電源の切断については第一実施形態と同様にブロック単位で行うが、電源の投入については、工具交換ブロック実行開始の所定時間前に行うように制御する。   A second embodiment of the present invention will be described with reference to FIGS. The second embodiment is a modification of the first embodiment. In the first embodiment, the block processing time from the start of execution of the execution block of the NC program to the start of execution of the tool change block is integrated, and the turning on and off of the power of the magazine motor 55 is controlled in block units based on the integrated time. I do. In the second embodiment, the power supply of the magazine motor 55 is turned off in units of blocks as in the first embodiment, but the power supply is controlled so as to be performed a predetermined time before the execution of the tool change block.

第二実施形態の数値制御装置30は、第一実施形態の数値制御装置30と同一の電気的構成を備えるので、同符号を用いて説明する。第二実施形態の数値制御装置30は、第一実施形態のRAM33の代わりに、RAM133(図10参照)を備える。数値制御装置30のCPU31は、第一実施形態のブロック情報作成処理(図6参照)に加え、タイマ処理(図11参照)、マガジンモータ電源制御処理(図12参照)を実行する。タイマ処理は、マガジンモータ55の電源の投入について制御する。マガジンモータ電源制御処理は、マガジンモータ55の電源の切断について制御する。第二実施形態は、RAM133、タイマ処理、マガジンモータ電源制御処理を中心に説明する。   The numerical controller 30 according to the second embodiment has the same electrical configuration as the numerical controller 30 according to the first embodiment, and will be described using the same reference numerals. The numerical control device 30 of the second embodiment includes a RAM 133 (see FIG. 10) instead of the RAM 33 of the first embodiment. The CPU 31 of the numerical controller 30 executes a timer process (see FIG. 11) and a magazine motor power control process (see FIG. 12) in addition to the block information creation process (see FIG. 6) of the first embodiment. The timer process controls turning on the power of the magazine motor 55. The magazine motor power supply control process controls the power off of the magazine motor 55. The second embodiment will be described mainly on the RAM 133, the timer process, and the magazine motor power control process.

図10を参照し、RAM133の各種記憶領域を説明する。RAM133は、ブロック情報記憶領域331、積算時間記憶領域332、合計処理時間記憶領域333、タイマ値記憶領域334、電源フラグ記憶領域335等を備える。ブロック情報記憶領域331と積算時間記憶領域332は第一実施形態と同じである。合計処理時間記憶領域333は合計処理時間を記憶する。合計処理時間は、後述するタイマ処理(図11参照)の中で設定するものであり、実行ブロックの実行開始から直近の工具交換ブロックの実行開始までのブロック処理時間を合計した時間である。タイマ値記憶領域334はタイマ値を記憶する。タイマ値は実行ブロック開始からの経過時間であり、CPU31が不図示のタイマからの出力値に基づき計測する。電源フラグ記憶領域335は電源フラグを記憶する。電源フラグは、後述するタイマ処理でマガジンモータ55の電源が投入された状態は1、それ以外の状態は0を設定する。   Various storage areas of the RAM 133 will be described with reference to FIG. The RAM 133 includes a block information storage area 331, an accumulated time storage area 332, a total processing time storage area 333, a timer value storage area 334, a power flag storage area 335, and the like. The block information storage area 331 and the accumulated time storage area 332 are the same as in the first embodiment. The total processing time storage area 333 stores the total processing time. The total processing time is set in timer processing (see FIG. 11) described later, and is a total time of block processing times from the start of execution of the execution block to the start of execution of the latest tool change block. The timer value storage area 334 stores a timer value. The timer value is an elapsed time from the start of the execution block, and is measured by the CPU 31 based on an output value from a timer (not shown). The power flag storage area 335 stores a power flag. The power flag is set to 1 when the power of the magazine motor 55 is turned on in timer processing described later, and is set to 0 in other states.

図11,図13を参照し、タイマ処理を説明する。本処理は、工具交換ブロックの実行開始より所定時間前に、マガジンモータ55の電源を投入するように制御する。なお、マガジンモータ電源制御処理(図12参照)は、マガジンモータ55の電源の切断について制御するが、電源切断の時刻は、第一実施形態のマガジンモータ電源制御処理(図7参)と同じである。それ故、図13に示すマガジンモータ55の電源を切断するt0とt3の時刻は、図9の時刻と同じである。CPU31は定期的にROM32からタイマ処理プログラムを読出し、本処理を実行する。第二実施形態も、NCプログラムP1の実行時を説明する。   The timer process will be described with reference to FIGS. In this process, the power of the magazine motor 55 is controlled to be turned on a predetermined time before the execution of the tool change block. In the magazine motor power control process (see FIG. 12), the power of the magazine motor 55 is controlled to be turned off. The power-off time is the same as the magazine motor power control process of the first embodiment (see FIG. 7). is there. Therefore, the times t0 and t3 at which the power to the magazine motor 55 shown in FIG. 13 is turned off are the same as the times shown in FIG. The CPU 31 periodically reads the timer processing program from the ROM 32 and executes this processing. The second embodiment also describes the execution of the NC program P1.

図11に示す如く、CPU31はタイマより、実行ブロックの現在のタイマ値を取得し、RAM133のタイマ値記憶領域334に設定する(S51)。CPU31は、RAM33に記憶するブロック情報3311から、NCプログラムP1における実行ブロックのブロック情報を読み取る(S52)。CPU31は、読み取ったブロック情報のブロック種類が終了指令か否か判断する(S53)。終了指令の場合(S53:YES)、マガジンモータ55の電源を投入する必要が無いので、CPU31は、RAM133の合計処理時間記憶領域333(以下省略)に記憶する合計処理時間を0に初期化し(S59)、RAM133の電源フラグ記憶領域335(以下省略)に記憶する電源フラグを0に初期化し(S60)、本処理を終了する。   As shown in FIG. 11, the CPU 31 obtains the current timer value of the execution block from the timer and sets it in the timer value storage area 334 of the RAM 133 (S51). The CPU 31 reads the block information of the execution block in the NC program P1 from the block information 3311 stored in the RAM 33 (S52). The CPU 31 determines whether the block type of the read block information is an end command (S53). In the case of the end command (S53: YES), there is no need to turn on the power of the magazine motor 55, so the CPU 31 initializes the total processing time stored in the total processing time storage area 333 (hereinafter abbreviated) of the RAM 133 to 0 ( (S59), the power flag stored in the power flag storage area 335 (hereinafter abbreviated) of the RAM 133 is initialized to 0 (S60), and the process ends.

読み取ったブロック情報のブロック種類が終了指令でない場合(S53:NO)、CPU31は、読み取ったブロック情報のブロック種類が工具交換指令か否か判断する(S54)。工具交換指令の場合(S54:YES)、マガジンモータ55の電源は既に投入した状態であるので、CPU31は、RAM133に記憶する合計処理時間を0に初期化し(S59)、RAM133に記憶する電源フラグを0に初期化し(S60)、本処理を終了する。   If the block type of the read block information is not an end command (S53: NO), the CPU 31 determines whether the block type of the read block information is a tool change command (S54). In the case of the tool change command (S54: YES), since the power of the magazine motor 55 has already been turned on, the CPU 31 initializes the total processing time stored in the RAM 133 to 0 (S59), and the power flag stored in the RAM 133. Is initialized to 0 (S60), and this processing ends.

読み取ったブロック情報のブロック種類が工具交換指令でも無い場合(S54:NO)、CPU31は直近の工具交換ブロックまでの合計処理時間を算出し、RAM133に設定する(S55)。CPU31はRAM33に記憶する合計処理時間からタイマ値を差し引いた値が所定時間以下か否か判断する。所定時間は、例えばマガジンモータ55の起動に必要な時間(例えば0.5秒)、若しくはそれ以上に設定するとよい。   If the block type of the read block information is not a tool change command (S54: NO), the CPU 31 calculates the total processing time up to the latest tool change block, and sets it in the RAM 133 (S55). The CPU 31 determines whether the value obtained by subtracting the timer value from the total processing time stored in the RAM 33 is equal to or less than a predetermined time. The predetermined time may be set to, for example, a time required for starting the magazine motor 55 (for example, 0.5 seconds) or longer.

図13に示す如く、例えばt10では、実行ブロックはN01、タイマ値は0.1秒である。直近の工具交換ブロックはN03である。合計処理時間は、N01とN02の夫々のブロック処理時間の合計であるので、0.2+1=1.2秒である。合計処理時間からタイマ値を差し引くと、1.2−0.1=1.1秒となり、所定時間よりも大きいので(S56:NO)、CPU31はマガジンモータ55の電源を投入する必要が無い。それ故、CPU31は、RAM133に記憶する電源フラグを0に初期化し(S60)、本処理を終了する。   As shown in FIG. 13, for example, at t10, the execution block is N01 and the timer value is 0.1 second. The latest tool change block is N03. Since the total processing time is the sum of the respective block processing times of N01 and N02, 0.2 + 1 = 1.2 seconds. When the timer value is subtracted from the total processing time, it becomes 1.2-0.1 = 1.1 seconds, which is longer than the predetermined time (S56: NO). Therefore, the CPU 31 does not need to turn on the power of the magazine motor 55. Therefore, the CPU 31 initializes the power flag stored in the RAM 133 to 0 (S60), and ends this processing.

例えばt11では、実行ブロックはN02、タイマ値は0.5秒である。直近の工具交換ブロックはN03である。合計処理時間はN02のブロック処理時間の1秒である。合計処理時間からタイマ値を差し引くと、1−0.5=0.5秒となり、所定時間以下であるので(S56:YES)、CPU31はマガジンモータ55の電源を投入する(S57)。CPU31は、N03の工具交換ブロックの実行開始前に、マガジンモータ55の電源を投入できるので、工具交換装置20による工具交換を速やかに実行できる。CPU31は、RAM133に記憶する電源フラグを1に設定する(S58)。それ故、CPU31は電源フラグを参照することで、マガジンモータ55の電源の状態を常時認識できる。CPU31は本処理を終了する。   For example, at t11, the execution block is N02 and the timer value is 0.5 seconds. The latest tool change block is N03. The total processing time is one second of the block processing time of N02. When the timer value is subtracted from the total processing time, it becomes 1-0.5 = 0.5 second, which is equal to or less than the predetermined time (S56: YES), so that the CPU 31 turns on the power of the magazine motor 55 (S57). Since the power of the magazine motor 55 can be turned on before the execution of the tool change block of N03, the CPU 31 can quickly execute the tool change by the tool change device 20. The CPU 31 sets the power flag stored in the RAM 133 to 1 (S58). Therefore, the CPU 31 can always recognize the power state of the magazine motor 55 by referring to the power flag. The CPU 31 ends this processing.

例えばt12では、実行ブロックはN07、タイマ値は0.25秒である。直近の工具交換ブロックはN09である。合計処理時間は、N07とN08の夫々のブロック処理時間の合計であるので、0.5+0.25=0.75秒である。合計処理時間からタイマ値を差し引くと、0.75−0.25=0.5秒となり、所定時間以下であるので(S56:YES)、CPU31はマガジンモータ55の電源を投入する(S57)。それ故、CPU31は、N08の工具交換ブロックの実行開始前に、マガジンモータ55の電源を投入できるので、工具交換装置20による工具交換を速やかに実行できる。CPU31は、RAM133の電源フラグ記憶領域335に記憶する電源フラグを1に設定し(S58)、本処理を終了する。   For example, at t12, the execution block is N07 and the timer value is 0.25 seconds. The nearest tool change block is N09. The total processing time is the sum of the block processing times of N07 and N08, and is 0.5 + 0.25 = 0.75 seconds. When the timer value is subtracted from the total processing time, it becomes 0.75−0.25 = 0.5 seconds, which is equal to or shorter than the predetermined time (S56: YES), so that the CPU 31 turns on the power of the magazine motor 55 (S57). Therefore, the CPU 31 can turn on the power of the magazine motor 55 before the execution of the execution of the tool change block of N08, so that the tool change by the tool changer 20 can be executed quickly. The CPU 31 sets the power flag stored in the power flag storage area 335 of the RAM 133 to 1 (S58), and ends this processing.

図12を参照し、マガジンモータ電源制御処理を説明する。第二実施形態のマガジンモータ電源制御処理は、第一実施形態のマガジンモータ電源制御処理(図7参照)を変形したもので、S21の前にS101の判断処理を追加し、S21とS22の間にS102の処理を追加し、図7のS33の処理を省略している。それ故、第二実施形態では、第一実施形態と異なる部分を中心に説明する。   The magazine motor power control process will be described with reference to FIG. The magazine motor power control process of the second embodiment is a modification of the magazine motor power control process of the first embodiment (see FIG. 7). The judgment process of S101 is added before S21, and the process between S21 and S22 is performed. 7 is omitted, and the process of S33 in FIG. 7 is omitted. Therefore, in the second embodiment, a description will be given mainly of a portion different from the first embodiment.

CPU31は電源フラグが1か否か判断する(S101)。電源フラグが1の場合(S101:YES)、上述のタイマ処理において、次の工具交換ブロック実行開始の所定時間前になったことから、マガジンモータ55の電源は投入した状態である。それ故、CPU31はS101に戻って待機する。電源フラグが0の場合(S101:NO)、マガジンモータ55の電源は、タイマ処理において、次の工具交換ブロック実行開始の所定時間前になったことから投入した状態では無い。それ故、次の工具交換までの間隔が長い場合、マガジンモータ55の電源を切断する必要があるので、CPU31は第一実施形態と同様に、一ブロックを読み込み(S21)、S22以降の処理を実行する。S22の処理を実行する前に、CPU31はRAM133に記憶するタイマ値を0に初期化し、且つタイマを初期化する(S102)。それ故、CPU31は上述のタイマ処理にて、各ブロックの実行開始からの経過時間を正確に計測できる。   The CPU 31 determines whether or not the power flag is 1 (S101). If the power flag is 1 (S101: YES), the power of the magazine motor 55 is turned on since a predetermined time has elapsed before the start of the execution of the next tool change block in the above timer processing. Therefore, the CPU 31 returns to S101 and waits. When the power flag is 0 (S101: NO), the power of the magazine motor 55 is not turned on since the predetermined time before the start of the execution of the next tool change block is reached in the timer processing. Therefore, when the interval until the next tool change is long, it is necessary to cut off the power supply of the magazine motor 55, so that the CPU 31 reads one block (S21) and executes the processing from S22 onward, as in the first embodiment. Execute. Before executing the processing in S22, the CPU 31 initializes the timer value stored in the RAM 133 to 0 and initializes the timer (S102). Therefore, the CPU 31 can accurately measure the elapsed time from the start of execution of each block by the above-described timer processing.

S30にて、工具交換ブロック実行開始までの積算時間が所定時間未満の場合(S30:NO)、マガジンモータ55の電源は、図11のタイマ処理にて既に投入した状態となっているので、CPU31は何もせずに、S101に戻って処理を繰り返す。また、マガジンモータ55の電源が切断した状態で、工具交換ブロック実行開始までの積算時間が所定時間以上であって(S30:YES)、次ブロックの種類が工具交換指令である場合も(S31:YES)、マガジンモータ55の電源の制御はタイマ処理にて行うので、CPU31は何もせずに、S101に戻って処理を繰り返す。CPU31は終了指令を読み込んだ場合(S22:YES)、本処理を終了する。   In S30, if the accumulated time until the execution of the tool change block is less than the predetermined time (S30: NO), the power of the magazine motor 55 has been already turned on by the timer process of FIG. Does nothing and returns to S101 to repeat the processing. In addition, when the power of the magazine motor 55 is turned off, the accumulated time until the start of execution of the tool change block is equal to or longer than a predetermined time (S30: YES), and the type of the next block is a tool change command (S31: YES), since the power supply of the magazine motor 55 is controlled by the timer processing, the CPU 31 does nothing and returns to S101 to repeat the processing. When the CPU 31 has read the end command (S22: YES), the CPU 31 ends the process.

以上説明にて、図11のタイマ処理を実行するCPU31は本発明の投入手段の一例である。   In the above description, the CPU 31 executing the timer processing of FIG. 11 is an example of the input unit of the present invention.

以上説明したように、第二実施形態の数値制御装置30では、マガジンモータ55の電源の切断については第一実施形態と同様にブロック単位で行い、電源の投入については、工具交換ブロック実行開始の所定時間前に行うように制御する。所定時間は例えばマガジンモータ55の起動時間としてもよい。それ故、数値制御装置30は、マガジンモータ55の電源を切断した後、工具交換ブロックの実行開始より少なくともマガジンモータ55の起動に必要な起動時間前に電源を投入できる。それ故、数値制御装置30は、工具交換ブロックを読み込んだときに、マガジンモータ55を確実に起動した状態で、工具交換装置20による工具交換を実行できる。   As described above, in the numerical control device 30 of the second embodiment, the power to the magazine motor 55 is turned off in units of blocks as in the first embodiment. Control is performed so as to be performed a predetermined time before. The predetermined time may be, for example, a start time of the magazine motor 55. Therefore, after the power to the magazine motor 55 is turned off, the numerical controller 30 can turn on the power at least before a start time required for starting the magazine motor 55 after the execution of the tool change block. Therefore, when reading the tool change block, the numerical control device 30 can execute the tool change by the tool change device 20 while the magazine motor 55 is reliably started.

本発明は上記実施形態に限らず、各種変形が可能なことはいうまでもない。上記実施形態の工作機械1は、切削加工のみができる機械であるが、切削加工と旋削加工ができる複合機であってもよい。テーブル13に対してX軸、Y軸、Z軸方向に相対的に移動する工具4の移動機構の仕組みは上記実施形態に限定しない。例えば主軸9はX、Y、Z軸方向の三軸に駆動するもので、テーブル13は固定若しくは回転可能であってもよい。上記実施形態の工作機械1は主軸9がZ軸方向に対して平行な縦型の工作機械であるが、主軸が水平方向に延びる横型の工作機械であってもよい。   The present invention is not limited to the above embodiment, and it goes without saying that various modifications are possible. The machine tool 1 of the above embodiment is a machine that can only perform cutting, but may be a multifunction machine that can perform cutting and turning. The mechanism of the moving mechanism of the tool 4 that moves relatively to the table 13 in the X-axis, Y-axis, and Z-axis directions is not limited to the above embodiment. For example, the main shaft 9 is driven in three axes of X, Y, and Z axes, and the table 13 may be fixed or rotatable. The machine tool 1 of the above embodiment is a vertical machine tool in which the spindle 9 is parallel to the Z-axis direction, but may be a horizontal machine tool in which the spindle extends in the horizontal direction.

図5に示すブロック情報3311のブロック処理時間は一例であって、これらの時間に限定するものではなく、自由に変更可能である。早送り指令、切削移動指令は移動距離、移動速度、加減速時定数から演算して求めるようにしてもよい。   The block processing time of the block information 3311 illustrated in FIG. 5 is an example, and is not limited to these times, and can be freely changed. The fast-forward command and the cutting movement command may be obtained by calculating from the moving distance, the moving speed, and the acceleration / deceleration time constant.

上記実施形態の駆動回路51A〜55Aは工作機械1に設けているが、数値制御装置30に設けてもよい。   Although the drive circuits 51A to 55A of the above embodiment are provided in the machine tool 1, they may be provided in the numerical controller 30.

1 工作機械
30 数値制御装置
31 CPU
1 machine tool 30 numerical controller 31 CPU

Claims (5)

制御指令を有する複数のブロックで構成したNCプログラムに基づき、工具と被削材の相対移動により前記被削材の切削加工を行う機械の動作と、前記機械の主軸に装着する前記工具の工具交換を行う工具交換装置の動作を制御する数値制御装置において、
前記NCプログラムの読込時に、前記複数のブロックの夫々の処理時間と、前記複数のブロックの夫々の前記制御指令の種類とを判定する判定手段と、
前記判定手段が判定した前記複数のブロックの夫々の前記処理時間と前記種類の情報であるブロック情報を記憶する記憶手段と、
前記NCプログラムの実行開始後、前記記憶手段が記憶した前記ブロック情報に基づき、現在実行を開始するブロックである実行ブロック以降で且つ直近のブロックであって、前記工具交換を指示する前記制御指令である工具交換指令を有する工具交換ブロックを検索する検索手段と、
前記実行ブロックの実行開始から前記検索手段が検索した前記工具交換ブロックの実行開始までの各ブロックの前記処理時間を積算する積算手段と、
前記積算手段が積算した前記処理時間が所定時間以上の場合、前記工具交換装置を駆動するモータの電源を切断する切断手段と
を備えたこと
を特徴とする数値制御装置。
An operation of a machine for cutting the work material by a relative movement between the tool and the work material based on an NC program composed of a plurality of blocks having control commands, and a tool change of the tool mounted on a main shaft of the machine. In the numerical control device that controls the operation of the tool changer that performs
A determination unit configured to determine a processing time of each of the plurality of blocks and a type of the control command of each of the plurality of blocks when reading the NC program;
Storage means for storing the processing time of each of the plurality of blocks determined by the determination means and block information which is information of the type,
After the start of the execution of the NC program, based on the block information stored in the storage means, a block immediately after the execution block that is a block to start the execution and the latest block, and the Search means for searching for a tool change block having a certain tool change command,
Integration means for integrating the processing time of each block from the start of execution of the execution block to the start of execution of the tool change block searched by the search means,
A cutting means for cutting off a power supply of a motor for driving the tool changing device when the processing time accumulated by the integrating means is equal to or longer than a predetermined time.
前記切断手段が前記モータの電源を切断した後、前記工具交換ブロックの実行開始より少なくとも前記モータの起動に必要な起動時間前に、前記モータの電源を投入する投入手段を備えたこと
を特徴とする請求項1に記載の数値制御装置。
After the cutting means cuts off the power of the motor, an input means for turning on the power of the motor is provided at least before a start time required for starting the motor from execution of the tool change block. The numerical control device according to claim 1.
前記投入手段は、
前記工具交換ブロックの実行開始よりも前記起動時間前のブロックの実行開始前に前記電源を投入すること
を特徴とする請求項2に記載の数値制御装置。
The input means,
3. The numerical control device according to claim 2, wherein the power supply is turned on before execution of the block before the start time of execution of the tool change block is started.
前記所定時間は、少なくとも前記モータの起動に必要な起動時間よりも長く、
前記切断手段は、
前記積算手段が積算した前記処理時間が前記所定時間未満の場合、前記モータの電源を切断しないこと
を特徴とする請求項1から3の何れかに記載の数値制御装置。
The predetermined time is longer than at least a start time required for starting the motor,
The cutting means,
4. The numerical controller according to claim 1, wherein the power of the motor is not turned off when the processing time integrated by the integrating means is shorter than the predetermined time.
制御指令を有する複数のブロックで構成したNCプログラムに基づき、工具と被削材の相対移動により前記被削材の切削加工を行う機械の動作と、前記機械の主軸に装着する前記工具の工具交換を行う工具交換装置の動作を制御する数値制御装置の制御方法において、
前記NCプログラムの読込時に、前記複数のブロックの夫々の処理時間と、前記複数のブロックの夫々の前記制御指令の種類とを判定する判定工程と、
前記判定工程で判定した前記複数のブロックの夫々の前記処理時間と前記種類の情報であるブロック情報を記憶する記憶工程と、
前記NCプログラムの実行開始後、前記記憶工程で記憶した前記ブロック情報に基づき、現在実行を開始するブロックである実行ブロック以降で且つ直近のブロックであって、前記工具交換を指示する前記制御指令である工具交換指令を有する工具交換ブロックを検索する検索工程と、
前記実行ブロックの実行開始から前記検索工程で検索した前記工具交換ブロックの実行開始までの各ブロックの前記処理時間を積算する積算工程と、
前記積算工程で積算した前記処理時間が所定時間以上の場合、前記工具交換装置を駆動するモータの電源を切断する切断工程と
を備えたこと
を特徴とする制御方法。
An operation of a machine for cutting the work material by a relative movement between the tool and the work material based on an NC program composed of a plurality of blocks having control commands, and a tool change of the tool mounted on a main shaft of the machine. In a control method of a numerical control device that controls the operation of a tool changer that performs
A determination step of determining a processing time of each of the plurality of blocks and a type of the control command of each of the plurality of blocks when reading the NC program;
A storage step of storing the processing time of each of the plurality of blocks determined in the determination step and block information that is the type of information,
After the start of the execution of the NC program, based on the block information stored in the storage step, based on the control command for instructing the tool change, which is a block immediately after the execution block that is a block to start the execution and is the latest block. A search step of searching for a tool change block having a certain tool change command;
An integration step of integrating the processing time of each block from the start of execution of the execution block to the start of execution of the tool change block searched in the search step,
A cutting step of cutting off a power supply of a motor for driving the tool changing device when the processing time integrated in the integrating step is equal to or longer than a predetermined time.
JP2016077854A 2016-04-08 2016-04-08 Numerical control device and control method Active JP6665645B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2016077854A JP6665645B2 (en) 2016-04-08 2016-04-08 Numerical control device and control method
CN201710225651.4A CN107272575B (en) 2016-04-08 2017-04-07 Numerical control device and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016077854A JP6665645B2 (en) 2016-04-08 2016-04-08 Numerical control device and control method

Publications (2)

Publication Number Publication Date
JP2017188005A JP2017188005A (en) 2017-10-12
JP6665645B2 true JP6665645B2 (en) 2020-03-13

Family

ID=60044966

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016077854A Active JP6665645B2 (en) 2016-04-08 2016-04-08 Numerical control device and control method

Country Status (2)

Country Link
JP (1) JP6665645B2 (en)
CN (1) CN107272575B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6680811B2 (en) * 2018-01-26 2020-04-15 ファナック株式会社 Processing time prediction device
JP6569825B1 (en) * 2018-07-10 2019-09-04 三菱電機株式会社 Numerical controller
JP2020201982A (en) * 2020-08-31 2020-12-17 ファナック株式会社 Operation management device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002023803A (en) * 2000-07-07 2002-01-25 Nisshinbo Ind Inc Control method for power saving
JP4193050B2 (en) * 2003-07-16 2008-12-10 株式会社ジェイテクト Servo drive device and control method thereof
JP2010176503A (en) * 2009-01-30 2010-08-12 Fanuc Ltd Machine tool and working system provided with robot which performs work to the machine tool
WO2012043786A1 (en) * 2010-10-01 2012-04-05 シチズンホールディングス株式会社 Power-supply management device and machine tool provided with power-supply management device
JP5482639B2 (en) * 2010-12-13 2014-05-07 ブラザー工業株式会社 Numerical control device, control program, and storage medium
JP5556656B2 (en) * 2010-12-28 2014-07-23 ブラザー工業株式会社 Numerical control machine tool, control program, and storage medium
DE112011104784T5 (en) * 2011-01-26 2013-10-31 Mitsubishi Electric Corporation Numerical control device
WO2013118241A1 (en) * 2012-02-06 2013-08-15 三菱電機株式会社 Numeric control device
DE102012111230A1 (en) * 2012-11-21 2014-05-22 Mag Ias Gmbh Method for controlling tool changing operations and machine tool
KR20140080845A (en) * 2012-12-20 2014-07-01 두산인프라코어 주식회사 Method for contolling power saving of numerical control machine

Also Published As

Publication number Publication date
CN107272575A (en) 2017-10-20
JP2017188005A (en) 2017-10-12
CN107272575B (en) 2019-07-09

Similar Documents

Publication Publication Date Title
JP6665645B2 (en) Numerical control device and control method
JP5482639B2 (en) Numerical control device, control program, and storage medium
JP6299527B2 (en) Numerical control device and control method
US20060041325A1 (en) Numerical control unit
JP6398254B2 (en) Numerical control device and control method of numerical control device
JP6651815B2 (en) Numerical control device and control method of numerical control device
JP5014515B1 (en) Numerical controller
JP2014048761A (en) Numerical control device
JP2016189039A (en) Numerical control device and control method
JP6255885B2 (en) Numerical controller
JP6693409B2 (en) Numerical control device and control method
JP5136853B2 (en) Numerically controlled machine tool and control program for numerically controlled machine tool
JP2016085650A (en) Numeral control device and control method
JP7035875B2 (en) Numerical control device, numerical control method, and numerical control program
JP2009237929A (en) Numerical controller, control program for numerical controller, and recording medium for numerical controller
JP5669993B1 (en) Numerical controller
JP2010234449A (en) Tool changer
JP2002001632A (en) Control device for automatic lathe
JP6028573B2 (en) Control system, machine tool, servo motor control device, and position information transmission / reception method
JP2012011492A (en) Tool arrangement computing device, tool arrangement computing program, and storage medium
JP6887048B1 (en) Machine tools, machine tool control methods, and machine tool control programs
JP2007233575A (en) Numerical controller and control method for machine tool
WO2023189525A1 (en) Numerical control device, control method, and program
US11003171B2 (en) Parameter setting device, system, and parameter setting method
JP2022131354A (en) Vibration suppression method, vibration suppression device, and machine tool

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190322

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200203

R150 Certificate of patent or registration of utility model

Ref document number: 6665645

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150