JP7035875B2 - Numerical control device, numerical control method, and numerical control program - Google Patents

Numerical control device, numerical control method, and numerical control program Download PDF

Info

Publication number
JP7035875B2
JP7035875B2 JP2018136400A JP2018136400A JP7035875B2 JP 7035875 B2 JP7035875 B2 JP 7035875B2 JP 2018136400 A JP2018136400 A JP 2018136400A JP 2018136400 A JP2018136400 A JP 2018136400A JP 7035875 B2 JP7035875 B2 JP 7035875B2
Authority
JP
Japan
Prior art keywords
motor
speed
command
determination
determined
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
JP2018136400A
Other languages
Japanese (ja)
Other versions
JP2020013433A (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 JP2018136400A priority Critical patent/JP7035875B2/en
Priority to CN201910649297.7A priority patent/CN110737241B/en
Publication of JP2020013433A publication Critical patent/JP2020013433A/en
Application granted granted Critical
Publication of JP7035875B2 publication Critical patent/JP7035875B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/406Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by monitoring or safety
    • G05B19/4065Monitoring tool breakage, life or condition

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Numerical Control (AREA)
  • Machine Tool Sensing Apparatuses (AREA)

Description

本発明は数値制御装置、数値制御方法、及び数値制御プログラムに関する。 The present invention relates to a numerical control device, a numerical control method, and a numerical control program.

工具を駆動するモータの電流値に基づいて工具の異常を検出する数値制御装置が公知である。特許文献1は、工具の刃こぼれの検知機能を有する数値制御装置を開示する。該数値制御装置は、主軸用サーボドライバから取得した電流値と、切削負荷の基準値を比較する。電流値は、主軸用サーボの負荷トルクを表す。故に、数値制御装置は電流値が基準値よりも大きい時、過剰な負荷トルクが主軸用サーボに作用したと判定する。該時、数値制御装置は工具の刃こぼれが発生したことを表す異常検知信号を出力する。 Numerical control devices that detect abnormalities in tools based on the current value of the motor that drives the tools are known. Patent Document 1 discloses a numerical control device having a function of detecting a blade spill of a tool. The numerical control device compares the current value acquired from the servo driver for the spindle with the reference value of the cutting load. The current value represents the load torque of the spindle servo. Therefore, the numerical control device determines that an excessive load torque has acted on the spindle servo when the current value is larger than the reference value. At this time, the numerical control device outputs an abnormality detection signal indicating that the blade of the tool has spilled.

特開2003-326439号公報Japanese Patent Application Laid-Open No. 2003-326439

モータが加速又は減速しながら回転する時、定速で回転する時と比べて、該電流値は、負荷トルク以外の要因で変動し易くなる。故に、数値制御装置は、モータの加速又は減速時に取得した電流値に基づき工具の異常を検出した時、誤検出の可能性が高くなる。従って数値制御装置は、モータが加速又は減速しながら回転する時に工具の異常を検出せず、モータが定速で回転するときに工具の異常を検することが好ましい。 When the motor rotates while accelerating or decelerating, the current value is more likely to fluctuate due to factors other than the load torque, as compared with the case where the motor rotates at a constant speed. Therefore, when the numerical control device detects an abnormality of the tool based on the current value acquired during acceleration or deceleration of the motor, the possibility of erroneous detection increases. Therefore, it is preferable that the numerical control device does not detect the abnormality of the tool when the motor rotates while accelerating or decelerating, and inspects the abnormality of the tool when the motor rotates at a constant speed.

本発明の目的は、モータが加速又は減速しながら回転する時を適切に判定し、該時に工具の異常の検出を行わないようにできる数値制御装置、数値制御方法、及び数値制御プログラムを提供することである。 An object of the present invention is to provide a numerical control device, a numerical control method, and a numerical control program capable of appropriately determining when a motor rotates while accelerating or decelerating and preventing detection of a tool abnormality at that time. That is.

本発明の第一態様に係る数値制御装置は、被削材を加工する工具と前記被削材とを相対的に回転及び移動させる為のモータ及び駆動回路を備えた機械装置に対して、NCプログラムに含まれる速度命令に基づく速度指令を前記駆動回路に周期的に出力する速度制御、及び、位置命令に基づく位置指令を前記駆動回路に周期的に出力する位置制御を実行可能な数値制御装置において、前記NCプログラムの命令が前記速度制御か前記位置制御かを判定する第一判定手段と、前記第一判定手段により前記位置制御と判定した時、前記位置命令に基づく前記位置指令を二階微分して加速度情報を算出する算出手段と、前記算出手段により算出した前記加速度情報の絶対値が所定閾値よりも大きい時、前記モータが加減速中であると判定し、前記加速度情報の絶対値が前記所定閾値以下の時、前記モータが定速中であると判定する第二判定手段と、前記第一判定手段により前記速度制御と判定した時、前記速度命令に基づく前記速度指令と、前記モータの回転速度を計測した計測情報とが同一か否か判定する第三判定手段と、前記第一判定手段により前記速度制御と判定した時、前記速度指令を記憶指令として記憶する速度記憶手段と、前記速度記憶手段によって前回記憶した前記記憶指令と、前記速度指令が同一か否か判定する第四判定手段と、前記第三判定手段により、前記速度指令と前記計測情報とが同一であると判定してから、前記第四判定手段により、前記記憶指令と前記速度指令が同一でないと判定するまでの間、前記モータが定速中であると判定し、前記第四判定手段により、前記記憶指令と前記速度指令が同一でないと判定してから、前記第三判定手段により、前記速度指令と前記計測情報とが同一であると判定するまでの間、前記モータが加減速中であると判定する第五判定手段と、前記モータに流れる電流を検出する検出手段と、前記第二判定手段又は前記第五判定手段により、前記モータが定速中であると判定した時、前記検出手段により検出した前記電流に基づいて前記工具の異常発生の有無を判定する第六判定手段と、を備え、前記第六判定手段は、前記第二判定手段又は前記第五判定手段により、前記モータが加減速中であると判定した時、前記異常発生の有無を判定しないことを特徴とする。 The numerical control device according to the first aspect of the present invention is NC for a mechanical device provided with a motor and a drive circuit for relatively rotating and moving the tool for processing the work material and the work material. A numerical control device capable of executing speed control that periodically outputs a speed command based on a speed command included in the program to the drive circuit and position control that periodically outputs a position command based on the position command to the drive circuit. In the first determination means for determining whether the command of the NC program is the speed control or the position control, and when the first determination means determines the position control, the position command based on the position command is second-order differentiated. When the calculation means for calculating the acceleration information and the absolute value of the acceleration information calculated by the calculation means are larger than a predetermined threshold value, it is determined that the motor is accelerating or decelerating, and the absolute value of the acceleration information is When the speed is equal to or less than the predetermined threshold, the second determination means for determining that the motor is in constant speed, and when the first determination means determines the speed control, the speed command based on the speed command and the motor. A third determination means for determining whether or not the measurement information obtained by measuring the rotation speed of the vehicle is the same, a speed storage means for storing the speed command as a storage command when the first determination means determines the speed control, and a speed storage means. The speed command and the measurement information are determined to be the same by the fourth determination means for determining whether or not the storage command previously stored by the speed storage means and the speed command are the same, and the third determination means. Then, until it is determined by the fourth determination means that the storage command and the speed command are not the same, it is determined that the motor is in constant speed, and the storage command is determined by the fourth determination means. It is determined that the motor is accelerating or decelerating from the determination that the speed command is not the same to the determination by the third determination means that the speed command and the measurement information are the same. When the fifth determination means, the detection means for detecting the current flowing through the motor, and the second determination means or the fifth determination means determine that the motor is in a constant speed, the detection means detects it. A sixth determination means for determining the presence or absence of an abnormality in the tool based on the current is provided, and the sixth determination means is accelerating or decelerating the motor by the second determination means or the fifth determination means. When it is determined that the above is true, the presence or absence of the above-mentioned abnormality is not determined.

数値制御装置は、モータが定速中と判定した時に工具の異常発生の有無を判定し、モータが加減速中と判定した時に工具の異常発生の有無を判定しない。このため、モータが加減速中に工具の異常発生とは別の要因で電流が変動した場合に、工具の異常発生を誤って判定しない。数値制御装置は、位置制御によりモータを制御する時と、速度制御によりモータを制御する時とで、異なる判定方法に基づき、モータが加減速中か又は定速中かを判定する。従って、数値制御装置は、夫々の制御方式に応じた適切な判定方法により、モータが加減速中か定速中かを適切に判定できる。従って、数値制御装置は、工具の異常発生の精度を高めることができる。 The numerical control device determines whether or not an abnormality has occurred in the tool when it is determined that the motor is in constant speed, and does not determine whether or not an abnormality has occurred in the tool when it is determined that the motor is accelerating or decelerating. Therefore, when the current fluctuates due to a factor other than the occurrence of the tool abnormality during acceleration / deceleration of the motor, the occurrence of the tool abnormality is not erroneously determined. The numerical control device determines whether the motor is in acceleration / deceleration or constant speed based on different determination methods when the motor is controlled by position control and when the motor is controlled by speed control. Therefore, the numerical control device can appropriately determine whether the motor is in acceleration / deceleration or constant speed by an appropriate determination method according to each control method. Therefore, the numerical control device can improve the accuracy of the occurrence of the abnormality of the tool.

第一態様において、前記機械装置は、前記被削材に対して前記工具を相対的に回転させる為の第一モータ、及び、前記被削材に対して前記工具を相対的に移動させる為の第二モータを備え、前記位置制御を行う時、前記第一モータは、前記第二モータに同期して回転し、前記第一判定手段により前記位置制御と判定した時、前記算出手段は、前記第二モータに対する前記位置指令を二階微分して前記加速度情報を算出し、前記第二判定手段は、前記加速度情報と前記所定閾値との関係に基づいて、前記第一モータが加減速中か又は定速中か判定し、前記第六判定手段は、前記第一モータの前記電流に基づき、前記工具の異常発生の有無を判定してもよい。数値制御装置は、位置制御を行う際に、第一モータが第二モータに同期することにより混入するノイズの影響を受けずに、第一モータが加減速中か定速中かを判定することができる。従って、数値制御装置は、加減速中か又は定速中かの判定を適切に実行できるので、異常発生の有無の判定の精度を向上できる。 In the first aspect, the mechanical device is for moving the tool relative to the work material and the first motor for rotating the tool relative to the work material. When the second motor is provided and the position control is performed, the first motor rotates in synchronization with the second motor, and when the first determination means determines that the position control is performed, the calculation means is said. The acceleration information is calculated by second-order differentiating the position command for the second motor, and the second determination means means that the first motor is accelerating or decelerating based on the relationship between the acceleration information and the predetermined threshold value. It is determined whether the speed is constant, and the sixth determination means may determine whether or not an abnormality has occurred in the tool based on the current of the first motor. The numerical control device determines whether the first motor is in acceleration / deceleration or constant speed without being affected by the noise mixed in by synchronizing the first motor with the second motor when performing position control. Can be done. Therefore, since the numerical control device can appropriately determine whether acceleration / deceleration is in progress or constant speed, the accuracy of determination of the presence / absence of abnormality can be improved.

第一態様において、前記機械装置は、前記被削材に対して前記工具を相対的に回転させる為の第一モータ、及び、前記被削材に対して前記工具を相対的に移動させる為の第二モータを備え、前記位置制御を行う時、前記第二モータは、前記第一モータに同期して回転し、前記算出手段は、前記第一モータに対する前記位置指令を二階微分して前記加速度情報を算出し、前記第二判定手段は、前記加速度情報と前記所定閾値との関係に基づいて、前記第二モータが加減速中か又は定速中か判定し、前記第六判定手段は、前記第二モータの前記電流に基づき、前記工具の前記異常発生の有無を判定してもよい。数値制御装置は、前記位置制御を行う際に、前記第二モータが前記第一モータに同期することにより混入するノイズの影響を受けずに、第二モータが加減速中か定速中かを判定することができる。従って、数値制御装置は、加減速中か又は定速中かの判定を適切に実行できるので、異常発生の有無の判定の精度を向上できる。 In the first aspect, the mechanical device is for moving the tool relative to the work material and the first motor for rotating the tool relative to the work material. When the second motor is provided and the position control is performed, the second motor rotates in synchronization with the first motor, and the calculation means second-orders the position command for the first motor to accelerate the acceleration. The information is calculated, the second determination means determines whether the second motor is in acceleration / deceleration or constant speed based on the relationship between the acceleration information and the predetermined threshold value, and the sixth determination means determines. Based on the current of the second motor, it may be determined whether or not the abnormality has occurred in the tool. The numerical control device determines whether the second motor is in acceleration / deceleration or constant speed without being affected by the noise mixed in by synchronizing the second motor with the first motor when performing the position control. It can be determined. Therefore, since the numerical control device can appropriately determine whether acceleration / deceleration is in progress or constant speed, the accuracy of determination of the presence / absence of abnormality can be improved.

第一態様において、前記異常発生の有無を判定するか否かを示す情報を記憶する第一記憶部と、前記第六判定手段による最初の判定の前に、前記異常発生の有無を判定しないことを示す判定停止情報を前記第一記憶部に記憶する第一記憶制御手段と、前記第一記憶部に前記判定停止情報を記憶した状態で、前記第二判定手段又は前記第五判定手段により、前記モータが定速中と判定した時、前記異常発生の有無を判定することを示す判定中情報を前記第一記憶部に記憶する第二記憶制御手段と、前記第一記憶部に前記判定中情報を記憶した状態で、前記第二判定手段又は前記第五判定手段により、前記モータが加減速中と判定した時、前記判定停止情報を前記第一記憶部に記憶する第三記憶制御手段とを備え、前記第六判定手段は、前記第一記憶部が前記判定中情報を記憶している時、前記異常発生の有無を判定し、前記第一記憶部が前記判定停止情報を記憶している時、前記異常発生の有無を判定しなくてもよい。該時、モータが加減速中か又は定速中かに応じて異常発生の有無の判定を適切に実行できる。 In the first aspect, the presence / absence of the abnormality is not determined before the first storage unit that stores information indicating whether or not the presence / absence of the abnormality has occurred and the first determination by the sixth determination means. By the first storage control means for storing the determination stop information indicating the above in the first storage unit and the second determination means or the fifth determination means in a state where the determination stop information is stored in the first storage unit. When the motor determines that the speed is constant, the second storage control means for storing the determination information indicating that the presence or absence of the abnormality has occurred is stored in the first storage unit, and the determination is in progress in the first storage unit. With the third storage control means for storing the determination stop information in the first storage unit when the motor is determined to be accelerating or decelerating by the second determination means or the fifth determination means in the state where the information is stored. The sixth determination means determines whether or not the abnormality has occurred when the first storage unit stores the determination information, and the first storage unit stores the determination stop information. At that time, it is not necessary to determine whether or not the abnormality has occurred. At that time, it is possible to appropriately determine whether or not an abnormality has occurred depending on whether the motor is in acceleration / deceleration or in constant speed.

第一態様において、前記NCプログラムは、前記異常発生の有無の判定を開始することを示す開始命令、及び、前記異常発生の有無の判定を終了することを示す終了命令を有し、前記第六判定手段は、前記第二記憶部から前記開始命令を読み出してから、次に前記終了命令を読み出すまでの間、前記工具の異常発生の有無を判定し、前記第二記憶部から前記終了命令を読み出してから、次に前記開始命令を読み出すまでの間、前記工具の前記異常発生の有無を判定しなくてもよい。該時、数値制御装置は、モータの制御命令とともに第二記憶部に記憶した開始命令と終了命令とに基づき、異常発生の有無の判定期間を指定できる。 In the first aspect, the NC program has a start command indicating to start the determination of the presence / absence of the abnormality and an end command indicating to end the determination of the presence / absence of the abnormality. The determination means determines whether or not an abnormality has occurred in the tool between the time when the start command is read from the second storage unit and the time when the end command is read next, and the determination means issues the end command from the second storage unit. It is not necessary to determine whether or not the abnormality has occurred in the tool between the time of reading and the next time the start command is read. At this time, the numerical control device can specify the determination period for the presence or absence of an abnormality based on the start command and the end command stored in the second storage unit together with the control command of the motor.

本発明の第二態様に係る数値制御方法は、NCプログラムに含まれ、被削材を加工する工具と前記被削材とを相対的に回転及び移動させる為のモータ及び駆動回路を備えた機械装置に対して、速度命令に基づく速度指令を前記駆動回路に周期的に出力する速度制御か、位置命令に基づく位置指令を前記駆動回路に周期的に出力する位置制御かを判定する第一判定工程と、前記第一判定工程により前記位置制御と判定した時、前記位置命令に基づく前記位置指令を二階微分して加速度情報を算出する算出工程と、前記算出工程により算出した前記加速度情報の絶対値が所定閾値よりも大きい時、前記モータが加減速中であると判定し、前記加速度情報の絶対値が前記所定閾値以下の時、前記モータが定速中であると判定する第二判定工程と、前記第一判定工程により前記速度制御と判定した時、前記速度命令に基づく前記速度指令と、前記モータの回転速度を計測した計測情報とが同一か否か判定する第三判定工程と、前記第一判定工程により前記速度制御と判定した時、前記速度指令を記憶指令として記憶する速度記憶工程と、前記速度記憶工程によって前回記憶した前記記憶指令と、前記速度指令が同一か否か判定する第四判定工程と、前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定してから、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定するまでの間、前記モータが定速中であると判定し、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定してから、前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定するまでの間、前記モータが加減速中であると判定する第五判定工程と、前記モータに流れる電流を検出する検出工程と、前記第二判定工程又は前記第五判定工程により、前記モータが定速中であると判定した時、前記検出工程により検出した前記電流に基づいて前記工具の異常発生の有無を判定する第六判定工程と、を備え、前記第六判定工程は、前記第二判定工程又は前記第五判定工程により、前記モータが加減速中であると判定した時、前記異常発生の有無を判定しないことを特徴とする。第二態様によれば、第一態様と同様の効果を奏することができる。 The numerical control method according to the second aspect of the present invention is included in the NC program, and is a machine provided with a motor and a drive circuit for relatively rotating and moving the tool for processing the work material and the work material. First determination for determining whether the speed control for periodically outputting the speed command based on the speed command to the drive circuit or the position control for periodically outputting the position command based on the position command to the drive circuit. When the position control is determined by the step, the first determination step, the calculation step of calculating the acceleration information by second-order differentiation of the position command based on the position command, and the absolute of the acceleration information calculated by the calculation step. A second determination step of determining that the motor is accelerating or decelerating when the value is larger than the predetermined threshold, and determining that the motor is in constant speed when the absolute value of the acceleration information is equal to or less than the predetermined threshold. When the speed control is determined by the first determination step, the third determination step of determining whether or not the speed command based on the speed command and the measurement information measured by the rotational speed of the motor are the same. When the speed control is determined by the first determination step, it is determined whether or not the speed storage step of storing the speed command as a storage command, the storage command previously stored by the speed storage process, and the speed command are the same. After determining that the speed command and the measurement information are the same by the fourth determination step and the third determination step, the storage command and the speed command are not the same by the fourth determination step. Until the determination, it is determined that the motor is in constant speed, the storage command and the speed command are determined not to be the same by the fourth determination step, and then the speed is determined by the third determination step. The fifth determination step of determining that the motor is accelerating or decelerating, the detection step of detecting the current flowing through the motor, and the second determination until it is determined that the command and the measurement information are the same. When it is determined by the step or the fifth determination step that the motor is in constant speed, the sixth determination step of determining whether or not an abnormality has occurred in the tool based on the current detected by the detection step. The sixth determination step is characterized in that, when it is determined by the second determination step or the fifth determination step that the motor is accelerating or decelerating, the presence or absence of the abnormality is not determined. According to the second aspect, the same effect as that of the first aspect can be obtained.

本発明の第三態様に係る数値制御プログラムは、NCプログラムに含まれ、被削材を加工する工具と前記被削材とを相対的に回転及び移動させる為のモータ及び駆動回路を備えた機械装置に対して、速度命令に基づく速度指令を前記駆動回路に周期的に出力する速度制御か、位置命令に基づく位置指令を前記駆動回路に周期的に出力する位置制御かを判定する第一判定工程と、前記第一判定工程により前記位置制御と判定した時、前記位置命令に基づく前記位置指令を二階微分して加速度情報を算出する算出工程と、前記算出工程により算出した前記加速度情報の絶対値が所定閾値よりも大きい時、前記モータが加減速中であると判定し、前記加速度情報の絶対値が前記所定閾値以下の時、前記モータが定速中であると判定する第二判定工程と、前記第一判定工程により前記速度制御と判定した時、前記速度命令に基づく前記速度指令と、前記モータの回転速度を計測した計測情報とが同一か否か判定する第三判定工程と、前記第一判定工程により前記速度制御と判定した時、前記速度指令を記憶指令として記憶する速度記憶工程と、前記速度記憶工程によって前回記憶した前記記憶指令と、前記速度指令が同一か否か判定する第四判定工程と、前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定してから、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定するまでの間、前記モータが定速中であると判定し、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定してから、前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定するまでの間、前記モータが加減速中であると判定する第五判定工程と、前記モータに流れる電流を検出する検出工程と、前記第二判定工程又は前記第五判定工程により、前記モータが定速中であると判定した時、前記検出工程により検出した前記電流に基づいて前記工具の異常発生の有無を判定する第六判定工程と、をコンピュータに実行させる為の数値制御プロプラムであって、前記第六判定工程は、前記第二判定工程又は前記第五判定工程により、前記モータが加減速中であると判定した時、前記異常発生の有無を判定しないことを特徴とする。第三態様によれば、第一態様と同様の効果を奏することができる。 The numerical control program according to the third aspect of the present invention is included in the NC program, and is a machine provided with a motor and a drive circuit for relatively rotating and moving the tool for processing the work material and the work material. First determination for determining whether the speed control for periodically outputting the speed command based on the speed command to the drive circuit or the position control for periodically outputting the position command based on the position command to the drive circuit. When the position control is determined by the step, the first determination step, the calculation step of calculating the acceleration information by second-order differentiation of the position command based on the position command, and the absolute of the acceleration information calculated by the calculation step. A second determination step of determining that the motor is accelerating or decelerating when the value is larger than the predetermined threshold, and determining that the motor is in constant speed when the absolute value of the acceleration information is equal to or less than the predetermined threshold. When the speed control is determined by the first determination step, the third determination step of determining whether or not the speed command based on the speed command and the measurement information measured by the rotational speed of the motor are the same. When the speed control is determined by the first determination step, it is determined whether or not the speed storage step of storing the speed command as a storage command, the storage command previously stored by the speed storage process, and the speed command are the same. After determining that the speed command and the measurement information are the same by the fourth determination step and the third determination step, the storage command and the speed command are not the same by the fourth determination step. Until the determination, it is determined that the motor is in constant speed, the storage command and the speed command are determined not to be the same by the fourth determination step, and then the speed is determined by the third determination step. The fifth determination step of determining that the motor is accelerating or decelerating, the detection step of detecting the current flowing through the motor, and the second determination until it is determined that the command and the measurement information are the same. When it is determined by the step or the fifth determination step that the motor is in constant speed, the sixth determination step of determining whether or not an abnormality has occurred in the tool based on the current detected by the detection step. It is a numerical control prompt for causing a computer to execute, and in the sixth determination step, when it is determined by the second determination step or the fifth determination step that the motor is accelerating or decelerating, the abnormality occurs. It is characterized in that the presence or absence is not determined. According to the third aspect, the same effect as that of the first aspect can be obtained.

工作機械1の斜視図。A perspective view of the machine tool 1. 工作機械1と数値制御装置30の電気的構成を示すブロック図。The block diagram which shows the electric composition of the machine tool 1 and the numerical control device 30. NCプログラムの一例を示す図。The figure which shows an example of NC program. 駆動回路51A、52Aの詳細を示す図。The figure which shows the detail of the drive circuit 51A, 52A. 位置制御の場合の位置情報、速度情報、加速度情報を示すグラフ。A graph showing position information, velocity information, and acceleration information in the case of position control. 速度制御の場合の速度情報、計測情報、速度情報/計測情報を示すグラフ。Graph showing speed information, measurement information, speed information / measurement information in the case of speed control. メイン処理の流れ図。Flow chart of the main process. 異常判定処理の流れ図。Flow chart of abnormality judgment processing. 第一判定処理の流れ図。The flow chart of the first judgment process. 第二判定処理の流れ図。The flow chart of the second judgment process.

<工作機械1の概要>
本発明の実施形態を説明する。以下説明は、図中に矢印で示す左右、前後、上下を使用する。工作機械1の左右方向、前後方向、上下方向は夫々工作機械1のX軸方向、Y軸方向、Z軸方向である。図1に示す工作機械1は主軸9に装着した工具4を回転し、且つ、被削材3を上面に保持したテーブル13を移動する。工作機械1は工具4及び被削材3を相対的に回転又は移動し、工具4により被削材3に切削加工を施す。数値制御装置30(図2参照)は工作機械1の動作を制御する。
<Overview of Machine Tool 1>
An embodiment of the present invention will be described. In the following description, left and right, front and back, and up and down indicated by arrows in the figure are used. The left-right direction, the front-back direction, and the up-down direction of the machine tool 1 are the X-axis direction, the Y-axis direction, and the Z-axis direction of the machine tool 1, respectively. The machine tool 1 shown in FIG. 1 rotates a tool 4 mounted on a spindle 9 and moves a table 13 holding a work material 3 on the upper surface. The machine tool 1 relatively rotates or moves the tool 4 and the work material 3, and the work material 3 is cut by the tool 4. The numerical control device 30 (see FIG. 2) controls the operation of the machine tool 1.

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

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

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

工具交換装置20は主軸ヘッド7の前側に設け、円盤型の工具マガジン21を備える。工具マガジン21は外周に複数の工具(図示略)を放射状に保持し、工具交換命令が指示する工具を工具交換位置に位置決めする。工具交換命令はNCプログラムで命令する。工具交換位置は工具マガジン21の最下部位置である。工具交換装置20は主軸9に装着する工具4と工具マガジン21に取り付けられた工具とを主軸ヘッド7の上昇、工具マガジン21の回転、主軸ヘッド7の下降の一連の動作により入れ替え交換する。 The tool changer 20 is provided on the front side of the spindle head 7 and includes a disk-shaped tool magazine 21. The tool magazine 21 holds a plurality of tools (not shown) radially on the outer periphery, and positions the tool instructed by the tool change command at the tool change position. Tool change instructions are given by the NC program. The tool change position is the lowest position of the tool magazine 21. The tool changing device 20 replaces and replaces the tool 4 mounted on the spindle 9 and the tool attached to the tool magazine 21 by a series of operations of raising the spindle head 7, rotating the tool magazine 21, and lowering the spindle head 7.

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

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

<電気的構成>
図2を参照し、数値制御装置30と工作機械1の電気的構成を説明する。数値制御装置30と工作機械1は、CPU31、ROM32、RAM33、記憶装置34、入出力部35、駆動回路51A~55A等を備える。CPU31は数値制御装置30を統括制御する。ROM32は、メインプログラム等を記憶する。CPU31は、メインプログラムを読み出して実行することで、メイン処理(図7参照)を実行する。メイン処理は、NCプログラムの命令を一行ずつ読み出し、対応する各種動作を実行する。NCプログラムは各種命令(速度命令、位置命令、有効命令、無効命令)を含む複数行で構成する。NCプログラムは、工作機械1の各種動作を行単位で制御する。RAM33は、後述の第一フラグ情報、第二フラグ情報、比較速度情報を含む各種情報を一時的に記憶する。記憶装置34は不揮発性であり、NCプログラム、各種情報を記憶する。CPU31は作業者が操作パネル15の入力部16で入力したNCプログラムに加え、外部入力で読み出したNCプログラム等を記憶装置34に記憶できる。
<Electrical configuration>
With reference to FIG. 2, the electrical configuration of the numerical control device 30 and the machine tool 1 will be described. The numerical control device 30 and the machine tool 1 include a CPU 31, ROM 32, RAM 33, a storage device 34, an input / output unit 35, drive circuits 51A to 55A, and the like. The CPU 31 controls the numerical control device 30 in an integrated manner. The ROM 32 stores the main program and the like. The CPU 31 executes the main process (see FIG. 7) by reading and executing the main program. The main process reads the instructions of the NC program line by line and executes the corresponding various operations. The NC program consists of multiple lines including various instructions (speed instruction, position instruction, valid instruction, invalid instruction). The NC program controls various operations of the machine tool 1 on a line-by-line basis. The RAM 33 temporarily stores various types of information including the first flag information, the second flag information, and the comparison speed information, which will be described later. The storage device 34 is non-volatile and stores NC programs and various information. In addition to the NC program input by the operator in the input unit 16 of the operation panel 15, the CPU 31 can store the NC program or the like read by the external input in the storage device 34.

駆動回路51AはZ軸モータ51、エンコーダ51B、電流検出器51C、速度検出器51Dに接続する。駆動回路52Aは主軸モータ52、エンコーダ52B、電流検出器52C、速度検出器52Dに接続する。駆動回路53AはX軸モータ53、エンコーダ53B、電流検出器53Cに接続する。駆動回路54AはY軸モータ54、エンコーダ54B、電流検出器54Cに接続する。駆動回路55Aは工具マガジン21を駆動するマガジンモータ55、エンコーダ55B、電流検出器55Cに接続する。Z軸モータ51、主軸モータ52、X軸モータ53、Y軸モータ54、マガジンモータ55は何れもサーボモータである。Z軸モータ51、主軸モータ52、X軸モータ53、Y軸モータ54、マガジンモータ55を区別しない時、「モータ50」と総称する。駆動回路51A~55Aは、CPU31が周期的に出力する指令を受け、対応するモータ50に駆動電流を出力する。エンコーダ51B~55Bは、対応するモータ50の回転角を検出する。エンコーダ51B~55Bは、検出した回転角に応じたパルス信号を、対応する駆動回路51A~55Aに出力する。駆動回路51A~55Aはエンコーダ51B~55Bが出力した信号を受け、CPU31に出力する。電流検出器51C~55Cは対応するモータ50に流れる電流を検出する。電流検出器51C~55Cは、検出した電流を示す信号を、対応する駆動回路51A~55Aに出力する。駆動回路51A~55Aは電流検出器51C~55Cが出力した信号を受け、CPU31に出力する。速度検出器51D、52Dは対応するモータ50の回転速度を検出する。速度検出器51D、52Dは、検出した回転速度を示す信号を、対応する駆動回路51A、52Aに出力する。駆動回路51A~55Aは速度検出器51D~55Dが出力した信号を受け、CPU31に出力する。入出力部35は操作パネル15の入力部16と表示部17に夫々接続する。 The drive circuit 51A is connected to the Z-axis motor 51, the encoder 51B, the current detector 51C, and the speed detector 51D. The drive circuit 52A is connected to the spindle motor 52, the encoder 52B, the current detector 52C, and the speed detector 52D. The drive circuit 53A is connected to the X-axis motor 53, the encoder 53B, and the current detector 53C. The drive circuit 54A is connected to the Y-axis motor 54, the encoder 54B, and the current detector 54C. The drive circuit 55A is connected to the magazine motor 55, the encoder 55B, and the current detector 55C that drive the tool magazine 21. The Z-axis motor 51, the spindle motor 52, the X-axis motor 53, the Y-axis motor 54, and the magazine motor 55 are all servo motors. When the Z-axis motor 51, the spindle motor 52, the X-axis motor 53, the Y-axis motor 54, and the magazine motor 55 are not distinguished, they are collectively referred to as "motor 50". The drive circuits 51A to 55A receive a command to be periodically output by the CPU 31 and output a drive current to the corresponding motor 50. The encoders 51B to 55B detect the rotation angle of the corresponding motor 50. The encoders 51B to 55B output pulse signals corresponding to the detected rotation angles to the corresponding drive circuits 51A to 55A. The drive circuits 51A to 55A receive the signals output by the encoders 51B to 55B and output them to the CPU 31. The current detectors 51C to 55C detect the current flowing through the corresponding motor 50. The current detectors 51C to 55C output a signal indicating the detected current to the corresponding drive circuits 51A to 55A. The drive circuits 51A to 55A receive the signals output by the current detectors 51C to 55C and output them to the CPU 31. The speed detectors 51D and 52D detect the rotational speed of the corresponding motor 50. The speed detectors 51D and 52D output a signal indicating the detected rotation speed to the corresponding drive circuits 51A and 52A. The drive circuits 51A to 55A receive the signals output by the speed detectors 51D to 55D and output them to the CPU 31. The input / output unit 35 is connected to the input unit 16 and the display unit 17 of the operation panel 15, respectively.

<異常判定処理の概要>
数値制御装置30のCPU31は、工具4による被削材3の切削動作中に主軸モータ52に流れる電流を、対応する電流検出器52C及び駆動回路52Aを介して取得する。CPU31が取得した電流が所定の第二閾値を超えた時、工具4に過剰な負荷が作用している可能性がある。従って、CPU31は、取得した電流が第二閾値を超えた時、工具4に異常が発生したと判定する。
<Outline of abnormality judgment processing>
The CPU 31 of the numerical control device 30 acquires the current flowing through the spindle motor 52 during the cutting operation of the work material 3 by the tool 4 via the corresponding current detector 52C and the drive circuit 52A. When the current acquired by the CPU 31 exceeds a predetermined second threshold value, there is a possibility that an excessive load is acting on the tool 4. Therefore, the CPU 31 determines that an abnormality has occurred in the tool 4 when the acquired current exceeds the second threshold value.

主軸モータ52の回転速度が加速又は減速する時、工作機械1は振動し易い。該振動は、被削材3の切削動作中に取得する電流の誤差の要因となる可能性がある。従って、CPU31は、主軸モータ52の回転速度が加速又は減速する時、電流に基づく工具4の異常発生の有無の判定を行わない。一方、CPU31は、主軸モータ52が定速で回転する時、電流に基づく工具4の異常発生の有無の判定を行う。以下、該処理を「異常判定処理」と称す。主軸モータ52の回転速度が加速又は減速する時を、「主軸モータ52が加減速中」と言い換える。主軸モータ52が定速で回転する時を、「主軸モータ52が定速中」と言い換える。 When the rotational speed of the spindle motor 52 accelerates or decelerates, the machine tool 1 tends to vibrate. The vibration may cause an error in the current acquired during the cutting operation of the work material 3. Therefore, the CPU 31 does not determine whether or not an abnormality has occurred in the tool 4 based on the current when the rotational speed of the spindle motor 52 accelerates or decelerates. On the other hand, the CPU 31 determines whether or not an abnormality has occurred in the tool 4 based on the current when the spindle motor 52 rotates at a constant speed. Hereinafter, the process is referred to as "abnormality determination process". When the rotational speed of the spindle motor 52 accelerates or decelerates, it is paraphrased as "the spindle motor 52 is accelerating or decelerating". When the spindle motor 52 rotates at a constant speed, it is paraphrased as "the spindle motor 52 is in a constant speed".

<NCプログラムの具体例(位置制御と速度制御)>
図3(a)は、記憶装置34に記憶したNCプログラムの具体例を示す。NCプログラムは、所定の順番に並ぶ複数の命令を含む。図3(b)は、各命令の内容を示す。
<Specific examples of NC programs (position control and speed control)>
FIG. 3A shows a specific example of the NC program stored in the storage device 34. An NC program contains a plurality of instructions arranged in a predetermined order. FIG. 3B shows the contents of each instruction.

「N02」「N06」は、切削動作に使用する工具4を交換する為の工具交換命令「M06」を含む。工具交換命令は、交換後の工具4を規定する。CPU31は、工具交換命令を読み出した時、駆動回路51A及び駆動回路55Aを制御してZ軸モータ51及びマガジンモータ55を駆動する。該時、工具交換装置20は工具4を交換する。「N03」「N07」は、被削材3に対する工具4の位置決めを実行する為の命令「G00」を含む。該命令は、工具4のX軸方向、Y軸方向、Z軸方向の少なくとも何れかの位置情報を規定する。CPU31は、該命令を読み出した時、該命令に基づく位置指令を算出し、駆動回路53A、54A、51Aに対して周期的に出力する。該時、駆動回路51A、53A、54Aは各々、X軸モータ53、Y軸モータ54、Z軸モータ51に駆動電流を出力し、X軸モータ53、Y軸モータ54、Z軸モータ51を駆動する。該時、テーブル13はX軸移動機構、Y軸移動機構によりX軸方向、Y軸方向に移動する。又、主軸ヘッド7はZ軸方向に移動する。 "N02" and "N06" include a tool change command "M06" for changing the tool 4 used for the cutting operation. The tool change order specifies the tool 4 after the change. When the tool change command is read, the CPU 31 controls the drive circuit 51A and the drive circuit 55A to drive the Z-axis motor 51 and the magazine motor 55. At this time, the tool changing device 20 replaces the tool 4. “N03” and “N07” include an instruction “G00” for executing positioning of the tool 4 with respect to the work material 3. The command defines at least one of the position information of the tool 4 in the X-axis direction, the Y-axis direction, and the Z-axis direction. When the CPU 31 reads the command, the CPU 31 calculates a position command based on the command and periodically outputs the position command to the drive circuits 53A, 54A, 51A. At this time, the drive circuits 51A, 53A, and 54A output drive currents to the X-axis motor 53, the Y-axis motor 54, and the Z-axis motor 51, respectively, and drive the X-axis motor 53, the Y-axis motor 54, and the Z-axis motor 51, respectively. do. At this time, the table 13 moves in the X-axis direction and the Y-axis direction by the X-axis movement mechanism and the Y-axis movement mechanism. Further, the spindle head 7 moves in the Z-axis direction.

「N08」は、工具4としてタップを使用し、穴の内側にめねじを形成する切削動作(以下、「タップ切削」と称す。)を実行する為の命令「G84」(以下、「タップ切削命令」と称す。)を含む。タップ切削命令は、工具4のZ軸方向の位置情報「Z-10」、工具4のZ軸方向の移動速度情報「F200」、及び、主軸9の回転速度情報「S200」を少なくとも規定する。CPU31は、タップ切削命令「G84」を読み出した時、該命令に基づくZ軸方向の位置指令(以下、「Z軸位置指令」と称す。)を算出し、駆動回路51AにZ軸位置指令を周期的に出力する。駆動回路51Aは、Z軸モータ51を駆動する。該時、主軸ヘッド7はZ軸移動機構により、「Z-10」(位置情報)まで「200mm/min」(移動速度情報)でZ軸方向に移動する。同時に後述の補正用演算器36B(図4参照)は、Z軸位置指令に同期する主軸9の位置指令(以下、「主軸位置指令」と称す。)を算出し、駆動回路52Aに主軸位置指令を周期的に出力する。駆動回路52Aは、Z軸モータ51に同期して主軸モータ52を駆動する。該時、主軸9は、主軸ヘッド7の移動に同期して、「200rpm」(回転速度情報)で回転する。以下、タップ切削を実行する為のZ軸モータ51及び主軸モータ52の制御方式を、「位置制御」と称す。タップ切削命令「G84」のうちZ軸位置指令及び主軸位置指令算出する為の命令を、それぞれ「位置命令」と称す。 "N08" uses a tap as a tool 4 and commands "G84" (hereinafter, "tap cutting") for executing a cutting operation (hereinafter, referred to as "tap cutting") for forming a female thread inside a hole. It is called "command"). The tap cutting command at least defines the position information "Z-10" in the Z-axis direction of the tool 4, the movement speed information "F200" in the Z-axis direction of the tool 4, and the rotation speed information "S200" of the spindle 9. When the CPU 31 reads the tap cutting command "G84", it calculates a position command in the Z-axis direction (hereinafter referred to as "Z-axis position command") based on the command, and issues a Z-axis position command to the drive circuit 51A. Output periodically. The drive circuit 51A drives the Z-axis motor 51. At this time, the spindle head 7 moves in the Z-axis direction at "200 mm / min" (movement speed information) up to "Z-10" (position information) by the Z-axis movement mechanism. At the same time, the correction calculator 36B (see FIG. 4), which will be described later, calculates the position command of the spindle 9 synchronized with the Z-axis position command (hereinafter referred to as “spindle position command”), and the spindle position command is given to the drive circuit 52A. Is output periodically. The drive circuit 52A drives the spindle motor 52 in synchronization with the Z-axis motor 51. At this time, the spindle 9 rotates at "200 rpm" (rotational speed information) in synchronization with the movement of the spindle head 7. Hereinafter, the control method of the Z-axis motor 51 and the spindle motor 52 for executing tap cutting is referred to as "position control". Of the tap cutting commands "G84", the commands for calculating the Z-axis position command and the spindle position command are referred to as "position commands", respectively.

