Control device, control method, control program, and medium

By synchronizing and asynchronizing motor controls for spindle rotation and feed in tap processing, the control device enhances processing speed and efficiency in tap operations.

JP2026105945APending Publication Date: 2026-06-29BROTHER KOGYO KK

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
BROTHER KOGYO KK
Filing Date
2024-12-17
Publication Date
2026-06-29

AI Technical Summary

Technical Problem

Existing tap processing methods are limited by the restriction of spindle rotation speed, which in turn restricts the feed motor speed, preventing an increase in processing speed.

Method used

A control device and method that synchronizes and asynchronizes motor controls to allow for accelerated movement and rotation of the spindle, enabling faster tap processing by varying motor speeds and accelerations during the tapping process.

Benefits of technology

This approach allows for increased speed and efficiency in tap processing by optimizing the synchronization and asynchronization of motor controls, thereby reducing the time required to complete tapping operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026105945000001_ABST
    Figure 2026105945000001_ABST
Patent Text Reader

Abstract

The present invention provides a control device, control method, control program, and medium for a machine tool that can speed up tapping operations. [Solution] During the tapping process, the numerical control device synchronizes the Z-axis motor and the spindle motor (S11) while the tip of the tool moves from the second position to the third position, and then moves from the third position back to the second position, and accelerates the speed of the first motor so that the absolute value of the acceleration of the Z-axis motor becomes the first acceleration based on the acceleration of the spindle motor (S19). If the numerical control device determines that the tip of the tool has reached the second position while the Z-axis motor and the spindle motor are synchronized (S17:YES), it releases the synchronization between the Z-axis motor and the spindle motor (S21) and accelerates the speed of the Z-axis motor so that the absolute value of the acceleration of the Z-axis motor becomes an acceleration greater than or equal to the first acceleration (S23).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a control device, a control method, a control program, and a medium for controlling a machine tool.

Background Art

[0002] In the case of performing tap processing for forming a female screw on a workpiece, a technique for synchronizing the rotational operation and the feed operation of the spindle has been proposed. In the screw processing device described in Patent Document 1, the feed system for moving the spindle head up and down is controlled based on a feed command value. On the other hand, the rotation system for rotating the spindle head is controlled based on a rotation command value corrected by a feed deviation corresponding to the feed speed of the spindle head. Thereby, the rotational operation of the spindle head is synchronized with the feed operation.

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] When the rotational operation and the feed operation of the spindle are driven synchronously during tap processing, if the speed increase of the rotation motor for rotating the spindle is restricted, the speed increase of the feed motor for feeding the spindle is also restricted. In this case, since the speed when feeding the spindle cannot be increased, there is a problem that tap processing cannot be speeded up.

[0005] An object of the present invention is to provide a control device, a control method, a control program, and a medium for a machine tool capable of speeding up tap processing.

Means for Solving the Problems

[0006] A control device according to a first aspect of the present invention is a control device for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, wherein the control device controls the first motor and the second motor to rotate the tool in a first direction while relatively moving the tip of the tool from a first position through a second position to a third position, and then rotates the tool in a second direction opposite to the first direction while relatively moving the tip from the third position through the second position to the first position, thereby performing the tapping, wherein the first position is a position away from the workpiece in the axial direction, the third position is the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position, and the control device controls the tip to move from the second position to the third position during the tapping process, and then the tip moves from the third position to the third position The invention is characterized by the following: a first control process which, while moving to a second position, synchronizes the first motor and the second motor and performs at least one of a first speed control which accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control which accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration; a first determination process which, in the process of the tip moving from the third position toward the first position, determines whether or not the tip has reached the second position; and, with the first motor and the second motor synchronized by the first control process, if the first determination process determines that the tip has reached the second position, the synchronization of the first motor and the second motor is released and a second control process which performs at least one of a second speed control which accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes greater than the first speed, and a second acceleration control which accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes greater than the first acceleration.

[0007] The control device according to the first embodiment can perform tapping on a workpiece by executing a first control process in which the first motor and the second motor are synchronized. Furthermore, when the tip of the tool reaches the second position, the control device releases the synchronization between the first motor and the second motor and executes at least one of a second speed control and a second acceleration control. This allows the speed at which the table and spindle move relative to each other to be increased. Therefore, the control device can shorten the time required to complete the tapping and increase the speed of the tapping.

[0008] In the first embodiment, the first control process may further include a second determination process that determines whether it is the right timing to start decelerating the first motor in order to stop the relative movement of the table and the spindle when the tip of the tool reaches the first position during the process in which the tip moves from the third position toward the first position, and a third control process that, with the synchronization between the first motor and the second motor released, controls the deceleration of the speed of the first motor if the second determination process determines that the timing is correct. The control device can increase the speed of the relative movement of the table and the spindle when it stops the relative movement of the table and the spindle when the tip of the tool reaches the first position.

[0009] In the first embodiment, the third control process may further perform a third acceleration control that controls the speed of the first motor to decelerate such that the absolute value of the acceleration of the first motor is greater than the first acceleration. The control device can increase the relative movement of the table and spindle when it stops the relative movement of the table and spindle when the tip of the tool reaches the first position.

[0010] In the first embodiment, if the speed of the first motor reaches the second speed before the second determination process determines that the timing is met, the second control process may maintain the speed of the first motor at the second speed, and the third control process may decelerate the first motor from the second speed. The control device can maximize the relative speed of the table and spindle when it stops the relative movement of the table and spindle when the tip of the tool reaches the first position.

[0011] In the first embodiment, the third control process may, when the second determination process determines that the timing is met, control the first motor to decelerate from the third speed if the speed of the first motor is a third speed that is lower than the second speed. The control device can appropriately increase the relative speed of the table and spindle when it stops the relative movement of the table and spindle when the tip of the tool reaches the first position.

[0012] In a first embodiment, the control unit may further perform a second determination process to determine whether it is time to start decelerating the first motor in order to stop the relative movement of the table and the spindle when the tip of the tool reaches the first position, and a fourth control process to perform a fourth acceleration control in which, if the second determination process determines that it is the right timing, the first motor and the second motor are synchronized, and the speed of the first motor is decelerated so that the absolute value of the acceleration of the first motor becomes the first acceleration. The control device can stop the relative movement of the table and the spindle when the tip of the tool reaches the first position.

[0013] In the first embodiment, if the control unit determines, based on the first determination process, that the tip has reached the second position while the speed of the first motor has been decelerated by the fourth control process, it may further execute a fifth control process, which involves releasing the synchronization between the first motor and the second motor and executing a fifth acceleration control to accelerate the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. The control device can increase the speed at which the table and spindle move relative to each other. Therefore, the control device can shorten the time required to complete the tapping process and speed up the tapping process.

[0014] In the first embodiment, the control unit may, after the fifth control process has released the synchronization between the first motor and the second motor, and if the second determination process determines that the timing is met, further execute a sixth acceleration control that decelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. The control device can increase the relative movement of the table and the spindle when it stops the relative movement of the tool and the table when the tip of the tool reaches the first position.

[0015] In the first embodiment, the control unit may, while the first control process has synchronized the first motor and the second motor, if the first determination process determines that the tip has reached the second position, it may further execute a seventh control process which involves releasing the synchronization between the first motor and the second motor and performing a seventh acceleration control to decelerate the speed of the second motor so that the absolute value of the acceleration of the second motor is greater than the first acceleration. This allows the control device to shorten the time required to decelerate the spindle.

[0016] In the first embodiment, the first control process may synchronize the first motor and the second motor by controlling the first motor in accordance with a first command for controlling the first motor and controlling the second motor in accordance with a second command determined based on feedback information of the first motor. By synchronizing the second motor with the first motor, the control device can synchronize the relative movement of the table and spindle with the rotation of the spindle.

[0017] In the first embodiment, the first control process may synchronize the first motor and the second motor by controlling the second motor in accordance with a second command for controlling the second motor, and by controlling the first motor in accordance with a first command determined based on feedback information of the second motor. As a result, the control device can synchronize the relative movement of the table and spindle with the rotation of the spindle by synchronizing the first motor with the second motor.

[0018] In the first embodiment, the first control process may synchronize the first motor and the second motor by controlling the first motor in accordance with a first command for controlling the first motor and controlling the second motor in accordance with a second command determined based on the first command. By synchronizing the first motor and the second motor, the control device can synchronize the relative movement of the table and spindle with the rotation of the spindle.

[0019] In the first embodiment, the first control process may synchronize the first motor and the second motor by controlling the second motor in accordance with a second command for controlling the second motor, and by controlling the first motor in accordance with a first command determined based on the second command. By synchronizing the first motor and the second motor, the control device can synchronize the relative movement of the table and spindle with the rotation of the spindle.

[0020] A control method according to a second aspect of the present invention is a control method for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, wherein by controlling the first motor and the second motor, the tip of the tool is moved relatively from a first position to a third position via a second position while rotating the tool in a first direction, and then the tip is moved relatively from the third position to the first position via a second position while rotating the tool in a second direction opposite to the first direction, thereby performing the tapping, wherein the first position is a position away from the workpiece in the axial direction, the third position is the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position, and during the process of tapping, the tip moves from the second position to the third position, and then while the tip moves from the third position to the second position... The invention is characterized by comprising: a first control step of synchronizing the first motor and the second motor and performing at least one of a first speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration; a first determination step of determining whether the tip has reached the second position in the process of the tip moving from the third position toward the first position as a result of the first control step; and a second control step of releasing the synchronization between the first motor and the second motor and performing at least one of a second speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes greater than the first speed, and a second acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes greater than the first acceleration, if the first determination step determines that the tip has reached the second position while the first motor and the second motor are synchronized as a result of the first control step. According to the second embodiment, the same effects as those of the first embodiment can be achieved.

