Program conversion device, numerical control device, and program conversion method

The program conversion device optimizes machining programs by correcting defective blocks to reduce time and improve accuracy by maintaining tool postures within allowable ranges, addressing variations that cause inefficiencies and deviations in existing systems.

WO2026133505A1PCT designated stage Publication Date: 2026-06-25MITSUBISHI ELECTRIC CORP

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
MITSUBISHI ELECTRIC CORP
Filing Date
2024-12-19
Publication Date
2026-06-25

AI Technical Summary

Technical Problem

Existing numerical control systems fail to optimize machining time and accuracy when tool postures vary significantly, leading to increased time due to deceleration and potential deviations from intended shapes, especially when not near singular postures.

Method used

A program conversion device that extracts and corrects defective command blocks in machining programs to ensure tool postures stay within allowable ranges, using methods like substitution, deletion, and merging to minimize deceleration and maintain accuracy.

Benefits of technology

The solution ensures efficient machining time reduction and improved accuracy by converting machining programs to avoid deceleration and maintain tool position within preset tolerances, regardless of proximity to singular postures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024045019_25062026_PF_FP_ABST
    Figure JP2024045019_25062026_PF_FP_ABST
Patent Text Reader

Abstract

A program conversion device (1) comprises: a defective block extraction unit (131) that refers to a processing program (31) that is used when the tool posture, which is the posture of a tool relative to a workpiece, is controlled by a rotary shaft and that includes a plurality of command blocks indicating the tool posture, and extracts, from the processing program, a defective block that is a command block causing a defect in processing due to the tool posture; and a command block correction unit (132) that corrects the defective block such that an increase in the movement time of the rotary shaft is suppressed and the tool posture indicated by the extracted defective block falls within a preset allowable range with respect to a reference position indicating the tool posture serving as a reference.
Need to check novelty before this filing date? Find Prior Art

Description

Program conversion device, numerical control device, and program conversion method

[0001] The present disclosure relates to a program conversion device, a numerical control device, and a program conversion method for converting a machining program that controls the operation of a tool posture into an appropriate machining program.

[0002] A machine tool controlled by a numerical control device performs machining so as to achieve a tool posture commanded by a machining program. In this machine tool, for example, when the tool posture approaches a singular posture (a state in which the central axis of the tool is perpendicular to the main surface of the table), the machining time increases and the machining accuracy decreases.

[0003] The numerical control device described in Patent Document 1 determines the rotational axis angle of the rotational axis so that the change in the tool posture from the previous tool posture is restricted when the tool posture read from the machining program is within a specific tool posture range. By doing so, when the tool posture approaches a singular posture, the increase in the rotational movement time of the rotational axis is suppressed and the machining time is reduced.

[0004] Japanese Patent No. 5425342

[0005] However, in the technique of Patent Document 1 above, only the case where the tool posture is close to the singular posture is focused on. Regardless of whether the tool posture is close to the singular posture, the machining time may increase due to variations in the tool postures indicated by a plurality of read commands, and when the tool posture is not close to the singular posture, the machining time increases. Further, in Patent Document 1, when determining the rotational axis angle, if the change width of the change in the tool posture does not fall within a predetermined allowable width based on, for example, the allowable error related to the rotational axis angle set for the machining program generated by CAM (Computer-Aided Manufacturing) or the like, the position of the tool may deviate from the path along the command shape defined by CAD (Computer-Aided Design) or the like, and the intended machining shape may not be machined.

[0006] This disclosure is made in view of the above, and aims to provide a program conversion device that can ensure machining to the intended shape while reducing machining time, even when the tool position is not close to a specific position.

[0007] To solve the above-mentioned problems and achieve the objective, the program conversion device of this disclosure is used when controlling the tool posture, which is the relative position of the tool with respect to the workpiece, by a rotary axis. It includes a defect block extraction unit that refers to a machining program which includes a plurality of command blocks indicating the tool posture and extracts defect blocks, which are command blocks that cause machining defects due to the tool posture, from the machining program. Furthermore, the program conversion device of this disclosure includes a command block correction unit that corrects the defect blocks so that the increase in the movement time of the rotary axis is suppressed and the tool posture indicated by the extracted defect block falls within a preset tolerance range with respect to a reference position indicating a reference tool posture.

[0008] The program conversion device described herein has the effect of ensuring that the intended machining shape can be achieved while reducing machining time, even when the tool position is not close to a specific position.

[0009] A diagram showing the configuration of a program conversion device according to an embodiment. A diagram illustrating the operation of a tool in a faulty block converted by the program conversion device according to an embodiment. A flowchart showing the processing procedure of a process executed by the program conversion device according to an embodiment. A flowchart showing the processing procedure of a process in which the program conversion device according to an embodiment extracts a faulty block. A diagram illustrating the process in which the program conversion device according to an embodiment sets a command block to a faulty block or an appropriate block based on the movement distance of the tool tip position. A flowchart showing the processing procedure of a process in which the program conversion device according to an embodiment converts a faulty block. A flowchart showing the processing procedure of a process in which the program conversion device according to an embodiment divides a command block. A diagram illustrating an example of a process in which the program conversion device according to an embodiment divides a command block. A flowchart showing the processing procedure of a process in which the program conversion device according to an embodiment combines command blocks. A diagram illustrating an example of a process in which the program conversion device according to an embodiment combines command blocks. A diagram illustrating an example of a process in which the program conversion device according to an embodiment converts a command block. A diagram showing the configuration of a numerical control device having the program conversion device according to an embodiment. A diagram showing an example of the configuration of a processing circuit when the processing circuit of the program conversion device according to an embodiment is implemented with a processor and memory. A diagram showing an example of the configuration of a processing circuit when the processing circuit of the program conversion device according to an embodiment is configured with dedicated hardware.

[0010] The program conversion device, numerical control device, and program conversion method according to embodiments of this disclosure will be described in detail below with reference to the drawings.

[0011] Embodiment. Figure 1 is a diagram showing the configuration of a program conversion device according to an embodiment. The program conversion system 100 includes a program conversion device 1, a numerical control (NC) device 2A, and a machine tool 3 equipped with a tool. The program conversion device 1 is a computer that converts a machining program 31 for controlling machining using a tool into a post-processing program 35, which is an appropriate machining program.

[0012] The program conversion device 1 generates a converted machining program 35 by converting the machining program 31 executed by the numerical control device 2A in a way that reduces machining time and improves machining accuracy. Specifically, the program conversion device 1 gives the tool position an allowable range of position, and converts the rotation axis commands among the servo axis commands described in the machining program 31 to appropriate rotation axis commands within the range in which the tool position falls within this allowable range. In this way, the program conversion device 1 eliminates the adverse effects on machining caused by the deceleration of the rotation axis. In other words, the program conversion device 1 reduces machining time and improves machining accuracy by converting the machining program 31 to the converted machining program 35. The conversion of the machining program 31 performed by the program conversion device 1 includes substitution, deletion, division, and merging of command blocks contained in the machining program 31.

[0013] The program conversion device 1 outputs the generated converted machining program 35 to the numerical control device 2A. The machining program 31 and the converted machining program 35 are, for example, an NC program and a motion program. The machining program 31 and the converted machining program 35 include a plurality of command blocks described by command codes for the machine tool 3.

[0014] The numerical control device 2A is a computer that numerically controls the machine tool 3, which processes a workpiece using a tool. The numerical control device 2A controls the machine tool 3 using the converted processing program 35, thereby controlling the tip position of the tool, the orientation of the tool, and other parameters.

[0015] The numerical control device 2A uses the converted machining program 35 generated by the program conversion device 1 to machine the workpiece while controlling the relative tool posture and tool tip position (tool tip position) with respect to the workpiece placed on the table using the rotation axis and linear axis. The tool posture information includes information on the axial direction of the tool.

[0016] The numerical control device 2A outputs movement commands corresponding to the post-processing program 35 to the X-axis amplifier, Y-axis amplifier, Z-axis amplifier, A-axis amplifier, B-axis amplifier, and C-axis amplifier, which are included in the servo amplifier. As a result, the X-axis amplifier, Y-axis amplifier, Z-axis amplifier, A-axis amplifier, B-axis amplifier, and C-axis amplifier output voltage commands to the X-axis servo motor, Y-axis servo motor, Z-axis servo motor, A-axis servo motor, B-axis servo motor, and C-axis servo motor, respectively, to drive each motor.

[0017] In the machine tool 3, machining is performed while moving the movable parts by driving each axis to move to the position commanded by the post-conversion machining program 35. The machine tool 3 is, for example, a 5-axis machining center having three linear axes (translational axes) X, Y, and Z axes, and two rotary axes B and C axes. One of the rotary axes, the B axis or the C axis, is the first rotary axis, and the other rotary axis is the second rotary axis.

[0018] Furthermore, machine tool 3 may be a 6-axis machining center having three rotational axes: A-axis, B-axis, and C-axis. In this case, one of the A-axis, B-axis, and C-axis is the first rotational axis, and one of the other rotational axes is the second rotational axis. The following description will mainly focus on the case where machine tool 3 is a 5-axis machining center, but machine tool 3 may also be a 6-axis machining center.

