JP2009110223A - Numerical control device, numerical control program, and storage medium storing numerical control program - Google Patents

Numerical control device, numerical control program, and storage medium storing numerical control program Download PDF

Info

Publication number
JP2009110223A
JP2009110223A JP2007281239A JP2007281239A JP2009110223A JP 2009110223 A JP2009110223 A JP 2009110223A JP 2007281239 A JP2007281239 A JP 2007281239A JP 2007281239 A JP2007281239 A JP 2007281239A JP 2009110223 A JP2009110223 A JP 2009110223A
Authority
JP
Japan
Prior art keywords
subprogram
numerical control
command
machining program
thermal displacement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007281239A
Other languages
Japanese (ja)
Inventor
Haruo Kobayashi
治夫 小林
Yutaka Murakami
裕 村上
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 JP2007281239A priority Critical patent/JP2009110223A/en
Publication of JP2009110223A publication Critical patent/JP2009110223A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a numerical control device stopping driving of a predetermined spindle to operate a machine tool. <P>SOLUTION: A main spindle flag is set to "1" when there is an "M300" command in a machining program. The main spindle flag is set to "0" when there is an "M301" command. A table flag is set to "1" when there is an "M302 " command. The table flag is set to "0" when there is an "M303" command. If the main spindle flag is "1" and the table flag is "1" (S31: Yes and S32: Yes), the rotation of the main spindle and the movement of the table are forbidden to carry out processing. If the main spindle flag is "1" and the table flag is "0" (S31: Yes and S32: No), the rotation of the main spindle is forbidden to carry out processing. If the main spindle flag is "0" and the table flag is "1" (S31: No and S33: Yes), the movement of the table is forbidden to carry out processing. If both the main spindle flag and table flag are "0" (S31: No and S33: No), processing is carried out as usual according to instructions. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、数値制御装置、数値制御プログラム及び数値制御プログラムを記憶した記憶媒体に関するものであり、詳細には、所定の軸の駆動を停止させて工作機械を動作させる数値制御装置、数値制御プログラム及び数値制御プログラムを記憶した記憶媒体に関するものである。   The present invention relates to a numerical control device, a numerical control program, and a storage medium storing the numerical control program, and more particularly, a numerical control device and a numerical control program for operating a machine tool by stopping driving of a predetermined axis. And a storage medium storing a numerical control program.

従来、特定の軸のみの駆動を停止させて工作機械を動作させたいという需要があった。例えば、主軸や送り軸の熱変位補正機能を持った工作機械である。熱変位補正機能を持った工作機械においては、パラメータを用いて熱変位補正を行っている。そこで、パラメータを決定するために、実際に加工プログラムを繰り返し実行し、熱変位量を計測して、パラメータを算出している(例えば、特許文献1参照)。ここで、主軸ヘッドや送り軸のボールネジに対する熱変位は軸の回転により発生し、パラメータは熱変位が発生する軸ごとに決定される。そこで、主軸のみを駆動させて主軸による熱変位量計測したり、送り軸のみを駆動させて送り軸による熱変位量を計測したりしている。また、熱変位量は軸の回転時間や回転速度により異なり、製品を加工するための加工プログラムにより異なる。よって、加工プログラムごとに熱変位量を計測し、熱変位補正用のパラメータを決定する必要がある。そこで、各軸のパラメータを決定するためには、加工プログラムごとに、特定の軸のみを駆動させた場合の熱変位量を計測する必要がある。そのため、従来は、加工プログラムから、主軸のみが駆動する計測用加工プログラムや、送り軸のみが駆動する計測用加工プログラムを作成して、計測用の加工プログラムを繰り返し実行して熱変位量を計測し、パラメータを決定していた。
特開平11−90780号公報
Conventionally, there has been a demand for stopping the driving of only a specific axis and operating a machine tool. For example, it is a machine tool having a thermal displacement correction function for a main shaft and a feed shaft. In a machine tool having a thermal displacement correction function, thermal displacement correction is performed using parameters. Therefore, in order to determine the parameter, the machining program is actually repeatedly executed, the amount of thermal displacement is measured, and the parameter is calculated (see, for example, Patent Document 1). Here, the thermal displacement of the spindle head and the feed shaft with respect to the ball screw is generated by the rotation of the shaft, and the parameters are determined for each axis on which the thermal displacement occurs. Therefore, only the main shaft is driven to measure the thermal displacement amount by the main shaft, or only the feed shaft is driven to measure the thermal displacement amount by the feed shaft. The amount of thermal displacement varies depending on the rotation time and rotation speed of the shaft, and varies depending on the machining program for machining the product. Therefore, it is necessary to measure the amount of thermal displacement for each machining program and determine the parameters for correcting the thermal displacement. Therefore, in order to determine the parameters of each axis, it is necessary to measure the amount of thermal displacement when only a specific axis is driven for each machining program. Therefore, conventionally, a machining program for measurement driven only by the spindle or a machining program for measurement driven only by the feed axis is created from the machining program, and the measurement machining program is repeatedly executed to measure the amount of thermal displacement. And parameters were determined.
JP-A-11-90780

しかしながら、加工プログラムから計測用加工プログラムを作成するのは大変な手間になり、計測用加工プログラムに誤りがあれば、正確な熱変位量を計測できず、好ましいパラメータを決定できないという問題点がある。また、タップ加工のように主軸の回転とZ軸(主軸とワークとが対向する方向の軸)の回転が同期する動作においては、主軸のみを動作させる計測用加工プログラムを作成するのは困難であるという問題点があった。   However, creating a measurement machining program from a machining program is very time consuming, and if there is an error in the measurement machining program, there is a problem that an accurate thermal displacement cannot be measured and a preferable parameter cannot be determined. . In addition, it is difficult to create a measurement machining program that operates only the main axis in an operation in which the rotation of the main axis and the rotation of the Z axis (the axis in the direction in which the main axis and the workpiece face each other) are synchronized as in tapping. There was a problem that there was.

本発明は、上述の問題点を解決するためになされたものであり、所定の軸の駆動を停止させて工作機械を動作させる数値制御装置、数値制御プログラム及び数値制御プログラムを記憶した記憶媒体を提供することを目的とする。   The present invention has been made to solve the above-described problems, and includes a numerical control device that stops driving a predetermined axis and operates a machine tool, a numerical control program, and a storage medium that stores the numerical control program. The purpose is to provide.

上記課題を解決するため、請求項1に係る発明の数値制御装置では、主軸により保持された工具を動作させ、冶具に固定されたワークを加工する工作機械を加工プログラムに基づいて数値制御する数値制御装置であって、前記加工プログラムに記載されている指令に基づいて前記工作機械の所定の軸を駆動させる軸駆動手段と、前記加工プログラムにより所定の軸の駆動を禁止する駆動禁止指令が指示されている場合には、前記軸駆動手段の駆動を行わないように制御する駆動禁止制御手段とを備えている。   In order to solve the above-described problem, in the numerical control device according to the first aspect of the present invention, a numerical value for numerically controlling a machine tool that operates a tool held by a spindle and processes a workpiece fixed to a jig based on a processing program. A control device, which is instructed by shaft drive means for driving a predetermined axis of the machine tool based on a command described in the machining program, and a drive prohibition command for prohibiting driving of the predetermined axis by the machining program If it is, drive inhibition control means for controlling the shaft drive means not to be driven is provided.

また、請求項2に係る発明の数値制御装置では、請求項1に記載の発明の構成に加えて、前記所定の軸は、前記主軸、及び、前記ワークを移動させるための送り軸のうちの少なくとも1つであることを特徴とする。   Further, in the numerical control device according to the second aspect of the present invention, in addition to the configuration of the first aspect, the predetermined axis is one of the main axis and a feed axis for moving the workpiece. It is characterized by being at least one.

また、請求項3に係る発明の数値制御装置では、請求項1又は2に記載の発明の構成に加えて、前記加工プログラムにより前記駆動禁止指令を解除する駆動禁止解除指令が指示されている場合には、前記駆動禁止制御手段による前記軸駆動手段の駆動を行わない制御を解除する駆動禁止解除手段を備えている。   In addition, in the numerical control device of the invention according to claim 3, in addition to the configuration of the invention of claim 1 or 2, when a drive prohibition release command for canceling the drive prohibition command is instructed by the machining program Includes a drive prohibition canceling unit that cancels the control that does not drive the shaft driving unit by the drive prohibition control unit.

また、請求項4に係る発明の数値制御装置では、請求項1乃至3のいずれかに記載の発明の構成に加えて、前記加工プログラムにより、他の前記加工プログラムを呼び出してサブプログラムとして実行するサブプログラム実行指令が指示された際に、呼び出された加工プログラムであるサブプログラムを実行するサブプログラム実行手段と、前記サブプログラム実行手段により前記サブプログラムが実行されている場合に、当該サブプログラムにより加工プログラムを終了させるプログラム終了指令が指示された際には、当該プログラム終了指令を、サブプログラムの実行を終了させるサブプログラム終了指令に変換する変換手段とを備えている。   Further, in the numerical control device according to the fourth aspect of the invention, in addition to the configuration of the invention according to any one of the first to third aspects, the machining program calls another machining program and executes it as a subprogram. When a subprogram execution command is instructed, subprogram execution means for executing a subprogram that is a called machining program, and when the subprogram is executed by the subprogram execution means, When a program end command for ending the machining program is instructed, conversion means is provided for converting the program end command into a subprogram end command for ending the execution of the subprogram.

また、請求項5に係る発明の数値制御装置では、請求項4に記載の発明の構成に加えて、計測対象位置の座標を計測するタッチプローブと、前記サブプログラムを実行する前に前記タッチプローブにより前記計測基準位置の座標を計測し、基準座標とする基準座標取得手段と、前記基準座標取得手段により取得された前記基準座標を記憶する基準座標記憶手段と、前記タッチプローブにより前記計測基準位置の座標を計測し、前記基準座標記憶手段に記憶された前記基準座標との差を熱変位量とする熱変位量取得手段と、前記熱変位量取得手段により取得された前記熱変位量を記憶する計測熱変位量記憶手段と、前記サブプログラムを繰り返し実行するサブプログラム実行手段と、前記サブプログラム実行手段により前記サブプログラムが繰り返し実行されている間、所定のタイミングで前記熱変位量取得手段により前記熱変位量を取得し、取得された前記熱変位量を前記計測熱変位量記憶手段へ記憶する熱変位量記録手段とを備え、前記サブプログラム実行手段は、前記熱変位量取計測手段により取得された前記熱変位量が所定の値となるまで、又は、前記サブプログラムを所定回数実行するまで、又は、所定時間経過するまで前記サブプログラムを繰り返し実行することを特徴とする。   According to a fifth aspect of the present invention, in addition to the configuration of the fourth aspect of the invention, the touch probe for measuring the coordinates of the measurement target position and the touch probe before the subprogram is executed. The reference coordinate acquisition unit that measures the coordinates of the measurement reference position by using the reference coordinate acquisition unit, the reference coordinate storage unit that stores the reference coordinate acquired by the reference coordinate acquisition unit, and the measurement reference position by the touch probe The thermal displacement amount acquisition means that measures the difference from the reference coordinates stored in the reference coordinate storage means as the thermal displacement amount, and stores the thermal displacement amount acquired by the thermal displacement amount acquisition means. The measured thermal displacement storage means, the subprogram execution means for repeatedly executing the subprogram, and the subprogram executed by the subprogram execution means. A thermal displacement amount recording means for acquiring the thermal displacement amount by the thermal displacement amount acquisition means at a predetermined timing and storing the acquired thermal displacement amount in the measured thermal displacement amount storage means during the return execution; The subprogram execution means includes the thermal displacement amount acquired by the thermal displacement amount measuring means until a predetermined value is reached, or the subprogram is executed a predetermined number of times, or a predetermined time has elapsed. The sub-program is repeatedly executed until it is done.