[0021] A control program according to a third aspect of the present invention is a control program for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, wherein by controlling the first motor and the second motor, the tip of the tool is moved relatively from a first position to a third position via a second position while rotating the tool in a first direction, and then the tip is moved relatively from the third position to the first position via a second position while rotating the tool in a second direction opposite to the first direction, thereby performing the tapping, wherein the first position is a position away from the workpiece in the axial direction, the third position is the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position, and during the tapping process the tip moves from the second position to the third position, and then the tip moves from the third position to the second position While moving, the first motor and the second motor are synchronized, and the computer is instructed to perform at least one of a first speed control, which accelerates the speed of the first motor so that the absolute value of the speed of the first motor is a first speed, and a first acceleration control, which accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is a first acceleration; a first determination step, which determines whether the tip has reached the second position in the process of the tip moving from the third position toward the first position as a result of the first control step; and a second control step, which, if the first determination step determines that the tip has reached the second position while the first motor and the second motor are synchronized as a result of the first control step, releases the synchronization between the first motor and the second motor, and performs at least one of a second speed control, which accelerates the speed of the first motor so that the absolute value of the speed of the first motor is greater than the first speed, and a second acceleration control, which accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. According to the third embodiment, the same effects as those of the first embodiment can be achieved.

[0022] A medium according to a fourth aspect of the present invention is a medium storing a control program for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, wherein by controlling the first motor and the second motor, the tip of the tool is moved relatively from a first position to a third position via a second position while rotating the tool in a first direction, and then the tip is moved relatively from the third position to the first position via a second position while rotating the tool in a second direction opposite to the first direction, thereby performing the tapping, wherein the first position is a position away from the workpiece in the axial direction, the third position is the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position, and during the tapping process the tip moves from the second position to the third position, and then the tip moves from the third position to the second position. During this time, the system stores a program that causes the computer to execute a first control step which synchronizes the first motor and the second motor and performs at least one of a first speed control which accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control which accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration; a first determination step which determines whether the tip has reached the second position during the process in which the tip moves from the third position toward the first position as a result of the first control step; and a second control step which, if the first determination step determines that the tip has reached the second position while the first motor and the second motor are synchronized as a result of the first control step, releases the synchronization of the first motor and the second motor and performs at least one of a second speed control which accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes greater than the first speed, and a second acceleration control which accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes greater than the first acceleration. According to the fourth embodiment, the same effects as those of the first embodiment can be achieved.

Brief Description of the Drawings

[0023] [Figure 1] It is a diagram showing an overview of the machine tool 10. [Figure 2] It is a block diagram showing the electrical configuration of the machine tool 10 and the numerical control device 20. [Figure 3] It is an explanatory diagram of tapping. [Figure 4] It is an explanatory diagram of the first synchronous control and the first asynchronous control. [Figure 5] It is a flowchart of the first feed process. [Figure 6] It is a flowchart of the first acceleration / deceleration process. [Figure 7] It is a flowchart of the second acceleration / deceleration process. [Figure 8] It is a flowchart of the first rotation process. [Figure 9] It is the first graph showing the speed and acceleration of the Z-axis motor 11 and the spindle motor 12. [Figure 10] It is the second graph showing the speed and acceleration of the Z-axis motor 11 and the spindle motor 12. [Figure 11] It is the third graph showing the speed and acceleration of the Z-axis motor 11 and the spindle motor 12. [Figure 12] It is an explanatory diagram of the second synchronous control and the second asynchronous control. [Figure 13] It is a flowchart of the second feed process. [Figure 14] It is a flowchart of the second rotation process. [Figure 15] It is a flowchart of the fifth acceleration / deceleration process. [Figure 16] It is an explanatory diagram of the third synchronous control and the third asynchronous control. [Figure 17] It is an explanatory diagram of the fourth synchronous control and the fourth asynchronous control.

Modes for Carrying Out the Invention

[0024] The machine tool 10 shown in Figure 1 performs cutting and other operations on a workpiece W on a table 50 using a tool 4 mounted on the spindle 9. The numerical control device 20 shown in Figure 2 controls the operation of the machine tool 10.

[0025] The front, rear, left, right, top, and bottom of the machine tool 10 correspond to the left, right, far side, near side, top, and bottom of Figure 1, respectively. The left-right, front-back, and up-down directions of the machine tool 10 are the X-axis, Y-axis, and Z-axis directions, respectively.

[0026] As shown in Figure 1, the machine tool 10 includes a base 2, a vertical column 5, a spindle head 7, a spindle 9, a workbench device 40, and an operation panel 16 as shown in Figure 2. In the machine tool 10, the table 50 of the workbench device 40 moves in two axial directions, the X axis and the Y axis.

[0027] Base 2 is the base of the machine tool 10. The vertical column 5 is fixed to the rear upper surface of base 2. The spindle head 7 moves along the front of the vertical column 5 in the Z-axis direction.

[0028] The vertical column 5 is equipped with a Z-axis movement mechanism on its front. The Z-axis movement mechanism is driven by the Z-axis motor 11 shown in Figure 2. The Z-axis movement mechanism has the same structure as the Y-axis movement mechanism, which will be described later.

[0029] The spindle 9 is rotatably positioned inside the spindle head 7. The tool 4 is mounted in a tool mounting hole located at the lower end of the spindle 9. The tool 4 rotates in response to the rotation of the spindle 9, which is driven by the spindle motor 12 shown in Figure 2.

[0030] The workbench device 40 is positioned on the upper surface of the base 2 and below the spindle head 7. The workbench device 40 supports the table 50 so that it can move in two directions, the X-axis and the Y-axis. In Figure 1, only the Y-axis movement mechanism for moving the table 50 in the Y-axis direction is shown for the workbench device 40, and the X-axis movement mechanism is omitted.

[0031] The workbench device 40 includes a bed 41, a Y-axis rail 42, a Y-axis motor 14, a coupling 43, a ball screw 44, a bearing section 45, a nut 46, a table 50, etc. The bed 41, Y-axis rail 42, Y-axis motor 14, coupling 43, ball screw 44, bearing section 45, and nut 46 constitute the Y-axis movement mechanism.

[0032] The bed 41 is installed on the upper surface of the base 2. The bed 41 has a recess in the center in the left-right direction that is long in the Y-axis direction, and most of the Y-axis movement mechanism is housed inside the recess.

[0033] The Y-axis rail 42 is positioned above the bed 41 and extends in the Y-axis direction. The Y-axis rail 42 guides the table 50 so that it can move in the Y-axis direction. The Y-axis motor 14 is positioned on the rear side of the recess of the bed 41.

[0034] The ball screw 44 is positioned inside the recess of the bed 41 and extends in the Y-axis direction. The coupling 43 connects the output shaft of the Y-axis motor 14 to the rear end of the ball screw 44. The bearing 45 rotatably supports the front end of the ball screw 44. Therefore, when the output shaft of the Y-axis motor 14 rotates, the ball screw 44 rotates via the coupling 43.

[0035] The nut 46 is fixed to the underside of the table 50 and screws onto the ball screw 44. Therefore, as the ball screw 44 rotates, the table 50 moves in the Y-axis direction together with the nut 46.

[0036] The workbench device 40 includes an X-axis movement mechanism in addition to a Y-axis movement mechanism. The X-axis movement mechanism supports the Y-axis movement mechanism so that it can move in the X-axis direction. The X-axis movement mechanism has the same structure as the Y-axis movement mechanism and is driven by the X-axis motor 13 shown in Figure 2.

[0037] As shown in Figure 2, the control panel 16 includes an input unit 17 and a display unit 18. The input unit 17 is a device for performing various inputs, instructions, settings, etc. The display unit 18 is a device for displaying various screens.

[0038] The numerical control device 20 includes a CPU 21, ROM 22, RAM 23, storage device 24, input / output unit 25, drive circuits 26-29, etc.

[0039] The CPU 21 provides overall control over the numerical control unit 20. The ROM 22 stores the program and settings for the CPU 21 to execute processes. The RAM 23 stores various data during the execution of various processes. The storage device 24 is a non-volatile memory that stores the NC program as well as various parameters.

[0040] The NC program describes the operation of the machine tool 10 using multiple control commands written in a predetermined programming language. Each control command is a command for positioning the tool 4 during the cutting process performed by the machine tool 10.

[0041] The input / output unit 25 is connected to the control panel 16, CPU 21, ROM 22, RAM 23, storage device 24, and drive circuits 26-29. Drive circuits 26-29 are servo amplifiers. Drive circuits 26-29 are collectively referred to as drive circuit 30.

[0042] The Z-axis motor 11 is equipped with an encoder 11A. The spindle motor 12 is equipped with an encoder 12A. The X-axis motor 13 is equipped with an encoder 13A. The Y-axis motor 14 is equipped with an encoder 14A.

[0043] The drive circuit 26 is connected to the Z-axis motor 11 and encoder 11A. The drive circuit 27 is connected to the spindle motor 12 and encoder 12A. The drive circuit 28 is connected to the X-axis motor 13 and encoder 13A. The drive circuit 29 is connected to the Y-axis motor 14 and encoder 14A.

[0044] The Z-axis motor 11, spindle motor 12, X-axis motor 13, and Y-axis motor 14 are collectively referred to as motor 15. Encoders 11A to 14A are collectively referred to as encoder 15A.

[0045] The CPU 21 reads the NC program stored in the memory device 24. Based on the control commands of the read NC program, the CPU 21 transmits a drive signal to the drive circuit 30 to position the tool 4 at the target position. The drive circuit 30 outputs a drive current to the corresponding motor 15 according to the drive signal received from the CPU 21. The drive circuit 30 receives a feedback signal from the encoder 15A and controls the position and speed of the motor 15.