[0019] The X-axis is the axis through which the X-axis servo motor moves the tool linearly in the X-axis direction. The Y-axis is the axis through which the Y-axis servo motor moves the tool linearly in the Y-axis direction. The Z-axis is the axis through which the Z-axis servo motor moves the tool linearly in the Z-axis direction. The X-axis, Y-axis, and Z-axis are, for example, orthogonal to each other.

[0020] The A-axis is the axis through which the A-axis servo motor rotates the tool. The A-axis servo motor rotates the arm on which the tool is mounted, for example, around the X-axis, thereby rotating the tool around the X-axis.

[0021] The B-axis is the axis through which the B-axis servo motor rotates the tool. The B-axis servo motor rotates the arm on which the tool is mounted, for example, around the Y-axis, thereby rotating the tool around the Y-axis.

[0022] The C-axis is the axis through which the C-axis servo motor rotates the workpiece. The C-axis servo motor rotates the workpiece around the Z-axis by rotating the table on which the workpiece is placed, for example, around the Z-axis. The workpiece is machined by a rotating tool while it is placed on the main surface (top surface) of the table.

[0023] The program conversion device 1 comprises a program reading unit 11, a conversion information input unit 12, a program conversion unit 13, and a program output unit 14. The program conversion unit 13 includes a faulty block extraction unit 131 and a command block correction unit 132.

[0024] The program reading unit 11 reads the machining program 31 to be converted, which is generated by CAM (Computer-Aided Manufacturing) or the like, into the program conversion device 1. The machining program 31 is used to control the tool position, which is the relative position of the tool to the workpiece, by the rotation axis, and is a program that includes multiple command blocks indicating the tool position. The program reading unit 11 transmits the read machining program 31 to the defect block extraction unit 131.

[0025] The conversion information input unit 12 reads information stored in the information storage device 32, such as a database (hereinafter referred to as "conversion information"), and transmits it to the program conversion unit 13. The conversion information is the conversion information used by the program conversion unit 13 when it performs conversion processing on the machining program 31. The conversion information includes information such as tool length, allowable width, conversion range, and conversion method.

[0026] The tool length is the dimension (length) of the tool used by the machine tool 3 for machining. The tolerance width is the allowable range of tool positions. The tolerance width is the width of the tool position that is allowed (tolerance width from the reference position) that is preset with respect to a reference position that indicates a standard tool position. The tolerance width is set, for example, for each numerical control device 2A. Note that the preset tolerance width may be set, for example, based on the tolerance width set in the CAM for the ideal tool position and tool position.

[0027] The conversion range is the range of command blocks to be converted among the command blocks included in the machining program 31. In other words, the conversion range is information indicating which command blocks to convert among the command blocks included in the machining program 31.

[0028] The conversion method is the type of conversion method applied to the processing program 31. The conversion method includes at least one of the following: replacement, deletion, division, and merging of command blocks. The program conversion unit 13 performs the conversion process on the command blocks included in the conversion range using the conversion method included in the conversion method.

[0029] The program conversion unit 13 uses the conversion information to convert the machining program 31 into a post-conversion machining program 35.

[0030] The program conversion unit 13 extracts command blocks from the machining program 31 that cause machining problems (hereinafter sometimes referred to as "problem blocks") and converts these problem blocks into appropriate command blocks that do not cause machining problems (hereinafter sometimes referred to as "appropriate blocks"). Problem blocks are command blocks that decelerate the rotation axis (feed axis) or are unnecessary for machining. In the following, the process of extracting problem blocks and converting them into appropriate blocks may be referred to as the extraction and conversion process.

[0031] The fault block extraction unit 131 of the program conversion unit 13 sets the command blocks specified in the conversion range of the conversion information as command blocks to be converted from among the multiple command blocks included in the machining program 31. Based on the tool length and the like, the fault block extraction unit 131 extracts command blocks that cause machining problems due to the tool position from among the command blocks to be converted as fault blocks. That is, the fault block extraction unit 131 refers to the machining program 31 and extracts fault blocks from the machining program 31 that are command blocks that cause machining problems due to the tool position.

[0032] A faulty block that decelerates the rotating shaft is a command block that increases machining time. Furthermore, a faulty block that decelerates the rotating shaft is a command block that causes machining defects, leading to a decrease in machining accuracy and the occurrence of machining scratches. Additionally, a command block that is unnecessary for machining is a command block that does not affect the machined shape of the workpiece, but it is a command block that may increase machining time or decrease machining accuracy.

[0033] The command block correction unit 132 of the program conversion unit 13 corrects (converts) the defective blocks extracted by the defective block extraction unit 131 so that the tool position suppresses the increase in machining time and stays within an allowable range. In other words, the command block correction unit 132 sets an allowable range for the tool position and converts the defective blocks into appropriate blocks that do not decelerate the rotation axis so that the tool position stays within the set allowable range. In other words, the command block correction unit 132 converts the defective blocks into appropriate blocks so as not to decelerate the rotation axis within the range in which the tool position stays within the allowable range. In this way, the command block correction unit 132 corrects the defective blocks so that the increase in the movement time of the rotation axis is suppressed and the tool position indicated by the defective block stays within an allowable range. The command block correction unit 132 converts the defective blocks into appropriate blocks by a conversion method (at least one of splitting, combining, replacing, and deleting) defined in the conversion information.

[0034] The command block correction unit 132 extracts faulty blocks that decelerate the rotation axis based on the calculation processing performed by the numerical control device 2A on the machining program 31. In other words, when the numerical control device 2A executes the machining program 31, it extracts command blocks that cause machining problems due to the tool position as faulty blocks.

[0035] The command block correction unit 132 then converts defective blocks into appropriate blocks based on the calculation process that the numerical control device 2A performs on the machining program 31. In other words, when the numerical control device 2A executes the machining program 31, the unit converts defective blocks into appropriate blocks so as not to decelerate the rotation axis, within a range where the tool position is within the allowable width.

[0036] The command block correction unit 132 converts the defective block into an appropriate block and sends the resulting machining program 31 to the program output unit 14 as a converted machining program 35. However, the command block correction unit 132 does not convert the machining program 31 if the tool position does not fit within the allowable width. This is because if the tool position does not fit within the allowable width, the tool position may deviate from the path along the command shape defined in CAD or the like, making it impossible to machine the intended shape.

[0037] The program output unit 14 outputs the converted processing program 35 to the outside of the program conversion device 1. Specifically, the program output unit 14 transmits the converted processing program 35 to the numerical control device 2A.

[0038] The program conversion device 1 according to this embodiment converts defective blocks into appropriate blocks for all tool positions, not just when the tool position is a singular position or near a singular position. A singular position is the position in the machine tool 3 where the rotation axis of the tool is 0 degrees (the main surface of the table on which the tool is placed and the central axis of the tool intersect perpendicularly). In the singular position, the angle of the rotation axis of the table is not uniquely determined, and any angle can be selected.

[0039] Here, we will explain that faulty blocks can occur in various tool positions, not just when the tool position is a singular position or near a singular position. Figure 2 is a diagram illustrating the operation of the tool in a faulty block converted by the program conversion device according to the embodiment. Here, we will explain an example of a change in the tool position of the tool 40 that decelerates the rotation axis. In Figure 2, we will explain the case in which the tool 40 processes the workpiece W by moving the tool 40 in a direction parallel to the XZ plane.

[0040] The tool 40 processes the workpiece W while changing its tool position TP. Figure 2 shows the case where the tip position (X, Y, Z) of the tool 40 moves from tool tip position N1 to tool tip position N7. For example, in the command block for tool tip positions N1 to N4, the B-axis command for tool position TP is a movement in the +B direction from tool tip position N1 to N2, a movement in the -B direction from tool tip position N2 to N3, and a movement in the +B direction from tool tip position N3 to N4. Therefore, between the command block for tool tip position N2 to N3, deceleration occurs in the rotation axis of the B-axis due to the B-axis reversal operation.

[0041] Similarly, in the command blocks for tool tip positions N4 to N7, the B-axis command for tool position TP is a movement in the +B direction from tool tip position N4 to N5, a movement in the -B direction from tool tip position N5 to N6, and a movement in the +B direction from tool tip position N6 to N7. Therefore, between the command blocks for tool tip positions N5 to N6, deceleration occurs in the rotation axis of the B-axis due to the B-axis reversal operation. At points where the B-axis reverses, such as between the command blocks for tool tip positions N2 to N3 and between the command blocks for tool tip positions N5 to N6, deceleration of the rotation axis of the B-axis occurs, increasing machining time. In addition, at points where the B-axis reverses, if there are no deceleration points around the reversal point, machining defects may occur due to the speed difference.

[0042] Thus, the deceleration of the rotation axis of the B-axis occurs not only in the singular posture or in the vicinity of the singular posture. That is, the increase in processing time or the decrease in processing accuracy (such as processing scratches) occurs not only in the singular posture or in the vicinity of the singular posture. Thus, in the machining program 31 created by the CAM, the commands for the tool posture may vary not only in the vicinity of the singular posture.

[0043] In the present embodiment, the program conversion device 1 converts a defective block that causes a problem such as a reverse operation of the B-axis into an appropriate block that avoids the problem such as the reverse operation of the B-axis.

