Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5327082B2 - Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium - Google Patents
[go: Go Back, main page]

JP5327082B2 - Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium - Google Patents

Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium Download PDF

Info

Publication number
JP5327082B2
JP5327082B2 JP2010016120A JP2010016120A JP5327082B2 JP 5327082 B2 JP5327082 B2 JP 5327082B2 JP 2010016120 A JP2010016120 A JP 2010016120A JP 2010016120 A JP2010016120 A JP 2010016120A JP 5327082 B2 JP5327082 B2 JP 5327082B2
Authority
JP
Japan
Prior art keywords
tool
switching
arrangement
calculating
pot
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
JP2010016120A
Other languages
Japanese (ja)
Other versions
JP2011152616A (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 JP2010016120A priority Critical patent/JP5327082B2/en
Publication of JP2011152616A publication Critical patent/JP2011152616A/en
Application granted granted Critical
Publication of JP5327082B2 publication Critical patent/JP5327082B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Automatic Tool Replacement In Machine Tools (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a tool arrangement computing device capable of surely computing an arrangement of tools with the minimum number of times of changing over tool magazines, a control program of the tool arrangement computing device, and a storage medium. <P>SOLUTION: The number R of times of changing over tool pots is calculated for all of tool arrangements of a plurality of tools to be used in an NC program of a numerically controlled device (S13-S19). The tool arrangement with the minimum number of changeover calculated for all of the tool arrangements is specified as the optimum tool arrangement (S21). Since the number of times of changeover of all of the tool arrangements is calculated, the tool arrangement with the minimum number of changeover can be surely calculated. <P>COPYRIGHT: (C)2011,JPO&amp;INPIT

Description

本発明は、タレット式の工具マガジンにおける工具の配置を算出できる工具配置算出装置、工具配置算出装置の制御プログラムおよび記憶媒体に関する。   The present invention relates to a tool arrangement calculation device capable of calculating the arrangement of tools in a turret type tool magazine, a control program for the tool arrangement calculation device, and a storage medium.

従来、タレット式の工具マガジンを備えた工具交換装置が知られている。この工具交換装置では、NCプログラム中に工具交換指令があると、その指令された工具番号のポット番号に工具マガジンが旋回する。例えば14本工具の工具マガジンの場合、現在主軸に装着されている現工具がポット1で、次工具がポット8であれば、工具マガジンは7回旋回して位置を切り替える。この切り替える回数(以下、切替回数と呼ぶ)が最小となるように、工具マガジンにおける工具配置を行うことで、工具交換時間を短縮できる。例えば、NCプログラム中に指令される工具交換指令を読み取り、最も多い工具交換の組合せの工具を優先的に隣のポットに並べ、残りの工具はNCプログラム中の指令順に並べる方法が提案されている(例えば、特許文献1参照)。   Conventionally, a tool changer provided with a turret type tool magazine is known. In this tool changer, when there is a tool change command in the NC program, the tool magazine turns to the pot number of the commanded tool number. For example, in the case of a tool magazine of 14 tools, if the current tool currently mounted on the spindle is pot 1 and the next tool is pot 8, the tool magazine rotates seven times and switches positions. Tool replacement time can be shortened by arranging the tools in the tool magazine so that the number of times of switching (hereinafter referred to as the number of times of switching) is minimized. For example, a method has been proposed in which a tool change command that is commanded in the NC program is read, the most frequently used tool change combinations are preferentially arranged in the adjacent pot, and the remaining tools are arranged in the order of the commands in the NC program. (For example, refer to Patent Document 1).

特開平5−269635号公報JP-A-5-269635

しかしながら、特許文献1に記載の方法では、工具配置の全パターンの全組合せを考慮していないので、プログラム中の工具使用順序によっては、切替回数が最小となる工具配置を算出できない場合が生ずるという問題点があった。   However, since the method described in Patent Document 1 does not consider all combinations of all patterns of tool arrangement, it may not be possible to calculate the tool arrangement that minimizes the number of times of switching depending on the tool usage order in the program. There was a problem.

本発明は、上記課題を解決するためになされたものであり、工具マガジンの切替回数が最小となる工具配置を確実に算出できる工具配置算出装置、工具配置算出装置の制御プログラムおよび記憶媒体を提供することを目的とする。   The present invention has been made to solve the above-described problems, and provides a tool placement calculation device, a tool placement calculation device control program, and a storage medium that can reliably calculate a tool placement that minimizes the number of times of switching between tool magazines. The purpose is to do.

本発明の第1態様に係る工具配置算出装置は、工作機械の工具交換装置に回転割り出し可能に設けられ、正転又は反転する略円盤状の工具マガジンの外周に設けられた複数のポットに各々配置される複数の工具の配置を算出する工具配置算出装置であって、前記工作機械の加工プログラムから工具交換指令を読み込む工具交換指令読込手段と、当該工具交換指令読込手段によって読み込まれた前記工具交換指令より、前記加工プログラムで使用される使用工具を特定する使用工具特定手段と、当該使用工具特定手段によって特定された前記使用工具の配置の全ての組合せを算出する配置組合せ算出手段と、当該配置組合せ算出手段によって算出された各組合せの配置で、前記加工プログラムで指令された順番で前記使用工具を使用した場合に、前記ポットの切り替えに必要な切替回数を、前記組合せ毎に計数する切替回数計数手段と、当該切替回数計数手段によって前記組合せ毎に計数された複数の前記切替回数の中から、最も少ない切替回数である最小回数を特定する最小回数特定手段と、当該最小回数特定手段によって特定された前記最小回数に対応する前記組合せの配置の情報である配置情報を出力する配置情報出力手段とを備えている。   A tool arrangement calculation device according to a first aspect of the present invention is provided in a tool changer of a machine tool so as to be able to perform rotation indexing, and each of a plurality of pots provided on an outer periphery of a substantially disk-shaped tool magazine that rotates forward or reverse. A tool arrangement calculation device for calculating an arrangement of a plurality of tools to be arranged, the tool exchange command reading means for reading a tool exchange command from a machining program of the machine tool, and the tool read by the tool exchange command reading means From an exchange command, a used tool specifying means for specifying a used tool used in the machining program, an arrangement combination calculating means for calculating all combinations of the used tools specified by the used tool specifying means, When the tools used are used in the order instructed by the machining program in the arrangement of each combination calculated by the arrangement combination calculating means. The switching number counting means for counting the number of switching necessary for the pot switching for each combination, and the smallest number of switching times among the plurality of switching times counted for each combination by the switching number counting means. There is provided a minimum number specifying means for specifying a certain minimum number of times, and an arrangement information output means for outputting arrangement information that is information on the arrangement of the combination corresponding to the minimum number of times specified by the minimum number of times specifying means.

第1態様では、まず、工具交換指令読込手段が、工作機械の加工プログラムから工具交換指令を読み込む。次いで、使用工具特定手段が、工具交換指令読込手段によって読み込まれた工具交換指令より、加工プログラムで使用される使用工具を特定する。さらに、配置組合せ算出手段が、使用工具特定手段によって特定された使用工具の配置の全ての組合せを算出する。次に、切替回数計数手段が、配置組合せ算出手段によって算出された各組合せの配置で、加工プログラムで指令された順番で使用工具を使用した場合に、ポットの切り替えに必要な切替回数を、組合せ毎に計数する。さらに、最小回数特定手段が、切替回数計数手段によって前記組合せ毎に計数された複数の前記切替回数の中から、最も少ない切替回数である最小回数を特定する。そして、配置情報出力手段が、最小回数特定手段によって特定された最小回数に対応する組合せの配置の情報である配置情報を出力する。このように、使用工具の配置の全ての組合せの配置について、ポットの切替回数を組合せ毎にそれぞれ計数し、その中から最小回数を特定しているので、工具マガジンの旋回回数が最小となる工具の配置を確実に算出できる。さらに、その配置に関する配置情報を出力できるので、作業者は出力された配置情報を元に、工具の配置を行うことができる。   In the first aspect, first, the tool change command reading means reads a tool change command from the machining program of the machine tool. Next, the used tool specifying means specifies the used tool used in the machining program from the tool change command read by the tool change command reading means. Further, the arrangement combination calculating means calculates all combinations of the used tool arrangements specified by the used tool specifying means. Next, when the switching number counting means uses the tools used in the order instructed by the machining program in the arrangement of each combination calculated by the arrangement combination calculating means, the number of times required for switching the pot is combined. Count every time. Further, the minimum number specifying means specifies the minimum number that is the smallest number of switching times from among the plurality of switching times counted for each combination by the switching number counting means. Then, the arrangement information output means outputs arrangement information which is arrangement information of a combination corresponding to the minimum number specified by the minimum number specifying means. In this way, with respect to the arrangement of all combinations of the tools used, the number of pot switching is counted for each combination, and the minimum number is specified from among them. Can be calculated reliably. Furthermore, since the arrangement information regarding the arrangement can be output, the operator can arrange the tools based on the outputted arrangement information.

また、第1態様において、前記切替回数は、前記加工プログラムで指令される最後の使用工具のポットから最初の使用工具のポットに切り替えるために必要な切替回数を含んでもよい。同じワークを複数切削する場合、同じ切削工程を繰り返し行うが、この場合、加工プログラムを繰り返し実行する。つまり、加工プログラムで指令される最後の使用工具のポットから最初の使用工具のポットに切り替えることが必要となる。そこで、このときの切替回数を考慮することで、同じ切削工程を繰り返し行うケースを想定した場合でも、工具マガジンの旋回回数が最小となる工具の配置を確実に算出できる。   In the first aspect, the number of times of switching may include the number of times of switching necessary for switching from the pot of the last tool used to be commanded by the machining program to the pot of the first tool used. In the case of cutting a plurality of the same workpiece, the same cutting process is repeated. In this case, the machining program is repeatedly executed. That is, it is necessary to switch from the pot of the last used tool commanded by the machining program to the pot of the first used tool. Therefore, by considering the number of times of switching at this time, even when a case where the same cutting process is repeatedly performed is assumed, it is possible to reliably calculate the arrangement of the tools that minimizes the number of times the tool magazine turns.

また、第1態様において、前記使用工具の予備として使用され、前記使用工具とは別のポットに配置される予備工具を登録する予備工具登録手段を備え、当該予備工具登録手段によって前記予備工具が登録されている場合、前記配置組合せ算出手段は、前記使用工具特定手段によって特定された前記使用工具及び前記予備工具の配置の全ての組合せを算出し、前記切替回数計数手段は、前記予備工具を使用しない場合の前記切替回数である第1切替回数と、前記予備工具を前記使用工具の代わりに使用した場合の前記切替回数である第2切替回数とを、前記組合せ毎にそれぞれ計数し、前記最小回数特定手段は、前記第1切替回数と前記第2切替回数との和である第1総切替回数を前記組合せ毎に算出する第1総切替回数算出手段を備え、当該第1総切替回数算出手段によって前記組合せ毎に算出された前記第1総切替回数のうち、最小の回数を特定するようにしてもよい。これにより、使用工具に代えて予備工具を途中で使用するケースを想定した場合でも、工具マガジンの旋回回数が最小となる工具の配置を確実に算出できる。   Further, in the first aspect, there is provided spare tool registration means for registering a spare tool used as a spare for the used tool and arranged in a pot different from the used tool, and the spare tool is registered by the spare tool registration means. When registered, the arrangement combination calculating means calculates all combinations of the use tool and the spare tool arrangement specified by the use tool specifying means, and the switching number counting means calculates the spare tool. A first switching number that is the number of times of switching when not used and a second switching number that is the number of times of switching when the spare tool is used instead of the tool used are counted for each combination, The minimum number specifying means includes first total switching number calculating means for calculating a first total switching number that is the sum of the first switching number and the second switching number for each combination. One of the first total number of switching actions calculated for each of said combinations by a first total number of switching actions calculating means, may be specified a minimum number of. Accordingly, even when a case in which a spare tool is used on the way instead of the tool used is assumed, it is possible to reliably calculate the arrangement of the tools that minimizes the number of times the tool magazine is turned.

また、第1態様において、前記工具交換指令読込手段によって、複数の加工プログラムから前記工具交換指令が各々読み込まれた場合、前記切替回数計数手段は、前記加工プログラム毎の前記切替回数を前記組合せ毎にそれぞれ計数し、前記最小回数特定手段は、前記加工プログラム毎に計数された前記切替回数の和である第2総切替回数を前記組合せ毎に算出する第2総切替回数算出手段を備え、当該第2総切替回数算出手段によって前記組合せ毎に算出された前記第2総切替回数のうち、最小の回数を特定するようにしてもよい。加工プログラムが複数ある場合、各プログラムによって工具の使用順序が異なっていることが多い。そこで、上記構成とすることで、複数のプログラムを実行するケースを想定した場合でも、工具マガジンの旋回回数が最小となる工具の配置を確実に算出できる。   Further, in the first aspect, when the tool change command is read from a plurality of machining programs by the tool change command reading unit, the switching number counting unit calculates the switching number for each machining program for each combination. And the minimum number specifying means comprises second total switching number calculating means for calculating, for each combination, a second total switching number that is the sum of the switching times counted for each machining program, You may make it specify the minimum frequency among the said 2nd total switching frequency calculated for every said combination by the 2nd total switching frequency calculation means. When there are a plurality of machining programs, the order in which the tools are used is often different for each program. Therefore, with the above configuration, even when a case in which a plurality of programs are executed is assumed, the arrangement of tools that minimizes the number of times of turning of the tool magazine can be reliably calculated.

また、第1態様において、前記使用工具の本数である使用工具本数をNとした場合、前記配置組合せ算出手段は、N!を算出することによって、前記組合せの数を導出するようにしてもよい。N!を算出すれば、前記組合せの数を簡単に導出できるので、組合せ算出の処理を速やかに実行できる。   Further, in the first aspect, when the number of tools used, which is the number of tools used, is N, the arrangement combination calculating means is N! The number of combinations may be derived by calculating. N! Since the number of the combinations can be easily derived, the combination calculation process can be executed quickly.

また、第1態様において、前記工具マガジンの前記ポットの数と、前記使用工具本数とが同じ場合、前記配置組合せ算出手段は、(N−1)!/2を算出することによって、前記組合せの数を導出するようにしてもよい。これにより、前記組合せの数をさらに簡単に導出できるので、組合せ算出の処理をより速やかに実行できる。なお、「!」は階乗を意味する。   In the first aspect, when the number of the pots in the tool magazine is the same as the number of used tools, the arrangement combination calculating means is (N-1)! The number of combinations may be derived by calculating / 2. As a result, the number of the combinations can be more easily derived, and the combination calculation process can be executed more quickly. “!” Means factorial.

また、第1態様において、前記工具マガジンを正転させるか反転させるかを決定する回転方向決定手段を備え、前記使用工具は、前記工具マガジンの外周に沿って正転方向に配置され、前記工具マガジンの前記ポットの数をPとし、使用中の工具のポットから次に使用する工具のポットに切り替えるために必要な切替回数をKとした場合において、K≧(P/2)+1となるときは、前記回転方向決定手段は、前記工具マガジンを反転させることを決定するようにしてもよい。これにより、工具マガジンを正転、又は反転させることによって、現ポットから次のポットに最小の切替回数で切り替えることができる。   Further, in the first aspect, the apparatus further comprises a rotation direction determining means for determining whether the tool magazine is rotated normally or reversed, and the tool used is arranged in a normal rotation direction along an outer periphery of the tool magazine. When the number of pots in the magazine is P and the number of times of switching required to switch from the pot of the tool being used to the pot of the next tool to be used is K, K ≧ (P / 2) +1 The rotation direction determination means may determine to invert the tool magazine. As a result, the tool magazine can be switched from the current pot to the next pot with the minimum number of times of switching by rotating or reversing the tool magazine.

また、第1態様において、前記工作機械に、ワークを支持する台が回転する回転テーブルが設置されているか否かを判断する回転テーブル設置判断手段と、当該回転テーブル設置判断手段によって前記回転テーブルが設置されていると判断された場合、前記切替回数計数手段は、前記切替回数には、前記加工プログラムで指令される最後の使用工具のポットから最初の使用工具のポットに切り替えるために必要な切替回数を含めないようにしてもよい。回転テーブルを使用する場合、例えば、一端側に固定されたワークに加工を施している間に、次に加工するワークを他端側に取り付ける等の作業ができる。このような回転テーブルでは、一方のワークの加工が終了した後、回転テーブルが回転している最中に、最初に使用する工具への交換が可能であるので、加工プログラムで指令される最後の使用工具のポットから最初の使用工具のポットに切り替えるために必要な切替回数を含めないようにすることができる。これにより、切替回数計数手段の処理量を減らすことができるので、切替回数を速やかに計数することができる。   Moreover, in the first aspect, the rotary table is determined by the rotary table installation determining means for determining whether or not a rotary table on which a table for supporting a workpiece rotates is installed on the machine tool. When it is determined that the tool is installed, the switching number counting means switches the number of switching necessary for switching from the pot of the last used tool to the pot of the first used tool instructed by the machining program. The number of times may not be included. When the rotary table is used, for example, a work to be processed next can be attached to the other end side while the work fixed to the one end side is being processed. In such a rotary table, since the tool to be used first can be replaced while the rotary table is rotating after the machining of one workpiece is completed, the last command commanded by the machining program is possible. It is possible not to include the number of times of switching necessary to switch from the pot of the used tool to the pot of the first used tool. Thereby, since the processing amount of the switching frequency counting means can be reduced, the switching frequency can be counted quickly.

本発明の第2態様に係る工具配置算出装置の制御プログラムは、工作機械の工具交換装置に設けられ、正転又は反転する略円盤状の工具マガジンの外周に設けられた複数のポットに各々配置される複数の工具の配置を算出する工具配置算出装置を機能させる工具配置算出装置の制御プログラムであって、前記工作機械の加工プログラムから工具交換指令を読み込む工具交換指令読込ステップと、当該工具交換指令読込ステップにおいて読み込まれた前記工具交換指令より、前記加工プログラムで使用される使用工具を特定する使用工具特定ステップと、当該使用工具特定ステップにおいて特定された前記使用工具の配置の全ての組合せを算出する配置組合せ算出ステップと、当該配置組合せ算出ステップにおいて算出された各組合せの配置で、前記加工プログラムで指令された順番で前記使用工具を使用した場合に、前記ポットの切り替えに必要な切替回数を、前記組合せ毎に計数する切替回数計数ステップと、当該切替回数計数ステップにおいて前記組合せ毎に計数された複数の前記切替回数の中から、最も少ない切替回数である最小回数を特定する最小回数特定ステップと、当該最小回数特定ステップにおいて特定された前記最小回数に対応する前記組合せの配置の情報である配置情報を出力する配置情報出力ステップとを備えている。   The control program of the tool arrangement calculating device according to the second aspect of the present invention is provided in a tool changer of a machine tool, and is arranged in each of a plurality of pots provided on the outer periphery of a substantially disk-shaped tool magazine that rotates forward or reverse. A tool placement calculation device control program for causing a tool placement calculation device to calculate the placement of a plurality of tools to be executed, the tool change command reading step for reading a tool change command from the machining program of the machine tool, and the tool change Based on the tool change command read in the command reading step, all combinations of the used tool specifying step for specifying the used tool used in the machining program and the arrangement of the used tool specified in the used tool specifying step are included. An arrangement combination calculation step to calculate, and an arrangement of each combination calculated in the arrangement combination calculation step. When the tools used are used in the order commanded by the machining program, the number of times of switching required for the pot switching is counted for each combination. A minimum number specifying step for specifying a minimum number of times that is the smallest number of switching times from among the plurality of times of switching counted in the above, and an arrangement of the combination corresponding to the minimum number specified in the minimum number specifying step An arrangement information output step for outputting arrangement information as information.

第2態様では、まず、工具交換指令読込ステップにおいて、工作機械の加工プログラムから工具交換指令を読み込む。次いで、使用工具特定ステップにおいて、工具交換指令読込ステップにて読み込まれた工具交換指令より、加工プログラムで使用される使用工具を特定する。さらに、配置組合せ算出ステップにおいて、使用工具特定ステップにて特定された使用工具の配置の全ての組合せを算出する。次に、切替回数計数ステップにおいて、配置組合せ算出ステップにて算出された各組合せの配置で、加工プログラムで指令された順番で使用工具を使用した場合に、ポットの切り替えに必要な切替回数を、組合せ毎に計数する。さらに、最小回数特定ステップにおいて、切替回数計数ステップにて前記組合せ毎に計数された複数の前記切替回数の中から、最も少ない切替回数である最小回数を特定する。そして、配置情報出力ステップにおいて、最小回数特定ステップにて特定された最小回数に対応する組合せの配置の情報である配置情報を出力する。このように、使用工具の配置の全ての組合せの配置について、ポットの切替回数を組合せ毎にそれぞれ計数し、その中から最小回数を特定しているので、工具マガジンの旋回回数が最小となる工具の配置を確実に算出できる。さらに、その配置に関する配置情報を出力できるので、作業者は出力された配置情報を元に、工具の配置を行うことができる。   In the second mode, first, in the tool change command reading step, a tool change command is read from the machining program of the machine tool. Next, in the used tool specifying step, the used tool used in the machining program is specified from the tool change command read in the tool change command reading step. Further, in the arrangement combination calculating step, all combinations of the used tool arrangement specified in the used tool specifying step are calculated. Next, in the switching count counting step, when using the tools in the order instructed by the machining program in the arrangement of each combination calculated in the arrangement combination calculating step, the number of switching required for pot switching is Count for each combination. Further, in the minimum number specifying step, the minimum number that is the smallest number of switching times is specified from the plurality of switching times counted for each combination in the switching number counting step. Then, in the arrangement information output step, arrangement information which is arrangement information of a combination corresponding to the minimum number specified in the minimum number specifying step is output. In this way, with respect to the arrangement of all combinations of the tools used, the number of pot switching is counted for each combination, and the minimum number is specified from among them. Can be calculated reliably. Furthermore, since the arrangement information regarding the arrangement can be output, the operator can arrange the tools based on the outputted arrangement information.

本発明の第3態様に係る記憶媒体は、請求項9に記載の制御プログラムを記憶したコンピュータ読み取り可能な記憶媒体である。   A storage medium according to a third aspect of the present invention is a computer-readable storage medium storing the control program according to claim 9.

第3態様は、請求項9に記載の制御プログラムを記憶しているので、請求項9に記載の効果を得ることができる。   Since the third aspect stores the control program according to the ninth aspect, the effect according to the ninth aspect can be obtained.

工作機械1の正面図である。1 is a front view of a machine tool 1. スプラッシュカバーを取り外した工作機械1の斜視図である。It is a perspective view of the machine tool 1 which removed the splash cover. 工具マガジン31の工具配置の一例を示した図である。FIG. 4 is a diagram showing an example of tool arrangement of a tool magazine 31. ディスプレイ11にNCプログラムが表示された状態を示す図である。It is a figure which shows the state by which the NC program was displayed on the display. ディスプレイ11に工具配置表120が表示された状態を示す図である。It is a figure which shows the state by which the tool arrangement | sequence table 120 was displayed on the display 11. 数値制御装置20の電気的構成を示すブロック図である。3 is a block diagram showing an electrical configuration of a numerical control device 20. FIG. RAM23の各記憶領域を示す概念図である。3 is a conceptual diagram showing each storage area of a RAM 23. FIG. フラッシュメモリ24の各記憶領域を示す概念図である。2 is a conceptual diagram showing each storage area of a flash memory 24. FIG. ポット切替テーブル2421の概念図である。22 is a conceptual diagram of a pot switching table 2421. FIG. CPU21によるメイン処理のフローチャートである。It is a flowchart of the main process by CPU21. CPU21による工具配置算出処理のフローチャートである。It is a flowchart of the tool arrangement | positioning calculation process by CPU21. 工具配置Qの全組合わせを示した図である。It is the figure which showed all the combinations of the tool arrangement | positioning Q. FIG. 工具マガジン31の工具配置の一例を示した図(第2実施形態)である。It is the figure which showed an example of the tool arrangement | positioning of the tool magazine 31 (2nd Embodiment). ディスプレイ11にNCプログラムが表示された状態を示す図(第2実施形態)である。It is a figure which shows the state by which the NC program was displayed on the display 11 (2nd Embodiment). フラッシュメモリ124の各記憶領域を示した概念図である。3 is a conceptual diagram showing each storage area of a flash memory 124. FIG. ポット切替テーブル2521の概念図である。22 is a conceptual diagram of a pot switching table 2521. FIG. 予備工具テーブル2431の概念図である。5 is a conceptual diagram of a spare tool table 2431. FIG. NCプログラム1,2を示した図である。It is the figure which showed NC program 1 and 2. 工作機械90の斜視図である。1 is a perspective view of a machine tool 90. FIG. フラッシュメモリ224の各記憶領域を示した概念図である。2 is a conceptual diagram showing each storage area of a flash memory 224. FIG. CPUによる工具配置算出処理のフローチャート(第4実施形態)である。It is a flowchart (4th Embodiment) of the tool arrangement | positioning calculation process by CPU.

以下、本発明の第1実施形態である数値制御装置20(図6参照)について、図面を参照して説明する。数値制御装置20は、図1,図2に示す工作機械1の動作を制御するものである。工作機械1は、ワークと工具Tとを相対移動させることで、ワークに所望の切削加工を施すための機械である。なお、数値制御装置20は、本発明の「工具配置算出装置」に相当する。   Hereinafter, a numerical controller 20 (see FIG. 6) according to a first embodiment of the present invention will be described with reference to the drawings. The numerical control device 20 controls the operation of the machine tool 1 shown in FIGS. The machine tool 1 is a machine for performing a desired cutting process on a workpiece by moving the workpiece and the tool T relative to each other. The numerical control device 20 corresponds to the “tool arrangement calculating device” of the present invention.

工作機械1の構造について簡単に説明する。図1に示すように、工作機械1は、鉄製のベース2と、該ベース2の上部に設けられ、ワークに切削加工を施す機械本体3(図2参照)と、ベース2の上部に固定され、機械本体3の周囲を取り囲むスプラッシュカバー4とを備えている。スプラッシュカバー4の正面には長方形状の開口5が設けられ、該開口5にはスライド式の開閉扉6が設けられている。開口5の右側には、工作機械1を操作するための操作パネル10が設けられている。操作パネル10の上部には、各種設定画面、操作画面等が表示されるディスプレイ11が設けられている。操作パネル10の下部には、各種操作キーを備えたキーボード12が設けられている。   The structure of the machine tool 1 will be briefly described. As shown in FIG. 1, a machine tool 1 is fixed to an iron base 2, a machine body 3 (see FIG. 2) that is provided on an upper part of the base 2, and cuts a workpiece, and is fixed to an upper part of the base 2. A splash cover 4 surrounding the periphery of the machine body 3. A rectangular opening 5 is provided in front of the splash cover 4, and a sliding opening / closing door 6 is provided in the opening 5. An operation panel 10 for operating the machine tool 1 is provided on the right side of the opening 5. A display 11 on which various setting screens, operation screens, and the like are displayed is provided on the upper portion of the operation panel 10. A keyboard 12 having various operation keys is provided at the lower part of the operation panel 10.

図2に示すように、機械本体3は、ベース2の上部後方に立設したコラム15と、該コラム15に沿って昇降可能に設けられた主軸ヘッド16と、該主軸ヘッド16の下部に回転可能に支持された主軸17と、ベース2の上部中央に設置され、XY軸方向に移動可能に支持されたテーブル19とを備えている。主軸ヘッド16は、Z軸モータ53(図6参照)の駆動によって、Z軸方向に移動される。主軸17は、主軸モータ54(図6参照)の駆動によって回転される。テーブル19は、X軸モータ51(図6参照)、Y軸モータ52(図6参照)、ガイド機構(図示省略)によって、XY軸方向に移動される。なお、X軸方向は、図1の左右方向であり、Y軸方向は、図1の表面背面方向であり、Z軸方向は、図1の上下方向である。   As shown in FIG. 2, the machine body 3 includes a column 15 erected on the upper rear side of the base 2, a spindle head 16 that can be moved up and down along the column 15, and a lower part of the spindle head 16. A main shaft 17 that can be supported, and a table 19 that is installed at the center of the upper portion of the base 2 and is supported so as to be movable in the XY-axis directions. The spindle head 16 is moved in the Z-axis direction by driving a Z-axis motor 53 (see FIG. 6). The main shaft 17 is rotated by driving a main shaft motor 54 (see FIG. 6). The table 19 is moved in the XY-axis direction by an X-axis motor 51 (see FIG. 6), a Y-axis motor 52 (see FIG. 6), and a guide mechanism (not shown). The X-axis direction is the left-right direction in FIG. 1, the Y-axis direction is the front-rear direction in FIG. 1, and the Z-axis direction is the up-down direction in FIG.

主軸ヘッド16の前側には、主軸17に装着された工具Tを自動的に交換できるタレット式の工具交換装置30が設けられている。コラム15の背面側には制御ボックス18が設けられている。制御ボックス18の内側には、工作機械1の動作を制御する数値制御装置20(図6参照)が格納されている。   A turret type tool changer 30 that can automatically change the tool T attached to the spindle 17 is provided on the front side of the spindle head 16. A control box 18 is provided on the back side of the column 15. A numerical controller 20 (see FIG. 6) for controlling the operation of the machine tool 1 is stored inside the control box 18.

工具交換装置30の構造について説明する。図2に示すように、工具交換装置30は、円盤状の工具マガジン31と、該工具マガジン31を旋回駆動するマガジンモータ55(図6参照)とを備えている。工具マガジン31の外周縁部には、工具Tを着脱可能な14個の工具ポットP1〜P14(図3参照)が周方向(正面視時計回り)に列設されている。そして、工具マガジン31の最下部に位置する工具ポットP8の位置が、主軸17(図2参照)との間で工具交換が行われる工具交換位置である。   The structure of the tool changer 30 will be described. As shown in FIG. 2, the tool changer 30 includes a disk-shaped tool magazine 31 and a magazine motor 55 (see FIG. 6) that drives the tool magazine 31 to rotate. Fourteen tool pots P <b> 1 to P <b> 14 (see FIG. 3) from which the tool T can be attached and detached are arranged in the circumferential direction (clockwise in front view) on the outer peripheral edge of the tool magazine 31. And the position of the tool pot P8 located in the lowest part of the tool magazine 31 is a tool exchange position where a tool exchange is performed between the main axis | shafts 17 (refer FIG. 2).

工具マガジン31は、図3に示すように、マガジンモータ55(図6参照)の駆動によって軸周りに旋回し、正転(正面視時計回り)、反転(正面視反時計回り)が可能である。マガジンモータ55は、数値制御装置20のCPU21(図6参照)によって制御される。例えば、NCプログラム中に工具交換指令のコマンドがあった場合、CPU21によって、その工具交換指令の対象の工具Tが装着されている工具ポットPの位置が割り出される。そして、工具マガジン31が旋回されることで、その工具Tが工具交換位置に搬送され、主軸17に装着されている工具Tと交換される。   As shown in FIG. 3, the tool magazine 31 is rotated around an axis by driving a magazine motor 55 (see FIG. 6), and can be rotated forward (clockwise in front view) or reversed (counterclockwise in front view). . The magazine motor 55 is controlled by the CPU 21 (see FIG. 6) of the numerical controller 20. For example, when there is a tool change command in the NC program, the CPU 21 determines the position of the tool pot P to which the tool T subject to the tool change command is mounted. Then, by turning the tool magazine 31, the tool T is transported to the tool changing position and replaced with the tool T mounted on the spindle 17.

なお、本実施例では、工具マガジン31の工具ポットPの位置を、隣の工具ポットPの位置に切り替える回数(以下、「切替回数」という)を「1回」として説明する。例えば、図3において、工具ポットP1に装着されている工具T1を、工具ポットP2,P3を挟んで隣に位置する工具ポットP4に装着されている工具T9に切り替えるために必要な切替回数は「3回」である。   In this embodiment, the number of times that the position of the tool pot P of the tool magazine 31 is switched to the position of the adjacent tool pot P (hereinafter referred to as “number of times of switching”) will be described as “one time”. For example, in FIG. 3, the number of times of switching required to switch the tool T1 mounted on the tool pot P1 to the tool T9 mounted on the adjacent tool pot P4 across the tool pots P2 and P3 is “ 3 times ".

また、工具マガジン31において、工具ポットP1〜P14の全てに工具Tを装着してもよいが、全ポット数に比べて工具数が少ない場合は、空の工具ポットPを設けてもよい。なお、工具ポットPの切替回数を少なくするために、工具Tと工具Tとの間は詰めた方が好ましい。図3に示す例では、工具ポットP1に工具T1が装着され、工具ポットP2に工具T5が装着され、工具ポットP3に工具T8が装着され、工具ポットP4に工具T9が装着されている。工具ポットP5〜P14には工具Tが装着されていない。なお、本実施例では、工具Tを時計回りに配置しているが、反時計周りに配置してもよい。   In the tool magazine 31, the tool T may be mounted on all of the tool pots P1 to P14. However, when the number of tools is smaller than the total number of pots, an empty tool pot P may be provided. In order to reduce the number of times the tool pot P is switched, it is preferable to close the space between the tool T and the tool T. In the example shown in FIG. 3, the tool T1 is mounted on the tool pot P1, the tool T5 is mounted on the tool pot P2, the tool T8 is mounted on the tool pot P3, and the tool T9 is mounted on the tool pot P4. The tool T is not attached to the tool pots P5 to P14. In this embodiment, the tool T is arranged clockwise, but it may be arranged counterclockwise.

次に、工具マガジン31の工具配置について説明する。数値制御装置20は、工具マガジン31における工具配置について、NCプログラムを実行する際に、工具ポットPの切替回数を最も少なくできる最適な工具配置を確実に算出できる機能を備えている。工具ポットPの切替回数が少なければ少ないほど、工具交換装置30の工具交換にかかる時間を短縮できる。   Next, the tool arrangement of the tool magazine 31 will be described. The numerical controller 20 has a function that can reliably calculate an optimum tool arrangement that can minimize the number of times of switching the tool pot P when the NC program is executed for the tool arrangement in the tool magazine 31. The smaller the number of times the tool pot P is switched, the shorter the time required for the tool change of the tool changer 30 can be shortened.

最適な工具配置を算出する際の操作パネル10の操作方法について説明する。例えば、図1に示す操作パネル10のキーボード12を操作すると、図4に示すように、ディスプレイ11に、これから実行するNCプログラムが表示される。図4に示すNCプログラムの例では、ワークの切削加工中に、工具T1→工具T5→工具T8→工具T1→工具T5→工具T8→工具T9の順に工具交換が実行される。そして、ディスプレイ11の左隅に表示されている工具配置計算ボタン110がユーザによって選択されると、数値制御装置20によって、工具ポットPの切替回数を最も少なくできる最適な工具配置が算出される。そして、図5に示すように、ディスプレイ11には、工具配置の算出結果を示す工具配置表120が表示される。   An operation method of the operation panel 10 when calculating the optimum tool arrangement will be described. For example, when the keyboard 12 of the operation panel 10 shown in FIG. 1 is operated, the NC program to be executed is displayed on the display 11 as shown in FIG. In the example of the NC program shown in FIG. 4, tool exchange is performed in the order of tool T1 → tool T5 → tool T8 → tool T1 → tool T5 → tool T8 → tool T9 during cutting of the workpiece. When the tool placement calculation button 110 displayed in the left corner of the display 11 is selected by the user, the numerical control device 20 calculates the optimum tool placement that can minimize the number of times the tool pot P is switched. As shown in FIG. 5, the display 11 displays a tool arrangement table 120 that shows the calculation result of the tool arrangement.

工具配置表120について説明する。図5に示すように、工具配置表120には、ポット番号欄121に対して工具番号欄122が設けられている。ポット番号欄121には、P1〜P14の工具ポットPのポット番号が表示される。工具番号欄122には、数値制御装置20によって算出された最適な工具配置に基づき、配置すべき工具Tの工具番号が表示される。空の工具ポットPには、「−」が表示される。ユーザは、ディスプレイ11に表示された工具配置表120に従って、工具マガジン31の各工具ポットP1〜14に工具Tをそれぞれ装着する。これにより、NCプログラムを実行する際に、工具Tの切替回数が最も少なくなるので、工具交換にかかる時間を効果的に短縮できる。   The tool arrangement table 120 will be described. As shown in FIG. 5, the tool arrangement table 120 has a tool number column 122 for the pot number column 121. In the pot number column 121, the pot numbers of the tool pots P1 to P14 are displayed. The tool number column 122 displays the tool number of the tool T to be arranged based on the optimum tool arrangement calculated by the numerical controller 20. In the empty tool pot P, “−” is displayed. The user installs the tools T in the tool pots P1 to P14 of the tool magazine 31 according to the tool arrangement table 120 displayed on the display 11. Thereby, when the NC program is executed, the number of times of switching of the tool T is minimized, so that the time required for tool change can be effectively shortened.

次に、数値制御装置20の電気的構成について、図6を参照して説明する。数値制御装置20は、CPU21、ROM22、RAM23及びフラッシュメモリ24からなるマイクロコンピュータと、入力インタフェイス25と、入出力インタフェイス26とを備えている。入力インタフェイス25には、操作パネル10のキーボード12が電気的に接続されている。キーボード12は、軸移動キーを備えている。軸移動キーは、テーブル19(図2参照)をX軸の+方向、−方向に移動させるためのキー、テーブル19をY軸の+方向、−方向に移動させるためのキー、主軸ヘッド16をZ軸の+方向、−方向に移動させるためのキーである。   Next, the electrical configuration of the numerical controller 20 will be described with reference to FIG. The numerical controller 20 includes a microcomputer including a CPU 21, ROM 22, RAM 23, and flash memory 24, an input interface 25, and an input / output interface 26. The keyboard 12 of the operation panel 10 is electrically connected to the input interface 25. The keyboard 12 includes an axis movement key. The axis movement key is a key for moving the table 19 (see FIG. 2) in the + and − directions of the X axis, a key for moving the table 19 in the + and − directions of the Y axis, and the spindle head 16. This key is used to move the Z axis in the + and-directions.

一方、入出力インタフェイス26には、X軸モータ51を駆動させる駆動回路41と、Y軸モータ52を駆動させる駆動回路42と、Z軸モータ53を駆動させる駆動回路43と、主軸モータ54を駆動させる駆動回路44と、マガジンモータ55を駆動させるための駆動回路45と、操作パネル10のディスプレイ11を駆動させるための駆動回路46等が電気的に接続されている。X軸モータ51及びY軸モータ52は、テーブル19をX軸方向及びY軸方向に移動させるものである。Z軸モータ53は、主軸ヘッド16をZ軸方向に移動させるものである。   On the other hand, the input / output interface 26 includes a drive circuit 41 that drives the X-axis motor 51, a drive circuit 42 that drives the Y-axis motor 52, a drive circuit 43 that drives the Z-axis motor 53, and a spindle motor 54. A drive circuit 44 for driving, a drive circuit 45 for driving the magazine motor 55, a drive circuit 46 for driving the display 11 of the operation panel 10, and the like are electrically connected. The X axis motor 51 and the Y axis motor 52 move the table 19 in the X axis direction and the Y axis direction. The Z-axis motor 53 moves the spindle head 16 in the Z-axis direction.

X軸モータ51、Y軸モータ52、Z軸モータ53、主軸モータ54、マガジンモータ55には、それぞれモータの位置を検出するエンコーダ(図示省略)を設けている。各エンコーダは、各駆動回路41、42、43、44、45に接続されている。   Each of the X-axis motor 51, the Y-axis motor 52, the Z-axis motor 53, the main shaft motor 54, and the magazine motor 55 is provided with an encoder (not shown) that detects the position of the motor. Each encoder is connected to each drive circuit 41, 42, 43, 44, 45.

次に、RAM23の各種記憶エリアについて、図7を参照して説明する。RAM23には、工具番号記憶エリア231と、使用工具本数記憶エリア232と、最適工具配置記憶エリア233と、最適切替回数記憶エリア234と、計算回数記憶エリア235等が少なくとも設けられている。   Next, various storage areas of the RAM 23 will be described with reference to FIG. The RAM 23 is provided with at least a tool number storage area 231, a used tool number storage area 232, an optimum tool placement storage area 233, an optimum switching number storage area 234, a calculation number storage area 235, and the like.

工具番号記憶エリア231には、NCプログラムから読み込まれた工具交換指令の対象である使用工具の工具番号が記憶される。使用工具本数記憶エリア232には、NCプログラムで使用される工具Tの本数(以下、使用工具本数N)が記憶される。最適工具配置記憶エリア233には、工具マガジン31における工具Tの最適な工具配置(以下、最適工具配置Qoptと呼ぶ)が記憶される。最適切替回数記憶エリア234には、最も少ない切替回数(以下、最適切替回数Roptという)が記憶される。計算回数記憶エリア235には、工具Tの配置に関する組合せ毎に切替回数を計算した回数(以下、計算回数Sという)が記憶される。   The tool number storage area 231 stores the tool number of the tool to be used that is the target of the tool change command read from the NC program. In the used tool number storage area 232, the number of tools T used in the NC program (hereinafter, used tool number N) is stored. The optimum tool placement storage area 233 stores the optimum tool placement of the tool T in the tool magazine 31 (hereinafter referred to as the optimum tool placement Qopt). The optimum switching count storage area 234 stores the smallest switching count (hereinafter referred to as the optimal switching count Ropt). The number-of-calculations storage area 235 stores the number of times the number of times of switching is calculated for each combination related to the arrangement of the tool T (hereinafter referred to as the number of times of calculation S).

次に、フラッシュメモリ24の各種記憶エリアについて、図8を参照して説明する。フラッシュメモリ24には、NCプログラム記憶エリア241と、ポット切替テーブル記憶エリア242等が少なくとも設けられている。NCプログラム記憶エリア241には、加工プログラムとしてNCプログラムが記憶される。ポット切替テーブル記憶エリア242には、ポット切替テーブル2421(図9参照)が記憶されている。   Next, various storage areas of the flash memory 24 will be described with reference to FIG. The flash memory 24 is provided with at least an NC program storage area 241 and a pot switching table storage area 242. The NC program storage area 241 stores an NC program as a machining program. The pot switching table storage area 242 stores a pot switching table 2421 (see FIG. 9).

次に、ポット切替テーブル2421について、図9を参照して説明する。ポット切替テーブル2421は、CPU21が後述する「工具配置算出処理」を実行する際に、使用工具の組合せからなる全ての工具配置について、NCプログラムを実行する際に必要な切替回数Rを算出するために用いられる。ポット切替テーブル2421には、工具切替欄71と、ポット切替欄72と、切替回数欄73とがそれぞれ対応して設けられている。さらに、切替回数欄73に記憶された切替回数の合計を記憶する合計欄74が設けられている。   Next, the pot switching table 2421 will be described with reference to FIG. The pot switching table 2421 calculates the number of times of switching R required when the NC program is executed for all tool arrangements composed of combinations of tools used when the CPU 21 executes “tool arrangement calculation processing” to be described later. Used for. In the pot switching table 2421, a tool switching field 71, a pot switching field 72, and a switching frequency field 73 are provided corresponding to each other. Furthermore, a total column 74 for storing the total number of switching times stored in the switching number column 73 is provided.

工具切替欄71には、NCプログラムにおいて工具Tの使用順に、工具Tを切り替える各工程が各々記憶される。ポット切替欄72には、工具切替欄71に記憶された工具Tの各切替工程を、工具ポットPの番号に対応させたものである。切替回数欄73には、工具ポットPの切り替えに必要な切替回数が記憶される。なお、使用例については後述する。   In the tool switching field 71, each step of switching the tool T in the order of use of the tool T in the NC program is stored. In the pot switching column 72, each switching step of the tool T stored in the tool switching column 71 is associated with the number of the tool pot P. The switching frequency column 73 stores the switching frequency necessary for switching the tool pot P. A usage example will be described later.

次に、NCプログラムに基づくCPU21のメイン処理について、図10のフローチャートを参照して説明する。まず、フラッシュメモリ24のNCプログラム記憶エリア241に記憶されたNCプログラムが読み出され、1ブロック解釈される(S1)。そして、解釈された1ブロックが工具交換指令であるか否かが判断される(S2)。工具交換指令でなければ(S2:NO)、その1ブロックで解釈された動作指令に基づき、指定の動作が実行される(S6)。   Next, the main processing of the CPU 21 based on the NC program will be described with reference to the flowchart of FIG. First, the NC program stored in the NC program storage area 241 of the flash memory 24 is read and interpreted as one block (S1). Then, it is determined whether or not the interpreted one block is a tool change command (S2). If it is not a tool change command (S2: NO), a specified operation is executed based on the operation command interpreted in one block (S6).

一方、解釈された1ブロックが工具交換指令であった場合(S2:YES)、工具交換指令の対象である次の工具Tを工具交換位置まで移動させるために必要な切替回数rが、所定値K以上であるか否かが判断される(S3)。なお、所定値Kは、(工具ポット数/2)+1で表される値である。切替回数rは、工具マガジン31を正転方向に旋回した場合の切替回数である。本実施例では、工具ポット数は14であるので、所定値K=8である。従って、切替回数rが8以上であるか否かが判断される。   On the other hand, if the interpreted one block is a tool change command (S2: YES), the number of times of switching r required to move the next tool T that is the target of the tool change command to the tool change position is a predetermined value. It is determined whether or not it is greater than or equal to K (S3). The predetermined value K is a value represented by (number of tool pots / 2) +1. The switching frequency r is the switching frequency when the tool magazine 31 is turned in the forward rotation direction. In this embodiment, since the number of tool pots is 14, the predetermined value K = 8. Therefore, it is determined whether or not the switching count r is 8 or more.

例えば、図3に示すように、工具ポットP12に装着された工具Tを、工具交換位置(現在の工具ポットP8の位置)に移動させる場合、切替回数rは10回であるから8よりも大きい。この場合(S3:YES)、工具マガジン31を正転させるよりも反転させた方が切替回数が少なくて済むので、反転方向に工具マガジン31が旋回され(S5)、工具Tが工具交換位置に速やかに移動される。また、切替回数rが8未満であった場合(S3:NO)、工具マガジン31を反転させるよりも正転させた方が切替回数が少なくて済むので、正転方向に工具マガジン31が旋回され(S4)、工具Tが工具交換位置に速やかに移動される。   For example, as shown in FIG. 3, when the tool T attached to the tool pot P12 is moved to the tool change position (the current position of the tool pot P8), the number of times of switching r is 10 and is larger than 8. . In this case (S3: YES), since the number of times of switching is smaller when the tool magazine 31 is reversed than when it is rotated forward, the tool magazine 31 is turned in the reversing direction (S5), and the tool T is moved to the tool change position. Moved quickly. In addition, when the switching frequency r is less than 8 (S3: NO), since the number of switching times is smaller than when the tool magazine 31 is reversed, the tool magazine 31 is turned in the normal rotation direction. (S4) The tool T is quickly moved to the tool change position.

次いで、次ブロックに移行し、プログラムエンド(M30)であるか否かが判断される(S7)。プログラムエンドであれば(S7:YES)、処理を終了する。プログラムエンドでなければ(S7:NO)、S1に戻って、引き続き次の1ブロックが解釈され、処理が繰り返される。   Next, the process proceeds to the next block, and it is determined whether or not it is a program end (M30) (S7). If it is a program end (S7: YES), the process is terminated. If it is not the program end (S7: NO), the process returns to S1, the next one block is continuously interpreted, and the process is repeated.

次に、CPU21による工具配置算出処理について、図11のフローチャートを参照して説明する。ここでは一例として、以下の条件を有するNCプログラムで、最適工具配置Qoptを算出する場合について説明する。本処理は、図6に示すディスプレイ11の左隅に表示された工具配置計算ボタン110が選択されると、ROM22に記憶された工具配置算出プログラム(本発明の「制御プログラム」に相当)が読み込まれて実行される。
・使用工具本数N=4本
・使用工具番号=T1,T5,T8,T9
・NCプログラム中における工具Tの使用順=「T1→T5→T8→T1→T5→T8→T9」
Next, the tool placement calculation process by the CPU 21 will be described with reference to the flowchart of FIG. Here, as an example, a case where the optimum tool placement Qopt is calculated using an NC program having the following conditions will be described. In this process, when the tool placement calculation button 110 displayed in the left corner of the display 11 shown in FIG. 6 is selected, the tool placement calculation program (corresponding to the “control program” of the present invention) stored in the ROM 22 is read. Executed.
-Number of tools used N = 4-Tool numbers used = T1, T5, T8, T9
・ Use order of tool T in NC program = “T1 → T5 → T8 → T1 → T5 → T8 → T9”

フラッシュメモリ24のNCプログラム記憶エリア241(図8参照)に記憶されているNCプログラム中の工具交換指令が読み込まれる(S10)。そして、工具交換指令の読み込みにより、NCプログラム中の使用工具の工具番号が、RAM23の工具番号記憶エリア231(図7参照)に記憶される(S11)。さらに、読み込まれた工具交換指令に基づき、使用工具本数Nが記憶される(S12)。本実施例では、使用工具本数N=4本であるので、RAM23の使用工具本数記憶エリア232(図7参照)に「4」が記憶される。   A tool change command in the NC program stored in the NC program storage area 241 (see FIG. 8) of the flash memory 24 is read (S10). Then, by reading the tool change command, the tool number of the tool used in the NC program is stored in the tool number storage area 231 (see FIG. 7) of the RAM 23 (S11). Further, the number N of tools used is stored based on the read tool change command (S12). In this embodiment, since the number N of used tools is 4, “4” is stored in the used tool number storage area 232 of the RAM 23 (see FIG. 7).

工具番号記憶エリア231に記憶された工具番号について、NCプログラムの使用順に工具配置Qが生成される(S13)。本実施例では、上記した使用順に基づき、工具配置Q=「T1,T5,T8,T9」が最初に生成される。   For the tool numbers stored in the tool number storage area 231, tool arrangement Q is generated in the order of use of the NC program (S13). In the present embodiment, the tool arrangement Q = “T1, T5, T8, T9” is first generated based on the order of use described above.

次に、生成された工具配置Qに基づき、NCプログラムが実行される際の工具ポットPの切替回数Rが算出される(S14)。工具配置Q=「T1,T5,T8,T9」の場合、図3に示すように、工具T1は工具ポットP1に、工具T5は工具ポットP2に、工具T8は工具ポットP3に、工具T9は工具ポットP4に装着されることになる。   Next, based on the generated tool arrangement Q, the number of times R of switching the tool pot P when the NC program is executed is calculated (S14). When the tool arrangement Q = “T1, T5, T8, T9”, as shown in FIG. 3, the tool T1 is in the tool pot P1, the tool T5 is in the tool pot P2, the tool T8 is in the tool pot P3, and the tool T9 is It will be attached to the tool pot P4.

この工具配置Qにおいて、NCプログラムの使用順で工具交換する場合、「T1→T5」「T5→T8」「T8→T1」「T1→T5」「T5→T8」「T8→T9」の6つの切替工程が必要となる。さらに、複数のワークについて同じ切削加工を施す場合、同じNCプログラムが繰り返し実行されるので、最後に使用される工具T9から最初の工具T1に切り替えるために必要な切替回数(以下、補助切替回数と呼ぶ)を考慮する。従って、上記した6つの工程に「T9→T1」の工程を加えた7つの切替工程について、切替回数を算出する必要がある。   In this tool arrangement Q, when changing the tool in the order of use of the NC program, there are six "T1 → T5", "T5 → T8", "T8 → T1", "T1 → T5", "T5 → T8", and "T8 → T9". A switching process is required. Further, when the same cutting process is performed on a plurality of workpieces, the same NC program is repeatedly executed. Therefore, the number of times of switching necessary for switching from the last tool T9 to the first tool T1 (hereinafter referred to as auxiliary switching number). Call). Accordingly, it is necessary to calculate the number of times of switching for seven switching steps in which the step “T9 → T1” is added to the six steps described above.

これらの各切替工程が、フラッシュメモリ24に記憶されたポット切替テーブル2421(図9参照)の工具切替欄71に各々記憶される。さらに、各切替工程の工具番号がポット番号に変換され、工具ポットPの切替工程として、ポット切替欄72に記憶される。そして、工具ポットPの各切替工程につき、切替回数が算出される。各切替工程毎に算出された切替回数は、ポット切替テーブル2421(図9参照)の切替回数欄73に各々記憶される。さらに、合計の切替回数Rが算出され、合計欄74に記憶される。本実施例では10回である。こうして、工具配置Qの切替回数Rが算出される。   Each of these switching steps is stored in the tool switching column 71 of the pot switching table 2421 (see FIG. 9) stored in the flash memory 24. Further, the tool number of each switching step is converted into a pot number and stored in the pot switching column 72 as a tool pot P switching step. Then, the number of times of switching is calculated for each switching step of the tool pot P. The number of switching times calculated for each switching step is stored in the switching number column 73 of the pot switching table 2421 (see FIG. 9). Further, the total number of switching times R is calculated and stored in the total column 74. In this embodiment, it is 10 times. In this way, the switching frequency R of the tool arrangement Q is calculated.

次いで、ここで生成された工具配置Qが現時点での最適工具配置Qoptとして、RAM23の最適工具配置記憶エリア233(図7参照)に記憶され、算出された切替回数Rが現時点での最適切替回数RoptとしてRAM23の最適切替回数記憶エリア234(図7参照)に記憶され、RAM23の計算回数記憶エリア235(図7参照)に計算回数S=1が記憶される(S15)。   Next, the tool placement Q generated here is stored in the optimum tool placement storage area 233 (see FIG. 7) of the RAM 23 as the optimum tool placement Qopt at the present time, and the calculated switching number R is the optimum switching number at the present time. Ropt is stored in the optimum switching count storage area 234 (see FIG. 7) of the RAM 23, and the calculation count S = 1 is stored in the calculation count storage area 235 (see FIG. 7) of the RAM 23 (S15).

次に、RAM23の計算回数記憶エリア235に記憶された計算回数Sの値がN!(Nの階乗)と異なるか否かが判断される(S16)。N!は、使用工具本数Nにおける全組合せの数に相当する。本実施例での使用工具本数Nは4本であるので、工具配置の組合せは、図12に示すように、24通りの組合せがある。つまり、「T1,T5,T8,T9」については、24通りの工具配置Qがある。なお、図12では、「T」の文字は省略している。本処理では、考えられる全ての組合せを考慮するので、後述するように、計算回数が24回になるまで各組合せの工具配置Qについて切替回数Rの算出が繰り返される。   Next, the value of the calculation count S stored in the calculation count storage area 235 of the RAM 23 is N! It is determined whether or not (N factorial) (S16). N! Corresponds to the number of all combinations in the number N of tools used. Since the number N of tools used in this embodiment is 4, there are 24 combinations of tool arrangements as shown in FIG. That is, for “T1, T5, T8, T9”, there are 24 tool arrangements Q. In FIG. 12, the letter “T” is omitted. Since all possible combinations are considered in this process, as will be described later, the calculation of the number of switching times R is repeated for the tool arrangement Q of each combination until the number of calculations reaches 24.

計算回数Sの値がN!と異なる場合(S16:YES)、計算回数Sに1が加算され、RAM23の計算回数記憶エリア235に記憶され(S17)、次の工具配置Qが生成される(S18)。本実施例でいえば、前回は「T1,T5,T8,T9」について算出されたので、次に「T1,T5,T9,T8」の工具配置Qが新たに生成される。   The number of calculations S is N! (S16: YES), 1 is added to the calculation count S and stored in the calculation count storage area 235 of the RAM 23 (S17), and the next tool arrangement Q is generated (S18). In the present embodiment, since the previous calculation was made for “T1, T5, T8, T9”, the tool arrangement Q of “T1, T5, T9, T8” is newly generated next.

新たに生成された工具配置Qについて、上述した前回の方法と同様に、切替回数Rが算出される(S19)。次いで、算出された切替回数Rが、RAM23の最適切替回数記憶エリア234に記憶された最適切替回数Roptよりも少ないか否かが判断される(S20)。最適切替回数Roptよりも多い場合(S20:NO)、今回算出された切替回数Rでは、工具交換する際に時間がかかってしまう。この場合、RAM23に記憶されている最適工具配置Qopt、最適切替回数Roptを変更せず、S16に戻り、計算回数SがN!(本実施例では24)でないか否かが判断される。24通りに到達していない場合は(S16:YES)、上記したS17〜S20の処理が繰り返される。   For the newly generated tool arrangement Q, the switching frequency R is calculated in the same manner as in the previous method described above (S19). Next, it is determined whether or not the calculated switching frequency R is smaller than the optimal switching frequency Ropt stored in the optimal switching frequency storage area 234 of the RAM 23 (S20). When the number of times of switching is larger than the optimal number of times Ropt (S20: NO), it takes time to change the tool at the number of times of switching R calculated this time. In this case, the optimum tool placement Qopt and the optimum switching number Ropt stored in the RAM 23 are not changed, and the process returns to S16 and the calculation number S is N! It is determined whether or not (24 in this embodiment). When it has not reached 24 ways (S16: YES), the processes of S17 to S20 described above are repeated.

S20において、算出された切替回数Rが、RAM23の最適切替回数記憶エリア234(図7参照)に記憶されている最適切替回数Roptよりも少ない場合(S20:YES)、新たに生成された工具配置Qが最適工具配置Qoptとして、RAM23の最適工具配置記憶エリア233に記憶され、算出された切替回数Rが新たな最適切替回数Roptとして、RAM23の最適切替回数記憶エリア234に記憶される(S21)。その後、S16に戻り、計算回数SがN!と異なる場合は(S16:YES)、上記したS17〜S21の処理が繰り返される。   In S20, when the calculated switching number R is smaller than the optimum switching number Ropt stored in the optimum switching number storage area 234 (see FIG. 7) of the RAM 23 (S20: YES), a newly generated tool arrangement is generated. Q is stored in the optimum tool placement storage area 233 of the RAM 23 as the optimum tool placement Qopt, and the calculated switching number R is stored in the optimum switching number storage area 234 of the RAM 23 as a new optimum switching number Ropt (S21). . Thereafter, the process returns to S16, and the number of calculations S is N! Is different (S16: YES), the above-described processes of S17 to S21 are repeated.

計算回数SがN!に到達した場合は(S16:NO)、RAM23の最適工具配置記憶エリア233に記憶された最適工具配置Qoptと、最適切替回数Roptとに基づき、図5に示すように、ディスプレイ11に、工具配置表120が表示される(S22)。例えば、RAM23の最適工具配置記憶エリア233に記憶された最適工具配置Qoptが「T1、T5、T8、T9」であった場合、ポット番号欄121のP1〜P4に対応させて、工具番号欄122に「T1」「T5」「T8」「T9」が表示される。   Number of calculations S is N! (S16: NO), on the basis of the optimum tool placement Qopt stored in the optimum tool placement storage area 233 of the RAM 23 and the optimum switching frequency Ropt, as shown in FIG. A table 120 is displayed (S22). For example, when the optimum tool placement Qopt stored in the optimum tool placement storage area 233 of the RAM 23 is “T1, T5, T8, T9”, the tool number column 122 is associated with P1 to P4 of the pot number column 121. “T1”, “T5”, “T8”, and “T9” are displayed.

工具配置表120の下方には、最適切替回数Roptである「10回」が表示される。こうして、CPU21による工具配置算出処理が終了する。ユーザは、この工具配置表120の最適工具配置Qoptに従って、図2,図3に示す工具マガジン31に工具Tを装着する。これにより、NCプログラムを実行する際に、工具交換にかかる時間を効果的に短縮できる。   Below the tool arrangement table 120, “10 times” that is the optimal switching frequency Ropt is displayed. Thus, the tool placement calculation process by the CPU 21 is completed. The user attaches the tool T to the tool magazine 31 shown in FIGS. 2 and 3 according to the optimum tool arrangement Qopt of the tool arrangement table 120. Thereby, when the NC program is executed, the time required for tool change can be effectively shortened.

なお、以上説明において、図11のフローチャートに示すS10の処理を実行するCPU21が本発明の「工具交換指令読込手段」に相当し、S11の処理を実行するCPU21が本発明の「使用工具特定手段」に相当し、S13,S18の処理を実行するCPU21が本発明の「配置組合せ算出手段」に相当し、S14,S19の処理を実行するCPU21が本発明の「切替回数計数手段」に相当し、S20,S21の処理を実行するCPU21が本発明の「最小回数特定手段」に相当し、S22の処理を実行するCPU21が本発明の「配置情報出力手段」に相当する。また、図10のフローチャートのS3、S4、S5の処理を実行するCPU21が本発明の「回転方向決定手段」に相当する。また、図6に示すROM22が本発明の「記憶媒体」に相当する。なお、本発明の制御プログラムは、フラッシュメモリ24等の他の記憶媒体に記憶させてもよい。   In the above description, the CPU 21 that executes the process of S10 shown in the flowchart of FIG. 11 corresponds to the “tool change command reading means” of the present invention, and the CPU 21 that executes the process of S11 corresponds to the “used tool specifying means” of the present invention. The CPU 21 that executes the processes of S13 and S18 corresponds to the “placement combination calculating means” of the present invention, and the CPU 21 that executes the processes of S14 and S19 corresponds to the “switching number counting means” of the present invention. The CPU 21 that executes the processes of S20 and S21 corresponds to the “minimum number specifying means” of the present invention, and the CPU 21 that executes the process of S22 corresponds to the “placement information output means” of the present invention. Further, the CPU 21 that executes the processes of S3, S4, and S5 in the flowchart of FIG. 10 corresponds to the “rotation direction determining means” of the present invention. 6 corresponds to the “storage medium” of the present invention. The control program of the present invention may be stored in another storage medium such as the flash memory 24.

以上説明したように、第1実施形態の数値制御装置20では、工具交換装置30の工具マガジン31における工具配置について、NCプログラムを実行する際に、工具ポットPの切替回数が最も少ない最適な工具配置Qoptを算出できる。具体的には、CPU21によって、NCプログラム中に使用される複数の工具Tについての組合せからなる全ての工具配置について、工具ポットPの切替回数が算出される。   As described above, in the numerical control device 20 according to the first embodiment, when the NC program is executed with respect to the tool arrangement in the tool magazine 31 of the tool changer 30, the optimum tool having the smallest number of times of switching the tool pot P is used. The arrangement Qopt can be calculated. Specifically, the CPU 21 calculates the number of times of switching the tool pot P for all tool arrangements composed of combinations of a plurality of tools T used in the NC program.

全ての工具配置について算出された切替回数の中で最も少ない切替回数Roptであった工具配置が最適工具配置Qoptとされる。最適工具配置Qoptは、ディスプレイ11に工具配置表120として表示される。ユーザは、ディスプレイ11に表示された工具配置表120に従って、工具マガジン31の各工具ポットP1〜14に工具Tをそれぞれ装着する。これにより、NCプログラムを実行する際に、工具Tの切替回数が最も少なくなるので、工具交換にかかる時間を効果的に短縮できる。   The tool arrangement that is the smallest switching frequency Ropt among the switching times calculated for all the tool arrangements is set as the optimum tool arrangement Qopt. The optimum tool placement Qopt is displayed as a tool placement table 120 on the display 11. The user installs the tools T in the tool pots P1 to P14 of the tool magazine 31 according to the tool arrangement table 120 displayed on the display 11. Thereby, when the NC program is executed, the number of times of switching of the tool T is minimized, so that the time required for tool change can be effectively shortened.

次に、本発明の第2実施形態である数値制御装置について、図13乃至図16を参照して説明する。第2実施形態では、工具Tの工具寿命が無くなった場合に代わりに使用される予備工具を考慮した最適工具配置Qoptを算出できる。なお、第2実施形態は、第1実施形態の変形例であり、第1実施形態で説明した数値制御装置20の構成、制御方法と同様であるので、異なる部分を中心に説明する。同じ構成部分については、第1実施形態と同符号を付して説明する。   Next, a numerical control apparatus according to a second embodiment of the present invention will be described with reference to FIGS. In the second embodiment, it is possible to calculate the optimum tool arrangement Qopt considering a spare tool used instead when the tool T has no tool life. The second embodiment is a modification of the first embodiment, and is the same as the configuration and control method of the numerical control device 20 described in the first embodiment. The same components will be described with the same reference numerals as in the first embodiment.

図13に示すように、予備工具は、他の使用工具と同様に、工具マガジン31の工具ポットPに装着される。本実施例では、工具ポットP5に、工具T1の予備である予備工具T10が装着されている。   As shown in FIG. 13, the spare tool is mounted in the tool pot P of the tool magazine 31 in the same manner as other used tools. In this embodiment, a spare tool T10 that is a spare for the tool T1 is attached to the tool pot P5.

次に、予備工具を登録した場合のNCプログラムについて説明する。図14に示すNCプログラムは、図3に示したNCプログラムに対応するものである。「T901」は、後述する予備工具を使用することを示している。   Next, the NC program when a spare tool is registered will be described. The NC program shown in FIG. 14 corresponds to the NC program shown in FIG. “T901” indicates that a spare tool described later is used.

次に、フラッシュメモリ124について、図15を参照して説明する。フラッシュメモリ124は、NCプログラム記憶エリア241と、ポット切替テーブル記憶エリア242と、予備工具テーブル記憶エリア243等が少なくとも設けられている。ポット切替テーブル記憶エリア242には、予備工具を考慮したポット切替テーブル2521(図16参照)が記憶されている。予備工具テーブル記憶エリア243には、予備工具テーブル2431(図17参照)が記憶されている。   Next, the flash memory 124 will be described with reference to FIG. The flash memory 124 is provided with at least an NC program storage area 241, a pot switching table storage area 242, a spare tool table storage area 243, and the like. The pot switching table storage area 242 stores a pot switching table 2521 (see FIG. 16) considering a spare tool. The spare tool table storage area 243 stores a spare tool table 2431 (see FIG. 17).

ポット切替テーブル2521について、図16を参照して説明する。ポット切替テーブル2521には、予備工具未使用時テーブル部81と、予備工具使用時テーブル部82とが各々設けられている。予備工具未使用時テーブル部81は、第1実施形態のポット切替テーブル2421と同じであり、切替回数の合計を合計(A)欄741に記憶している。予備工具使用時テーブル部82は、予備工具を使用した場合の第1実施形態のポット切替テーブル2421と同じものである。切替回数の合計を合計(B)欄742に記憶している。総合計欄75は、合計(A)欄741に記憶した合計と合計(B)欄742に記憶した合計とを加算した合計値を記憶している。   The pot switching table 2521 will be described with reference to FIG. The pot switching table 2521 is provided with a spare tool unused table portion 81 and a spare tool used table portion 82. The spare tool unused table unit 81 is the same as the pot switching table 2421 of the first embodiment, and stores the total number of switchings in the total (A) column 741. The spare tool use time table unit 82 is the same as the pot switching table 2421 of the first embodiment when a spare tool is used. The total number of times of switching is stored in the total (B) column 742. The grand total column 75 stores a total value obtained by adding the total stored in the total (A) column 741 and the total stored in the total (B) column 742.

本実施例の場合、予備工具未使用時の切替回数が10回、予備工具使用時の切替回数が12回であるので、総合計は22回となり、総合計欄75には「22」が記憶される。なお、予備工具が予備工具テーブル記憶エリア243に登録されていない場合は、予備工具未使用時テーブル部81のみが使用される。   In the case of the present embodiment, the number of times of switching when the spare tool is not used is 10 and the number of times of switching when the spare tool is used is 12. Therefore, the total is 22 times, and “22” is stored in the total column 75. Is done. When the spare tool is not registered in the spare tool table storage area 243, only the spare tool unused table section 81 is used.

次に、予備工具テーブル2431について、図17を参照して説明する。予備工具テーブル2431には、使用工具Tと、その代わりに使用される予備工具Tとが対応して記憶されている。本実施例では、使用工具T1と、その使用工具T1の工具寿命が無くなった場合に使用される予備工具T10が記憶されている。予備工具を登録しない場合は、予備工具テーブル2431には何も記憶されない。工具Tの工具寿命は、フラッシュメモリ24に工具T毎に各々記憶されている。各工具Tの使用によって、工具寿命が無くなった場合に、使用工具から予備工具に自動的に切り替わるようになっている。なお、予備工具テーブル2431が本発明の「予備工具登録手段」に相当する。   Next, the spare tool table 2431 will be described with reference to FIG. The spare tool table 2431 stores the tool T to be used and the spare tool T used instead. In the present embodiment, the tool T1 to be used and the spare tool T10 that is used when the tool life of the tool T1 used is lost are stored. If no spare tool is registered, nothing is stored in the spare tool table 2431. The tool life of the tool T is stored in the flash memory 24 for each tool T. When the tool life is lost due to the use of each tool T, the tool is automatically switched from the used tool to the spare tool. The spare tool table 2431 corresponds to the “spare tool registration unit” of the present invention.

次に、第2実施形態のCPUによって実行される工具配置算出処理について説明する。第2実施形態で実行される工具配置算出処理は、第1実施形態で説明した図11のフローチャートとほぼ同様であるが、予備工具が登録された場合は、S11、S12、S13、14,18,19においての処理が異なる。図10のフローチャートを参照して、予備工具が使用された場合のS11、S12、S13、14の処理について説明する。なお、S18、19は、S13,S14と同じ処理のため説明は省略する。本処理は、図14に示すディスプレイ11の左隅に表示された工具配置計算ボタン110が選択されると開始する。   Next, a tool arrangement calculation process executed by the CPU of the second embodiment will be described. The tool placement calculation process executed in the second embodiment is almost the same as the flowchart of FIG. 11 described in the first embodiment. However, when a spare tool is registered, S11, S12, S13, 14, 18 are used. , 19 are different. With reference to the flowchart of FIG. 10, the process of S11, S12, S13, 14 when a spare tool is used is demonstrated. In addition, since S18 and 19 are the same processes as S13 and S14, description is abbreviate | omitted. This process starts when the tool placement calculation button 110 displayed in the left corner of the display 11 shown in FIG. 14 is selected.

なお、ここでは一例として、以下の条件を有するNCプログラムで、最適工具配置Qoptを算出する場合について説明する。
・使用工具本数N=5本
・使用工具番号(予備工具未使用時)=T1,T5,T8,T9
・使用工具番号(予備工具使用時) =T10,T5,T8,T9
・NCプログラム中における工具Tの使用順(予備工具未使用時)=「T1→T5→T8→T1→T5→T8→T9」
・NCプログラム中における工具Tの使用順(予備工具使用時)=「T10→T5→T8→T10→T5→T8→T9」
Here, as an example, a case where the optimum tool placement Qopt is calculated using an NC program having the following conditions will be described.
・ Number of tools used N = 5 ・ Tool numbers used (when spare tool is not used) = T1, T5, T8, T9
-Tool number used (when using spare tools) = T10, T5, T8, T9
・ Use order of tool T in NC program (when spare tool is not used) = “T1 → T5 → T8 → T1 → T5 → T8 → T9”
・ Use order of tool T in NC program (when using spare tool) = “T10 → T5 → T8 → T10 → T5 → T8 → T9”

図11に示すように、フラッシュメモリ24のNCプログラム記憶エリア241(図8参照)に記憶されているNCプログラムが読み込まれ、NCプログラム中の工具交換指令が読み込まれる(S10)。工具交換指令の読み込みにより、NCプログラム中の使用工具の工具番号が、RAM23の工具番号記憶エリア231(図7参照)に記憶される(S11)。ここで、工具交換指令において「M06 T901」があった場合は、フラッシュメモリ124に記憶された予備工具テーブル2431に記憶された予備工具の工具番号が読み出され、工具番号記憶エリア231に同様に記憶される。   As shown in FIG. 11, the NC program stored in the NC program storage area 241 (see FIG. 8) of the flash memory 24 is read, and the tool change command in the NC program is read (S10). By reading the tool change command, the tool number of the tool used in the NC program is stored in the tool number storage area 231 (see FIG. 7) of the RAM 23 (S11). Here, when there is “M06 T901” in the tool change command, the tool number of the spare tool stored in the spare tool table 2431 stored in the flash memory 124 is read out, and similarly in the tool number storage area 231. Remembered.

読み込まれた工具交換指令に基づき、使用工具本数Nが記憶される(S12)。本実施例では、予備工具Tが登録されているので、使用工具本数Nは、使用工具4本に予備工具1本を加算した5本である。RAM23の使用工具本数記憶エリア232(図7参照)には「5」が記憶される。   Based on the read tool change command, the number N of used tools is stored (S12). In this embodiment, since the spare tool T is registered, the number N of used tools is five, which is four used tools plus one spare tool. “5” is stored in the used tool number storage area 232 of the RAM 23 (see FIG. 7).

次いで、工具番号記憶エリア231に記憶された工具番号について、NCプログラムの使用順に工具配置Qが生成される(S13)。ここで、予備工具テーブル2431には予備工具T10が登録されているので、上記した使用順に基づき、工具配置Q=「T1,T5,T8,T9,T10」が最初に生成される。   Next, for the tool numbers stored in the tool number storage area 231, tool arrangement Q is generated in the order of use of the NC program (S13). Here, since the spare tool T10 is registered in the spare tool table 2431, the tool arrangement Q = “T1, T5, T8, T9, T10” is first generated based on the order of use described above.

次に、生成された工具配置Qに基づき、NCプログラムが実行される際の工具ポットPの切替回数Rが算出される(S14)。工具配置Q=「T1,T5,T8,T9,T10」の場合、図13に示すように、工具T1は工具ポットP1に、工具T5は工具ポットP2に、工具T8は工具ポットP3に、工具T9は工具ポットP4に、工具T10は工具ポットP5に装着されることになる。   Next, based on the generated tool arrangement Q, the number of times R of switching the tool pot P when the NC program is executed is calculated (S14). When the tool arrangement Q = “T1, T5, T8, T9, T10”, as shown in FIG. 13, the tool T1 is in the tool pot P1, the tool T5 is in the tool pot P2, the tool T8 is in the tool pot P3, the tool T9 is attached to the tool pot P4, and the tool T10 is attached to the tool pot P5.

この工具配置Qについて、第1実施形態と同様に、切替回数Rが算出されるのであるが、本実施例では、予備工具T10が登録されているので、予備工具未使用時と、予備工具使用時とを合計して切替回数Rを算出する。切替回数Rを算出する際、CPU21は、フラッシュメモリ124に記憶されたポット切替テーブル2521を使用する。予備工具T10を使用せず、工具T1を使用した場合の切替工程は、予備工具未使用時テーブル部81に記憶される。予備工具未使用時の切替回数(本発明の第1切替回数に相当)が算出され、合計(A)欄741に記憶される。本実施例では10回である。   For this tool arrangement Q, the number of times of switching R is calculated as in the first embodiment. However, in this example, since the spare tool T10 is registered, the spare tool is not used and the spare tool is used. The total number of times is calculated to calculate the number of times of switching R. When calculating the switching frequency R, the CPU 21 uses the pot switching table 2521 stored in the flash memory 124. The switching process when the tool T1 is used without using the spare tool T10 is stored in the table 81 when the spare tool is not used. The number of switching times when the spare tool is not used (corresponding to the first switching number of the present invention) is calculated and stored in the total (A) column 741. In this embodiment, it is 10 times.

一方、工具T1の代わりに、工具T10を使用した場合の切替工程は、予備工具使用時テーブル部82に記憶される。予備工具使用時の切替回数(本発明の第2切替回数に相当)が算出され、合計(B)欄742に記憶される。本実施例では予備工具未使用時よりも多い12回である。これらの総合計(本発明の第1総切替回数に相当)が算出される。本実施例では22回であるので、総合計欄75には「22」が記憶される。この切替回数の総合計が、工具配置Qの切替回数Rとなる。なお、図11に示すS14,S19において、予備工具未使用時の切替回数と、予備工具使用時の切替回数との総合計を算出するCPUが本発明の「第1総切替回数算出手段」に相当する。   On the other hand, the switching process when the tool T10 is used instead of the tool T1 is stored in the spare tool use table 82. The number of times of switching when using the spare tool (corresponding to the second number of times of switching according to the present invention) is calculated and stored in the total (B) column 742. In this embodiment, the number of times is twelve, which is larger than when the spare tool is not used. These totals (corresponding to the first total number of switching times of the present invention) are calculated. In this embodiment, since 22 times, “22” is stored in the grand total column 75. The total number of times of switching is the number of times R of switching the tool arrangement Q. In S14 and S19 shown in FIG. 11, the CPU that calculates the total sum of the number of times of switching when the spare tool is not used and the number of times of switching when the spare tool is used is the “first total switching number calculating means” of the present invention. Equivalent to.

次いで、ここで生成された工具配置Qが現時点での最適工具配置Qoptとして、RAM23の最適工具配置記憶エリア233(図7参照)に記憶され、算出された切替回数Rが現時点での最適切替回数RoptとしてRAM23の最適切替回数記憶エリア234に記憶され、RAM23の計算回数記憶エリア235に計算回数S=1が記憶される(S15)。以降は、第1実施形態と同様の処理が実行される。つまり、工具配置Qの全組合せについて、予備工具を使用しない場合の切替回数と、予備工具を使用した場合の切替回数との合計がそれぞれ算出され、その合計の中で最も少ない切替回数Rの工具配置が求められる。この切替回数の合計が最小となる工具配置Qが、最適工具配置Qoptとなる。なお、予備工具がフラッシュメモリ124の予備工具テーブル2431に登録されていない場合は、第1実施形態と同様の処理が実行される。   Next, the tool placement Q generated here is stored in the optimum tool placement storage area 233 (see FIG. 7) of the RAM 23 as the optimum tool placement Qopt at the present time, and the calculated switching number R is the optimum switching number at the present time. The Ropt is stored in the optimal switching count storage area 234 of the RAM 23, and the calculation count S = 1 is stored in the calculation count storage area 235 of the RAM 23 (S15). Thereafter, the same processing as in the first embodiment is executed. That is, for all combinations of the tool arrangement Q, the total of the number of times of switching when the spare tool is not used and the number of times of switching when the spare tool is used is calculated, and the tool with the smallest number of times of switching R among the total is calculated. Placement is required. The tool placement Q that minimizes the total number of times of switching is the optimum tool placement Qopt. If the spare tool is not registered in the spare tool table 2431 of the flash memory 124, the same process as in the first embodiment is executed.

以上説明したように、第2実施形態の数値制御装置では、第1実施形態の効果に加え、予備工具が登録されている場合において、その予備工具を含めた最適工具配置Qoptを算出できる。CPUは、工具配置Qの全組合せについて、予備工具を使用しない場合の切替回数と、予備工具を使用した場合の切替回数との合計をそれぞれ算出するので、その合計の中で最も少ない切替回数Rの工具配置を求めることができる。この切替回数の合計が最小となる工具配置Qが最適工具配置Qoptとなるので、予備工具の使用の有無に関わらず、工具交換にかかる時間を効果的に短縮できる。   As described above, in the numerical control apparatus of the second embodiment, in addition to the effects of the first embodiment, when a spare tool is registered, the optimum tool arrangement Qopt including the spare tool can be calculated. The CPU calculates the total of the number of times of switching when the spare tool is not used and the number of times of switching when the spare tool is used for all the combinations of the tool arrangements Q. Therefore, the smallest number of times of switching R among the total is calculated. Can be obtained. Since the tool placement Q that minimizes the total number of times of switching is the optimum tool placement Qopt, the time required for tool replacement can be effectively shortened regardless of whether or not a spare tool is used.

なお、第2実施形態では、予備工具を使用しない場合の切替回数と、予備工具を使用した場合の切替回数とを合計しただけであるが、例えば、使用工具及び予備工具の工具寿命の比率に応じて、切替回数Rにその比率を反映させてもよい。上記実施形態において、工具T1と工具T10の工具寿命比率が2:3である場合、以下の式のように、切替回数Rにその比率を反映させてもよい。
・切替回数R=(備工具を使用しない場合の切替回数)×2+(予備工具を使用した場合の切替回数)×3
In the second embodiment, the number of times of switching when the spare tool is not used and the number of times of switching when the spare tool is used are only totaled. Accordingly, the ratio may be reflected in the switching frequency R. In the above embodiment, when the tool life ratio between the tool T1 and the tool T10 is 2: 3, the ratio may be reflected in the switching number R as in the following equation.
・ Number of times of switching R = (Number of times of switching when the tool is not used) × 2 + (Number of times of switching when the spare tool is used) × 3

次に、第3実施形態である数値制御装置について、図18を参照して説明する。第3実施形態では、複数のNCプログラムを実行する場合でも、最適工具配置Qoptを算出できる。なお、第3実施形態は、第1,第2実施形態の変形例であり、第1,第2実施形態で説明した数値制御装置20の構成、制御方法と同様であるので、異なる部分を中心に説明する。同じ構成部分については、第1,第2実施形態と同符号を付して説明する。   Next, the numerical control apparatus which is 3rd Embodiment is demonstrated with reference to FIG. In the third embodiment, the optimum tool placement Qopt can be calculated even when a plurality of NC programs are executed. The third embodiment is a modification of the first and second embodiments, and is similar to the configuration and control method of the numerical control device 20 described in the first and second embodiments. Explained. The same components will be described with the same reference numerals as those in the first and second embodiments.

例えば、フラッシュメモリ24のNCプログラム記憶エリア241(図8参照)に、図18に示す2つのNCプログラム(NCプログラム1、NCプログラム2)が記憶されている場合を想定する。
・使用工具番号=T1,T5,T8,T9(NCプログラム1)
・使用工具番号=T10,T5,T8,T9(NCプログラム2)
・使用工具本数N=4本
・NCプログラム1中における工具Tの使用順=「T1→T5→T8→T1→T5→T8→T9」
・NCプログラム2中における工具Tの使用順=「T10→T5→T8→T10→T5→T8→T9」
For example, it is assumed that two NC programs (NC program 1 and NC program 2) shown in FIG. 18 are stored in the NC program storage area 241 (see FIG. 8) of the flash memory 24.
・ Tool number used: T1, T5, T8, T9 (NC program 1)
・ Tool number used: T10, T5, T8, T9 (NC program 2)
-Number of tools used N = 4-Order of use of tools T in NC program 1 = "T1->T5->T8->T1->T5->T8->T9"
・ Use order of tool T in NC program 2 = “T10 → T5 → T8 → T10 → T5 → T8 → T9”

このような条件の下で、最適工具配置Qoptを算出する場合、第3実施形態の数値制御装置のCPU21は、第2実施形態と同様の処理を実行する。即ち、図11のフローチャートと同様の処理をCPU21が行うことで、複数のNCプログラムを実行する場合を考慮した最適工具配置Qoptを求めることができる。第2実施形態では、予備工具を使用しない場合と、予備工具を使用した場合とで、工具配置Qの切替回数を算出し、合計を求めて、最も少ない最適工具配置Qoptを求めている。第3実施形態では、NCプログラム1を実行した場合と、NCプログラム2を実行した場合とで、工具配置Qの切替回数を算出し、合計を求めて、最も少ない切替回数Roptである最適工具配置Qoptを求めればよい。   When calculating the optimum tool placement Qopt under such conditions, the CPU 21 of the numerical control device of the third embodiment executes the same processing as in the second embodiment. In other words, the CPU 21 performs the same processing as that in the flowchart of FIG. 11 so that the optimum tool placement Qopt considering the case of executing a plurality of NC programs can be obtained. In the second embodiment, the number of times of switching the tool arrangement Q is calculated when the spare tool is not used and when the spare tool is used, the total is obtained, and the smallest optimum tool arrangement Qopt is obtained. In the third embodiment, when the NC program 1 is executed and when the NC program 2 is executed, the number of times of switching the tool placement Q is calculated, and the total is obtained to obtain the optimum tool placement that is the smallest number of times of switching Ropt. What is necessary is just to obtain | require Qopt.

具体的には、第2実施形態のポット切替テーブル2521(図16参照)と同様のテーブルをフラッシュメモリ24に記憶させればよい。つまり、予備工具未使用時テーブル部81を、NCプログラム1実行時テーブル部(図示省略)とし、予備工具使用時テーブル部82を、NCプログラム2実行時テーブル部(図示省略)とする。   Specifically, a table similar to the pot switching table 2521 (see FIG. 16) of the second embodiment may be stored in the flash memory 24. That is, the spare tool unused table section 81 is the NC program 1 execution table section (not shown), and the spare tool use table section 82 is the NC program 2 execution table section (not shown).

そして、図11のフローチャートのS14,S19において以下の処理が実行される。まず、NCプログラム1を実行した場合の切替工程は、NCプログラム1実行時テーブル部に記憶される。NCプログラム1の実行時の切替回数Rが算出され、合計(A)欄741に記憶される。なお、NCプログラム1実行時テーブル部には、図16の予備工具未使用時テーブル部81の記憶内容と同じ値が記憶される。NCプログラム1の切替回数Rは10回である。   Then, the following processing is executed in S14 and S19 of the flowchart of FIG. First, the switching process when the NC program 1 is executed is stored in the NC program 1 execution time table section. The number of times of switching R when the NC program 1 is executed is calculated and stored in the total (A) column 741. The NC program 1 execution time table portion stores the same value as the stored content of the spare tool unused time table portion 81 of FIG. The switching frequency R of the NC program 1 is 10 times.

一方、NCプログラム2を実行した場合の切替工程は、NCプログラム2実行時テーブル部に記憶される。そして、NCプログラム1の実行時の切替回数Rが算出され、合計(B)欄742に記憶される。なお、NCプログラム2実行時テーブル部には、図16の予備工具使用時テーブル部82の記憶内容と同じ値が記憶される。NCプログラム2の切替回数Rは12回である。そして、これらの総合計が算出される。本実施例では22回であるので、総合計欄75には「22」が記憶される。この切替回数の総合計が、NCプログラム1,2を考慮した工具配置Qの切替回数Rとなる。なお、図11に示すS14,S19において、NCプログラム1を実行した場合の切替回数と、NCプログラム2を実行した場合の切替回数との総合計を算出するCPU21が本発明の「第2総切替回数算出手段」に相当する。   On the other hand, the switching process when the NC program 2 is executed is stored in the NC program 2 execution time table section. Then, the number of times of switching R when the NC program 1 is executed is calculated and stored in the total (B) column 742. The NC program 2 execution time table portion stores the same value as the stored contents of the spare tool use time table portion 82 of FIG. The switching frequency R of the NC program 2 is 12 times. These totals are then calculated. In this embodiment, since 22 times, “22” is stored in the grand total column 75. The total number of times of switching is the number of times of switching R of the tool arrangement Q considering the NC programs 1 and 2. In S14 and S19 shown in FIG. 11, the CPU 21 for calculating the total sum of the number of times of switching when the NC program 1 is executed and the number of times of switching when the NC program 2 is executed is the “second total switching” of the present invention. This corresponds to “number of times calculation means”.

次いで、ここで生成された工具配置Qが現時点での最適工具配置Qoptとして、RAM23の最適工具配置記憶エリア233(図7参照)に記憶され、算出された切替回数Rが現時点での最適切替回数RoptとしてRAM23の最適切替回数記憶エリア234に記憶され、RAM23の計算回数記憶エリア235に計算回数S=1が記憶される(S15)。以降は、第1実施形態と同様の処理が実行される。つまり、工具配置Qの全組合せについて、NCプログラム1を実行した場合の切替回数と、NCプログラム2を実行した場合の切替回数との合計がそれぞれ算出され、その合計の中で最も少ない切替回数Rの工具配置が求められる。この切替回数の合計が最小となる工具配置Qが、最適工具配置Qoptとなる。なお、NCプログラムが1つの場合は、第1実施形態と同様の処理が実行される。   Next, the tool placement Q generated here is stored in the optimum tool placement storage area 233 (see FIG. 7) of the RAM 23 as the optimum tool placement Qopt at the present time, and the calculated switching number R is the optimum switching number at the present time. The Ropt is stored in the optimal switching count storage area 234 of the RAM 23, and the calculation count S = 1 is stored in the calculation count storage area 235 of the RAM 23 (S15). Thereafter, the same processing as in the first embodiment is executed. That is, the total number of times of switching when the NC program 1 is executed and the number of times of switching when the NC program 2 is executed are calculated for all combinations of the tool arrangements Q, and the smallest number of times of switching R among the total is calculated. Tool arrangement is required. The tool placement Q that minimizes the total number of times of switching is the optimum tool placement Qopt. When there is one NC program, the same processing as in the first embodiment is executed.

以上説明したように、第3実施形態の数値制御装置では、第1実施形態の効果に加え、複数のNCプログラムを実行する場合において、それら複数のNCプログラムを考慮した最適工具配置Qoptを算出できる。NCプログラム1,2を実行する場合、CPU21は、工具配置Qの全組合せについて、NCプログラム1を実行した場合の切替回数と、NCプログラム2を実行した場合の切替回数との合計をそれぞれ算出するので、その合計の中で最も少ない切替回数Rの工具配置を求めることができる。この切替回数の合計が最小となる工具配置Qが最適工具配置Qoptとなるので、複数のNCプログラムを実行する場合でも、工具交換にかかる時間を効果的に短縮できる。   As described above, in the numerical control apparatus of the third embodiment, in addition to the effects of the first embodiment, when executing a plurality of NC programs, it is possible to calculate the optimum tool arrangement Qopt considering the plurality of NC programs. . When the NC programs 1 and 2 are executed, the CPU 21 calculates the total of the number of times of switching when the NC program 1 is executed and the number of times of switching when the NC program 2 is executed for all combinations of the tool arrangement Q. Therefore, it is possible to obtain the tool arrangement with the smallest number of switching times R in the total. Since the tool placement Q that minimizes the total number of times of switching is the optimum tool placement Qopt, the time required for tool change can be effectively shortened even when a plurality of NC programs are executed.

なお、第3実施形態では、NCプログラム1を実行した場合の切替回数と、NCプログラム2を実行した場合の切替回数とを合計しただけであるが、例えば、NCプログラムの運転回数の比率に応じて、切替回数Rにその比率を反映させてもよい。上記実施形態において、NCプログラム1とNCプログラム2の運転回数比率が2:3である場合、以下の式のように、切替回数Rにその比率を反映させてもよい。
・切替回数R=(NCプログラム1を実行した場合の切替回数)×2+(NCプログラム2を実行した場合の切替回数)×3
In the third embodiment, the number of times of switching when the NC program 1 is executed and the number of times of switching when the NC program 2 is executed are only totaled. Thus, the ratio may be reflected in the switching frequency R. In the above embodiment, when the operation frequency ratio of the NC program 1 and the NC program 2 is 2: 3, the ratio may be reflected in the switching frequency R as in the following equation.
・ Number of switching times R = (number of times of switching when NC program 1 is executed) × 2 + (number of times of switching when NC program 2 is executed) × 3

次に、第4実施形態の数値制御装置について、図19〜図21を参照して説明する。第4実施形態の数値制御装置は、図19に示す工作機械90に搭載されるものである。工作機械90は、回転テーブル190を備えるものである。図19に示すように、回転テーブル190は、主軸(図示省略)側の加工領域と前室との間を仕切る仕切壁130の下側に設けられている。回転テーブル190は、XY軸方向に移動可能に支持されると共に180度旋回することができる。   Next, a numerical control apparatus according to a fourth embodiment will be described with reference to FIGS. The numerical control device of the fourth embodiment is mounted on a machine tool 90 shown in FIG. The machine tool 90 includes a rotary table 190. As shown in FIG. 19, the rotary table 190 is provided below the partition wall 130 that partitions the machining area on the main shaft (not shown) side and the front chamber. The rotary table 190 is supported so as to be movable in the XY axis directions and can turn 180 degrees.

第1実施形態では、上記したように、1つのNCプログラムを連続して実行する場合を想定して、工具配置Qにおける工具ポットPの切替回数Rが算出について、補助切替回数を考慮した。回転テーブル190が設置された工作機械90では、加工領域側の一端側に固定されたワークの加工終了後、回転テーブル190が旋回している間に、次の加工の最初に使用する工具Tへの交換が可能である。   In the first embodiment, as described above, assuming the case where one NC program is continuously executed, the auxiliary switching frequency is considered in calculating the switching frequency R of the tool pot P in the tool arrangement Q. In the machine tool 90 in which the rotary table 190 is installed, the tool T used at the beginning of the next machining is performed while the rotary table 190 is turning after the work fixed to one end on the machining area side is finished. Can be exchanged.

第4実施形態の数値制御装置は、工作機械90に回転テーブル190が設置されている場合は、補助切替回数を切替回数Rの算出に含めないこととする。第4実施形態の数値制御装置は、第1実施形態の数値制御装置の構成と同様であるので、異なる部分を中心に説明する。また、数値制御装置のCPUによる制御方法についても、第1実施形態と異なる部分を中心に説明する。   The numerical control device of the fourth embodiment does not include the auxiliary switching number in the calculation of the switching number R when the rotary table 190 is installed in the machine tool 90. Since the numerical control device of the fourth embodiment is the same as the configuration of the numerical control device of the first embodiment, different parts will be mainly described. Also, the control method by the CPU of the numerical control device will be described focusing on the differences from the first embodiment.

まず、フラッシュメモリ224について、図20を参照して説明する。フラッシュメモリ224は、数値制御装置が備えるものである。フラッシュメモリ224には、第1実施形態と同じであるNCプログラム記憶エリア241、ポット切替テーブル記憶エリア242に加え、回転テーブルフラグ記憶エリア245と、短縮フラグ記憶エリア246とが少なくとも設けられている。回転テーブルフラグ記憶エリア245には、回転テーブル190の設置の有無を示す回転テーブルフラグが記憶される。短縮フラグ記憶エリア246には、切替回数Rの算出に関し、補助切替回数を含めるか否かを示す短縮フラグが記憶される。   First, the flash memory 224 will be described with reference to FIG. The flash memory 224 is provided in the numerical controller. The flash memory 224 is provided with at least a rotation table flag storage area 245 and a shortened flag storage area 246 in addition to the NC program storage area 241 and the pot switching table storage area 242 that are the same as those in the first embodiment. The rotation table flag storage area 245 stores a rotation table flag indicating whether or not the rotation table 190 is installed. The shortening flag storage area 246 stores a shortening flag indicating whether or not to include the auxiliary switching number for the calculation of the switching number R.

次に、CPUによる回転テーブルフラグ設定処理について説明する。例えば、図14のディスプレイ11に表示されている画面の左隅の工具配置計算ボタン110がユーザによって選択されると、本処理が実行される。本処理では、まず、ディスプレイ11に「回転テーブルが設置されていますか?」のメッセージと、「YES」「NO」の各ボタンとが表示される。ユーザによって、「YES」が選択されると、フラッシュメモリ224の回転テーブル記憶エリアに「1」が記憶され、「NO」が選択されると、「0」が記憶される。こうして、本処理が終了し、後述する工具配置算出処理が実行される。   Next, rotation table flag setting processing by the CPU will be described. For example, when the tool placement calculation button 110 at the left corner of the screen displayed on the display 11 of FIG. 14 is selected by the user, this processing is executed. In this process, first, a message “Is a rotating table installed?” And buttons “YES” and “NO” are displayed on the display 11. When “YES” is selected by the user, “1” is stored in the rotation table storage area of the flash memory 224, and when “NO” is selected, “0” is stored. In this way, this process is complete | finished and the tool arrangement | positioning calculation process mentioned later is performed.

次に、CPUによる工具配置算出処理について、図21を参照して説明する。本処理は、第1実施形態のCPU21による工具配置算出処理(図11参照)において、S13とS14との間に、回転テーブル190の設置の有無によって、切替回数Rの算出に関して、補助切替回数を含めるか否かを決定する処理(S30,S31,S32)が設けられる。   Next, tool placement calculation processing by the CPU will be described with reference to FIG. In this processing, in the tool placement calculation processing (see FIG. 11) by the CPU 21 of the first embodiment, the auxiliary switching frequency is calculated regarding the calculation of the switching frequency R depending on whether or not the rotary table 190 is installed between S13 and S14. Processing (S30, S31, S32) for determining whether or not to include is provided.

具体的には、本処理が開始され、工具交換指令の読み込みによって、最初の工具配置Qが生成されると(S10〜S13)、回転テーブル190が設置されているか否かが判断される(S30)。ここで、フラッシュメモリ224の回転テーブルフラグ記憶エリア245に「1」が記憶されている場合は、回転テーブル190が設置されているので(S30:YES)、フラッシュメモリ224の短縮フラグ記憶エリア246に「1」が記憶される(S31)。一方、回転テーブルフラグ記憶エリア245に「1」が記憶されていない場合は、回転テーブル190が設置されていないので(S30:NO)、フラッシュメモリ224の短縮フラグ記憶エリア246に「0」が記憶される。なお、S30の処理を実行するCPUが本発明の「回転テーブル設置判断手段」に相当する。   Specifically, when this process is started and the first tool arrangement Q is generated by reading the tool change command (S10 to S13), it is determined whether or not the rotary table 190 is installed (S30). ). Here, when “1” is stored in the rotation table flag storage area 245 of the flash memory 224, the rotation table 190 is installed (S30: YES), and therefore the shortening flag storage area 246 of the flash memory 224 is stored. “1” is stored (S31). On the other hand, when “1” is not stored in the rotary table flag storage area 245, the rotary table 190 is not installed (S 30: NO), and therefore “0” is stored in the shortened flag storage area 246 of the flash memory 224. Is done. The CPU that executes the process of S30 corresponds to the “rotary table installation determination unit” of the present invention.

