Program conversion device, numerical control device, and program conversion method
The program conversion device optimizes machining programs by correcting defective blocks to maintain tool posture within tolerances, reducing machining time and ensuring accuracy by minimizing rotary axis deceleration and shape deviations.
Patent Information
- Application Number
- JP2025528567
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Existing numerical control technologies fail to optimize machining time and accuracy when tool postures vary significantly, leading to increased machining time and potential deviations from intended shapes due to tool posture changes, even when not near singular postures.
A program conversion device that extracts and corrects defective command blocks in machining programs, ensuring tool postures remain within allowable tolerances by replacing, dividing, or combining blocks to minimize rotary axis deceleration and maintain accuracy.
The solution reduces machining time and improves accuracy by converting machining programs to ensure tool postures stay within predetermined tolerances, preventing deceleration and shape deviations.
Smart Images

Figure 0007760094000001 
Figure 0007760094000002 
Figure 0007760094000003
Abstract
Description
[Technical Field]
[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 attitude into an appropriate machining program. [Background technology]
[0002] A machine tool controlled by a numerical control device performs machining so that the tool posture is as specified in a machining program. In this machine tool, for example, if 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 rotation axis angle of the rotation axis so that changes in the tool attitude from the previous tool attitude are limited when the tool attitude read from the machining program is within a specific tool attitude range, thereby suppressing an increase in the rotational movement time of the rotation axis and reducing the machining time when the tool attitude approaches a singular attitude. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Patent No. 5425342 Summary of the Invention [Problem to be solved by the invention]
[0005] However, the technology of Patent Document 1 focuses only on cases where the tool posture is close to a singular posture, and regardless of whether the tool posture is close to a singular posture, variations in the tool postures indicated by the multiple read commands can increase the machining time, and if the tool posture is not close to a singular posture, the machining time increases. Also, in Patent Document 1, when determining the rotation axis angle, if the change range of the tool posture does not fall within a predetermined allowable range based on, for example, an allowable error related to the rotation axis angle set in a machining program generated by CAM (Computer-Aided Manufacturing) or the like, the tool position may deviate from a path along a command shape defined by CAD (Computer-Aided Design) or the like, and the intended machining shape cannot be machined.
[0006] The present disclosure has been made in consideration of the above, and aims to provide a program conversion device that can ensure that machining is performed to an intended machining shape while reducing machining time, even when the tool posture is not close to a singular posture. [Means for solving the problem]
[0007] To solve the above-mentioned problems and achieve the object, a program conversion device disclosed herein corrects a machining program that is generated by CAM in which an ideal tool position and a first tolerance for the ideal tool attitude are set and that includes a quantization error based on the first tolerance, and includes a defect block extraction unit that references the machining program, which includes a plurality of command blocks that indicate the tool attitude and are used when controlling the tool attitude, which is the attitude of the tool relative to the workpiece, using a rotary axis, and extracts from the machining program defect blocks that are command blocks that cause defects in machining due to the tool attitude.The program conversion device disclosed herein also includes a command block correction unit that corrects the defect blocks so that an increase in the movement time of the rotary axis is suppressed and the tool attitude indicated by the extracted defect block falls within a predetermined second tolerance for a reference position that indicates a reference tool attitude. The defective block extracting unit extracts, as defective blocks, at least one of command blocks whose length between command blocks varies by an amount greater than a specific value and command blocks that are unnecessary for machining. [Effects of the Invention]
[0008] The program conversion device according to the present disclosure has the effect of reducing the machining time while ensuring that machining is performed to the intended machining shape even when the tool posture is not close to a singular posture. [Brief explanation of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram showing a configuration of a program conversion apparatus according to an embodiment; [Figure 2] FIG. 10 is a diagram for explaining the operation of a tool in a defective block converted by the program conversion device according to the embodiment; [Figure 3] 1 is a flowchart showing a processing procedure executed by a program conversion apparatus according to an embodiment; [Figure 4] 1 is a flowchart showing a procedure for extracting a defective block by a program conversion apparatus according to an embodiment; [Figure 5] FIG. 10 is a diagram for explaining a process in which the program conversion device according to the embodiment sets a command block as a defective block or an appropriate block based on the movement distance of the tool tip position. [Figure 6] 1 is a flowchart showing a procedure for converting a defective block by a program conversion device according to an embodiment; [Figure 7] 1 is a flowchart showing a processing procedure for dividing a command block by a program conversion device according to an embodiment; [Figure 8] FIG. 1 is a diagram for explaining an example of a process in which a program conversion device according to an embodiment divides a command block. [Figure 9] 10 is a flowchart showing a processing procedure for combining command blocks by a program conversion device according to an embodiment; [Figure 10] FIG. 1 is a diagram for explaining an example of processing in which the program conversion device according to the embodiment combines command blocks; [Figure 11]FIG. 1 is a diagram for explaining an example of a process in which a program conversion device according to an embodiment converts a command block. [Figure 12] FIG. 1 is a diagram showing the configuration of a numerical control device having a program conversion device according to an embodiment; [Figure 13] FIG. 1 is a diagram illustrating an example of a configuration of a processing circuit when the processing circuit included in the program conversion apparatus according to the embodiment is realized by a processor and a memory. [Figure 14] FIG. 1 is a diagram illustrating an example of a configuration of a processing circuit included in a program transformation apparatus according to an embodiment, in the case where the processing circuit is configured with dedicated hardware. DETAILED DESCRIPTION OF THE INVENTION
[0010] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A program conversion device, a numerical control device, and a program conversion method according to embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0011] Embodiment 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 the tool into a converted machining program 35, which is an appropriate machining program.
[0012] The program conversion device 1 generates a converted machining program 35 by converting a machining program 31 executed by a numerical control device 2A so as to reduce machining time and improve machining accuracy. Specifically, the program conversion device 1 provides an allowable range for the tool attitude, and converts the rotational axis commands among the servo axis commands written in the machining program 31 into appropriate rotational axis commands within a range in which the tool attitude falls within this allowable range. In this way, the program conversion device 1 eliminates the adverse effects on machining caused by deceleration of the rotary axes. In other words, by converting the machining program 31 into the converted machining program 35, the program conversion device 1 reduces machining time and improves machining accuracy. The conversion of the machining program 31 executed by the program conversion device 1 includes replacing, deleting, dividing, and combining command blocks included 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, a motion program, etc. The machining program 31 and the converted machining program 35 include a plurality of command blocks written in command codes for the machine tool 3.
[0014] The numerical control device 2A is a computer that numerically controls the machine tool 3 that uses a tool to machine a workpiece (a workpiece). The numerical control device 2A controls the machine tool 3 using a converted machining program 35, thereby controlling the tip position of the tool, the tool attitude, etc.
[0015] The numerical control device 2A performs machining of a workpiece while controlling the tool attitude and tool tip position (tool tip position) relative to the workpiece placed on the table using the rotary axes and linear axes, using the converted machining program 35 generated by the program conversion device 1. The tool attitude information includes information on the axial direction of the tool.
[0016] The numerical control device 2A outputs movement commands according to the converted machining program 35 to the X-axis amplifier, Y-axis amplifier, Z-axis amplifier, A-axis amplifier, B-axis amplifier, and C-axis amplifier included in the servo amplifiers. 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 machine tool 3, machining is performed while moving the movable part by driving each axis so that the movable part moves to the position commanded by converted machining program 35. Machine tool 3 is, for example, a five-axis machining machine having three linear axes (translational axes) X-axis, Y-axis, and Z-axis, and two rotation axes B-axis and C-axis. One of the B-axis and C-axis is the first rotation axis, and the other is the second rotation axis.
[0018] The machine tool 3 may be a six-axis machine having three rotation axes, A-axis, B-axis, and C-axis. In this case, one of the A-axis, B-axis, and C-axis is the first rotation axis, and one of the other rotation axes is the second rotation axis. The following description will mainly focus on the case where the machine tool 3 is a five-axis machine, but the machine tool 3 may also be a six-axis machine.
[0019] The X-axis is an axis along which the X-axis servo motor moves the tool linearly in the X-axis direction. The Y-axis is an axis along which the Y-axis servo motor moves the tool linearly in the Y-axis direction. The Z-axis is an axis along 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, perpendicular to one another.
[0020] The A-axis is the axis on 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 on 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 on which the C-axis servo motor rotates and moves the workpiece. The C-axis servo motor rotates and moves the table on which the workpiece is placed, for example, around the Z-axis, thereby rotating and moving the workpiece around the Z-axis. The workpiece is placed on the main surface (top surface) of the table and is machined by a rotating tool.
[0023] The program conversion device 1 includes 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 defective block extraction unit 131 and a command block correction unit 132.
[0024] The program reading unit 11 reads a machining program 31 to be converted, which has been generated by CAM (computer-aided manufacturing) or the like, from the CAM or the like into the program conversion device 1. The machining program 31 is used when controlling the tool attitude, which is the attitude of the tool relative to the workpiece, using a rotation axis, and is a program that includes multiple command blocks that indicate the tool attitude. The program reading unit 11 transmits the read machining program 31 to the defective block extraction unit 131.
[0025] The conversion information input unit 12 reads information (hereinafter referred to as conversion information) stored in an information storage device 32 such as a database, and transmits it to the program conversion unit 13. The conversion information is conversion information used when the program conversion unit 13 executes 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 the tool posture. The tolerance width is the width of the tool posture (the tolerance width from the reference position) that is allowed for the tool posture, which is set in advance with respect to a reference position that indicates a reference tool posture. 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 a tolerance width set in the CAM for an ideal tool position and tool posture.
[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 a type of conversion method for the machining program 31. The conversion method includes at least one of replacing, deleting, dividing, and combining command blocks. The program conversion unit 13 performs conversion processing on the command blocks included in the conversion range using the conversion method included in the conversion method.
[0029] The program conversion unit 13 converts the machining program 31 into a converted machining program 35 using the conversion information.
[0030] The program conversion unit 13 extracts command blocks (hereinafter sometimes referred to as "defective blocks") from the machining program 31 that cause defects in machining, and converts the defective blocks into appropriate command blocks (hereinafter sometimes referred to as "appropriate blocks") that do not cause defects in machining. Defective blocks are command blocks that slow down the rotation axis (feed axis) or are not necessary for machining. Note that, hereinafter, the process of extracting defective blocks and converting them into appropriate blocks may be referred to as extraction and conversion processing.
[0031] The defect block extraction unit 131 of the program conversion unit 13 sets, among the multiple command blocks included in the machining program 31, command blocks specified in the conversion range of the conversion information as command blocks to be converted. Based on the tool length, etc., the defect block extraction unit 131 extracts, as defect blocks, command blocks that cause defects in machining due to the tool posture from among the command blocks to be converted. That is, the defect block extraction unit 131 refers to the machining program 31 and extracts from the machining program 31 defect blocks that are command blocks that cause defects in machining due to the tool posture.
[0032] A defective block that decelerates the rotary axis is a command block that increases the machining time. Furthermore, a defective block that decelerates the rotary axis is a command block that causes machining defects, reduces machining accuracy, and causes machining scratches. Furthermore, a command block that is unnecessary for machining is a command block that does not affect the machined shape of the workpiece, but has the potential to increase the machining time or reduce machining accuracy.
[0033] The command block correction unit 132 of the program conversion unit 13 corrects (converts) the defective block extracted by the defective block extraction unit 131 so that the tool posture suppresses an increase in machining time and falls within an allowable range. That is, the command block correction unit 132 sets an allowable range for the tool posture and converts the defective block into an appropriate block that does not decelerate the rotary axis so that the tool posture falls within the set allowable range. In other words, the command block correction unit 132 converts the defective block into an appropriate block that does not decelerate the rotary axis within a range in which the tool posture falls within the allowable range. In this way, the command block correction unit 132 corrects the defective block so that an increase in the movement time of the rotary axis is suppressed and the tool posture indicated by the defective block falls within the allowable range. The command block correction unit 132 converts the defective block into an appropriate block using a conversion method (at least one of division, combination, replacement, and deletion) specified in the conversion information.
[0034] The command block correction unit 132 extracts a defective block that decelerates the rotation axis based on the calculation process that the numerical control device 2A executes for the machining program 31. In other words, when the numerical control device 2A executes the machining program 31, the command block that causes a defect in machining due to the tool posture is extracted as the defective block.
[0035] Then, the command block correction unit 132 converts the defective block into an appropriate block based on the calculation process that the numerical control device 2A executes for the machining program 31. In other words, when the numerical control device 2A executes the machining program 31, the defective block is converted into an appropriate block so as not to decelerate the rotation axis within a range in which the tool posture falls within the allowable width.
[0036] The command block correction unit 132 transmits the machining program 31 in which the defective blocks have been converted into suitable blocks to the program output unit 14 as a converted machining program 35. Note that the command block correction unit 132 does not convert the machining program 31 if the tool posture does not fall within the allowable width. This is because if the tool posture does not fall within the allowable width, the tool position may deviate from the path along the command shape defined by CAD or the like, making it impossible to machine the intended machining shape.
[0037] The program output unit 14 outputs the converted machining program 35 to the outside of the program conversion device 1. Specifically, the program output unit 14 transmits the converted machining program 35 to the numerical control device 2A.
[0038] The program conversion device 1 according to the embodiment converts defective blocks into appropriate blocks for all tool postures, not just when the tool posture is singular or near a singular posture. A singular posture is a posture in which the rotation axis of the tool in the machine tool 3 is 0 degrees (the main surface of the table on which the tool is placed intersects perpendicularly with the central axis of the tool). In a singular posture, the angle of the table rotation axis is not uniquely determined, and any angle can be selected.
[0039] Here, it will be explained that a defective block may occur in various tool postures, not just when the tool posture is singular or near a singular posture. Fig. 2 is a diagram for explaining the operation of the tool in a defective block converted by the program conversion device according to the embodiment. Here, an example of a change in the tool posture of the tool 40 that decelerates the rotation axis will be explained. Fig. 2 explains a case where the tool 40 machines the workpiece W by moving the tool 40 in a direction parallel to the XZ plane.
[0040] The tool 40 machines the workpiece W while changing the tool attitude TP. Fig. 2 shows a 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 blocks for tool tip positions N1 to N4, the B-axis command for the tool attitude TP is for movement in the +B direction from tool tip position N1 to N2, movement in the -B direction from tool tip position N2 to N3, and movement in the +B direction from tool tip position N3 to N4. Therefore, between the command blocks for tool tip positions 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 center positions N4 to N7, the B-axis command for tool attitude TP moves in the +B direction from tool center positions N4 to N5, moves in the -B direction from tool center positions N5 to N6, and moves in the +B direction from tool center positions N6 to N7. Therefore, between command blocks for tool center positions N5 to N6, deceleration occurs in the B-axis rotation axis due to the B-axis reversal operation. At B-axis reversal points, such as between command blocks for tool center positions N2 to N3 and between command blocks for tool center positions N5 to N6, deceleration of the B-axis rotation axis occurs, increasing the machining time. Furthermore, at B-axis reversal points, if there are no deceleration points around the reversal points, machining scratches may occur due to the speed difference.
[0042] In this way, the occurrence of deceleration in the B-axis rotation axis is not limited to singular postures or the vicinity of singular postures. In other words, the occurrence of an increase in machining time or a decrease in machining accuracy (such as machining scratches) is not limited to singular postures or the vicinity of singular postures. In this way, in the machining program 31 created by CAM, the tool posture command may vary not only in the vicinity of singular postures.
[0043] In this embodiment, the program conversion apparatus 1 converts a defective block that causes a defect such as a B-axis reversal operation into a suitable block that avoids the defect such as the B-axis reversal operation.
[0044] The command block correction unit 132 sets an allowable range for the tool attitude and converts the rotation axis command (tool attitude command) of the machining program 31 within a range in which the tool attitude falls within the allowable range. Specifically, the command block correction unit 132 converts the tool attitude in the defective block extracted by the defective block extraction unit 131 into a command block with an appropriate tool attitude within the allowable range set in advance for the numerical control device 2A.
[0045] The command block correction unit 132 performs conversion processing on defective blocks, such as dividing, combining, replacing, and deleting command blocks. When combining command blocks, the command block correction unit 132 combines the defective block with another command block. When dividing a command block, the command block correction unit 132 divides one defective block into multiple command blocks. When replacing a command block, the command block correction unit 132 replaces the defective block with another command block. When deleting a command block, the command block correction unit 132 deletes the defective block.
[0046] When the defective block extraction unit 131 extracts the command block at the tool tip position N2 as the defective block, the command block correction unit 132 performs conversion processing on the command block at the tool tip position N2 as the command block to be converted. The command block correction unit 132 performs conversion processing on the defective block so that, for example, deceleration does not occur due to 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 posture at the tool tip position N1 and the tool posture at the tool tip position N3, within the range in which the tool posture falls within the allowable width.
[0047] 3 is a flowchart showing the processing procedure executed by the program conversion device according to the embodiment. The program conversion device 1 reads conversion information and a 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 an information storage device 32. 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 defective 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] Based on the conversion range included in the conversion information, the defect block extraction unit 131 extracts command blocks to be converted from a plurality of command blocks included in the machining program 31. From the command blocks to be converted, the defect block extraction unit 131 extracts command blocks that cause defects in machining due to deceleration of the rotation axis, which is the feed axis.
[0050] Specifically, the defect block extraction unit 131 calculates the post-machining shape of the workpiece, which is the shape of the workpiece after machining, based on the multiple command blocks to be converted (step S20). The post-machining shape of the workpiece corresponds to command points (X, Y, Z, A, B, C) that correspond to commands to the servo axes (rotational axis commands and linear axis commands) included in the command blocks. Therefore, the defect block extraction unit 131 calculates the post-machining shape of the workpiece by calculating the command points included in the command blocks based on the multiple command blocks.
[0051] The command points correspond to the position and attitude of the tool. That is, among the command points calculated by the defect block extractor 131, the command point (X, Y, Z) indicates the coordinates of the tool tip position, and among the command points, the command point (A, B, C) indicates the tool attitude. In this way, the command points calculated by the defect block extractor 131 include information on the coordinates of the tool tip position and information on the tool attitude.
[0052] The defect block extractor 131 calculates command points for a plurality of command blocks, thereby calculating changes in the command points in the plurality of command blocks. That is, by calculating command points for a plurality of command blocks, the defect block extractor 131 calculates the movement direction of the tool tip position that changes across the plurality of command blocks, and the movement distance of the tool tip position that changes across the plurality of command blocks. Since the movement direction and movement distance of the tool tip position (the trajectory of tool movement) change depending on the tool attitude, the defect block extractor 131 calculates the movement direction and movement distance of the tool tip position according to the tool attitude. The defect block extractor 131 extracts defect blocks based on the movement direction and movement distance of the tool tip position (step S25).
[0053] In this way, the defective block extractor 131 calculates the post-machining shape of the workpiece based on a plurality of command blocks. Then, the defective block extractor 131 calculates the movement direction and movement distance of the tool tip position based on the command points corresponding to the post-machining shape of the workpiece, and extracts defective blocks based on the movement direction and movement distance of the tool tip position.
[0054] That is, the defect block extractor 131 extracts command points for a tool corresponding to the position and posture of the tool based on command blocks included in the machining program 31. Then, the defect block extractor 131 calculates changes in the command points based on each command point for a plurality of command blocks. Furthermore, the defect block extractor 131 extracts defect blocks based on the changes in the command points.
[0055] As described above, defective blocks that cause defects in machining are command blocks that increase the machining time due to deceleration of the rotary axis, command blocks that cause machining defects such as the occurrence of machining scratches, etc. Furthermore, defective blocks may include command blocks that are unnecessary for machining.
[0056] The defective block extraction unit 131 may extract as defective blocks at least one of the following: a command block in which the change in length between command blocks (the length of the movement distance of the tool tip position) is greater than a specific value; a command block in which the change in tool posture is greater than a reference value; a command block that inverts the rotation axis (B axis or C axis) that rotates the tool posture; and a command block that is unnecessary for machining.
[0057] A command block in which the change in tool attitude is greater than the reference value is a command block in which the movement direction of the tool tip position is greater than the first reference value, or a command block in which the movement distance of the tool tip position is greater than the second reference value.
[0058] The defective block extracting section 131 may extract candidates for defective blocks (defective block candidates) based on the post-machining shape of the workpiece, and determine whether or not the rotation axis actually decelerates for the defective block candidates.
[0059] The defect block extraction unit 131 sets, as the defect block to be converted, a defect block that causes deceleration in the rotation axis among the defect block candidates extracted based on the post-machining shape of the workpiece. In addition, the defect block extraction unit 131 sets, as the defect block to be converted, a command block that is not required for machining.
[0060] The defect block extraction unit 131 sets an allowable range for the tool posture for the extracted defect block. The defect block extraction unit 131 converts the tool posture command (rotation axis command) that is a command for the tool posture included in the machining program 31 so that the tool posture falls within the set allowable range (step S30). In other words, the defect block extraction unit 131 optimizes (corrects) the rotation axis command so that the tool posture falls within the set allowable range. In this way, the defect block extraction unit 131 optimizes the tool path of the machining program 31 that 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 posture among the commands included in the machining program 31.
[0061] The program conversion unit 13 determines whether the extraction conversion process has been completed for all command blocks (step S40). If the extraction 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 until the extraction conversion process has been completed for all command blocks. If the extraction conversion process has been completed for all command blocks (step S40, Yes), the program conversion unit 13 transmits a converted machining program 35 in which the rotary axis commands have been converted for the machining program 31 to the program output unit 14. The converted machining program 35 includes command blocks in which the rotary axis commands have been converted because they are defective blocks, and command blocks in which the rotary axis commands have 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 executes machining of the workpiece using the converted machining program 35 in which the defective blocks have been converted into suitable blocks.
[0063] In this way, the program conversion device 1 converts the defective blocks into suitable blocks, thereby converting the machining program 31 into the converted machining program 35. This enables the program conversion device 1 to generate the converted machining program 35 that shortens the machining time and reduces machining damage.
[0064] 4 is a flowchart showing the processing procedure for extracting defective blocks by the program conversion device according to the embodiment. The defective block extractor 131 receives the machining program 31 from the program reader 11. That is, the defective block extractor 131 receives the command blocks included in the machining program 31 from the program reader 11 (step S110).
[0065] Based on the conversion range included in the conversion information, the defect block extraction unit 131 extracts command blocks to be converted from among the plurality of command blocks included in the machining program 31. Based on the plurality of command blocks to be converted, the defect block extraction unit 131 calculates the movement direction and movement distance of the tool tip position (step S120).
[0066] The defect block extractor 131 calculates the amount of change in the movement direction and the amount of change in the movement distance for each of the command blocks. The amount of change in the movement direction is, for example, the amount of change between the B-axis and the C-axis.
[0067] The defective block extraction unit 131 determines that the amount of change in the movement direction is large when there is a change such that rotation on the B axis or rotation on the C axis is eliminated, or when there is a change such that rotation on the B axis or rotation on the C axis is initiated.
[0068] For example, if there is a change from rotation only on the B axis to rotation only on the C axis, or from rotation only on the C axis to rotation only on the B axis, the defective block extraction unit 131 determines that the change in movement direction is large.
[0069] Furthermore, when there is a change from rotation on the B-axis and C-axis to rotation on the B-axis only, when there is a change to rotation on the C-axis only, or when there is a change to stopping of rotation on the B-axis and C-axis, the defective block extraction unit 131 determines that the amount of change in the movement direction is large.
[0070] In addition, when there are three rotation axes, the amount of change between the A-axis, B-axis, and C-axis is the amount of change in the movement direction. The amount of change in movement distance is the amount of change in the rotation angle (rotation axis angle) of the B-axis rotation axis and the amount of change in the rotation angle of the C-axis rotation axis. In the case of three rotation axes, the amount of change in movement distance includes the amount of change in the rotation angle of the A-axis rotation axis.
[0071] The defect block extractor 131 determines whether the amount of change in the tool attitude for a plurality of command blocks is greater than a reference value of the amount of change. For example, the defect block extractor 131 determines whether the amount of change in the movement direction of the tool tip position is greater than a first reference value, which is a reference value for the amount of change in the movement direction (step S130).
[0072] If the amount of change in the movement direction of the tool tip position is greater than the first reference value (step S130, Yes), the defect block extractor 131 sets the command block that increases the amount of change in the movement direction as a defect block (step S140). For example, the defect block extractor 131 adds defect information indicating that the defect block is a defect block to the defect block, and writes the information of the defect block with the added defect information to the buffer as block information.
[0073] The buffer is a buffer area on the memory where block information is written by the defective block extractor 131 and which can be accessed by the command block corrector 132. The buffer may be located anywhere within the program conversion device 1.
[0074] The block information includes information such as the start point, end point, line length, and axis ratio of the tool tip position. The axis ratio is, for example, the ratio of the movement distance in the X-axis direction to the movement distance in the Y-axis direction from the start point to the end point.
[0075] If the amount of change in the movement direction of the tool tip position is less than or equal to the first reference value (step S130, No), the defect block extraction unit 131 determines whether the amount of change in the movement distance of the tool tip position is greater than a second reference value, which is a reference value for the amount of change in the movement distance (step S150).
[0076] If the amount of change in the travel distance of the tool tip position is greater than the second reference value (step S150, Yes), the defect block extractor 131 sets the command block that increases the amount of change in the travel distance as a defect block (step S140). Then, the defect block extractor 131 adds defect information indicating that the defect block is a defect block to the defect block, for example, and writes the information of the defect block with the defect information added to the buffer as block information.
[0077] If the amount of change in the travel distance of the tool tip position is equal to or less than the second reference value (No in step S150), the defective block extractor 131 sets the command block in which the amount of change in travel distance is equal to or less than the second reference value as an appropriate block (step S160). That is, the defective block extractor 131 sets the command block in which the amount of change in travel direction is equal to or less than the first reference value and the amount of change in travel distance is equal to or less than the second reference value as an appropriate block. For example, the defective block extractor 131 adds appropriate information indicating that the appropriate block is an appropriate block to the appropriate block, and writes the information of the appropriate block with the appropriate information added to the buffer as block information.
[0078] In this way, the defect block extractor 131 sets, as a defect block, a command block in which the amount of change in the movement direction is greater than the first reference value or the amount of change in the movement distance is greater than the second reference value.
[0079] The process of step S130 and the process of step S150 may be executed in any order. The defective block extractor 131 repeats the processes of steps S110 to S160.
[0080] The defective block extractor 131 may classify each command block as either a defective block or a suitable block based on the amount of change in the tool attitude (in the tool axial direction). For example, the defective block extractor 131 sets the command block as a defective block when the amount of change in the tool axial direction is greater than a third reference value. Also, for example, the defective block extractor 131 sets the command block as a suitable block when the amount of change in the tool axial direction is equal to or less than the third reference value.
[0081] Furthermore, as described above, the defect block extractor 131 may classify each command block into either a defect block or a suitable block based on whether the B-axis command or the C-axis command of the command block is reversed.
[0082] In this way, the defective block extractor 131 refers to multiple command blocks to be converted, and sets each command block to be converted as either a defective block that requires conversion of the rotation axis command, or an appropriate block that does not require conversion of the rotation axis command. In other words, the defective block extractor 131 globally refers to the group of command blocks included in the machining program 31, and classifies each command block as either a defective block or an appropriate block.
[0083] The defective block extraction unit 131 calculates the post-machining shape of the workpiece based on, for example, a plurality of command blocks. This post-machining shape of the workpiece corresponds to changes in command points (X, Y, Z, A, B, C) corresponding to the tool attitude and tip position across a plurality of command blocks. The defective block extraction unit 131 extracts defective blocks from the machining program 31 based on the changes in command points. The defective block extraction unit 131 extracts defective blocks globally across a plurality of command blocks based on changes in the tool tip position and changes in tool attitude, making it possible to accurately extract defective blocks.
[0084] A defective block is a command block that is unnecessary (can be omitted) or has a negative effect 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 (computer-aided design) data, the output machining program 31 includes a quantization error of the order of the tolerance width set in the CAM with respect to the ideal tool position and tool posture, and therefore, a machining program 31 with variations in tool position and tool posture may be created. Since this variation can have a negative effect on machining the model originally defined in the CAD data, in this embodiment, such a command block is considered a defective block.
[0085] For example, when the tool attitude changes as shown in Fig. 2, the defect block extractor 131 calculates the tool attitude across a plurality of command blocks from tool tip positions N1 to N4. The defect block extractor 131 also calculates a rotation axis command across a plurality of command blocks from tool tip positions N4 to N7. The defect block extractor 131 then sets the command block (rotation axis command) for tool tip position N2 and the command block for tool tip position N5 as defect blocks in which the B-axis command is reversed. The defect block extractor 131 may also calculate the tool attitude across a plurality of command blocks from tool tip positions N1 to N7.
[0086] In addition, the defective block extraction unit 131 may set the command block as a defective block or an appropriate block by combining at least two of the following judgments: the judgment result of whether the change in the movement direction is greater than a first reference value; the judgment result of whether the change in the movement distance is greater than a second reference value; the judgment result of whether the change in the axial direction (rotation angle) of the tool is greater than a third reference value; and the judgment result of whether the B-axis command or C-axis command of the command block is reversed.
[0087] Furthermore, the defect block extractor 131 may determine whether or not a command block passes through a singular posture or the vicinity of a singular posture, and set the command block as a defect block or a suitable block based on the determination result.
[0088] In this way, the defective block extraction unit 131 can identify each command block as either a defective block or a suitable 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 contain simultaneous five-axis commands including two rotation axes. In this case, if the command block of the simultaneous five-axis command causes deceleration and the command block after conversion is a command block that does not affect machining, the command block correction unit 132 may change the rotation axis command that determines the tool attitude from a two-axis command to a one-axis command, and may replace the simultaneous five-axis command with a simultaneous four-axis command.
[0090] The command block correction unit 132 determines whether a command block does not affect machining based on the tolerance of the tool posture. That is, the command block correction unit 132 determines whether a converted command block does not affect machining based on whether the tool posture after converting the command block is within the tolerance. If the tool posture after converting the command block is within the tolerance, the command block correction unit 132 replaces the simultaneous five-axis command with a simultaneous four-axis command. On the other hand, if the tool posture after converting the command block is not within the tolerance, the command block correction unit 132 does not replace the simultaneous five-axis command with a simultaneous four-axis command.
[0091] In this way, if the tool posture after converting the command block is within the range of the tolerance, the command block correcting unit 132 converts a simultaneous five-axis command block including two rotation axes into a simultaneous four-axis command block including one rotation axis within the tolerance. As a result, the converted machining program 35 does not issue unnecessary rotation axis commands (movement commands), so the command block correcting unit 132 can improve machining accuracy and reduce machining scratches.
[0092] Here, the amount of change in the movement distance (length of the line segment) of the tool tip position will be described. Fig. 5 is a diagram for explaining the process in which the program conversion device according to the embodiment sets a command block as a defective block or an appropriate block based on the movement distance of the tool tip position.
[0093] The defect block extraction unit 131 calculates the movement distance of the tool tip position in the command block. Fig. 5 shows a 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 of tool tip positions N11 to N14, the length (line segment length) between the command blocks of tool tip positions N11 to N12 and the length of the line segment between the command blocks of tool tip positions N13 to N14 are longer than the length of the line segment between the command blocks of tool tip positions N12 to N13.
[0094] Tool deceleration occurs near the transition point (command point) between command blocks with long and short line segment lengths, which are the inter-block lengths, and machining damage is likely to occur. In the example of Figure 5, the interval between command blocks for tool tip positions N11 and N12 is longer than the interval between command blocks for tool tip positions N12 and N13. Therefore, there is a high possibility that tool deceleration will occur at the transition point (command point for tool tip position N12) between the interval between command blocks for tool tip positions N11 and N12 and the interval between command blocks for tool tip positions N12 and N13.
[0095] Furthermore, the distance between command blocks for tool tip positions N12 to N13 is shorter than the distance between command blocks for tool tip positions N13 to N14. Therefore, there is a high possibility that tool deceleration will occur at the change point between the command block for tool tip positions N12 to N13 and the command block for tool tip positions N13 to N14 (the command point for tool tip position N13).
[0096] That is, there is a high possibility that tool deceleration will occur at tool tip positions N12 and N13. Therefore, the defect block extractor 131 extracts command blocks where there is a high possibility that tool deceleration will occur, such as tool tip positions N12 and N13.
[0097] The defect block extraction unit 131 extracts a command block where the change (difference or ratio) in the line segment length between two consecutive command blocks is greater than a specific value as a defect block where tool deceleration is likely to occur. That is, the defect block extraction unit 131 extracts the command block to be determined as a defect block when the change from a first line segment length, which is the length between the command block to be determined and the command block immediately preceding this command block, to a second line segment length, which is the length between the command block to be determined and the command block immediately following this command block, is greater than a specific value.
[0098] The defect block extraction unit 131 may extract a defect block based on the difference between the first line segment length and the second line segment length, or may extract a defect block based on the ratio between the first line segment length and the second line segment length.
[0099] In this way, the defective block extractor 131 extracts command blocks that are likely to cause 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 the command block to be judged as a defective block, for example, when the value obtained by subtracting the second line segment length (second block inter-length) on the subsequent side including the command block to be judged from the first line segment length (first block inter-length) on the previous side including the command block to be judged is greater than a first specific value.
[0101] Furthermore, the defective block extractor 131 extracts the command block to be judged as a defective block when the value obtained by subtracting the first line segment length on the upstream side from the second line segment length on the downstream side is greater than a second specific value. Note that the first specific value and the second specific value may be the same value.
[0102] In addition, the defective block extraction unit 131 extracts the command block to be judged as a defective block if the value obtained by dividing the first line segment length on the upstream side by the second line segment length on the downstream side is greater than a third specific value.
[0103] In addition, the defective block extraction unit 131 extracts the command block to be judged as a defective block if the value obtained by dividing the second line segment length on the subsequent stage side by the first line segment length on the previous stage side is greater than a fourth specific value.
[0104] In this way, the defect block extraction unit 131 determines the change in 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 defect block, which is a command block to be converted by combining, dividing, etc.
[0105] The command block correction unit 132 converts a defective block into an appropriate block so as not to decelerate the rotary axis within a range in which the tool posture falls within the allowable width. Note that the command block correction unit 132 may determine whether a command block determined to be a defective block is actually a command block that decelerates the rotary axis (such as a command block that reverses the rotary axis), and set the command block that decelerates the rotary axis as the defective block to be corrected. In this case, the command block correction unit 132 converts a defective block that decelerates the rotary axis into an appropriate block, and does not convert a defective block that does not decelerate the rotary axis into an appropriate block.
[0106] For example, when tool tip positions N12 and N13 are extracted as defective blocks, if tool deceleration does not occur at tool tip positions N12 and N13, the command block correction unit 132 does not convert the command blocks at tool tip positions N12 and N13 into appropriate blocks. On the other hand, when tool tip positions N12 and N13 are extracted as defective blocks, if tool deceleration occurs at tool tip positions N12 and N13, the command block correction unit 132 converts the command blocks at tool tip positions N12 and N13 into appropriate blocks.
[0107] 6 is a flowchart illustrating a process for converting a defective block performed by the program conversion device according to the embodiment. Here, a case will be described in which a simultaneous five-axis command is replaced with a simultaneous four-axis command.
[0108] The command block correcting unit 132 reads block information for one block from the buffer (step S210) and extracts the allowable range from the conversion information.
[0109] The command block corrector 132 determines whether the command block read from the buffer is a suitable block or a defective block based on the suitable information or defective information added to the block information.
[0110] If the command block read from the buffer is a suitable block, the command block correction unit 132 does not perform conversion processing on this command block. On the other hand, if the command block read from the buffer is a defective block, the command block correction unit 132 determines whether the rotation axis command of the defective block is a command for two or more axes (step S220). Note that here, a case will be described in which the rotation axis command of the defective 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 defective block is a two-axis command.
[0111] If the rotation axis command of the defective block is a one-axis command rather than a two-axis command (step S220, No), the command block corrector 132 does not perform conversion processing on this defective block.
[0112] On the other hand, if the rotation axis command of the defective block is a two-axis command (step S220, Yes), the command block corrector 132 calculates the tool attitude as commanded by the command block (step S230).
[0113] The command block correcting unit 132 calculates the tool posture when only one of the two rotation axis commands is operating (step S240). For example, if the machine tool 3 has a B-axis and a C-axis, the command block correcting unit 132 may calculate the tool posture when the B-axis is operated without operating the C-axis, or may calculate the tool posture when the C-axis is operated without operating the B-axis.
[0114] The command block correcting unit 132 calculates the angle difference of the tool attitude (step S250). That is, the command block correcting unit 132 calculates, as the angle difference of the tool attitude, the angle difference between the tool attitude according to the command output from the CAM and the tool attitude when only one axis is operated. That is, the command block correcting unit 132 calculates, as the angle difference of the tool attitude, the angle difference between the tool attitude calculated in step S230 and the tool attitude calculated in step S240.
[0115] The command block correcting unit 132 determines whether the angle difference of the tool attitude is greater than the allowable angle (step S260). That is, the command block correcting unit 132 determines whether the angle difference of the tool attitude is greater than the allowable angle.
[0116] If the angle difference of the tool posture is larger than the allowable angle (step S260, Yes), the command block correcting unit 132 divides the command block (step S270). In this case, the command block correcting unit 132 divides the command block so that the tool posture suppresses an increase in machining time and falls within the allowable range.
[0117] If the angle difference of the tool posture is equal to or smaller than the allowable angle (step S260, No), the command block correcting unit 132 combines the command blocks (step S280). In this case, the command block correcting unit 132 combines the command blocks so that the tool posture suppresses an increase in machining time and falls within the allowable range.
[0118] In step S240, the command block correcting unit 132 may calculate both the tool posture when the B-axis is operated and the tool posture when the C-axis is operated. In this case, the command block correcting unit 132 determines both whether the angle difference when the B-axis is operated is larger than the allowable angle and whether the angle difference when the C-axis is operated is larger than the allowable angle. The command block correcting unit 132 divides the command block when the angle difference when the B-axis is operated is larger than the allowable angle or when the angle difference when the C-axis is operated is larger than the allowable angle. On the other hand, the command block correcting unit 132 combines the command blocks when the angle difference when the B-axis is operated is equal to or smaller than the allowable angle and when the angle difference when the C-axis is operated is equal to or smaller than the allowable angle.
[0119] 7 is a flowchart showing the procedure of the process of dividing a command block by the program conversion device according to the embodiment. Here, the division process of the command block (step S270) will be described when the command block correction unit 132 determines that the angle difference of the tool attitude is larger than the allowable angle in step S260 of FIG.
[0120] If the angle difference of the tool attitude is larger than the allowable angle, the command block correction unit 132 calculates the number of divisions of the command block (step S310). Number of divisions = (angle difference of the tool attitude) / (allowable angle). Therefore, the command block correction unit 132 calculates the number of divisions by dividing the angle difference of the tool attitude by the allowable angle.
[0121] The command block correcting unit 132 divides the linear axis command (step S320). Specifically, the command block correcting unit 132 divides the linear axis command by "the number of divisions x 2." If the machine tool 3 has three rotation axes (A-axis, B-axis, and C-axis), the command block correcting unit 132 divides the linear axis command by "the number of divisions x 3."
[0122] The command block correcting unit 132 divides the rotational axis commands (step S330). Specifically, the command block correcting unit 132 divides the rotational axis commands of each rotational axis by the "division number." For example, if the division number is "3," the command block correcting unit 132 divides the rotational axis command of the B-axis into thirds and the rotational axis command of the C-axis into thirds. Note that if the machine tool 3 has three rotational axes, the command block correcting unit 132 divides each of the rotational axis commands of the A-axis, B-axis, and C-axis into thirds. The command block correcting unit 132 may divide the linear axis commands and the rotational axis commands in any order.
[0123] The command block corrector 132 generates an appropriate block by combining command blocks that can be combined based on the division results of the linear axis commands and the rotational axis commands (step S340).
[0124] FIG. 8 is a diagram illustrating an example of a process in which the program conversion device according to the embodiment divides a command block. Here, a case where the division number is "3" will be described. The command block correction unit 132 extracts a rotation axis command BD1 and a linear axis command bd1 from the axis command. FIG. 8 shows a graph of the rotation axis command BD1 and a graph of the linear axis command bd1.
[0125] The horizontal axis of the graph of rotation axis command BD1 is the rotation axis command for the C-axis, and the vertical axis is the rotation axis command for the B-axis. The rotation axis command BD1 before division is a command to simultaneously execute the rotation axis command for the C-axis and the rotation axis command for the B-axis. Command block correction unit 132 divides the rotation axis command BD1 into a rotation axis command for only the C-axis and a rotation axis command for only the B-axis.
[0126] The command block corrector 132 calculates the "number of divisions" to be 3, and divides the rotation axis command for the B axis, of the rotation axis command BD1, into thirds, and divides the rotation axis command for the C axis into thirds. Fig. 8 shows a case where the command block corrector 132 divides the rotation axis command BD1 into six rotation axis commands BR1 to BR6.
[0127] The command block corrector 132 divides the rotational axis command BD1, for example, so that the line indicating the divided command approaches the line indicating the rotational axis command BD1 before division. For example, the command block corrector 132 divides the rotational axis command for the C-axis into three equal parts, namely, rotational axis commands BR1, BR4, and BR5, and divides the rotational axis command for the B-axis into three equal parts, namely, rotational axis commands BR2, BR3, and BR6. Note that the method of dividing the rotational axis command BD1 by the command block corrector 132 is not limited to the method described in FIG. 8.
[0128] Furthermore, the "number of divisions"×2=6 is calculated. The command block correcting unit 132 divides the linear axis command into 6 equal parts. Fig. 8 shows a case where the command block correcting unit 132 divides the linear axis command bd1 into 6 equal parts of linear axis commands br1 to br6.
[0129] The command block corrector 132 groups (combines) the rotational axis commands BR2 and BR3, which are successive commands to the same axis, into one block. The command block corrector 132 also groups the rotational axis commands BR4 and BR5, which are successive commands to the same axis, into one block. As a result, the command block corrector 132 generates a rotational axis command group AD1 from the rotational axis command BD1, which is made up of four rotational axis commands: the rotational axis command BR1, the rotational axis commands BR2 and BR3, the rotational axis commands BR4 and BR5, and the rotational axis command BR6.
[0130] Similarly to the rotary axis commands, the command block corrector 132 groups the linear axis commands br2 and br3 into one block, and groups the linear axis commands br4 and br5 into one block. As a result, the command block corrector 132 generates, from the linear axis command bd1, a linear axis command group ad1 consisting of four linear axis commands: the linear axis command br1, the linear axis commands br2 and br3, the linear axis commands br4 and br5, and the linear axis command br6.
[0131] The rotary axis command BR1 and the linear axis command br1 are commands included in the same command block and are executed simultaneously. Furthermore, the rotary axis commands BR2 and BR3 and the linear axis commands br2 and br3 are commands included in the same command block and are executed simultaneously. Furthermore, the rotary axis commands BR4 and BR5 and the linear axis commands br4 and br5 are commands included in the same command block and are executed simultaneously. Furthermore, the rotary axis command BR6 and the linear axis command br6 are commands included in the same command block and are executed simultaneously.
[0132] In this way, when dividing a command block, the program conversion device 1 divides the linear axis commands and the rotary axis commands of the command block, and then combines the command blocks of the rotary axis commands that can be combined.
[0133] 9 is a flowchart showing the processing procedure of the program conversion device according to the embodiment for combining command blocks. Here, the command block combining processing (step S280) will be described when the command block correcting unit 132 determines in step S260 of FIG. 6 that the angle difference between the tool attitudes is equal to or smaller than the allowable angle.
[0134] If the angle difference of the tool posture is equal to or less than the allowable angle, the command block correction unit 132 calculates a cumulative value of the angle difference of 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 equal to or less than the allowable angle (step S420, No), the command block correction unit 132 reads the next command block of one block from the buffer (step S430). Thereafter, 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 correcting unit 132 repeats the processes of steps S410 to S430 until the cumulative value becomes larger than the allowable angle. If the cumulative value becomes larger than the allowable angle (step S420, Yes), the command block correcting unit 132 combines the rotation axis commands within the allowable angle (step S440). For example, if the cumulative value of the angle differences of the first to Nth command blocks (N is a natural number greater than or equal to 3) is smaller than the allowable angle and the cumulative value of the angle differences of the first to (N+1)th command blocks is larger than the allowable angle, the command block correcting unit 132 combines the rotation axis commands of the first to Nth command blocks.
[0136] Note that command block correcting unit 132 may combine the rotation axis commands of the first to Nth command blocks with the rotation axis command up to the middle of the (N+1)th command block (hereinafter referred to as the preceding rotation axis command). In this case, command block correcting unit 132 sets the preceding rotation axis command so that the cumulative value of the rotation axis commands of the first to Nth command blocks and the preceding rotation axis command of the (N+1)th command block becomes the maximum value of the allowable angle. Then, command block correcting unit 132 combines the rotation axis commands of the first to Nth command blocks with the set preceding rotation axis command.
[0137] Then, command block corrector 132 subtracts the front-stage rotation axis command from the (N+1)th command block and sets the remaining rotation axis command (hereinafter referred to as the rear-stage rotation axis command) as the cumulative value of the next angle difference. After this, command block corrector 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 rear-stage 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 equal to or less than 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 corrector 132 combines the rotation axis command of the first command block with the front-stage rotation axis command of the second command block. Then, the command block corrector 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 rear-stage rotation axis command of the second command block.
[0139] The command block correcting unit 132 divides the combined rotation axis commands into rotation axis commands for each axis (step S450). The command block correcting unit 132 divides each divided rotation axis command according to the movement amount of the tool tip position (step S460). Specifically, the command block correcting unit 132 generates appropriate blocks by dividing each rotation axis command so that the ratio of the line segment lengths of the linear axis commands (movement amounts of the tool tip position) between command blocks and the ratio of the line segment lengths of the rotation axis commands for each axis are the same (step S470). Note that the command block correcting unit 132 neither divides nor combines linear axis commands.
[0140] 10 is a diagram illustrating an example of a process in which the program conversion device according to the embodiment combines command blocks. Here, a case will be described 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. FIG. 10 shows a graph of the rotational axis commands BD11 to BD14 and a graph of the linear axis commands bd11 to bd14.
[0141] The rotary axis command BD11 and the linear axis command bd11 are commands included in the same command block, and are executed simultaneously if not converted. The rotary axis command BD12 and the linear axis command bd12 are commands included in the same command block, and are executed simultaneously if not converted. The rotary axis command BD13 and the linear axis command bd13 are commands included in the same command block, and are executed simultaneously if not converted. The rotary axis command BD14 and the linear axis command bd14 are commands included in the same command block, and are executed simultaneously if not converted.
[0142] The command block corrector 132 does not divide or combine the linear axis commands bd11 to bd14, but leaves them as commands. The command block corrector 132 does not convert the linear axis commands bd11 to bd14, but for the sake of convenience, the following description will be given assuming that the command block corrector 132 converts 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] The horizontal axis of the graph of rotation axis commands BD11 to BD14 is the rotation axis command for the C axis, and the vertical axis is the rotation axis command for the B axis. The rotation axis commands BD11 to BD14 before combination are commands that simultaneously execute the rotation axis command for the C axis and the rotation axis command for the B axis. Command block corrector 132 combines the rotation axis commands BD11 to BD14.
[0144] Command block corrector 132 divides the combined rotation axis commands BD11 to BD14 into a rotation axis command for only the C axis and a rotation axis command for only the B axis. When M (M is a natural number of 2 or more) command blocks are combined, command block corrector 132 divides the combined rotation axis command 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 corrector 132 divides the rotational axis command for the C axis and the rotational axis command for the B axis so that the difference between the division number of the rotational axis command for the C axis and the division number of the rotational axis command for the B axis is 1 and the sum is M. For example, if M is 5, the command block corrector 132 divides the rotational axis command for the C axis into 3 and the rotational axis command for the B axis into 2.
[0146] In this case, the command block corrector 132 combines four command blocks, and therefore divides the rotational axis command for the C-axis into two, and also divides the rotational axis command for the B-axis into two. Figure 10 shows a case where the command block corrector 132 divides the combined rotational axis commands BD11 to BD14 into rotational axis commands BR11 and BR12 for the C-axis, and into rotational axis commands BR13 and BR14 for the B-axis. In this case, the command block corrector 132 divides the rotational 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 rotational axis commands.
[0147] The command block correction unit 132 divides the rotational axis command for the C axis into two rotational axis commands BR11 and BR12 so that the ratio between the line segment length of the rotational axis command BR11 for the C axis and the line segment length of the rotational axis command BR12 for the C axis is the same as the ratio between the line segment length of the linear axis command bd11 and the line segment length of the linear axis command bd12.
[0148] Furthermore, the command block correction unit 132 divides the rotational axis command for the B axis into two rotational axis commands BR13 and BR14 so that the ratio between the line segment length of the rotational axis command BR13 for the B axis and the line segment length of the rotational axis command BR14 for the B axis is the same as the ratio between the line segment length of the linear axis command bd13 and the line segment length of the linear axis command bd14.
[0149] The rotary axis command BR11 and the linear axis command br11 are commands included in the same command block and are executed simultaneously. The rotary axis command BR12 and the linear axis command br12 are commands included in the same command block and are executed simultaneously. The rotary axis command BR13 and the linear axis command br13 are commands included in the same command block and are executed simultaneously. The rotary axis command BR14 and the linear axis command br14 are commands included in the same command block and are executed simultaneously.
[0150] Note that the command block correcting unit 132 is not limited to dividing the rotation axis commands so that the rotation axis command for the C-axis is executed before the rotation axis command for the B-axis, and may divide the rotation axis commands so that the rotation axis commands are executed in any order. For example, the command block correcting unit 132 may divide the rotation axis commands so that the rotation axis command for the B-axis is executed before the rotation axis command for the C-axis. Furthermore, the command block correcting unit 132 may divide the rotation axis commands 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, when the command block corrector 132 executes the rotational axis commands BR13 and BR14 for the B-axis before the rotational axis commands BR11 and BR12, it divides the rotational axis command for the B-axis into two, BR13 and BR14, so that the ratio of the line segment lengths of the rotational 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 rotational axis command for the C-axis into two, BR11 and BR12, so that the ratio of the line segment lengths of the rotational 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 corrector 132 divides the rotational axis command for the C-axis so that the ratio of the line segment length of the rotational axis command for the C-axis is the same as the ratio of the line segment length of the linear axis command when the rotational axis command for the C-axis is executed. Similarly, the command block corrector 132 divides the rotational axis command for the B-axis so that the ratio of the line segment length of the rotational axis command for the B-axis is the same as the ratio of the line segment length of the linear axis command when the rotational axis command for the B-axis is executed.
[0153] 11 is a diagram for explaining an example of a process in which the program conversion device according to the embodiment converts a command block. Here, a process for converting the rotation axis commands for the B-axis and C-axis included in the machining program 31 into rotation axis commands for each axis, for the B-axis or the C-axis, will be explained. The rotation axis commands shown in the upper part of FIG. 11 are the rotation axis commands before conversion, and the rotation axis commands shown in the lower part of FIG. 11 are the rotation axis commands after conversion.
[0154] FIG. 11 shows a case where the rotation axis commands before conversion are rotation axis commands that are executed in the order of command points P1 to P7. For ease of explanation, FIG. 11 shows the rotation axis command (rotation angle command) for the B axis and the rotation axis command for the C axis as (Bx, Cx). Here, x is a natural number, and in the rotation axis commands before conversion, x = 1 to 7. It is assumed that the command points P1 to P7 in FIG. 11 are 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 points P1 to P3 is section SB1 where a rotation axis command is set for only the B axis, and the rotation angle of the B axis changes, but the rotation angle of the C axis does not change. The section from command points P3 to P4 is section SBC1 where rotation axis commands are set for both the B and C axes, and the rotation angles of the B and C axes change. In other words, the section from command point P3 = (B3, C1) to command point P4 = (B4, C4) is a section where rotation axis commands are set for both the B and C axes.
[0156] Furthermore, the section from command points P4 to P6 is section SB2 where a rotation axis command is set for only the B axis, and the rotation angle of the B axis changes, but the rotation angle of the C axis does not change. Furthermore, the section from command points P6 to P7 is section SBC2 where rotation axis commands are set for both the B axis and the C axis, and the rotation angles of the B axis and the C axis change. In other words, the section from command point P6 = (B6, C4) to command point P7 = (B7, C7) is a section where rotation axis commands are set for both the B axis and the C axis.
[0157] Since deceleration may occur in sections where rotation axis commands are set for both the B axis and the C axis, the command block correction unit 132 replaces sections 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 operates or a section where only the C axis command operates.
[0158] The command block corrector 132 changes the command points P1 to P7 to eliminate a section in which rotation axis commands are set for both the B-axis and the C-axis. For example, the command block corrector 132 changes the command point P4 = (B4, C4) to the command point P11 = (B4, C1), the command point P5 = (B5, C4) to the command point P12 = (B5, C1), and the command point P6 = (B6, C4) to the command point P13 = (B7, C1). In other words, the command block corrector 132 replaces the command points P4 to P6 with the command points P11 to P13. Note that the command point P14 = (B7, C7) is the same command point as the command point P7 = (B7, C7).
[0159] In this way, the command block correction unit 132 replaces sections SBC1 and SBC2 in which rotation axis commands are set for both the B axis and the C axis with sections in which a rotation axis command is set for only the B axis or a section in which a rotation axis command is set for only the C axis.
[0160] Here, the command block corrector 132 replaces the command points P4 to P6 with the command points P11 to P13 by setting the command points so that the rotation angle of the C-axis does not change for the command points P1 to P5 and so that the rotation angle of the B-axis does not change for the command point P6. As a result, the sections from the command points P1 to P3 and P11 to P13 become the section SB3 where only the rotation axis command of the B-axis is set, and the section from the command points P13 to P14 becomes the section SC1 where only the rotation axis command of the C-axis is set.
[0161] In this way, the command block correcting unit 132 replaces a section in which rotation axis commands are set for both the B axis and the C axis with a rotation axis command for only either the B axis or the C axis. In other words, if there is a section in which rotation axis commands are set for both the B axis and the C axis, the command block correcting unit 132 converts the program so as to change the section in which rotation axis commands are set for both the B axis and the C axis into a section in which only the B axis command operates and a section in which only the C axis operates. This allows the tool to rotate on only one rotation axis, so the program conversion device 1 can prevent problems such as an increase in machining time and a decrease in machining accuracy.
[0162] When the B-axis is the first rotation axis, the C-axis is the second rotation axis. Also, when the C-axis is the first rotation axis, the B-axis is the second rotation axis. When the machine tool 3 is a six-axis machining center having three rotation axes, the A-axis, B-axis, and C-axis, the command block corrector 132 replaces a section in which rotation axis commands for two or three of the A-axis, B-axis, and C-axis are set with a rotation axis command for 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 likely to cause deceleration into rotation axis commands that are unlikely to cause deceleration in the machining program 31 and omits unnecessary rotation axis commands, so that unnecessary deceleration does not occur during machining. This allows the program conversion device 1 to shorten the machining time. Furthermore, the program conversion device 1 can suppress a decrease in machining accuracy due to deceleration.
[0164] For example, regardless of whether the tool posture is near a singular posture, the machining time may increase due to variations in the tool postures indicated by the multiple commands read from the machining program 31, and the machining time may increase even if the tool posture is not close to the singular posture. For this reason, regardless of whether the tool posture is near a singular posture, the program conversion device 1 converts a rotation axis command that causes deceleration and increases the machining time into a rotation axis command that is less likely to cause deceleration and suppresses an increase in the movement time of the rotation axis.
[0165] Furthermore, when determining the rotation angle, if the change range of the tool attitude does not fall within a predetermined allowable range based on the allowable error for the rotation angle set for the machining program 31, the tool position may deviate from the path along the command shape defined by CAD or the like, and machining to the intended machining shape may not be possible. For this reason, the program conversion device 1 corrects the defective block so that the tool attitude indicated by the defective block falls within a predetermined allowable range with respect to the reference position indicating the reference tool attitude.
[0166] In this way, the program conversion device 1 corrects the defective block so that the increase in the movement time of the rotation axis is suppressed and the tool posture indicated by the defective block falls within a predetermined tolerance range relative to the reference position indicating the reference tool posture.
[0167] Furthermore, the program conversion device 1 converts the machining program 31 in advance before machining is started. 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. Therefore, the program conversion device 1 can reduce the processing load of the numerical control device 2A. As a result, the numerical control device 2A has the leeway to execute the converted machining program 35 and other processes in parallel.
[0168] The program conversion device 1 may be disposed within a numerical control device. Fig. 12 is a diagram showing the configuration of a numerical control device having a program conversion device according to an embodiment. Among the components in Fig. 12, components that achieve the same functions as those in the program conversion system 100 shown in Fig. 1 are assigned the same reference numerals, and redundant explanations will be omitted.
[0169] The numerical control device 2B has 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 included in the numerical control device 2B has the same configuration as the program conversion device 1 described in Fig. 1 and executes the same operations. The information storage device 32 stores conversion information as described in Fig. 1, and the conversion information is read out from the conversion information input unit 12.
[0170] The program conversion device 1 reads, from the CAM or the like, a machining program 31 to be converted, which has been generated by the CAM or the like. The program conversion device 1 converts the machining program 31 into a converted machining program 35 based on conversion information. The program conversion device 1 stores the converted machining program 35 in a storage unit 36.
[0171] The control unit 50 reads the converted machining program 35 in which the defective blocks have been converted into suitable 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 of the workpiece using the converted machining program 35 in which the defective blocks have been converted into suitable blocks.
[0172] Next, the hardware configurations 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 realized by processing circuits. The processing circuits may be a processor and memory that executes a program stored in a memory, or may be dedicated hardware. Note that when the program conversion device 1 and the numerical control device 2B are realized by processing circuits, each processing circuit has a similar hardware configuration, so here, the hardware configuration of the program conversion device 1 will be described.
[0173] FIG. 13 is a diagram illustrating a configuration example of a processing circuit included in a program conversion device according to an embodiment, where the processing circuit is realized by a processor and a memory. The processing circuit 90 illustrated in FIG. 13 includes a processor 91 and a memory 92. When the processing circuit 90 includes the processor 91 and the 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 written as a conversion program that converts the machining program 31 into an appropriate machining program (converted machining program 35) and is stored in the memory 92. The processing circuit 90 realizes each function by having the processor 91 read and execute the conversion program stored in the memory 92. That is, the processing circuit 90 includes the memory 92 for storing the conversion program that results in the processing of the program conversion device 1. The conversion program can also be considered a program that causes the program conversion device 1 to execute each function realized by the processing circuit 90. The conversion program may be provided by a computer-readable recording medium on which the conversion program is recorded, or by other means such as a communication medium.
[0174] The conversion program can also be said to be a program that causes the program conversion device 1 to execute the processes of steps S10 to S50 in Fig. 3. Here, the processor 91 is, for example, a CPU, a processing unit, an arithmetic unit, a microprocessor, a microcomputer, or a DSP (Digital Signal Processor). The memory 92 is, for example, a non-volatile or volatile semiconductor memory such as a RAM (Random Access Memory), a ROM (Read Only Memory), a flash memory, an EPROM (Erasable Programmable ROM), or an EEPROM (registered trademark) (Electrically EPROM), a magnetic disk, a flexible disk, an optical disk, a compact disk, a minidisk, or a DVD (Digital Versatile Disc).
[0175] 14 is a diagram illustrating an example of the configuration of a processing circuit included in a program conversion device according to an embodiment, where the processing circuit is configured using dedicated hardware. The processing circuit 93 illustrated in FIG. 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 using dedicated hardware and partially implemented using software or firmware. In this way, the processing circuit 93 can achieve the above-described functions using dedicated hardware, software, firmware, or a combination thereof.
[0176] In this way, the program conversion device 1 of the embodiment extracts defective blocks from the machining program 31 and corrects the defective blocks so that the tool posture is within the allowable range while suppressing an increase in machining time. As a result, the program conversion device 1 can reduce the machining time even when the tool posture is not close to a singular posture. Furthermore, 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 is started, 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 may be combined with other known technologies, and parts of the configurations may be omitted or modified without departing from the spirit of the invention. [Explanation of symbols]
[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 converted machining program, 36 storage unit, 40 tool, 50 control unit, 90, 93 processing circuit, 91 processor, 92 memory, 100 program conversion system, 131 defective block extraction unit, 132 command block correction unit, ad1 linear axis command group, bd1, bd11 to bd14, br1 to br6, br11 to br14 linear axis command, AD1 rotary axis command group, BD1, BD11 to BD14, BR1 to BR6, BR11 to BR14 rotary axis command, N1 to N7, N11 to N14 tool tip position, P1 to P7, P11 to P14 Command point, SB1~SB3, SBC1, SBC2, SC1 section, TP tool attitude, W workpiece.
Claims
1. A program conversion device that corrects a machining program that is generated by a CAM in which a first tolerance range for an ideal tool position and an ideal attitude of the tool is set, and that includes a quantization error based on the first tolerance range, a defect block extraction unit that refers to the machining program including a plurality of command blocks that are used when controlling a tool attitude, which is the attitude of the tool relative to a workpiece, using a rotation axis, and extracts defect blocks, which are command blocks that cause defects in machining due to the tool attitude, from the machining program; a command block correction unit that corrects the defective block so that an increase in a movement time of the rotation axis is suppressed and the tool posture indicated by the extracted defective block falls within a second allowable range that is set in advance with respect to a reference position that indicates a reference tool posture; Equipped with the defect block extraction unit extracts, as the defect block, at least one of a command block whose length between the command blocks changes by an amount greater than a specific value and a command block that is unnecessary for machining. A program conversion device characterized by:
2. the defect block extraction unit calculates a change in a command point for the tool corresponding to the tool attitude based on a plurality of command blocks included in the machining program, and extracts the defect block based on the change in the command point.
2. The program conversion device according to claim 1.
3. the defect block extraction unit further extracts, as the defect block, at least one of a command block in which the amount of change in the tool attitude changes more significantly than a reference value and a command block in which the rotation axis is reversed.
2. The program conversion device according to claim 1.
4. the defect block extraction unit sets a command block that causes deceleration in the rotation shaft among the extracted defect blocks as the defect block to be corrected by the command block correction unit.
4. The program conversion device according to claim 3.
5. the defect block extraction unit extracts, as the defect block, a command block in which the tool posture is a singular posture in which a main surface of a table on which the tool is placed and a central axis of the tool intersect perpendicularly.
2. The program conversion device according to claim 1.
6. the command block correction unit converts the extracted command block by performing at least one of combining, replacing, deleting, and dividing the command block, and corrects the command block.
6. The program conversion device according to claim 1, wherein:
7. When executing the replacement of the command block on the command block, the command block correction unit replaces a command block including a first rotation axis and a second rotation axis that rotate the tool attitude with a command block including the first rotation axis and a command block including the second rotation axis.
7. The program conversion device according to claim 6.
8. A numerical control device that corrects a machining program that is generated by a CAM in which a first tolerance range for an ideal tool position and an ideal tool posture is set, the machining program including a quantization error based on the first tolerance range, a program conversion device that is used when controlling a tool attitude, which is the attitude of the tool relative to a workpiece, by a rotation axis, and that references the machining program including a plurality of command blocks that indicate the tool attitude, and converts the machining program to generate a converted machining program; a control unit that controls the tool attitude using the converted machining program and controls a machine tool having the tool; and The program conversion device a defect block extraction unit that extracts, from the machining program, a defect block that is the command block that causes a defect in machining due to the tool posture; a command block correction unit that generates the converted machining program by correcting the defective block so that an increase in a movement time of the rotation axis is suppressed and a tool posture indicated by the extracted defective block falls within a second allowable width that is set in advance with respect to a reference position indicating a reference tool posture; and Equipped with the defect block extraction unit extracts, as the defect block, at least one of a command block whose length between the command blocks changes by an amount greater than a specific value and a command block that is unnecessary for machining. A numerical control device characterized by:
9. A program conversion method for correcting a machining program that is generated by a CAM in which a first tolerance range for an ideal tool position and an ideal attitude of the tool is set, and that includes a quantization error based on the first tolerance range, comprising: a defective block extraction step in which the program conversion device refers to the machining program, which is used when controlling a tool attitude, which is the attitude of the tool relative to a workpiece, by a rotation axis, and which includes a plurality of command blocks indicating the tool attitude, and extracts from the machining program defective blocks, which are command blocks that cause defects in machining due to the tool attitude; a command block correcting step in which the program conversion device corrects the defective block so that an increase in the movement time of the rotation axis is suppressed and the tool posture indicated by the extracted defective block falls within a second allowable width set in advance with respect to a reference position indicating a reference tool posture; Including, In the defective block extraction step, the program conversion device extracts, as the defective block, at least one of a command block in which a change in length between the command blocks is greater than a specific value and a command block that is unnecessary for machining. A program conversion method comprising:
Citation Information
Patent Citations
Numerical control device for five-axis processing machine
JP2010140312A
Numerical control device
JP2013030102A
Process program processing device and multiple spindle processor having the same
JP2017204072A
Numeric control device
WO2013175573A1
Numerical control device
WO2023073782A1