Work machine control device and work machine control program

JPWO2024053027A5Active Publication Date: 2025-05-20FANUC LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024545344
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-05-20
Estimated Expiration
2042-09-07

AI Technical Summary

Technical Problem

Machine tool control devices face challenges in preventing mechanical resonance during chip separation, which can lead to machining defects, tool damage, and stoppages due to unpredictable resonance frequencies changing with machining conditions.

Method used

A machine tool control device and program that includes a position information acquisition unit, state determination unit, and swing switching unit to dynamically adjust swing conditions based on positional deviations exceeding a threshold, shifting the resonance frequency and reducing command amplitude to prevent mechanical resonance.

Benefits of technology

Effectively separates chips while suppressing mechanical resonance, ensuring stable machining conditions and preventing tool damage by dynamically adjusting swing conditions in response to positional deviations.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The purpose of the present invention is to both break down chips and suppress sympathetic vibration in a machine. This work machine control device superposes a swinging command for commanding relative swinging between a workpiece and a cutting tool onto a movement command for commanding relative movement between the workpiece and the cutting tool, thereby generating air cuts in chips from the workpiece to break down the chips. A position information acquisition unit of the work machine control device acquires position information related to the relative positions of the workpiece and the tool. A state assessment unit of the work machine control device assesses that a state of instability is in effect, under the condition that a positional deviation exceeds a threshold value, the positional deviation increasing with increases in the difference between actual relative positions that are based on the position information and command relative positions that are based on the movement command and the swinging command. A swinging switching unit of the work machine control device performs a switching process for switching a swinging condition in relative swinging, under the condition that it is assessed that the state of instability is in effect.
Need to check novelty before this filing date? Find Prior Art

Description

Machine tool control device and machine tool control program

[0001] The present invention relates to a machine tool control device for controlling a machine tool.

[0002] Some machine tool control devices superimpose a swing command that commands relative swing between the workpiece and the cutting tool on a movement command that commands relative movement between the workpiece and the cutting tool, thereby generating an air cut when the workpiece is cut by the cutting tool, thereby breaking up the chips.

[0003] Japanese Patent Application Laid-Open No. 2020-144588

[0004] According to such a machine tool control device, the relative swing can break up the chips into small pieces, thereby preventing the chips from becoming entangled in the cutting tool, etc. However, the present inventors have noticed that the following problem can occur.

[0005] That is, depending on the oscillation conditions, there is a risk that the frequency of the relative oscillation will coincide with the resonance frequency of the machine tool, thereby inducing mechanical resonance. As a result, there is a risk of poor machining of the workpiece, stoppage of the machine tool, damage to the cutting tool, etc. On the other hand, because the oscillation conditions can change depending on the machining conditions, it is necessary to comprehensively check in advance to prevent mechanical resonance from occurring for each machining condition, which is difficult.

[0006] The present disclosure has been made in consideration of the above circumstances, and aims to achieve both chip breaking and suppression of mechanical resonance.

[0007] The machine tool control device disclosed herein is a machine tool control device that, in controlling a machine tool equipped with a cutting tool that cuts a workpiece, generates an air cut and breaks chips when cutting the workpiece by superimposing a swing command that commands relative swing between the workpiece and the cutting tool on a movement command that commands relative movement between the workpiece and the cutting tool, and has: a position information acquisition unit that acquires position information related to the relative position between the workpiece and the cutting tool; a state determination unit that determines an unstable state when a position deviation, which increases as the difference between an actual relative position as the relative position based on the position information and a command relative position as the relative position based on the movement command and the swing command, exceeds a threshold; and a swing switching unit that performs switching processing to switch the swing conditions for the relative swing on the condition that the unstable state is determined.

[0008] The machine tool control program of the present disclosure is a machine tool control program that causes a computer to function as a machine tool control device that generates an air cut and breaks chips when cutting a workpiece by superimposing a swing command that commands relative swing between the workpiece and the cutting tool on a movement command that commands relative movement between the workpiece and the cutting tool, in controlling a machine tool equipped with a cutting tool that cuts a workpiece, and further causes the computer to function as: a position information acquisition unit that acquires position information related to the relative position between the workpiece and the cutting tool; a state determination unit that determines an unstable state when a position deviation, which increases as the difference between an actual relative position as the relative position based on the position information and a command relative position as the relative position based on the movement command and the swing command, exceeds a threshold; and a swing switching unit that performs switching processing to switch the swing conditions for the relative swing when the unstable state is determined.