図4を参照し、タップ切削を実行する場合の位置制御を詳細に説明する。CPU31はZ軸位置指令を演算器36Aに周期的に出力する。演算器36Aは入力したZ軸位置指令を、偏差カウンタ37Bに出力する。Z軸モータ51に設けたエンコーダ51Bは、Z軸モータ51の回転角に応じたパルス信号を偏差カウンタ37Bに出力する。偏差カウンタ37Bは、入力したZ軸位置指令とパルス信号との偏差を算出する。偏差カウンタ37Bは、算出した偏差をサーボアンプ38Bに出力する。速度検出器51Dは、エンコーダ51Bが出力したパルス信号に基づいてZ軸モータ51の回転速度を検出し、回転速度を示す信号をサーボアンプ38Bに出力する。サーボアンプ38Bは、速度検出器51Dから入力した回転速度を示す信号をフィードバック信号として用い、偏差カウンタ37Bから入力した偏差を補正する。サーボアンプ38Bは補正した偏差に基づき、Z軸モータ51に駆動電流を出力する。Z軸モータ51は、現時点での回転速度に応じて補正したZ軸位置指令に基づいて回転する。該時、主軸ヘッド7はZ軸方向に移動する。 With reference to FIG. 4, the position control when the tap cutting is executed will be described in detail. The CPU 31 periodically outputs a Z-axis position command to the calculator 36A. The arithmetic unit 36A outputs the input Z-axis position command to the deviation counter 37B. The encoder 51B provided in the Z-axis motor 51 outputs a pulse signal corresponding to the rotation angle of the Z-axis motor 51 to the deviation counter 37B. The deviation counter 37B calculates the deviation between the input Z-axis position command and the pulse signal. The deviation counter 37B outputs the calculated deviation to the servo amplifier 38B. The speed detector 51D detects the rotation speed of the Z-axis motor 51 based on the pulse signal output by the encoder 51B, and outputs a signal indicating the rotation speed to the servo amplifier 38B. The servo amplifier 38B uses a signal indicating the rotation speed input from the speed detector 51D as a feedback signal, and corrects the deviation input from the deviation counter 37B. The servo amplifier 38B outputs a drive current to the Z-axis motor 51 based on the corrected deviation. The Z-axis motor 51 rotates based on the Z-axis position command corrected according to the current rotation speed. At this time, the spindle head 7 moves in the Z-axis direction.

