Numerical control device, control program, and storage medium

JP7635612B2Active Publication Date: 2025-02-26BROTHER KOGYO KK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2021061818
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-03-31
Publication Date
2025-02-26
Estimated Expiration
2041-03-31

Smart Images

  • Figure 0007635612000001
    Figure 0007635612000001
  • Figure 0007635612000002
    Figure 0007635612000002
  • Figure 0007635612000003
    Figure 0007635612000003
Patent Text Reader

Abstract

To provide a numerical control device, a control program and a storage medium having stored therein the control program which can highly precisely determine a minimal change in the attached state of a tool to a main shaft.SOLUTION: A numerical control device obtains a torque of a motor that is a drive source for an attachment mechanism of a tool to a main shaft (S19). The numerical control device interpolates the obtained torque to generate interpolation torque (S25). The numerical control device performs differential operation on the interpolation torque (S29), and determines, as peak information, displacement information associated with the maximum or minimum value within the differential values (S35). The numerical control device performs statistical process on the basis of the peak information. The numerical control device determines the attached state of the tool to the main shaft on the basis of statistical values.SELECTED DRAWING: Figure 9
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a numerical control device, a control program, and a storage medium. [Background technology]

[0002] A numerical control device capable of determining whether or not a tool is attached to a spindle of a machine tool is known. Patent Document 1 discloses a numerical control device capable of determining whether or not a tool is attached to a spindle of a turret-type machine tool. The machine tool includes a spindle, a spindle head, a Z-axis motor, a drawbar, and an unclamping operation unit. The spindle is rotatably mounted on the spindle head. The Z-axis motor moves the spindle head in an up-down direction. When the Z-axis motor moves the spindle head downward, the drawbar clamps the tool holder to the spindle by the biasing force of the clamp spring. When the Z-axis motor moves the spindle head upward, the drawbar releases the clamped state of the tool holder against the biasing force of the clamp spring. The drive current value of the Z-axis motor varies depending on the attachment state of the tool holder to the spindle. Therefore, the numerical control device judges the attachment state of the tool holder to the spindle by comparing the drive current value of the Z-axis motor with a judgment reference value. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Patent Publication No. 2009-178795 Summary of the Invention [Problem to be solved by the invention]

[0004] With the above method, there are times when slight changes in the mounting state of the tool relative to the spindle cannot be determined with high accuracy.

[0005] An object of the present invention is to provide a numerical control device, a control program, and a storage medium storing the control program, which are capable of determining with high accuracy even slight changes in the mounting state of a tool relative to a spindle. [Means for solving the problem]

[0006] A numerical control device according to a first aspect of the present invention is a numerical control device that controls a machine tool that machines a workpiece by relatively moving a tool attached to a spindle and a workpiece fixed to a worktable, and is characterized in that it comprises an acquisition unit that acquires the torque of a motor that is a drive source of a mounting mechanism for the tool relative to the spindle at a predetermined time during the mounting operation of the tool, an interpolation unit that interpolates the torque acquired by the acquisition unit to generate an interpolated torque, a differential calculation unit that performs a differential calculation of the interpolated torque interpolated by the interpolation unit, a determination unit that determines, as peak information, displacement information indicating a position or angle of the mounting mechanism corresponding to the maximum or minimum value of the differential values ​​calculated by the differential calculation unit, a memory unit that stores the peak information determined by the determination unit in correspondence with the number of times or duration of use of the tool relative to the spindle, a statistical processing unit that performs statistical processing based on the peak information stored in the memory unit, and a determination unit that determines the mounting state of the tool relative to the spindle based on the statistical values ​​statistically processed by the statistical processing unit.

[0007] The numerical control device determines the attachment state of the tool based on the interpolated torque obtained by interpolating the torque, and can therefore determine even slight changes in the attachment state of the tool with high accuracy.

[0008] In the first aspect, the interpolation unit may generate the interpolated torque by interpolating the torque using a linear approximation. In this case, the numerical control device can generate the interpolated torque using a simple method, so that an increase in processing load can be suppressed.

[0009] In the first aspect, the interpolation unit may generate the interpolated torque by interpolating the torque using curve approximation. Since the numerical control device can generate the interpolated torque that is a good approximation to the actual torque, it can determine even a slight change in the mounting state of the tool with higher accuracy.

[0010] In a first aspect, the numerical control device may include a first filter processing unit that applies a low-pass filter to the interpolation torque obtained by the interpolation unit, and the differentiation unit may differentiate the interpolation torque obtained by the first filter processing unit that applies the low-pass filter to the interpolation torque. The numerical control device can remove noise components of the interpolation torque and can determine accurate peak information by smoothing the interpolation torque.

[0011] In the first aspect, the numerical control device may further include a second filter processing unit that applies a low-pass filter to the torque acquired by the acquisition unit, and the interpolation unit may generate the interpolated torque by interpolating the torque to which the second filter processing unit has applied the low-pass filter. By generating the interpolated torque from the torque from which noise components have been removed, the numerical control device can generate an interpolated torque that is well approximating the actual torque.

[0012] In the first aspect, the statistical value may be calculated by counting from a predetermined number of pieces of target peak information, starting from second peak information, which is the latest piece of target peak information, among the pieces of target peak information excluding first peak information, which is the latest piece of peak information, and peak information at the time of occurrence of an abnormality, from the pieces of peak information stored in the memory unit as the statistical value, and the judgment unit may judge the mounting state based on the average value calculated by the statistical processing unit. Judgment based on the average value of peak information is less susceptible to the influence of aging of the tool compared to judgment based on the drive current value of the motor. Therefore, the numerical control device can judge the mounting state with even greater accuracy.

[0013] In a first aspect, the determination unit may determine the mounting state based on the first peak information and a threshold value determined based on the average value calculated by the statistical processing unit. The peak information varies greatly with respect to the average value depending on the mounting state of the tool. The numerical control device can determine the mounting state of the tool with high accuracy by determining the mounting state of the tool using the threshold value determined based on the average value.

[0014] In a first aspect, the statistical processing unit may further calculate the predetermined number of standard deviations counting from the second peak information among the target peak information, and the judgment unit may judge the mounting state based on the first peak information and the threshold determined based on the average value and the standard deviation. At this time, the numerical control device can determine the threshold taking into consideration the degree of fluctuation of the peak information. Therefore, the numerical control device can judge the mounting state of the tool with high accuracy.

[0015] In a first aspect, the mounting mechanism includes a spindle head that is reciprocable in a predetermined direction by being driven by the motor and rotatably supports the spindle, the motor mounts the tool on the spindle by moving the spindle head in the predetermined direction, and the displacement information may be a position of the spindle head in the predetermined direction. The numerical control device can accurately determine the mounting state of a tool for a so-called turret-type machine tool.

[0016] In a first aspect, the mounting mechanism includes a rotating shaft that is rotated by the drive of the motor, and an arm that rotates in synchronization with the rotation of the rotating shaft and is capable of supporting the tool to be mounted on the spindle, the motor mounts the tool that rotates together with the arm to the spindle by rotating the rotating shaft, and the displacement information may be a rotation angle of the rotating shaft. The numerical control device can accurately determine the mounting state of a tool for a so-called arm-type machine tool.

[0017] A control program according to a second aspect of the present invention causes a computer that controls a machine tool that moves a tool attached to a spindle and a workpiece fixed to a worktable relatively to machine the workpiece to execute the following steps: acquiring torque of a motor that is a drive source of a mechanism for attaching the tool to the spindle at a predetermined time during the attachment operation of the tool, interpolating the torque acquired in the acquiring step to generate an interpolated torque, differentiating the interpolated torque interpolated in the interpolating step, determining, as peak information, displacement information indicating a position or angle of the attachment mechanism corresponding to a maximum or minimum value among the differential values ​​calculated in the differentiating step, storing the peak information determined in the determining step in association with the number of times or duration of use of the tool with respect to the spindle, performing statistical processing based on the peak information stored in the storing step, and determining a mounting state of the tool with respect to the spindle based on the statistical value statistically processed in the statistical processing step. According to the second aspect, the same effects as those of the first aspect can be achieved.

[0018] A storage medium according to a third aspect of the present invention stores a numerical control program for causing a computer that controls a machine tool that moves a tool attached to a spindle and a workpiece fixed to a worktable relative to each other to machine the workpiece to execute the following operations: an acquisition step of acquiring torque of a motor that is a drive source of a mechanism for attaching the tool to the spindle at a predetermined time during the attachment operation of the tool, an interpolation step of generating an interpolated torque by interpolating the torque acquired in the acquisition step, a differentiation step of differentiating the interpolated torque interpolated in the interpolation step, a determination step of determining, as peak information, displacement information indicating a position or angle of the attachment mechanism corresponding to a maximum or minimum value among the differential values ​​calculated in the differentiation step, a storage step of storing the peak information determined in the determination step in association with the number of times or duration of use of the tool with respect to the spindle, a statistical processing step of performing statistical processing based on the peak information stored in the storage step, and a determination step of determining the attachment state of the tool with respect to the spindle based on the statistical value statistically processed in the statistical processing step. According to the third aspect, the same effects as those of the first aspect can be achieved. [Brief description of the drawings]

[0019] [Figure 1] FIG. [Diagram 2] FIG. [Diagram 3] A vertical cross-sectional view of the inside of spindle 9A. [Figure 4] FIG. 2 is a block diagram showing the electrical configuration of a machine tool 1A and a numerical control device 30A. [Diagram 5] 11 is a graph showing the torque and differential value of the Z-axis motor 51A. [Figure 6] Graphs showing peak positions in the perfectly attached state (A) and the imperfectly attached states (B) and (C) before linear approximation. [Figure 7] FIG. [Figure 8] Graphs showing peak positions in a perfectly attached state (A) and in imperfectly attached states (B) and (C) after linear approximation. [Figure 9] 1 is a flow diagram of the main process. [Figure 10] Flow chart of the main process continued from FIG. [Figure 11] FIG. [Figure 12] FIG. [Figure 13] FIG. [Figure 14] 13 is a cross-sectional view taken along line II in FIG. 12. [Figure 15] FIG. 12 is a partially enlarged view of a region W shown in FIG. [Figure 16] 4 is a cross-sectional view of the periphery of the rotating shaft 43B and the ATC drive shaft 46B in the main body 401B. FIG. [Figure 17] FIG. 4 is a block diagram showing the electrical configuration of a numerical control device 50B and a machine tool 1B. [Figure 18] FIG. [Figure 19] Timing diagram of tool change operation. [Figure 20] FIG. [Figure 21] 1 is a flow diagram of the main process. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0020] First Embodiment A first embodiment of the present invention will be described. In the following description, the left / right, front / back, and up / down directions shown by arrows in the drawings will be used. The left / right, front / back, and up / down directions of machine tool 1A shown in FIG. 1 are the X-axis, Y-axis, and Z-axis directions, respectively. Machine tool 1A is a machine that rotates tool 4A of tool body 40A (see FIG. 2) attached to spindle 9A, and performs cutting on a workpiece held on the upper surface of table 13A. Numerical control device 30A controls the operation of machine tool 1A.