次いで、上記したように、工具配置Qの全組合せについて、切替回数Rが随時算出されるが(S15、S19)、フラッシュメモリ224の短縮フラグ記憶エリア246に「1」が記憶されている場合は、補助切替回数を考慮せずに、切替回数Rが算出される。一方、フラッシュメモリ224の短縮フラグ記憶エリア246に「0」が記憶されている場合は、回転しない通常のテーブル19であるので、第1実施形態と同様に、補助切替回数を考慮して、切替回数Rが算出される。これにより、回転テーブル190が設置された場合の作業に応じた最適工具配置Qoptを求めることができる。その他の処理については、第1実施形態と同じである。   Next, as described above, the number of times of switching R is calculated as needed for all combinations of the tool arrangement Q (S15, S19), but when “1” is stored in the shortened flag storage area 246 of the flash memory 224. The number of times of switching R is calculated without considering the number of times of auxiliary switching. On the other hand, when “0” is stored in the shortening flag storage area 246 of the flash memory 224, it is a normal table 19 that does not rotate. Therefore, as in the first embodiment, the switching is performed in consideration of the auxiliary switching frequency. The number of times R is calculated. Thereby, the optimal tool arrangement | positioning Qopt according to the operation | work when the rotary table 190 is installed can be calculated | required. Other processes are the same as those in the first embodiment.