[0044] The command block correction unit 132 sets an allowable range for the tool posture, and converts the rotation axis command (tool posture command) of the machining program 31 within the range where the tool posture falls within the allowable range. Specifically, the command block correction unit 132 converts the tool posture in the defective block extracted by the defective block extraction unit 131 into a command block of an appropriate tool posture within the range of the allowable range preset for the numerical control device 2A.

[0045] As a conversion process for the defective block, the command block correction unit 132 executes splitting, combining, replacement, deletion, etc. of the command blocks. When combining command blocks, the command block correction unit 132 combines the defective block with other command blocks. Also, when splitting a command block, the command block correction unit 132 splits one defective block into a plurality of command blocks. Also, when replacing a command block, the command block correction unit 132 replaces the defective block with other command blocks. Also, when deleting a command block, the command block correction unit 132 deletes the defective block.

[0046] When the defect block extraction unit 131 extracts the command block at the tool tip position N2 as a defect block, the command block correction unit 132 sets the command block at the tool tip position N2 as the command block to be converted and executes the conversion process. The command block correction unit 132 executes a conversion process on the defect block, for example, so that deceleration does not occur due to the reversal of the B-axis command. Specifically, the command block correction unit 132 replaces the command block at the tool tip position N2 so that the tool posture at the tool tip position N2 becomes an intermediate posture between the tool postures at the tool tip position N1 and the tool tip position N3 within the range where the tool posture fits within the allowable range.

[0047] FIG. 3 is a flowchart showing the processing procedure of the process executed by the program conversion device according to the embodiment. The program conversion device 1 reads conversion information and the machining program 31 to be converted (step S10). Specifically, the program reading unit 11 of the program conversion device 1 reads the machining program 31 to be converted from an external device such as a CAM. The conversion information input unit 12 reads the conversion information from the information storage device 32. Note that the program conversion device 1 may read the conversion information and the machining program 31 in any order.

[0048] The program reading unit 11 transmits the read machining program 31 to the defect block extraction unit 131 of the program conversion unit 13. The conversion information input unit 12 transmits the read conversion information to the program conversion unit 13.

[0049] The defect block extraction unit 131 extracts a command block to be converted from among a plurality of command blocks included in the machining program 31 based on the conversion range included in the conversion information. The defect block extraction unit 131 extracts a command block that causes a problem in machining due to deceleration of the rotating axis, which is a feed axis, from among the command blocks to be converted.

[0050] Specifically, the defective block extraction unit 131 calculates the post-machined workpiece shape, which is the shape of the workpiece after processing, based on a plurality of command blocks to be converted (step S20). The post-machined workpiece shape corresponds to the command points (X, Y, Z, A, B, C) corresponding to the commands to the servo axes (rotation axis commands and linear axis commands) included in the command blocks. Therefore, the defective block extraction unit 131 calculates the post-machined workpiece shape by calculating the command points included in the command blocks based on a plurality of command blocks.

[0051] The command points correspond to the position and orientation of the tool. Specifically, among the command points calculated by the fault block extraction unit 131, the command point (X, Y, Z) indicates the coordinates of the tool tip position, and the command point (A, B, C) indicates the tool orientation. Thus, the command points calculated by the fault block extraction unit 131 include information on the coordinates of the tool tip position and information on the tool orientation.