[0021] <Overview of Machine Tool 1A> 1 and 2, the machine tool 1A includes a base 2A, a column 5A, a spindle head 7A, a spindle 9A, a table device 10A, a tool changer 20A, a control box 6A, and an operation panel 15A (see FIG. 4). The base 2A is a metal base having a substantially rectangular parallelepiped shape. The column 5A is fixed to the upper rear of the base 2A.

[0022] The spindle head 7A is raised and lowered in the Z-axis direction by a Z-axis movement mechanism (not shown) provided on the front surface of the column 5A. The Z-axis movement mechanism is equipped with a Z-axis motor 51A (see FIG. 4) and the like. The Z-axis movement mechanism moves the spindle head 7A in the Z-axis direction in response to the drive of the Z-axis motor 51A. The spindle head 7A is equipped with a spindle motor 52A at its upper part. The spindle 9A is rotatably provided inside the spindle head 7A. The spindle 9A has a mounting hole 92A at its lower end (tip). A tool holder 17A is attached to the mounting hole 92A of the spindle 9A, and the spindle 9A rotates in response to the drive of the spindle motor 52A. The tool holder 17A holds the tool 4A. The tool 4A and the tool holder 17A constitute a tool body 40A.

[0023] The table device 10A includes a table 13A, a Y-axis motor 54A (see FIG. 4), an X-axis motor 53A (see FIG. 4), etc. The table 13A can be moved in the X-axis and Y-axis directions on the base 2A by the X-axis motor 53A and the Y-axis motor 54A.

[0024] The tool changer 20A is provided in front of the spindle head 7A and is equipped with a tool magazine 21A. The tool magazine 21A is equipped with a plurality of grip arms 90A arranged in a circle around its periphery. The grip arms 90A grip the tool holder 17A. The tool changer 20A rotates the tool magazine 21A in response to the drive of a magazine motor 55A (see FIG. 4).

[0025] The control box 6A is fixed to the rear side of the column 5A and houses the numerical control device 30A (see FIG. 4). The numerical control device 30A controls the Z-axis motor 51A, the spindle motor 52A, the X-axis motor 53A, and the Y-axis motor 54A, and performs various processes on the workpiece by moving the workpiece held on the table 13A and the tool 4A attached to the spindle 9A relative to each other. The various processes include drilling using a drill, tap, etc., side surface processing using an end mill, milling cutter, etc.

[0026] The operation panel 15A is provided on the outer wall of a cover (not shown) that covers the machine tool 1A. The operation panel 15A is equipped with an input unit 24A (see FIG. 4) and a display unit 25A (see FIG. 4). The input unit 24A receives input of various information, operation instructions, etc., and outputs the input information to the numerical control device 30A. The display unit 25A displays various screens, abnormality information, etc. based on commands from the numerical control device 30A.

[0027] <Internal structure of spindle head 7A and spindle 9A> As shown in Figs. 2 and 3, the spindle head 7A rotatably supports the spindle 9A on the inside of the lower front part. The spindle 9A has a vertical axis of rotation. The spindle 9A is connected to the drive shaft of the spindle motor 52A and rotates when driven by the spindle motor 52A. As shown in Fig. 3, the spindle 9A has a shaft hole 91A, a mounting hole 92A, a space 93A, a lower slide hole 94A, a clamp shaft 81A, and a spring 82A. The shaft hole 91A passes through the center of the spindle 9A. The mounting hole 92A is provided at the tip of the spindle 9A. The tool holder 17A is mounted in the mounting hole 92A. The tool holder 17A holds the tool 4A on one end side and has a tapered mounting portion 180A and a pull stud 181A on the other end side. The tapered mounting portion 180A is conical. The pull stud 181A has a cylindrical portion 182A and a top portion 183A. The cylindrical portion 182A is cylindrical and extends upward from the upper end of the tapered mounting portion 180A. The apex portion 183A is provided at the upper end of the cylindrical portion 182A and has a larger radial size than the cylindrical portion 182A. The tapered mounting portion 180A is attached in close contact with the mounting hole 92A of the spindle 9A. The space 93A is provided continuous with the upper part of the mounting hole 92A. The lower sliding hole 94A is provided continuous with the lower end of the shaft hole 91A and the space 93A.

[0028] The clamp shaft 81A is inserted into the shaft hole 91A and is arranged to be movable in the vertical direction. The clamp shaft 81A has a pin support portion 811A, a shaft portion 812A, and a holder grip portion 813A. The pin support portion 811A is cylindrical and is located at the upper end of the clamp shaft 81A, and supports a pin 58A, which will be described later. The shaft portion 812A is cylindrical and extends downward from the pin support portion 811A. The holder grip portion 813A is located at the lower end of the shaft portion 812A, and has a number of steel balls (not shown). The spring 82A is inserted into the shaft hole 91A, and the upper end of the spring 82A engages with the pin support portion 811A, constantly urging the clamp shaft 81A upward with the spring force. As the clamp shaft 81A moves downward against the elastic force of the spring 82A and the spring 82A contracts, the holder gripping portion 813A moves out of the lower sliding hole 94A and into the space 93A, releasing the fixation of the pull stud 181A of the tool holder 17A. When the clamp shaft 81A moves upward from its downward position due to the elastic force of the spring 82A, the holder gripping portion 813A moves from the space 93A to the lower sliding hole 94A, and holds and fixes the top portion 183A of the pull stud 181A. Therefore, with the tool holder 17A pulled upward by the spring 82A, the clamp shaft 81A fixes the tool body 40A to the spindle 9A.

[0029] As shown in FIG. 2, the spindle head 7A is provided with a lever 60A at the upper rear portion. The lever 60A is substantially L-shaped and swings around a support shaft 61A. The support shaft 61A is fixed inside the spindle head 7A. The lever 60A is provided with a vertical lever 63A and a horizontal lever 62A. The vertical lever 63A extends obliquely upward from the support shaft 61A toward the column 5A side, bends upward at the middle portion 65A, and extends further upward. The horizontal lever 62A extends substantially horizontally from the support shaft 61A toward the front of the column 5A. The tip portion of the horizontal lever 62A can engage from above with a pin 58A protruding perpendicular to the clamp shaft 81A. The vertical lever 63A is provided with a plate cam body 66A on the back surface of the upper end portion. The plate cam body 66A has a cam surface on the column 5A side. The cam surface of the plate cam body 66A can come into contact with and be separated from the cam follower 67A fixed to the upper bearing portion 27A. The cam follower 67A slides on the cam surface of the plate cam body 66A. A tension coil spring (not shown) is provided between the vertical lever 63A and the spindle head 7A. When the lever 60A is viewed from the right side, the tension coil spring constantly urges the lever 60A clockwise. Therefore, the lever 60A constantly releases the downward pressure on the pin 58A by the horizontal lever 62A.

[0030] <Attachment, detachment and replacement of tool body 40A> As shown in FIG. 2, with the tapered mounting portion 180A of the tool holder 17A mounted in the mounting hole 92A, the spindle head 7A rises due to the rotation of the Z-axis motor 51A. The plate cam body 66A of the lever 60A comes into contact with and slides on the cam follower 67A. When the cam follower 67A slides along the cam shape of the plate cam body 66A, the lever 60A rotates counterclockwise around the support shaft 61A when viewed from the right side. The lateral lever 62A engages with the pin 58A from above and presses the clamp shaft 81A downward. The clamp shaft 81A urges the holder gripping portion 813A downward against the spring force of the spring 82A. The holder gripping portion 813A releases the fixation of the pull stud 181A of the tool holder 17A. The tool holder 17A is disengaged from the mounting hole 92A of the spindle 9A, and the tool body 40A is detached from the spindle 9A. The tool body 40A detached from the spindle 9A is referred to as the first tool body. Of the multiple grip arms 90A of the tool changer 20A, one grip arm 90A (hereinafter referred to as the first grip arm) at the tool changing position grips the first tool body detached from the spindle 9A. The tool changing position is the lowest position of the tool magazine 21A.

[0031] The tool changer 20A rotates the tool magazine 21A by the magazine motor 55A, and positions the tool body 40A (hereinafter referred to as the second tool body) including the tool 4A specified by the tool change command of the NC program at the tool change position. At that time, the tool magazine 21A rotates from a state in which the first tool body, which is the tool body 40A detached from the spindle 9A, is at the tool change position to a state in which the second tool body, which is the tool body 40A to be newly attached to the spindle 9A, is at the tool change position. The tool magazine 21A rotates with the second tool body being gripped by another grip arm 90A (hereinafter referred to as the second grip arm).

[0032] With the second tool body placed at the tool changing position, the spindle head 7A is lowered by the rotation of the Z-axis motor 51A. The tapered mounting portion 180A of the tool holder 17A of the second tool body is inserted into the mounting hole 92A. When the plate cam body 66A slides on the cam follower 67A, the lever 60A rotates clockwise around the support shaft 61A when viewed from the right side. Therefore, the lateral lever 62A leaves the pin 58A and releases the downward pressure of the clamp shaft 81A. The clamp shaft 81A releases the downward bias of the holder gripping portion 813A and moves upward by the spring force of the spring 82A. The holder gripping portion 813A pulls the pull stud 181A upward, fixing the pull stud 181A. The second tool body is detached from the second grip arm of the tool changer 20A. The attachment of the tapered attachment portion 180A of the tool holder 17A to the attachment hole 92A of the spindle 9A is completed, and the attachment of the second tool body to the spindle 9A is completed.

[0033] The operation of the clamp shaft 81A and the lever 60A when the tool body 40A is mounted on the spindle 9A is referred to as a mounting operation. The spindle head 7A, the lever 60A, etc., which are driven by the rotation of the Z-axis motor 51A during the mounting operation, are referred to as a mounting mechanism.