[0046] We will explain this in detail using the example of moving tool 4 in the Z-axis direction relative to workpiece W during machining. The same applies when moving tool 4 in the X-axis direction, Y-axis direction, or when rotating tool 4.

[0047] When the CPU 21 reads an NC program command, it moves the spindle 9 to the position specified by the command, and generates time-series data of the target position of the spindle 9. The position specified by the command is called the command position. The CPU 21 outputs the target position data to the drive circuit 26 at a predetermined period. The drive circuit 26 drives the Z-axis motor 11 based on the target position data output from the CPU 21. The Z-axis motor 11 moves the tool 4 to the target position in the Z-axis direction via the spindle 9.

[0048] Each time the CPU 21 inputs target position data to the drive circuit 26, the drive circuit 26 drives the Z-axis motor 11. As a result, the tool 4 eventually reaches the commanded position.

[0049] When the CPU 21 generates time-series data of target positions, it first determines each target position such that the speed of the tool 4 as it moves in the Z-axis direction to the commanded position remains constant. The waveform that shows the time-series change in speed is called the speed waveform. Next, the CPU 21 adjusts the acceleration and deceleration characteristics that correspond to the rising and falling characteristics of the speed waveform. The process of adjusting the acceleration and deceleration characteristics is called the acceleration and deceleration process.

[0050] The CPU 21 determines the target position at predetermined intervals based on the speed waveform obtained by the acceleration and deceleration process. The CPU 21 outputs the data of the determined target position to the drive circuit 26 at predetermined intervals.

[0051] The machine tool 10 is capable of performing tapping to form an internal thread in the workpiece W. The CPU 21 controls the Z-axis motor 11 and the spindle motor 12 to drive the tool 4 as follows, thereby performing the tapping operation.

[0052] In Figure 3, the first position P1 is a position located above the workpiece W. The third position P3 is the depth position of the workpiece W in the Z-axis direction. The second position P2 is located above the workpiece W and is between the first position P1 and the third position P3 in the Z-axis direction.

[0053] The CPU 21 moves the tip of the tool 4 downward from the first position P1, through the second position P2, to the third position P3. While the tip of the tool 4 moves from the second position P2 to the third position P3, the CPU 21 rotates the tool 4 in a predetermined first direction Y1. Then, the CPU 21 moves the tip of the tool 4 from the third position P3, through the second position P2, back to the first position P1. While the tip of the tool 4 moves from the third position P3 to the second position P2, the CPU 21 rotates the tool 4 in a second direction Y2, opposite to the first direction Y1. As a result, tapping is performed and a female thread is formed in the workpiece W.

[0054] The first position P1 is the position of the tool 4 in the Z-axis direction. Alternatively, the first position P1 may be the position of the tool 4 in the Z-axis direction when the spindle 9 begins to move relative to the table 50 in at least one of the X-axis and Y-axis directions after the completion of tapping, or the first position P1 may be the position of the tool 4 in the Z-axis direction when the next tapping operation begins after the completion of the previous tapping operation.

[0055] The rotation of tool 4 in the second direction Y2 is stopped at a predetermined stop timing Ts after tapping. The stop timing Ts may be any timing between the end of tapping and the time tool 4 is attached to or detached from the spindle 9 by the tool changer of the machine tool 10. Alternatively, the stop timing Ts may be any timing between the end of tapping and the start of the next tapping operation.

[0056] During the tapping process, the tip of the tool 4 moves downward from the second position P2 to the third position P3, and then upward from the third position P3 to the second position P2. During this time, it is necessary to synchronize the movement of the spindle 9 in the Z-axis direction with the rotation of the spindle 9. The control that synchronizes the Z-axis motor 11 and the spindle motor 12 in order to synchronize the movement of the spindle 9 in the Z-axis direction with the rotation of the spindle 9 is called synchronous control.

[0057] On the other hand, after the tip of the tool 4 moves to the second position P2, synchronous control is not required until it moves further upward to the first position P1. Control that does not synchronize the Z-axis motor 11 and the spindle motor 12 is called asynchronous control.

[0058] The CPU 21 performs a first synchronous control that synchronizes the spindle motor 12 with the Z-axis motor 11, and a first asynchronous control that does not synchronize the spindle motor 12 with the Z-axis motor 11.

[0059] The switch 55 in Figure 4 switches between a state in which the synchronous control unit 53 and the drive circuit 27 are connected and the spindle acceleration / deceleration processing unit 54 and the drive circuit 27 are disconnected, and a state in which the synchronous control unit 53 and the drive circuit 27 are disconnected and the spindle acceleration / deceleration processing unit 54 and the drive circuit 27 are connected. When the first synchronous control is executed, the switch 55 is switched to a state in which the synchronous control unit 53 and the drive circuit 27 are connected and the spindle acceleration / deceleration processing unit 54 and the drive circuit 27 are disconnected. The CPU 21 uses the command analysis unit 51 to analyze the command for moving the spindle 9 in the Z-axis direction from the NC program. The command for moving the spindle 9 in the Z-axis direction is called a feed command. Based on this, the command analysis unit 51 generates time-series data of the target position.

[0060] Next, the CPU 21 performs acceleration and deceleration processing on the time-series data of the generated target position using the Z-axis acceleration / deceleration processing unit 52, and determines the target position at predetermined intervals. Then, the CPU 21 outputs the determined target position data from the Z-axis acceleration / deceleration processing unit 52 to the drive circuit 26 at predetermined intervals.

[0061] The drive circuit 26 drives the Z-axis motor 11 based on the target position data output from the Z-axis acceleration / deceleration processing unit 52. As a result, the tool 4 mounted on the spindle 9 moves in the Z-axis direction.

[0062] The CPU 21 obtains the rotation angle of the Z-axis motor 11 detected by the encoder 11A via the synchronous control unit 53. Based on the rotation angle of the Z-axis motor 11, the synchronous control unit 53 determines a rotation command to rotate the spindle 9. For example, the rotation command is a command to rotate the spindle 9 at a speed obtained by multiplying the speed of the Z-axis motor 11 by a predetermined synchronous ratio. The synchronous control unit 53 determines a target angle for the spindle 9 according to the determined rotation command. Next, the CPU 21 outputs the data of the determined target angle from the synchronous control unit 53 to the drive circuit 27.

[0063] The drive circuit 27 drives the spindle motor 12 based on the target angle data output from the synchronous control unit 53. As a result, the tool 4 mounted on the spindle 9 rotates in sync with the movement of the spindle 9 in the Z-axis direction.

[0064] When the tip of tool 4 moves from the third position P3 to the second position P2, the first synchronous control ends and the first asynchronous control begins. Switch 55 is switched so that the synchronous control unit 53 and the drive circuit 27 are disconnected, and the spindle acceleration / deceleration processing unit 54 and the drive circuit 27 are connected.

[0065] The CPU 21 performs acceleration and deceleration processing on the time-series data of the target position using the Z-axis acceleration / deceleration processing unit 52. The target position subject to acceleration and deceleration processing is the position at which the movement of the spindle 9 is stopped when the tip of the tool 4 reaches the first position P1. Next, the CPU 21 outputs the target position data determined by the acceleration and deceleration processing from the Z-axis acceleration / deceleration processing unit 52 to the drive circuit 26 at a predetermined period.

[0066] The drive circuit 26 drives the Z-axis motor 11 based on the target position data output from the Z-axis acceleration / deceleration processing unit 52. As a result, the tool 4 mounted on the spindle 9 moves upward while decelerating, and stops when the tip reaches the first position P1.

[0067] Furthermore, the CPU 21 acquires the rotation angle and acceleration of the spindle motor 12 immediately before switching to the first asynchronous control. Based on the acquired rotation angle and acceleration, the CPU 21 executes acceleration / deceleration processing using the spindle acceleration / deceleration processing unit 54. The target of the acceleration / deceleration processing is time-series data of the target angle for stopping the rotation of the spindle 9. Next, the CPU 21 outputs the target angle data determined by the acceleration / deceleration processing from the spindle acceleration / deceleration processing unit 54 to the drive circuit 27 at a predetermined period.

[0068] The drive circuit 27 drives the spindle motor 12 asynchronously with the Z-axis motor 11 based on the target angle data output from the spindle acceleration / deceleration processing unit 54. As a result, the tool 4 connected to the spindle 9 rotates while decelerating asynchronously with the movement of the tool 4 in the Z-axis direction, and stops at the stop timing Ts.

[0069] The first asynchronous control is effective when the rotation of the Z-axis motor 11 is constrained by the driving conditions of the spindle motor 12 in the first synchronous control. Details are as follows.

[0070] Typically, the acceleration constraints for the spindle motor 12 are often stricter than those for the Z-axis motor 11. Furthermore, the acceleration of the spindle motor 12 may be restricted to extend the lifespan of the tool 4 or to prevent overheating of the spindle motor 12.

[0071] When the first synchronous control is performed, the acceleration of the Z-axis motor 11 must be limited according to the constraints of the acceleration of the spindle motor 12. When the acceleration of the Z-axis motor 11 is limited, the movement of the spindle 9 slows down, and the time required to move the tip of the tool 4 to the first position P1 increases.

[0072] On the other hand, when the tip of the tool 4 moves from the third position P3 to the second position P2, the first synchronous control is terminated and the first asynchronous control is started. This allows the CPU 21 to drive the Z-axis motor 11 asynchronously with the spindle motor 12. By rotating the Z-axis motor 11 at high speed after the start of the first asynchronous control, the CPU 21 can reduce the time required to move the tip of the tool 4 to the first position P1.

[0073] The first feed process will be explained with reference to Figures 5 to 7. The first feed process is performed to control the Z-axis motor 11 during tapping. The first feed process is started when the CPU 21 reads and executes the program for the first feed process stored in the ROM 22.