又、演算器36Aは入力したZ軸位置指令を、補正用演算器36Bに出力する。エンコーダ51Bは、Z軸モータ51の回転角に応じたパルス信号を補正用演算器36Bに出力する。補正用演算器36Bは、エンコーダ51Bから入力したパルス信号をフィードバック信号として用い、演算器36Aから入力したZ軸位置指令を補正する。補正用演算器36Bは、補正した指令より主軸位置指令を算出して偏差カウンタ37Aに出力する。主軸モータ52に設けたエンコーダ52Bは、主軸モータ52の回転角に応じたパルス信号を偏差カウンタ37Aに出力する。偏差カウンタ37Aは、入力した主軸位置指令とパルス信号との偏差を算出する。偏差カウンタ37Aは、算出した偏差をサーボアンプ38Aに出力する。速度検出器52Dは、エンコーダ52Bが出力したパルス信号に基づいて主軸モータ52の回転速度を検出し、回転速度を示す信号をサーボアンプ38Aに出力する。サーボアンプ38Aは、速度検出器52Dから入力した回転速度を示す信号をフィードバック信号として用い、偏差カウンタ37Aから入力した偏差を補正する。サーボアンプ38Aは補正した偏差に基づき、主軸モータ52に駆動電流を出力する。主軸モータ52は、現時点での回転速度に応じて補正した主軸位置指令に基づいて回転する。該時、主軸ヘッド7は、Z軸方向の移動に同期して回転する。故に、主軸位置指令はZ軸位置指令に同期する。 Further, the arithmetic unit 36A outputs the input Z-axis position command to the correction arithmetic unit 36B. The encoder 51B outputs a pulse signal corresponding to the rotation angle of the Z-axis motor 51 to the correction calculator 36B. The correction calculator 36B uses the pulse signal input from the encoder 51B as a feedback signal to correct the Z-axis position command input from the calculator 36A. The correction calculator 36B calculates a spindle position command from the corrected command and outputs it to the deviation counter 37A. The encoder 52B provided on the spindle motor 52 outputs a pulse signal corresponding to the rotation angle of the spindle motor 52 to the deviation counter 37A. The deviation counter 37A calculates the deviation between the input spindle position command and the pulse signal. The deviation counter 37A outputs the calculated deviation to the servo amplifier 38A. The speed detector 52D detects the rotation speed of the spindle motor 52 based on the pulse signal output by the encoder 52B, and outputs a signal indicating the rotation speed to the servo amplifier 38A. The servo amplifier 38A uses a signal indicating the rotation speed input from the speed detector 52D as a feedback signal, and corrects the deviation input from the deviation counter 37A. The servo amplifier 38A outputs a drive current to the spindle motor 52 based on the corrected deviation. The spindle motor 52 rotates based on the spindle position command corrected according to the current rotation speed. At this time, the spindle head 7 rotates in synchronization with the movement in the Z-axis direction. Therefore, the spindle position command is synchronized with the Z-axis position command.

尚、位置制御の場合において、図4の偏差カウンタ37B、サーボアンプ38Bは、図2の駆動回路51Aに対応する。位置制御の場合において、図4の偏差カウンタ37A、サーボアンプ38Aは、図2の駆動回路52Aに対応する。 In the case of position control, the deviation counter 37B and the servo amplifier 38B in FIG. 4 correspond to the drive circuit 51A in FIG. In the case of position control, the deviation counter 37A and the servo amplifier 38A in FIG. 4 correspond to the drive circuit 52A in FIG.

「N02」は主軸9を一定速度で正方向に回転させる為の命令「M03」を含む。該命令は、主軸9の回転速度情報「S2000」を少なくとも規定する。尚、「N05」以降における主軸9の回転速度情報は、「N05」の命令において「S1000」に規定してある。補正用演算器36B(図4参照)は、該命令に基づく主軸9の速度指令(以下、「主軸速度指令」と称す。)を算出し、駆動回路52Aに主軸速度指令を周期的に出力する。駆動回路52Aは主軸モータ52を駆動する。該時、主軸9は、「2000rpm」で回転する。以下、命令「M03」を実行する為の主軸モータ52の制御方式を、「速度制御」と称す。命令「M03」を、「速度命令」と称す。 "N02" includes a command "M03" for rotating the spindle 9 in the positive direction at a constant speed. The instruction at least defines the rotational speed information "S2000" of the spindle 9. The rotation speed information of the spindle 9 after "N05" is specified in "S1000" in the command of "N05". The correction calculator 36B (see FIG. 4) calculates the speed command of the spindle 9 based on the command (hereinafter referred to as “spindle speed command”), and periodically outputs the spindle speed command to the drive circuit 52A. .. The drive circuit 52A drives the spindle motor 52. At this time, the spindle 9 rotates at "2000 rpm". Hereinafter, the control method of the spindle motor 52 for executing the command "M03" is referred to as "speed control". The command "M03" is referred to as a "speed command".