なお、本実施例では、ユーザの操作パネル100からの入力操作によって、フラッシュメモリ224の回転テーブルフラグ記憶エリア245に、回転テーブル190の設置の有無を示す回転テーブルフラグを記憶させたがこの他の方法でもよい。例えば、数値制御装置の入出力インタフェイス26に回転テーブル190が接続されているか否かを判断してもよい。   In this embodiment, a rotary table flag indicating whether or not the rotary table 190 is installed is stored in the rotary table flag storage area 245 of the flash memory 224 by a user's input operation from the operation panel 100. The method may be used. For example, it may be determined whether or not the rotary table 190 is connected to the input / output interface 26 of the numerical controller.

以上説明したように、第4実施形態の数値制御装置では、ユーザの入力操作により、回転テーブル190が設置されている場合は、フラッシュメモリ224の回転テーブルフラグ記憶エリア245に「1」が記憶され、回転テーブル190が設置されていない場合は、「0」が記憶される。回転テーブルフラグが「1」か「0」かによって、補助切替回数を考慮して切替回数Rを算出するかしないかが決定される。回転テーブル190が設置されている場合は、補助切替回数を切替回数Rの算出に含めないので、回転テーブル190が設置された場合の作業に応じた最適工具配置Qoptを求めることができる。   As described above, in the numerical control apparatus according to the fourth embodiment, when the rotary table 190 is installed by a user input operation, “1” is stored in the rotary table flag storage area 245 of the flash memory 224. When the turntable 190 is not installed, “0” is stored. Whether or not to calculate the switching number R in consideration of the auxiliary switching number is determined depending on whether the rotation table flag is “1” or “0”. When the rotary table 190 is installed, the auxiliary switching count is not included in the calculation of the switching count R, so that the optimum tool placement Qopt corresponding to the work when the rotary table 190 is installed can be obtained.