[0074] The CPU 21 switches the switch 55 in Figure 4 and starts the first synchronous control (S11). The CPU 21 controls the Z-axis motor 11 to move the tip of the tool 4 from the second position P2 to the third position P3 (S13).

[0075] After the tip of the tool 4 reaches the third position P3, the CPU 21 controls the Z-axis motor 11 to move the tip of the tool 4 upward from the third position P3 (S15, see Figures 9-11). At this time, the CPU 21 accelerates the speed of the Z-axis motor 11 so that the acceleration value is Az(1).

[0076] As shown in Figures 9 to 11, Az(1) is the maximum acceleration when the Z-axis motor 11 rotates under conditions constrained by the drive conditions of the main shaft motor 12 by the first synchronous control.

[0077] As shown in Figure 5, the CPU 21 determines whether the tip of the tool 4 has reached the second position P2 based on the rotation angle of the Z-axis motor 11 detected by the encoder 11A (S17). If the CPU 21 determines that the tip of the tool 4 has not reached the second position P2 (S17:NO), it executes the first acceleration / deceleration process shown in Figure 6 (S19).

[0078] Referring to Figure 6, the first acceleration / deceleration process will be explained. The CPU 21 determines the position of the tip of the tool 4 when deceleration is completed, after decelerating the speed of the Z-axis motor 11 by Az(1) from the current speed. The current speed of the Z-axis motor 11 is called the current speed. The position of the tip of the tool 4 when deceleration is completed is called the deceleration completion position. The CPU 21 determines whether the deceleration completion position exceeds the first position P1 above when the speed of the Z-axis motor 11 is decelerated by Az(1) from the current speed (S31). When the deceleration completion position of the tip of the tool 4 moves above the first position P1, it is called the tool 4 overrunning.

[0079] The position at which deceleration is complete when the vehicle decelerates from its current velocity Vz to a stop using acceleration Az can be calculated as follows: First, the distance L0 traveled from velocity Vz to a stop using acceleration Az is given by the equation "L0 = Vz 2 This is calculated using " / 2Az". Here, if we denote the current position as P, the position obtained by adding L0 to P, "P+L0", is the position where deceleration is complete.

[0080] The current speed is called the current speed. If CPU 21 determines that tool 4 will not overrun (S31: NO), it proceeds to S35.

[0081] The CPU 21 determines whether the speed of the Z-axis motor 11 is less than Vz(1) (S35). As shown in Figures 9 to 11, Vz(1) is the maximum speed when the Z-axis motor 11 rotates under conditions constrained by the drive conditions of the spindle motor 12 by the first synchronous control.

[0082] As shown in Figure 6, if the CPU 21 determines that the speed of the Z-axis motor 11 is less than Vz(1) (S35:YES), the process proceeds to S37. After accelerating the Z-axis motor 11, the CPU 21 determines whether the tool 4 will overrun when decelerated at Az(1) (S37). If the CPU 21 determines that the tool 4 will not overrun (S37:NO), the process proceeds to S39.

[0083] The CPU 21 continuously accelerates the Z-axis motor 11 so that its acceleration value becomes Az(1) (S39, see Figures 9 to 11). The CPU 21 finishes the first acceleration / deceleration process and returns to the first feed process shown in Figure 5.

[0084] If the CPU 21 determines that the speed value of the Z-axis motor 11 matches Vz(1) (S35: NO), it proceeds to S41. The CPU 21 maintains the Z-axis motor 11 at the current speed (S41, see Figures 9 to 11). The CPU 21 returns to the first feed process shown in Figure 5.

[0085] If the CPU 21 determines that the tool 4 will overrun when the Z-axis motor 11 is accelerated and then decelerated by Az(1) (S37:YES), it proceeds to S43. The CPU 21 maintains the Z-axis motor 11 at the current speed (S43). The CPU 21 returns to the first feed process shown in Figure 5. In this case, it is determined that the tool 4 will overrun in the next first acceleration / deceleration process, S31 (S31:YES).

[0086] As shown in Figure 5, after the completion of the first acceleration / deceleration process (S19), the CPU 21 returns to process S17. The CPU 21 repeatedly executes the first acceleration / deceleration process until the tip of the tool 4 reaches the second position P2.

[0087] As shown in Figure 6, if the CPU 21 determines that the tool 4 will overrun when the speed of the Z-axis motor 11 is reduced by Az(1) from its current speed (S31: YES), the process proceeds to S33. The CPU 21 reduces the speed of the Z-axis motor 11 so that the acceleration value becomes -Az(1) (S33, see Figure 11). The CPU 21 returns the process to the first feed process shown in Figure 5.

[0088] As shown in Figure 5, if the CPU 21 determines that the tip of the tool 4 has reached the second position P2 (S17: YES), it proceeds to S21. The CPU 21 switches the switch 55 in Figure 4 and starts the first asynchronous control (S21). The CPU 21 executes the second acceleration / deceleration process in Figure 7 (S23).

[0089] Referring to Figure 7, the second acceleration / deceleration process will be explained. The CPU 21 determines whether the tool 4 will overrun when the speed of the Z-axis motor 11 is reduced from the current speed by Az(2) (S51). If the CPU 21 determines that the tool 4 will not overrun (S51: NO), the process proceeds to S55.

[0090] The CPU 21 determines whether the speed of the Z-axis motor 11 is less than Vz(2) (S55). As shown in Figures 9 and 10, Vz(2) is the maximum speed when the Z-axis motor 11 rotates without being constrained by the driving conditions of the spindle motor 12. Vz(2) is greater than Vz(1).

[0091] As shown in Figure 7, if the CPU 21 determines that the speed of the Z-axis motor 11 is less than Vz(2) (S55: YES), it proceeds to S57. After accelerating the Z-axis motor 11, the CPU 21 determines whether the tool 4 will overrun when decelerated by Az(2) (S57). As shown in Figures 9 and 10, Az(2) is the maximum acceleration when the Z-axis motor 11 rotates without being constrained by the driving conditions of the spindle motor 12. Az(2) is greater than Az(1).

[0092] As shown in Figure 7, if the CPU 21 determines that the tool 4 will not overrun (S57: NO), it proceeds to process S59.

[0093] The CPU 21 accelerates the Z-axis motor 11 so that its acceleration value becomes Az(2) (S59, see Figures 9 to 11). The CPU 21 finishes the second acceleration / deceleration process and returns the process to the first feed process shown in Figure 5.

[0094] For example, in S41 of Figure 6, the Z-axis motor 11 is maintained at its current speed, and in S17 of Figure 5, it is determined that the tip of the tool 4 has reached the second position P2 (S17: YES). In this case, in S59 of Figure 7, the Z-axis motor 11 is accelerated from Vz(1), as shown in Figures 9 and 10.

[0095] Furthermore, for example, in S33 of Figure 6, the speed of the Z-axis motor 11 is reduced, and in S17 of Figure 5, it is determined that the tip of the tool 4 has reached the second position P2 (S17: YES). In this case, in S59 of Figure 7, as shown in Figure 11, the Z-axis motor 11, which was decelerating, stops decelerating and accelerates.

[0096] As shown in Figure 7, if the CPU 21 determines that the speed value of the Z-axis motor 11 matches Vz(2) (S55: NO), it proceeds to S61. The CPU 21 maintains the Z-axis motor 11 at the current speed (S61, see Figure 9). The CPU 21 returns to the first feed process shown in Figure 5.

[0097] If the CPU 21 determines that the tool 4 will overrun when the Z-axis motor 11 is accelerated and then decelerated by Az(2) (S57:YES), it proceeds to S63. The CPU 21 maintains the Z-axis motor 11 at the current speed (S63). The CPU 21 returns to the first feed process shown in Figure 5. In this case, it is determined that the tool 4 will overrun in the next second acceleration / deceleration process, S51 (S51:YES).

[0098] As shown in Figure 5, after the completion of the second acceleration / deceleration process (S23), the CPU 21 proceeds to S25. Based on the rotation angle of the Z-axis motor 11 detected by the encoder 11A, the CPU 21 determines whether the tip of the tool 4 mounted on the spindle 9 has reached the first position P1 (S25). If the CPU 21 determines that the tip of the tool 4 has not reached the first position P1 (S25: NO), it returns to S23. The CPU 21 repeatedly executes the second acceleration / deceleration process until the tip of the tool 4 reaches the first position P1.

[0099] As shown in Figure 7, if the CPU 21 determines that the tool 4 will overrun when the speed of the Z-axis motor 11 is reduced by Az(2) from its current speed (S51: YES), the process proceeds to S53. The CPU 21 reduces the speed of the Z-axis motor 11 so that the acceleration value becomes -Az(2) (S53, see Figures 9 to 11). The CPU 21 returns the process to the first feed process shown in Figure 5.

[0100] In this case, at S53, the speed of the Z-axis motor 11 is reduced from Vz(2) as shown in Figure 9.

[0101] Furthermore, for example, in S59, it may be determined that the tool 4 will overrun while the speed of the Z-axis motor 11 is accelerating (S51: YES). In this case, in S53, as shown in Figure 10, the acceleration of the Z-axis motor 11 is stopped when the speed value is Vz(3), which is less than Vz(2). After that, the Z-axis motor 11 is decelerated from Vz(3).

[0102] Furthermore, for example, after the Z-axis motor 11 is decelerated in S33 in Figure 6, there are cases where the tool 4 is determined to have overrun while the Z-axis motor 11 is accelerating in S59 in Figure 7 (S51: YES). In this case, in S53, as shown in Figure 11, the acceleration of the Z-axis motor 11 is stopped when the speed value is Vz(4), which is less than Vz(2). After that, the Z-axis motor 11 is decelerated from Vz(4).

[0103] As shown in Figure 5, if the CPU 21 determines that the tip of the tool 4 has reached the first position P1 (S25: YES), it terminates the first feed process.