「N04」「N05」は、タップ切削以外の通常の切削動作(以下、「通常切削」と称す。)を実行する為の命令「G01」(以下、「通常切削命令」と称す。)を含む。該命令は、工具4のZ軸方向の位置情報「Z-10/Z-15」、工具4のZ軸方向の移動速度情報「F500/F250」を少なくとも規定する。CPU31は、「N04」の命令「G01」を読み出した時、該命令に基づくZ軸位置指令を算出し、駆動回路51AにZ軸位置指令を周期的に出力する。駆動回路51Aは、Z軸モータ51を駆動する。該時、主軸ヘッド7はZ軸移動機構により、「Z-10」(位置情報)まで「500mm/min」(移動速度情報)でZ軸方向に移動する。同時にCPU31は、駆動回路51Aの制御とは非同期で、「N02」の「速度命令」に基づく主軸速度指令を駆動回路52Aに周期的に出力する。駆動回路52Aは、駆動回路51Aの制御とは独立して主軸モータ52を駆動する。該時、主軸9は、「2000rpm」(回転速度情報(「N04」の場合))で回転する。 "N04" and "N05" include a command "G01" (hereinafter referred to as "normal cutting command") for executing a normal cutting operation (hereinafter referred to as "normal cutting") other than tap cutting. .. The instruction at least defines the position information "Z-10 / Z-15" in the Z-axis direction of the tool 4 and the movement speed information "F500 / F250" in the Z-axis direction of the tool 4. When the CPU 31 reads the command "G01" of "N04", it calculates a Z-axis position command based on the command and periodically outputs the Z-axis position command to the drive circuit 51A. The drive circuit 51A drives the Z-axis motor 51. At this time, the spindle head 7 moves in the Z-axis direction at "500 mm / min" (movement speed information) up to "Z-10" (position information) by the Z-axis movement mechanism. At the same time, the CPU 31 periodically outputs a spindle speed command based on the "speed command" of "N02" to the drive circuit 52A, asynchronously with the control of the drive circuit 51A. The drive circuit 52A drives the spindle motor 52 independently of the control of the drive circuit 51A. At this time, the spindle 9 rotates at "2000 rpm" (rotational speed information (in the case of "N04")).

通常切削を実行する為の主軸モータ52の制御方式は、「速度制御」に対応する。通常切削を実行する為のZ軸モータ51の制御方式は、「位置制御」に対応する。「G01」のうちZ軸位置指令を算出する為の命令は、「位置命令」に対応する。「G01」のうち主軸速度指令を算出する為の命令は、「速度命令」に対応する。タップ切削を実行する為の命令(N08)及び通常切削を実行する為の命令(N04、N05)を総称し、切削命令と称す。 The control method of the spindle motor 52 for executing normal cutting corresponds to "speed control". The control method of the Z-axis motor 51 for executing normal cutting corresponds to "position control". The command for calculating the Z-axis position command in "G01" corresponds to the "position command". The command for calculating the spindle speed command in "G01" corresponds to the "speed command". The command for executing tap cutting (N08) and the command for executing normal cutting (N04, N05) are collectively referred to as a cutting command.

図4を参照し、通常切削を行う場合の速度制御を詳細に説明する。タップ切削を行う場合の位置制御と相違する点は、タップ切削ではZ軸位置指令に基づいて主軸位置指令が生成されるのに対して、通常切削では、CPU31が演算器36Aに主軸速度指令を出力し、且つ、演算器36Aは補正用演算器36B及び偏差カウンタ37Aをバイパスしてサーボアンプ38Aに主軸速度指令を出力する点である。該時、主軸ヘッド7は、Z軸方向の移動とは非同期で回転する。故に、主軸速度指令はZ軸位置指令に同期しない。 With reference to FIG. 4, speed control in the case of performing normal cutting will be described in detail. The difference from the position control in the case of tap cutting is that in tap cutting, the spindle position command is generated based on the Z-axis position command, whereas in normal cutting, the CPU 31 issues the spindle speed command to the calculator 36A. The point is that the arithmetic unit 36A outputs a spindle speed command to the servo amplifier 38A by bypassing the correction arithmetic unit 36B and the deviation counter 37A. At this time, the spindle head 7 rotates asynchronously with the movement in the Z-axis direction. Therefore, the spindle speed command is not synchronized with the Z-axis position command.

「N01」は、異常判定処理を開始することを示す為の命令(開始命令と称す。)「M901」を含む。CPU31は開始命令を読み出した時、次に後述の終了命令を読み出す迄、異常判定処理を実行可能とする。「N09」は、異常判定処理を終了することを示す為の命令(終了命令と称す。)「M902」を含む。CPU31は終了命令を読み出した時、次に有効命令を読み出す迄、異常判定処理を実行不能とする。 "N01" includes an instruction (referred to as a start instruction) "M901" for indicating to start the abnormality determination process. When the CPU 31 reads the start command, the CPU 31 can execute the abnormality determination process until the next end command described later is read. "N09" includes an instruction (referred to as an end instruction) "M902" for indicating that the abnormality determination process is terminated. When the CPU 31 reads the end instruction, the abnormality determination process cannot be executed until the next valid instruction is read.

<加減速中/定速中の判断方法>
図5は、CPU31が「N08」(図3参照)のタップ切削命令「G84」に応じて位置制御によりZ軸モータ51及び主軸モータ52を制御する場合を示す。図5(a-1)に示すように、CPU31は、タップ切削命令の「G84」の位置命令に応じ、時間t1~t2の間、位置情報「Z-10」、移動速度情報「F200」を用いて、時間t1~t2におけるZ軸位置指令pを算出し、駆動回路51Aに周期的に出力する。駆動回路51Aは、Z軸位置指令pに基づきZ軸モータ51を駆動する。該時、Z軸モータ51の回転速度は時間t1、t2のタイミングで急加速又は急減速する為、該タイミングで加減速度は大きくなる。従って、CPU31は、時間t1、t2のタイミング近傍で、Z軸モータ51に流れる電流に基づく異常発生の判定を行わないことが好ましい。
<Judgment method during acceleration / deceleration / constant speed>
FIG. 5 shows a case where the CPU 31 controls the Z-axis motor 51 and the spindle motor 52 by position control in response to the tap cutting command “G84” of “N08” (see FIG. 3). As shown in FIG. 5 (a-1), the CPU 31 responds to the position command of the tap cutting command “G84” and performs the position information “Z-10” and the movement speed information “F200” during the time t1 to t2. The Z-axis position command p at times t1 to t2 is calculated and periodically output to the drive circuit 51A. The drive circuit 51A drives the Z-axis motor 51 based on the Z-axis position command p. At this time, since the rotation speed of the Z-axis motor 51 suddenly accelerates or decelerates at the timings of time t1 and t2, the acceleration / deceleration speed becomes large at the timing. Therefore, it is preferable that the CPU 31 does not determine the occurrence of an abnormality based on the current flowing through the Z-axis motor 51 in the vicinity of the timings of the times t1 and t2.

本実施形態において、CPU31は、周期的に出力するZ軸位置指令pの時間変化を微分し、図5(a-2)に示す速度情報を算出する。更にCPU31は、算出した速度情報の時間変化を微分し、図5(a-3)に示す加速度情報を算出する。つまり、CPU31は、駆動回路51Aに周期的に出力するZ軸位置指令p(Z-10)の時間変化を二階微分し、加速度情報を算出する。CPU31は、算出した加速度情報の絶対値が所定の第一閾値Th1よりも大きい期間d21、d22の間、Z軸モータ51が加減速中と判定する。更に上述のように、タップ切削時において、Z軸位置指令p及び回転速度情報「S200」より主軸位置情報指令qが算出され、駆動回路52Aに周期的に出力される。この時、「q=p×移動速度情報÷回転速度情報」の関係を満たす。即ち、主軸モータ52はZ軸モータ51に同期して駆動する。故に、CPU41は、期間d21、d22の間、主軸モータ52に流れる電流に基づく異常発生の判定を行わない。一方、CPU31は、算出した加速度情報の絶対値が第一閾値Th1以下の期間d11、d12、d13の間、主軸モータ52が定速中と判定する。該期間、CPU31は主軸モータ52に流れる電流に基づく異常発生の判定を行う。 In the present embodiment, the CPU 31 differentiates the time change of the Z-axis position command p that is periodically output, and calculates the velocity information shown in FIG. 5 (a-2). Further, the CPU 31 differentiates the time change of the calculated velocity information and calculates the acceleration information shown in FIG. 5A-3. That is, the CPU 31 secondarily differentiates the time change of the Z-axis position command p (Z-10) that is periodically output to the drive circuit 51A, and calculates the acceleration information. The CPU 31 determines that the Z-axis motor 51 is accelerating or decelerating during the periods d21 and d22 in which the absolute value of the calculated acceleration information is larger than the predetermined first threshold value Th1. Further, as described above, at the time of tap cutting, the spindle position information command q is calculated from the Z-axis position command p and the rotation speed information "S200", and is periodically output to the drive circuit 52A. At this time, the relationship of "q = p × movement speed information ÷ rotation speed information" is satisfied. That is, the spindle motor 52 is driven in synchronization with the Z-axis motor 51. Therefore, the CPU 41 does not determine the occurrence of an abnormality based on the current flowing through the spindle motor 52 during the periods d21 and d22. On the other hand, the CPU 31 determines that the spindle motor 52 is in constant speed during the periods d11, d12, and d13 in which the absolute value of the calculated acceleration information is equal to or less than the first threshold value Th1. During this period, the CPU 31 determines the occurrence of an abnormality based on the current flowing through the spindle motor 52.

図6は、CPU31が「N02」(図3参照)の速度命令「M03」に応じて速度制御により主軸モータ52を制御する場合を示す。図6(b-1)に示すように、CPU31は、時間t3~t4の間、速度情報「S2000」を示す主軸速度指令vを駆動回路52Aに周期的に出力する。駆動回路52Aは、主軸速度指令vに基づき主軸モータ52を駆動する。図6(b-2)は、主軸モータ52に接続する速度検出器52Dにより計測した主軸モータ52の回転速度を示す情報(以下、「計測情報」と称す。)の時間的変化を示す。主軸モータ52の回転速度は、時間t3のタイミングと同時に2000rpm(速度情報)まで上昇せず、時間t3~t31の期間d41で緩やかに上昇する。又、主軸モータ52の回転速度は、時間t4のタイミングと同時に0rpmまで下降せず、時間t4~t41の期間d42で緩やかに下降する。期間d41、d42の間、主軸モータ52の回転速度の加減速度は大きくなる。従って、CPU31は、期間d41、d42の間、主軸モータ52に流れる電流に基づく異常発生の判定を行わないことが好ましい。 FIG. 6 shows a case where the CPU 31 controls the spindle motor 52 by speed control in response to the speed command “M03” of “N02” (see FIG. 3). As shown in FIG. 6 (b-1), the CPU 31 periodically outputs the spindle speed command v indicating the speed information “S2000” to the drive circuit 52A during the time t3 to t4. The drive circuit 52A drives the spindle motor 52 based on the spindle speed command v. FIG. 6 (b-2) shows the temporal change of the information indicating the rotation speed of the spindle motor 52 (hereinafter referred to as “measurement information”) measured by the speed detector 52D connected to the spindle motor 52. The rotational speed of the spindle motor 52 does not increase to 2000 rpm (speed information) at the same time as the timing of the time t3, but gradually increases in the period d41 of the time t3 to t31. Further, the rotation speed of the spindle motor 52 does not decrease to 0 rpm at the same time as the timing of the time t4, but gradually decreases in the period d42 of the time t4 to t41. During the periods d41 and d42, the acceleration / deceleration of the rotational speed of the spindle motor 52 increases. Therefore, it is preferable that the CPU 31 does not determine the occurrence of an abnormality based on the current flowing through the spindle motor 52 during the periods d41 and d42.

図6(b-3)に示すように、本実施形態においてCPU31は、速度情報が0である期間d31、d33の間、主軸モータ52に流れる電流に基づく異常発生の判定を行わない。CPU31は、第m(mは1以上の整数)番目の速度指令が示す速度情報(以下、「第m速度情報」と称す。)と、第m+1速度情報とが同一でないと判定してから、速度情報と計測情報とが同一であると判定するまでの期間d41の間、主軸モータ52が加減速中と判定する。該期間、CPU31は主軸モータ52に流れる電流に基づく異常発生の判定を行わない。CPU31は、速度情報と計測情報とが同一であると判定してから、第n(nは1以上の整数)速度情報と第n+1速度情報とが同一でないと判定するまでの期間d32の間、主軸モータ52が定速中と判定する。該期間、CPU31は主軸モータ52に流れる電流に基づく異常発生の判定を行う。CPU31は、第n速度情報と第n+1速度情報とが同一でないと判定してから、速度情報と計測情報とが同一であると判定するまでの期間d42の間、主軸モータ52が加減速中と判定する。該期間、CPU31は主軸モータ52に流れる電流に基づく異常発生の判定を行わない。 As shown in FIG. 6 (b-3), in the present embodiment, the CPU 31 does not determine the occurrence of an abnormality based on the current flowing through the spindle motor 52 during the periods d31 and d33 when the speed information is 0. The CPU 31 determines that the speed information (hereinafter referred to as "mth speed information") indicated by the mth (m is an integer of 1 or more) th speed command is not the same as the m + 1 speed information, and then determines that the speed information is not the same. It is determined that the spindle motor 52 is accelerating / decelerating during the period d41 until it is determined that the speed information and the measurement information are the same. During this period, the CPU 31 does not determine the occurrence of an abnormality based on the current flowing through the spindle motor 52. During the period d32 from the determination that the speed information and the measurement information are the same to the determination that the nth (n is an integer of 1 or more) speed information and the n + 1 speed information are not the same, the CPU 31 determines. It is determined that the spindle motor 52 is in constant speed. During this period, the CPU 31 determines the occurrence of an abnormality based on the current flowing through the spindle motor 52. During the period d42 from the determination that the nth velocity information and the n + 1th velocity information are not the same to the determination that the velocity information and the measurement information are the same, the CPU 31 states that the spindle motor 52 is accelerating or decelerating. judge. During this period, the CPU 31 does not determine the occurrence of an abnormality based on the current flowing through the spindle motor 52.

<第一フラグ情報、第二フラグ情報>
第一フラグ情報は、NCプログラムの開始命令(「M901」、図3参照)と終了命令(「M902」、図3参照)に基づいて異常判定処理の実行の可否を切り替える為のフラグ情報である。CPU31は、NCプログラムから開始命令を読み出した時、第一フラグ情報として開始フラグを記憶する(S17(図7参照))。CPU31は、NCプログラムから終了命令を読み込んだ時、第一フラグ情報として終了フラグを記憶する(S21(図7参照))。従って、第一フラグ情報は、開始命令を読み出してから次に終了命令を読み出すまでの間、開始フラグとなる。第一フラグ情報は、終了命令を読み出してから次に開始命令を読み出すまでの間、終了フラグとなる。CPU31は、第一フラグ情報として開始フラグを記憶する間(S45:YES(図8参照))、異常判定処理を実行可能とする。CPU31は、第一フラグ情報として終了フラグを記憶する間(S45:NO(図8参照))、異常判定処理を実行不能とする。
<First flag information, second flag information>
The first flag information is flag information for switching whether or not to execute the abnormality determination process based on the NC program start command (“M901”, see FIG. 3) and the end command (“M902”, see FIG. 3). .. When the start instruction is read from the NC program, the CPU 31 stores the start flag as the first flag information (S17 (see FIG. 7)). When the end instruction is read from the NC program, the CPU 31 stores the end flag as the first flag information (S21 (see FIG. 7)). Therefore, the first flag information becomes the start flag from the time when the start instruction is read until the next time when the end instruction is read. The first flag information becomes the end flag from the time when the end instruction is read until the next time when the start instruction is read. The CPU 31 is capable of executing the abnormality determination process while storing the start flag as the first flag information (S45: YES (see FIG. 8)). The CPU 31 makes the abnormality determination process unexecutable while storing the end flag as the first flag information (S45: NO (see FIG. 8)).