また、請求項6に係る発明の数値制御プログラムでは、コンピュータを請求項1乃至5のいずれかに記載の数値制御装置の各種処理手段として動作させる。   In the numerical control program according to the sixth aspect of the invention, the computer is operated as various processing means of the numerical control apparatus according to any one of the first to fifth aspects.

また、請求項7に係る発明のコンピュータ読み取り可能な記憶媒体では、請求項6に記載の数値制御プログラムを記憶している。   A computer-readable storage medium according to a seventh aspect stores the numerical control program according to the sixth aspect.

請求項1に係る発明の数値制御装置では、加工プログラムにより所定の軸の駆動を禁止する駆動禁止指令が指示されている場合には、軸駆動手段の駆動を行わないように制御することができる。よって、所定の軸を駆動させないような加工プログラムを作成しなくても、加工プログラムに駆動禁止指令を記載するだけで、所定の軸を駆動させないように制御できる。したがって、所定の軸を駆動させないような加工プログラムを作成する手間がない。また、複数の軸が同時に回転する動作においても、所定の軸のみを駆動させないようにできる。   In the numerical control device according to the first aspect of the present invention, when the drive prohibiting command for prohibiting the driving of the predetermined axis is instructed by the machining program, the shaft driving means can be controlled not to be driven. . Therefore, even if a machining program that does not drive the predetermined axis is not created, it is possible to control the predetermined axis not to be driven only by writing a drive prohibition command in the machining program. Therefore, there is no need to create a machining program that does not drive a predetermined axis. Further, even in an operation in which a plurality of axes rotate at the same time, only a predetermined axis can be prevented from being driven.

また、請求項2に係る発明の数値制御装置では、請求項1に記載の発明の効果に加えて、所定の軸を、前記主軸、及び、前記ワークを移動させるための送り軸のうちの少なくとも1つとすることができるので、主軸のみを動作させなくしたり、送り軸のみを動作させなくしたりできる。よって、加工プログラムによるワーク加工において、加工物の精度に密接に関係する主軸及び送り軸のうちの少なくとも1つを動作させずに加工プログラムに基づいて工作機械を数値制御することができる。   In addition, in the numerical control device according to the second aspect of the present invention, in addition to the effect of the first aspect, at least one of the predetermined shaft, the main shaft, and the feed shaft for moving the workpiece is provided. Since only one spindle can be used, it is possible to make only the spindle not to operate or to make only the feed axis not to operate. Therefore, in the workpiece machining by the machining program, the machine tool can be numerically controlled based on the machining program without operating at least one of the main shaft and the feed shaft that are closely related to the accuracy of the workpiece.

また、請求項3に係る発明の数値制御装置では、請求項1又は2に記載の発明の効果に加えて、加工プログラムにより前記駆動禁止指令を解除する駆動禁止解除指令が指示されている場合には、前記駆動禁止制御手段による前記軸駆動手段の駆動を行わない制御を解除することができる。よって、所定の軸を駆動させたくない場合だけ軸の駆動を停止させ、駆動させたい時には駆動禁止を解除して軸を駆動させることができる。   In addition, in the numerical control device of the invention according to claim 3, in addition to the effect of the invention according to claim 1 or 2, when a drive prohibition release command for canceling the drive prohibition command is instructed by a machining program Can cancel the control that does not drive the shaft drive means by the drive prohibition control means. Therefore, the drive of the shaft can be stopped only when it is not desired to drive the predetermined shaft, and the drive prohibition can be canceled and the shaft can be driven when the drive is desired.

また、請求項4に係る発明の数値制御装置では、請求項1乃至3のいずれかに記載の発明の効果に加えて、サブプログラムが実行されている場合に、サブプログラムにより加工プログラムを終了させるプログラム終了指令が指示された際には、プログラム終了指令を、サブプログラムの実行を終了させるサブプログラム終了指令に変換することができる。加工プログラムの最後には加工プログラムの実行を終了させるプログラム終了指令が記述されている。加工プログラム中で他の加工プログラムを呼び出してサブプログラムとして実行した際に、サブプログラムとされた加工プログラム(サブプログラム)に「プログラム終了指令」がある場合には、サブプログラムを終了させるだけでなく、サブプログラムを呼び出した加工プログラムまで終了させて工作機械に対する数値制御が終了してしまう。そこで、サブプログラムとされる加工プログラムには「プログラム終了指令」でなく、「サブプログラムの実行を終了させるサブプログラム終了指令」を記載する必要がある。しかしながら、請求項4に記載の発明の数値制御装置では、サブプログラムとして加工プログラムが実行されている場合には、「プログラム終了指令」を「サブプログラム終了指令」に変換することができる。よって、加工プログラムをサブプログラムとして実行したい場合に、加工プログラムの「プログラム終了指令」を「サブプログラム終了指令」に変更しておく必要がないので、ユーザの手間が省ける。さらに、加工プログラムに手を入れないことで、思わぬ部分がミスで変更されてしまったり、消去されてしまったりして、加工プログラムへの不必要な変更が行われてしまうことを防止できる。   Further, in the numerical control device according to the fourth aspect of the invention, in addition to the effect of the invention according to any one of the first to third aspects, when the subprogram is executed, the machining program is terminated by the subprogram. When a program end command is instructed, the program end command can be converted into a subprogram end command for ending the execution of the subprogram. At the end of the machining program, a program end command for terminating the execution of the machining program is described. When calling a machining program in a machining program and executing it as a subprogram, if there is a “program end command” in the machining program (subprogram) that is a subprogram, not only the subprogram is terminated. Then, the machining program that called the subprogram is terminated, and the numerical control for the machine tool is terminated. Therefore, it is necessary to describe not the “program end command” but the “subprogram end command for ending the execution of the subprogram” in the machining program as the subprogram. However, in the numerical control device according to the fourth aspect of the present invention, when the machining program is executed as the subprogram, the “program end command” can be converted into the “subprogram end command”. Therefore, when it is desired to execute the machining program as a subprogram, it is not necessary to change the “program end command” of the machining program to the “subprogram end command”. Furthermore, it is possible to prevent an unnecessary change from being made to the machining program due to an unexpected part being changed by mistake or being erased by not handling the machining program.

また、請求項5に係る発明の数値制御装置では、請求項4に記載の発明の効果に加えて、サブプログラムが繰り返し実行されている間、所定のタイミングで前記熱変位量を取得し、取得された前記熱変位量を計測熱変位量記憶手段へ記憶することができる。そこで、駆動禁止指令により所定の軸の駆動を禁止する指示を行った後に、熱変位量を計測したい加工プログラムをサブプログラムとして実行させる加工プログラムを作成する。そして、この加工プログラムに基づいて工作機械を数値制御させることにより、ある加工プログラムの所定の軸の熱変位量を計測することができる。   In addition, in the numerical control device according to the fifth aspect of the invention, in addition to the effect of the fourth aspect of the invention, the thermal displacement amount is acquired and acquired at a predetermined timing while the subprogram is repeatedly executed. The measured thermal displacement amount can be stored in the measured thermal displacement amount storage means. Therefore, after giving an instruction to prohibit driving of a predetermined axis by a drive prohibition command, a machining program is created that causes a machining program for measuring the amount of thermal displacement to be executed as a subprogram. Then, by performing numerical control of the machine tool based on this machining program, it is possible to measure the thermal displacement amount of a predetermined axis of a certain machining program.

また、請求項6に係る発明の数値制御プログラムでは、コンピュータを請求項1乃至5のいずれかに記載の数値制御装置の各種処理手段として動作させることができる。したがって、請求項1乃至5のいずれかに記載の発明と同様の効果を奏することができる。   In the numerical control program according to the sixth aspect of the present invention, the computer can be operated as various processing means of the numerical control apparatus according to any one of the first to fifth aspects. Therefore, the same effect as that of any one of claims 1 to 5 can be obtained.

また、請求項7に係る発明のコンピュータ読み取り可能な記憶媒体は、請求項6に記載の数値制御プログラムを記憶することができる。したがって、請求項6に記載の発明と同様の効果を奏することができ、請求項1乃至5のいずれかに記載の発明と同様の効果を奏することができる。   A computer-readable storage medium according to a seventh aspect of the invention can store the numerical control program according to the sixth aspect. Therefore, the same effect as that of the invention described in claim 6 can be obtained, and the same effect as that of the invention described in any of claims 1 to 5 can be obtained.

以下、本発明の実施の形態を図面を参照して説明する。本実施の形態の数値制御装置1(図1参照)は、被加工物(ワーク)を工具を用いて加工する装置である。数値制御装置1はワークをテーブルに固定しており、テーブルに対向して工具の装着された主軸が配置されている。そして、テーブルを移動させて加工対象位置を工具位置に合わせ、工具を作動(回転、上昇、下降)させてワークを加工する。テーブルの移動方向は、工具に近づく方向をZ軸方向とし、Z軸方向に直交する平面上で直交する2方向をX軸方向、Y軸方向とする。そして、テーブルをX軸方向、Y軸方向に移動させて、ワークのX−Y平面の加工位置を決定し、Z軸方向に移動させることにより、工具との距離が決定される。このテーブルの移動指令及び工具の作動の指令は加工プログラム(図3参照)に記述されており、加工プログラムを1行ずつ解釈して、工具を移動、作動させる。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. The numerical control device 1 (see FIG. 1) of the present embodiment is a device that processes a workpiece (workpiece) using a tool. The numerical control device 1 fixes a workpiece to a table, and a spindle on which a tool is mounted is disposed opposite the table. Then, the work is machined by moving the table to align the machining target position with the tool position and actuating (rotating, raising and lowering) the tool. As for the moving direction of the table, the direction approaching the tool is defined as the Z-axis direction, and the two directions perpendicular to the plane perpendicular to the Z-axis direction are defined as the X-axis direction and the Y-axis direction. Then, the table is moved in the X-axis direction and the Y-axis direction, the machining position of the workpiece on the XY plane is determined, and the distance to the tool is determined by moving in the Z-axis direction. This table movement command and tool operation command are described in the machining program (see FIG. 3), and the tool is moved and operated by interpreting the machining program line by line.