[0034] <Electrical configuration> The electrical configuration of the numerical control device 30A and the machine tool 1A will be described with reference to FIG. 4. The numerical control device 30A includes a CPU 31A, a ROM 32A, a RAM 33A, a storage device 34A, an input interface 351A, an output interface 352A, and the like. The CPU 31A controls the numerical control device 30A. The ROM 32A stores various programs. The RAM 33A stores various data during processing. The storage device 34A is a non-volatile memory, and stores NC programs and the like. The NC programs are composed of a plurality of blocks, and each block includes at least one command, such as a tool exchange command. The storage device 34A also stores the number of times (corresponding to the number of uses) that the tool body 40A has been mounted on the spindle 9A for each tool body 40A. When the CPU 31A mounts the tool body 40A on the spindle 9A, it adds 1 to the number of times that the tool body 40A is mounted. When the CPU 31A detaches the tool body 40A attached to the spindle 9A and replaces it with another tool body 40A, the number of attachments corresponding to the detached tool body 40A is set to 0.

[0035] The input unit 24A of the operation panel 15A is electrically connected to the input interface 351A. The display unit 25A of the operation panel 15A is electrically connected to the output interface 352A. The Z-axis motor 51A, the spindle motor 52A, the X-axis motor 53A, the Y-axis motor 54A, and the magazine motor 55A are electrically connected to the output interface 352A. The Z-axis motor 51A, the spindle motor 52A, the X-axis motor 53A, the Y-axis motor 54A, and the magazine motor 55A are servo motors that rotate in response to pulse signals output by the output interface 352A. The Z-axis motor 51A is provided with an encoder 511A. The spindle motor 52A is provided with an encoder 521A. The X-axis motor 53A is provided with an encoder 531A. The Y-axis motor 54A is provided with an encoder 541A. The magazine motor 55A is provided with an encoder 551A. The encoders 511A, 521A, 531A, 541A, and 551A detect the rotation angles of the spindle motor 52A, the X-axis motor 53A, the Y-axis motor 54A, and the magazine motor 55A, respectively. The encoders 511A, 521A, 531A, 541A, and 551A are electrically connected to the input interface 351A.

[0036] <How to determine wearing status> A state in which the tool body 40A is attached to the spindle 9A in such a manner that the workpiece can be machined by the tool 4A and cutting accuracy is not affected is referred to as a completely attached state. In contrast, when cutting processing is performed in a state in which the tool body 40A is incompletely attached to the spindle 9A (hereinafter referred to as an incompletely attached state), the cutting accuracy of the machine tool 1A may decrease. The incompletely attached state is a state in which the tool body 40A is attached with foreign matter adhering between the tapered attachment portion 180A and the attachment hole 92A. In the incompletely attached state, the position at which the holder gripping portion 813A pulls up and fixes the pull stud 181A during the attachment operation is lower than the position in the completely attached state. The completely attached state and the incompletely attached state are collectively referred to as the attached state.

[0037] When the spindle head 7A is moved in the Z-axis direction to perform the mounting operation, the torque of the Z-axis motor 51A changes over time depending on the mounting state because the timing at which the plate cam body 66A of the lever 60A comes into contact with or separates from the cam follower 67A during the movement of the spindle head 7A changes depending on the mounting state of the tool body 40A to the spindle 9A.

[0038] FIG. 5(A) is a graph showing the relationship between the position (horizontal axis) of the spindle head 7A in the Z-axis direction and the torque (vertical axis) of the Z-axis motor 51A during the mounting operation. In order to eliminate the influence of vibrations of the machine tool 1A, FIG. 5(A) has been processed using a low-pass filter capable of removing the inherent vibrations of the machine tool 1A. The reference 0 [mm] on the horizontal axis corresponds to the position of the spindle head 7A in the Z-axis direction when the tool mounting operation is completed. Specifically, the reference 0 is the machine origin, which is the uppermost position where machining is possible. The positive direction on the horizontal axis corresponds to the upward direction. During the mounting operation, the spindle head 7A moves downward, which is the reference 0, from the uppermost position where the tool magazine 21A can rotate.

[0039] FIG. 5(B) is a graph showing the relationship between the position of the spindle head 7A in the Z-axis direction (horizontal axis) during the mounting operation and the time derivative value (hereinafter referred to as the derivative value) (vertical axis) of the torque of the Z-axis motor 51A. In FIG. 5(B), the position of the spindle head 7A in the Z-axis direction when the derivative value during the mounting operation is minimum is referred to as the peak position. The peak position results from the position where the holder gripping portion 813A pulls up and fixes the pull stud 181A. The peak position changes depending on the mounting state. More specifically, when the mounting state is incompletely mounted, the peak position is higher than the peak position in the completely mounted state.

[0040] Therefore, the CPU 31A of the numerical control device 30A periodically acquires the torque of the Z-axis motor 51A in a time series during the mounting operation. The CPU 31A time-differentiates the acquired torque of the Z-axis motor 51A to calculate a differential value. The CPU 31A associates the differential value with the position in the Z-axis direction of the spindle head 7A, which is lowered by the drive of the Z-axis motor 51A, and stores it in the RAM 33A. The CPU 31A determines a peak position from the differential value stored in the RAM 33A. Every time the CPU 31A executes a mounting operation, the CPU 31A associates the determined peak position with the number of mounting times for each tool body 40A and sequentially stores it in the storage device 34A. Every time the CPU 31A stores a peak position in the storage device 34A, the CPU 31A statistically processes the peak position to calculate a statistical value. More specifically, the CPU 31A extracts a predetermined number of peak positions, counting from the most recent target peak position (hereinafter referred to as the second peak position), from among the peak positions stored in the storage device 34A, excluding the most recent peak position (hereinafter referred to as the first peak position) and the peak position when the incomplete attachment state occurred (hereinafter referred to as the target peak position), and calculates the average value μ and standard deviation σ as statistical values. If the first peak position, i.e., the peak position during the attachment operation, is greater than the sum of the average value μ and six times the standard deviation σ (μ+6σ, hereinafter referred to as the determination threshold), the CPU 31A determines that the attachment state after the attachment operation is an incomplete attachment state.

[0041] In the above determination method, the period during which the CPU 31A obtains the torque of the Z-axis motor 51A (referred to as the acquisition period) affects the accuracy of the determination of the wearing state. The shorter the acquisition period, the higher the determination accuracy, but the shorter the acquisition period, the greater the processing load on the CPU 31A.

[0042] FIG. 6 shows the frequency (number of times) of peak positions obtained from the differential value after applying a low-pass filter to the torque of the Z-axis motor 51A acquired at a 0.5 ms cycle, and the average value μ of the peak positions. FIG. 6(A) shows the result of a perfect mounting state, and the torque was acquired 50 times. FIG. 6(A) also shows the standard deviation σ and the judgment threshold μ+6σ. FIG. 6(B) shows the result of an incomplete mounting state in which one sheet of 85 μm paper is attached between the taper mounting portion 180A and the mounting hole 92A, and the torque was acquired 10 times. FIG. 6(C) shows the result of an incomplete mounting state in which two sheets of 85 μm paper are attached between the taper mounting portion 180A and the mounting hole 92A, and the torque was acquired 10 times.

[0043] In the result of the completely attached state shown in Fig. 6(A), the standard deviation σ becomes very small, and the judgment threshold value μ+6σ is approximately equal to the average value μ. At that time, even when the tool body 40A is attached to the spindle 9A and the completely attached state is reached, the peak position may become larger than the judgment threshold value μ+6σ, and it may be erroneously judged as an incompletely attached state.

[0044] In addition, in the results for the imperfectly attached state shown in Figure 6(B), the distribution of the peak positions is divided into two mountains. The reason for this distribution is suggested to be that the obtained peak positions are scattered due to the relationship between the 0.5 ms period and the moving speed of the Z-axis motor 51A. It is not possible to correctly calculate the standard deviation from data that is far from a normal distribution.

[0045] In contrast, in the first embodiment, the CPU 31A generates an interpolated torque by interpolating the torque using linear approximation. A method for generating an interpolated torque will be specifically described with reference to FIG. 7. FIG. 7(A) is a graph showing the relationship between the acquired torque (y-axis) of the Z-axis motor 51A and the position in the Z-axis direction of the spindle head 7A when the torque was acquired (x-axis; hereinafter referred to as displacement information). An example is shown in which the CPU 31A continuously acquires torques T(1), T(5), and T(9) of the Z-axis motor 51A. The displacement information when the torques T(1), T(5), and T(9) are acquired is s(1), s(5), and s(9).

[0046] As shown in FIG. 7B, the CPU 31A connects two consecutively acquired torques T(1) and T(5) with a straight line. The CPU 31A determines a plurality of points on the connected straight line, which are arranged at equal time intervals in the x-axis direction. The CPU 31A determines the y coordinates of each of the plurality of points as torques T(2), T(3), and T(4). The CPU 31A determines the x coordinates of each of the plurality of points as displacement information s(2), s(3), and s(4) corresponding to the torques T(2), T(3), and T(4). In a similar manner, the CPU 31A determines torques T(6), T(7), and T(8) from two consecutively acquired torques T(5), and T(9), and determines the corresponding displacement information s(6), s(7), and s(8). The torques T(1) to T(9) generated in this manner are called interpolated torques.

[0047] The CPU 31A applies a low-pass filter to the interpolated torque generated from the torque acquired at 0.5 ms intervals, then time-differentiates the torque to calculate the differential value, and determines the peak position. FIG. 8 shows the frequency (number of times) of the peak position and the average value μ calculated based on the differential value. FIG. 8(A) shows the result of the perfect mounting state, and the number of interpolated torques is set to 50. FIG. 8(A) also shows the standard deviation σ and the judgment threshold value μ+6σ. FIG. 8(B) shows the result of the incomplete mounting state in which one 85 μm paper is attached between the taper mounting portion 180A and the mounting hole 92A, and the number of interpolated torques is set to 10. FIG. 8(C) shows the result of the incomplete mounting state in which two 85 μm paper sheets are attached between the taper mounting portion 180A and the mounting hole 92A, and the number of interpolated torques is set to 10.

[0048] In the results for the perfectly attached state shown in Figure 8(A), the standard deviation σ was 0.0243, and the judgment threshold μ+6σ was 35, 3875. In contrast, in the results for the imperfectly attached state shown in Figure 8(B), the average value μ was 35.8403, and in the results for the imperfectly attached state shown in Figure 8(C), the average value μ was 36.3724. In either case, since the values ​​are greater than the judgment threshold μ+6σ, it is clear that it is possible to judge an imperfectly attached state.

[0049] Furthermore, compared with FIGS. 6(A) to (C), the distribution of peak positions in FIGS. 8(A) to (C) is closer to a normal distribution, and the standard deviation can be calculated.