[0009] According to the present disclosure, it is possible to achieve both chip breaking and suppression of mechanical resonance.

[0010] Fig. 1 is a configuration diagram showing a machine tool control device and a machine tool according to a first embodiment; Fig. 2 is a configuration diagram showing a machine tool control device; Fig. 3 is a graph showing changes in actual relative position and position deviation; Fig. 4 is a configuration diagram showing a machine tool control device according to a second embodiment; Fig. 5 is a graph showing changes in position deviation; Fig. 6 is a configuration diagram showing a machine tool control device according to a third embodiment;

[0011] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. However, the present disclosure is not limited to the following embodiments and can be appropriately modified and implemented within the scope of the present disclosure.

[0012] 1, a machine tool 80 has a workpiece holder 85 that holds a workpiece 86 and a tool holder 87 that holds a cutting tool 88. The workpiece holder 85 is driven, for example, by a first motor 81a serving as a spindle motor, and the tool holder 87 is driven, for example, by a second motor 81b and a third motor 81c. Hereinafter, the first motor 81a, the second motor 81b, and the third motor 81c will each be simply referred to as "motor 81."

[0013] The workpiece 86 and the cutting tool 88 move relative to each other due to the relative movement between the workpiece holder 85 and the tool holder 87. Hereinafter, the relative movement between the workpiece 86 and the cutting tool 88 for cutting the workpiece 86 will be simply referred to as "relative movement," and the relative position between the cutting tool 88 and the workpiece 86 will be simply referred to as "relative position." Also, below, the relative oscillation between the cutting tool 88 and the workpiece 86 in a direction intersecting the direction of the relative movement will be simply referred to as "relative oscillation."

[0014] Each motor 81 is provided with an encoder 82 that detects the rotation angle of the motor 81. Hereinafter, the relative position based on the rotation angle detected by these encoders 82 will be referred to as an "actual relative position Pa."

[0015] The machine tool controller 50 controls the machine tool 80 described above. The machine tool controller 50 is mainly composed of, for example, a numerical control device and a servo control device that operates the motor 81 and the like based on commands from the numerical control device. From another perspective, the machine tool controller 50 is mainly composed of a computer Cp and a machine tool control program Pg that causes it to function as the machine tool controller 50. The computer Cp here includes the numerical control device and the servo control device, and has a calculation unit, a display, an operation unit, etc. The calculation unit of the computer Cp has, for example, a CPU, RAM, ROM, etc.

[0016] The machine tool control device 50 controls the relative movement of the machine tool 80 to press the cutting tool 88 against the workpiece 86, and then causes further relative movement from that state, thereby cutting the workpiece 86 with the cutting tool 88. Furthermore, the machine tool control device 50 superimposes relative oscillation on the relative movement while cutting the workpiece 86, thereby intermittently generating air cuts in which the cutting tool 88 misses without cutting the workpiece 86, thereby breaking up the chips.

[0017] 2, the machine tool control device 50 has a machining command unit 11, a movement command unit 18, a swing command unit 28, an adder 21, a subtractor 22, a position / speed control unit 35, and a current control unit 36. The subtractor 22 may be read as a "position information acquisition unit."

[0018] The machining command unit 11 is configured so that a user can input a machining program, for example, by operating an operation unit while checking the display of a numerical control device or the like.

[0019] The movement command unit 18 calculates a "movement command C1" as a command value for relative movement based on a machining command Cx based on the machining program. The swing command unit 28 calculates a "swing command C2" as a command value for relative swing based on a machining condition X based on the machining program. Specifically, the swing command unit 28 calculates a repeatable sine wave command as the swing command C2.

[0020] The adder 21 acquires a movement command C1 from the movement command unit 18 and an oscillation command C2 from the oscillation command unit 28. Then, the adder 21 calculates a superimposed command C3 by adding, or superimposing, the oscillation command C2 to the movement command C1. Hereinafter, the relative position when the relative movement is performed according to the superimposed command C3 is referred to as the "command relative position Pc."

[0021] The subtractor 22 obtains the command relative position Pc from the adder 21 and also obtains the actual relative position Pa from the encoder 82. Then, the subtractor 22 calculates the position deviation ΔP by subtracting the actual relative position Pa from the command relative position Pc.