[0052] The faulty block extraction unit 131 calculates command points for multiple command blocks, thereby calculating changes in command points across multiple command blocks. Specifically, by calculating command points for multiple command blocks, the faulty block extraction unit 131 calculates the direction of movement of the tool tip position and the distance of movement of the tool tip position across multiple command blocks. Since the direction of movement and distance of movement of the tool tip position (the trajectory of the tool's movement) change according to the tool posture, the faulty block extraction unit 131 calculates the direction of movement and distance of movement of the tool tip position according to the tool posture. Based on the direction of movement and distance of movement of the tool tip position, the faulty block extraction unit 131 extracts faulty blocks (step S25).

[0053] In this way, the defective block extraction unit 131 calculates the shape of the workpiece after machining based on a plurality of command blocks. Then, the defective block extraction unit 131 calculates the direction and distance of movement of the tool tip position based on the command points corresponding to the shape of the workpiece after machining, and extracts defective blocks based on the direction and distance of movement of the tool tip position.

[0054] Specifically, the defect block extraction unit 131 extracts command points for the tool corresponding to the tool's position and orientation based on the command blocks included in the machining program 31. The defect block extraction unit 131 then calculates the change in command points based on each command point for the multiple command blocks. Furthermore, the defect block extraction unit 131 extracts defect blocks based on the change in command points.

[0055] As mentioned above, the faulty blocks that cause problems during machining are command blocks that increase machining time due to deceleration of the rotating shaft, and command blocks that result in machining defects such as machining scratches. In addition, faulty blocks may also include command blocks that are unnecessary for machining.

[0056] The defect block extraction unit 131 may extract as a defect block at least one of the following: a command block in which the amount of change in the length between command blocks (the length of the distance the tool tip position moves) changes by a value greater than a specific value; a command block in which the amount of change in the tool posture changes by a value greater than a reference value; a command block in which the rotation axis (B axis or C axis) that rotates the tool posture is reversed; and a command block that is unnecessary for machining.

[0057] A command block in which the amount of change in tool posture changes significantly more than a reference value is a command block in which the direction of movement of the tool tip position changes significantly more than a first reference value, or a command block in which the distance of movement of the tool tip position changes significantly more than a second reference value.

[0058] The defective block extraction unit 131 may extract candidate defective blocks (candidate defective blocks) based on the shape of the workpiece after machining, and determine whether or not the rotation axis actually slows down for each candidate defective block.

[0059] The defect block extraction unit 131 sets defect blocks that cause deceleration in the rotating shaft from among the defect block candidates extracted based on the shape after workpiece processing as defect blocks to be converted. The defect block extraction unit 131 also sets command blocks that are unnecessary for processing as defect blocks to be converted.

[0060] The defective block extraction unit 131 sets an allowable width for the tool position for the extracted defective blocks. The defective block extraction unit 131 converts the tool position command (rotation axis command), which is a command for the tool position included in the machining program 31, so that the tool position fits within the set allowable width (step S30). In other words, the defective block extraction unit 131 optimizes (corrects) the rotation axis command so that the tool position fits within the set allowable width. As a result, the defective block extraction unit 131 optimizes the tool path of the machining program 31, which includes the rotation axis command (rotation angle command), and optimizes the machining program 31. Details of the method for converting the rotation axis command will be described later. The rotation axis command is a command that determines the tool position among the commands included in the machining program 31.

[0061] The program conversion unit 13 determines whether the extraction and conversion process has been completed for all command blocks (step S40). If the extraction and conversion process has not been completed for any command block (step S40, No), the program conversion unit 13 returns to step S20 and executes the processes of steps S20 to S40. The program conversion unit 13 repeats the processes of steps S20 to S40 for all command blocks until the extraction and conversion process is completed for all command blocks. If the extraction and conversion process is completed for all command blocks (step S40, Yes), the program conversion unit 13 sends the converted machining program 35, in which the rotation axis command has been converted for the machining program 31, to the program output unit 14. The converted machining program 35 includes command blocks in which the rotation axis command has been converted because they are defective blocks, and command blocks in which the rotation axis command has not been converted because they are not defective blocks.

[0062] The program output unit 14 transmits the converted machining program 35 to the numerical control device 2A (step S50). As a result, the numerical control device 2A uses the converted machining program 35, in which the defective blocks have been converted into appropriate blocks, to perform machining on the workpiece.

[0063] In this way, the program conversion device 1 converts the processing program 31 to a post-processing program 35 by converting defective blocks to appropriate blocks. As a result, the program conversion device 1 can generate a post-processing program 35 that shortens processing time and reduces processing defects.

[0064] Figure 4 is a flowchart showing the processing procedure for extracting defective blocks by the program conversion device according to the embodiment. The defective block extraction unit 131 receives the processing program 31 from the program reading unit 11. That is, the defective block extraction unit 131 receives the command blocks included in the processing program 31 from the program reading unit 11 (step S110).

[0065] The defective block extraction unit 131 extracts the command blocks to be converted from among the multiple command blocks included in the machining program 31 based on the conversion range included in the conversion information. Based on the multiple command blocks to be converted, the defective block extraction unit 131 calculates the direction of movement and the distance of movement of the tool tip position (step S120).

[0066] The faulty block extraction unit 131 calculates the change in the direction of movement and the change in the distance of movement for multiple command blocks. The change in the direction of movement is, for example, the change between the B axis and the C axis.

[0067] The faulty block extraction unit 131 determines that the amount of change in the direction of movement is large when the rotation on the B axis or the rotation on the C axis changes to the point where it is eliminated, or when the rotation on the B axis or the C axis changes to the point where it is started.

[0068] For example, if the rotation changes from only on the B axis to only on the C axis, or from only on the C axis to only on the B axis, the faulty block extraction unit 131 determines that the amount of change in the direction of movement is large.

[0069] Furthermore, the faulty block extraction unit 131 determines that the amount of change in the direction of movement is large when the rotation changes from rotation on the B axis and C axis to rotation on the B axis only, when the rotation changes to rotation on the C axis only, or when the rotation on the B axis and C axis stops.

[0070] In the case of a three-axis rotation system, the change between the A, B, and C axes represents the change in the direction of movement. The change in travel distance is the change in the rotation angle (axis angle) of the B axis and the change in the rotation angle of the C axis. In the case of a three-axis rotation system, the change in travel distance includes the change in the rotation angle of the A axis.

[0071] The faulty block extraction unit 131 determines whether the amount of change in tool posture for a plurality of command blocks is greater than a reference value for the amount of change. For example, the faulty block extraction unit 131 determines whether the amount of change in the direction of movement of the tool tip position is greater than a first reference value, which is a reference value for the amount of change in the direction of movement (step S130).

[0072] If the amount of change in the direction of movement of the tool tip position is greater than a first reference value (step S130, Yes), the faulty block extraction unit 131 sets the command block that is causing the large change in the direction of movement as a faulty block (step S140). The faulty block extraction unit 131, for example, adds fault information to the faulty block to indicate that it is a faulty block, and writes the information of the faulty block with the added fault information to the buffer as block information.

[0073] The buffer is a memory buffer area where block information is written by the faulty block extraction unit 131 and which can be accessed by the command block correction unit 132. The buffer may be located anywhere within the program conversion device 1.

[0074] Block information includes details such as the start and end points of the tool tip position, line segment length, and axial ratio. The axial ratio is, for example, the ratio of the distance traveled in the X-axis direction from the start point to the end point to the distance traveled in the Y-axis direction.

[0075] If the amount of change in the direction of movement of the tool tip position is less than or equal to the first reference value (step S130, No), the defective block extraction unit 131 determines whether the amount of change in the distance traveled by the tool tip position is greater than the second reference value, which is the reference value for the change in the distance traveled (step S150).

[0076] If the change in the distance traveled by the tool tip is greater than the second reference value (step S150, Yes), the faulty block extraction unit 131 sets the command block that is causing the large change in the distance traveled as a faulty block (step S140). Then, the faulty block extraction unit 131 adds fault information to the faulty block to indicate that it is a faulty block, and writes the information of the faulty block with the added fault information to the buffer as block information.

[0077] If the change in the travel distance of the tool tip position is less than or equal to a second reference value (step S150, No), the faulty block extraction unit 131 sets the command block whose change in travel distance is less than or equal to the second reference value as an appropriate block (step S160). That is, the faulty block extraction unit 131 sets the command block whose change in the direction of movement is less than or equal to a first reference value and whose change in travel distance is less than or equal to a second reference value as an appropriate block. For example, the faulty block extraction unit 131 adds appropriate information to the appropriate block to indicate that it is an appropriate block, and writes the information of the appropriate block to which the appropriate information has been added as block information to the buffer.

[0078] In this way, the faulty block extraction unit 131 sets command blocks as faulty blocks if the amount of change in the direction of movement is greater than the first reference value, or if the amount of change in the distance of movement is greater than the second reference value.

[0079] Note that the process in step S130 and the process in step S150 may be executed in any order. The faulty block extraction unit 131 repeats the processes in steps S110 to S160.

[0080] The defective block extraction unit 131 may also assign each command block to either a defective block or a suitable block based on the amount of change in the tool position (in the axial direction of the tool). For example, the defective block extraction unit 131 sets a command block as a defective block when the amount of change in the axial direction of the tool is greater than a third reference value. Alternatively, the defective block extraction unit 131 sets a command block as a suitable block when the amount of change in the axial direction of the tool is less than or equal to the third reference value.

[0081] Furthermore, as mentioned above, the faulty block extraction unit 131 may also sort each command block into either a faulty block or a suitable block based on whether or not the B-axis command or C-axis command of the command block is reversed.

[0082] In this way, the defective block extraction unit 131 refers to multiple command blocks to be converted and sets each command block to be converted as either a defective block requiring conversion of the rotation axis command or an appropriate block that does not require conversion of the rotation axis command. That is, the defective block extraction unit 131 globally refers to the group of command blocks included in the machining program 31 and assigns each command block to either a defective block or an appropriate block.

[0083] The defect block extraction unit 131 calculates the workpiece shape after machining based on multiple command blocks, for example. This workpiece shape after machining corresponds to changes in command points (X, Y, Z, A, B, C) that correspond to the tool's orientation and tip position across multiple command blocks. The defect block extraction unit 131 extracts defect blocks from the machining program 31 based on the changes in command points. Since the defect block extraction unit 131 extracts defect blocks globally across multiple command blocks based on changes in the tool tip position and changes in the tool's orientation, it is possible to accurately extract defect blocks.

[0084] A defective block is a command block that is unnecessary (can be omitted) or has a negative impact on machining. A suitable block is a command block that is absolutely necessary for machining, and does not require conversion of the rotation axis command. For example, when CAM outputs a machining program 31 based on CAD data, it outputs the machining program 31 with a quantization error of about the tolerance width set in CAM relative to the ideal tool position and tool orientation, so a machining program 31 with varying tool position and tool orientation may be created. This variation can have a negative impact on machining the model originally defined in the CAD data, so in this embodiment, such command blocks are designated as defective blocks.

[0085] For example, when the tool position changes as shown in Figure 2, the fault block extraction unit 131 calculates the tool position over multiple command blocks from tool tip positions N1 to N4. The fault block extraction unit 131 also calculates the rotation axis command over multiple command blocks from tool tip positions N4 to N7. Then, the fault block extraction unit 131 sets the command block (rotation axis command) at tool tip position N2 and the command block at tool tip position N5 as fault blocks where the B axis command is reversed. The fault block extraction unit 131 may also calculate the tool position over multiple command blocks from tool tip positions N1 to N7.

[0086] Furthermore, the defective block extraction unit 131 may set a command block as a defective block or an appropriate block by combining at least two of the following determinations: whether the amount of change in the direction of movement is greater than a first reference value; whether the amount of change in the distance of movement is greater than a second reference value; whether the amount of change in the axial direction of the tool (rotation angle) is greater than a third reference value; and whether the B-axis command or C-axis command of the command block is reversed.

[0087] Furthermore, the faulty block extraction unit 131 may determine whether a command block is passing through an unusual orientation or near an unusual orientation, and based on the determination result, set the command block as a faulty block or an appropriate block.

[0088] In this way, the defective block extraction unit 131 can identify each command block as either a defective block or an appropriate block, making it possible to identify variations in command blocks (command blocks that cause defects) within the machining program 31 generated by CAM.

[0089] The machining program 31 may include simultaneous 5-axis commands, including 2 rotation axes. In this case, if the command block correction unit 132 determines that the command block for simultaneous 5-axis commands is a cause of deceleration and the converted command block does not affect machining, it may change the rotation axis command that determines the tool position from a 2-axis command to a 1-axis command and replace the simultaneous 5-axis command with a simultaneous 4-axis command.

[0090] The command block correction unit 132 determines whether a command block does not affect machining based on the allowable range of tool position. That is, the command block correction unit 132 determines whether a converted command block does not affect machining based on whether the tool position after the command block conversion is within the allowable range. If the tool position after the command block conversion is within the allowable range, the command block correction unit 132 replaces the simultaneous 5-axis command with a simultaneous 4-axis command. On the other hand, if the tool position after the command block conversion is not within the allowable range, the command block correction unit 132 does not replace the simultaneous 5-axis command with a simultaneous 4-axis command.

[0091] In this way, if the tool position after the command block conversion is within the allowable width, the command block correction unit 132 converts a simultaneous 5-axis command block including 2 rotation axes within the allowable width into a simultaneous 4-axis command block including 1 rotation axis. As a result, the converted machining program 35 does not issue unnecessary rotation axis commands (movement commands), so the command block correction unit 132 can improve machining accuracy and reduce machining scratches.

[0092] Here, we will explain the change in the distance (line segment length) traveled by the tool tip. Figure 5 is a diagram illustrating the process by which the program conversion device according to the embodiment sets a command block to a faulty block or an appropriate block based on the distance traveled by the tool tip.

[0093] The faulty block extraction unit 131 calculates the distance the tool tip position moves in the command block. Figure 5 shows the case where the tool tip position (X, Y, Z) moves from tool tip position N11 to tool tip position N14. For example, among the command blocks between tool tip positions N11 to N14, the length between command blocks between tool tip positions N11 and N12 (line segment length), and the length between command blocks between tool tip positions N13 and N14 are longer than the length between command blocks between tool tip positions N12 and N13.

[0094] Near the point of change (command point) where the length of the line segment between command blocks changes from a long command block to a short command block, tool deceleration occurs, making machining scratches more likely to occur. In the example in Figure 5, the command block between tool tip positions N11 and N12 is longer than the command block between tool tip positions N12 and N13. Therefore, there is a high possibility that tool deceleration will occur at the point of change (command point at tool tip position N12) between the command block between tool tip positions N11 and N12 and between tool tip positions N12 and N13.

[0095] Furthermore, the distance between the command blocks for tool tip positions N12 to N13 is shorter than the distance between the command blocks for tool tip positions N13 to N14. Therefore, there is a high probability that tool deceleration will occur at the point of change between the command blocks for tool tip positions N12 to N13 and the command blocks for tool tip positions N13 to N14 (the command point for tool tip position N13).

[0096] In other words, there is a high probability that tool deceleration will occur at tool tip positions N12 and N13. Therefore, the fault block extraction unit 131 extracts command blocks that are highly likely to cause tool deceleration, such as tool tip positions N12 and N13.

[0097] The defect block extraction unit 131 extracts a command block as a defect block where the change (difference or ratio) of the line segment length between two consecutive command blocks changes significantly more than a specific value. In other words, the defect block extraction unit 131 extracts a command block as a defect block if the change from the first line segment length, which is the length between the command block to be judged and the command block immediately preceding it, to the second line segment length, which is the length between the command block to be judged and the command block immediately following it, changes significantly more than a specific value.

[0098] The defective block extraction unit 131 may extract defective blocks based on the difference between the length of the first line segment and the length of the second line segment, or it may extract defective blocks based on the ratio between the length of the first line segment and the length of the second line segment.

[0099] In this way, the malfunction block extraction unit 131 extracts command blocks that are prone to tool deceleration based on the difference or ratio of the line segment lengths between two consecutive command blocks.

[0100] The defective block extraction unit 131 extracts a defective block as such if, for example, the value obtained by subtracting the length of the second line segment on the subsequent side (length between the second block) which includes the command block to be judged from the length of the first line segment on the preceding side (length between the first block) which includes the command block to be judged is greater than a first specific value.

[0101] Furthermore, the faulty block extraction unit 131 extracts a command block to be judged as a faulty block if the value obtained by subtracting the first line segment length on the preceding side from the second line segment length on the subsequent side is greater than the second specific value. Note that the first specific value and the second specific value may be the same value.

[0102] Furthermore, the faulty block extraction unit 131 extracts a command block to be judged as a faulty block if the value obtained by dividing the length of the first line segment on the preceding side by the length of the second line segment on the succeeding side is greater than a third specific value.

[0103] Furthermore, the faulty block extraction unit 131 extracts a command block to be judged as a faulty block if the value obtained by dividing the second line segment length on the downstream side by the first line segment length on the upstream side is greater than the fourth specific value.

[0104] In this way, the faulty block extraction unit 131 determines the change in the line segment length between two consecutive command blocks, and based on the determination result, determines whether or not to set the command block as a faulty block, which is a command block that is subject to conversion such as merging or splitting.

[0105] The command block correction unit 132 converts defective blocks into appropriate blocks so as not to decelerate the rotation axis, within the range in which the tool position falls within the allowable width. The command block correction unit 132 may also determine whether a command block identified as a defective block is actually a command block that decelerates the rotation axis (such as a command block that reverses the rotation axis) and set the command block that decelerates the rotation axis as the defective block to be corrected. In this case, the command block correction unit 132 converts defective blocks that decelerate the rotation axis into appropriate blocks, and does not convert defective blocks that do not decelerate the rotation axis into appropriate blocks.

[0106] For example, if tool tip positions N12 and N13 are extracted as faulty blocks, and no tool deceleration occurs at tool tip positions N12 and N13, the command block correction unit 132 will not convert the command blocks for tool tip positions N12 and N13 into appropriate blocks. On the other hand, if tool tip positions N12 and N13 are extracted as faulty blocks, and tool deceleration occurs at tool tip positions N12 and N13, the command block correction unit 132 will convert the command blocks for tool tip positions N12 and N13 into appropriate blocks.

[0107] Figure 6 is a flowchart showing the processing procedure for the program conversion device according to the embodiment in which a faulty block is converted. Here, we will explain the case in which simultaneous 5-axis commands are replaced with simultaneous 4-axis commands.

[0108] The command block correction unit 132 reads block information for one block from the buffer (step S210). The command block correction unit 132 also extracts the tolerance width from the conversion information.

[0109] The command block correction unit 132 determines whether the command block read from the buffer is a valid block or a defective block based on the valid information or defective information added to the block information.

[0110] The command block correction unit 132 does not perform any conversion processing on a command block if the command block read from the buffer is a suitable block. On the other hand, if the command block read from the buffer is a faulty block, the command block correction unit 132 determines whether the rotation axis command of the faulty block is a command for two or more axes (step S220). Here, we will explain the case where the rotation axis command of the faulty block is a two-axis command or a one-axis command, and the command block correction unit 132 determines whether the rotation axis command of the faulty block is a two-axis command.

[0111] If the rotation axis command of the faulty block is a single-axis command and not a two-axis command (step S220, No), the command block correction unit 132 does not perform conversion processing for this faulty block.

[0112] On the other hand, if the rotation axis command of the faulty block is a two-axis command (step S220, Yes), the command block correction unit 132 calculates the tool position according to the command of the command block (step S230).

[0113] The command block correction unit 132 calculates the tool position when only one of the two rotation axis commands is in operation (step S240). For example, if the machine tool 3 has a B axis and a C axis, the command block correction unit 132 may calculate the tool position when the B axis is operated without the C axis, or when the C axis is operated without the B axis.

[0114] The command block correction unit 132 calculates the angular difference of the tool position (step S250). That is, the command block correction unit 132 calculates the angular difference between the tool position according to the command output from the CAM and the tool position when only one axis is operated as the angular difference of the tool position. In other words, the command block correction unit 132 calculates the angular difference between the tool position calculated in step S230 and the tool position calculated in step S240 as the angular difference of the tool position.

[0115] The command block correction unit 132 determines whether the angle difference of the tool position is greater than the allowable angle (step S260). That is, the command block correction unit 132 determines whether the angle difference of the tool position is greater than the allowable angle.

[0116] If the angular difference of the tool position is greater than the allowable angle (step S260, Yes), the command block correction unit 132 divides the command block (step S270). In this case, the command block correction unit 132 divides the command block so that the tool position suppresses an increase in machining time and the tool position falls within the allowable range.

[0117] If the angle difference of the tool position is less than or equal to the allowable angle (step S260, No), the command block correction unit 132 combines the command blocks (step S280). In this case, the command block correction unit 132 combines the command blocks such that the tool position suppresses an increase in machining time and the tool position falls within the allowable range.

[0118] In step S240, the command block correction unit 132 may calculate both the tool position when the B-axis is operated and the tool position when the C-axis is operated. In this case, the command block correction unit 132 determines whether the angle difference when the B-axis is operated is greater than the allowable angle, and whether the angle difference when the C-axis is operated is greater than the allowable angle. The command block correction unit 132 divides the command block if either the angle difference when the B-axis is operated is greater than the allowable angle, or the angle difference when the C-axis is operated is greater than the allowable angle. On the other hand, the command block correction unit 132 combines the command blocks if the angle difference when the B-axis is operated is less than or equal to the allowable angle, and the angle difference when the C-axis is operated is less than or equal to the allowable angle.

[0119] Figure 7 is a flowchart showing the processing procedure for dividing a command block by the program conversion device according to the embodiment. Here, the command block division process (step S270) when the command block correction unit 132 determines in step S260 of Figure 6 that the angle difference of the tool position is greater than the allowable angle will be described.

[0120] The command block correction unit 132 calculates the number of divisions of the command block if the angular difference of the tool position is greater than the allowable angle (step S310). The number of divisions = (angular difference of tool position) / (allowable angle). Therefore, the command block correction unit 132 calculates the number of divisions by dividing the angular difference of the tool position by the allowable angle.

[0121] The command block correction unit 132 divides the linear axis command (step S320). Specifically, the command block correction unit 132 divides the linear axis command by "number of divisions × 2". If the machine tool 3 has three rotation axes (A axis, B axis, and C axis), the command block correction unit 132 divides the linear axis command by "number of divisions × 3".

[0122] The command block correction unit 132 divides the rotation axis command (step S330). Specifically, the command block correction unit 132 divides the rotation axis command for each rotation axis by the "number of divisions". For example, if the number of divisions is "3", the command block correction unit 132 divides the rotation axis command for the B axis into three equal parts and also divides the rotation axis command for the C axis into three equal parts. If the machine tool 3 has three rotation axes, the command block correction unit 132 divides the rotation axis commands for the A axis, B axis, and C axis into three equal parts. The command block correction unit 132 may perform the division of linear axis commands and the division of rotation axis commands in either order.

[0123] The command block correction unit 132 generates an appropriate block by combining command blocks that can be combined based on the division results of the linear axis command and the division results of the rotation axis command (step S340).

[0124] Figure 8 is a diagram illustrating an example of the process by which the program conversion device according to the embodiment divides a command block. Here, the case where the number of divisions is "3" will be described. The command block correction unit 132 extracts the rotation axis command BD1 and the linear axis command bd1 from the axis command. Figure 8 shows the graph of the rotation axis command BD1 and the graph of the linear axis command bd1.

[0125] The horizontal axis of the graph for rotation axis command BD1 represents the rotation axis command to the C axis, and the vertical axis represents the rotation axis command to the B axis. Before splitting, rotation axis command BD1 is a command that executes both the rotation axis command to the C axis and the rotation axis command to the B axis simultaneously. The command block correction unit 132 splits rotation axis command BD1 into a rotation axis command for the C axis only and a rotation axis command for the B axis only.

[0126] The command block correction unit 132 calculates "number of divisions" = 3 and divides the rotation axis command for the B axis of the rotation axis command BD1 into three equal parts, and the rotation axis command for the C axis into three equal parts. Figure 8 shows the case where the command block correction unit 132 divides the rotation axis command BD1 into six rotation axis commands BR1 to BR6.

[0127] The command block correction unit 132 divides the rotation axis command BD1, for example, so that the line showing the divided command is close to the line showing the rotation axis command BD1 before division. For example, the command block correction unit 132 divides the rotation axis command to the C axis into three equal parts: rotation axis commands BR1, BR4, and BR5, and the rotation axis command to the B axis into three equal parts: rotation axis commands BR2, BR3, and BR6. Note that the method of dividing the rotation axis command BD1 by the command block correction unit 132 is not limited to the method described in Figure 8.

[0128] Furthermore, the "number of divisions" × 2 = 6 is calculated. The command block correction unit 132 divides the linear axis command into 6 equal parts. Figure 8 shows the case where the command block correction unit 132 divides the linear axis command bd1 into 6 equal parts, linear axis commands br1 to br6.

[0129] The command block correction unit 132 combines (combines) rotation axis commands BR2 and BR3, which are consecutive commands for the same axis, into one block. The command block correction unit 132 also combines rotation axis commands BR4 and BR5, which are consecutive commands for the same axis, into one block. As a result, the command block correction unit 132 generates a rotation axis command group AD1 from rotation axis command BD1, consisting of four rotation axis commands: rotation axis command BR1, rotation axis commands BR2 and BR3, rotation axis commands BR4 and BR5, and rotation axis command BR6.

[0130] Furthermore, the command block correction unit 132, similar to the rotation axis commands, combines the linear axis commands br2 and br3 into one block, and combines the linear axis commands br4 and br5 into one block. As a result, the command block correction unit 132 generates a linear axis command group ad1 from the linear axis command bd1, consisting of four linear axis commands: linear axis command br1, linear axis commands br2 and br3, linear axis commands br4 and br5, and linear axis command br6.

[0131] Rotational axis command BR1 and linear axis command br1 are commands included in the same command block and are executed simultaneously. Similarly, rotational axis commands BR2 and BR3 and linear axis commands br2 and br3 are commands included in the same command block and are executed simultaneously. Furthermore, rotational axis commands BR4 and BR5 and linear axis commands br4 and br5 are commands included in the same command block and are executed simultaneously. Additionally, rotational axis command BR6 and linear axis command br6 are commands included in the same command block and are executed simultaneously.

[0132] In this way, when the program conversion device 1 divides a command block, it divides the linear axis command and the rotation axis command within the command block, and then combines the command blocks of the rotation axis command that can be combined.

[0133] Figure 9 is a flowchart showing the processing procedure for the program conversion device according to the embodiment in which command blocks are combined. Here, the command block combination process (step S280) when the command block correction unit 132 determines in step S260 of Figure 6 that the angle difference of the tool position is less than or equal to the allowable angle will be described.

[0134] If the angle difference of the tool position is less than or equal to the allowable angle, the command block correction unit 132 calculates the cumulative value of the angle difference for each command block (step S410). The command block correction unit 132 determines whether the cumulative value is greater than the allowable angle (step S420). If the cumulative value is less than or equal to the allowable angle (step S420, No), the command block correction unit 132 reads the next command block from the buffer (step S430). After this, the command block correction unit 132 returns to the process of step S410 and executes the processes of steps S410 and S420.

[0135] The command block correction unit 132 repeats the process in steps S410 to S430 until the cumulative value becomes greater than the allowable angle. If the cumulative value becomes greater than the allowable angle (step S420, Yes), the command block correction unit 132 combines the rotation axis commands within the allowable angle (step S440). For example, if the cumulative value of the angle difference of the first to the Nth command blocks (where N is a natural number greater than or equal to 3) is less than or equal to the allowable angle, and the cumulative value of the angle difference of the first to the (N+1)th command blocks is greater than the allowable angle, the command block correction unit 132 combines the rotation axis commands of the first to the Nth command blocks.

[0136] The command block correction unit 132 may combine the rotation axis commands of the first to Nth command blocks with the rotation axis commands up to the middle of the (N+1)th command block (hereinafter referred to as the pre-stage rotation axis command). In this case, the command block correction unit 132 sets the pre-stage rotation axis command such that the cumulative value of the rotation axis commands of the first to Nth command blocks and the pre-stage rotation axis command of the (N+1)th command block becomes the maximum allowable angle. Then, the command block correction unit 132 combines the rotation axis commands of the first to Nth command blocks with the set pre-stage rotation axis command.

[0137] Then, the command block correction unit 132 takes the remaining rotation axis command (hereinafter referred to as the "subsequent rotation axis command") obtained by subtracting the preceding rotation axis command from the (N+1)th command block as the cumulative value of the next angle difference. After this, the command block correction unit 132 calculates the cumulative value of the angle difference by adding the angle difference of the third command block to the angle difference of the subsequent rotation axis command of the (N+1)th command block.

[0138] For example, if the cumulative value of the angle difference of the first command block is less than or equal to the allowable angle, and the cumulative value of the angle differences of the first to second command blocks is greater than the allowable angle, the command block correction unit 132 combines the rotation axis command of the first command block with the preceding rotation axis command of the second command block. After this, the command block correction unit 132 calculates the cumulative value of the angle difference by adding the angle difference of the third command block to the angle difference of the subsequent rotation axis command of the second command block.

[0139] The command block correction unit 132 divides the combined rotation axis command into individual rotation axis commands (step S450). The command block correction unit 132 further divides each divided rotation axis command according to the amount of movement of the tool tip position (step S460). Specifically, the command block correction unit 132 generates appropriate blocks by dividing each rotation axis command so that the ratio of the line segment lengths (amount of movement of the tool tip position) of the linear axis commands between command blocks is the same as the ratio of the line segment lengths of the rotation axis commands for each axis (step S470). The command block correction unit 132 does not divide or combine linear axis commands.

[0140] Figure 10 is a diagram illustrating an example of the process by which a program conversion device according to an embodiment combines command blocks. Here, we will describe the case in which the command block correction unit 132 combines four command blocks. The command block correction unit 132 extracts rotational axis commands BD11 to BD14 and linear axis commands bd11 to bd14 from the axis commands. Figure 10 shows graphs of rotational axis commands BD11 to BD14 and graphs of linear axis commands bd11 to bd14.

[0141] Rotational axis command BD11 and linear axis command bd11 are commands included in the same command block and will be executed simultaneously if not converted. Similarly, rotational axis command BD12 and linear axis command bd12 are commands included in the same command block and will be executed simultaneously if not converted. Furthermore, rotational axis command BD13 and linear axis command bd13 are commands included in the same command block and will be executed simultaneously if not converted. Additionally, rotational axis command BD14 and linear axis command bd14 are commands included in the same command block and will be executed simultaneously if not converted.

[0142] The command block correction unit 132 does not split or combine the linear axis commands bd11 to bd14, but treats them as they are. The command block correction unit 132 does not perform any conversion on the linear axis commands bd11 to bd14, but for the sake of explanation, it will be explained here as if the command block correction unit 132 has converted the linear axis commands bd11 to bd14 into linear axis commands br11 to br14. In other words, the linear axis commands br11 to br14 are the same linear axis commands as the linear axis commands bd11 to bd14.

[0143] In the graph of rotation axis commands BD11 to BD14, the horizontal axis represents the rotation axis command to the C axis, and the vertical axis represents the rotation axis command to the B axis. Before coupling, rotation axis commands BD11 to BD14 are commands that execute both the rotation axis command to the C axis and the rotation axis command to the B axis simultaneously. The command block correction unit 132 couples the rotation axis commands BD11 to BD14.

[0144] The command block correction unit 132 divides the combined rotation axis commands BD11 to BD14 into rotation axis commands for the C axis only and rotation axis commands for the B axis only. When M (M is a natural number of 2 or more) command blocks are combined, the command block correction unit 132 divides the combined rotation axis commands into M / 2 rotation axis commands for the C axis and M / 2 rotation axis commands for the B axis.

[0145] If M is an odd number, the command block correction unit 132 divides the rotation axis commands for the C axis and the B axis so that the difference between the number of divisions of the rotation axis command for the C axis and the number of divisions of the rotation axis command for the B axis is 1 and the sum is M. For example, if M is 5, the command block correction unit 132 divides the rotation axis command for the C axis into 3 parts and the rotation axis command for the B axis into 2 parts.

[0146] In this case, the command block correction unit 132 combines the four command blocks, and divides the rotation axis command for the C axis into two, as well as the rotation axis command for the B axis into two. Figure 10 shows the case where the command block correction unit 132 divides the combined rotation axis commands BD11 to BD14 into two rotation axis commands BR11 and BR12 for the C axis, and into two rotation axis commands BR13 and BR14 for the B axis. In this case, the command block correction unit 132 divides the rotation axis commands so that the ratio of the line segment lengths of the linear axis commands bd11 to bd14 is the same as the ratio of the line segment lengths of the rotation axis commands.

[0147] The command block correction unit 132 divides the rotation axis command for the C-axis into two rotation axis commands, BR11 and BR12, such that the ratio of the line segment length of the rotation axis command BR11 for the C-axis to the line segment length of the rotation axis command BR12 for the C-axis is the same as the ratio of the line segment length of the linear axis command bd11 to the line segment length of the linear axis command bd12.

[0148] Furthermore, the command block correction unit 132 divides the rotation axis command for the B-axis into two rotation axis commands, BR13 and BR14, such that, for example, the ratio of the line segment length of the rotation axis command BR13 for the B-axis to the line segment length of the rotation axis command BR14 for the B-axis is the same as the ratio of the line segment length of the linear axis command bd13 to the line segment length of the linear axis command bd14.

[0149] Rotational axis command BR11 and linear axis command br11 are commands included in the same command block and are executed simultaneously. Similarly, rotational axis command BR12 and linear axis command br12 are commands included in the same command block and are executed simultaneously. Furthermore, rotational axis command BR13 and linear axis command br13 are commands included in the same command block and are executed simultaneously. Also, rotational axis command BR14 and linear axis command br14 are commands included in the same command block and are executed simultaneously.

[0150] Furthermore, the command block correction unit 132 is not limited to dividing the rotation axis command so that the rotation axis command for the C axis is executed before the rotation axis command for the B axis; it may divide the rotation axis command so that it is executed in any order. For example, the command block correction unit 132 may divide the rotation axis command so that the rotation axis command for the B axis is executed before the rotation axis command for the C axis. Alternatively, the command block correction unit 132 may divide the rotation axis command so that the rotation axis command for the C axis and the rotation axis command for the B axis are executed alternately.

[0151] For example, if the command block correction unit 132 wants to execute the rotation axis commands BR13 and BR14 for the B axis before the rotation axis commands BR11 and BR12, it divides the rotation axis commands for the B axis into two, BR13 and BR14, so that the ratio of the line segment lengths of the rotation axis commands BR13 and BR14 for the B axis is the same as the ratio of the line segment lengths of the linear axis commands bd11 and bd12. Similarly, it divides the rotation axis commands for the C axis into two, BR11 and BR12, so that the ratio of the line segment lengths of the rotation axis commands BR11 and BR12 for the C axis is the same as the ratio of the line segment lengths of the linear axis commands bd13 and bd14.

[0152] In this way, the command block correction unit 132 divides the rotation axis command for the C axis so that the ratio of the line segment lengths of the rotation axis command for the C axis is the same as the ratio of the line segment lengths of the linear axis command when the rotation axis command for the C axis is executed. Similarly, the command block correction unit 132 divides the rotation axis command for the B axis so that the ratio of the line segment lengths of the rotation axis command for the B axis is the same as the ratio of the line segment lengths of the linear axis command when the rotation axis command for the B axis is executed.

[0153] Figure 11 is a diagram illustrating an example of the process by which the program conversion device according to the embodiment converts a command block. Here, the process of converting rotation axis commands for the B axis and C axis included in the machining program 31 into rotation axis commands for each individual axis of the B axis or C axis will be described. The rotation axis commands shown in the upper part of Figure 11 are the rotation axis commands before conversion, and the rotation axis commands shown in the lower part of Figure 11 are the rotation axis commands after conversion.

[0154] Figure 11 shows the case where the rotation axis command before conversion is a rotation axis command executed in the order of command points P1 to P7. In Figure 11, for the sake of explanation, the rotation axis command for the B axis (rotation angle command) and the rotation axis command for the C axis are shown as (Bx, Cx). Here, x is a natural number, and in the rotation axis command before conversion, x = 1 to 7. The command points P1 to P7 in Figure 11 are assumed to be the following rotation axis commands: Command point P1 = (B1, C1) Command point P2 = (B2, C1) Command point P3 = (B3, C1) Command point P4 = (B4, C4) Command point P5 = (B5, C4) Command point P6 = (B6, C4) Command point P7 = (B7, C7)

[0155] The section from command point P1 to P3 is section SB1, where rotation axis commands are set only for the B axis, so the rotation angle of the B axis changes, while the rotation angle of the C axis does not change. The section from command point P3 to P4 is section SBC1, where rotation axis commands are set for both the B axis and the C axis, so the rotation angles of both the B axis and the C axis change. In other words, the section between command point P3 = (B3, C1) and command point P4 = (B4, C4) is a section where rotation axis commands are set for both the B axis and the C axis.

[0156] Furthermore, the section from command point P4 to P6 is section SB2 where rotation axis commands are set only for the B axis, so the rotation angle of the B axis changes, while the rotation angle of the C axis does not change. Also, the section from command point P6 to P7 is section SBC2 where rotation axis commands are set for both the B axis and the C axis, so the rotation angles of both the B axis and the C axis change. In other words, the section between command point P6 = (B6, C4) and command point P7 = (B7, C7) is a section where rotation axis commands are set for both the B axis and the C axis.

[0157] In sections where rotation axis commands are set for both the B axis and the C axis, deceleration may occur. Therefore, the command block correction unit 132 replaces the section where rotation axis commands are set for both the B axis and the C axis with either a section where only the B axis command is active or a section where only the C axis command is active.

[0158] The command block correction unit 132 eliminates the section in which rotation axis commands are set for both the B axis and the C axis by changing command points P1 to P7. For example, the command block correction unit 132 changes command point P4 = (B4, C4) to command point P11 = (B4, C1), command point P5 = (B5, C4) to command point P12 = (B5, C1), and command point P6 = (B6, C4) to command point P13 = (B7, C1). In other words, the command block correction unit 132 replaces command points P4 to P6 with command points P11 to P13. Note that command point P14 = (B7, C7) is the same command point as command point P7 = (B7, C7).

[0159] In this way, the command block correction unit 132 replaces the sections SBC1 and SBC2, in which rotation axis commands are set for both the B axis and the C axis, with sections in which rotation axis commands are set for only the B axis or only the C axis.

[0160] The command block correction unit 132 here replaces command points P4 to P6 with command points P11 to P13 by setting the command points such that the rotation angle of the C axis does not change with respect to command points P1 to P5, and the rotation angle of the B axis does not change with respect to command point P6. As a result, the section from command points P1 to P3 and P11 to P13 becomes section SB3, where only the rotation axis command for the B axis is set, and the section from command point P13 to P14 becomes section SC1, where only the rotation axis command for the C axis is set.

[0161] In this way, the command block correction unit 132 replaces sections in which rotation axis commands are set for both the B axis and the C axis with rotation axis commands for only one of the two axes. That is, if there are sections in which rotation axis commands are set for both the B axis and the C axis, the command block correction unit 132 converts the program so that sections in which rotation axis commands are set for both the B axis and the C axis are changed to sections in which only the B axis command operates and sections in which only the C axis operates. As a result, the tool rotates on only one axis, and the program conversion device 1 can prevent problems such as increased machining time and decreased machining accuracy.

[0162] If the rotation axis of the B axis is the first rotation axis, then the rotation axis of the C axis is the second rotation axis. Also, if the rotation axis of the C axis is the first rotation axis, then the rotation axis of the B axis is the second rotation axis. If the machine tool 3 is a 6-axis machining center having three rotation axes, namely the A axis, B axis, and C axis, the command block correction unit 132 replaces the rotation axis commands set for two or three of the A axis, B axis, and C axis in the section with the rotation axis command for any one of the A axis, B axis, or C axis.

[0163] In this way, the program conversion device 1 converts rotation axis commands that are prone to causing deceleration into rotation axis commands that are less prone to causing deceleration in the machining program 31, and omits unnecessary rotation axis commands, thereby preventing deceleration that would not otherwise occur during machining. As a result, the program conversion device 1 can shorten the machining time. Furthermore, the program conversion device 1 can suppress the decrease in machining accuracy that occurs due to deceleration.

[0164] For example, regardless of whether the tool position is near a singular position, the machining time may increase due to variations in the tool positions indicated by multiple commands read from the machining program 31, and the machining time may increase even if the tool position is not close to a singular position. For this reason, the program conversion device 1 converts a rotation axis command that causes deceleration and increases machining time, regardless of whether the tool position is near a singular position, into a rotation axis command that is less likely to cause deceleration and suppresses the increase in rotation axis movement time.

[0165] Furthermore, when determining the rotation angle, if the range of change in tool posture does not fall within a predetermined tolerance range based on the tolerance error for rotation angle set for the machining program 31, the tool position may deviate from the path along the command shape defined in CAD, etc., making it impossible to machine the intended shape. For this reason, the program conversion device 1 corrects the defective block so that the tool posture indicated by the defective block falls within a preset tolerance range relative to the reference position indicating the standard tool posture.

[0166] In this way, the program conversion device 1 corrects the defective block so that the increase in the movement time of the rotating shaft is suppressed and the tool posture indicated by the defective block falls within a preset tolerance range with respect to the reference position indicating the standard tool posture.

[0167] Furthermore, the program conversion device 1 converts the machining program 31 in advance before machining begins. Therefore, when the numerical control device 2A executes control using the converted machining program 35, it can shorten the machining time and suppress a decrease in machining accuracy without correcting the loaded command content. Consequently, the program conversion device 1 can reduce the processing load on the numerical control device 2A. As a result, the numerical control device 2A has the capacity to execute the converted machining program 35 and other processes in parallel.

[0168] Incidentally, the program conversion device 1 may be located within the numerical control device. Figure 12 is a diagram showing the configuration of a numerical control device having the program conversion device according to the embodiment. Among the components in Figure 12, components that achieve the same function as the program conversion system 100 shown in Figure 1 are denoted by the same reference numerals, and redundant explanations are omitted.

[0169] The numerical control device 2B includes a program conversion device 1, a storage unit 36, an information storage device 32 such as a database, and a control unit 50. The program conversion device 1 in the numerical control device 2B has the same configuration as the program conversion device 1 described in Figure 1 and performs the same operations. The information storage device 32 stores conversion information as described in Figure 1, and the conversion information is read from the conversion information input unit 12.

[0170] The program conversion device 1 reads the machining program 31 to be converted, which is generated by a CAM or the like, from the CAM or the like. The program conversion device 1 converts the machining program 31 into a post-converted machining program 35 based on the conversion information. The program conversion device 1 stores the post-converted machining program 35 in the storage unit 36.

[0171] The control unit 50 reads the converted machining program 35, in which the defective blocks have been converted into appropriate blocks, from the storage unit 36. The control unit 50 controls the machine tool 3 using the converted machining program 35. As a result, the numerical control device 2B performs machining on the workpiece using the converted machining program 35 in which the defective blocks have been converted into appropriate blocks.

[0172] Next, the hardware configuration of the program conversion device 1 and the numerical control device 2B will be described. The program conversion device 1 and the numerical control device 2B are implemented by processing circuits. The processing circuits may be a processor and memory that execute programs stored in memory, or they may be dedicated hardware. When the program conversion device 1 and the numerical control device 2B are implemented by processing circuits, each processing circuit has a similar hardware configuration, so here we will describe the hardware configuration of the program conversion device 1.

[0173] Figure 13 is a diagram showing an example of the configuration of a processing circuit when the processing circuit of the program conversion device according to the embodiment is realized with a processor and memory. The processing circuit 90 shown in Figure 13 comprises a processor 91 and memory 92. When the processing circuit 90 is composed of a processor 91 and memory 92, each function of the processing circuit 90 is realized by software, firmware, or a combination of software and firmware. The software or firmware is described as a conversion program that converts the processing program 31 into an appropriate processing program (post-conversion processing program 35) and is stored in the memory 92. In the processing circuit 90, each function is realized by the processor 91 reading and executing the conversion program stored in the memory 92. That is, the processing circuit 90 includes memory 92 for storing the conversion program that will ultimately be executed as a result of the processing of the program conversion device 1. This conversion program can also be said to be a program that causes the program conversion device 1 to execute each function realized by the processing circuit 90. This conversion program may be provided on a computer-readable recording medium on which the conversion program is recorded, or it may be provided by other means such as a communication medium.

[0174] The above conversion program can also be described as a program that causes the program conversion device 1 to execute the processes in steps S10 to S50 of Figure 3. Here, the processor 91 is, for example, a CPU, processing unit, arithmetic unit, microprocessor, microcomputer, or DSP (Digital Signal Processor). The memory 92 is, for example, a non-volatile or volatile semiconductor memory such as RAM (Random Access Memory), ROM (Read Only Memory), flash memory, EPROM (Erasable Programmable ROM), EEPROM (Registered Trademark) (Electrically EPROM), magnetic disk, flexible disk, optical disk, compact disk, minidisc, or DVD (Digital Versatile Disc).

[0175] Figure 14 shows an example of the configuration of a processing circuit when the processing circuit of the program conversion device according to the embodiment is configured with dedicated hardware. The processing circuit 93 shown in Figure 14 may be, for example, a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a combination thereof. The processing circuit 93 may be partially implemented with dedicated hardware and partially implemented with software or firmware. In this way, the processing circuit 93 can realize each of the above functions by dedicated hardware, software, firmware, or a combination thereof.

[0176] As described above, the program conversion device 1 of this embodiment extracts defective blocks from the machining program 31 and corrects the defective blocks so that the tool position suppresses an increase in machining time and stays within an acceptable range. As a result, the program conversion device 1 can reduce machining time even when the tool position is not close to a specific position. In addition, the program conversion device 1 can suppress a decrease in machining accuracy.

[0177] Furthermore, since the program conversion device 1 converts the machining program 31 in advance before machining begins, the processing load on the numerical control device 2A when it executes control using the converted machining program 35 can be reduced.

[0178] The configurations shown in the above embodiments are merely examples, and can be combined with other known technologies. It is also possible to omit or modify parts of the configuration without departing from the gist of the invention.

[0179] 1 Program conversion device, 2A, 2B Numerical control device, 3 Machine tool, 11 Program reading unit, 12 Conversion information input unit, 13 Program conversion unit, 14 Program output unit, 31 Machining program, 32 Information storage device, 35 Post-conversion machining program, 36 Storage unit, 40 Tool, 50 Control unit, 90, 93 Processing circuit, 91 Processor, 92 Memory, 100 Program conversion system, 131 Defect block extraction unit, 132 Command block correction unit, ad1 Linear axis command group, bd1, bd11-bd14, br1-br6, br11-br14 Linear axis command, AD1 Rotation axis command group, BD1, BD11-BD14, BR1-BR6, BR11-BR14 Rotation axis command, N1-N7, N11-N14 Tool tip position, P1-P7, P11-P14; Command point, SB1-SB3, SBC1, SBC2, SC1; Section, TP; Tool posture, W; Workpiece.

Claims

1. A program conversion device characterized by comprising: a malfunction block extraction unit used when controlling the tool posture, which is the relative position of the tool to the workpiece, by a rotating axis, which refers to a machining program that includes a plurality of command blocks indicating the tool posture and extracts malfunction blocks, which are command blocks that cause machining malfunctions due to the tool posture, from the machining program; and a command block correction unit that corrects the malfunction blocks so that the increase in the movement time of the rotating axis is suppressed and the tool posture indicated by the extracted malfunction block falls within a preset tolerance range with respect to a reference position indicating a reference tool posture.

2. The program conversion device according to claim 1, wherein the defective block extraction unit calculates a change in the command point to the tool corresponding to the orientation of the tool based on a plurality of command blocks included in the machining program, and extracts the defective block based on the change in the command point.

3. The program conversion device according to claim 1 or 2, characterized in that the defective block extraction unit extracts at least one of the following as a candidate for a defective block: a command block in which the amount of change in the length between the command blocks changes by a certain amount or more than a specific value; a command block in which the amount of change in the tool posture changes by a certain amount or more than a reference value; a command block in which the rotation axis is reversed; and a command block that is unnecessary for machining; and extracts the defective block from among the candidate for the defective block.

4. The program conversion device according to claim 3, characterized in that the faulty block extraction unit extracts a command block that causes deceleration in the rotating shaft from among the faulty block candidates as the faulty block.

5. The program conversion device according to claim 1, characterized in that the fault block extraction unit extracts a command block as the fault block in which the tool posture is in a unique posture in which the main surface of the table on which the tool is placed and the central axis of the tool intersect perpendicularly.

6. The program conversion device according to any one of claims 1 to 5, characterized in that the command block correction unit converts the extracted command block by performing at least one of the following operations on the command block: combining, replacing, deleting, and splitting the command block.

7. The program conversion device according to claim 6, characterized in that when the command block correction unit performs a command block replacement on the command block, it replaces a command block including a first rotation axis and a second rotation axis for rotating the tool position with a command block including the first rotation axis and a command block including the second rotation axis.

8. A numerical control device characterized by comprising: a program conversion device used when controlling the tool posture, which is the relative position of the tool to the workpiece, by a rotating axis, which references a machining program that includes a plurality of command blocks indicating the tool posture and converts the machining program to generate a converted machining program; and a control unit that controls the tool posture using the converted machining program and controls a machine tool having the tool, wherein the program conversion device comprises a defect block extraction unit that extracts defect blocks, which are command blocks that cause machining defects due to the tool posture, from the machining program; and a command block correction unit that generates the converted machining program by correcting the defect blocks so that the increase in the movement time of the rotating axis is suppressed and the tool posture indicated by the extracted defect blocks falls within a preset tolerance range with respect to a reference position indicating a reference tool posture.

9. A program conversion method characterized by comprising: a malfunction block extraction step in which a program conversion device is used when controlling the tool posture, which is the relative position of the tool to the workpiece, by a rotating axis, and refers to a machining program which includes a plurality of command blocks indicating the tool posture, and extracts malfunction blocks, which are command blocks that cause a machining malfunction due to the tool posture, from the machining program; and a command block correction step in which the program conversion device corrects the malfunction block so that the increase in the movement time of the rotating axis is suppressed and the tool posture indicated by the extracted malfunction block falls within a preset tolerance range with respect to a reference position indicating a reference tool posture.