[0050] <Main processing> The main processing will be described with reference to Figures 9 and 10. When replacing the tool body 40A mounted on the spindle 9A, the operator operates the input unit 24A. The input unit 24A transmits a tool replacement command to the CPU 31A in response to the operator's operation. When the CPU 31A receives the tool replacement command, it starts the main processing by reading and executing a control program stored in the ROM 32A. When the main processing starts, the spindle head 7A is at the lowest position (for example, reference point 0).

[0051] As shown in FIG. 9, the CPU 31A executes the ascent process until the spindle head 7A reaches the top position (S11). In the ascent process, the CPU 31A rotates the Z-axis motor 51A, and the spindle head 7A rises. The CPU 31A judges whether or not the spindle head 7A has reached the top position (S13). If it is judged that the spindle head 7A has not reached the top position (S13: NO), the CPU 31A returns the process to S11. The CPU 31A repeats the judgment of S13 at a predetermined cycle until the spindle head 7A reaches the top position. Whether or not the spindle head 7A has reached the top position is judged from the position of the spindle head 7A in the Z-axis direction based on the rotation angle of the Z-axis motor 51A obtained from the encoder 511A.

[0052] When it is determined that the spindle head 7A has reached the top position (S13: YES), the CPU 31A executes a magazine rotation process (S15). In the magazine rotation process, the CPU 31A drives the magazine motor 55A to rotate the tool magazine 21A and positions the tool body 40A (second tool body) at the tool exchange position.

[0053] The CPU 31A executes the lowering process until the spindle head 7A reaches the bottom (S17). In the lowering process, the CPU 31A rotates the Z-axis motor 51A. The rotation direction of the Z-axis motor 51A in the lowering process is opposite to that in the ascent process. The CPU 31A starts acquiring the torque of the Z-axis motor 51A (S19). Thereafter, the CPU 31A acquires the torque of the Z-axis motor 51A at a predetermined acquisition period (e.g., 0.5 ms).

[0054] The CPU 31A judges whether the spindle head 7A has reached the lowest position (S21). Whether the spindle head 7A has reached the lowest position is judged from the position of the spindle head 7A in the Z-axis direction based on the rotation angle of the Z-axis motor 51A obtained from the encoder 511A. When it is judged that the spindle head 7A has not reached the lowest position (S21: NO), the CPU 31A judges whether a new torque has been acquired (S23). When a new torque has not been acquired (S23: NO), the CPU 31A returns the process to S21. When a new torque has been acquired (S23: YES), the CPU 31A generates an interpolation torque by linear approximation based on the previously acquired torque and the newly acquired torque (S25). The CPU 31A applies a low-pass filter to the generated interpolation torque (S27). The application of the low-pass filter is realized by applying a moving average filter twice.

[0055] The CPU 31A executes a differential calculation process to time-differentiate the interpolated torque to which the low-pass filter was applied in S25 (S29). The CPU 31A associates the differential value obtained by the differential calculation with the displacement information corresponding to the differential value and stores them in the RAM 33A (S31). The CPU 31A repeats the processes from S23 to S31 until the spindle head 7A reaches the bottom, and stores the differential value and the displacement information in the RAM 33A.

[0056] When it is determined that the spindle head 7A has reached the lowest position (S21: YES), the spindle 9A is fitted with a tool body 40A (second tool body). The CPU 31A stops acquiring the torque that was started in S19 (S33). The CPU 31A determines the minimum differential value among the differential values ​​stored in the RAM 33A in the process of S31. The CPU 31A determines the displacement information associated with the determined minimum differential value as a peak position (S35). The CPU 31A acquires the number of mountings corresponding to the tool body 40A mounted on the spindle 9A among the number of mountings stored in the storage device 34A. The CPU 31A associates the determined peak position with the acquired number of mountings and stores them in the storage device 34A (S37). The CPU 31A advances the process to S39 (see FIG. 10).

[0057] 10, when the spindle head 7A descends, the CPU 31A determines whether the tool body 40A is present at the tool replacement position (S39). If the CPU 31A determines that the tool body 40A is not present at the tool replacement position (S39: NO), the process proceeds to S53. If the CPU 31A determines that the tool body 40A is present at the tool replacement position (S39: YES), the process proceeds to S41.

[0058] The CPU 31A judges whether the total number of target peak positions among the peak positions stored in the storage device 34A in the process of S37 (see FIG. 9) is equal to or greater than a predetermined number (S41). If the number of target peak positions stored in the storage device 34A is less than the predetermined number (S41: NO), the CPU 31A ends the main process. If the total number of target peak positions stored in the storage device 34A is equal to or greater than the predetermined number (S41: YES), the CPU 31A executes statistical processing (S47). In the statistical processing, the CPU 31A acquires a predetermined number of target peak positions, counting from the second peak position in order of newness, among the target peak positions stored in the storage device 34A based on the number of mountings. The CPU 31A calculates the average value μ and standard deviation σ of the acquired target peak positions. The CPU 31A determines μ+6σ as the judgment threshold value based on the average value μ and standard deviation σ calculated in the statistical processing (S49).

[0059] The CPU 31A judges whether the first peak position stored in the storage device 34A is greater than the judgment threshold (μ+6σ) determined in the process of S49 (S51). When the CPU 31A judges that the first peak position is greater than the judgment threshold (S51: YES), it judges that the wearing state after the wearing operation is an incomplete wearing state. At that time, the CPU 31A displays an alarm notification on the display unit 25A to notify that the wearing state after the wearing operation is an incomplete state (S53). The CPU 31A deletes the first peak position stored in the storage device 34A (S55). The CPU 31A ends the main process. When the CPU 31A judges that the first peak position is not greater than the judgment threshold (S51: NO), it ends the main process.

[0060] <Actions and Effects of First Embodiment> The numerical controller 30A generates an interpolated torque by interpolating the torque of the Z-axis motor 51A thus obtained (S25). The numerical controller 30A determines a peak position based on a differential value obtained by time-differentiating the generated interpolated torque (S35). The numerical controller 30A performs statistical processing on the determined peak position to calculate an average value μ and a standard deviation σ, and determines a judgment threshold value (μ+6σ) (S47, S49). The numerical controller 30A determines the mounting state of the tool body 40A after the mounting operation based on the relationship between the determined judgment threshold value and the first peak position (S51). By generating an interpolated torque, the numerical controller 30A can increase the number of torques used to determine the peak position, and therefore can determine a slight change in the mounting state of the tool body 40A with high accuracy.

[0061] The numerical controller 30A can generate the interpolated torque by a simple method by interpolating the torque using linear approximation, and therefore can suppress an increase in the processing load when generating the interpolated torque.

[0062] The numerical controller 30A applies a low-pass filter to the generated interpolation torque (S27), and differentiates the interpolation torque to which the low-pass filter has been applied (S29). At this time, the numerical controller 30A can remove noise components from the generated interpolation torque, and can determine an accurate peak position by smoothing the interpolation torque.

[0063] The numerical control device 30A calculates the average value μ based on the peak positions (S47), and judges the mounting state based on the average value μ (S51). Note that the judgment based on the average value of the peak positions is less susceptible to the influence of aging of the tool body 40A compared to the judgment based on the drive current value of the Z-axis motor 51A. Therefore, the numerical control device 30A can judge the mounting state with high accuracy.

[0064] The peak position varies greatly with respect to the average value μ depending on the mounting state of the tool body 40A. In response to this, the numerical control device 30A judges the mounting state based on the relationship between the judgment threshold (μ+6σ) and the first peak position (S51). At this time, the judgment threshold (μ+6σ) is a value that takes into account the degree of fluctuation of the peak position. Therefore, the numerical control device 30A can judge the mounting state with high accuracy even if there is variation in the measurement value of the peak position with respect to the average value μ.

[0065] The numerical control device 30A can accurately determine the mounting state of the tool body 40A in the so-called turret type machine tool 1A. Note that, although the predetermined time for acquiring the torque in the embodiment is a predetermined cycle, it may be a predetermined position.

[0066] The CPU 31A performing the process of S19 is an example of the "acquisition unit" of the present invention. The CPU 31A performing the process of S25 is an example of the "interpolation unit" of the present invention. The CPU 31A performing the process of S29 is an example of the "differential calculation unit" of the present invention. The CPU 31A performing the process of S35 is an example of the "determination unit" of the present invention. The CPU 31A performing the process of S37 is an example of the "storage unit" of the present invention. The CPU 31A performing the process of S47 is an example of the "statistical processing unit" of the present invention. The CPU 31A performing the process of S51 is an example of the "determination unit" of the present invention. The CPU 31A performing the process of S27 is an example of the "first filter processing unit" of the present invention. The process of S19 is an example of the "acquisition step" of the present invention. The process of S25 is an example of the "interpolation step" of the present invention. The process of S29 is an example of the "differential calculation step" of the present invention. The process of S35 is an example of the "determination step" of the present invention. The process of S37 is an example of the "storage step" of the present invention. The process of S47 is an example of the "statistical processing step" of the present invention. The process of S51 is an example of the "determination step" of the present invention.

[0067] Second Embodiment A second embodiment of the present invention will be described. In the following description, arrows in the drawings will be used to indicate left and right, front and rear, and up and down. The left and right direction, front and rear direction, and up and down direction of machine tool 1B shown in FIG. 11 are the X-axis direction, Y-axis direction, and Z-axis direction of machine tool 1B, respectively. Machine tool 1B is a machine that rotates tool 4A (see FIG. 2) of tool body 40A (see FIG. 2) attached to spindle 7B (see FIG. 14) and performs cutting on a workpiece fixed to turntable 11B. A numerical control device 50B (see FIG. 17) controls the operation of machine tool 1B.

[0068] <Overview of Machine Tool 1B> The structure of a machine tool 1B will be described with reference to Figures 11 to 16. The machine tool 1B includes a base unit 2B, a pillar 5B, a spindle head 6B, a spindle 7B, a work table device 10B, a tool changer 40B (hereinafter referred to as an ATC device 40B), and the like.

[0069] The base 2B is an iron member having a generally rectangular shape in plan view, and includes a pedestal 20B on the rear side of the upper surface. The pedestal 20B includes an X-axis motor 21B (see FIG. 17), a Y-axis motor 24B (see FIG. 17), and the like. The pedestal 20B supports the upright pillar 5B so that it can move in the X-axis and Y-axis directions. Driven by the X-axis motor 21B and the Y-axis motor 24B, the upright pillar 5B moves in the X-axis and Y-axis directions relative to the base 2B. The upright pillar 5B includes a Z-axis movement mechanism 103B on its front side. The Z-axis movement mechanism 103B supports the spindle head 6B so that it can move in the Z-axis direction. The workbench device 10B is provided in front of the pedestal 20B of the base 2B. The workbench device 10B includes a rotating table 11B on its upper portion. The rotating table 11B is provided so that it can rotate about a rotation axis parallel to the Z-axis direction by drive of a rotating table motor (not shown). The workpiece is fixed to the rotating table 11B.