[0104] Referring to Figure 8, the first rotation process will be explained. The first rotation process is performed to control the spindle motor 12 during tapping. The first rotation process is started when the CPU 21 reads and executes the program for the first rotation process stored in the ROM 22.

[0105] The CPU 21 switches the switch 55 in Figure 4 and starts the first synchronous control (S71). The CPU 21 controls the spindle motor 12 in synchronization with the Z-axis motor 11 and rotates the tool 4 in the first direction Y1.

[0106] After the tip of the tool 4 reaches the third position P3, the CPU 21 controls the spindle motor 12 in synchronization with the Z-axis motor 11 to rotate the tool 4 in the second direction Y2. At this time, the acceleration of the Z-axis motor 11 is limited by the first acceleration / deceleration process so that the acceleration value of the spindle motor 12 becomes Ar(1). Therefore, by controlling the spindle motor 12 in synchronization with the Z-axis motor 11, the acceleration of the spindle motor 12 is accelerated so that its value becomes Ar(1).

[0107] As shown in Figures 9 to 11, Ar(1) is the maximum acceleration when the main shaft motor 12 rotates under conditions constrained by the drive conditions via the first synchronous control.

[0108] As shown in Figure 8, the CPU 21 determines whether the tip of the tool 4 has reached the second position P2 based on the rotation angle of the Z-axis motor 11 detected by the encoder 11A (S77). If the CPU 21 determines that the tip of the tool 4 has not reached the second position P2 (S77: NO), it returns to S77 and continues the first synchronous control.

[0109] If the CPU 21 determines that the tip of the tool 4 has reached the second position P2 (S77: YES), it proceeds to S81. The CPU 21 switches the switch 55 in Figure 4 and starts the first asynchronous control (S81).

[0110] The CPU 21 acquires the speed and acceleration of the spindle motor 12 at the timing when the first asynchronous control is initiated in S81 (S83). Based on the acquired speed and acceleration, the CPU 21 determines a rotation command to drive the spindle motor 12 and generates target angle data. The CPU 21 drives the spindle motor 12 asynchronously with the Z-axis motor 11 using the generated data. At this time, the CPU 21 decelerates the speed of the spindle motor 12 so that the acceleration value becomes -Ar(1) (S85).

[0111] The CPU 21 determines whether the rotation of the spindle 9 has stopped based on the rotation angle of the spindle motor 12 detected by the encoder 12A (S87). If the rotation of the spindle motor 12 has not stopped, the CPU 21 determines that the rotation of the spindle 9 has not stopped (S87: NO). In this case, the CPU 21 returns to processing S85 and continues to decelerate the spindle motor 12 (S85). If the rotation of the spindle motor 12 has stopped, the CPU 21 determines that the rotation of the spindle 9 has also stopped (S87: YES). The CPU 21 terminates the first rotation process.

[0112] The numerical control device 20 drives the tool 4 by first synchronous control, which synchronizes the spindle motor 12 with the Z-axis motor 11. This allows the numerical control device 20 to perform tapping on the workpiece W (S11-S19).

[0113] Furthermore, when the tip of the tool 4 reaches the second position P2 (S17:YES), the numerical control device 20 performs a first asynchronous control, which does not synchronize the spindle motor 12 with the Z-axis motor 11 (S21). Also, the numerical control device 20 accelerates the Z-axis motor 11 so that its acceleration Az(2) is greater than Az(1).

[0114] This allows the numerical control device 20 to increase the speed at which the spindle 9 moves in the Z-axis direction. Consequently, the numerical control device 20 can shorten the time required to complete the tapping process and speed up the tapping process.

[0115] The numerical control device 20, while in first asynchronous control mode (S21), may determine that the tool 4 is overrunning (S51: YES). In this case, the numerical control device 20 decelerates the Z-axis motor 11 so that the acceleration value becomes -Az(2) (S53). In other words, in S51, the numerical control device 20 determines whether it is time to start decelerating the Z-axis motor 11 in order to stop the movement of the spindle 9 when the tip of the tool 4 reaches the first position P1. This allows the movement of the spindle 9 to be stopped when the tip of the tool 4 reaches the first position P1, while increasing the speed at which the spindle 9 moves in the Z-axis direction.

[0116] Before the numerical control device 20 determines that the tool 4 is overrunning (S31: NO), there are cases where the speed of the Z-axis motor 11 becomes Vz(2) (S55: YES). In this case, the numerical control device 20 maintains the speed of the Z-axis motor 11 at Vz(2). If the numerical control device 20 determines that the tool 4 is overrunning in this state (S51: YES), it decelerates the Z-axis motor 11 so that the acceleration value becomes -Az(2) (S53). This allows the numerical control device 20 to maximize the speed of the spindle 9 when it stops moving the spindle 9 when the tip of the tool 4 reaches the first position P1.

[0117] When the numerical control device 20 determines that the tool 4 is overrunning (S51:YES), the speed of the Z-axis motor 11 may be Vz(3), which is less than Vz(2). In this case, the numerical control device 20 controls the Z-axis motor 11 to decelerate from Vz(3) (S53). This allows the relative movement of the spindle 9 to be appropriately accelerated when the movement of the spindle 9 is stopped when the tip of the tool 4 reaches the first position P1.

[0118] The numerical control device 20 may determine that the tool 4 is overrunning (S31: YES) while in the state of first synchronous control (S11). In this case, the numerical control device 20 maintains the first synchronous control and decelerates the Z-axis motor 11 so that the acceleration value becomes -Az(1) (S33). This allows the relative movement of the spindle 9 to be stopped at 8 when the tip of the tool 4 reaches the first position P1.

[0119] In S33, the numerical control device 20 may determine that the tip of the tool 4 has reached the second position P2 while the speed of the Z-axis motor 11 has been reduced (S17: YES). In this case, the numerical control device 20 stops the deceleration of the Z-axis motor 11 and accelerates it in S59. In this case, the numerical control device 20 can increase the speed at which the spindle 9 moves. Therefore, the numerical control device 20 can shorten the time required to complete the tapping process and increase the speed of the tapping process.

[0120] In some cases, after the numerical control device 20 decelerates the Z-axis motor 11 in S33, it may determine in S59 that the tool 4 will overrun while the Z-axis motor 11 is accelerating (S51: YES). In this case, the numerical control device 20 stops accelerating the Z-axis motor 11 when the speed value is Vz(4), which is less than Vz(1), and then decelerates it from Vz(4) (S53). In this case, the numerical control device 20 can increase the relative movement of the spindle 9 when it stops the movement of the tool 4 when the tip of the tool 4 reaches the first position P1.

[0121] If the numerical control device 20 determines that the tip of the tool 4 has reached the second position P2 while in the state of first synchronous control (S11) (S17: YES), it starts first asynchronous control (S21). The numerical control device 20 also reduces the speed of the spindle motor 12 so that the acceleration value becomes -Ar(1) (S85). This satisfies the acceleration constraint of the spindle motor 12 and stops the rotation of the spindle 9.

[0122] In the first synchronous control, the Z-axis motor 11 is controlled in accordance with the feed command for controlling the Z-axis motor 11. In addition, in the first synchronous control, the spindle motor 12 is controlled in accordance with the rotation command determined based on the feedback information from the encoder 12A connected to the Z-axis motor 11. As a result, the numerical control device 20 can synchronize the spindle motor 12 with the Z-axis motor 11.

[0123] The second embodiment differs from the first embodiment in that, instead of the first synchronous control and first asynchronous control shown in Figure 4, the second synchronous control and second asynchronous control shown in Figure 12 are executed. The CPU 21 executes the second synchronous control, which is a synchronous control that synchronizes the Z-axis motor 11 with the spindle motor 12. The CPU 21 also executes the second asynchronous control, which is an asynchronous control that does not synchronize the Z-axis motor 11 with the spindle motor 12.

[0124] During the execution of the second synchronous control, switch 65 in Figure 12 is switched to connect the synchronous control unit 63 and the drive circuit 26. Switch 65 is also switched to disconnect the Z-axis acceleration / deceleration processing unit 64 and the drive circuit 26. The CPU 21 uses the command analysis unit 61 to analyze the rotation command for rotating the spindle 9 in the NC program. Based on this, the command analysis unit 61 generates time-series data of the target angle.

[0125] Next, the CPU 21 performs acceleration and deceleration processing on the time-series data of the target angle generated by the spindle acceleration / deceleration processing unit 62, and determines the target angle for each predetermined period. Then, the CPU 21 outputs the determined target angle data from the spindle acceleration / deceleration processing unit 62 to the drive circuit 27 at predetermined intervals.

[0126] The drive circuit 27 drives the spindle motor 12 based on the target angle data output from the spindle acceleration / deceleration processing unit 62. As a result, the tool 4 connected to the spindle 9 rotates.

[0127] The CPU 21 obtains the rotation angle of the spindle motor 12 detected by the encoder 12A via the synchronous control unit 63. Based on the rotation angle of the spindle motor 12, the synchronous control unit 63 determines a feed command to move the spindle 9 in the Z-axis direction. The synchronous control unit 63 determines the target position of the spindle 9 according to the determined feed command. Next, the CPU 21 outputs the data of the determined target position from the synchronous control unit 63 to the drive circuit 26.

[0128] The drive circuit 26 drives the Z-axis motor 11 based on target position data output from the synchronous control unit 63. As a result, the tool 4 connected to the spindle 9 moves in the Z-axis direction in synchronization with the rotation of the spindle 9.

[0129] When the tip of tool 4 moves from the third position P3 to the second position P2, the second synchronous control ends and the second asynchronous control begins. Switch 55 is switched so that the synchronous control unit 63 and the drive circuit 26 are disconnected, and the Z-axis acceleration / deceleration processing unit 64 (described later) and the drive circuit 26 are connected.