なお、本発明の工具配置算出装置は、上記実施形態に限らず、各種の変形が可能なことはいうまでもない。上記各実施形態では、数値制御装置20を工具配置算出装置として説明したが、例えば、一般的なPC(パーソナルコンピュータ)であってもよい。この場合、PCのCPUで算出された最適工具配置Qoptについて、工具配置表をプリンタで印刷し、印刷された工具配置表を確認しながら、工具マガジン31に工具Tを装着することができる。   Needless to say, the tool arrangement calculating apparatus of the present invention is not limited to the above-described embodiment, and various modifications are possible. In each of the above embodiments, the numerical control device 20 has been described as a tool arrangement calculation device. However, for example, a general PC (personal computer) may be used. In this case, with respect to the optimum tool arrangement Qopt calculated by the CPU of the PC, the tool arrangement table can be printed by the printer, and the tool T can be mounted on the tool magazine 31 while checking the printed tool arrangement table.

また、上記各実施形態において、切替回数Rの算出に関しては、例えば、フラッシュメモリ等に記憶したライブラリを使うことで、速やかに処理を実行することができる。   Further, in each of the embodiments described above, regarding the calculation of the switching number R, for example, the processing can be executed promptly by using a library stored in a flash memory or the like.

また、上記各実施形態では、図12に示すように、使用工具の工具配置の全組合せについて切替回数Rを算出したが、例えば、「1589」の配置と「9851」のように、順列を逆にした順列は切替回数が同じになる。従って、順列を逆にして同じになる順列については計算せずに、計算回数SをN!/2としてもよい。この場合、計算回数Sが少なくなるので、工具配置算出処理を速やかに実行できる。なお、工具ポットPの全ポット数と、使用工具本数Nとが同じである場合は、工具Tの順列は円順列となるため、計算回数Sを(N−1)!/2とすることもできる。   Further, in each of the above embodiments, as shown in FIG. 12, the number of times of switching R is calculated for all combinations of tool arrangements of the tools used. For example, the permutation is reversed as in the arrangement of “1589” and “9851”. The permutations that have been made have the same number of switchings. Therefore, the number of calculations S is set to N! Without calculating permutations that are the same by reversing the permutations. / 2. In this case, since the number of calculations S is reduced, the tool placement calculation process can be executed quickly. When the total number of pots in the tool pot P and the number N of used tools are the same, since the permutation of the tool T is a circular permutation, the number of calculations S is (N-1)! / 2.