[0070] <Spindle head 6B> As shown in FIG. 14, the spindle head 6B rotatably supports the spindle 7B therein. The spindle 7B extends in the Z-axis direction. The spindle head 6B has a spindle motor 8B fixed to its upper portion. The drive shaft of the spindle motor 8B is connected to the spindle 7B. The spindle 7B is provided with an attachment hole (not shown), a clamp mechanism (not shown), a drawbar 70B, and the like. The attachment hole is provided at the lower end of the spindle 7B. The lower end of the spindle 7B has a convex key (not shown) at a predetermined position. The key is engageable with a tool holder 17A that holds the tool 4A. The clamp mechanism is provided in a shaft hole (not shown) that passes through the center of the spindle 7B and above the attachment hole. The drawbar 70B is inserted coaxially into the shaft hole of the spindle 7B. The drawbar 70B is constantly biased upward by a spring (not shown). The spring uses its elastic force to fix tool holder 17A of tool body 40A to the mounting hole of spindle 7B. When tool holder 17A is mounted in the mounting hole, the clamp mechanism mounts tool holder 17A. When drawbar 70B presses the clamp mechanism downward, the clamp mechanism detaches tool holder 17A from spindle 7B.

[0071] The spindle head 6B is provided with a swing arm member 60B on the inner side of the upper rear part. The swing arm member 60B is substantially L-shaped and is swingable about a support shaft 61B. The support shaft 61B extends in the left-right direction inside the spindle head 6B and is fixed to the left and right side walls of the spindle head 6B. The swing arm member 60B includes a vertical arm portion 63B and a horizontal arm portion 62B. The vertical arm portion 63B extends obliquely upward from the support shaft 61B toward the column 5B side. The horizontal arm portion 62B extends substantially horizontally forward from the support shaft 61B. A pin 71B projects perpendicularly to the draw bar 70B. The tip portion 621 of the horizontal arm portion 62B is formed in a bifurcated shape, and the draw bar 70B is disposed between the tip portions 621. The tip portion 621 can be engaged with the pin 71B from above. When the swing arm member 60B is viewed from the left side, a tension spring (not shown) always biases the swing arm member 60B counterclockwise. Therefore, the swing arm member 60B always releases the downward pressing of the pin 71B by the horizontal arm portion 62B.

[0072] As shown in FIGS. 14 and 15, the spindle head 6B is provided with a rod support portion 91B on the upper part and on the side of the ATC device 40B. The rod support portion 91B supports a push rod 92B so as to be movable in the front-rear direction. The push rod 92B extends in the front-rear direction. The vertical arm portion 63B of the swing arm member 60B is provided with a contact portion 631 on the right side surface of the upper end portion. The contact portion 631 contacts the front end portion of the push rod 92B and is always biased rearward by a tension spring. Therefore, the rear end portion of the push rod 92B always projects rearward from the rod support portion 91B by a predetermined distance. When the rear end portion of the push rod 92B is pressed forward, the swing arm member 60B swings clockwise (viewed from the left side) about the support shaft 61B, and pushes down the draw bar 70B against the biasing force of the tension spring. The clamping mechanism portion disengages the tool holder 17A. The tool body 40A can be disengaged from the mounting hole of the spindle 7B.

[0073] <ATC device 40B> The ATC device 40B is a so-called arm-type exchange device. As shown in Fig. 11, the ATC device 40B is supported on the right side of the spindle head 6B by supports 31B and 32B. The ATC device 40B receives a control signal from the numerical control device 50B and replaces the tool body 40A (first tool body 201) attached to the attachment hole of the spindle 7B with another tool body 40A (second tool body 202) specified by an NC program described later. The ATC device 40B includes a main body 401B and a tool magazine 41B.

[0074] As shown in Figs. 11 to 16, the main body 401B is substantially rectangular parallelepiped and is supported by the support columns 31B and 32B. The main body 401B includes an operating member 47B, a rotating shaft 43B, a tool exchange arm 44B, an ATC motor 45B, an ATC drive shaft 46B, and swing levers 22B and 23B. The operating member 47B is provided inside the main body 401B and is a rod-shaped member extending substantially parallel to the Z-axis direction. The upper end of the operating member 47B protrudes upward from an opening (not shown) provided on the upper surface of the main body 401B. The lower end of the operating member 47B is pivotally supported so as to be swingable around a swing shaft 49B. The swing shaft 49B extends left and right inside the main body 401B and is fixed to both left and right side walls of the main body 401B. Therefore, the upper end of the operating member 47B can move in the front-rear direction around the swing shaft 49B. The basic position is when the operating member 47B extends parallel to the Z-axis direction. The operating member 47B has a contact portion 48B on the left side of the upper end. The contact portion 48B has a generally cylindrical shape that protrudes to the left. When the spindle head 6B moves to the position shown in FIG. 12 (referred to as the tool changing position) to change a tool, the rear end of the push rod 92B is positioned in front of the contact portion 48B (see FIG. 15).

[0075] The pivot shaft 43B is formed in a cylindrical shape protruding downward from the lower part of the main body 401B, and the main body 401B supports the pivot shaft 43B so that it can rotate around its axis. The pivot shaft 43B extends parallel to the Z-axis direction and has a spline 15B and a spline countershaft 17B at its upper end. The spline 15B has a stepped hole 16B. The stepped hole 16B has a predetermined depth along the axis of the spline 15B. The support member 39B is formed in an elongated shaft shape and is fixed to the upper machine frame 38B fixed to the upper part of the main body 401B. The support member 39B is inserted into the stepped hole 16B via a bush (not shown) arranged at the upper step of the stepped hole 16B.

[0076] The splined countershaft 17B is formed in a cylindrical shape and is attached to the outside of the splined countershaft 15B. The splined countershaft 15B can move up and down inside the splined countershaft 17B. The bearings 75B and 76B are fixed to the upper part of the main body 401B and rotatably support the splined countershaft 17B. Therefore, the rotating shaft 43B rotates around the support member 39B with respect to the main body 401B. The splined countershaft 17B has a flange portion 171 on its outer periphery. The flange portion 171 has the shafts of the driven rollers 182 and 183 fixed to its upper and lower surfaces. The rotating shaft 43B has a cylindrical portion 34B coaxially at the axial center. The cylindrical portion 34B has a circumferential groove 342 on its outer circumferential surface. When the cylindrical portion 34B moves up and down, the rotating shaft 43B moves up and down along the support member 39B.

[0077] The lower part inside the main body 401B is provided with an outer shaft gear 431B. The outer shaft gear 431B has an opening in the center, into which the rotating shaft 43B is inserted. The rotating shaft 43B can move up and down relative to the outer shaft gear 431B. When the rotating shaft 43B moves to the top dead center described below, the outer shaft gear 431B engages with the tool exchange arm 44B, and the tool exchange arm 44B rotates with the rotation of the outer shaft gear 431B. When the rotating shaft 43B moves downward from the top dead center, the outer shaft gear 431B separates from the tool exchange arm 44B, and the tool exchange arm 44B does not rotate even if the outer shaft gear 431B rotates. The outer shaft gear 431B has a tooth portion 432B on the outer circumference of the upper end part. The lower part inside the main body 401B rotatably supports the segment gear 66B. The tooth portion 432B meshes with the segment gear 66B. The segment gear 66B supports a rocker 571B. The rocker 571B follows a flat groove cam 33B provided on the lower surface of the cylindrical portion 37B.

[0078] The tool exchange arm 44B is perpendicular to the lower end of the rotating shaft 43B and extends horizontally. The tool exchange arm 44B rotates in response to the rotation of the outer shaft gear 431B, and moves up and down between the top dead center and the bottom dead center in response to the up and down movement of the rotating shaft 43B. The tool exchange arm 44B has grippers 441 and 442 at both ends. Although not described in detail, the grippers 441 and 442 are formed, for example, in a C-shape in a plan view, and fit into the tool holder 17A of the tool body 40A to grip the tool holder 17A. The tool exchange arm 44B has a lock mechanism (not shown) that fixes the tool holder 17A gripped by the grippers 441 and 442, and fixes and releases the tool holder 17A in response to the rotation angle of the ATC motor 45B. Therefore, the grippers 441 and 442 grip the tool body 40A in a detachable manner.

[0079] The box 450 is fixed to the main body 401B at approximately the center in the front-rear direction on the upper surface. The bottom wall of the box 450 is open, and the bearing 27B is fixed around the opening. The ATC motor 45B is fixed to the upper part of the box 450, and the output shaft 451B of the ATC motor 45B protrudes downward from the opening provided in the upper wall. The ATC drive shaft 46B is provided behind the rotating shaft 43B and extends in the vertical direction parallel to the rotating shaft 43B. The bearings 27B and 28B support the ATC drive shaft 46B so that it can rotate freely. The bearing 28B is fixed to the bottom wall of the main body 401B. The upper end of the ATC drive shaft 46B is connected to the output shaft 451B via a coupling 45C inside the box 450. The ATC drive shaft 46B has a cylindrical portion 37B coaxially at the center in the axial direction. The cylindrical portion 37B has a grooved cam 371B and a grooved cam 372B on the outer circumferential surface.

[0080] The main body 401B supports a support point 221B provided at one end of the swing lever 22B inside so that the swing lever 22B can swing. The swing lever 22B is formed in a long shaft shape, and an engagement piece 222B provided at the center of the swing lever 22B engages with the grooved cam 372B. A contact piece 223B provided at the other end of the swing lever 22B engages with a circumferential groove 342 provided in the cylindrical portion 34B. Therefore, when the ATC drive shaft 46B rotates once, the swing lever 22B swings in response to the grooved cam 372B, and the rotating shaft 43B and the tool exchange arm 44B reciprocate once in the axial direction. The swing lever 23B is formed in a long shaft shape, and one end in the length direction engages with the grooved cam 371B. The other end of the swing lever 23B is rotatably supported by the operating member 47B. Therefore, when the ATC drive shaft 46B rotates, the swing lever 23B swings in response to the grooved cam 371B, thereby swinging the operating member 47B forward from the basic position. As described above, when the operating member 47B presses the rear end of the push rod 92B forward, the tool holder 17A can be detached from the mounting hole of the spindle 7B.