[0130] The CPU 21, using the spindle acceleration / deceleration processing unit 62, performs acceleration / deceleration processing on time-series data of the target angle for stopping the rotation of the spindle 9. Next, the CPU 21 outputs the target angle data determined by the acceleration / deceleration processing from the spindle acceleration / deceleration processing unit 62 to the drive circuit 27 at a predetermined period.

[0131] The drive circuit 27 drives the spindle motor 12 based on the target angle data output from the spindle acceleration / deceleration processing unit 62. As a result, the speed of the tool 4 connected to the spindle 9 is reduced and it stops at the stop timing Ts.

[0132] Furthermore, the CPU 21 acquires the rotation angle and acceleration of the Z-axis motor 11 immediately before switching to the second asynchronous control. Based on the acquired rotation angle and acceleration, the CPU 21 uses the Z-axis acceleration / deceleration processing unit 64 to perform acceleration / deceleration processing on the time-series data of the target position for stopping the movement of the tool 4 in the Z-axis direction when the tip of the tool 4 reaches the first position P1. Next, the CPU 21 outputs the target position data determined by the acceleration / deceleration processing from the Z-axis acceleration / deceleration processing unit 64 to the drive circuit 26 at a predetermined period.

[0133] The drive circuit 26 drives the Z-axis motor 11 asynchronously with the spindle motor 12 based on the target position data output from the Z-axis acceleration / deceleration processing unit 64. As a result, the tool 4 connected to the spindle 9 moves upward while decelerating asynchronously with the rotation of the tool 4, and stops when the tip reaches the first position P1.

[0134] The second feed process will be explained with reference to Figure 13. Processes common to the first feed process in Figures 5 to 7 are denoted by the same reference numerals as the first feed process, and their explanations are omitted or simplified.

[0135] The CPU 21 switches the switch 65 in Figure 12 to start the second synchronous control (S111). The CPU 21 controls the Z-axis motor 11 in synchronization with the spindle motor 12 to move the tip of the tool 4 from the second position P2 to the third position P3. After the tip of the tool 4 reaches the third position P3, the CPU 21 controls the Z-axis motor 11 in synchronization with the spindle motor 12 to move the tip of the tool 4 upward from the third position P3. At this time, the acceleration of the Z-axis motor 11 is accelerated to a value of Az(1).

[0136] The CPU 21 determines whether the tip of the tool 4 has reached the second position P2 based on the rotation angle of the Z-axis motor 11 detected by the encoder 11A (S17). If the CPU 21 determines that the tip of the tool 4 has not reached the second position P2 (S17: NO), it continues the second synchronous control.

[0137] If the CPU 21 determines that the tip of the tool 4 has reached the second position P2 (S17: YES), it proceeds to S119. The CPU 21 switches the switch 55 and starts the second asynchronous control (S119).

[0138] The CPU 21 acquires the speed and acceleration of the Z-axis motor 11 at the timing when the second asynchronous control is initiated in S115 (S121). Based on the acquired speed and acceleration, the CPU 21 determines a feed command to drive the Z-axis motor 11 and generates target position data. The CPU 21 drives the Z-axis motor 11 asynchronously with respect to the spindle motor 12 using the generated data.

[0139] The second acceleration / deceleration process in S23 and S25 in Figure 7 are identical to the first feed process in Figure 5, so their explanation is omitted.

[0140] The second rotation process will be explained with reference to Figures 14 and 15. Processes common to the first rotation process in Figure 8 are denoted by the same reference numerals as in the first rotation process, and their explanations are omitted or simplified.

[0141] The CPU 21 switches the switch 65 in Figure 12 to start the second synchronous control (S171). The CPU 21 controls the spindle motor 12 to rotate the tool 4 in the first direction Y1 (S173). After the tip of the tool 4 reaches the third position P3, the CPU 21 controls the spindle motor 12 to rotate the tool 4 in the second direction Y2, opposite to the first direction Y1 (S175). At this time, the CPU 21 accelerates the speed of the spindle motor 12 so that the acceleration value is Ar(1).

[0142] The CPU 21 determines whether the tip of the tool 4 has reached the second position P2 based on the rotation angle of the Z-axis motor 11 detected by the encoder 11A (S77). If the CPU 21 determines that the tip of the tool 4 has not reached the second position P2 (S77: NO), it executes the fifth acceleration / deceleration process shown in Figure 15 (S179).

[0143] Referring to Figure 15, the fifth acceleration / deceleration process will be explained. The CPU 21 calculates the rotation amount Cr of the spindle motor 12 when the tip of the tool 4 reaches the first position P1, in accordance with the drive of the Z-axis motor 11 which is synchronized with the spindle motor 12. The CPU 21 further calculates the rotation amount Cs of the spindle motor 12 when the tool 4, which is moving in accordance with the drive of the Z-axis motor 11 which is synchronized with the spindle motor 12, moves to the deceleration completion position. Based on the calculated rotation amounts Cr and Cs, the CPU 21 determines whether the tool 4 will overrun when the speed of the spindle motor 12 is decelerated by Ar(1) from the current speed (S191).

[0144] The CPU 21 determines that the tool 4 will not overrun when the rotational speed Cr is greater than or equal to the rotational speed Cs (S191: NO). The CPU 21 proceeds to S95.

[0145] The CPU 21 determines whether the speed of the spindle motor 12 is less than Vr(1) (S95). As shown in Figures 9 to 11, Vr(1) is the maximum speed when the spindle motor 12 rotates under conditions constrained by the drive conditions due to the first synchronous control. If the CPU 21 determines that the speed of the spindle motor 12 is less than Vr(1) (S95: YES), the process proceeds to S197. The CPU 21 calculates the amount of rotation Cp of the spindle motor 12 when the spindle motor 12 is accelerated from its current speed by Ar(1) and the tool 4, which moves in accordance with the drive of the Z-axis motor 11 synchronized with the spindle motor 12, stops. The CPU 21 determines whether the tool 4 will overrun when the spindle motor 12 is accelerated from its current speed by Ar(1) based on the calculated rotation amounts Cs and Cp (S197).

[0146] The CPU 21 determines that the tool 4 will not overrun when the rotational speed Cr is greater than or equal to the rotational speed Cp (S197: NO). In this case, the CPU 21 proceeds to S99.

[0147] The CPU 21 continuously accelerates the spindle motor 12 so that the acceleration value becomes Ar(1) (S99). The CPU 21 finishes the fifth acceleration / deceleration process and returns the process to the second rotation process shown in Figure 14.

[0148] If the CPU 21 determines that the speed value of the spindle motor 12 matches Vr(1) (S95: NO), it proceeds to S101. The CPU 21 maintains the spindle motor 12 at the current speed (S101). The CPU 21 returns to the second rotation process shown in Figure 14.

[0149] The CPU 21 determines that if the spindle motor 12 is continuously accelerated from its current speed by Ar(1) when the rotational speed Cp is greater than the rotational speed Cr, the tool 4 will overrun (S197: YES). The CPU 21 maintains the spindle motor 12 at its current speed (S103). The CPU 21 returns to the second rotational process shown in Figure 14.

[0150] As shown in Figure 14, after the completion of the fifth acceleration / deceleration process (S179), the CPU 21 returns to processing S77. The CPU 21 repeatedly executes the fifth acceleration / deceleration process until the tip of the tool 4 reaches the second position P2.

[0151] As shown in Figure 15, the CPU 21 determines that if the rotation amount Cs is greater than the rotation amount Cr, the tool 4 will overrun when the speed of the spindle motor 12 is reduced by Ar(1) from the current speed (S191: YES). The CPU 21 proceeds to S93. The CPU 21 reduces the speed of the spindle motor 12 so that the acceleration value becomes -Ar(1) (S93). The CPU 21 returns to the second rotation process shown in Figure 14.

[0152] As shown in Figure 14, if the CPU 21 determines that the tip of the tool 4 has reached the second position P2 (S77: YES), it proceeds to S181. The CPU 21 switches the switch 65 in Figure 12 and starts the second asynchronous control (S181).

[0153] Since steps S85 and S87 are identical to the first rotation process in Figure 8, their explanation will be omitted.

[0154] As described above, the numerical control device 20 can perform second-stage synchronous control, which is synchronous control that synchronizes the Z-axis motor 11 with the spindle motor 12. Even when performing second-stage synchronous control, the numerical control device 20 can shorten the time required to complete the tapping process and speed up the tapping process.

[0155] The third embodiment differs from the first embodiment in that, instead of the first synchronous control and first asynchronous control shown in Figure 4, the third synchronous control and third asynchronous control shown in Figure 16 are performed. The CPU 21 controls the Z-axis motor 11 in response to the feed command and controls the spindle motor 12 in response to the rotation command determined based on the feed command. This synchronizes the Z-axis motor 11 and the spindle motor 12.

[0156] During the execution of the third synchronous control, switch 75 in Figure 16 is switched to connect the synchronous control unit 73 and the drive circuit 27. Switch 75 is also switched to disconnect the spindle acceleration / deceleration processing unit 74 and the drive circuit 27. The CPU 21 uses the command analysis unit 71 to analyze the feed command for moving the spindle 9 in the Z-axis direction from the NC program. Based on this, the command analysis unit 71 generates time-series data of the target position.

[0157] Next, the CPU 21 performs acceleration and deceleration processing on the time-series data of the generated target position using the Z-axis acceleration / deceleration processing unit 72, and determines the target position at predetermined intervals. Then, the CPU 21 outputs the determined target position data from the Z-axis acceleration / deceleration processing unit 72 to the drive circuit 26 at predetermined intervals.

[0158] The drive circuit 26 drives the Z-axis motor 11 based on the target position data output from the Z-axis acceleration / deceleration processing unit 72. As a result, the tool 4 connected to the spindle 9 moves in the Z-axis direction.