[0022] The position / speed control unit 35 acquires the position deviation ΔP from the subtractor 22. Then, based on the position deviation ΔP or its integrated value, it generates a torque command for the motor 81. In other words, the position / speed control unit 35 performs feedback control in cooperation with the subtractor 22.

[0023] The current control unit 36 ​​calculates a current value based on the torque command received from the position / speed control unit 35, and operates the motor 81 based on the calculated current value, thereby causing the cutting tool 88 to cut the workpiece 86, and also performing air cutting to break up the chips.

[0024] Next, the problem to be solved by this embodiment will be described with reference to FIG. 3 . The upper curve in FIG. 3 shows an example of the transition of the actual relative position Pa. That is, the upper curve is filled in black because the two curves are closely spaced horizontally, but it follows a wavy trajectory including relative oscillation. The dashed line overlapping the curve showing the actual relative position Pa shows the command relative position Pc. The fluctuation amplitude of the command relative position Pc is smaller than the fluctuation amplitude of the actual relative position Pa for most of periods t1 and t2, which will be described later. The lower curve shows the transition of the position deviation ΔP. This position deviation ΔP is also filled in black because the two curves are closely spaced horizontally, but it follows a wavy trajectory with approximately the same period as the actual relative position Pa. Note that in FIG. 3 , the position deviation ΔP is shown enlarged in the vertical axis direction. Therefore, the vertical length of "ΔP" in FIG. 3 is longer than the difference between "Pc" and "Pa" in the vertical axis direction.

[0025] Hereinafter, a period during which relative movement and relative oscillation are performed in a predetermined manner will be referred to as a "first period t1," and a period during which relative movement and relative oscillation are performed in a different manner will be referred to as a "second period t2." During the first period t1, mechanical resonance does not occur to a significant extent, so the position deviation ΔP is relatively small. In contrast, during the second period t2, mechanical resonance occurs to a significant extent, so the position deviation ΔP becomes larger than in the first period t1. This may result in poor machining of the workpiece 86, stoppage of the machine tool 80, damage to the cutting tool 88, etc.

[0026] In order to solve the above problems, the machine tool control device 50 further includes a threshold setting section 24, a state determining section 25, and an oscillation switching section 26, as shown in FIG.

[0027] The threshold setting unit 24 acquires the swing command C2 from the swing command unit 28, calculates a "command amplitude" as the amplitude of the command relative position Pc, and sets a value greater than the command amplitude as the threshold value ΔPth of the position deviation ΔP. Specifically, for example, the threshold setting unit 24 sets the threshold value ΔPth to be greater the larger the command amplitude. More specifically, the threshold setting unit 24 sets the threshold value ΔPth to, for example, the command amplitude multiplied by a predetermined value, or to which a predetermined value is added or subtracted. However, instead of this, the threshold value ΔPth may be set to be gradually larger as the command amplitude increases. In other words, the threshold value ΔPth may not only be calculated by multiplying the command amplitude by a fixed value, but also may be calculated by changing the predetermined value according to the magnitude of the command amplitude. The threshold setting unit 24 transmits the set threshold value ΔPth to the state determination unit 25.

[0028] The state determination unit 25 obtains the position deviation ΔP from the subtractor 22 and obtains the threshold value ΔPth from the threshold value setting unit 24. If the position deviation ΔP is equal to or less than the threshold value ΔPth, the state is determined to be stable, and if the position deviation ΔP exceeds the threshold value ΔPth, the state determination unit 25 determines that the state is unstable. In other words, the state determination unit 25 determines that the state is unstable if the position deviation ΔP exceeds the threshold value ΔPth. The state determination unit 25 transmits a determination result J to the oscillation switching unit 26.

[0029] The swing switching unit 26 transmits a switching command Cs to the swing command unit 28 on the condition that the determination result J indicates an unstable state. The process of transmitting this switching command Cs corresponds to a "switching process" as a process for switching the swing conditions.

[0030] Hereinafter, the vibration frequency of the command relative position Pc will be referred to as the "command frequency." The swing switching unit 26 transmits at least one of a command to change the command frequency and a command to reduce the command amplitude as a switching command Cs to the swing command unit 28. The swing command unit 28 switches the swing conditions for the relative swing based on this switching command Cs.