1 工作機械
10 操作パネル
11 ディスプレイ
12 キーボード
20 数値制御装置
21 CPU
23 RAM
24 フラッシュメモリ
30 工具交換装置
31 工具マガジン
90 工作機械
100 操作パネル
124 フラッシュメモリ
190 回転テーブル
224 フラッシュメモリ
P 工具ポット
T 工具
DESCRIPTION OF SYMBOLS 1 Machine tool 10 Operation panel 11 Display 12 Keyboard 20 Numerical control apparatus 21 CPU
23 RAM
24 Flash memory 30 Tool changer 31 Tool magazine 90 Machine tool 100 Operation panel 124 Flash memory 190 Rotary table 224 Flash memory P Tool pot T Tool

Claims (10)

工作機械の工具交換装置に回転割り出し可能に設けられ、正転又は反転する略円盤状の工具マガジンの外周に設けられた複数のポットに各々配置される複数の工具の配置を算出する工具配置算出装置であって、
前記工作機械の加工プログラムから工具交換指令を読み込む工具交換指令読込手段と、
当該工具交換指令読込手段によって読み込まれた前記工具交換指令より、前記加工プログラムで使用される使用工具を特定する使用工具特定手段と、
当該使用工具特定手段によって特定された前記使用工具の配置の全ての組合せを算出する配置組合せ算出手段と、
当該配置組合せ算出手段によって算出された各組合せの配置で、前記加工プログラムで指令された順番で前記使用工具を使用した場合に、前記ポットの切り替えに必要な切替回数を、前記組合せ毎に計数する切替回数計数手段と、
当該切替回数計数手段によって前記組合せ毎に計数された複数の前記切替回数の中から、最も少ない切替回数である最小回数を特定する最小回数特定手段と、
当該最小回数特定手段によって特定された前記最小回数に対応する前記組合せの配置の情報である配置情報を出力する配置情報出力手段と
を備えたことを特徴とする工具配置算出装置。
Tool arrangement calculation for calculating the arrangement of a plurality of tools respectively arranged in a plurality of pots provided on the outer periphery of a substantially disk-shaped tool magazine that is provided on a tool changer of a machine tool so that it can be rotated and indexed. A device,
Tool change command reading means for reading a tool change command from the machining program of the machine tool;
Use tool specifying means for specifying a tool used in the machining program from the tool change command read by the tool change command reading means;
An arrangement combination calculating means for calculating all combinations of the arrangement of the used tools specified by the used tool specifying means;
In the arrangement of each combination calculated by the arrangement combination calculating means, when the tools are used in the order instructed by the machining program, the number of times required for switching the pot is counted for each combination. Switching number counting means;
Among the plurality of switching times counted for each combination by the switching number counting means, the minimum number specifying means for specifying the minimum number that is the smallest number of switching times;
A tool arrangement calculation device comprising: arrangement information output means for outputting arrangement information which is arrangement information of the combination corresponding to the minimum number of times specified by the minimum number of times specifying means.
前記切替回数は、前記加工プログラムで指令される最後の使用工具のポットから最初の使用工具のポットに切り替えるために必要な切替回数を含むことを特徴とする請求項1に記載の工具配置算出装置。   2. The tool arrangement calculating device according to claim 1, wherein the number of times of switching includes a number of times of switching required to switch from a pot of the last used tool to be commanded by the machining program to a pot of the first used tool. . 前記使用工具の予備として使用され、前記使用工具とは別のポットに配置される予備工具を登録する予備工具登録手段を備え、
当該予備工具登録手段によって前記予備工具が登録されている場合、
前記配置組合せ算出手段は、
前記使用工具特定手段によって特定された前記使用工具及び前記予備工具の配置の全ての組合せを算出し、
前記切替回数計数手段は、
前記予備工具を使用しない場合の前記切替回数である第1切替回数と、前記予備工具を前記使用工具の代わりに使用した場合の前記切替回数である第2切替回数とを、前記組合せ毎にそれぞれ計数し、
前記最小回数特定手段は、
前記第1切替回数と前記第2切替回数との和である第1総切替回数を前記組合せ毎に算出する第1総切替回数算出手段を備え、
当該第1総切替回数算出手段によって前記組合せ毎に算出された前記第1総切替回数のうち、最小の回数を特定することを特徴とする請求項1又は2に記載の工具配置算出装置。
A spare tool registration means for registering a spare tool that is used as a spare for the tool used and is arranged in a pot different from the tool used;
When the spare tool is registered by the spare tool registration means,
The arrangement combination calculating means includes:
Calculating all combinations of the use tool and the spare tool specified by the use tool specifying means;
The switching number counting means includes
A first switching number that is the number of times of switching when the spare tool is not used, and a second switching number that is the number of times of switching when the spare tool is used instead of the used tool, for each combination. Count,
The minimum number specifying means is:
A first total switching number calculating means for calculating, for each combination, a first total switching number that is a sum of the first switching number and the second switching number;
3. The tool arrangement calculating device according to claim 1, wherein a minimum number of times among the first total switching times calculated for each of the combinations by the first total switching number calculating unit is specified.
前記工具交換指令読込手段によって、複数の加工プログラムから前記工具交換指令が各々読み込まれた場合、
前記切替回数計数手段は、
前記加工プログラム毎の前記切替回数を前記組合せ毎にそれぞれ計数し、
前記最小回数特定手段は、
前記加工プログラム毎に計数された前記切替回数の和である第2総切替回数を前記組合せ毎に算出する第2総切替回数算出手段を備え、
当該第2総切替回数算出手段によって前記組合せ毎に算出された前記第2総切替回数のうち、最小の回数を特定することを特徴とする請求項1又は2に記載の工具配置算出装置。
When the tool change command is read from a plurality of machining programs by the tool change command reading means,
The switching number counting means includes
Count the number of switching for each machining program for each combination,
The minimum number specifying means is:
A second total switching number calculating means for calculating, for each combination, a second total switching number that is a sum of the switching times counted for each machining program;
3. The tool arrangement calculating device according to claim 1, wherein a minimum number of times among the second total number of switching times calculated for each of the combinations by the second total switching number calculating unit is specified.
前記使用工具の本数である使用工具本数をNとした場合、
前記配置組合せ算出手段は、
N!を算出することによって、前記組合せの数を導出することを特徴とする請求項1乃至4の何れかに記載の工具配置算出装置。
When the number of tools used, which is the number of tools used, is N,
The arrangement combination calculating means includes:
N! The tool arrangement calculating device according to any one of claims 1 to 4, wherein the number of the combinations is derived by calculating.
前記工具マガジンの前記ポットの数と、前記使用工具本数とが同じ場合、
前記配置組合せ算出手段は、
(N−1)!/2を算出することによって、前記組合せの数を導出することを特徴とする請求項5に記載の工具配置算出装置。
When the number of pots in the tool magazine is the same as the number of tools used,
The arrangement combination calculating means includes:
(N-1)! The tool arrangement calculating apparatus according to claim 5, wherein the number of combinations is derived by calculating / 2.
前記工具マガジンを正転させるか反転させるかを決定する回転方向決定手段を備え、
前記使用工具は、前記工具マガジンの外周に沿って正転方向に配置され、
前記工具マガジンの前記ポットの数をPとし、使用中の工具のポットから次に使用する工具のポットに切り替えるために必要な切替回数をKとした場合において、
K≧(P/2)+1となるときは、前記回転方向決定手段は、前記工具マガジンを反転させることを決定することを特徴とする請求項1乃至6の何れかに記載の工具配置算出装置。
A rotation direction determining means for determining whether the tool magazine is rotated normally or reversed;
The tool used is arranged in the forward rotation direction along the outer periphery of the tool magazine,
In the case where the number of pots of the tool magazine is P, and the number of times of switching required to switch from the pot of the tool being used to the pot of the tool to be used next is K,
The tool arrangement calculating device according to claim 1, wherein when K ≧ (P / 2) +1, the rotation direction determining unit determines to invert the tool magazine. .
前記工作機械に、ワークを支持する台が回転する回転テーブルが設置されているか否かを判断する回転テーブル設置判断手段と、
当該回転テーブル設置判断手段によって前記回転テーブルが設置されていると判断された場合、
前記切替回数計数手段は、
前記切替回数には、前記加工プログラムで指令される最後の使用工具のポットから最初の使用工具のポットに切り替えるために必要な切替回数を含めないことを特徴とする請求項2に記載の工具配置算出装置。
A rotary table installation determining means for determining whether or not a rotary table on which a table for supporting a workpiece rotates is installed in the machine tool;
When it is determined by the rotary table installation determination means that the rotary table is installed,
The switching number counting means includes
3. The tool arrangement according to claim 2, wherein the number of times of switching does not include the number of times of switching required to switch from the pot of the last used tool commanded by the machining program to the pot of the first used tool. Calculation device.
工作機械の工具交換装置に設けられ、正転又は反転する略円盤状の工具マガジンの外周に設けられた複数のポットに各々配置される複数の工具の配置を算出する工具配置算出装置を機能させる工具配置算出装置の制御プログラムであって、
前記工作機械の加工プログラムから工具交換指令を読み込む工具交換指令読込ステップと、
当該工具交換指令読込ステップにおいて読み込まれた前記工具交換指令より、前記加工プログラムで使用される使用工具を特定する使用工具特定ステップと、
当該使用工具特定ステップにおいて特定された前記使用工具の配置の全ての組合せを算出する配置組合せ算出ステップと、
当該配置組合せ算出ステップにおいて算出された各組合せの配置で、前記加工プログラムで指令された順番で前記使用工具を使用した場合に、前記ポットの切り替えに必要な切替回数を、前記組合せ毎に計数する切替回数計数ステップと、
当該切替回数計数ステップにおいて前記組合せ毎に計数された複数の前記切替回数の中から、最も少ない切替回数である最小回数を特定する最小回数特定ステップと、
当該最小回数特定ステップにおいて特定された前記最小回数に対応する前記組合せの配置の情報である配置情報を出力する配置情報出力ステップと
を備えたことを特徴とする工具配置算出装置の制御プログラム。
Provided in a tool changer of a machine tool to function a tool arrangement calculation device that calculates the arrangement of a plurality of tools respectively arranged in a plurality of pots provided on the outer periphery of a substantially disk-shaped tool magazine that rotates forward or reverse A control program for a tool arrangement calculation device,
A tool change command reading step for reading a tool change command from the machining program of the machine tool;
From the tool change command read in the tool change command reading step, a used tool specifying step for specifying a tool used in the machining program,
An arrangement combination calculating step of calculating all combinations of the arrangement of the used tools specified in the used tool specifying step;
In the arrangement of each combination calculated in the arrangement combination calculation step, the number of times of switching necessary for the pot switching is counted for each combination when the tools are used in the order instructed by the machining program. Switching frequency counting step;
A minimum number specifying step for specifying a minimum number of times of switching among a plurality of the switching times counted for each combination in the switching number counting step;
A control program for a tool arrangement calculating device, comprising: an arrangement information output step for outputting arrangement information which is arrangement information of the combination corresponding to the minimum number specified in the minimum number specifying step.
請求項9に記載の制御プログラムを記憶したコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the control program according to claim 9.
JP2010016120A 2010-01-28 2010-01-28 Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium Active JP5327082B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010016120A JP5327082B2 (en) 2010-01-28 2010-01-28 Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010016120A JP5327082B2 (en) 2010-01-28 2010-01-28 Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium

Publications (2)

Publication Number Publication Date
JP2011152616A JP2011152616A (en) 2011-08-11
JP5327082B2 true JP5327082B2 (en) 2013-10-30

Family

ID=44538931

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010016120A Active JP5327082B2 (en) 2010-01-28 2010-01-28 Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium

Country Status (1)

Country Link
JP (1) JP5327082B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7409822B2 (en) * 2019-10-18 2024-01-09 ファナック株式会社 numerical control device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59118318A (en) * 1982-12-24 1984-07-09 Hitachi Ltd Intensive system in combination of tool for nc device
JPS6124132U (en) * 1984-07-16 1986-02-13 三菱重工業株式会社 Automatic tool changer for NC machine tools
JP2849268B2 (en) * 1992-03-23 1999-01-20 オークマ株式会社 Numerical controller with tool sorting function
JP3537922B2 (en) * 1995-07-24 2004-06-14 オークマ株式会社 Method and apparatus for rearranging tools in machine tools

Also Published As

Publication number Publication date
JP2011152616A (en) 2011-08-11

Similar Documents

Publication Publication Date Title
CN104932419B (en) Simulation device using manual operation of working machines
JP5802377B2 (en) Tool changer for machine tools
JP5333938B2 (en) Industrial equipment and machine tools
JP6692437B2 (en) Machine Tools
JP2015079286A (en) Numerical control device including operation setting screen
JP6400095B2 (en) Machine tool controller
WO2023032382A1 (en) Display control device, machine tool, and display control program
JP2010099766A (en) Machine tool including automatic tool changing device
JP6359026B2 (en) Processing machine line
US7058473B2 (en) Method and device for generation of machining program
JP2011237880A (en) Controller of machine tool equipped with tool change position automatic determination function
JP5327082B2 (en) Tool arrangement calculation device, control program for tool arrangement calculation device, and storage medium
JP2012011492A (en) Tool arrangement computing device, tool arrangement computing program, and storage medium
JP6584593B2 (en) Machine Tools
WO2021161737A1 (en) Display control device
JP7821141B2 (en) Machine tool and display control program
JP5110021B2 (en) Numerical control device for machine tools
JP4549051B2 (en) Machine tool axis control device, machine tool axis control program
JP2010234449A (en) Tool changer
JP7704059B2 (en) Numerical control device, control method and program
JPH0596433A (en) Manual tool exchange method in machining center
JP2006095627A (en) Machine tool and tool change method for machine tool
JP2009080621A (en) Numerical control device, numerical control program, and storage medium storing numerical control program
JP6879256B2 (en) Machine tools, control methods and computer programs
JP2024108912A (en) Control device, control method, and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120215

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130620

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130625

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130708

R150 Certificate of patent or registration of utility model

Ref document number: 5327082

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150