[0159] The synchronous control unit 73 determines a rotation command to rotate the spindle 9 based on the feed command. The synchronous control unit 73 further determines a target angle for the spindle 9 according to the determined rotation command. The synchronous control unit 73 performs acceleration and deceleration processing on the generated time-series data of the target angle to determine the target angle for each predetermined period. Next, the CPU 21 outputs the determined target angle data from the synchronous control unit 73 to the drive circuit 27.

[0160] The drive circuit 27 drives the spindle motor 12 in synchronization with the Z-axis motor 11 based on the target angle data output from the synchronous control unit 73.

[0161] On the other hand, when the third asynchronous control is executed, switch 75 is switched to disconnect the synchronous control unit 73 and the drive circuit 27. Switch 75 is also switched to connect the spindle acceleration / deceleration processing unit 74 and the drive circuit 27.

[0162] The CPU 21 acquires the rotation angle and acceleration of the spindle motor 12 just before switching to the third asynchronous control. Based on the acquired rotation angle and acceleration, the CPU 21 determines a rotation command using the spindle acceleration / deceleration processing unit 74. Furthermore, the spindle acceleration / deceleration processing unit 74 generates a target angle based on the determined rotation command and performs acceleration / deceleration processing on the time-series data of the target angle. Next, the CPU 21 outputs the target angle data determined by the acceleration / deceleration processing from the spindle acceleration / deceleration processing unit 74 to the drive circuit 27 at a predetermined period.

[0163] The drive circuit 27 drives the spindle motor 12 asynchronously with the Z-axis motor 11 based on the target angle data output from the spindle acceleration / deceleration processing unit 74.

[0164] Furthermore, the third synchronous control and the feed and rotation processes when the third synchronous control is executed can be directly applied to the first feed process in Figures 5 to 7 and the first rotation process in Figure 8.

[0165] As described above, the numerical control device 20 performs third-order synchronous control. The third-order synchronous control controls the Z-axis motor 11 in accordance with the feed command and controls the spindle motor 12 in accordance with the rotation command determined based on the feed command. Even when performing third-order synchronous control, the numerical control device 20 can shorten the time required to complete the tapping process and speed up the tapping process.

[0166] The fourth embodiment differs from the first embodiment in that, instead of the first synchronous control and first asynchronous control in Figure 4, the fourth synchronous control and fourth asynchronous control in Figure 17 are performed. The CPU 21 controls the spindle motor 12 in response to a rotation command and controls the Z-axis motor 11 in response to a feed command determined based on the rotation command. This synchronizes the Z-axis motor 11 and the spindle motor 12.

[0167] During the execution of the fourth synchronous control, switch 85 in Figure 17 is switched to connect the synchronous control unit 83 and the drive circuit 26. Switch 85 is also switched to disconnect the Z-axis acceleration / deceleration processing unit 84 and the drive circuit 26. The CPU 21 uses the command analysis unit 81 to analyze the rotation command for rotating the spindle 9 from the NC program. Based on this, the command analysis unit 81 generates time-series data of the target angle.

[0168] Next, the CPU 21 performs acceleration and deceleration processing on the time-series data of the target angle generated by the spindle acceleration / deceleration processing unit 82, and determines the target angle for each predetermined period. Then, the CPU 21 outputs the determined target angle data from the spindle acceleration / deceleration processing unit 82 to the drive circuit 27 at predetermined intervals.

[0169] The drive circuit 27 drives the spindle motor 12 based on the target angle data output from the spindle acceleration / deceleration processing unit 82. As a result, the tool 4 connected to the spindle 9 rotates.

[0170] The synchronous control unit 83 determines a feed command to move the spindle 9 in the Z-axis direction based on the rotation command. The synchronous control unit 83 further determines the target position of the spindle 9 according to the determined feed command. The synchronous control unit 83 performs acceleration and deceleration processing on the generated time-series data of the target position to determine the target position at predetermined cycles. Next, the CPU 21 outputs the determined target position data from the synchronous control unit 83 to the drive circuit 26.

[0171] The drive circuit 26 drives the Z-axis motor 11 in synchronization with the spindle motor 12 based on the target position data output from the synchronous control unit 53.

[0172] On the other hand, when the fourth asynchronous control is executed, switch 85 is switched to disconnect the synchronous control unit 83 and the drive circuit 26. Switch 85 is also switched to connect the Z-axis acceleration / deceleration processing unit 84 and the drive circuit 26.

[0173] The CPU 21 acquires the rotation angle and acceleration of the Z-axis motor 11 just before switching to the fourth asynchronous control. Based on the acquired rotation angle and acceleration, the CPU 21 determines a feed command using the Z-axis acceleration / deceleration processing unit 84. Furthermore, the Z-axis acceleration / deceleration processing unit 84 generates a target position based on the determined rotation command and performs acceleration / deceleration processing on the time-series data of the target angle. Next, the CPU 21 outputs the target position data determined by the acceleration / deceleration processing from the Z-axis acceleration / deceleration processing unit 84 to the drive circuit 26 at a predetermined period.

[0174] The drive circuit 26 drives the Z-axis motor 11 asynchronously with the spindle motor 12 based on the target position data output from the Z-axis acceleration / deceleration processing unit 84.

[0175] Furthermore, the fourth synchronous control and the feed process when the fourth synchronous control is executed can be directly applied to the second feed process shown in Figure 13. The fourth synchronous control and the rotation process when the fourth synchronous control is executed can be directly applied to the second rotation process shown in Figures 14 and 15.

[0176] As described above, the numerical control device 20 performs fourth-stage synchronous control. In fourth-stage synchronous control, the spindle motor 12 is controlled according to the rotation command, and the Z-axis motor 11 is controlled according to the feed command determined based on the rotation command. Even when performing fourth-stage synchronous control, the numerical control device 20 can shorten the time required to complete the tapping process and speed up the tapping process.

[0177] The present invention is not limited to the above embodiments, and various modifications are possible. In the above, the machine tool 10 moves the spindle 9 in the Z-axis direction relative to the table 50 on which the workpiece W is fixed. Alternatively, the machine tool 10 may move the table 50 in the Z-axis direction relative to the spindle 9. Furthermore, the machine tool 10 may move both the spindle 9 and the table 50 in the Z-axis direction.

[0178] CPU21 accelerated the Z-axis motor 11 in S15 and S39 so that the acceleration value was Az(1). CPU21 may also accelerate the Z-axis motor 11 in S15 and S39 so that the velocity value was Vz(1). CPU21 may accelerate the Z-axis motor 11 in S15 and S39 so that the acceleration value was Az(1) and also so that the velocity value was Vz(1). CPU21 may also accelerate the Z-axis motor 11 in S15 and S39 so that the jerk value was Jz(1). Jz(1) is the maximum jerk when the Z-axis motor 11 rotates under conditions constrained by the drive conditions of the spindle motor 12 by the first synchronous control.

[0179] In S59, CPU21 accelerated the Z-axis motor 11 so that the acceleration value was Az(2). CPU21 may also accelerate the Z-axis motor 11 in S59 so that the velocity value was Vz(2). CPU21 may accelerate the Z-axis motor 11 in S59 so that the acceleration value was Az(2) and also so that the velocity value was Vz(2). CPU21 may also accelerate the Z-axis motor 11 in S59 so that the jerk value was Jz(2). Jz(2) is the maximum jerk when the Z-axis motor 11 rotates without being constrained by the driving conditions of the spindle motor 12.

[0180] In S53, CPU21 decelerated the Z-axis motor 11 so that the acceleration value was -Az(2). Alternatively, in S53, CPU21 may decelerate the Z-axis motor 11 so that the velocity value was -Vz(2). In S53, CPU21 may decelerate the Z-axis motor 11 so that the acceleration value was -Az(2) and also so that the velocity value was -Vz(2). Alternatively, in S53, CPU21 may decelerate the Z-axis motor 11 so that the jerk value was -Jz(2).

[0181] In S33, CPU21 decelerated the Z-axis motor 11 so that the acceleration value was -Az(1). In S33, CPU21 may also decelerate the Z-axis motor 11 so that the velocity value was -Vz(1). In S33, CPU21 may decelerate the Z-axis motor 11 so that the acceleration value was -Az(1) and also decelerate the Z-axis motor 11 so that the velocity value was -Vz(1). In S33, CPU21 may also decelerate the Z-axis motor 11 so that the jerk value was -Jz(1).

[0182] In S85, CPU21 decelerated the spindle motor 12 so that the acceleration value was -Ar(1). CPU21 may also decelerate the spindle motor 12 in S85 so that the acceleration value was greater than -Ar(1). CPU21 may also decelerate the spindle motor 12 in S85 so that the velocity value was greater than -Vr(1). CPU21 may decelerate the spindle motor 12 in S85 so that the acceleration value was greater than -Ar(1) and also so that the velocity value was greater than -Vr(1). CPU21 may also accelerate the Z-axis motor 11 in S85 so that the jerk value was Jr(1). Jr(1) is the maximum jerk when the spindle motor 12 rotates under the constraints of the drive conditions by the first synchronous control.

[0183] In S59, the numerical control device 20 may accelerate the speed by maintaining the acceleration of the Z-axis motor 11 at Az(1). In S53, the numerical control device 20 may decelerate the speed of the Z-axis motor 11 so that the acceleration value becomes -Az(1).

[0184] The numerical control device 20 may reduce the speed in S85 by controlling the acceleration of the spindle motor 12 so that its absolute value is greater than Ar(1), resulting in Ar(2). For example, the numerical control device 20 may determine whether the motor is operating in low-heat mode. If the numerical control device 20 determines that the motor is operating in low-heat mode, it may reduce the speed by controlling the acceleration of the spindle motor 12 so that it becomes -Ar(2). On the other hand, if the numerical control device 20 determines that the motor is not operating in low-heat mode, it may reduce the speed by controlling the acceleration of the spindle motor 12 so that it becomes -Ar(1).