[0031] If the state is not stabilized even after the switching, the state determination unit 25 again determines that the state is unstable, and the oscillation switching unit 26 again issues a switching command Cs to switch the oscillation conditions again. Therefore, the switching of the oscillation conditions is repeated until the state is stabilized, that is, until the amplitude of the position deviation ΔP falls below the threshold value ΔPth. As a result, the state is finally stabilized.

[0032] The configuration and effects of this embodiment are summarized below.

[0033] The adder 21 creates a superimposed command C3 by superimposing the swing command C2 on the movement command C1. Based on the superimposed command C3, the position / speed control unit 35 and the current control unit 36 ​​control the motor 81 to cut the workpiece 86 and generate an air cut. This cuts the workpiece 86 and breaks up the chips generated thereby, thereby preventing problems such as the chips becoming tangled around the cutting tool 88.

[0034] The subtractor 22 obtains the command relative position Pc from the adder 21 and the actual relative position Pa from the encoder 82 to calculate the position deviation ΔP. The state determination unit 25 determines that an unstable state exists when the position deviation ΔP exceeds a threshold value ΔPth. The oscillation switching unit 26 switches the oscillation conditions for the relative oscillation when an unstable state is determined. This makes it possible to avoid the unstable state and suppress mechanical resonance.

[0035] As described above, according to this embodiment, it is possible to achieve both chip breaking and suppression of mechanical resonance. More specifically, the following effects are further obtained.

[0036] When an unstable state is determined, the oscillation switching unit 26 performs at least one of a process of changing the command frequency and a process of reducing the command amplitude as a switching process. When the command frequency is changed, the frequency of the relative oscillation is thereby shifted from the resonance frequency with respect to the machine tool 80, thereby making it possible to avoid mechanical resonance. When the command amplitude is reduced, the amplitude of the relative oscillation is thereby suppressed, thereby making it possible to suppress mechanical resonance. Therefore, these processes make it possible to suppress mechanical resonance.

[0037] The threshold setting unit 24 calculates the threshold value ΔPth based on the magnitude of the command amplitude. Specifically, the threshold setting unit 24 sets the threshold value ΔPth to a value greater than the command amplitude calculated by the swing command unit 28 each time, thereby making it possible to set the threshold value ΔPth to an appropriate magnitude.

[0038] Second Embodiment Next, a second embodiment will be described with reference to Figures 4 and 5. This embodiment will be described based on the first embodiment, focusing on differences from the first embodiment, and descriptions of the same or similar aspects to the first embodiment will be omitted as appropriate.

[0039] As shown in Fig. 4, the machine tool control device 50 of this embodiment further includes a deviation storage unit 23. The deviation storage unit 23 acquires and stores the position deviation ΔP from the subtractor 22. The threshold setting unit 24 calculates the threshold value ΔPth based on the position deviation history ΔPd stored in the deviation storage unit 23. Specifically, this is done as follows.

[0040] Hereinafter, as shown in FIG. 5 , the oscillation period of the position deviation ΔP will be referred to as the "deviation oscillation period ωΔ," and the oscillation period of the command relative position Pc will be referred to as the "command oscillation period ωc." As described above, the adder 21 superimposes a repeatable sine wave command on the movement command C1 as the oscillation command C2. As a result, the position deviation ΔP includes disturbances, such as cutting disturbances, while also including many of the same frequency components as the sine wave command described above. In other words, the command oscillation period ωc and the deviation oscillation period ωΔ are substantially equal. Hereinafter, the command oscillation period ωc and the deviation oscillation period ωΔ will be collectively referred to as the "oscillation period ω." Furthermore, below, an interval divided based on the oscillation period ω will be referred to as a "divided interval Sc," and the maximum value of the position deviation ΔP within the divided interval Sc will be referred to as the "intra-interval maximum deviation ΔPmax." However, instead of the maximum value of the position deviation ΔP, the maximum absolute value of the position deviation ΔP may be referred to as the "intra-interval maximum deviation ΔPmax."

[0041] The threshold setting unit 24 calculates the intra-section maximum deviation ΔPmax for each divided section Sc. Specifically, in this embodiment, the length of each divided section Sc is an integer multiple of half the length of the oscillation period ω. Therefore, the maximum value of the position deviation ΔP in each divided section Sc is the intra-section maximum deviation ΔPmax for that divided section Sc. The state in which the intra-section maximum deviation ΔPmax is at its minimum value ΔPmax_min can be considered to be the steady state of the position deviation ΔP, i.e., a stable state.