[0081] The ATC drive shaft 46B is provided with a cylindrical parallel cam 59B coaxially at its axial upper portion. The parallel cam 59B is a compound cam having flange-shaped plate cams 591B and 592B. The plate cams 591B and 592B abut against the driven rollers 182 and 183 of the spline countershaft 17B, respectively. Therefore, when the ATC drive shaft 46B rotates and the plate cams 591B and 592B abut against the driven rollers 182 and 183, the tool change arm 44B rotates.

[0082] The tool magazine 41B is fixed to the right side of the main body 401B and has a generally elliptical shape long in the Y-axis direction in a side view. The tool magazine 41B has a generally elliptical tool passage on the inside, and stores a plurality of tool pots 411 along the tool passage. The tool pots 411 detachably mount the tool holders 17A. The tool magazine 41B has a tool exchange unit (not shown) on the lower front side. The tool exchange unit opens downward. The magazine motor 42B is fixed to the upper front side of the tool magazine 41B. The plurality of tool pots 411 move in the tool passage by driving the magazine motor 42B. The numerical control device 50B drives the magazine motor 42B to transport the tool pot 411 to which the second tool body 202 (see FIG. 18) is attached to the tool exchange unit. In this embodiment, the first tool body 201 (see FIG. 18) corresponds to the tool body currently mounted on the spindle 7B and detached from the spindle 7B when the ATC device 40B replaces the tool. The second tool body 202 corresponds to a tool body that is attached to the spindle 7B in place of the first tool body 201 after the tool change by the ATC device 40B.

[0083] <Electrical configuration> The electrical configuration of the numerical control device 50B and the machine tool 1B will be described with reference to FIG. 17. The numerical control device 50B includes a CPU 51B, a ROM 52B, a RAM 53B, a storage device 54B, an input interface 55B, an output interface 56B, and the like. The CPU 51B controls the numerical control device 50B. The ROM 52B stores various programs. The RAM 53B stores various data during processing. The storage device 54B is a non-volatile memory, and stores various data in addition to the NC program. The NC program is composed of a plurality of blocks, and each block includes at least one command such as a tool change command. The storage device 54B also stores the number of times the tool body 40A has been mounted on the spindle 7B for each tool body 40A. When the CPU 51B performs a mounting operation of the tool body 40A on the spindle 7B, it adds 1 to the number of mounting operations corresponding to the tool body 40A to be mounted. When the CPU 51B detaches the tool body 40A attached to the spindle 7B and replaces it with another tool body 40A, the number of attachments corresponding to the detached tool body 40A is set to 0.

[0084] The machine tool 1B further includes an input unit 82B, a display unit 90B, an air cylinder 88B, etc. The input unit 82B and the display unit 90B are provided on an operation panel (not shown). The input unit 82B accepts various inputs. The display unit 90B displays various screens. The air cylinder 88B is provided on the ATC device 40B. The air cylinder 88B is a drive source for a pot lifting mechanism (not shown) that lifts and lowers the tool pot 411 between a vertical position and a horizontal position, which will be described later. When in a vertical position, the tool pot 41A is located to the left of the spindle 7B when the spindle head 6B is in the tool changing position. The input unit 82B is electrically connected to the input interface 55B. The air cylinder 88B and the display unit 90B are electrically connected to the output interface 56B.

[0085] The Z-axis motor 19B, the spindle motor 8B, the X-axis motor 21B, the Y-axis motor 24B, the magazine motor 42B, and the ATC motor 45B are electrically connected to the output interface 56B. The Z-axis motor 19B, the spindle motor 8B, the X-axis motor 21B, the Y-axis motor 24B, the magazine motor 42B, and the ATC motor 45B are servo motors that rotate in response to pulse signals output by the output interface 56B. The Z-axis motor 19B is equipped with an encoder 19C. The spindle motor 8B is equipped with an encoder 8C. The X-axis motor 21B is equipped with an encoder 21C. The Y-axis motor 24B is equipped with an encoder 24C. The magazine motor 42B is equipped with an encoder 42C. The ATC motor 45B is equipped with an encoder 45D. Encoders 19C, 8C, 21C, 24C, 42C, and 45D detect the rotation angles of Z-axis motor 19B, spindle motor 8B, X-axis motor 21B, Y-axis motor 24B, magazine motor 42B, and ATC motor 45B, respectively. Encoders 19C, 8C, 21C, 24C, 42C, and 45D are electrically connected to input interface 55B.

[0086] <Attachment / detachment of tool body 40A, tool replacement operation> The tool changing operation will be described with reference to Figs. 18 and 19. The CPU 51B moves the spindle head 6B to the tool changing position (see Fig. 12). The rear end of the push rod 92B is located in front of the abutment part 48B and separated therefrom. The rotation angle of the ATC drive shaft 46B at this time is called 0°. The tool changing arm 44B is located at the top dead center in the vertical direction and at the standby position in the rotation direction. The standby position is a position where the gripping parts 441, 442 are located between the spindle 7B and the tool changing part. As shown in Figs. 18(1) and 18(2), the CPU 51B tilts the tool pot 411, which holds the second tool body 202, vertically downward by 90° from the horizontal state, thereby lowering the second tool body 202 from the opening of the tool changing part. The tool pot 411 becomes vertical. The CPU 51B starts driving the ATC motor 45B.

[0087] As shown in Fig. 19, the ATC motor 45B starts driving at time T0, and rotates the ATC drive shaft 46B in the normal direction. The flat groove cam 33B rotates in the normal direction, and the segment gear 66B and the outer shaft gear 431B rotate via the oscillator 571B. The rotating shaft 43B starts rotating in the first direction (counterclockwise in a plan view) at time T1. Due to the rotation of the rotating shaft 43B, the tool change arm 44B rotates in the first direction from the standby position. Hereinafter, the angle at which the tool change arm 44B rotates in the first direction from the standby position is referred to as the rotation angle.

[0088] With the rotation of the ATC drive shaft 46B, the swing lever 23B swings, and the operating member 47B swings forward. Therefore, the abutment portion 48B of the operating member 47B abuts against the rear end of the push rod 92B and presses it forward. The push rod 92B moves forward, urging the abutment portion 631 of the swing arm member 60B forward. The swing arm member 60B starts to rotate clockwise as viewed from the right side about the support shaft 61B against the urging force of the tension spring. The inclination angle of the swing arm member 60B changes from 3.7° to 0° (time T2). At that time, the horizontal arm portion 62B engages with the pin 71B from above, and presses the draw bar 70B downward against the urging force of the spring provided inside the main shaft 7B. The draw bar 70B urges the clamp mechanism downward.

[0089] When the rotation angle of the ATC drive shaft 46B reaches 60° (time T3), the pivot angle of the tool change arm 44B reaches 70°. As shown in Fig. 18(3), the gripper 441 grips the first tool body 201 attached to the spindle 7B, and the gripper 442 grips the second tool body 202 located in the tool change unit. As shown in Fig. 19, between times T3 and T6, the plate cams 591B and 592B are separated from the driven rollers 18A and 18B, and the pivot angle of the tool change arm 44B is maintained at 70°.

[0090] When the rotation angle of the ATC drive shaft 46B reaches 80° (time T4), the first tool body 201 comes out of the clamp mechanism inside the spindle 7B, as shown in Fig. 18(4). The tool change arm 44B starts to descend from the top dead center to the bottom dead center. When the rotation angle of the ATC drive shaft 46B reaches the 90° position (time T5), the inclination angle of the swing arm member 60B becomes 0°, and the first tool body 201 and the second tool body 202 are detached downward from the spindle 7B and the tool pot 411.

[0091] At time T6, the plate cams 591B and 592B come into contact with the driven rollers 18A and 18B, and the rotating shaft 43B starts rotating in the first direction again from a rotation angle of 70°. The tool change arm 44B rotates while descending toward the bottom dead center while gripping the first tool body 201 and the second tool body 202. When the rotation angle of the ATC drive shaft 46B is 130° (time T7), the tool change arm 44B reaches the bottom dead center. When the rotation angle of the ATC drive shaft 46B is 230° (time T8), the tool change arm 44B starts to rise while rotating from the bottom dead center toward the top dead center. When the rotation angle of the ATC drive shaft 46B is 260° (time T9), the rotation angle of the tool change arm 44B becomes 250°. As shown in FIG. 18(5), the positions of the first tool body 201 and the second tool body 202 are interchanged. The second tool body 202 is disposed below the spindle 7B, and the first tool body 201 is disposed below the tool pot 411 of the tool changing section. The plate cams 591B and 592B move away from the driven rollers 18A and 18B, and the pivot angle of the tool changing arm 44B is maintained at 250°. The tool changing arm 44B continues to rise toward the top dead center. At that time, the second tool body 202 is inserted into the mounting hole of the spindle 7B, and the first tool body 201 is inserted into the tool pot 411.

[0092] When the rotation angle of the ATC drive shaft 46B reaches 270° (time T10), the operation member 47B starts to swing backward, and the push rod 92B moves backward. The swing arm member 60B starts to rotate counterclockwise as viewed from the right side about the support shaft 61B by the biasing force of the tension spring, and the inclination angle changes from 0° to 3.7°. When the rotation angle of the ATC drive shaft 46B reaches the 280° position (time T11), as shown in FIG. 18(6), the tool exchange arm 44B reaches the top dead center. The second tool body 202 is attached to the attachment hole of the spindle 7B, and the first tool body 201 is attached to the tool pot 411. The tool holder 17A engages with the key at the lower end of the spindle 7B, and the second tool body 202 is attached to the attachment hole of the spindle 7B.

[0093] When the rotation angle of the ATC drive shaft 46B reaches 300° (time T12), the oscillator 571B oscillates in a predetermined direction along the flat groove cam 33B. The segment gear 66B driven by the oscillator 571B rotates, and the outer shaft gear 431B meshing with the segment gear 66B via the tooth portion 432B rotates. With the rotation of the outer shaft gear 431B, the tool exchange arm 44B rotates in the reverse direction (clockwise in plan view). When the rotation angle of the ATC drive shaft 46B reaches 330° (time T13), the inclination angle of the oscillating arm member 60B returns to 3.7°. When the rotation angle of the ATC drive shaft 46B reaches 350° (time T14), the tool exchange arm 44B stops rotating at a rotation angle of 180°. When the rotation angle of the ATC drive shaft 46B reaches 360°, the CPU 51B stops the ATC motor 45B. As shown in FIG. 18(8), the CPU 51B returns the tool pot 411 located in the tool exchange section of the tool magazine 41B from the vertical position to the horizontal position and raises it. This completes the tool exchange operation. The operation of the ATC drive shaft 46B, the swing arm member 60B, the draw bar 70B, and the clamp mechanism when mounting the tool body 40A on the spindle 7B is referred to as the mounting operation.