第二フラグ情報は、異常判定処理においてモータ50に流れる電流に基づく異常発生の有無の判定を行うか否かを切り替える為のフラグ情報である。CPU31は、主軸モータ52が加減速中と判定した時、第二フラグ情報として判定停止フラグを記憶する(S81(図9参照)、S103(図10参照))。CPU31は、速度制御を実行する場合において速度情報が0の時、第二フラグ情報として判定停止フラグを記憶する(S93(図10参照))。判定停止フラグは、異常発生の有無を判定しないことを示す。CPU31は、主軸モータ52が定速中と判定した時、第二フラグ情報として判定中フラグを記憶する(S77(図9参照)、S99(図10参照))。判定中フラグは、異常発生の有無を判定することを示す。CPU31は、第二フラグ情報として判定中フラグを記憶する間(S53:YES(図8参照))、主軸モータ52に流れる電流に基づく工具4の異常判定を行う(S57(図8参照))。 The second flag information is flag information for switching whether or not to determine whether or not an abnormality has occurred based on the current flowing through the motor 50 in the abnormality determination process. When the spindle motor 52 determines that acceleration / deceleration is in progress, the CPU 31 stores the determination stop flag as the second flag information (S81 (see FIG. 9), S103 (see FIG. 10)). When the speed information is 0 when the speed control is executed, the CPU 31 stores the determination stop flag as the second flag information (S93 (see FIG. 10)). The determination stop flag indicates that the presence or absence of an abnormality is not determined. When the spindle motor 52 determines that the speed is constant, the CPU 31 stores the determination flag as the second flag information (S77 (see FIG. 9), S99 (see FIG. 10)). The determination flag indicates that the presence or absence of an abnormality is determined. While the determination flag is stored as the second flag information (S53: YES (see FIG. 8)), the CPU 31 determines an abnormality of the tool 4 based on the current flowing through the spindle motor 52 (S57 (see FIG. 8)).

<メイン処理>
図7~図10を参照し、メイン処理を説明する。CPU31は、第一フラグ情報として終了フラグをRAM33に記憶し、第二フラグ情報として判定停止フラグをRAM33に記憶する(S11)。CPU31は、記憶装置34に記憶したNCプログラムの命令を順番に一つ読み出す(S13)。CPU31は、読み出した命令が開始命令か判定する(S15)。CPU31は、読み出した命令が開始命令であると判定した時(S15:YES)、第一フラグ情報として開始フラグをRAM33に記憶する(S17)。CPU31は処理をS13に戻す。CPU31は、読み出した命令が開始命令でないと判定した時(S15:NO)、読み出した命令が終了命令か判定する(S19)。CPU31は、読み出した命令が終了命令であると判定した時(S19:YES)、第一フラグ情報として終了フラグをRAM33に記憶する(S21)。CPU31は処理をS13に戻す。
<Main processing>
The main process will be described with reference to FIGS. 7 to 10. The CPU 31 stores the end flag in the RAM 33 as the first flag information, and stores the determination stop flag in the RAM 33 as the second flag information (S11). The CPU 31 reads one instruction of the NC program stored in the storage device 34 in order (S13). The CPU 31 determines whether the read instruction is a start instruction (S15). When the CPU 31 determines that the read instruction is a start instruction (S15: YES), the CPU 31 stores the start flag in the RAM 33 as the first flag information (S17). The CPU 31 returns the process to S13. When the CPU 31 determines that the read instruction is not a start instruction (S15: NO), the CPU 31 determines whether the read instruction is an end instruction (S19). When the CPU 31 determines that the read instruction is an end instruction (S19: YES), the CPU 31 stores the end flag in the RAM 33 as the first flag information (S21). The CPU 31 returns the process to S13.

CPU31は、読み出した命令が終了命令でないと判定した時(S19:NO)、読み出した命令が切削命令(位置命令又は速度命令)か判定する(S23)。CPU31は、読み出した命令が切削命令でないと判定した時(S23:NO)、読み出した命令が、NCプログラムの完了を示す完了命令か判定する(S29)。CPU31は、読み出した命令が完了命令でないと判定した時(S29:NO)、読み出した命令に基づき処理を実行する(S31)。CPU31は、処理の終了後、処理をS13に進める。CPU31は、NCプログラムの次の命令を一つ読み出し(S13)、S15~S31の処理を繰り返す。 When the CPU 31 determines that the read instruction is not an end instruction (S19: NO), the CPU 31 determines whether the read instruction is a cutting instruction (position instruction or speed instruction) (S23). When the CPU 31 determines that the read instruction is not a cutting instruction (S23: NO), the CPU 31 determines whether the read instruction is a completion instruction indicating the completion of the NC program (S29). When the CPU 31 determines that the read instruction is not a completion instruction (S29: NO), the CPU 31 executes a process based on the read instruction (S31). After the processing is completed, the CPU 31 advances the processing to S13. The CPU 31 reads one instruction next to the NC program (S13), and repeats the processes of S15 to S31.

CPU31は、S13で読み出した命令が切削命令であると判定した時(S23:YES)、異常判定処理(図8参照)を実行する(S25)。図8に示すように、CPU31は、RAM33に記憶した比較速度情報を初期化する(S41)。CPU31は切削命令に応じた切削処理(通常切削又はタップ切削)を開始する(S43)。CPU31は、第一フラグ情報として開始フラグを記憶しているか判定する(S45)。CPU31は、第一フラグとして終了フラグを記憶していると判定した時(S45:NO)、処理をS59に進める。CPU31は、第一フラグ情報として開始フラグを記憶していると判定した時(S45:YES)、処理をS47に進める。 When the CPU 31 determines that the command read in S13 is a cutting command (S23: YES), the CPU 31 executes an abnormality determination process (see FIG. 8) (S25). As shown in FIG. 8, the CPU 31 initializes the comparison speed information stored in the RAM 33 (S41). The CPU 31 starts a cutting process (normal cutting or tap cutting) according to a cutting command (S43). The CPU 31 determines whether or not the start flag is stored as the first flag information (S45). When the CPU 31 determines that the end flag is stored as the first flag (S45: NO), the processing proceeds to S59. When the CPU 31 determines that the start flag is stored as the first flag information (S45: YES), the CPU 31 advances the process to S47.

CPU31は、S13(図7参照)で読み出した命令に応じて主軸モータ52を制御する時の制御方式が位置制御か判定する(S47)。CPU31は、タップ切削を実行する為のタップ切削命令を読み出した時、主軸モータ52の制御方式が位置制御であると判定する(S47:YES)。該時、CPU31は第一判定処理(図9参照)を実行する(S49)。CPU31は、通常切削を実行する為の通常切削命令を読み出した時、主軸モータ52の制御方式が速度制御であると判定する(S47:NO)。該時、CPU31は第二判定処理(図10参照)を実行する(S51)。CPU31は、第一判定処理又は第二判定処理の終了後、処理をS53に進める。 The CPU 31 determines whether the control method for controlling the spindle motor 52 is position control in response to the command read in S13 (see FIG. 7) (S47). When the CPU 31 reads out a tap cutting command for executing tap cutting, it determines that the control method of the spindle motor 52 is position control (S47: YES). At this time, the CPU 31 executes the first determination process (see FIG. 9) (S49). When the CPU 31 reads out a normal cutting command for executing normal cutting, it determines that the control method of the spindle motor 52 is speed control (S47: NO). At this time, the CPU 31 executes the second determination process (see FIG. 10) (S51). After the first determination process or the second determination process is completed, the CPU 31 advances the process to S53.

図9を参照し、第一判定処理を説明する。CPU31は、駆動回路51Aに周期的に出力するZ軸位置指令の時間変化を二階微分し、加速度情報を算出する(S71)。CPU31は、第二フラグ情報として判定停止フラグを記憶しているか判定する(S73)。CPU31は、第二フラグ情報として判定停止フラグを記憶していると判定した時(S73:YES)、加速度情報が所定の第一閾値以下か判定する(S75)。CPU31は、加速度情報が第一閾値以下と判定した時(S75:YES)、Z軸モータ51に同期して動作する主軸モータ52が定速中と判定する。CPU31は、第二フラグ情報として判定中フラグをRAM33に記憶する(S77)。CPU31は第一判定処理を終了し、処理を異常判定処理(図8参照)に戻す。CPU31は、加速度情報が第一閾値よりも大きいと判定した時(S75:NO)、Z軸モータ51に同期して動作する主軸モータ52が加減速中と判定する。CPU31は第一判定処理を終了し、処理を異常判定処理(図8参照)に戻す。該時、第二フラグ情報として判定停止フラグを記憶した状態は継続する。 The first determination process will be described with reference to FIG. The CPU 31 secondarily differentiates the time change of the Z-axis position command that is periodically output to the drive circuit 51A, and calculates the acceleration information (S71). The CPU 31 determines whether or not the determination stop flag is stored as the second flag information (S73). When the CPU 31 determines that the determination stop flag is stored as the second flag information (S73: YES), the CPU 31 determines whether the acceleration information is equal to or less than a predetermined first threshold value (S75). When the CPU 31 determines that the acceleration information is equal to or less than the first threshold value (S75: YES), the CPU 31 determines that the spindle motor 52 that operates in synchronization with the Z-axis motor 51 is in constant speed. The CPU 31 stores the determination flag as the second flag information in the RAM 33 (S77). The CPU 31 ends the first determination process and returns the process to the abnormality determination process (see FIG. 8). When the CPU 31 determines that the acceleration information is larger than the first threshold value (S75: NO), the CPU 31 determines that the spindle motor 52 operating in synchronization with the Z-axis motor 51 is accelerating or decelerating. The CPU 31 ends the first determination process and returns the process to the abnormality determination process (see FIG. 8). At this time, the state in which the determination stop flag is stored as the second flag information continues.

CPU31は、第二フラグ情報として判定中フラグを記憶していると判定した時(S73:NO)、加速度情報が第一閾値よりも大きいか判定する(S79)。CPU31は、加速度情報が第一閾値よりも大きいと判定した時(S79:YES)、Z軸モータ51に同期して動作する主軸モータ52が加減速中と判定する。CPU31は、第二フラグ情報として判定停止フラグをRAM33に記憶する(S81)。CPU31は第一判定処理を終了し、処理を異常判定処理(図8参照)に戻す。CPU31は、加速度情報が第一閾値以下と判定した時(S79:NO)、Z軸モータ51に同期して動作する主軸モータ52が定速中と判定する。CPU31は第一判定処理を終了し、処理を異常判定処理(図8参照)に戻す。該時、第二フラグ情報として判定中フラグを記憶した状態は継続する。 When the CPU 31 determines that the determination flag is stored as the second flag information (S73: NO), the CPU 31 determines whether the acceleration information is larger than the first threshold value (S79). When the CPU 31 determines that the acceleration information is larger than the first threshold value (S79: YES), the CPU 31 determines that the spindle motor 52 operating in synchronization with the Z-axis motor 51 is accelerating or decelerating. The CPU 31 stores the determination stop flag in the RAM 33 as the second flag information (S81). The CPU 31 ends the first determination process and returns the process to the abnormality determination process (see FIG. 8). When the CPU 31 determines that the acceleration information is equal to or less than the first threshold value (S79: NO), the CPU 31 determines that the spindle motor 52 that operates in synchronization with the Z-axis motor 51 is in constant speed. The CPU 31 ends the first determination process and returns the process to the abnormality determination process (see FIG. 8). At this time, the state in which the determination flag is stored as the second flag information continues.

図10を参照し、第二判定処理を説明する。CPU31は、駆動回路52Aに周期的に出力する主軸速度指令が示す速度情報を取得する。CPU31は、取得した速度情報が0かを判定する(S91)。CPU31は、速度情報が0であると判定した時(S91:YES)、第二フラグ情報として判定停止フラグを記憶する(S93)。CPU31は処理をS105に進める。CPU31は、速度情報が0でないと判定した時(S91:NO)、処理をS95に進める。 The second determination process will be described with reference to FIG. The CPU 31 acquires the speed information indicated by the spindle speed command periodically output to the drive circuit 52A. The CPU 31 determines whether the acquired speed information is 0 (S91). When the CPU 31 determines that the speed information is 0 (S91: YES), the CPU 31 stores the determination stop flag as the second flag information (S93). The CPU 31 advances the process to S105. When the CPU 31 determines that the speed information is not 0 (S91: NO), the CPU 31 advances the process to S95.

CPU31は、第二フラグ情報として判定停止フラグを記憶しているか判定する(S95)。CPU31は、第二フラグ情報として判定停止フラグを記憶していると判定した時(S95:YES)、処理をS97に進める。CPU31は、主軸モータ52に接続した速度検出器52Dが出力する信号に基づき、主軸モータ52の回転速度を計測した計測情報を取得する。CPU31は、計測情報と速度情報とが同一か否か判定する(S97)。CPU31は、計測情報と速度情報とが同一と判定した時(S97:YES)、主軸モータ52が定速中と判定する。CPU31は、第二フラグ情報として判定中フラグを記憶する(S99)。CPU31は、処理をS105に進める。CPU31は、計測情報と速度情報とが同一でないと判定した時(S97:NO)、処理をS105に進める。該時、第二フラグ情報として判定停止フラグを記憶した状態は継続する。 The CPU 31 determines whether or not the determination stop flag is stored as the second flag information (S95). When the CPU 31 determines that the determination stop flag is stored as the second flag information (S95: YES), the CPU 31 advances the process to S97. The CPU 31 acquires measurement information obtained by measuring the rotation speed of the spindle motor 52 based on the signal output by the speed detector 52D connected to the spindle motor 52. The CPU 31 determines whether or not the measurement information and the speed information are the same (S97). When the CPU 31 determines that the measurement information and the speed information are the same (S97: YES), the CPU 31 determines that the spindle motor 52 is in constant speed. The CPU 31 stores the determination flag as the second flag information (S99). The CPU 31 advances the process to S105. When the CPU 31 determines that the measurement information and the speed information are not the same (S97: NO), the CPU 31 advances the process to S105. At this time, the state in which the determination stop flag is stored as the second flag information continues.

CPU31は、第二フラグ情報として判定中フラグを記憶していると判定した時(S95:NO)、RAM33に記憶した比較速度情報と速度情報とが同一か否か判定する(S101)。これによりCPU31は、駆動回路52Aが主軸モータ52に連続して出力する二つの速度指令が示す二つの速度情報が同一か否かを判定する。CPU31は、比較速度情報と速度情報とが同一でないと判定した時(S101:NO)、主軸モータ52が加減速中と判定する。CPU31は、第二フラグ情報として判定停止フラグを記憶する(S103)。CPU31は、処理をS105に進める。CPU31は、比較速度情報と速度情報とが同一であると判定した時(S101:YES)、処理をS105に進める。該時、第二フラグ情報として判定中フラグを記憶した状態は継続する。 When the CPU 31 determines that the determination flag is stored as the second flag information (S95: NO), the CPU 31 determines whether or not the comparative speed information stored in the RAM 33 and the speed information are the same (S101). As a result, the CPU 31 determines whether or not the two speed information indicated by the two speed commands continuously output by the drive circuit 52A to the spindle motor 52 are the same. When the CPU 31 determines that the comparative speed information and the speed information are not the same (S101: NO), the CPU 31 determines that the spindle motor 52 is accelerating or decelerating. The CPU 31 stores the determination stop flag as the second flag information (S103). The CPU 31 advances the process to S105. When the CPU 31 determines that the comparative speed information and the speed information are the same (S101: YES), the CPU 31 advances the process to S105. At this time, the state in which the determination flag is stored as the second flag information continues.

CPU31は、比較速度情報として速度情報を記憶し、比較速度情報を更新する(S105)。CPU31は、第二判定処理を終了し、処理を異常判定処理(図8参照)に戻す。 The CPU 31 stores the speed information as the comparison speed information and updates the comparison speed information (S105). The CPU 31 ends the second determination process and returns the process to the abnormality determination process (see FIG. 8).