ここで、図1を参照して、数値制御装置1の電気的構成について説明する。図1は、数値制御装置1の電気的構成を示すブロック図である。図1に示すように、数値制御装置1には、数値制御装置1の制御を行うCPU10が設けられている。このCPU10は、数値制御装置1全体の制御の中心となるプロセッサであり、バス20を介して、ROM11,入力インターフェース13,出力インターフェース12,RAM14,フラッシュメモリ18に接続されている。そして、ROM11には、数値制御装置1の制御を行う制御プログラムが記憶されており、CPU10はROM11から制御プログラムを読み出し、この制御プログラムがRAM14の加工プログラム記憶エリア145にロードされた加工プログラムを読み出してワークの加工を実行する。また、フラッシュメモリ18には、計測された熱変位量が記憶される熱変位量記憶エリアが設けられている。   Here, the electrical configuration of the numerical controller 1 will be described with reference to FIG. FIG. 1 is a block diagram showing an electrical configuration of the numerical controller 1. As shown in FIG. 1, the numerical control device 1 is provided with a CPU 10 that controls the numerical control device 1. The CPU 10 is a processor that is the center of control of the entire numerical controller 1, and is connected to the ROM 11, the input interface 13, the output interface 12, the RAM 14, and the flash memory 18 via the bus 20. The ROM 11 stores a control program for controlling the numerical control device 1. The CPU 10 reads the control program from the ROM 11, and this control program reads the machining program loaded in the machining program storage area 145 of the RAM 14. To process the workpiece. The flash memory 18 is provided with a thermal displacement amount storage area in which the measured thermal displacement amount is stored.

そして、入力インターフェース13には、キーボード15、起動スイッチ16、タッチプローブ17が接続されている。キーボード15は、数値制御装置1に種々の情報を入力することができる。起動スイッチ16は、加工プログラムの実行を指示するスイッチである。ONされると、加工プログラムが読み出され、1行ごとに指令が実行される。タッチプローブ17は、主軸に取り付けられ、計測対象位置の座標を取得する。また、出力インターフェース12には、工具をX軸方向へ移動させるためのX軸モータ31を駆動する駆動回路21、工具をY軸方向へ移動させるためのY軸モータ32を駆動する駆動回路22、工具をZ軸方向へ移動させるためのZ軸モータ33を駆動するための駆動回路23、主軸を回転させる主軸モータ34を駆動する駆動回路24、表示装置35の制御を行う制御回路25を接続している。フラッシュメモリ18には、熱変位量記憶エリア181が設けられている。   A keyboard 15, a start switch 16, and a touch probe 17 are connected to the input interface 13. The keyboard 15 can input various information to the numerical controller 1. The start switch 16 is a switch for instructing execution of the machining program. When turned ON, the machining program is read and a command is executed for each line. The touch probe 17 is attached to the spindle and acquires the coordinates of the measurement target position. The output interface 12 includes a drive circuit 21 for driving an X-axis motor 31 for moving the tool in the X-axis direction, a drive circuit 22 for driving a Y-axis motor 32 for moving the tool in the Y-axis direction, A drive circuit 23 for driving the Z-axis motor 33 for moving the tool in the Z-axis direction, a drive circuit 24 for driving the spindle motor 34 for rotating the spindle, and a control circuit 25 for controlling the display device 35 are connected. ing. The flash memory 18 is provided with a thermal displacement amount storage area 181.

次に、図2を参照して、RAM14に設けられている記憶エリアについて説明する。図2は、RAM14に設けられている記憶エリアを示す模式図である。図2に示すように、RAM14には、主軸フラグ記憶エリア141,テーブルフラグ記憶エリア142,サブフラグ記憶エリア143,ワーク記憶エリア144が設けられている。主軸フラグ記憶エリア141には主軸フラグが記憶される。主軸フラグは「1」が記憶されている場合に、主軸の動作を禁止する。「0」が記憶されている場合は、主軸の動作は禁止されない。主軸の動作とは、主軸モータ34の回転を実施しないということである。テーブルフラグ記憶エリア142にはテーブルフラグが記憶される。テーブルフラグは「1」が記憶されている場合に、テーブルの動作を禁止する。「0」が記憶されている場合は、テーブルの動作は禁止されない。テーブルの動作とは、X軸モータ31及びY軸モータ32、Z軸モータ33の回転を実施しないということである。サブフラグ記憶エリア143には、サブフラグが記憶される。サブフラグは「1」以上である場合に、サブプログラムの実行中であることを示している。サブフラグが「1」であれば、メインの加工プログラムにより呼び出された1階層目のサブプログラムが実行中であることを示し、「2」であれば、1階層目のサブプログラムにより呼び出された2階層目のサブプログラムが実行中であることを示している。「0」が記憶されている場合にはサブプログラムを実行中でないことを示している。   Next, a storage area provided in the RAM 14 will be described with reference to FIG. FIG. 2 is a schematic diagram showing a storage area provided in the RAM 14. As shown in FIG. 2, the RAM 14 is provided with a spindle flag storage area 141, a table flag storage area 142, a sub flag storage area 143, and a work storage area 144. The spindle flag storage area 141 stores a spindle flag. The spindle flag prohibits the operation of the spindle when “1” is stored. When “0” is stored, the operation of the spindle is not prohibited. The operation of the main shaft means that the main shaft motor 34 is not rotated. A table flag storage area 142 stores a table flag. The table flag prohibits the operation of the table when “1” is stored. When “0” is stored, the operation of the table is not prohibited. The operation of the table means that the X-axis motor 31, the Y-axis motor 32, and the Z-axis motor 33 are not rotated. A sub flag is stored in the sub flag storage area 143. When the subflag is “1” or more, it indicates that the subprogram is being executed. If the subflag is “1”, it indicates that the subprogram of the first layer called by the main machining program is being executed. If it is “2”, 2 is called by the subprogram of the first layer. This indicates that the subprogram in the hierarchy is being executed. When “0” is stored, it indicates that the subprogram is not being executed.

次に、図3を参照して、加工プログラムについて説明する。図3は、加工プログラムの模式図である。図3に示すように、加工プログラムは1行を1ブロックとして、工具やテーブルの動作が定義されている。図3では1ブロックごとに符号を付与している。1行目のブロックをブロック101、2行目のブロックをブロック102、・・・、22行目のブロックをブロック122としている。図3に示した加工プログラムは、全22行の加工プログラムである。ブロック101,104,109に記載されている「#100」、ブロック102,113,118に記載されている「#101」は本加工プログラムで使用される変数である。これらの変数は、RAM14のワーク記憶エリア144に記憶エリアが確保され、記憶される。また、ブロック103,111,120に記載されている「N」で始まるコード(Nコード)は、加工プログラム中の場所を特定するためのコードである。   Next, the machining program will be described with reference to FIG. FIG. 3 is a schematic diagram of a machining program. As shown in FIG. 3, the machining program defines operations of tools and tables with one line as one block. In FIG. 3, a code is assigned to each block. A block in the first row is a block 101, a block in the second row is a block 102,..., And a block in the 22nd row is a block 122. The machining program shown in FIG. 3 is a machining program for all 22 lines. “# 100” described in the blocks 101, 104, and 109 and “# 101” described in the blocks 102, 113, and 118 are variables used in this machining program. These variables are stored with a storage area secured in the work storage area 144 of the RAM 14. The code (N code) beginning with “N” described in the blocks 103, 111, and 120 is a code for specifying a location in the machining program.