[0094] <How to determine wearing status> The mounting state of the tool body 40A relative to the spindle 7B is either a completely mounted state or an incompletely mounted state, as in the first embodiment. The relationship between the rotation angle of the ATC drive shaft 46B and the torque of the ATC motor 45B during the mounting operation differs between the completely mounted state and the incompletely mounted state. During the mounting operation, the rotation angle of the ATC drive shaft 46B when the time differential value of the torque of the ATC motor 45B is minimum is referred to as the peak angle. As in the first embodiment, the peak angle changes depending on the mounting state. More specifically, when the mounting state is an incompletely mounted state, the peak angle is larger than the peak angle in the completely mounted state.

[0095] Therefore, similarly to the first embodiment, the CPU 51B of the numerical control device 50B periodically acquires the torque of the ATC motor 45B in a time series during the mounting operation. Every time the CPU 51B executes the mounting operation, it complements the acquired torque of the ATC motor 45B to generate an interpolated torque. The CPU 51B time-differentiates the generated interpolated torque to calculate a differential value. The CPU 51B associates the differential value with the rotation angle of the ATC drive shaft 46B and stores them in the RAM 53B. The CPU 51B determines a peak angle from the differential value stored in the RAM 53B. The CPU 51B associates the determined peak angle with the number of times each tool body 40A is mounted and sequentially stores it in the storage device 54B. Every time the CPU 51B stores the peak angle in the storage device 54B, it statistically processes the peak angle to calculate an average value μ and a standard deviation σ. More specifically, the CPU 51B extracts a predetermined number of peak angles, counting from the most recent peak angle (hereinafter referred to as the second peak angle) among the peak angles (hereinafter referred to as the target peak angles) excluding the most recent peak angle (hereinafter referred to as the first peak angle) and the peak angle at the time of the incomplete attachment state from the peak angles stored in the storage device 54B, and calculates the average value μ and standard deviation σ as statistical values. If the first peak angle, i.e., the peak angle during the attachment operation, is greater than a determination threshold value (μ-6σ) obtained by subtracting six times the standard deviation σ from the average value μ, the CPU 51B determines that the attachment state after the attachment operation is an incomplete attachment state.

[0096] In the second embodiment, the method of generating the interpolated torque is different from that in the first embodiment. In the second embodiment, the CPU 51B generates a correction torque by interpolating the torque using curve approximation. The method of generating the interpolated torque will be specifically described with reference to FIG. 20. FIG. 20(A) is a graph showing the relationship between the acquired torque (y-axis) of the ATC motor 45B and the rotation angle (x-axis) of the ATC drive shaft 46B when the torque is acquired. The rotation angle of the ATC drive shaft 46B corresponds to the position of the spindle head 7A in the Z-axis direction in the first embodiment, so it is called displacement information as in the first embodiment. An example is shown in which the CPU 31A continuously acquires the torques U(1), U(5), U(9), and U(13) of the ATC motor 45B. The displacement information when the torques U(1), U(5), U(9), and U(13) are acquired is a(1), a(5), a(9), and a(13).

[0097] As shown in FIG. 20B, the CPU 51B calculates an approximation curve that minimizes the distance between the successively acquired torques U(1), U(5), U(9), and U(13) by using a known curve approximation method. The CPU 31A determines a plurality of points on the calculated approximation curve that are arranged at equal time intervals in the x-axis direction. The CPU 51B determines the y coordinates of each of the plurality of points as the torques U(1), U(2)′ to U(12)′, and U(13). The CPU 51B determines the x coordinates of each of the plurality of points as the displacement information a(1) to a(13) corresponding to U(1), U(2)′ to U(12)′, and U(13). The torques U(1), U(2)′ to U(12)′, and U(13) generated as described above are called interpolation torques, as in the first embodiment. Curve approximation can be performed using the least squares method, polynomial curves such as spline curves, trigonometric functions, and the like.

[0098] <Main processing> The main processing will be described with reference to Figs. 21 and 10. When replacing the tool body 40A mounted on the spindle 7B, the operator operates the input unit 82B. The input unit 82B transmits a tool replacement command to the CPU 51B in response to the operator's operation. When the CPU 51B receives the tool replacement command, it starts the main processing by reading and executing a control program stored in the ROM 52B. At the start of the main processing, the rotation angle of the ATC drive shaft 46B is 0°. In the following description, the same processing as the main processing of the first embodiment will be simplified.

[0099] As shown in FIG. 21, the CPU 51B rotates the ATC motor 45B until the rotation angle of the ATC drive shaft 46B reaches 360° (S111). Whether the rotation angle of the ATC drive shaft 46B reaches 360° is determined based on the rotation angle of the ATC motor 45B acquired from the encoder 45D. The CPU 51B determines whether the rotation angle of the ATC drive shaft 46B reaches 270° (time T10) (S113). This time is the time when the swing arm member 60B starts to rotate during the mounting operation. When it is determined that the rotation angle of the ATC drive shaft 46B has not reached 270° (S113: NO), the CPU 51B returns the process to S113. The CPU 51B repeats the determination of S113 at a predetermined cycle until the rotation angle of the ATC drive shaft 46B reaches 270°. When it is determined that the rotation angle of the ATC drive shaft 46B has reached 270° (S113: YES), the CPU 51B starts acquiring the torque of the ATC motor 45B (S115). After that, the CPU 51B acquires the torque of the ATC motor 45B at an acquisition period (for example, 0.5 ms).

[0100] The CPU 51B judges whether the rotation angle of the ATC drive shaft 46B has reached 360° (S121). When it is judged that the rotation angle of the ATC drive shaft 46B has not reached 360° (S21: NO), the CPU 51B judges whether the torque has been newly acquired (S123). When the torque has not been newly acquired (S123: NO), the CPU 51B returns the process to S121. When the torque has been newly acquired (S123: YES), the CPU 51B associates the acquired torque with the displacement information at the time of acquiring the torque and stores them in the RAM 53B (S124). The CPU 51B returns the process to S121. When it is judged that the rotation angle of the ATC drive shaft 46B has reached 360° (S121: YES), the spindle 7B is equipped with the tool body 40A (second tool body 202). The CPU 51B stops the torque acquisition started in S115 (S133).

[0101] The CPU 31A applies a low-pass filter to the torque stored in the RAM 53B (S145). The application of the low-pass filter is realized by applying a moving average filter twice. The CPU 51B generates an interpolation torque by curve approximation based on the torque after the application of the low-pass filter (S147). The CPU 51B executes a differentiation process to time-differentiate the stored interpolation torque (S149). The CPU 51B associates the differential value obtained by the differentiation process with the displacement information corresponding to the differential value and stores them in the RAM 53B (S151). The CPU 51B determines the minimum differential value among the differential values ​​stored in the RAM 53B. The CPU 51B determines the displacement information associated with the determined minimum differential value as the peak angle (S135). The CPU 51B acquires the number of mountings corresponding to the tool body 40A mounted on the spindle 9A from the number of mountings stored in the storage device 54B. The CPU 51B associates the determined peak angle with the acquired number of times of wearing and stores them in the storage device 54B (S137). The CPU 51B advances the process to S41 (see FIG. 10).

[0102] 10, when the tool exchange arm 44B reaches the top dead center, the CPU 51B determines whether the tool body 40A is present at the tool exchange position (S39). If the CPU 51B determines that the tool body 40A is not present at the tool exchange position (S39: NO), the process proceeds to S53. If the CPU 51B determines that the tool body 40A is present at the tool exchange position (S39: YES), the process proceeds to S41.

[0103] The CPU 51B judges whether the total number of target peak angles among the peak angles stored in the storage device 54B in the process of S137 (see FIG. 21) is equal to or greater than a predetermined number (S41). If the number of target peak angles stored in the storage device 54B is less than the predetermined number (S41: NO), the CPU 31A ends the main process. If the total number of target peak angles stored in the storage device 54B is equal to or greater than the predetermined number (S41: YES), the CPU 51B executes statistical processing (S47). In the statistical processing, the CPU 51B acquires a predetermined number of target peak angles, counting from the second peak angle in reverse chronological order, among the target peak angles stored in the storage device 54B based on the number of times of mounting. The CPU 51B calculates the average value μ and standard deviation σ of the acquired target peak angles. The CPU 51B determines μ-6σ as the judgment threshold value based on the average value μ and standard deviation σ calculated in the statistical processing (S49).

[0104] The CPU 51B judges whether the first peak angle stored in the storage device 54B is greater than the judgment threshold (μ-6σ) determined in the process of S49 (S51). When the CPU 51B judges that the first peak angle is smaller than the judgment threshold (S51: YES), it judges that the wearing state after the wearing operation is an incomplete wearing state. At that time, the CPU 51B displays an alarm notification on the display unit 90B to notify that the wearing state after the wearing operation is an incomplete state (S53). The CPU 51B deletes the first peak angle stored in the storage device 54B (S55). The CPU 51B ends the main process. When the CPU 51B judges that the first peak angle is not smaller than the judgment threshold (S51: NO), it ends the main process.

[0105] <Actions and Effects of the Second Embodiment> The numerical controller 30B generates an interpolated torque by interpolating the acquired torque of the ATC motor 45B (S147). The numerical controller 30B determines a peak angle based on a differential value obtained by time-differentiating the generated interpolated torque (S135). The numerical controller 30B performs statistical processing on the determined peak angle to calculate an average value μ and a standard deviation σ, and determines a judgment threshold value (μ-6σ) (S47, S49). The numerical controller 30B determines the mounting state of the tool body 40A after the mounting operation based on the relationship between the determined judgment threshold value and the first peak angle (S51). By generating an interpolated torque, the numerical controller 30B can increase the number of torques used to determine the peak angle, and therefore can determine a slight change in the mounting state of the tool body 40A with high accuracy.

[0106] The numerical controller 30B calculates an approximation curve by curve approximation, and generates an interpolation torque based on the approximation curve (S147). At this time, the numerical controller 30B can generate an interpolation torque that closely approximates the actual torque, so that slight changes in the mounting state can be determined with high accuracy.

[0107] The numerical controller 30B applies a low-pass filter to the acquired torque (S145), and generates an interpolated torque by interpolating the torque to which the low-pass filter has been applied (S147). At this time, the numerical controller 30B generates an interpolated torque from the torque from which the noise components have been removed, thereby enabling the generation of an interpolated torque that closely approximates the actual torque.