図8に示すように、CPU31は、第一判定処理(S49)又は第二判定処理(S51)の終了後、第二フラグ情報として判定中フラグを記憶しているか判定する(S53)。CPU31は、第二フラグ情報として判定停止フラグを記憶していると判定した時(S53:NO)、工具4の異常発生の有無を判定しない。該時、CPU31は処理をS59に進める。CPU31は、第二フラグ情報として判定中フラグを記憶していると判定した時(S53:YES)、以下の如く工具4の異常発生の有無を判定する。 As shown in FIG. 8, after the end of the first determination process (S49) or the second determination process (S51), the CPU 31 determines whether or not the determination flag is stored as the second flag information (S53). When the CPU 31 determines that the determination stop flag is stored as the second flag information (S53: NO), the CPU 31 does not determine whether or not the tool 4 has an abnormality. At this time, the CPU 31 advances the process to S59. When the CPU 31 determines that the determination flag is stored as the second flag information (S53: YES), the CPU 31 determines whether or not an abnormality has occurred in the tool 4 as follows.

CPU31は、電流検出器52Cが検出する電流を、主軸モータ52に流れる電流として駆動回路52Aから取得する(S55)。CPU31は、検出した電流が所定の第二閾値以下か判定する(S57)。CPU31は、検出した電流が第二閾値よりも大きいと判定した時(S57:NO)、工具4に異常が発生したと判定する。CPU31は、表示部17(図2参照)に警告を表示する(S61)。CPU31は、異常判定処理を終了し、処理をメイン処理(図7参照)に戻す。CPU31は、検出した電流が第二閾値以下と判定した時(S57:YES)、処理をS59に進める。CPU31は、S13(図7参照)で読み出した切削命令に応じた切削処理が完了したか判定する(S59)。CPU31は、切削処理が完了していないと判定した時(S59:NO)、処理をS45に戻す。CPU31は、切削処理が完了したと判定した特(S59:YES)、異常判定処理を終了し、処理をメイン処理(図7参照)に戻す。 The CPU 31 acquires the current detected by the current detector 52C from the drive circuit 52A as the current flowing through the spindle motor 52 (S55). The CPU 31 determines whether the detected current is equal to or less than a predetermined second threshold value (S57). When the CPU 31 determines that the detected current is larger than the second threshold value (S57: NO), the CPU 31 determines that an abnormality has occurred in the tool 4. The CPU 31 displays a warning on the display unit 17 (see FIG. 2) (S61). The CPU 31 ends the abnormality determination process and returns the process to the main process (see FIG. 7). When the CPU 31 determines that the detected current is equal to or less than the second threshold value (S57: YES), the CPU 31 advances the process to S59. The CPU 31 determines whether or not the cutting process corresponding to the cutting command read in S13 (see FIG. 7) is completed (S59). When the CPU 31 determines that the cutting process has not been completed (S59: NO), the CPU 31 returns the process to S45. The CPU 31 ends the abnormality determination process when it is determined that the cutting process is completed (S59: YES), and returns the process to the main process (see FIG. 7).

図7に示すように、CPU31は、異常判定処理(S25)の終了後、表示部17に警告を表示したか判定する(S27)。CPU31は、表示部17に警告を表示した時(S27:YES)、工具4に異常が発生している為、メイン処理を終了する。CPU31は、表示部17に警告を表示していない時(S27:NO)、処理をS13に戻す。CPU31は、NCプログラムの次の命令を一つ読み出し(S13)、S15~S31の処理を繰り返す。CPU31は、読み出した命令が完了命令であると判定した場合(S29:YES)、メイン処理を終了する。 As shown in FIG. 7, the CPU 31 determines whether or not a warning has been displayed on the display unit 17 after the abnormality determination process (S25) is completed (S27). When the warning is displayed on the display unit 17 (S27: YES), the CPU 31 ends the main process because an abnormality has occurred in the tool 4. When the warning is not displayed on the display unit 17 (S27: NO), the CPU 31 returns the process to S13. The CPU 31 reads one instruction next to the NC program (S13), and repeats the processes of S15 to S31. When the CPU 31 determines that the read instruction is a completion instruction (S29: YES), the CPU 31 ends the main process.

<本実施形態の作用、効果>
工作機械1は、Z軸モータ51、主軸モータ52、及び、夫々を駆動する為の駆動回路51A、52Aを備える。数値制御装置30は主軸モータ52の速度制御を実行する場合において、速度命令に基づく主軸速度指令を、演算器36Aを介して駆動回路52A(偏差カウンタ37A及びサーボアンプ38A)に周期的に出力する。数値制御装置30は主軸モータ52及びZ軸モータ51の夫々の位置制御を実行する場合において、位置命令に基づくZ軸位置指令を、演算器36Aを介して駆動回路51A(偏差カウンタ37B及びサーボアンプ38B)に周期的に出力し、且つ、主軸位置指令を、演算器36A及び補正用演算器36Bを介して駆動回路52A(偏差カウンタ37A及びサーボアンプ38A)に周期的に出力する。数値制御装置30は主軸モータ52が定速中と判定した時(S53:YES)、工具4の異常発生の有無を判定する。数値制御装置30は、主軸モータ52が加減速中と判定した時(S53:NO)、工具4の異常発生の有無を判定しない。該為、主軸モータ52が加減速中の時に工具4の異常発生とは別の要因で主軸モータ52に流れる電流が変動した場合に、工具4の異常発生を誤って判定する可能性を軽減できる。数値制御装置30は、位置制御により主軸モータ52を制御する時(タップ切削時)と、速度制御により主軸モータ52を制御する時(通常切削時)とで異なる判定方法に基づき、主軸モータ52が加減速中か又は定速中かを判定する。該為、数値制御装置30は、夫々の制御方式に応じた適切な判定方法により、主軸モータ52が加減速中か又は定速中かを適切に判定できる。従って、数値制御装置30は、工具4の異常発生の精度を高めることができる。
<Action and effect of this embodiment>
The machine tool 1 includes a Z-axis motor 51, a spindle motor 52, and drive circuits 51A and 52A for driving each. When the numerical control device 30 executes the speed control of the spindle motor 52, the numerical control device 30 periodically outputs a spindle speed command based on the speed command to the drive circuit 52A (deviation counter 37A and servo amplifier 38A) via the arithmetic unit 36A. .. When the numerical control device 30 executes the position control of each of the spindle motor 52 and the Z-axis motor 51, the numerical control device 30 issues a Z-axis position command based on the position command to the drive circuit 51A (deviation counter 37B and servo amplifier) via the arithmetic unit 36A. 38B) is periodically output, and the spindle position command is periodically output to the drive circuit 52A (deviation counter 37A and servo amplifier 38A) via the arithmetic unit 36A and the correction arithmetic unit 36B. When the numerical control device 30 determines that the spindle motor 52 is in constant speed (S53: YES), the numerical control device 30 determines whether or not an abnormality has occurred in the tool 4. When the numerical control device 30 determines that the spindle motor 52 is accelerating / decelerating (S53: NO), the numerical control device 30 does not determine whether or not an abnormality has occurred in the tool 4. Therefore, when the current flowing through the spindle motor 52 fluctuates due to a factor other than the occurrence of the abnormality of the tool 4 while the spindle motor 52 is accelerating or decelerating, the possibility of erroneously determining the occurrence of the abnormality of the tool 4 can be reduced. .. The numerical control device 30 is based on a determination method different between when the spindle motor 52 is controlled by position control (during tap cutting) and when the spindle motor 52 is controlled by speed control (during normal cutting). Determine whether acceleration / deceleration is in progress or constant speed is in progress. Therefore, the numerical control device 30 can appropriately determine whether the spindle motor 52 is in acceleration / deceleration or in constant speed by an appropriate determination method according to each control method. Therefore, the numerical control device 30 can improve the accuracy of the occurrence of the abnormality of the tool 4.

工作機械1は、被削材3に対して工具4を相対的に回転させる為の主軸モータ52、及び、被削材3に対する工具4を相対的に移動させる為のZ軸モータ51を備える。数値制御装置30がタップ切削を行う時、主軸モータ52はZ軸モータ51に同期して回転する。この時、主軸モータ52の制御方式は位置制御である。数値制御装置30は、主軸モータ52が位置制御と判定した時(図9参照)、Z軸モータ51に出力するZ軸位置指令を二階微分して加速度情報を算出する(S71)。数値制御装置30は、加速度情報と第一閾値との関係に応じ、Z軸モータ51に同期して動作する主軸モータ52が加減速中か定速中かを判定する。一方、数値制御装置30が通常切削を行う時、主軸モータ52はZ軸モータ51と非同期で回転する。この時、主軸モータ52の制御方式は速度制御である。数値制御装置30は、主軸モータ52が速度制御と判定した時(図10参照)、主軸モータ52に出力する主軸速度指令が示す速度情報と、主軸モータ52の回転速度を計測した計測情報とが同一か否かに応じ、主軸モータ52が加減速中か定速中かを判定する(S97)。数値制御装置30は、速度制御と判定した時(図10参照)、主軸モータ52に連続して出力する二つの速度指令が示す二つの速度情報が同一か否かに応じ、主軸モータ52が加減速中か定速中かを判定する(S101)。該時、数値制御装置30は、主軸モータ52が加減速中か又は定速中かの判定を適切に実行できるので、異常発生の有無の判定精度を向上できる。 The machine tool 1 includes a spindle motor 52 for rotating the tool 4 relative to the work material 3 and a Z-axis motor 51 for moving the tool 4 relative to the work material 3. When the numerical control device 30 performs tap cutting, the spindle motor 52 rotates in synchronization with the Z-axis motor 51. At this time, the control method of the spindle motor 52 is position control. When the spindle motor 52 determines the position control (see FIG. 9), the numerical control device 30 second-orders the Z-axis position command output to the Z-axis motor 51 to calculate the acceleration information (S71). The numerical control device 30 determines whether the spindle motor 52, which operates in synchronization with the Z-axis motor 51, is in acceleration / deceleration or in constant speed, according to the relationship between the acceleration information and the first threshold value. On the other hand, when the numerical control device 30 performs normal cutting, the spindle motor 52 rotates asynchronously with the Z-axis motor 51. At this time, the control method of the spindle motor 52 is speed control. When the numerical control device 30 determines that the spindle motor 52 determines the speed control (see FIG. 10), the speed information indicated by the spindle speed command output to the spindle motor 52 and the measurement information measured by the rotation speed of the spindle motor 52 are displayed. It is determined whether the spindle motor 52 is in acceleration / deceleration or in constant speed depending on whether they are the same (S97). When the numerical control device 30 determines that the speed control is performed (see FIG. 10), the spindle motor 52 is added depending on whether or not the two speed information indicated by the two speed commands continuously output to the spindle motor 52 are the same. It is determined whether deceleration is in progress or constant speed is in progress (S101). At this time, the numerical control device 30 can appropriately determine whether the spindle motor 52 is in acceleration / deceleration or constant speed, so that the accuracy of determining whether or not an abnormality has occurred can be improved.

RAM33は、異常発生の有無を判定するか否かを示す第二フラグ情報を記憶する。数値制御装置30は、最初にモータ50が加減速中か定速中かを最初に判断する(SS57)前に、異常発生の有無を判定しないことを示す判定停止フラグを第二フラグ情報としてRAM33に記憶する(S11)。数値制御装置30は、第二フラグ情報として判定停止フラグを記憶した状態で、主軸モータ52が定速中と判定した時(S75:YES、S97:YES)、異常発生の有無を判定することを示す判定中フラグを第二フラグ情報としてRAM33に記憶する(S77、S99)。数値制御装置30は、第二フラグ情報として判定中フラグを記憶した状態で、主軸モータ52が加減速中と判定した時(S79:NO、S101:NO)、判定停止フラグを第二フラグ情報としてRAM33に記憶する(S81、S103)。数値制御装置30は、第二フラグ情報として判定中フラグを記憶した状態の時(S53:YES)、異常発生の有無を判定する(S55,S57)。数値制御装置30は、第二フラグ情報として判定停止フラグを記憶した状態の時(S53:NO)、異常発生の有無を判定しない。従って、数値制御装置30は、異常発生の有無を判定するか否かを、主軸モータ52の状態に応じて適切に判定できる。 The RAM 33 stores the second flag information indicating whether or not to determine whether or not an abnormality has occurred. The numerical control device 30 uses the determination stop flag indicating that the presence or absence of an abnormality has not been determined as the second flag information in the RAM 33 before first determining whether the motor 50 is in acceleration / deceleration or constant speed (SS57). It is stored in (S11). When the spindle motor 52 determines that the speed is constant (S75: YES, S97: YES) in a state where the determination stop flag is stored as the second flag information, the numerical control device 30 determines whether or not an abnormality has occurred. The indicating determination flag is stored in the RAM 33 as the second flag information (S77, S99). When the spindle motor 52 determines that acceleration / deceleration is in progress (S79: NO, S101: NO) in a state where the determination flag is stored as the second flag information, the numerical control device 30 uses the determination stop flag as the second flag information. It is stored in the RAM 33 (S81, S103). The numerical control device 30 determines whether or not an abnormality has occurred (S55, S57) when the determination flag is stored as the second flag information (S53: YES). The numerical control device 30 does not determine whether or not an abnormality has occurred when the determination stop flag is stored as the second flag information (S53: NO). Therefore, the numerical control device 30 can appropriately determine whether or not to determine whether or not an abnormality has occurred, depending on the state of the spindle motor 52.

記憶装置34に記憶したNCプログラムは、異常発生の有無の判定を開始することを示す開始命令、及び、異常発生の有無の判定を終了することを示す終了命令を含む。数値制御装置30は、開始命令を読み出してから(S15:YES)、次に終了命令を読み出す(S19:YES)までの間、第一フラグ情報として開始フラグを記憶する(S17)。該時、数値制御装置30は、工具4の異常発生の有無を判定する。数値制御装置30は、終了命令を読み出してから(S19:YES)、次に前記開始命令を読み出す(S15:YES)までの間、第一フラグ情報として終了フラグを記憶する(S21)。該時、数値制御装置30は、工具4の異常発生の有無を判定しない。該時、数値制御装置30は、NCプログラムがモータ50の制御命令とともに有する開始命令と終了命令とに基づき、異常発生の有無の判定機関を指定できる。 The NC program stored in the storage device 34 includes a start command indicating to start the determination of the presence / absence of an abnormality and an end command indicating to end the determination of the presence / absence of an abnormality. The numerical control device 30 stores the start flag as the first flag information (S17) from the time when the start instruction is read (S15: YES) to the time when the end instruction is read (S19: YES). At that time, the numerical control device 30 determines whether or not an abnormality has occurred in the tool 4. The numerical control device 30 stores the end flag as the first flag information (S21) from the time when the end command is read (S19: YES) to the time when the start command is read (S15: YES). At this time, the numerical control device 30 does not determine whether or not the tool 4 has an abnormality. At this time, the numerical control device 30 can specify a determination body for the presence or absence of an abnormality based on the start command and the end command that the NC program has together with the control command of the motor 50.

<変形例>
本発明は上記実施形態に限らない。CPU31は、S97の処理を実行する時、速度情報と計測情報とが完全同一か否か判定しなくてもよい。例えばCPU31は、速度情報に対して計測情報が所定の範囲内に含まれる時、速度情報と計測情報とが同一と判定してもよい。CPU31は、S101の処理を実行する時、比較速度情報と速度情報とが完全同一か否か判定しなくてもよい。例えばCPU31は、比較速度情報に対して速度情報が所定の範囲内に含まれる時、比較速度情報と速度情報とが同一と判定してもよい。
<Modification example>
The present invention is not limited to the above embodiment. When executing the process of S97, the CPU 31 does not have to determine whether the speed information and the measurement information are completely the same. For example, the CPU 31 may determine that the speed information and the measurement information are the same when the measurement information is included in the predetermined range with respect to the speed information. When executing the process of S101, the CPU 31 does not have to determine whether the comparative speed information and the speed information are completely the same. For example, the CPU 31 may determine that the comparative speed information and the speed information are the same when the speed information is included in the predetermined range with respect to the comparative speed information.