そして、ブロック105,107,114,116に記載されている「M98」というMコードはサブプログラムの実行を指示するコードである。ブロック105,114にあるように「M98 P1000」は「P1000」というサブプログラムを1回実行することを示している。また、ブロック107,116に記載されている「M98 P500 L10」は「P500」というサブプログラムを10回繰り返して実行することを示している。そして、ブロック104,110,113,119に記載されている「GOTO」は、その後に記載されている数字の位置へ進むことを示している。ブロック104の「GOTO 10」であれば、「N10」のブロック、つまり、ブロック111へ進むことを示している。そして、ブロック104に記載されている「IF [#100 GT 10]」は、「変数#100が10より大きくなったら」という条件分を示している。よって、ブロック104では、「変数#100が10より大きくなったらN10のブロックへ進む」ことを示している。ブロック113は同様に、「変数#101が10より大きくなったらN30のブロックへ進む」ことを示している。   The M code “M98” described in the blocks 105, 107, 114, and 116 is a code for instructing execution of the subprogram. As shown in blocks 105 and 114, “M98 P1000” indicates that the subprogram “P1000” is executed once. Further, “M98 P500 L10” described in the blocks 107 and 116 indicates that the subprogram “P500” is repeatedly executed 10 times. “GOTO” described in the blocks 104, 110, 113, and 119 indicates that the process proceeds to the position of the number described thereafter. “GOTO 10” in the block 104 indicates that the process proceeds to the block “N10”, that is, the block 111. “IF [# 100 GT 10]” described in the block 104 indicates a condition “if the variable # 100 becomes larger than 10”. Therefore, the block 104 indicates that “if the variable # 100 becomes larger than 10, proceed to the block N10”. Similarly, the block 113 indicates that “if the variable # 101 becomes larger than 10, proceed to the block N30”.

そして、ブロック112,121に記載されている「G04」は、「X」に続く数字で指定された秒数だけ待機することを示している。ブロック112,121では、90000秒、つまり、2時間30分待機することを示している。そして、「M30」というMコードは本加工プログラムの終了を示している。   Then, “G04” described in the blocks 112 and 121 indicates to wait for the number of seconds designated by the number following “X”. Blocks 112 and 121 indicate 90000 seconds, that is, waiting for 2 hours and 30 minutes. The M code “M30” indicates the end of the machining program.

次いで、本発明の要部である4つのMコードについて説明する。「M300」は主軸の動作を禁止する指令であり、「M301」は主軸の動作の禁止を解除する指令である。「M300」の指令が行われた後は、「M301」の指令が行われるまでの間、主軸モータ34は回転されない。「M302」はテーブルの動作を禁止する指令であり、「M303」はテーブルの動作の禁止を解除する指令である。「M302」の指令が行われた後は、「M303」の指令が行われるまでの間、X軸モータ31及びY軸モータ32、Z軸モータ33は回転されない。   Next, the four M codes that are the main part of the present invention will be described. “M300” is a command for prohibiting the operation of the spindle, and “M301” is a command for canceling the prohibition of the operation of the spindle. After the “M300” command is issued, the spindle motor 34 is not rotated until the “M301” command is issued. “M302” is a command for prohibiting the operation of the table, and “M303” is a command for canceling the prohibition of the table operation. After the “M302” command is issued, the X-axis motor 31, the Y-axis motor 32, and the Z-axis motor 33 are not rotated until the “M303” command is issued.

次に、図4及び図5を参照して、数値制御装置1がCPU10において制御プログラムを実行することにより行われる動作について説明する。図4及び図5は、制御プログラムの動作を示すフローチャートである。制御プログラムは、起動スイッチ16がONされると実施される。   Next, with reference to FIG.4 and FIG.5, the operation | movement performed when the numerical control apparatus 1 runs a control program in CPU10 is demonstrated. 4 and 5 are flowcharts showing the operation of the control program. The control program is executed when the start switch 16 is turned on.

まず、RAM14の主軸フラグ記憶エリア141,テーブルフラグ記憶エリア142,サブフラグ記憶エリア143に「0」が記憶されて、主軸フラグ,テーブルフラグ,サブフラグがOFFクリアされる(S1)。次いで、1ブロックが読み込まれ(S2)、読み込まれたブロックにMコードがあるか否かの判断が行われる(S3)。Mコードがなければ(S3:NO)、S21へ進み、指示実行処理が行われる(S21)。この指示実行処理では、ブロックに記載されている指示に応じた処理が実行される。   First, “0” is stored in the spindle flag storage area 141, the table flag storage area 142, and the sub flag storage area 143 of the RAM 14, and the spindle flag, table flag, and sub flag are cleared to OFF (S1). Next, one block is read (S2), and it is determined whether or not there is an M code in the read block (S3). If there is no M code (S3: NO), the process proceeds to S21 and an instruction execution process is performed (S21). In this instruction execution process, a process according to the instruction described in the block is executed.

図5に示すように、指示実行処理では、まず、主軸フラグが「1」であり(S31:YES)、テーブルフラグが「1」であれば(S32:YES)、主軸の回転もテーブルの移動も禁止されている。そこで、S2で読み込まれたブロックの指示を主軸の回転、及び、テーブルの移動を禁止して処理を実行する。具体的には、指示内容に応じた処理を行う際に、X軸モータ31を駆動する駆動回路21、Y軸モータ32を駆動する駆動回路22、Z軸モータ33を駆動する駆動回路23、主軸モータ34を駆動する駆動回路24に対しては指示を与えないようにする。また、主軸フラグが「1」であり(S31:YES)、テーブルフラグが「1」でなければ(S32:NO)、主軸の回転のみ禁止されている。そこで、S2で読み込まれたブロックの指示に対して、主軸の回転を禁止して処理を実行する。具体的には、指示内容に応じて各種駆動回路21〜25を制御する際に、主軸モータ34を駆動する駆動回路24に対しては指示を与えないようにする。   As shown in FIG. 5, in the instruction execution process, first, if the spindle flag is “1” (S31: YES) and the table flag is “1” (S32: YES), the rotation of the spindle and the movement of the table are also performed. Is also prohibited. Therefore, the block instruction read in S2 is executed while prohibiting the rotation of the spindle and the movement of the table. Specifically, when performing processing according to the instruction content, the drive circuit 21 that drives the X-axis motor 31, the drive circuit 22 that drives the Y-axis motor 32, the drive circuit 23 that drives the Z-axis motor 33, the spindle Instructions are not given to the drive circuit 24 that drives the motor 34. If the spindle flag is “1” (S31: YES) and the table flag is not “1” (S32: NO), only the rotation of the spindle is prohibited. Therefore, in response to the block instruction read in S2, the processing is executed while prohibiting the rotation of the spindle. Specifically, when the various drive circuits 21 to 25 are controlled in accordance with the contents of the instructions, instructions are not given to the drive circuit 24 that drives the spindle motor 34.

また、主軸フラグが「1」でなく(S31:NO)、テーブルフラグが「1」である場合には(S33:YES)、テーブルの移動のみが禁止されている。そこで、S2で読み込まれたブロックの指示に対して、テーブルの移動を禁止して処理を実行する(S36)。具体的には、指示内容に応じて各種駆動回路21〜25を制御する際に、X軸モータ31を駆動する駆動回路21、Y軸モータ32を駆動する駆動回路22、Z軸モータ33を駆動する駆動回路23に対しては指示を与えないようにする。また、主軸フラグもテーブルフラグも「1」でない場合には(S31:NO、S33:NO)、何も禁止されていないので、通常通り指示に応じた処理が実行される(S37)。なお、指示実行処理が終了すると(S21)、S2へ戻り、次のブロックが読み込まれる(S2)。   Further, when the spindle flag is not “1” (S31: NO) and the table flag is “1” (S33: YES), only the movement of the table is prohibited. Therefore, in response to the block instruction read in S2, the table movement is prohibited and the process is executed (S36). Specifically, when the various drive circuits 21 to 25 are controlled in accordance with the instruction contents, the drive circuit 21 that drives the X-axis motor 31, the drive circuit 22 that drives the Y-axis motor 32, and the Z-axis motor 33 are driven. An instruction is not given to the driving circuit 23 to be operated. If neither the spindle flag nor the table flag is “1” (S31: NO, S33: NO), nothing is prohibited, and processing according to the instruction is executed as usual (S37). When the instruction execution process ends (S21), the process returns to S2 and the next block is read (S2).

また、Mコードがある場合には(S3:YES)、Mコードの内容に応じてフラグ処理が行われた後に、Mコードで指示された処理が行われる。まず、「M30」であるか否かの判断が行われる(S4)。「M30」であれば(S4:YES)、本制御プログラムを終了させる必要がある。しかしながら、処理中のブロックがサブプログラムのものであれば、制御プログラムを終了させるのではなく、当該サブプログラムを呼び出した加工プログラムへ戻る必要がある。そこで、サブフラグが「1」以上であるか否かの判断が行われる(S13)。サブフラグが「1」以上であれば(S13:YES)、サブプログラムの実行中であり、サブプログラムにおいて「M30」が指示されていると判断できる。そこで、サブフラグから「1」減算され(S14)、サブプログラムが終了される(S15)。サブプログラムの終了では、当該サブプログラムを呼び出した加工プログラムの次のブロックが、次に読み込まれるブロックに指定される。そして、S2へ戻り、次のブロックが読み込まれる(S2)。また、サブフラグが「1」以上でなければ(S13:NO)、メインの加工プログラムからの「M30」の指示であるので、制御プログラムは終了される。   If there is an M code (S3: YES), a flag process is performed according to the content of the M code, and then a process instructed by the M code is performed. First, it is determined whether or not it is “M30” (S4). If it is “M30” (S4: YES), it is necessary to terminate this control program. However, if the block being processed is a subprogram, it is necessary not to end the control program but to return to the machining program that called the subprogram. Therefore, it is determined whether or not the sub flag is “1” or more (S13). If the sub flag is “1” or more (S13: YES), it can be determined that the sub program is being executed and that “M30” is instructed in the sub program. Therefore, “1” is subtracted from the subflag (S14), and the subprogram is terminated (S15). At the end of the subprogram, the next block of the machining program that called the subprogram is designated as the next block to be read. Then, the process returns to S2, and the next block is read (S2). On the other hand, if the sub flag is not “1” or more (S13: NO), since the instruction is “M30” from the main machining program, the control program is terminated.

また、Mコードが「M99」である場合には(S5:YES)、サブプログラムの終了が指示されている。そこで、サブフラグから「1」減算され(S14)、サブプログラムが終了される(S15)。当該サブプログラムを呼び出した加工プログラムの次のブロックが、次に読み込まれるブロックに指定される。そして、S2へ戻り、次のブロックが読み込まれる(S2)。また、Mコードが「M99」でなく(S5:NO)、「M98」である場合には(S6:YES)、サブプログラムの開始が指示されている。そこで、サブフラグに「1」が加算される(S16)。そして、S21でブロックに記載されている指示に応じた処理が実行される(S21)。具体的には、サブプログラムの開始は主軸回転、テーブル移動と関係ないので、主軸フラグ、テーブルフラグがいずれの値であっても(S31:YES,S32:YES、S31:YES,S32:NO、S31:NO,S33:YES、S31:NO,S33:NO)、サブプログラム開始の指令は実行される(S34、S35、S36、S37)。ここでは、次に読み込まれるブロックがサブプログラムの1つ目のブロックとされる。そして、S2へ戻り、サブプログラムの1つ目のブロックが読み込まれる(S2)。   If the M code is “M99” (S5: YES), the end of the subprogram is instructed. Therefore, “1” is subtracted from the subflag (S14), and the subprogram is terminated (S15). The next block of the machining program that called the subprogram is designated as the next block to be read. Then, the process returns to S2, and the next block is read (S2). When the M code is not “M99” (S5: NO) and “M98” (S6: YES), the start of the subprogram is instructed. Therefore, “1” is added to the subflag (S16). Then, a process according to the instruction described in the block in S21 is executed (S21). Specifically, since the start of the subprogram is not related to spindle rotation and table movement, regardless of the values of the spindle flag and table flag (S31: YES, S32: YES, S31: YES, S32: NO, S31: NO, S33: YES, S31: NO, S33: NO), the subprogram start command is executed (S34, S35, S36, S37). Here, the next block to be read is the first block of the subprogram. Then, the process returns to S2, and the first block of the subprogram is read (S2).

また、Mコードが「M98」でなく(S6:NO)、「M300」である場合には(S7:YES)、主軸フラグに「1」が記憶される(S17)。つまり、主軸の動作が禁止される。そして、指示実行処理が行われる(S21)。指示実行処理では、「M300」以外のコードが記載されている場合に、それに応じた処理が行われる。図3に示した例では、ブロック106には「M300」しか記載されておらず、その他の指令はないので、処理は実行されない。また、Mコードが「M300」でなく(S7:NO)、「M301」である場合には(S8:YES)、主軸フラグに「0」が記憶される(S18)。つまり、主軸の動作の禁止が解除される。そして、指示実行処理が行われる(S21)。指示実行処理では、「M301」以外のコードが記載されている場合に、それに応じた処理が行われる。図3に示した例では、ブロック108には「M301」しか記載されていないので、その他の指令はなく、処理は実行されない。   When the M code is not “M98” (S6: NO) and is “M300” (S7: YES), “1” is stored in the spindle flag (S17). That is, the operation of the spindle is prohibited. Then, an instruction execution process is performed (S21). In the instruction execution process, when a code other than “M300” is described, a process corresponding to the code is performed. In the example shown in FIG. 3, only “M300” is described in the block 106, and there is no other command, so the processing is not executed. When the M code is not “M300” (S7: NO) and “M301” (S8: YES), “0” is stored in the spindle flag (S18). That is, the prohibition of the operation of the spindle is released. Then, an instruction execution process is performed (S21). In the instruction execution process, when a code other than “M301” is described, a process corresponding to the code is performed. In the example shown in FIG. 3, since only “M301” is described in the block 108, there is no other command and the process is not executed.

また、Mコードが「M301」でなく(S8:NO)、「M302」である場合には(S9:YES)、テーブルフラグに「1」が記憶される(S19)。つまり、テーブルの動作が禁止される。そして、指示実行処理が行われる(S21)。指示実行処理では、「M302」以外のコードが記載されている場合に、それに応じた処理が行われる。図3に示した例では、ブロック115には「M302」しか記載されていないので、その他の指令はなく、処理は実行されない。また、Mコードが「M302」でなく(S9:NO)、「M303」である場合には(S10:YES)、テーブルフラグに「0」が記憶される(S20)。つまり、テーブルの動作の禁止が解除される。そして、指示実行処理が行われる(S21)。指示実行処理では、「M303」以外のコードが記載されている場合に、それに応じた処理が行われる。図3に示した例では、ブロック117には「M303」しか記載されていないので、その他の指令はなく、処理は実行されない。   If the M code is not “M301” (S8: NO) and “M302” (S9: YES), “1” is stored in the table flag (S19). That is, the operation of the table is prohibited. Then, an instruction execution process is performed (S21). In the instruction execution process, when a code other than “M302” is described, a process corresponding to the code is performed. In the example shown in FIG. 3, since only “M302” is described in the block 115, there is no other command and the process is not executed. If the M code is not “M302” (S9: NO) and “M303” (S10: YES), “0” is stored in the table flag (S20). That is, the prohibition of the table operation is released. Then, an instruction execution process is performed (S21). In the instruction execution process, when a code other than “M303” is described, a process corresponding to the code is performed. In the example shown in FIG. 3, since only “M303” is described in the block 117, there is no other command and the process is not executed.

そして、指令実行処理が行われたら(S21)、S2へ戻り次のブロックが読み出されて(S2)、繰り返しS3〜S20の処理が行われる。なお、サブプログラム実行中以外、つまり、メインの加工プログラム実行中に「M30」が指示された場合には(S4:YES、S13:NO)、制御プログラムは終了する。   When the command execution process is performed (S21), the process returns to S2, the next block is read (S2), and the processes of S3 to S20 are repeated. If “M30” is instructed during execution of the main machining program other than during the subprogram execution (S4: YES, S13: NO), the control program ends.

以上のようにして、制御プログラムでは、「M300」、「M301」、「M302」、「M303」の指令がある場合に、主軸フラグ又はテーブルフラグを更新する。これにより、加工プログラムにおいて、主軸を動作させたくない処理の指令の前のブロックに「M300」を記載すれば、その指令では主軸が動作しない。また、加工プログラムに「M301」の指令を記載すれば、主軸の動作を復活させることができる。さらに、加工プログラムにおいて、テーブルを移動させたくない処理の指令の前のブロックに「M302」を記載すれば、その指令ではテーブルが移動しない。また、加工プログラムに「M303」の指令を記載すれば、テーブル移動を復活させることができる。よって、ユーザの求めに柔軟に対応することができる。   As described above, in the control program, the spindle flag or the table flag is updated when there is a command of “M300”, “M301”, “M302”, or “M303”. As a result, if “M300” is described in the block before the command of the process in which the spindle is not desired to be operated in the machining program, the spindle does not operate with the command. If the command “M301” is described in the machining program, the operation of the spindle can be restored. Furthermore, if “M302” is described in the block before the command of the processing that does not want to move the table in the machining program, the table does not move with the command. Further, if the command “M303” is described in the machining program, the table movement can be restored. Therefore, it is possible to flexibly respond to user requests.

また、サブプログラムにおいて「M30」の指令があった場合には、制御プログラムを終了させるのではなく、サブプログラム終了の指令「M99」と同様の処理(S14、S15)が行われる。これにより、加工プログラムをサブプログラムとして実行したい場合に、加工プログラムの「M30」を「M99」にユーザが変更する必要がない。したがって、所定の軸を駆動させずに実行したい加工プログラムに手を加えることなく、そのままサブプログラムとして実行させることができる。よって、ユーザが「M99」に変更する際に他のブロックを変更してしまったり、削除してしまったりするミスを犯す危険がなくなる。   Further, when the command “M30” is issued in the subprogram, the control program is not terminated, but the same processing (S14, S15) as the subprogram termination command “M99” is performed. This eliminates the need for the user to change the machining program “M30” to “M99” when the machining program is to be executed as a subprogram. Therefore, the machining program desired to be executed without driving a predetermined axis can be directly executed as a subprogram without any modification. Therefore, when the user changes to “M99”, there is no risk of making a mistake of changing or deleting another block.

次に、図3に示した加工プログラムを具体例として、制御プログラムの動作を説明する。まず、主軸フラグ、テーブルフラグ、サブフラグがクリアされる(S1)。主軸フラグ=0、テーブルフラグ=0、サブフラグ=0である。そして、ブロック101『#100=0』が読み込まれ(S2)、Mコードはないので(S3:NO)、指示実行処理が行われる(S21)。主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指示が実行され、変数100=0とされる(S37)。そして、S2へ戻り、ブロック102『#101=0』が読み込まれる(S2)。Mコードはなく(S33:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指示が実行され、変数101=0とされる(S37)。そして、ブロック103『N20』が読み込まれる(S2)。Mコードはなく(S33:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指示が実行されるが、『N20』は位置指定であり指令はないので、実際に行われる処理はない(S37)。   Next, the operation of the control program will be described using the machining program shown in FIG. 3 as a specific example. First, the spindle flag, table flag, and sub flag are cleared (S1). The spindle flag = 0, the table flag = 0, and the sub flag = 0. Then, the block 101 “# 100 = 0” is read (S2), and since there is no M code (S3: NO), an instruction execution process is performed (S21). Since the spindle flag = 0 (S31: NO) and the table flag = 0 (S33: NO), the instruction is executed without any restriction, and the variable 100 is set to 0 (S37). Then, the process returns to S2, and the block 102 “# 101 = 0” is read (S2). Since there is no M code (S33: NO), the spindle flag = 0 (S31: NO), and the table flag = 0 (S33: NO), the instruction is executed without any restriction, and the variable 101 = 0 (S37). ). Then, the block 103 “N20” is read (S2). Since there is no M code (S33: NO), spindle flag = 0 (S31: NO), and table flag = 0 (S33: NO), the instruction is executed without any restrictions, but “N20” is a position designation. Since there is no command, there is no actual processing (S37).

そして、S2へ戻り、ブロック104『IF[#100 GT 10] GOTO 10』が読み込まれる(S2)。Mコードはなく(S33:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指示が実行される(S37)。具体的には、変数100が参照されて、「10」と比較される。ここでは、変数100=0なので、何も行われない。そして、ブロック105『M98 P1000』が読み込まれる(S2)。Mコードである(S33:YES)。そして、「M98」である(S4:NO、S5:NO、S6:YES)。そこで、サブフラグに「1」が加算されて、「1」となる(S16)。そして、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなくP1000のサブプログラムが読み出され、開始される。具体的には、次に読み出されるブロックがP1000の1つ目のブロックとされる。このP1000は、熱変位量を計測する加工プログラムである。図示しないが、このP1000の加工プログラムでは、主軸の工具交換が指示されており、タッチプローブが取り付けられる。そして、今回のように初めてP1000が実行される場合には、タッチプローブにより計測位置の座標が取得され、フラッシュメモリ18の熱変位量記憶エリア181に「基準座標」として記憶される。なお、2回目以降には、主軸の工具交換が指示されており、タッチプローブが取り付けられ、タッチプローブにより計測位置の座標が取得され、「基準座標」との差が算出される。そして、算出された値が「熱変位量」として、フラッシュメモリ18の熱変位量記憶エリア181に記憶される。   Then, returning to S2, the block 104 “IF [# 100 GT 10] GOTO 10” is read (S2). Since there is no M code (S33: NO), the spindle flag = 0 (S31: NO), and the table flag = 0 (S33: NO), the instruction is executed without any restriction (S37). Specifically, the variable 100 is referred to and compared with “10”. Here, since the variable 100 = 0, nothing is done. Then, the block 105 “M98 P1000” is read (S2). It is an M code (S33: YES). And it is "M98" (S4: NO, S5: NO, S6: YES). Therefore, “1” is added to the subflag to become “1” (S16). Since the spindle flag = 0 (S31: NO) and the table flag = 0 (S33: NO), the P1000 subprogram is read and started without any restrictions. Specifically, the next block to be read is the first block of P1000. This P1000 is a machining program for measuring the amount of thermal displacement. Although not shown, in the machining program of P1000, the tool change of the spindle is instructed and the touch probe is attached. When P1000 is executed for the first time as in this case, the coordinates of the measurement position are acquired by the touch probe and stored as “reference coordinates” in the thermal displacement amount storage area 181 of the flash memory 18. From the second time on, the tool change of the spindle is instructed, the touch probe is attached, the coordinates of the measurement position are acquired by the touch probe, and the difference from the “reference coordinates” is calculated. Then, the calculated value is stored as “thermal displacement amount” in the thermal displacement amount storage area 181 of the flash memory 18.

そこで、S2へ戻ると、P1000の1つ目のブロックが読み出される。そして、P1000の指示に応じてS3〜S20の処理が行われる。そして、P1000において「M30」又は「M99」が指示されるまで、繰り返し、S2〜S21の処理が行われる。P1000の最後のブロックが「M30」であれば(S4:YES)、サブフラグは「1」であり「1」以上であるので(S13:YES)、サブフラグは「1」減算され「0」となる(S14)。そして、サブプログラムP1000が終了される(S15)。ここでは、次に読み込むブロックがメイン加工プログラムの、当該サブプログラムを読み出したブロックの次のブロック(ブロック106)とされる。図3の例では、ブロック106が次に読み出すブロックとされる。実施されたサブプログラム「P1000」では、計測位置の座標が取得され、RAM14のワーク記憶エリア144に「基準座標」として記憶される。   Therefore, when returning to S2, the first block of P1000 is read. And the process of S3-S20 is performed according to the instruction | indication of P1000. Then, the processes of S2 to S21 are repeated until “M30” or “M99” is instructed in P1000. If the last block of P1000 is “M30” (S4: YES), the subflag is “1” and is “1” or more (S13: YES), so the subflag is subtracted by “1” to become “0”. (S14). Then, the subprogram P1000 is terminated (S15). Here, the block to be read next is the block (block 106) next to the block from which the subprogram is read out of the main machining program. In the example of FIG. 3, the block 106 is a block to be read next. In the executed subprogram “P1000”, the coordinates of the measurement position are acquired and stored in the work storage area 144 of the RAM 14 as “reference coordinates”.

そこで、S2へ戻り、メインの加工プログラムのブロック106『M300』が読み出される。Mコードであり(S3:YES)、「M300」であるので(S4:NO、S5:NO、S6:NO、S7:YES)、主軸フラグが「1」とされる(S17)。そして、主軸フラグ=1(S31:YES)、テーブルフラグ=0なので(S32:NO)、主軸の回転が禁止されて、その他の指令は実行される(S35)。しかし、『M300』は、主軸駆動禁止指令であり工作機械を駆動する指令はないので、実際に行われる処理はない。次いで、ブロック107『M98 P500 L10』が読み込まれる。Mコードであり(S3:YES)、「M98」であるので(S4:NO、S5:NO、S6:YES)、サブフラグに「1」が加算されて、「1」となる(S16)。そして、主軸フラグ=1(S31:YES)、テーブルフラグ=0なので(S32:NO)、主軸の制御が禁止されて、P500のサブプログラムが読み出され、開始される。具体的には、次に読み出されるブロックがP500の1つ目のブロックとされ、実行回数が1回目とされる。図示しないが、このP500は、工作機械においてワークを加工する加工プログラムである。   Then, the process returns to S2 and the main machining program block 106 “M300” is read out. Since it is an M code (S3: YES) and “M300” (S4: NO, S5: NO, S6: NO, S7: YES), the spindle flag is set to “1” (S17). Since the spindle flag = 1 (S31: YES) and the table flag = 0 (S32: NO), rotation of the spindle is prohibited and other commands are executed (S35). However, since “M300” is a spindle drive prohibition command and there is no command to drive the machine tool, there is no processing actually performed. Next, the block 107 “M98 P500 L10” is read. Since it is an M code (S3: YES) and “M98” (S4: NO, S5: NO, S6: YES), “1” is added to the subflag to become “1” (S16). Since the spindle flag = 1 (S31: YES) and the table flag = 0 (S32: NO), the spindle control is prohibited, and the P500 subprogram is read and started. Specifically, the next block to be read is the first block of P500, and the number of executions is the first. Although not shown, this P500 is a machining program for machining a workpiece in a machine tool.

1回目のP500の加工プログラムが開始され、S2へ戻ると、P500の1つ目のブロックが読み出される。そして、P500の指示に応じてS3〜S21の処理が行われる。そして、P500において「M30」又は「M99」が指示されるまで、繰り返し、S2〜S21の処理が行われる。P500の最後のブロックが「M30」であれば(S4:YES)、サブフラグは「1」であり「1」以上であるので(S13:YES)、サブフラグは「1」減算され「0」となる(S14)。そして、サブプログラムP500が終了される(S15)。ブロック107では、『L10』とあり、サブプログラムを10回繰り返して実施する指示が成されているので、実施回数が10未満である場合には、サブフラグに「1」が加算されて、再度、サブプログラムが開始される。つまり、次に読み出されるブロックがP500の1つ目のブロックとされる。   When the first P500 machining program is started and the process returns to S2, the first block of P500 is read out. And the process of S3-S21 is performed according to the instruction | indication of P500. And the process of S2-S21 is repeated until "M30" or "M99" is instruct | indicated in P500. If the last block of P500 is “M30” (S4: YES), since the sub flag is “1” and is “1” or more (S13: YES), the sub flag is subtracted by “1” to become “0”. (S14). Then, the subprogram P500 is terminated (S15). In block 107, “L10” is given, and an instruction to repeat the subprogram is performed 10 times. Therefore, when the number of executions is less than 10, “1” is added to the subflag, The subprogram is started. That is, the next block to be read out is the first block of P500.

そして、P500の1つ目のブロックが読み出される。そして、P500の指示に応じてS3〜S21の処理が行われる。そして、P500において「M30」又は「M99」が指示されるまで、繰り返し、S2〜S21の処理が行われる。さらに、実施回数が10回となるまで、繰り返し、S2〜S21の処理が行われる。この10回実施されるP500では、主軸フラグ=1となっているので、指示を実行する際に、主軸モータ34を駆動する駆動回路24に対しては指示が与えられない(S35)。そして、10回目のP500において、「M30」が読み込まれたら(S4:YES)、サブフラグは「1」であるので(S13:YES)、サブフラグから「1」減算され「0」となる(S14)。そして、サブプログラムP1000が終了される(S15)。ここでは、P500の10回の実施が終了しているので、次に読み込むブロックがメイン加工プログラムの、当該サブプログラムを読み出したブロックの次のブロック(ブロック108)とされる。   Then, the first block of P500 is read. And the process of S3-S21 is performed according to the instruction | indication of P500. And the process of S2-S21 is repeated until "M30" or "M99" is instruct | indicated in P500. Further, the processes of S2 to S21 are repeated until the number of executions reaches 10. In P500 executed ten times, since the spindle flag = 1, no instruction is given to the drive circuit 24 that drives the spindle motor 34 when the instruction is executed (S35). When “M30” is read in the tenth P500 (S4: YES), the subflag is “1” (S13: YES), so “1” is subtracted from the subflag to become “0” (S14). . Then, the subprogram P1000 is terminated (S15). Here, since the execution of 10 times of P500 has been completed, the next block to be read is the next block (block 108) of the main machining program and the block from which the subprogram has been read.

そして、ブロック108『M301』が読み出される。Mコードであり(S3:YES)、「M301」であるので(S4:NO、S5:NO、S6:NO、S7:NO、S8:YES)、主軸フラグが「0」とされる(S18)。そして、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指令は実行される(S35)。しかし、『M301』は、主軸駆動禁止解除指令であり工作機械を駆動する指令はないので、実際に行われる処理はない。ここで、主軸フラグが「0」とされたので(S18)、以降の処理では、主軸モータ34を駆動する駆動回路24に対する指示が行われる。   Then, the block 108 “M301” is read. Since it is an M code (S3: YES) and “M301” (S4: NO, S5: NO, S6: NO, S7: NO, S8: YES), the spindle flag is set to “0” (S18). . Since the spindle flag = 0 (S31: NO) and the table flag = 0 (S33: NO), the command is executed without any restrictions (S35). However, “M301” is a spindle drive prohibition release command and there is no command to drive the machine tool, so there is no actual processing. Here, since the spindle flag is set to "0" (S18), in the subsequent processing, an instruction is given to the drive circuit 24 that drives the spindle motor 34.

そして、ブロック109『#100=#100+1』が読み込まれる(S2)。Mコードはなく(S3:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0(S33:NO)なので、何の制約もなく指令は実行され、変数100に「1」が加算され「1」とされる(S37)。そして、S2へ戻り、ブロック110『GOTO 20』が読み込まれ(S2)、Mコードはなく(S3:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0(S33:NO)、なので、何の制約もなく指令は実行され、次に読み込まれるブロックが「N20」のブロックの次のブロック、すなわちブロック104とされる(S37)。   Then, the block 109 “# 100 = # 100 + 1” is read (S2). Since there is no M code (S3: NO), spindle flag = 0 (S31: NO), and table flag = 0 (S33: NO), the command is executed without any restrictions, and “1” is added to the variable 100. It is set to “1” (S37). Returning to S2, the block 110 “GOTO 20” is read (S2), there is no M code (S3: NO), the spindle flag = 0 (S31: NO), and the table flag = 0 (S33: NO). The command is executed without any restriction, and the next block to be read is the block next to the block of “N20”, that is, the block 104 (S37).

そして、ブロック104『IF[#100 GT 10] GOTO 10』が読み込まれる(S2)。Mコードはなく(S3:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指示が実行される(S37)。ここでは、変数100=1であり、10よりも大きくないので、何も行われない。そして、S2へ戻り、ブロック105『M98 P1000』が読み込まれるが(S2)、変数100が「10」より大きくなるまでは、ブロック104〜ブロック110の処理が繰り返し実施される。そして、変数100が「10」より大きくなったら、ブロック104の処理において、次に読み込まれるブロックが「N10」の次のブロック、すなわちブロック112とされる(S37)。つまり、P1000により熱変位量が記録され、その後、主軸の駆動が禁止された状態で、P500が10回連続して実行されるという一連の処理が10回行われる。よって、主軸の駆動が禁止された状態、つまり、テーブル移動のためのX軸,Y軸,Z軸のみが駆動された状態での熱変位量が記録される。   Then, the block 104 “IF [# 100 GT 10] GOTO 10” is read (S2). Since there is no M code (S3: NO), the spindle flag = 0 (S31: NO), and the table flag = 0 (S33: NO), the instruction is executed without any restriction (S37). Here, the variable 100 = 1 and is not greater than 10, so nothing is done. Then, the process returns to S2 and the block 105 “M98 P1000” is read (S2). Until the variable 100 becomes larger than “10”, the processes of the block 104 to the block 110 are repeatedly performed. When the variable 100 becomes larger than “10”, the block to be read next is set to the next block of “N10”, that is, the block 112 in the process of the block 104 (S37). That is, a series of processes in which P500 is continuously executed 10 times in a state where the thermal displacement amount is recorded by P1000 and the driving of the spindle is prohibited is performed 10 times. Therefore, the thermal displacement amount is recorded in a state where the driving of the main shaft is prohibited, that is, in a state where only the X axis, the Y axis, and the Z axis for table movement are driven.

そして、ブロック112『G04X9000』が読み込まれる(S2)。Mコードはなく(S3:NO)、主軸フラグ=0(S31:NO)、テーブルフラグ=0なので(S33:NO)、何の制約もなく指示が実行される(S37)。『G04X9000』は、9000秒間待機する指令であるので、9000秒間待機される。これにより、ブロック104〜ブロック110の実行により発生した熱変位が回復する。そして、9000秒経過すると、S2へ戻る。   Then, the block 112 “G04X9000” is read (S2). Since there is no M code (S3: NO), the spindle flag = 0 (S31: NO), and the table flag = 0 (S33: NO), the instruction is executed without any restriction (S37). Since “G04X9000” is a command to wait for 9000 seconds, it waits for 9000 seconds. Thereby, the thermal displacement generated by the execution of block 104 to block 110 is recovered. When 9000 seconds have elapsed, the process returns to S2.

次のブロック113『IF[#101 GT 10] GOTO 30』が読み込まれる(S2)。以下、ブロック113〜ブロック121の処理は、ブロック104〜ブロック112の処理と類似しているので、説明を援用する。ブロック106では『M300』により主軸の駆動を禁止しているが、ブロック115ではテーブルの駆動、つまり、X軸,Y軸,Z軸の駆動が禁止されている。そして、変数100の代わりに変数101が用いられている。よって、P1000により熱変位量が記録され、その後、X軸,Y軸,Z軸の駆動が禁止された状態で、P500が10回連続して実行されるという一連の処理が10回行われる。よって、X軸,Y軸,Z軸の駆動が禁止された状態、つまり、主軸のみが駆動された状態での熱変位量が記録される。そして、ブロック121『G04X9000』では、9000秒間待機される。これにより、ブロック113〜ブロック119の実行により発生した熱変位が回復する。そして、9000秒経過すると、S2へ戻る。   The next block 113 “IF [# 101 GT 10] GOTO 30” is read (S2). Hereinafter, the processing of the block 113 to the block 121 is similar to the processing of the block 104 to the block 112, and thus the description is cited. In block 106, driving of the main shaft is prohibited by “M300”, but in block 115, driving of the table, that is, driving of the X, Y, and Z axes is prohibited. A variable 101 is used instead of the variable 100. Therefore, a series of processes in which P500 is executed ten times in a state where the thermal displacement amount is recorded by P1000 and the driving of the X axis, the Y axis, and the Z axis is prohibited are performed ten times. Therefore, the amount of thermal displacement is recorded in a state where the driving of the X axis, the Y axis, and the Z axis is prohibited, that is, only the main shaft is driven. The block 121 “G04X9000” waits for 9000 seconds. Thereby, the thermal displacement generated by the execution of block 113 to block 119 is recovered. When 9000 seconds have elapsed, the process returns to S2.

そして、ブロック122『M30』が読み込まれ(S2)、Mコードであり(S3:YES)、「M30」であり(S4:YES)、サブフラグ=0であるので(S13:NO)、制御プログラムは終了する。   Then, since the block 122 “M30” is read (S2), is M code (S3: YES), is “M30” (S4: YES), and the subflag = 0 (S13: NO), the control program is finish.

以上のようにして、加工プログラムに「M300」の指令を組み込むことにより、その後の指令において、主軸を駆動させないようにできる。そして、「M301」の指令を組み込むことにより、主軸の駆動禁止を解除することができる。また、「M302」の指令を組み込むことにより、テーブルを駆動するX軸,Y軸,Z軸の駆動を禁止することができる。そして、「M303」の指令を組み込むことにより、X軸,Y軸,Z軸の駆動禁止を解除することができる。したがって、加工プログラムに手を加えることなく、所定の軸を駆動させずに加工プログラムを実行させることができる。よって、加工プログラムに手を加える手間がない。また、複数の軸が同時に駆動されるような複雑な指令に対して、所定の軸のみを駆動させないような加工プログラムを作成するのは困難であるが、その必要はなく、簡単に所定の軸のみを駆動させずに加工プログラムを実行させることができる。   As described above, by incorporating the command “M300” into the machining program, it is possible to prevent the spindle from being driven in subsequent commands. Then, by incorporating the command “M301”, the prohibition of driving of the spindle can be released. Further, by incorporating the command “M302”, the driving of the X axis, Y axis, and Z axis for driving the table can be prohibited. Then, by incorporating the command “M303”, the prohibition of driving the X axis, the Y axis, and the Z axis can be canceled. Therefore, the machining program can be executed without driving the predetermined axis without modifying the machining program. Therefore, there is no time and effort to modify the machining program. In addition, it is difficult to create a machining program that does not drive only a predetermined axis for a complicated command in which a plurality of axes are driven at the same time. The machining program can be executed without driving only.

なお、上記実施の形態において図1に示す駆動回路21〜24が「軸駆動手段」に該当する。図4に示すS7,S17で「M300」に応じて主軸フラグに「1」を記憶する処理、S9,S19で「M301」に応じてテーブルフラグに「1」を記憶する処理、図5に示す指令実行処理において主軸フラグ及びテーブルフラグの値に応じてテーブルの移動や主軸の回転を禁止して指令を実行する処理を行うCPU10が「駆動禁止制御手段」に相当する。S8,S18で「M301」に応じて主軸フラグに「0」を記憶する処理、S10,S20で「M303」に応じてテーブルフラグに「0」を記憶する処理を行うCPU10が「駆動禁止解除手段」に相当する。   In the above embodiment, the drive circuits 21 to 24 shown in FIG. 1 correspond to the “axis drive means”. The process of storing “1” in the spindle flag in accordance with “M300” in S7 and S17 shown in FIG. 4, the process of storing “1” in the table flag in accordance with “M301” in S9 and S19, and shown in FIG. In the command execution process, the CPU 10 that performs the process of executing the command by prohibiting the movement of the table and the rotation of the spindle according to the values of the spindle flag and the table flag corresponds to the “drive inhibition control means”. The CPU 10 that performs the process of storing “0” in the spindle flag in accordance with “M301” in S8 and S18, and the process of storing “0” in the table flag in accordance with “M303” in S10 and S20 is “drive prohibition canceling means”. Is equivalent to.

また、図3に示した加工プログラムにおいて、最初にブロック105を実行して計測対象位置の座標を取得するCPU10、最初にブロック114を実行して計測対象位置の座標を取得するCPU10が「基準座標取得手段」に相当する。また、2回目以降にブロック105を実行して計測対象位置の座標を取得するCPU10、2回目以降にブロック114を実行して計測対象位置の座標を取得するCPU10が「熱変位量取得手段」に相当する。フラッシュメモリ18の熱変位量記憶エリア181が「基準座標記憶手段」及び「計測熱変位量記憶手段」に該当する。そして、ブロック107,116での『M98 P500 L10』の指令を実行するCPU10が「サブプログラム実行手段」に該当する。そして、ブロック101,103,104,105,107,109,110の処理を実行するCPU10、ブロック102,113,114,116,118,119の処理を実行するCPU10が「熱変位量記録手段」に相当する。   In the machining program shown in FIG. 3, the CPU 10 that first executes the block 105 to acquire the coordinates of the measurement target position, and the CPU 10 that first executes the block 114 to acquire the coordinates of the measurement target position It corresponds to “acquiring means”. Further, the CPU 10 that executes the block 105 after the second time to acquire the coordinates of the measurement target position, and the CPU 10 that executes the block 114 after the second time and acquires the coordinates of the measurement target position becomes the “thermal displacement amount acquisition means”. Equivalent to. The thermal displacement amount storage area 181 of the flash memory 18 corresponds to “reference coordinate storage means” and “measured thermal displacement amount storage means”. The CPU 10 that executes the command “M98 P500 L10” in the blocks 107 and 116 corresponds to the “subprogram execution means”. Then, the CPU 10 that executes the processing of the blocks 101, 103, 104, 105, 107, 109, and 110, and the CPU 10 that executes the processing of the blocks 102, 113, 114, 116, 118, and 119 serve as the “thermal displacement amount recording means”. Equivalent to.

なお、本発明の数値制御装置は、上記した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。上記実施の形態では、主軸駆動禁止指令のコードを「M300」、主軸駆動禁止解除指令のコードを「M301」、テーブル駆動禁止指令のコードを「M302」、テーブル駆動禁止解除指令のコードを「M303」としたが、これら指令のコードはこれに限らないことは言うまでもない。また、所定の軸として主軸、X軸,Y軸,Z軸のセットを例に挙げたが、駆動を禁止する軸はこれに限らない。また、X軸,Y軸,Z軸をテーブルの駆動としてセットで禁止したが、各軸それぞれで禁止するように駆動禁止指令のコード、駆動禁止解除指令のコードを設定してもよい。   The numerical control device of the present invention is not limited to the above-described embodiment, and various changes can be made without departing from the scope of the present invention. In the above embodiment, the spindle drive prohibition command code is “M300”, the spindle drive prohibition release command code is “M301”, the table drive prohibition command code is “M302”, and the table drive prohibition release command code is “M303”. However, it goes without saying that the codes of these commands are not limited to this. In addition, the set of the main axis, the X axis, the Y axis, and the Z axis is given as an example as the predetermined axis, but the axis that prohibits driving is not limited thereto. Further, although the X-axis, Y-axis, and Z-axis are prohibited by set as table driving, a drive prohibition command code and a drive prohibition release command code may be set so as to prohibit each axis.

また、上記実施の形態では、熱変位量計測において駆動禁止指令のコードを用いたが、駆動禁止指令を用いるのは熱変位量計測のためでなくともよい。例えば、加工プログラムの動作を確認するドライランに、Z軸のみを禁止するZ軸禁止指令を用いてもよい。   In the above embodiment, the drive prohibition command code is used in the thermal displacement amount measurement. However, the drive prohibition command may not be used for the thermal displacement amount measurement. For example, a Z-axis prohibition command that prohibits only the Z-axis may be used in a dry run for confirming the operation of the machining program.

また、上記実施の形態では、サブフラグを用いてサブプログラム中に「M30(加工プログラム終了)」の指示があった場合には、「M99(サブプログラム終了)」と同様に扱っている。しかし、この機能を必ずしも備えていなくてもよい。   Further, in the above embodiment, when an instruction of “M30 (machining program end)” is given in the subprogram using the subflag, it is handled in the same manner as “M99 (subprogram end)”. However, this function is not necessarily provided.

また、上記実施の形態で例示した加工プログラム(図3参照)では、サブプログラムを10回繰り返して実行する都度、熱変位量の計測(P1000の実行)を行っているが、熱変位量を計測するタイミングはこれに限らない。例えば、サブプログラムの実行回数は10回でなくともよい。また、計測開始以降、時間が経過するにつれて、サブプログラムの実行回数を多くしてもよい。また、時間を計測して、所定時間に熱変位量を計測してもよい。その際には、計測時間は時間が経過するに連れて、間隔が空くようにしてもよい。   In the machining program illustrated in the above embodiment (see FIG. 3), the thermal displacement amount is measured (execution of P1000) every time the subprogram is repeatedly executed 10 times, but the thermal displacement amount is measured. The timing to do is not limited to this. For example, the number of executions of the subprogram need not be ten. Further, the number of executions of the subprogram may be increased as time elapses from the start of measurement. Alternatively, the amount of thermal displacement may be measured at a predetermined time by measuring time. At that time, the measurement time may be increased as time elapses.

数値制御装置1の電気的構成を示すブロック図である。2 is a block diagram showing an electrical configuration of the numerical control device 1. FIG. RAM14に設けられている記憶エリアを示す模式図である。3 is a schematic diagram showing a storage area provided in a RAM 14. FIG. 加工プログラムの模式図である。It is a schematic diagram of a processing program. 制御プログラムの動作を示すフローチャートである。It is a flowchart which shows operation | movement of a control program. 制御プログラムの動作を示すフローチャートである。It is a flowchart which shows operation | movement of a control program.

符号の説明Explanation of symbols

1 数値制御装置
10 CPU
21 駆動回路
22 駆動回路
23 駆動回路
24 駆動回路
31 X軸モータ
32 Y軸モータ
33 Z軸モータ
34 主軸モータ
141 主軸フラグ記憶エリア
142 テーブルフラグ記憶エリア
143 サブフラグ記憶エリア
1 Numerical control device 10 CPU
21 drive circuit 22 drive circuit 23 drive circuit 24 drive circuit 31 X-axis motor 32 Y-axis motor 33 Z-axis motor 34 spindle motor 141 spindle flag storage area 142 table flag storage area 143 subflag storage area

Claims (7)

主軸により保持された工具を動作させ、冶具に固定されたワークを加工する工作機械を加工プログラムに基づいて数値制御する数値制御装置であって、
前記加工プログラムに記載されている指令に基づいて前記工作機械の所定の軸を駆動させる軸駆動手段と、
前記加工プログラムにより所定の軸の駆動を禁止する駆動禁止指令が指示されている場合には、前記軸駆動手段の駆動を行わないように制御する駆動禁止制御手段とを備えたことを特徴とする数値制御装置。
A numerical control device for operating a tool held by a spindle and numerically controlling a machine tool that processes a workpiece fixed to a jig based on a processing program,
Shaft driving means for driving a predetermined axis of the machine tool based on a command described in the machining program;
Drive prohibit control means for controlling the shaft drive means not to be driven when a drive prohibit command for prohibiting driving of a predetermined axis is instructed by the machining program. Numerical control unit.
前記所定の軸は、前記主軸、及び、前記ワークを移動させるための送り軸のうちの少なくとも1つであることを特徴とする請求項1に記載の数値制御装置。   The numerical control apparatus according to claim 1, wherein the predetermined axis is at least one of the main axis and a feed axis for moving the workpiece. 前記加工プログラムにより前記駆動禁止指令を解除する駆動禁止解除指令が指示されている場合には、前記駆動禁止制御手段による前記軸駆動手段の駆動を行わない制御を解除する駆動禁止解除手段を備えたことを特徴とする請求項1又は2に記載の数値制御装置。   When a drive prohibition release command for canceling the drive prohibition command is instructed by the machining program, drive prohibition canceling means for canceling control that does not drive the shaft driving means by the drive prohibition control means is provided. The numerical control apparatus according to claim 1 or 2, wherein 前記加工プログラムにより、他の前記加工プログラムを呼び出してサブプログラムとして実行するサブプログラム実行指令が指示された際に、呼び出された加工プログラムであるサブプログラムを実行するサブプログラム実行手段と、
前記サブプログラム実行手段により前記サブプログラムが実行されている場合に、当該サブプログラムにより加工プログラムを終了させるプログラム終了指令が指示された際には、当該プログラム終了指令を、サブプログラムの実行を終了させるサブプログラム終了指令に変換する変換手段とを備えたことを特徴とする請求項1乃至3のいずれかに記載の数値制御装置。
Subprogram execution means for executing a subprogram that is a called machining program when a subprogram execution command for invoking the other machining program and executing it as a subprogram is instructed by the machining program;
When the subprogram is executed by the subprogram execution means, when a program end command for ending the machining program is instructed by the subprogram, the program end command is used to end the execution of the subprogram. 4. The numerical control apparatus according to claim 1, further comprising conversion means for converting into a subprogram end command.
計測対象位置の座標を計測するタッチプローブと、
前記サブプログラムを実行する前に前記タッチプローブにより前記計測基準位置の座標を計測し、基準座標とする基準座標取得手段と、
前記基準座標取得手段により取得された前記基準座標を記憶する基準座標記憶手段と、
前記タッチプローブにより前記計測基準位置の座標を計測し、前記基準座標記憶手段に記憶された前記基準座標との差を熱変位量とする熱変位量取得手段と、
前記熱変位量取得手段により取得された前記熱変位量を記憶する計測熱変位量記憶手段と、
前記サブプログラムを繰り返し実行するサブプログラム実行手段と、
前記サブプログラム実行手段により前記サブプログラムが繰り返し実行されている間、所定のタイミングで前記熱変位量取得手段により前記熱変位量を取得し、取得された前記熱変位量を前記計測熱変位量記憶手段へ記憶する熱変位量記録手段とを備え、
前記サブプログラム実行手段は、前記熱変位量取計測手段により取得された前記熱変位量が所定の値となるまで、又は、前記サブプログラムを所定回数実行するまで、又は、所定時間経過するまで前記サブプログラムを繰り返し実行することを特徴とする請求項4に記載の数値制御装置。
A touch probe that measures the coordinates of the measurement target position;
Before executing the subprogram, measure the coordinates of the measurement reference position by the touch probe, and a reference coordinate acquisition means as a reference coordinate;
Reference coordinate storage means for storing the reference coordinates acquired by the reference coordinate acquisition means;
A thermal displacement amount acquisition unit that measures the coordinates of the measurement reference position by the touch probe and uses a difference from the reference coordinates stored in the reference coordinate storage unit as a thermal displacement amount;
Measured thermal displacement amount storage means for storing the thermal displacement amount acquired by the thermal displacement amount acquisition means;
Subprogram execution means for repeatedly executing the subprogram;
While the subprogram is repeatedly executed by the subprogram execution unit, the thermal displacement amount is acquired by the thermal displacement amount acquisition unit at a predetermined timing, and the acquired thermal displacement amount is stored in the measured thermal displacement amount. Thermal displacement amount recording means for storing in the means,
The subprogram execution unit is configured to execute the subprogram until a predetermined value is reached, until the subprogram is executed a predetermined number of times, or until a predetermined time elapses. The numerical control apparatus according to claim 4, wherein the subprogram is repeatedly executed.
コンピュータを請求項1乃至5のいずれかに記載の数値制御装置の各種処理手段として動作させる数値制御プログラム。   A numerical control program for operating a computer as various processing means of the numerical control device according to any one of claims 1 to 5. 請求項6に記載の数値制御プログラムを記憶したコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the numerical control program according to claim 6.
JP2007281239A 2007-10-30 2007-10-30 Numerical control device, numerical control program, and storage medium storing numerical control program Pending JP2009110223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007281239A JP2009110223A (en) 2007-10-30 2007-10-30 Numerical control device, numerical control program, and storage medium storing numerical control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007281239A JP2009110223A (en) 2007-10-30 2007-10-30 Numerical control device, numerical control program, and storage medium storing numerical control program

Publications (1)

Publication Number Publication Date
JP2009110223A true JP2009110223A (en) 2009-05-21

Family

ID=40778661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007281239A Pending JP2009110223A (en) 2007-10-30 2007-10-30 Numerical control device, numerical control program, and storage medium storing numerical control program

Country Status (1)

Country Link
JP (1) JP2009110223A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019065138A1 (en) 2017-09-28 2019-04-04 シチズン時計株式会社 Machine tool
JP2019200644A (en) * 2018-05-17 2019-11-21 ファナック株式会社 Control device, control method, and control program
US20200316764A1 (en) * 2017-12-18 2020-10-08 Nitto Kohki Co., Ltd. Tool, and control circuit and control method therefor

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019065138A1 (en) 2017-09-28 2019-04-04 シチズン時計株式会社 Machine tool
KR20200062185A (en) 2017-09-28 2020-06-03 시티즌 마쉬나리 가부시키가이샤 Machine tool
JPWO2019065138A1 (en) * 2017-09-28 2020-10-15 シチズン時計株式会社 Machine Tools
JP7154218B2 (en) 2017-09-28 2022-10-17 シチズン時計株式会社 Machine Tools
US11491548B2 (en) 2017-09-28 2022-11-08 Citizen Watch Co., Ltd. Machine tool system that restricts parallel execution of predetermined operations by different tools
TWI791606B (en) * 2017-09-28 2023-02-11 日商西鐵城時計股份有限公司 machine tool
KR20230164196A (en) 2017-09-28 2023-12-01 시티즌 마쉬나리 가부시키가이샤 Machine tool
US20200316764A1 (en) * 2017-12-18 2020-10-08 Nitto Kohki Co., Ltd. Tool, and control circuit and control method therefor
US11701766B2 (en) * 2017-12-18 2023-07-18 Nitto Kohki Co., Ltd. Tool, and control circuit and control method therefor
JP2019200644A (en) * 2018-05-17 2019-11-21 ファナック株式会社 Control device, control method, and control program
US11650571B2 (en) 2018-05-17 2023-05-16 Fanuc Corporation Control device, control method, and control program for executing a machining program using flag indications

Similar Documents

Publication Publication Date Title
US4815000A (en) Numerical controller with operation halting function for data revision
JP4531023B2 (en) Crankshaft machining method, crankshaft machining apparatus, control apparatus, and program
US10324444B2 (en) Numerical controller including tool retracting function for avoidance of interference
JP2017204072A (en) Process program processing device and multiple spindle processor having the same
JP2009053801A (en) Numerical controller with program restart function
JP5785224B2 (en) Numerical control device for controlling a 5-axis machine
JP2007188170A (en) Method and device for interrupting/restarting working of numerically controlled machine tool
JP5187436B2 (en) Numerical control device, control method of numerical control device, and system program
JP4216808B2 (en) Numerical controller
JP2010247246A (en) Numerical control apparatus
JP2008234319A (en) Numerical controller capable of executing g-code command in path table operation
EP1775065B1 (en) Roundness working method and roundness working device in nc machine tool
JP2009110223A (en) Numerical control device, numerical control program, and storage medium storing numerical control program
JP2019070953A (en) Machining program processing device and multiple-spindle machine equipped with the same
KR101683696B1 (en) Robot, robot control method and robot control program
TWI574803B (en) Robot
JP5456216B1 (en) Numerical controller
WO2022215166A1 (en) Numerical control device and machining system
JP4112433B2 (en) Numerical control device for machine tool and numerical control method for machine tool
JP2007213241A (en) Interruption workable numerically controlled machine tool
JPH05305540A (en) Tool exchange method for working device
JP2012110983A (en) Instruction method of stopping main shaft at fixed stopping position and workpiece measuring method
JP2009075727A (en) Numerical controller, numerical control program, and storage medium storing numerical control program
JP2006302207A (en) Numerical control device
JP5301300B2 (en) Machine tool control device and tool post movement control method