[0042] The threshold value setting unit 24 sets the threshold value ΔPth to a value obtained by multiplying the minimum value ΔPmax_min of the intra-section maximum deviation by a predetermined factor greater than 1. However, instead of this, the threshold value ΔPth may be set to a value obtained by multiplying the average value of the intra-section maximum deviations ΔPmax in a predetermined number of divided sections Sc by a predetermined factor greater than 1.

[0043] The threshold setting unit 24 transmits the set threshold ΔPth to the state determination unit 25, as shown in Fig. 4. The subsequent steps are the same as those in the first embodiment. Therefore, the state determination unit 25 performs state determination based on the received threshold ΔPth.

[0044] The configuration and effects of this embodiment are summarized below.

[0045] The deviation storage unit 23 stores the position deviation ΔP. The threshold setting unit 24 calculates the threshold value ΔPth based on the history ΔPd of the position deviation ΔP stored in the deviation storage unit 23. This makes it possible to set the threshold value ΔPth based on the position deviation ΔP up to now, rather than simply setting the threshold value ΔPth based on the command amplitude. This makes it possible to expect a more appropriate setting of the threshold value ΔPth.

[0046] The threshold setting unit 24 calculates the intra-section maximum deviation ΔPmax for each divided section Sc. The intra-section maximum deviation ΔPmax is calculated sequentially, and the calculated intra-section maximum deviation ΔPmax is compared with the stored intra-section maximum deviation ΔPmax. The smaller intra-section maximum deviation ΔPmax is constantly updated as the minimum value ΔPmax_min. This minimum value ΔPmax_min can be regarded as the steady state of the position deviation ΔP, i.e., the stable state. Since the threshold value ΔPth is determined based on this minimum value ΔPmax_min, it is expected that a more appropriate threshold value ΔPth can be set.

[0047] The adder 21 superimposes a repeatable sine wave command as the swing command C2 on the movement command C1. As a result, the position deviation ΔP also contains many of the same frequency components as this sine wave. Taking note of this characteristic, the period of the divided interval Sc is set to an integer multiple of half the period of the command swing period ωc. By setting the threshold value ΔPth using the maximum deviation in this divided interval Sc as the maximum deviation within the interval ΔPmax, a more appropriate threshold value ΔPth can be set.

[0048] The threshold setting unit 24 sets the threshold value ΔPth to a value obtained by multiplying the minimum value ΔPmax_min of the intra-section maximum deviation or the average value of the intra-section maximum deviations ΔPmax in the multiple divided sections Sc by a predetermined factor greater than 1. This allows a margin to be provided between the minimum value ΔPmax_min and the threshold value ΔPth, or between the average value and the threshold value ΔPth. This makes it possible to prevent the position deviation ΔP from exceeding the threshold value ΔPth due to external disturbances or the like, resulting in a determination that the state is unstable.

[0049] [Third Embodiment] Next, a third embodiment will be described with reference to Fig. 6. This embodiment will be described based on the second embodiment, focusing on differences from the second embodiment, and descriptions of the same or similar aspects to the second embodiment will be omitted as appropriate.

[0050] The machine tool control device 50 further includes a learning unit 33 and a second adder 21b. The learning unit 33 calculates a correction amount α based on the position deviation ΔP, and the second adder 21b adds the calculated correction amount α to the position deviation ΔP to reduce the position deviation ΔP. The learning unit 33 has a memory and correlates the oscillation phase and the position deviation ΔP within one or multiple oscillation periods and stores the correlation in the memory. The learning unit 33 then outputs the correction amount α, calculated based on the position deviation ΔP stored in the memory, to the second adder 21b at a timing that allows compensation for the phase delay of the oscillation operation according to the responsiveness of the motor 81. Generally, the higher the oscillation frequency, the larger the position deviation ΔP relative to the command amplitude. Therefore, by performing correction by the learning unit 33, the tracking ability of the actual relative oscillation relative to the periodic oscillation command C2 can be improved. As a result, the tracking ability of the actual relative position Pa relative to the command relative position Pc is also improved, reducing the position deviation ΔP. This ultimately improves machining accuracy.

[0051] As described above, the learning unit 33 calculates the correction amount α based on the position deviation ΔP and corrects the position deviation ΔP by adding the calculated correction amount α to the position deviation ΔP. This reduces the position deviation ΔP. The oscillation conditions are changed on the condition that the position deviation ΔP exceeds the threshold value ΔPth. This reduces the frequency of changing the oscillation conditions and is expected to further suppress mechanical resonance.