工作機械1は、被削材3を保持するテーブル13を回転する為のモータを備えてもよい。工作機械1は、該モータの回転により、工具4に対して被削材3を相対的に回転させて切削加工を実行してもよい。該時、CPU31は、速度制御と判定した時(図10参照)、該モータに出力する速度指令が示す速度情報と、該モータの回転速度を計測した計測情報とが同一か否か判定してもよい。又、CPU31は、速度制御と判定した時、該モータに連続して出力する二つの速度指令が示す二つの速度情報が同一か否か判定してもよい。 The machine tool 1 may include a motor for rotating the table 13 that holds the work material 3. The machine tool 1 may execute cutting by rotating the work material 3 relative to the tool 4 by the rotation of the motor. At that time, when the CPU 31 determines that the speed control is performed (see FIG. 10), the CPU 31 determines whether or not the speed information indicated by the speed command output to the motor is the same as the measurement information measured by the rotation speed of the motor. May be good. Further, when the CPU 31 determines that the speed control is performed, the CPU 31 may determine whether or not the two speed information indicated by the two speed commands continuously output to the motor are the same.

CPU31は、タップ切削を行う際に、主軸位置指令を駆動回路52Aに周期的に出力してもよい。これにより、駆動回路52Aは主軸モータ52を駆動してもよい。同時に、駆動回路52Aの制御に同期して、Z軸位置指令を駆動回路51Aに周期的に出力してもよい。これにより、駆動回路51Aは、主軸モータ52に同期してZ軸モータ51を駆動してもよい。CPU31は、主軸モータ52の駆動回路52Aに周期的に出力する主軸位置指令を二階微分して、加速度情報を算出してもよい(S71)。CPU31は、算出した加速度情報と第一閾値との関係に基づいて、主軸モータ52に同期して動作するZ軸モータ51が加減速中か又は定速中か判定してもよい(S75、S79)。CPU31は、Z軸モータ51の電流に基づき、工具4の異常発生の有無を判定してもよい(S57)。 The CPU 31 may periodically output a spindle position command to the drive circuit 52A when performing tap cutting. As a result, the drive circuit 52A may drive the spindle motor 52. At the same time, the Z-axis position command may be periodically output to the drive circuit 51A in synchronization with the control of the drive circuit 52A. As a result, the drive circuit 51A may drive the Z-axis motor 51 in synchronization with the spindle motor 52. The CPU 31 may calculate the acceleration information by second-order differentializing the spindle position command periodically output to the drive circuit 52A of the spindle motor 52 (S71). The CPU 31 may determine whether the Z-axis motor 51 operating in synchronization with the spindle motor 52 is in acceleration / deceleration or in constant speed based on the relationship between the calculated acceleration information and the first threshold value (S75, S79). ). The CPU 31 may determine whether or not an abnormality has occurred in the tool 4 based on the current of the Z-axis motor 51 (S57).

CPU31は、タップ切削を行う際に、Z軸モータ51及び主軸モータ52にそれぞれ出力する位置指令(Z軸位置指令及び主軸位置指令)を二階微分し、それぞれの加速度情報を算出してもよい。CPU31は、算出した加速度情報と第一閾値との関係に基づいて、Z軸モータ51と主軸モータ52との何れかが加減速中か又は定速中か判定してもよい(S75、S79)。CPU31は、Z軸モータ51と主軸モータ52との何れかが定速中と判定した時、Z軸モータ51と主軸モータ52との何れかに流れる電流に基づき、工具4の異常発生の有無を判定してもよい。 The CPU 31 may secondarily differentiate the position commands (Z-axis position command and spindle position command) output to the Z-axis motor 51 and the spindle motor 52, respectively, and calculate the respective acceleration information when tap cutting is performed. The CPU 31 may determine whether either the Z-axis motor 51 or the spindle motor 52 is in acceleration / deceleration or in constant speed based on the relationship between the calculated acceleration information and the first threshold value (S75, S79). .. When the CPU 31 determines that either the Z-axis motor 51 or the spindle motor 52 is in constant speed, the CPU 31 determines whether or not an abnormality has occurred in the tool 4 based on the current flowing through either the Z-axis motor 51 or the spindle motor 52. You may judge.

CPU31は、読み出した命令が通常切削命令時、主軸モータ52の制御方式が速度制御であると判定した(S47:YES)。CPU31は、読み出した命令がタップ切削命令の時、主軸モータ52の制御方式が位置制御であると判定した(S47:NO)。CPU31は、上記と異なる方法で、速度制御か位置制御かを判定してもよい。例えばNCプログラムは、速度制御か又は位置制御かを示すフラグ情報を含んでいてもよい。CPU31は、該フラグ情報に基づいて、速度制御か位置制御かを判定してもよい。NCプログラムは、開始命令及び終了命令を含まなくてもよい。CPU31は、第一フラグ情報として記憶されたフラグに限らず、工具4の異常発生の有無を常に判定してもよい。 When the read command is a normal cutting command, the CPU 31 determines that the control method of the spindle motor 52 is speed control (S47: YES). When the read command is a tap cutting command, the CPU 31 determines that the control method of the spindle motor 52 is position control (S47: NO). The CPU 31 may determine whether it is speed control or position control by a method different from the above. For example, the NC program may include flag information indicating whether it is speed control or position control. The CPU 31 may determine whether to control the speed or the position based on the flag information. The NC program may not include a start instruction and an end instruction. The CPU 31 is not limited to the flag stored as the first flag information, and may always determine whether or not an abnormality has occurred in the tool 4.

<その他>
工作機械1は本発明の「機械装置」の一例である。S47の処理を行うCPU31は本発明の「第一判定手段」の一例である。S71の処理を行うCPU31は本発明の「算出手段」の一例である。S75、S77、S79、S81の処理を行うCPU31は本発明の「第二判定手段」の一例である。S95の処理を行うCPU31は本発明の「第三判定手段」の一例である。S105の処理を行うCPU31は本発明の「速度記憶手段」の一例である。S101の処理を行うCPU31は本発明の「第四判定手段」の一例である。S99、S103の処理を行うCPU31は本発明の「第五判定手段」の一例である。S55の処理を行うCPU31は本発明の「検出手段」の一例である。S57、S61の処理を行うCPU31は、本発明の「第六判定手段」の一例である。主軸モータ52は、本発明の「第一モータ」の一例である。Z軸モータ51は本発明の「第二モータ」の一例である。第二フラグ情報を記憶するRAM33は、本発明の「第一記憶部」の一例である。S11の処理を行うCPU31は本発明の「第一記憶制御手段」の一例である。判定停止フラグは、本発明の「判定停止情報」の一例である。定中フラグは、本発明の「判定中情報」の一例である。S77、S99の処理を行うCPU31は本発明の「第二記憶制御手段」の一例である。S81、S103の処理を行うCPU31は本発明の「第三記憶制御手段」の一例である。記憶装置34は、本発明の「第二記憶部」の一例である。
<Others>
The machine tool 1 is an example of the "mechanical device" of the present invention. The CPU 31 that performs the processing of S47 is an example of the "first determination means" of the present invention. The CPU 31 that performs the processing of S71 is an example of the "calculation means" of the present invention. The CPU 31 that performs the processing of S75, S77, S79, and S81 is an example of the "second determination means" of the present invention. The CPU 31 that performs the processing of S95 is an example of the "third determination means" of the present invention. The CPU 31 that performs the processing of S105 is an example of the "speed storage means" of the present invention. The CPU 31 that performs the processing of S101 is an example of the "fourth determination means" of the present invention. The CPU 31 that performs the processes of S99 and S103 is an example of the "fifth determination means" of the present invention. The CPU 31 that performs the processing of S55 is an example of the "detection means" of the present invention. The CPU 31 that performs the processes of S57 and S61 is an example of the "sixth determination means" of the present invention. The spindle motor 52 is an example of the "first motor" of the present invention. The Z-axis motor 51 is an example of the "second motor" of the present invention. The RAM 33 that stores the second flag information is an example of the "first storage unit" of the present invention. The CPU 31 that performs the processing of S11 is an example of the "first storage control means" of the present invention. The determination stop flag is an example of the "determination stop information" of the present invention. The constant flag is an example of the "determining information" of the present invention. The CPU 31 that performs the processing of S77 and S99 is an example of the "second storage control means" of the present invention. The CPU 31 that performs the processing of S81 and S103 is an example of the "third storage control means" of the present invention. The storage device 34 is an example of the "second storage unit" of the present invention.

S47の処理は本発明の「第一判定工程」の一例である。S71の処理は本発明の「算出工程」の一例である。S75、S77、S79、S81の処理は本発明の「第二判定工程」の一例である。S95の処理は本発明の「第三判定工程」の一例である。S105の処理は本発明の「速度記憶工程」の一例である。S101の処理は本発明の「第四判定工程」の一例である。S99、S103の処理は本発明の「第五判定工程」の一例である。S55の処理は本発明の「検出工程」の一例である。S57、S61の処理は本発明の「第六判定工程」の一例である。 The treatment of S47 is an example of the "first determination step" of the present invention. The process of S71 is an example of the "calculation step" of the present invention. The processing of S75, S77, S79, and S81 is an example of the "second determination step" of the present invention. The treatment of S95 is an example of the "third determination step" of the present invention. The process of S105 is an example of the "speed storage step" of the present invention. The process of S101 is an example of the "fourth determination step" of the present invention. The processing of S99 and S103 is an example of the "fifth determination step" of the present invention. The treatment of S55 is an example of the "detection step" of the present invention. The processing of S57 and S61 is an example of the "sixth determination step" of the present invention.

1 :工作機械
4 :工具
30 :数値制御装置
31 :CPU
34 :記憶装置
51 :Z軸モータ
51A :駆動回路
51B :エンコーダ
51C、52C :電流検出器
52 :主軸モータ
52A :駆動回路
52B :エンコーダ
p、q :位置指令
v :速度指令
1: Machine tool 4: Tool 30: Numerical control device 31: CPU
34: Storage device 51: Z-axis motor 51A: Drive circuit 51B: Encoder 51C, 52C: Current detector 52: Spindle motor 52A: Drive circuit 52B: Encoder p, q: Position command v: Speed command

Claims (7)