[0185] The upper surface of the workpiece W may have a step. The step may have a first surface and a second surface above the first surface. The second position P2 may be above the first surface. The first position P1 may be a position where contact with the second surface of the workpiece W can be avoided when the tool 4 moves in the X-axis and Y-axis directions.

[0186] The numerical control device 20 may determine that the tip of the tool 4 has reached the second position P2 if the tip of the tool 4 is positioned between the lower predetermined position and the upper predetermined position. The lower predetermined position is a predetermined position below the second position P2. The upper predetermined position is a predetermined position above the second position P2.

[0187] CPU 21 is an example of the "control unit" or "computer" of the present invention. The program stored in ROM 22 is an example of the "control program" of the present invention. S11, S13, S15, and S39 are examples of the "first control process" or "first control step" of the present invention. S17 is an example of the "first determination process" or "first determination step" of the present invention. S21 and S59 are examples of the "second control process," "fifth control process," or "second control step" of the present invention. S51 is an example of the "second determination process" of the present invention. S53 is an example of the "third control process" or "sixth control process" of the present invention. S33 is an example of the "fourth control process" of the present invention. S85 is an example of the "seventh control process" of the present invention. Z-axis motor 11 is an example of the "first motor" of the present invention. Spindle motor 12 is an example of the "second motor" of the present invention. Feed command is an example of the "first command" of the present invention. Rotation command is an example of the "second command" of the present invention. Az(1) is an example of the "first acceleration" of the present invention. Vz(1) is an example of the "first velocity" of the present invention. Vz(2) is an example of the "second velocity" of the present invention. Vz(3) is an example of the "third velocity" of the present invention. [Explanation of symbols]

[0188] 4:Tools 9: Spindle 10: Machine tools 11: Z-axis motor 12: Main shaft motor 20: Numerical control device 21: CPU 22 :ROM P1: 1st position P2: 2nd position P3: 3rd position

Claims

1. A control device for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, The control unit controls the first motor and the second motor to rotate the tool in a first direction, moving the tip of the tool relative to the first position through the second position to the third position, and then rotates the tool in a second direction opposite to the first direction, moving the tip of the tool relative to the first position through the second position, thereby performing the tapping operation. The first position is a position away from the workpiece in the axial direction, the third position is a position at the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position. The control unit, During the tapping process, the tip moves from the second position to the third position, and thereafter, while the tip moves from the third position to the second position, the first motor and the second motor are synchronized, and a first control process is performed which includes a first speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration. The first control process includes a first determination process that determines whether the tip has reached the second position during the process in which the tip moves from the third position toward the first position, With the first motor and the second motor synchronized by the first control process, if the first determination process determines that the tip has reached the second position, the synchronization between the first motor and the second motor is released, and a second control process is performed which includes a second speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor is greater than the first speed, and a second acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. A control device characterized by performing the following actions.

2. The control unit, The first control process determines, in the process of the tip moving from the third position toward the first position, whether it is the right time to start decelerating the first motor in order to stop the relative movement of the table and the spindle when the tip of the tool reaches the first position, and the second determination process determines, If the second control process determines that the timing is met while the synchronization between the first motor and the second motor is released, a third control process is performed to decelerate the speed of the first motor. The control device according to claim 1, further characterized by performing the following.

3. The third control process is as follows: The control device according to claim 2, characterized in that it performs a third acceleration control to decelerate the speed of the first motor so that the absolute value of the acceleration of the first motor becomes greater than the first acceleration.

4. The second control process is as follows: If the speed of the first motor reaches the second speed before the second determination process determines that the timing is met, the speed of the first motor is maintained at the second speed. The third control process is as follows: The first motor is controlled to decelerate from the second speed. The control device according to claim 2 or 3.

5. The third control process is as follows: When the second determination process determines that the timing is met, if the speed of the first motor is a third speed which is lower than the second speed, the first motor is decelerated from the third speed. The control device according to claim 2 or 3.

6. The control unit, A second determination process determines whether it is the right time to start decelerating the first motor in order to stop the relative movement of the table and the spindle when the tip of the tool reaches the first position, If, after the first control process, the first motor and the second motor are synchronized, and the second determination process determines that the timing is met, then a fourth control process is performed to execute a fourth acceleration control that decelerates the speed of the first motor while the first motor and the second motor are synchronized, so that the absolute value of the acceleration of the first motor becomes the first acceleration. The control device according to claim 1, further characterized by performing the following.

7. The control unit, The control device according to claim 6, characterized in that, while the speed of the first motor is decelerated by the fourth control process, if the first determination process determines that the tip has reached the second position, the fifth control process is further executed, which involves releasing the synchronization between the first motor and the second motor and executing a fifth acceleration control to accelerate the speed of the first motor so that the absolute value of the acceleration of the first motor becomes greater than the first acceleration.

8. The control unit, The control device according to claim 7, characterized in that, with the synchronization between the first motor and the second motor released by the fifth control process, if the second determination process determines that the timing is as described above, the control device further executes a sixth acceleration control that decelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes greater than the first acceleration.

9. The control unit, The control device according to claim 1, characterized in that, while the first motor and the second motor are synchronized by the first control process, if the first determination process determines that the tip has reached the second position, the synchronization between the first motor and the second motor is released, and a seventh acceleration control is performed to decelerate the speed of the second motor so that the absolute value of the acceleration of the second motor is greater than the first acceleration.

10. The first control process is: The control device according to claim 1, characterized in that it synchronizes the first motor and the second motor by controlling the first motor in accordance with a first command for controlling the first motor and controlling the second motor in accordance with a second command determined based on feedback information of the first motor.

11. The first control process is: The control device according to claim 1, characterized in that it synchronizes the first motor and the second motor by controlling the second motor in accordance with a second command for controlling the second motor and by controlling the first motor in accordance with a first command determined based on feedback information of the second motor.

12. The first control process is: The control device according to claim 1, characterized in that it synchronizes the first motor and the second motor by controlling the first motor in accordance with a first command for controlling the first motor and controlling the second motor in accordance with a second command determined based on the first command.

13. The first control process is: The control device according to claim 1, characterized in that it synchronizes the first motor and the second motor by controlling the second motor in accordance with a second command for controlling the second motor and by controlling the first motor in accordance with a first command determined based on the second command.

14. A control method for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, By controlling the first motor and the second motor, the tip of the tool is moved relative to the first position, passing through the second position to the third position, while the tool is rotated in the first direction, and then the tip is moved relative to the first position, passing through the second position, while the tool is rotated in the second direction opposite to the first direction, thereby performing the tapping operation. The first position is a position away from the workpiece in the axial direction, the third position is a position at the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position. During the tapping process, the tip moves from the second position to the third position, and thereafter, while the tip moves from the third position to the second position, the first motor and the second motor are synchronized, and a first control step is performed in which at least one of the following is executed: a first speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration. The first control step includes a first determination step which determines whether the tip has reached the second position during the process in which the tip moves from the third position toward the first position, With the first motor and the second motor synchronized by the first control step, if the first determination step determines that the tip has reached the second position, the second control step releases the synchronization between the first motor and the second motor and performs at least one of the following: a second speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor is greater than the first speed, and a second acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. A control method characterized by having the following features.

15. A control program for performing tapping on a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, By controlling the first motor and the second motor, the tip of the tool is moved relative to the first position, passing through the second position to the third position, while the tool is rotated in the first direction, and then the tip is moved relative to the first position, passing through the second position, while the tool is rotated in the second direction opposite to the first direction, thereby performing the tapping operation. The first position is a position away from the workpiece in the axial direction, the third position is a position at the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position. During the tapping process, the tip moves from the second position to the third position, and thereafter, while the tip moves from the third position to the second position, the first motor and the second motor are synchronized, and a first control step is performed in which at least one of the following is executed: a first speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration. The first control step includes a first determination step which determines whether the tip has reached the second position during the process in which the tip moves from the third position toward the first position, With the first motor and the second motor synchronized by the first control step, if the first determination step determines that the tip has reached the second position, the second control step releases the synchronization between the first motor and the second motor and performs at least one of the following: a second speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor is greater than the first speed, and a second acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. A control program characterized by causing a computer to execute it.

16. A medium storing a control program for performing tapping by controlling a machine tool comprising a table for holding a workpiece, a spindle for holding a tool, a first motor for relatively moving the table and the spindle in the axial direction of the spindle, and a second motor for rotating the spindle, By controlling the first motor and the second motor, the tip of the tool is moved relative to the first position, passing through the second position to the third position, while the tool is rotated in the first direction, and then the tip is moved relative to the first position, passing through the second position, while the tool is rotated in the second direction opposite to the first direction, thereby performing the tapping operation. The first position is a position away from the workpiece in the axial direction, the third position is a position at the depth of the workpiece in the axial direction, and the second position is a position away from the workpiece in the axial direction and between the first position and the third position. During the tapping process, the tip moves from the second position to the third position, and thereafter, while the tip moves from the third position to the second position, the first motor and the second motor are synchronized, and a first control step is performed in which at least one of the following is executed: a first speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor becomes a first speed, and a first acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor becomes a first acceleration. The first control step includes a first determination step which determines whether the tip has reached the second position during the process in which the tip moves from the third position toward the first position, With the first motor and the second motor synchronized by the first control step, if the first determination step determines that the tip has reached the second position, the second control step includes releasing the synchronization between the first motor and the second motor, and performing at least one of the following: a second speed control that accelerates the speed of the first motor so that the absolute value of the speed of the first motor is greater than the first speed, and a second acceleration control that accelerates the speed of the first motor so that the absolute value of the acceleration of the first motor is greater than the first acceleration. A medium that stores a control program characterized by causing a computer to execute it.