[0052] Other Embodiments The above-described embodiments can be modified, for example, as follows. Instead of switching the rocking conditions as the switching process, the rocking switching unit 26 may notify the user by at least one of displaying and sounding the fact that the rocking conditions need to be switched. Specifically, for example, the switching process may be performed by displaying the relevant information on a display. Furthermore, other examples include a case in which the rocking switching unit 26 has a speaker, and the switching process may be performed by causing the speaker to emit the relevant sound.

[0053] 22 Subtractor (position information acquisition unit) 23 Deviation storage unit 24 Threshold value setting unit 25 State determination unit 26 Swing switching unit 33 Learning unit 50 Machine tool control device 80 Machine tool 86 Workpiece 88 Cutting tool C1 Movement command C2 Swing command C3 Superimposition command Cp Computer Pa Actual relative position Pc Command relative position Pg Machine tool control program ΔP Position deviation ΔPth Threshold value ΔPmax Maximum deviation within interval ΔPmax_min Minimum value of maximum deviation within interval ω Swing period

Claims

1. A machine tool control device for controlling a machine tool having a cutting tool that cuts a workpiece, the machine tool control device generating an air cut in cutting the workpiece to break up chips by superimposing a swing command that commands relative swing between the workpiece and the cutting tool on a movement command that commands relative movement between the workpiece and the cutting tool, the machine tool control device comprising: a position information acquiring unit that acquires position information relating to a relative position between the workpiece and the cutting tool; a state determination unit that determines an unstable state when a position deviation, which increases as a difference between an actual relative position based on the position information and a command relative position based on the movement command and the swing command, increases, exceeds a threshold value; and a swing switching unit that performs a switching process for switching a swing condition of the relative swing on condition that the unstable state is determined; A machine tool control device having the above configuration.

2. 2 . The machine tool control device according to claim 1 , wherein the swing switching unit performs, as the switching process, at least one of a process of changing a frequency of the relative swing and a process of reducing an amplitude of the relative swing based on the swing command.

3. The machine tool control device according to claim 1 , wherein the swing switching unit performs, as the switching process, a process of notifying a user of the need to switch the swing conditions by at least one of a display and a sound.

4. a threshold setting unit that sets the threshold to a value greater than the amplitude of the relative swing based on the swing command; The machine tool control device according to any one of claims 1 to 3.

5. 4. The machine tool control device according to claim 1, further comprising: a deviation storage unit which stores the position deviation; and a threshold setting unit which sets the threshold based on a history of the position deviation stored in the deviation storage unit.

6. 6. The machine tool control device according to claim 5, wherein the threshold setting unit calculates a maximum deviation within an interval as a maximum value of the position deviation or a maximum absolute value of the position deviation for each divided interval divided based on a swing period as a period of the relative swing, and determines the threshold based on the maximum deviation within the interval.

7. 7. The machine tool control device according to claim 6, wherein the length of each of the divided sections is an integer multiple of half the length of the oscillation period.

8. 7. The machine tool control device according to claim 6, wherein the threshold setting unit sets the threshold value to a value obtained by multiplying the intra-section maximum deviation in the divided section in which the intra-section maximum deviation is smallest, or the average value of the intra-section maximum deviations in a plurality of the divided sections, by a predetermined multiplying factor greater than 1.

9. 4. The machine tool control device according to claim 1, further comprising a learning unit that calculates a correction amount for the position deviation based on the position deviation, and corrects the position deviation by adding the calculated correction amount to the position deviation.

10. A machine tool control device for controlling a machine tool having a cutting tool for cutting a workpiece, which generates an air cut in cutting the workpiece to break up chips by superimposing a swing command for commanding relative swing between the workpiece and the cutting tool on a movement command for commanding relative movement between the workpiece and the cutting tool, A machine tool control program for causing a computer to function, The computer further comprises: a position information acquiring unit that acquires position information relating to a relative position between the workpiece and the cutting tool; a state determination unit that determines an unstable state when a position deviation, which increases as a difference between an actual relative position based on the position information and a command relative position based on the movement command and the swing command, increases, exceeds a threshold value; and a swing switching unit that performs a switching process for switching a swing condition of the relative swing on condition that the unstable state is determined; A machine tool control program that functions as a