被削材を加工する工具と前記被削材とを相対的に回転及び移動させる為のモータ及び駆動回路を備えた機械装置に対して、NCプログラムに含まれる速度命令に基づく速度指令を前記駆動回路に周期的に出力する速度制御、及び、位置命令に基づく位置指令を前記駆動回路に周期的に出力する位置制御を実行可能な数値制御装置において、
前記NCプログラムの命令が前記速度制御か前記位置制御かを判定する第一判定手段と、
前記第一判定手段により前記位置制御と判定した時、前記位置命令に基づく前記位置指令を二階微分して加速度情報を算出する算出手段と、
前記算出手段により算出した前記加速度情報の絶対値が所定閾値よりも大きい時、前記モータが加減速中であると判定し、前記加速度情報の絶対値が前記所定閾値以下の時、前記モータが定速中であると判定する第二判定手段と、
前記第一判定手段により前記速度制御と判定した時、前記速度命令に基づく前記速度指令と、前記モータの回転速度を計測した計測情報とが同一か否か判定する第三判定手段と、
前記第一判定手段により前記速度制御と判定した時、前記速度指令を記憶指令として記憶する速度記憶手段と、
前記速度記憶手段によって前回記憶した前記記憶指令と、前記速度指令が同一か否か判定する第四判定手段と、
前記第三判定手段により、前記速度指令と前記計測情報とが同一であると判定してから、前記第四判定手段により、前記記憶指令と前記速度指令が同一でないと判定するまでの間、前記モータが定速中であると判定し、前記第四判定手段により、前記記憶指令と前記速度指令が同一でないと判定してから、前記第三判定手段により、前記速度指令と前記計測情報とが同一であると判定するまでの間、前記モータが加減速中であると判定する第五判定手段と、
前記モータに流れる電流を検出する検出手段と、
前記第二判定手段又は前記第五判定手段により、前記モータが定速中であると判定した時、前記検出手段により検出した前記電流に基づいて前記工具の異常発生の有無を判定する第六判定手段と、
を備え、
前記第六判定手段は、
前記第二判定手段又は前記第五判定手段により、前記モータが加減速中であると判定した時、前記異常発生の有無を判定しないことを特徴とする数値制御装置。
The speed command based on the speed command included in the NC program is driven to the mechanical device provided with the motor and the drive circuit for relatively rotating and moving the tool for processing the work material and the work material. In a numerical control device capable of performing speed control that periodically outputs to a circuit and position control that periodically outputs a position command based on a position command to the drive circuit.
The first determination means for determining whether the instruction of the NC program is the speed control or the position control,
When the position control is determined by the first determination means, the calculation means for calculating the acceleration information by second-order differentializing the position command based on the position command, and
When the absolute value of the acceleration information calculated by the calculation means is larger than the predetermined threshold value, it is determined that the motor is accelerating or decelerating, and when the absolute value of the acceleration information is equal to or less than the predetermined threshold value, the motor is determined. The second judgment means for determining that the vehicle is in speed,
When the speed control is determined by the first determination means, the third determination means for determining whether or not the speed command based on the speed command and the measurement information measured by the rotational speed of the motor are the same.
When the speed control is determined by the first determination means, the speed storage means for storing the speed command as a storage command and the speed storage means.
A fourth determination means for determining whether or not the storage command previously stored by the speed storage means and the speed command are the same.
From the time when the third determination means determines that the speed command and the measurement information are the same until the fourth determination means determines that the storage command and the speed command are not the same, the said After determining that the motor is in constant speed and determining that the storage command and the speed command are not the same by the fourth determination means, the speed command and the measurement information are transmitted by the third determination means. Until it is determined that they are the same, the fifth determination means for determining that the motor is accelerating or decelerating, and
A detection means for detecting the current flowing through the motor and
When the second determination means or the fifth determination means determines that the motor is in constant speed, the sixth determination is to determine whether or not an abnormality has occurred in the tool based on the current detected by the detection means. Means and
Equipped with
The sixth determination means is
A numerical control device, characterized in that, when it is determined by the second determination means or the fifth determination means that the motor is accelerating or decelerating, the presence or absence of the occurrence of the abnormality is not determined.
前記機械装置は、
前記被削材に対して前記工具を相対的に回転させる為の第一モータ、及び、前記被削材に対して前記工具を相対的に移動させる為の第二モータを備え、
前記位置制御を行う時、前記第一モータは、前記第二モータに同期して回転し、
前記第一判定手段により前記位置制御と判定した時、
前記算出手段は、前記第二モータに対する前記位置指令を二階微分して前記加速度情報を算出し、
前記第二判定手段は、前記加速度情報と前記所定閾値との関係に基づいて、前記第一モータが加減速中か又は定速中か判定し、
前記第六判定手段は、前記第一モータの前記電流に基づき、前記工具の異常発生の有無を判定することを特徴とする請求項1に記載の数値制御装置。
The mechanical device is
A first motor for rotating the tool relative to the work material and a second motor for moving the tool relative to the work material are provided.
When performing the position control, the first motor rotates in synchronization with the second motor, and the first motor rotates in synchronization with the second motor.
When the position control is determined by the first determination means,
The calculation means second-orders the position command for the second motor to calculate the acceleration information.
The second determination means determines whether the first motor is in acceleration / deceleration or constant speed based on the relationship between the acceleration information and the predetermined threshold value.
The numerical control device according to claim 1, wherein the sixth determination means determines whether or not an abnormality has occurred in the tool based on the current of the first motor.
前記機械装置は、
前記被削材に対して前記工具を相対的に回転させる為の第一モータ、及び、前記被削材に対して前記工具を相対的に移動させる為の第二モータを備え、
前記位置制御を行う時、前記第二モータは、前記第一モータに同期して回転し、
前記算出手段は、前記第一モータに対する前記位置指令を二階微分して前記加速度情報を算出し、
前記第二判定手段は、前記加速度情報と前記所定閾値との関係に基づいて、前記第二モータが加減速中か又は定速中か判定し、
前記第六判定手段は、前記第二モータの前記電流に基づき、前記工具の前記異常発生の有無を判定することを特徴とする請求項1に記載の数値制御装置。
The mechanical device is
A first motor for rotating the tool relative to the work material and a second motor for moving the tool relative to the work material are provided.
When performing the position control, the second motor rotates in synchronization with the first motor, and the second motor rotates in synchronization with the first motor.
The calculation means second-orders the position command with respect to the first motor to calculate the acceleration information.
The second determination means determines whether the second motor is in acceleration / deceleration or constant speed based on the relationship between the acceleration information and the predetermined threshold value.
The numerical control device according to claim 1, wherein the sixth determination means determines whether or not the abnormality has occurred in the tool based on the current of the second motor.
前記異常発生の有無を判定するか否かを示す情報を記憶する第一記憶部と、
前記第六判定手段による最初の判定の前に、前記異常発生の有無を判定しないことを示す判定停止情報を前記第一記憶部に記憶する第一記憶制御手段と、
前記第一記憶部に前記判定停止情報を記憶した状態で、前記第二判定手段又は前記第五判定手段により、前記モータが定速中と判定した時、前記異常発生の有無を判定することを示す判定中情報を前記第一記憶部に記憶する第二記憶制御手段と、
前記第一記憶部に前記判定中情報を記憶した状態で、前記第二判定手段又は前記第五判定手段により、前記モータが加減速中と判定した時、前記判定停止情報を前記第一記憶部に記憶する第三記憶制御手段と
を備え、
前記第六判定手段は、
前記第一記憶部が前記判定中情報を記憶している時、前記異常発生の有無を判定し、前記第一記憶部が前記判定停止情報を記憶している時、前記異常発生の有無を判定しないことを特徴とする請求項1から3の何れかに記載の数値制御装置。
A first storage unit that stores information indicating whether or not to determine whether or not an abnormality has occurred, and
Prior to the first determination by the sixth determination means, the first storage control means for storing the determination stop information indicating that the presence or absence of the abnormality has not been determined is stored in the first storage unit.
With the determination stop information stored in the first storage unit, when the second determination means or the fifth determination means determines that the motor is in constant speed, it is determined whether or not the abnormality has occurred. A second storage control means for storing the determined information to be shown in the first storage unit,
When the motor is determined to be accelerating or decelerating by the second determination means or the fifth determination means in a state where the determination information is stored in the first storage unit, the determination stop information is stored in the first storage unit. Equipped with a third memory control means to store in
The sixth determination means is
When the first storage unit stores the determination information, it is determined whether or not the abnormality has occurred, and when the first storage unit stores the determination stop information, it is determined whether or not the abnormality has occurred. The numerical control device according to any one of claims 1 to 3, wherein the numerical control device is not provided.
前記NCプログラムは、前記異常発生の有無の判定を開始することを示す開始命令、及び、前記異常発生の有無の判定を終了することを示す終了命令を有し、
前記第六判定手段は、
前記開始命令を読み出してから、次に前記終了命令を読み出すまでの間、前記工具の前記異常発生の有無を判定し、
前記終了命令を読み出してから、次に前記開始命令を読み出すまでの間、前記工具の前記異常発生の有無を判定しないことを特徴とする請求項1から4の何れかに記載の数値制御装置。
The NC program has a start command indicating to start the determination of the presence / absence of the abnormality and an end command indicating to end the determination of the presence / absence of the abnormality.
The sixth determination means is
From the time when the start command is read until the next time when the end command is read, it is determined whether or not the abnormality has occurred in the tool.
The numerical control device according to any one of claims 1 to 4, wherein the presence or absence of the abnormality occurrence of the tool is not determined between the time when the end command is read and the time when the start command is read next.
NCプログラムに含まれ、被削材を加工する工具と前記被削材とを相対的に回転及び移動させる為のモータ及び駆動回路を備えた機械装置に対して、速度命令に基づく速度指令を前記駆動回路に周期的に出力する速度制御か、位置命令に基づく位置指令を前記駆動回路に周期的に出力する位置制御かを判定する第一判定工程と、
前記第一判定工程により前記位置制御と判定した時、前記位置命令に基づく前記位置指令を二階微分して加速度情報を算出する算出工程と、
前記算出工程により算出した前記加速度情報の絶対値が所定閾値よりも大きい時、前記モータが加減速中であると判定し、前記加速度情報の絶対値が前記所定閾値以下の時、前記モータが定速中であると判定する第二判定工程と、
前記第一判定工程により前記速度制御と判定した時、前記速度命令に基づく前記速度指令と、前記モータの回転速度を計測した計測情報とが同一か否か判定する第三判定工程と、
前記第一判定工程により前記速度制御と判定した時、前記速度指令を記憶指令として記憶する速度記憶工程と、
前記速度記憶工程によって前回記憶した前記記憶指令と、前記速度指令が同一か否か判定する第四判定工程と、
前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定してから、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定するまでの間、前記モータが定速中であると判定し、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定してから、前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定するまでの間、前記モータが加減速中であると判定する第五判定工程と、
前記モータに流れる電流を検出する検出工程と、
前記第二判定工程又は前記第五判定工程により、前記モータが定速中であると判定した時、前記検出工程により検出した前記電流に基づいて前記工具の異常発生の有無を判定する第六判定工程と、
を備え、
前記第六判定工程は、
前記第二判定工程又は前記第五判定工程により、前記モータが加減速中であると判定した時、前記異常発生の有無を判定しないことを特徴とする数値制御方法。
The speed command based on the speed command is given to the mechanical device included in the NC program and equipped with a motor and a drive circuit for relatively rotating and moving the tool for machining the work material and the work material. The first determination step of determining whether the speed control is periodically output to the drive circuit or the position command is periodically output to the drive circuit based on the position command.
When the position control is determined by the first determination step, the calculation step of calculating the acceleration information by second-order differentiating the position command based on the position command, and
When the absolute value of the acceleration information calculated by the calculation step is larger than the predetermined threshold value, it is determined that the motor is accelerating or decelerating, and when the absolute value of the acceleration information is equal to or less than the predetermined threshold value, the motor is determined. The second judgment process to determine that the speed is high, and
When the speed control is determined by the first determination step, the third determination step of determining whether or not the speed command based on the speed command and the measurement information measured by the rotational speed of the motor are the same.
When the speed control is determined by the first determination step, the speed storage step of storing the speed command as a storage command and the speed storage step.
The fourth determination step of determining whether or not the storage command previously stored by the speed storage step and the speed command are the same,
From the determination that the speed command and the measurement information are the same by the third determination step to the determination that the storage command and the speed command are not the same by the fourth determination step, the said After determining that the motor is in constant speed and determining that the storage command and the speed command are not the same by the fourth determination step, the speed command and the measurement information are sent by the third determination step. Until it is determined that they are the same, the fifth determination step of determining that the motor is accelerating or decelerating, and
A detection process for detecting the current flowing through the motor, and
When it is determined by the second determination step or the fifth determination step that the motor is in constant speed, the sixth determination is to determine whether or not an abnormality has occurred in the tool based on the current detected by the detection step. Process and
Equipped with
The sixth determination step is
A numerical control method characterized in that when it is determined by the second determination step or the fifth determination step that the motor is accelerating or decelerating, the presence or absence of the occurrence of the abnormality is not determined.
NCプログラムに含まれ、被削材を加工する工具と前記被削材とを相対的に回転及び移動させる為のモータ及び駆動回路を備えた機械装置に対して、速度命令に基づく速度指令を前記駆動回路に周期的に出力する速度制御か、位置命令に基づく位置指令を前記駆動回路に周期的に出力する位置制御かを判定する第一判定工程と、
前記第一判定工程により前記位置制御と判定した時、前記位置命令に基づく前記位置指令を二階微分して加速度情報を算出する算出工程と、
前記算出工程により算出した前記加速度情報の絶対値が所定閾値よりも大きい時、前記モータが加減速中であると判定し、前記加速度情報の絶対値が前記所定閾値以下の時、前記モータが定速中であると判定する第二判定工程と、
前記第一判定工程により前記速度制御と判定した時、前記速度命令に基づく前記速度指令と、前記モータの回転速度を計測した計測情報とが同一か否か判定する第三判定工程と、
前記第一判定工程により前記速度制御と判定した時、前記速度指令を記憶指令として記憶する速度記憶工程と、
前記速度記憶工程によって前回記憶した前記記憶指令と、前記速度指令が同一か否か判定する第四判定工程と、
前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定してから、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定するまでの間、前記モータが定速中であると判定し、前記第四判定工程により、前記記憶指令と前記速度指令が同一でないと判定してから、前記第三判定工程により、前記速度指令と前記計測情報とが同一であると判定するまでの間、前記モータが加減速中であると判定する第五判定工程と、
前記モータに流れる電流を検出する検出工程と、
前記第二判定工程又は前記第五判定工程により、前記モータが定速中であると判定した時、前記検出工程により検出した前記電流に基づいて前記工具の異常発生の有無を判定する第六判定工程と、
をコンピュータに実行させる為の数値制御プロプラムであって、
前記第六判定工程は、
前記第二判定工程又は前記第五判定工程により、前記モータが加減速中であると判定した時、前記異常発生の有無を判定しないことを特徴とする数値制御プログラム。
The speed command based on the speed command is given to the mechanical device included in the NC program and equipped with a motor and a drive circuit for relatively rotating and moving the tool for machining the work material and the work material. The first determination step of determining whether the speed control is periodically output to the drive circuit or the position command is periodically output to the drive circuit based on the position command.
When the position control is determined by the first determination step, the calculation step of calculating the acceleration information by second-order differentiating the position command based on the position command, and
When the absolute value of the acceleration information calculated by the calculation step is larger than the predetermined threshold value, it is determined that the motor is accelerating or decelerating, and when the absolute value of the acceleration information is equal to or less than the predetermined threshold value, the motor is determined. The second judgment process to determine that the speed is high, and
When the speed control is determined by the first determination step, the third determination step of determining whether or not the speed command based on the speed command and the measurement information measured by the rotational speed of the motor are the same.
When the speed control is determined by the first determination step, the speed storage step of storing the speed command as a storage command and the speed storage step.
The fourth determination step of determining whether or not the storage command previously stored by the speed storage step and the speed command are the same,
From the determination that the speed command and the measurement information are the same by the third determination step to the determination that the storage command and the speed command are not the same by the fourth determination step, the said After determining that the motor is in constant speed and determining that the storage command and the speed command are not the same by the fourth determination step, the speed command and the measurement information are sent by the third determination step. Until it is determined that they are the same, the fifth determination step of determining that the motor is accelerating or decelerating, and
A detection process for detecting the current flowing through the motor, and
When it is determined by the second determination step or the fifth determination step that the motor is in constant speed, the sixth determination is to determine whether or not an abnormality has occurred in the tool based on the current detected by the detection step. Process and
Is a numerical control program for letting a computer execute
The sixth determination step is
A numerical control program characterized in that when it is determined by the second determination step or the fifth determination step that the motor is accelerating or decelerating, the presence or absence of the occurrence of the abnormality is not determined.
JP2018136400A 2018-07-20 2018-07-20 Numerical control device, numerical control method, and numerical control program Active JP7035875B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2018136400A JP7035875B2 (en) 2018-07-20 2018-07-20 Numerical control device, numerical control method, and numerical control program
CN201910649297.7A CN110737241B (en) 2018-07-20 2019-07-18 Numerical control device, numerical control method, and storage device storing numerical control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018136400A JP7035875B2 (en) 2018-07-20 2018-07-20 Numerical control device, numerical control method, and numerical control program

Publications (2)

Publication Number Publication Date
JP2020013433A JP2020013433A (en) 2020-01-23
JP7035875B2 true JP7035875B2 (en) 2022-03-15

Family

ID=69170123

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018136400A Active JP7035875B2 (en) 2018-07-20 2018-07-20 Numerical control device, numerical control method, and numerical control program

Country Status (2)

Country Link
JP (1) JP7035875B2 (en)
CN (1) CN110737241B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7218702B2 (en) * 2019-09-30 2023-02-07 ブラザー工業株式会社 Machine tools, measuring methods and computer programs
JP7276193B2 (en) * 2020-02-21 2023-05-18 ブラザー工業株式会社 Numerical controller and control method of the numerical controller
CN113155435B (en) * 2021-04-30 2024-06-25 深圳素士科技股份有限公司 Ceramic blade detection method, shaver detection device and shaver

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001125611A (en) 1999-10-29 2001-05-11 Toyoda Mach Works Ltd Numerical controller
JP2001287118A (en) 2000-01-31 2001-10-16 Yoshiaki Kakino Tapping device
US20060089742A1 (en) 2004-10-25 2006-04-27 Ford Motor Company System and method for monitoring machine health
JP5531541B2 (en) 2009-10-05 2014-06-25 大日本印刷株式会社 Log information generator

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5531541A (en) * 1978-08-23 1980-03-05 Toshiba Mach Co Ltd Abnormality detecting system for cutting tool
JPS62287958A (en) * 1986-06-06 1987-12-14 Okuma Mach Works Ltd Supervisory device for load in machine tool
JP3644129B2 (en) * 1996-05-20 2005-04-27 ブラザー工業株式会社 Cutting apparatus and abnormality detection method thereof
JP2013022681A (en) * 2011-07-21 2013-02-04 Hitachi Koki Co Ltd Electric tool
JP6178591B2 (en) * 2013-03-06 2017-08-09 富士機械製造株式会社 Tool abnormality discrimination system
JP5727572B2 (en) * 2013-10-10 2015-06-03 ファナック株式会社 Machine tool control apparatus and control method for changing operation according to motor temperature
JP6898079B2 (en) * 2016-11-16 2021-07-07 芝浦機械株式会社 Machine tools and their control methods

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001125611A (en) 1999-10-29 2001-05-11 Toyoda Mach Works Ltd Numerical controller
JP2001287118A (en) 2000-01-31 2001-10-16 Yoshiaki Kakino Tapping device
US20060089742A1 (en) 2004-10-25 2006-04-27 Ford Motor Company System and method for monitoring machine health
JP5531541B2 (en) 2009-10-05 2014-06-25 大日本印刷株式会社 Log information generator

Also Published As

Publication number Publication date
CN110737241B (en) 2022-08-16
JP2020013433A (en) 2020-01-23
CN110737241A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
JP6439542B2 (en) Numerical control device and control method
JP4261470B2 (en) Control device
JP7035875B2 (en) Numerical control device, numerical control method, and numerical control program
US9939798B2 (en) Numerical controller having cutting in/out motion inserting function or circular motion inserting function
US9869989B2 (en) Numerical controller
JP4995976B1 (en) Numerical control device that performs in-position check of rotating shaft
JP2000317710A (en) Tool abnormality detection tethod and device for machine tool
JP5949537B2 (en) Numerical controller
JP4639058B2 (en) Threading machine
JP5908552B1 (en) Machine tool controller
JP2007172068A (en) Numerical control device
JPH01146642A (en) Stop control device for cutting tool
JP2012056030A (en) Machine tool
JP6464135B2 (en) Numerical controller
JP7131454B2 (en) Numerical controllers, machine tools, control programs, and storage media
US10996655B2 (en) Numerical controller
US20190107820A1 (en) Controller
US20180364681A1 (en) Numerical controller
JPH0751992A (en) Drilling work method
WO2023058085A1 (en) Numerical control device
CN111716148B (en) Numerical controller and control method for numerical controller
WO2023162001A1 (en) Machining surface estimation device and computer-readable storage medium
JP4434209B2 (en) Numerical control device and control method thereof
JP2008158726A (en) Machining control device and program thereof
CN112241148A (en) Control device and control system for machine tool

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211208

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220201

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220214

R150 Certificate of patent or registration of utility model

Ref document number: 7035875

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150