[0108] The numerical control device 30B calculates an average value μ based on the peak angles (S47), and judges the mounting state based on the average value μ (S51). Note that the judgment based on the average value of the peak angles is less susceptible to the influence of aging of the tool body 40A compared to the judgment based on the drive current value of the ATC motor 45B. Therefore, the numerical control device 30B can judge the mounting state with high accuracy.

[0109] The peak angle varies greatly with respect to the average value μ depending on the mounting state of the tool body 40A. In response to this, the numerical control device 30B judges the mounting state based on the relationship between the judgment threshold (μ-6σ) and the first peak angle (S51). At this time, the judgment threshold (μ-6σ) is a value that takes into account the degree of fluctuation of the peak angle. Therefore, the numerical control device 30B can judge the mounting state with high accuracy even if there is variation in the measured value of the peak angle with respect to the average value μ. Note that, although the specified time for acquiring the torque in the embodiment is a specified cycle, it may be a specified position.

[0110] The numerical control device 30B can accurately determine the mounting state of the so-called arm-type machine tool 1B.

[0111] <Special Notes on the Second Embodiment> The CPU 51B performing the process of S115 is an example of the "acquisition unit" of the present invention. The CPU 51B performing the process of S147 is an example of the "interpolation unit" of the present invention. The CPU 51B performing the process of S149 is an example of the "differential calculation unit" of the present invention. The CPU 51B performing the process of S135 is an example of the "determination unit" of the present invention. The CPU 51B performing the process of S137 is an example of the "storage unit" of the present invention. The CPU 51B performing the process of S47 is an example of the "statistical processing unit" of the present invention. The CPU 51B performing the process of S51 is an example of the "determination unit" of the present invention. The CPU 51B performing the process of S145 is an example of the "second filter processing unit" of the present invention. The process of S115 is an example of the "acquisition step" of the present invention. The process of S147 is an example of the "interpolation step" of the present invention. The process of S149 is an example of the "differential calculation step" of the present invention. The process of S135 is an example of the "determination step" of the present invention. The process of S137 is an example of the "storage step" of the present invention. The process of S47 is an example of the "statistical processing step" of the present invention. The process of S51 is an example of the "determination step" of the present invention.

[0112] <Modification> The present invention can be modified in various ways. Unless otherwise specified, the following describes modified examples by taking the numerical control device 30A according to the first embodiment as an example, but it goes without saying that the modified examples can also be appropriately applied to the numerical control device 30B according to the second embodiment.

[0113] Each time the numerical control device 30A performs a mounting operation of the tool body 40A, the peak position is associated with the number of mountings of each tool body 40A and stored in the storage device 34A in sequence. In contrast, the numerical control device 30A may store a parameter other than the number of mountings in the storage device 34A in association with the peak position. For example, as an example of the parameter, the usage time may be associated with the peak position and stored in the storage device 34A.

[0114] The numerical controller 30A may determine the position of the spindle head 7A in the Z-axis direction when the differential value during the mounting operation is maximum as the peak position. The method of generating the interpolated torque is not limited to linear approximation or curve approximation, and other methods may be used. For example, the numerical controller 30A may generate the interpolated torque based on an approximate straight line linearly approximated by the least squares method. The numerical controller 30A may apply a low-pass filter to the acquired torque. The numerical controller 30A may generate the interpolated torque from the torque to which the low-pass filter has been applied. The numerical controller 30A may further apply a low-pass filter to the generated interpolated torque. The applied low-pass filter may be a moving average filter. The window size of the moving average filter may be the same as the number (predetermined number) of peak angles acquired when calculating the average value μ and the standard deviation σ, or may be smaller than the predetermined number.

[0115] The numerical control device 30A does not need to apply a low-pass filter to the generated interpolation torque, and the numerical control device 30B does not need to apply a low-pass filter to the acquired torque.

[0116] The numerical control device 30A may extract a predetermined number of target peak positions, counting from the second peak position, from among the target peak positions, and calculate a value uniquely determined from the extracted predetermined number of peak positions as a statistical value instead of the average value μ. For example, the numerical control device 30A may calculate a median value of the predetermined number of target peak positions as a statistical value. The judgment threshold may be a value other than "μ+6σ". For example, the value multiplied by the standard deviation σ may be appropriately switched depending on the type of machine tool 1A, the cutting processing conditions, etc.

[0117] The numerical control device 30A may set the number of mountings stored in the memory device 34A to 0 when a predetermined time has elapsed with the power of the machine tool 1A turned off, or when a predetermined time has elapsed with the machine tool 1A not performing cutting processing. [Explanation of symbols]

[0118] 1A, 1B: Machine tools 7A: Spindle head 7B, 9A: Main shaft 51A: Z-axis motor 30B: Numerical control device 31A, 51B: CPU 34A: Storage device 40A: Tool body 43B: Rotating shaft 44B: Tool change arm 45B: ATC motor

Claims

1. A numerical control device that controls a machine tool that processes a workpiece by relatively moving a tool attached to a spindle and a workpiece fixed to a worktable, an acquisition unit that acquires a torque of a motor that is a drive source of the attachment mechanism of the tool relative to the spindle at a predetermined time during an attachment operation of the tool; an interpolation unit that generates a second torque by interpolating the first torque, which is the torque acquired by the acquisition unit; a differential calculation unit that performs a differential calculation on an interpolated torque including the first torque acquired by the acquisition unit and the second torque interpolated by the interpolation unit; a determination unit that determines, as peak information, displacement information indicating a position or an angle of the mounting mechanism corresponding to a maximum or minimum value among the differential values ​​calculated by the differential calculation unit; a storage unit that stores the peak information determined by the determination unit in association with a number of uses or a duration of use of the tool with respect to the spindle; a statistical processing unit that performs statistical processing based on the peak information stored in the storage unit; a determination unit that determines a mounting state of the tool with respect to the spindle based on the statistical values ​​statistically processed by the statistical processing unit; A numerical control device comprising:

2. The numerical control device according to claim 1 , wherein the interpolation unit generates the second torque by interpolating the first torque using linear approximation.

3. The numerical control device according to claim 1 , wherein the interpolation unit generates the second torque by interpolating the first torque using curve approximation.

4. A first filtering unit that applies a low-pass filter to the interpolated torque, The differential calculation unit is 3. The numerical control device according to claim 2, wherein the first filter processing unit performs a differential operation on the interpolated torque to which the low-pass filter has been applied.

5. a second filter processing unit that applies a low-pass filter to the first torque acquired by the acquisition unit, The interpolation unit is 4. The numerical control device according to claim 2, wherein the second filter processing unit generates the second torque by interpolating the first torque to which the low-pass filter has been applied.

6. The statistical processing unit Among the target peak information stored in the storage unit as the statistical value, excluding the first peak information that is the latest peak information and the peak information at the time of occurrence of an abnormality, counting a predetermined number of the target peak information starting from the second peak information that is the latest target peak information, and calculating an average value; and Counting the number of pieces of target peak information starting from the second peak information to the predetermined number of pieces of target peak information, and calculating a standard deviation; The determination unit is The wearing state is determined based on the average value and the standard deviation calculated by the statistical processing unit.

6. The numerical control device according to claim 1, wherein the numerical control device is a control device for controlling a control operation of the control unit.

7. The determination unit: The wearing state is determined based on the first peak information and a threshold determined based on the average value and the standard deviation. The numerical control device according to claim 6 .

8. the mounting mechanism includes a spindle head that is reciprocable in a predetermined direction by being driven by the motor and that rotatably supports the spindle; The motor moves the spindle head in the predetermined direction to mount the tool on the spindle, The displacement information is the position of the spindle head in the predetermined direction.

8. The numerical control device according to claim 1, wherein the numerical control device is a control device for controlling a control operation of the control unit.

9. The mounting mechanism includes: A rotating shaft that rotates when driven by the motor; an arm that rotates in synchronization with the rotation of the rotary shaft and is capable of supporting the tool to be attached to the spindle; Equipped with The motor rotates the rotary shaft to mount the tool, which rotates together with the arm, on the spindle; The displacement information is a rotation angle of the rotation axis.

8. The numerical control device according to claim 1, wherein the numerical control device is a control device for controlling a control operation of the control unit.

10. A computer controls a machine tool that moves a tool attached to a spindle and a workpiece fixed to a worktable relative to each other to machine the workpiece, an acquiring step of acquiring torque of a motor which is a drive source of a mechanism for mounting the tool on the spindle at a predetermined time during an operation of mounting the tool; an interpolation step of generating a second torque by interpolating the first torque acquired in the acquisition step; a differentiation calculation step of differentiating an interpolated torque including the first torque acquired in the acquisition step and the second torque interpolated in the interpolation step; a determination step of determining, as peak information, displacement information indicating a position or an angle of the mounting mechanism corresponding to a maximum or minimum value among the differential values ​​calculated in the differential calculation step; a storage step of storing the peak information determined in the determination step in association with a number of uses or a duration of use of the tool with respect to the spindle; a statistical processing step for performing statistical processing based on the peak information stored in the storage step; a determination step of determining a mounting state of the tool with respect to the spindle based on the statistical values ​​obtained by the statistical processing step; A control program for executing the above.

11. A computer controls a machine tool that moves a tool attached to a spindle and a workpiece fixed to a worktable relative to each other to machine the workpiece, an acquiring step of acquiring torque of a motor which is a drive source of a mechanism for mounting the tool on the spindle at a predetermined time during an operation of mounting the tool; an interpolation step of generating a second torque by interpolating the first torque acquired in the acquisition step; a differentiation calculation step of differentiating an interpolated torque including the first torque acquired in the acquisition step and the second torque interpolated in the interpolation step; a determination step of determining, as peak information, displacement information indicating a position or an angle of the mounting mechanism corresponding to a maximum or minimum value among the differential values ​​calculated in the differential calculation step; a storage step of storing the peak information determined in the determination step in association with a number of uses or a duration of use of the tool with respect to the spindle; a statistical processing step for performing statistical processing based on the peak information stored in the storage step; a determination step of determining a mounting state of the tool with respect to the spindle based on the statistical values ​​obtained by the statistical processing step; A storage medium that stores a numerical control program for executing the above.

Citation Information

Patent Citations

  • Machine tool

    JP2002200542A

  • Numerical value control device, numerical value control program, and memory medium

    JP2009178795A

  • Numerical control machine tool and tool exchanging method therefor

    JP2010234450A

  • Numerical control device and control method

    JP2017049642A

  • Numerical control device and attachment judging method

    JP2018205891A