Control device and control method
By setting the program coordinate system and performing difference correction, the problem of design shape error caused by the difference between product shape data and NC program coordinate system is solved, ensuring that the machine tool can accurately process products that conform to the design shape.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MITSUBISHI ELECTRIC CORP
- Filing Date
- 2024-01-24
- Publication Date
- 2026-07-14
AI Technical Summary
Due to factors such as format changes in product shape data, a difference arises between the axes of the product shape and the program coordinate system of the NC program, causing the machine tool to be unable to produce a product that conforms to the design shape.
The program coordinate system is set by the coordinate setting unit to make the direction of the product shape data consistent with the program coordinate system, and the difference detection unit detects the difference. The shape correction unit corrects the product shape data within the allowable error range.
Even when there is a difference between the product shape data and the coordinate system of the NC program, the machine tool can still produce a product that conforms to the design shape.
Smart Images

Figure CN122396983A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a control device and control method for controlling machine tools. Background Technology
[0002] A machine tool that cuts a product from a blank by turning it is controlled by a control device such as a numerical control (NC) unit. Preferably, this control device controls the machine tool to produce a product with the shape desired by the operator, i.e., a shape conforming to the design. Here, in a machine tool equipped with a NC unit, the workpiece is machined into the desired product shape by executing an NC (Numerical Control) program. Furthermore, when generating the NC creation program used to create this NC program, product shape data representing the product shape, such as CAD (Computer-Aided Design) data, is acquired and defined in the NC creation program. However, a problem exists where, due to various reasons, errors occur between the designed product shape and the product shape defined in the NC creation program.
[0003] To address the aforementioned problem, in the self-interference stereo correction device described in Patent Document 1, all surfaces of the three-dimensional solid, which is equivalent to the product shape data, are separated into thin plates. The self-interference of all the thin plates is checked, and the three-dimensional solid is reconstructed using the results of the check, thereby correcting the stereo that has experienced self-interference.
[0004] Patent Document 1: Japanese Patent Application Publication No. 4-213168 Summary of the Invention
[0005] However, when the technology of the aforementioned Patent Document 1 is applied to the creation of an NC creation program, although the product shape data itself that has caused self-interference can be corrected, due to various processing reasons such as format transformation of the product shape data, the geometric information of each shape element contained in the product shape data will produce errors. Sometimes, there will be an unexpected difference between the axis set in the geometric information of each shape element in the product shape data and the axis set in the program coordinate system of the NC program. There is a problem that the difference cannot be corrected and the machine tool cannot produce a product that conforms to the design shape.
[0006] The present invention was made in view of the above-mentioned problems, and its object is to provide a control device that enables a machine tool to produce a product that conforms to the design shape even when there is a difference between the axis set in the geometric information of each shape element contained in the product shape data and the axis set in the program coordinate system of the NC program.
[0007] To solve the above problems and achieve the objective, the control device of the present invention includes a coordinate setting unit that sets a program coordinate system such that a first direction set in product shape data representing the product shape coincides with a second direction set in the program coordinate system. Furthermore, the control device of the present invention includes: a difference detection unit that detects the difference between the coordinates and the first direction of the configured product shape and the coordinates and the second direction of the program coordinate system; and a shape correction unit that corrects the product shape data if the difference does not fall within a specific range greater than or equal to a geometrically permissible error, i.e., a geometrically permissible error, so that the difference falls within the specific range.
[0008] The effects of the invention
[0009] The control device of the present invention achieves the following effect: even when there is a difference between the axis set in the geometric information of each shape element contained in the product shape data and the axis set in the program coordinate system of the NC program, the machine tool can still produce a product that conforms to the design shape. Attached Figure Description
[0010] Figure 1 This is a diagram showing the structure of the numerical control device involved in the implementation method.
[0011] Figure 2 It is a flowchart illustrating the processing flow of the processing program generation process performed by the processing program generation apparatus according to the embodiment.
[0012] Figure 3 This is a diagram showing an example of a product shape corresponding to the product shape data stored in the product shape storage unit of the processing procedure generation apparatus according to the embodiment.
[0013] Figure 4 This is a diagram showing an example of a blank shape corresponding to the blank shape data stored in the blank shape storage unit of the processing program generation apparatus according to the embodiment.
[0014] Figure 5 This is a diagram showing an example of the product shape and blank shape configured by the shape configuration unit of the processing procedure generation apparatus according to the embodiment.
[0015] Figure 6 This is a schematic diagram illustrating an example of machining shape data generated by the machining program generation unit of the machining program generation apparatus according to the embodiment.
[0016] Figure 7 This is a diagram illustrating an example of a machining program generated by the machining program generation unit of the machining program generation apparatus according to the embodiment.
[0017] Figure 8This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the first example.
[0018] Figure 9 This diagram illustrates the shape correction process performed by the shape correction unit of the machining process generation apparatus according to the embodiment in the first example.
[0019] Figure 10 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the second example.
[0020] Figure 11 This is a diagram illustrating the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the second example.
[0021] Figure 12 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the third example.
[0022] Figure 13 This diagram illustrates the shape correction process performed by the shape correction unit of the machining process generation apparatus according to the embodiment in the third example.
[0023] Figure 14 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the fourth example.
[0024] Figure 15 This is a flowchart illustrating the processing flow of the fifth example of shape correction processing performed by the shape correction unit of the processing program generation apparatus according to the embodiment.
[0025] Figure 16 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the sixth example.
[0026] Figure 17 This is a diagram illustrating the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the sixth example.
[0027] Figure 18 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the seventh example.
[0028] Figure 19 This is a diagram illustrating the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the seventh example.
[0029] Figure 20 This is a flowchart illustrating the processing flow of the shape correction process performed by the CNC device involved in the embodiment in the eighth example.
[0030] Figure 21 It is a flowchart illustrating the processing flow of the learning model generation process performed by the machine learning device involved in the implementation.
[0031] Figure 22 This is a block diagram illustrating the hardware structure of the numerical control device involved in the implementation method. Detailed Implementation
[0032] The control device and control method according to the embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0033] Implementation
[0034] Figure 1 This diagram illustrates the structure of the numerical control device according to the embodiment. The numerical control device 100, serving as the control device, is a computer that automatically creates an NC program, or machining program PM (not shown), for numerically controlling a machine tool (not shown), and uses the machining program PM to control the machine tool. The numerical control device 100 generates the machining program PM based on product shape data representing the shape of the product. The machine tool performs cutting operations where the workpiece (the object to be machined) is fixed and the cutting tool is rotated, or turning operations where the cutting tool is fixed and the workpiece / cutting tool is rotated.
[0035] If a difference arises between the axis (first axis) of a specific part of the product shape and the axis (second axis) set in the program coordinate system due to format transformation of the product shape data, the CNC device 100 corrects the difference and generates a machining program PM. That is, the CNC device 100 corrects the product shape to facilitate the generation of the machining program PM, and then generates the machining program PM.
[0036] The CNC device 100 can be mounted on a machine tool or be an external device connected to the machine tool. The CNC device 100 performs CNC control on the machine tool's movements according to a created machining program PM. The machining program PM is used to cut the workpiece from the blank state to produce the product shape.
[0037] The product shape is the finished shape of the machined workpiece. The blank shape is the shape of the workpiece before machining. A blank shape may be, for example, a cylindrical or cuboid shape that contains the product shape. Furthermore, the blank shape may not necessarily contain the product shape; it can be a shape obtained by thickening any facet of the product shape, or a shape obtained by removing holes from the product shape. Machine tools include, for example, machining centers, lathes, and composite lathes. The case where the machine tool is a composite lathe will be explained below.
[0038] The CNC device 100 includes a machining program generation device 10, a machine learning device 20, a dialogue operation processing unit 30, an instruction input unit 40, a display unit 50, and a control unit 60. Furthermore, in... Figure 1 In the example shown, the machining program generation device 10 and the machine learning device 20 are mounted on the CNC device 100, but the implementation is not limited to the example described in the embodiment. For example, at least one of the machining program generation device 10 and the machine learning device 20 may be a different device from the CNC device 100. That is, at least one of the machining program generation device 10 and the machine learning device 20 may be independently disposed outside the CNC device 100. In addition, the machining program generation device 10 and the machine learning device 20 may be composed of different separate devices, or they may be composed of a single device.
[0039] The machining program generation device 10 is an apparatus that generates a machining program PM containing multiple cutting processes for cutting a workpiece from a workpiece (blank) using CNC machining. The machining program generation device 10 receives shape data Fd and shape correction examples Fc from an external device. Furthermore, the shape correction examples Fc can be stored within the CNC device 100 or on an external device of the CNC device 100.
[0040] The shape correction example Fc contains data from multiple shape correction examples created in the past. The shape correction example Fc is a product shape correction example performed in the past for the product shape. The shape correction example Fc may also contain data from shape corrections performed by the CNC device 100. Additionally, the shape correction example Fc may also contain data from shape corrections performed by other devices.
[0041] In the shape correction case Fc, information such as the correction method for product shape data, the product shape to be corrected (corrected product shape data), the configuration data of the product shape, the position (coordinates) of the workpiece origin, and the direction vector information of each axis of the program coordinate system are included.
[0042] The machining program generation device 10 generates a machining program PM based on shape data Fd input from outside the CNC device 100. The shape data Fd includes data of the object to be machined, i.e., blank shape data, and data of the product shape, i.e., product shape data.
[0043] Furthermore, the product shape data may also include product material information representing the material of the product shape, and the blank shape data may also include blank material information representing the material of the blank shape. Additionally, the shape data Fd may also include blank shape assembly data. In this case, the blank shape assembly data consists of multiple blank shape data. Furthermore, the shape data Fd may also include product shape assembly data. In this case, the product shape assembly data consists of multiple product shape data.
[0044] The blank shape data is data that defines the shape of the workpiece before processing, i.e., the blank shape. The product shape data is data that defines the shape of the workpiece after processing, i.e., the product shape. The blank shape data and product shape data are, for example, CAD data. In addition, the product shape data and blank shape data are not limited to CAD data; they can be any data that the machining program generation device 10 can interpret.
[0045] If the processing program generation device 10 receives product shape data, it uses the inference results from the machine learning device 20, i.e., shape correction data, to correct the product shape. The shape correction data is data (correction methods, etc.) related to the shape correction of the product shape corresponding to the product shape data.
[0046] The machining program generation apparatus 10 of the embodiment generates a machining program PM based on product shape data and blank shape data after the product shape has been corrected. The machining program generation apparatus 10 generates a machining program PM containing information about machining units (hereinafter referred to as machining unit information) based on configuration data (configuration positions of blank shape data and product shape data), workpiece origin and program coordinate system.
[0047] The workpiece origin is the origin set for the workpiece being machined. It is the origin of the program coordinate system and a reference point used when generating the machining program (PM). The workpiece origin defines the position and orientation of the workpiece. For example, it can be used to set the origin of the machine tool's coordinate system. The machining program (PM) uses the workpiece origin as a reference to calculate the machining position and the tool's movement path. For instance, if the workpiece origin is set at X=0, Y=0, Z=0, the machining program (PM) uses that position as a reference to calculate the machining position and the tool's movement path.
[0048] A machining unit is a unit of continuous machining operations performed using the same spindle and the same cutting tools. Machining unit information consists of data related to the machining process. Specifically, machining unit information includes: machining data, which contains information about the machining method (hole machining, surface machining, etc.); tool data, which contains information about the cutting tools used for machining and the cutting conditions; and shape information, which defines the machining shape consisting of a single shape.
[0049] As machining units, there are, for example, turning units, stepped hole machining units, surface machining units, radius chamfering units, and radius chamfering units. A turning unit performs turning operations, a stepped hole machining unit performs stepped hole machining (machining of holes with steps), a surface machining unit performs surface machining, a radius chamfering unit performs radius chamfering, and a radius chamfering unit performs radius chamfering. Furthermore, the shape information defining the machining shape may also include information such as the surface roughness of the workpiece.
[0050] The tool information includes the type and shape of the tool. Additionally, the tool holder information may also include the type and shape of the tool holder. Cutting condition information includes the cutting speed, spindle speed, and feed rate during machining.
[0051] The machine learning device 20 generates a machine learning model, namely the learning model Mx (not shown), for shape correction of the product shape based on multiple shape correction examples contained in the shape correction example Fc.
[0052] The machine learning device 20 extracts product shape information (product shape, workpiece origin, program coordinate system) and shape correction data, i.e., the correction method, from multiple shape correction examples contained in the shape correction example Fc. Hereinafter, the product shape information, including product shape, workpiece origin, and program coordinate system, is sometimes referred to as product shape information.
[0053] The machine learning device 20 generates a learning model Mx based on the correspondence between the extracted product shape information and the correction method. In this embodiment, the correction method (shape correction data) corresponds to the first parameter described later, and the product shape information corresponds to the second parameter described later.
[0054] The learning model Mx is a model used to infer the correction method based on the product shape information. If product shape information is input, the learning model Mx infers the correction method corresponding to the product shape information and outputs it. The machine learning device 20 uses the generated learning model Mx to infer the correction method based on the product shape information, and sends the result of the inference, i.e., the correction method, to the processing program generation device 10.
[0055] The dialogue operation processing unit 30 is the interface between the CNC device 100 and the operator, and also the interface between the machining program generation device 10 or the machine learning device 20 and the operator.
[0056] The dialogue operation processing unit 30 sends the instruction information input by the operator via the instruction input unit 40 to the processing program generation device 10 or the machine learning device 20. Additionally, the dialogue operation processing unit 30 displays the instruction information input by the operator via the instruction input unit 40 on the display unit 50. Furthermore, in Figure 1 The diagram of the connection line between the dialogue operation processing unit 30 and the machine learning device 20 is omitted.
[0057] The instruction input unit 40 is configured using input devices such as a mouse and keyboard. The instruction input unit 40 receives instruction information from the operator and sends the instruction information to the dialogue operation processing unit 30.
[0058] The display unit 50 is a display device such as an LCD monitor. The display unit 50 displays the machining program PM, shape correction example Fc, CAD data (shape data Fd), and instruction information input by the operator via the instruction input unit 40. Additionally, the display unit 50 displays various information related to the processing performed by the CNC device 100. The control unit 60 controls the machine tool using the machining program PM generated by the machining program generation device 10.
[0059] The machining program generation device 10 includes a shape input unit 11, a product shape storage unit 12, a blank shape storage unit 13, a shape configuration unit 14, a program coordinate setting unit 15, a difference detection unit 16, a shape correction unit 17, and a machining program generation unit 18.
[0060] As shape data Fd, the shape input unit 11 receives product shape data and blank shape data input from an external device. Alternatively, the shape input unit 11 can also receive product shape data and blank shape data from an external device, respectively.
[0061] Product shape storage unit 12 stores product shape data in shape data Fd input to shape input unit 11. Blank shape storage unit 13 stores blank shape data in shape data Fd input to shape input unit 11.
[0062] The shape configuration unit 14 configures the product shape data stored in the product shape storage unit 12 and the blank shape data stored in the blank shape storage unit 13. The shape configuration unit 14 configures the product shape and blank shape so that the shape of the workpiece after processing (i.e., the product shape) is contained within the shape of the workpiece before processing (i.e., the blank shape). The shape configuration unit 14 stores the configured product shape data in the product shape storage unit 12 and the configured blank shape data in the blank shape storage unit 13. The product shape data containing the configured product shape includes the product shape coordinates (coordinates set in the product shape data) and program coordinate system information. Similarly, the blank shape data containing the configured blank shape includes the blank shape coordinates and program coordinate system information.
[0063] The product shape storage unit 12 stores in advance the identification information (hereinafter referred to as shape identification information) that identifies the combination of the configured product shape and the blank shape, and associates it with the product shape data. The blank shape storage unit 13 stores in advance the shape identification information of the configured product shape and the blank shape, and associates it with the blank shape data.
[0064] The shape configuration unit 14 may not necessarily configure the blank shape and the product shape at the position where the product shape is contained within the blank shape. Alternatively, the shape configuration unit 14 may configure at least one of the product shape and the blank shape at the position indicated by the operator via the dialogue operation processing unit 30.
[0065] The program coordinate setting unit 15 configures the workpiece origin and program coordinate system at any position based on the shape of either the product shape or the blank shape configured by the shape configuration unit 14. The program coordinate setting unit 15 sets the workpiece origin and program coordinate system so that the position and direction set on the product shape (first direction) are consistent with the position and direction set in the program coordinate system (second direction). That is, the program coordinate setting unit 15 performs alignment and orientation between the product shape data and the program coordinate system. The first direction (first axis) corresponds to the first direction vector, and the second direction (second axis) corresponds to the second direction vector. The program coordinate setting unit 15 stores the coordinate values of the workpiece origin and the direction vectors of each axis of the program coordinate system in association with shape recognition information.
[0066] Furthermore, the program coordinate setting unit 15 can also configure the workpiece origin and program coordinate system specified by the operator at any position. In this case, the program coordinate setting unit 15 stores the coordinate values of the workpiece origin specified by the operator at any position and the direction vectors of each axis of the program coordinate system in advance.
[0067] In addition, the program coordinate setting unit 15 sets the initially set direction (e.g., the Z-axis direction) as the turning direction and stores the set turning direction. Furthermore, the program coordinate setting unit 15 can also set the direction specified by the operator at any position as the turning direction and store the set turning direction.
[0068] The workpiece origin is used to create the machining program (PM), for example, it can be set at a specific location (center, corner, etc.) on the shape of the workpiece. The program coordinate system is a coordinate system with the workpiece origin as its origin, such as a world coordinate system with X, Y, and Z axes. Furthermore, the workpiece origin can be set at the center or corner of a surface, or it can be set by the operator at any location.
[0069] The difference detection unit 16 reads the product shape data configured by the shape configuration unit 14 and stored in the product shape storage unit 12 from the product shape storage unit 12. In addition, the difference detection unit 16 reads the program coordinate system stored in the program coordinate setting unit 15 from the program coordinate setting unit 15.
[0070] The difference detection unit 16 detects the difference between the position or direction set in the product shape (first direction) and the position or direction set in the program coordinate system (second direction) based on the product shape data and the program coordinate system. The difference detection unit 16 sends the product shape data, the program coordinate system, and the detected difference to the shape correction unit 17. The shape correction unit 17 corrects the product shape data based on the product shape data, the program coordinate system, and the difference.
[0071] The shape correction unit 17 stores the product shape data correction method in advance as shape correction data. The shape correction unit 17 also stores the shape recognition information in advance in association with the shape correction data. In addition, the shape correction data can also be stored in other areas outside the shape correction unit 17.
[0072] Furthermore, the shape correction unit 17 stores the corrected product shape data in the product shape storage unit 12. That is, the shape correction unit 17 overwrites the uncorrected product shape data stored in the product shape storage unit 12 with the corrected product shape data.
[0073] The product shape storage unit 12 stores shape recognition information and corrected product shape data in advance. Furthermore, the shape correction unit 17 can also store both the product shape data before and after correction in the product shape storage unit 12. The corrected product shape data includes information such as product shape configuration data and product shape dimensions.
[0074] The information, including the corrected product shape, workpiece origin, and program coordinate system, is called product shape information. Furthermore, the correction method used by the shape correction unit 17 is called shape correction data. Moreover, the combination of product shape information and shape correction data is called a shape correction example Fc.
[0075] The machining program generation unit 18 reads the product shape data and shape recognition information configured by the shape configuration unit 14 and corrected by the shape correction unit 17 from the product shape storage unit 12. Additionally, based on the shape recognition information, the machining program generation unit 18 reads the blank shape data configured by the shape configuration unit 14 from the blank shape storage unit 13. Furthermore, based on the shape recognition information, the machining program generation unit 18 reads the program coordinate system from the program coordinate setting unit 15.
[0076] The machining program generation unit 18 generates a machining program PM based on the product shape data configured by the shape configuration unit 14 and corrected by the shape correction unit 17, the blank shape data configured by the shape configuration unit 14, and the program coordinate system.
[0077] The machine learning device 20 uses shape correction examples Fc generated by the processing procedure generation device 10 or shape correction examples Fc read from an external source to generate a learning model Mx for reasoning about the correction method based on the product shape information. Furthermore, the machine learning device 20 infers the correction method by inputting the product shape information generated by the processing procedure generation device 10 into the learning model Mx.
[0078] The following describes the case where the machine learning device 20 uses the shape correction example Fc generated by the processing program generation device 10 to generate a learning model Mx for reasoning about the correction method based on the product shape information.
[0079] The machine learning device 20 includes a shape correction method analysis unit 21, a machine learning unit 22, a learning model storage unit 23, and an inference unit 24. The shape correction method analysis unit 21 reads the product shape data and shape recognition information stored in the product shape storage unit 12 after being configured by the shape configuration unit 14 and corrected by the shape correction unit 17.
[0080] The shape correction method analysis unit 21 extracts a first parameter and a second parameter from the program coordinate system stored in the program coordinate setting unit 15, the product shape data read from the product shape storage unit 12, and the shape correction data stored in the shape correction unit 17. That is, the shape correction method analysis unit 21 extracts the first parameter (the correction method for the product shape data) from the shape correction data, and extracts the second parameter (the product shape, the workpiece origin, and the program coordinate system) from the corrected product shape, the product shape configuration data, the workpiece origin position, and the direction vectors of each axis of the program coordinate system.
[0081] The correction methods for product shape data include the following.
[0082] Correction methods for machined surfaces (cylinders, cones, toroids) Correction methods for stepped hole surfaces and stepped hole surfaces Correction method for the XY plane of the plane Methods for correcting the relationship between the plane and cylindrical surfaces of the wall and the Z-axis direction during surface machining. Correction method for the radius of curvature (R) of adjacent round fillets Correction method for the chamfer amount of adjacent C-chamfer fillets The first parameter and the second parameter are parameters used by the machining program generation device 10. The first parameter is a parameter that is subject to adjustment in the machining program generation device 10. The second parameter is a parameter that is not subject to adjustment in the machining program PM, and is used to adjust the first parameter. The parameter adjustment process is the process of determining the value of the parameter.
[0083] The value of the first parameter is generated when performing shape correction on the product shape data stored in the product shape storage unit 12. The first parameter is, for example, a parameter representing the product shape correction method in the shape correction example Fc, and is the data required for product shape correction.
[0084] The second parameter is fixed-length data that has not been adjusted. For example, the second parameter can be data generated based on the product shape, the dimensions of the product shape, etc. Examples of the second parameter include product dimensions (height, width, height, etc.) extracted from the product shape, the position coordinates of the workpiece origin, and the direction vectors of each axis of the program coordinate system. Alternatively, the second parameter can also be image data of the 3D shape of the product, voxel data of the 3D shape of the product, or interior / exterior determination data in the 3D lattice space of the product shape.
[0085] Internal / external data refers to data distributed across a lattice-like structure dividing 3D space. Data is assigned to each lattice point, and within this internal / external data, it is categorized into two types: data existing within the lattice space (internal data) and data existing outside the lattice space (external data). Internal data is data within the lattice space, such as data representing the shape of an object or the distribution of physical quantities. Conversely, external data is data outside the lattice space, such as data representing inputs and boundary conditions from outside the object.
[0086] For each first parameter, a second parameter is associated with it. The shape correction method analysis unit 21 adjusts the first parameter based on the second parameter corresponding to the first parameter. For each first parameter, the shape correction method analysis unit 21 determines the second parameter to be extracted and extracts the determined second parameter. The shape correction method analysis unit 21 inputs the extracted first parameter and second parameter to the machine learning unit 22.
[0087] The machine learning unit 22 generates a learning model Mx by learning from a dataset including the extracted first and second parameters. That is, the machine learning unit 22 generates a learning model Mx that is used to infer the first parameter based on the second parameter set by the operator. In this embodiment, the machine learning unit 22 performs teacher-guided learning, for example, to generate the learning model Mx. The machine learning unit 22 then inputs the generated learning model Mx into the learning model storage unit 23.
[0088] The learning algorithm used by the Machine Learning Department 22 can be any algorithm. As an example of a learning algorithm used by the Machine Learning Department 22, a neural network can be cited. A neural network can also be a multi-layered deep learning network. Furthermore, the learning algorithm used by the Machine Learning Department 22 can also be genetic programming, inductive logic programming, SVM (Support Vector Machine), etc. Machine learning is the process of optimizing parameters such as the weights or biases of a neural network.
[0089] The learning model storage unit 23 stores the learning results of the machine learning unit 22, namely the learning model Mx. The learning model Mx outputs the optimal first parameter for the input second parameter. That is, the learning model Mx is a model used to derive the optimal first parameter for the second parameter from the second parameter.
[0090] As input data, input data including the second parameter is input to the inference unit 24. The inference unit 24 uses the learning model Mx to infer the first parameter based on the second parameter. The inference unit 24 inputs the second parameter to the learning model Mx and outputs the inference result, i.e., the first parameter, from the learning model Mx. The inference unit 24 sends the inference result to the shape correction unit 17. That is, for the second parameter sent from the shape correction unit 17, the inference unit 24 sends the inference result, i.e., the first parameter, back to the shape correction unit 17. As the inference result, the inference unit 24 outputs the first parameter to the shape correction unit 17.
[0091] The CNC device 100 can determine the first parameter (correction method) based on the second parameter using the machine learning device 20, or it can determine the first parameter based on the second parameter without using the machine learning device 20. When the CNC device 100 determines the first parameter without using the machine learning device 20, it determines the first parameter, i.e., the correction method, based on the shape of the area (surface) being machined.
[0092] Next, the operation of the CNC device 100 will be described. The processing performed by the CNC device 100 includes machining program generation processing performed by the machining program generation device 10, learning model generation processing performed by the machine learning device 20, and inference processing performed by the machine learning device 20.
[0093] Figure 2 This is a flowchart illustrating the processing flow of the processing procedure generation process performed by the processing procedure generation apparatus according to the embodiment. The processing procedure generation apparatus 10 uses the inference result to perform shape correction on the product shape and generates a processing procedure PM for the corrected product shape. The inference result is obtained by inference using the learning result of the machine learning device 20, i.e., the learning model Mx.
[0094] The shape input unit 11 reads product shape data from an external device or a storage area (not shown) within the CNC device 100 (step S1). The shape input unit 11 stores the product shape data in the product shape storage unit 12.
[0095] The shape input unit 11 reads blank shape data from an external device or a storage area (not shown) within the CNC device 100 (step S2). The shape input unit 11 stores the blank shape data in the blank shape storage unit 13. Furthermore, the machining program generation device 10 generates a blank shape based on the product shape data stored in the product shape storage unit 12, and stores the generated blank shape data in the blank shape storage unit 13. The machining program generation device 10 can also execute the processing of step S1 and step S2 in any order.
[0096] Figure 3 This diagram illustrates an example of a product shape corresponding to the product shape data stored in the product shape storage unit of the processing program generation apparatus according to the embodiment. The product shape data 101 stored in the product shape storage unit 12 includes three views and a perspective view Pv1 of the product shape SA1. The three views of the product shape SA1 are a front view Fv1, a left side view Ls1, and a top view Gp1. A program coordinate system AX1 is set in the three views and perspective view Pv1 of the product shape SA1.
[0097] Figure 4This diagram illustrates an example of a blank shape corresponding to the blank shape data stored in the blank shape storage unit of the machining program generation apparatus according to the embodiment. The blank shape data 102 stored in the blank shape storage unit 13 includes three views and a perspective view Pv2 of the blank shape SB2. The three views of the blank shape SB2 are a front view Fv2, a left side view Ls2, and a top view Gp2. A program coordinate system AX2 is set in the three views and perspective view Pv2 of the blank shape SB2. Figure 4 The diagram shows the case where the program coordinate system AX2 is the same as the program coordinate system AX1.
[0098] The shape configuration unit 14 configures each shape of the product shape and the blank shape (step S3). That is, the shape configuration unit 14 generates configuration data for the product shape and the blank shape. In other words, the shape configuration unit 14 generates configuration data indicating the configuration position of the product shape and the blank shape. The configuration data indicates the orientation of the product shape and the blank shape and their position on a 3D coordinate system. At the time the configuration data is generated, the product shape and the blank shape are not limited to being configured in easily machinable locations.
[0099] Therefore, the shape configuration unit 14 reconfigures the product shape data and the blank shape data based on the generated configuration data. That is, the shape configuration unit 14 reconfigures the product shape and the blank shape by rotating and moving them according to the configuration data. For example, the shape configuration unit 14 reconfigures the product shape and the blank shape so that the direction of the axis (first axis) of the processing shape (processing area) included in the product shape data is aligned with the direction of the axis (second axis) set in the program coordinate system. Furthermore, at least one of the product shape data and the blank shape data can also be configured at any position by the operator using the dialogue operation processing unit 30, the instruction input unit 40, and the display unit 50.
[0100] The program coordinate setting unit 15 sets the coordinate values of the workpiece origin and the program coordinate system at any position based on the shape of either the product shape or the blank shape configured by the shape configuration unit 14 (step S4). For example, the program coordinate setting unit 15 sets the position on the central axis of the product shape or the blank shape as the workpiece origin. Furthermore, the program coordinate setting unit 15 configures the program coordinate system such that the direction of the cutting axis is aligned with the axis direction of the program coordinate system. The program coordinate setting unit 15 stores the coordinate values of the workpiece origin and the direction vectors of each axis of the program coordinate system.
[0101] The workpiece origin and program coordinate system can be configured in any direction and at any position by the operator using the dialogue operation processing unit 30, the instruction input unit 40, and the display unit 50. Furthermore, when the program coordinate system is set to the world coordinate system, the machining program generation device 10 can omit step S4. That is, when the program coordinate system is the world coordinate system, the machining program generation device 10 does not need to set the coordinate values of the workpiece origin and the program coordinate system.
[0102] Figure 5 This diagram illustrates an example of a product shape and a blank shape configured by the shape configuration unit of the processing procedure generation apparatus according to the embodiment. The shape configuration unit 14 combines the product shape and the blank shape by configuring them.
[0103] The configuration data 103 for the product shape and blank shape generated by configuring the product shape and blank shape through the shape configuration unit 14 includes the three views and oblique view Pv3 of the configuration shape SC3, which configures the product shape SA1 and the blank shape SB2. The three views of the configuration shape SC3 are the front view Fv3, the left side view Ls3, and the top view Gp3. The program coordinate system AX3 is set in the configuration shape SC3. Figure 5 The diagram shows the case where the program coordinate system AX3 is the same as the program coordinate systems AX1 and AX2.
[0104] Products are formed by cutting blanks. Therefore, in Figure 5 The diagram shows the case where product shape SA1 is positioned inside blank shape SB2.
[0105] The shape correction unit 17 analyzes all the shape data of the product shape configured by the shape configuration unit 14 and corrects the product shape based on the workpiece origin and the program coordinate system (step S5). The machining program generation unit 18 unfolds the machining shape representing the area (shape) to be machined. Specifically, the machining program generation unit 18 generates machining shape data based on the product shape data stored in the product shape storage unit 12 and the shape corrected by the shape correction unit 17, and the blank shape data stored in the blank shape storage unit 13.
[0106] The shape corresponds to the difference between the machining shape data and the product shape data and the blank shape data. That is, the machining shape data is the data of the shape (area) of the blank to be machined. The machining program generation unit 18 generates turning machining data, surface machining data, chamfering machining data and hole machining data based on the machining shape data.
[0107] Turning data represents the area where the workpiece is rotated during turning. Surface machining data represents the area where surface machining is performed, chamfering data represents the area where chamfering is performed, and hole machining data represents the area where hole machining is performed. Surface machining, chamfering, and hole machining are all machining processes that involve rotating the cutting tool.
[0108] Next, the machining program generation unit 18 allocates machining units for the unfolded machining shape. That is, the machining program generation unit 18 determines the machining method, tool, and cutting conditions for the generated machining shape. The machining program generation unit 18 generates machining unit information by allocating information about the machining method, tool, and cutting conditions to the machining shape. Furthermore, based on the generated machining unit information, machining method, tool, cutting conditions, machining shape, and the results of interference checks, the machining program generation unit 18 generates a machining program PM (step S6). Interference checks are a process that confirms whether the tool interferes with non-machined areas.
[0109] Figure 6 This is a schematic diagram illustrating an example of machining shape data generated by the machining program generation unit of the machining program generation apparatus according to the embodiment. Figure 6 The machining shape data 201 shows the blank shape data, turning shape data, surface machining shape data and hole machining shape data.
[0110] exist Figure 6 The diagram of machining shape data shown on the left schematically illustrates, in oblique view, the blank shape Sx1, the shape example shown in the turning machining shape data of the front side process, namely the turning hole machining shape SH1, the turning shapes SH2, SH3, and the shape example shown in the hole machining shape data, namely the hole machining shape SH4.
[0111] exist Figure 6 In the diagram of machining shape data shown on the right, the blank shape Sx1, the turning machining shape data of the back side process (i.e., turning shapes SH5 to SH7), the surface machining shapes SH8 to SH15, and the hole machining shape data (i.e., hole machining shape SH16) are schematically shown in oblique view.
[0112] Furthermore, hole machining shape SH4 is a hole machining shape composed of four hole machining shapes, each of which performs the same hole machining. Additionally, hole machining shape SH16 is a hole machining shape composed of two hole machining shapes, each of which performs the same hole machining.
[0113] Figure 7 This diagram illustrates an example of a machining program generated by the machining program generation unit of the machining program generation apparatus according to the embodiment. Figure 7The diagram shows a list of machining steps in the machining process PM. Here, it shows the case where Uno1. to Uno4. are included in the front-side machining step HD1 of the machining process PM. It also shows the case where Uno.5. to Uno.16 are included in the back-side machining step HD2.
[0114] "Uno1. Turning Drill Bit...SH1" indicates that the machine tool processes the turning hole machining shape SH1 as a turning drill bit unit. "Uno2. End Face...SH2" indicates that the machine tool processes the turning machining shape SH2 as a turning end face unit. "Uno3. Bar Stock...SH3" indicates that the machine tool processes the turning machining shape SH3 as a turning bar stock unit. "Uno4. C-Axis Drill Bit...SH4" indicates that the machine tool processes the four hole machining shapes SH4 as a C-axis drill bit unit. Furthermore, in Uno1. to Uno4., the machine tool holds the workpiece on the first spindle side and processes it from the front side. The first spindle is one of the spindles facing opposite directions. The first spindle and the second spindle are... Figure 6 The central axis of the blank shape Sx1 shown.
[0115] “Uno5. End Face…SH5” indicates that the machine tool uses the turning shape SH5 as the turning end face unit for machining. “Uno6. Bar…SH6” and “Uno7. Bar…SH7” indicate that the machine tool uses the turning shapes SH6 and SH7 as the turning bar unit for machining. “Uno8. End Mill…SH8”, “Uno9. End Mill…SH9”, “Uno10. End Mill…SH10”, and “Uno11. End Mill…SH11” indicate that the machine tool uses the face machining shapes SH8, SH9, SH10, and SH11 as end mill units for machining. "Uno12. Concave Milling Cutter…SH12", "Uno13. Concave Milling Cutter…SH13", "Uno14. Concave Milling Cutter…SH14", and "Uno15. Concave Milling Cutter…SH15" indicate that the machine tool uses the face machining shapes SH12, SH13, SH14, and SH15 as concave milling cutter units. "Uno16. C-axis Drill…SH16" indicates that the machine tool uses the two hole machining shapes SH16 as C-axis drill unit.
[0116] Furthermore, in Uno5 to Uno16, the machine tool re-holds the blank processed by the first spindle using the second spindle and performs machining from the back side. Both the first and second spindles are turning spindles, referred to as the main spindle and sub-spindle, respectively, and are positioned opposite each other. In machine tools without a second spindle, after machining the front side, the blank is removed from the first spindle, the machined blank is reversed, and re-clamped by the first spindle, allowing the machine tool to machine the back side.
[0117] The turning drill unit is a machining unit that performs hole machining using a turning drill bit at the center of a workpiece. The turning face unit is a machining unit that removes protrusions from the end face (front or back) of a workpiece. The turning bar unit is a machining unit that performs turning machining on the outer circumference, inner circumference, front, or back of a round bar workpiece using a turning tool. The end mill unit is a machining unit that uses end mills to flatten the surface of a workpiece (the object being machined). Machining is performed using the end mill unit without exceeding the shape to be machined. The recess end mill unit is a machining unit that uses end mills to machine recessed shapes. Machining is performed using the recess end mill unit without exceeding the shape to be machined. The C-axis drill unit is a machining unit that performs hole machining using a drill bit; during positioning, C-axis machining is performed by clamping the C-axis. The C-axis is an axis that rotates about the Z-axis.
[0118] Figure 8 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the first example. Figure 8 processing and Figure 2 The processing corresponds to step S5. The first example of shape correction processing performed by the shape correction unit 17 is a process of correcting cylindrical surfaces, conical surfaces, and toroidal surfaces.
[0119] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinates of the central axis of the cylindrical surface, conical surface, or toroidal surface are consistent with the direction (second direction) and position coordinates of the turning axis. Here, the first direction and the second direction are the directions of the turning axis. That is, the first direction and the second direction are the directions of either vector (0, 0, 1) or vector (0, 0, -1).
[0120] The difference detection unit 16 acquires all surfaces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S11). The difference detection unit 16, referring to the geometric information of the acquired surfaces, extracts cylindrical surfaces, conical surfaces, and toroidal surfaces from the acquired surfaces (step S12). A cylindrical surface is the inner wall of a cylindrical hole shape; a conical surface is the inner wall of a conical hole shape; and a toroidal surface is the inner wall of a toroidal hole shape.
[0121] The difference detection unit 16 calculates the difference between the central axis of the surface extracted by the shape correction unit 17 and the turning axis set in the program coordinate system (step S13). That is, the difference detection unit 16 compares the position coordinates and direction vectors of the central axes of the extracted cylindrical, conical, and toroidal surfaces with the position coordinates and direction vectors of the turning axis stored by the program coordinate setting unit 15, and calculates the difference in position coordinates and the difference in direction vectors. The position coordinates of the central axis are the coordinates of a specific point on the central axis, and the position coordinates of the turning axis are the coordinates of a specific point on the turning axis.
[0122] The shape correction unit 17 determines whether product shape correction is needed based on the difference in position coordinates and the difference in direction vectors (step S14). The shape correction unit 17 determines that correction is needed if both the difference in position coordinates and the difference in direction vectors fall within a specific range. That is, the shape correction unit 17 determines that correction is needed if the difference in position coordinates and the difference in direction vectors are greater than or equal to the geometric tolerance (geometric accuracy) and less than the set error set by the operator. The set error can be a fixed value or arbitrarily set by the operator. If the operator has set the set error, a difference greater than or equal to the set error is an intentionally set difference by the operator, and the product shape with such a difference is not subject to correction. In other words, the difference set in the design is the difference required to achieve the designed product shape, and the determination is performed so that this difference is not subject to correction.
[0123] If the difference between the position coordinates and the difference between the direction vectors is less than the geometric tolerance, and the other is greater than or equal to the geometric tolerance but less than the set error, the shape correction unit 17 determines that correction is required.
[0124] Furthermore, if either the difference in position coordinates or the difference in direction vectors is greater than or equal to a set error, the shape correction unit 17 determines that no correction is needed. Conversely, if both the difference in position coordinates and the difference in direction vectors are less than the geometrically permissible error, the shape correction unit 17 determines that no correction is needed.
[0125] That is, if the shape correction unit 17 determines that correction is required when at least one of the difference in position coordinates and the difference in direction vector is greater than or equal to the geometric allowable error, and both the difference in position coordinates and the direction vector are less than the set error.
[0126] The geometric tolerance is the allowable error in geometry; errors greater than or equal to this geometric tolerance are not permitted. The geometric tolerance corresponds to the linear and angular precision in the system. If the difference in position coordinates is less than the linear precision, the difference, i.e., the distance (error), is treated as zero. If the distance is less than the difference in linear precision, it is treated as the same position.
[0127] Additionally, if the difference in direction vectors is less than the angular precision, the difference in direction vectors, i.e., the angle, is treated as zero. If the angle is less than the difference in angular precision, it is treated as the same direction vector with the same angle.
[0128] Furthermore, the set error amount set by the operator is a linear accuracy and angular accuracy set separately from the geometric tolerance error amount. The operator considers shape data with accuracy differences and sets a value greater than or equal to the geometric tolerance error amount as the set error amount. The set error amount is the error amount envisioned by the operator; errors greater than or equal to the operator's envisioned set error amount are allowed, but errors less than the set error amount are not allowed. That is, errors greater than or equal to the operator's desired error are allowed, but errors undesirable to the operator are not allowed. The operator's envisioned error is an error that is detrimental to the manufacturing process. The shape correction unit 17 corrects the product shape to reduce this error to less than the set error amount. That is, the shape correction unit 17 corrects the product shape so that the error falls within a specific range when the error (difference) does not fall within a specific range greater than or equal to the geometrically permissible error amount, i.e., the geometric tolerance error amount. As described above, the shape correction unit 17 only sets the error within the specific range envisioned by the operator as the correction target.
[0129] If the shape correction unit 17 determines that correction is needed (as determined in step S14), it corrects the surface that is determined to require correction (step S15). If the position coordinates of the central axis of the cylindrical, conical, or toroidal surface need correction, the shape correction unit 17 corrects the position coordinates of the central axis to make them consistent with the position coordinates of the turning axis. Additionally, if the direction vector of the central axis of the cylindrical, conical, or toroidal surface needs correction, the shape correction unit 17 corrects the direction vector of the central axis to make it consistent with the direction vector of the turning axis. The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the surface corrected in step S15 with adjacent surfaces (step S16). If it determines that correction is not needed (as determined in step S14), the shape correction unit 17 does not perform correction.
[0130] Figure 9 This diagram illustrates the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the first example. Here, the conical surface formed into the product shape 81 will be described.
[0131] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the central axis of the surface SF4 included in the product shape 81 is consistent with the direction of the turning axis set in the program coordinate system, i.e., vector (0, 0, 1) or vector (0, 0, -1). In this case, for example, the geometric information of the surface SF4, which forms the conical surface of the product shape 81, has the following information. This geometric information is, for example, information that has been rewritten for some reason during format transformation, resulting in an offset.
[0132] SF4: Conical surface The position coordinates of the central axis are (0.00001, 0, 0). The direction vector of the central axis (0.0001, 0.0001, 0.99999999) Radius = 0.025 Half vertex angle = 2.86 degrees The difference detection unit 16 calculates the difference between the position coordinates and direction vectors of the central axis and the turning axis of the SF4.
[0133] When the turning axis of the comparison object is at position coordinates (0, 0, 0) and direction vector (0, 0, 1), the difference between the position coordinates of the turning axis and the position coordinates of the central axis of surface SF4 is 0.00001, and the difference between the direction vector of the turning axis and the direction vector of the central axis of surface SF4 is 0.000141.
[0134] Furthermore, both the direction vector of the turning axis and the direction vector of the central axis of surface SF4 are unit vectors. Therefore, in this embodiment, the difference between the two direction vectors is set as the magnitude of the difference in direction vectors, but the difference in direction vectors can also be the angle between the direction vector of the turning axis and the direction vector of the central axis of surface SF4.
[0135] When the geometric tolerance of the position coordinates is 1.0e-8, the geometric tolerance of the direction vector is 1.0e-10, the setting error of the position coordinates set by the operator is 1.0e-3, and the setting error of the direction vector is 1.0e-6, the shape correction unit 17 performs shape correction of surface SF4.
[0136] The shape correction unit 17 corrects the geometric information of the surface SF4 of the conical surface in the following manner.
[0137] The position coordinates of the central axis are (0, 0, 0). The direction vector of the central axis is (0, 0, 1). That is, the shape correction unit 17 corrects the geometric information of the surface SF4 so that the position coordinates and direction vector of the central axis of the surface SF4 are consistent with the position coordinates (0, 0, 0) and direction vector (0, 0, 1) of the turning axis. In addition, the shape correction unit 17 recalculates the intersection line and intersection point of the surface SF4 and the surface adjacent to the surface SF4 in a matching manner with the corrected surface SF4.
[0138] Figure 10 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the second example. Figure 10 processing and Figure 2 The processing corresponds to step S5. The second example of shape correction processing performed by the shape correction unit 17 is a process of correcting adjacent cylindrical surfaces, conical surfaces and toroidal surfaces in the stepped hole.
[0139] The shape configuration unit 14 configures the product shape so that the directions of the central axes of the stepped holes (i.e., stepped holes) included in the product shape are aligned. The program coordinate setting unit 15 sets the workpiece origin, program coordinate system, and turning axis directions so that the directions (first direction) and position coordinates of the central axes of the stepped holes (i.e., stepped holes) included in the product shape are aligned with the directions (second direction) and position coordinates of the turning axis. That is, the program coordinate setting unit 15 sets the workpiece origin, program coordinate system, and turning axis directions so that the directions of the central axes of the cylindrical, conical, and toroidal surfaces in the stepped holes are aligned with the direction of the turning axis. Here, the first direction and the second direction are the directions of the turning axis. That is, the first direction and the second direction are the directions of either vector (0, 0, 1) or vector (0, 0, -1).
[0140] The difference detection unit 16 acquires all surfaces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S21). The difference detection unit 16 refers to the geometric information of the acquired surfaces and extracts the cylindrical, conical, and toroidal surfaces of the hole shapes (empty inside) in the acquired surfaces (step S22).
[0141] The difference detection unit 16 selects adjacent surfaces among the obtained surfaces by referring to the geometric information of the obtained surfaces. That is, the shape correction unit 17 selects combinations of adjacent surfaces (hole surfaces) among the extracted cylindrical surfaces, conical surfaces and toroidal surfaces (step S23).
[0142] The difference detection unit 16 calculates the difference (axis difference) between the central axes of adjacent surfaces (hole surfaces) (step S24). That is, the difference detection unit 16 obtains the position coordinates and direction vectors of the central axes of the selected adjacent cylindrical, conical, and toroidal surfaces, and calculates the difference in position coordinates and direction vectors between the adjacent surfaces. As described above, the difference detection unit 16 calculates the difference indicating how much the central axes have shifted between adjacent surfaces.
[0143] The shape correction unit 17 determines whether the product shape needs to be corrected based on the difference in position coordinates and the difference in direction vectors (step S25). The shape correction unit 17 determines whether correction is needed using the same determination method as in the shape correction process of the first example (the determination method in step S14).
[0144] If the shape correction unit 17 determines that correction is needed (in step S25, it is needed), it corrects the surface that is determined to need correction (step S26). When the position coordinates of the central axis of a cylindrical surface, conical surface, or torus surface need to be corrected, the shape correction unit 17 corrects the position coordinates of the central axis of a surface so that the position coordinates of the central axis of one surface of an adjacent surface are consistent with the position coordinates of the central axis of the other surface.
[0145] Furthermore, when the direction vector of the central axis of a cylindrical, conical, or toroidal surface needs to be corrected, the shape correction unit 17 corrects the direction vector of the central axis of one surface so that the direction vector of the central axis of one adjacent surface is consistent with the direction vector of the central axis of the other surface. In other words, the shape correction unit 17 corrects the position coordinates and direction vector of the central axis of any one of the adjacent surfaces so that the position coordinates and direction vectors of the central axes of the two adjacent surfaces are consistent.
[0146] Furthermore, the shape correction unit 17 can also correct the position coordinates and direction vectors of the central axes of adjacent surfaces to make the position coordinates and direction vectors of the central axes of adjacent surfaces consistent. The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the surfaces that were corrected in step S26 with adjacent surfaces (step S27). If it is determined that no correction is needed (in step S25, no correction is needed), the shape correction unit 17 does not perform correction.
[0147] Figure 11 This diagram illustrates the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the second example. Here, the stepped hole formed into product shape 82 will be described. For example, the stepped hole formed into product shape 82 includes a conical surface SF5, a cylindrical surface SF6, and a cylindrical surface SF7.
[0148] The shape configuration unit 14 configures the product shape 82 so that the central axes of the surfaces SF5 to SF7 included in the product shape 82 are aligned. The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the central axes of surfaces SF5 to SF7 are aligned with the direction of the turning axis. In this case, the geometric information of the conical surface SF5, the cylindrical surface SF6, and the cylindrical surface SF7 has the following information. This geometric information is, for example, information resulting from an offset after being rewritten for some reason during format conversion.
[0149] SF5: Conical surface The position coordinates of the central axis are (0, 0, 0.029). The direction vector of the central axis is (0, 0, 1). Radius = 0.0075 Half vertex angle = 45 degrees SF6: Cylindrical surface The position coordinates of the central axis are (0, 0, 0.03). The direction vector of the central axis is (0, 0, 1). Radius = 0.0075 SF7: Cylindrical surface The position coordinates of the central axis are (0.00001, 0.0001, 0.03). The direction vector of the central axis (0.0001, 0.0001, 0.99999999) Radius = 0.005 The difference detection unit 16 calculates the difference between the position coordinates and direction vectors of surfaces SF5 to SF7. That is, the difference detection unit 16 calculates the difference between the center axis of surface SF6, which is adjacent to surface SF5, and the difference between the center axis of surface SF7, which is adjacent to surface SF6, and the center axis of surface SF6.
[0150] The difference in position coordinates between the conical surface SF5 and the cylindrical surface SF6 is 0.001, and the difference in the direction vector of the central axis is 0. Additionally, the difference in position coordinates between the cylindrical surface SF6 and the cylindrical surface SF7 is 0, and the difference in the direction vector of the central axis is 0.000141.
[0151] When the geometric tolerance of the position coordinates is 1.0e-8, the geometric tolerance of the direction vector is 1.0e-10, the setting error of the position coordinates set by the operator is 1.0e-3, and the setting error of the direction vector is 1.0e-6, the shape correction unit 17 performs shape correction of surface SF7.
[0152] The shape correction unit 17 corrects the geometric information of the cylindrical surface SF7 in the following manner.
[0153] The position coordinates of the central axis are (0, 0, 0.03). The direction vector of the central axis is (0, 0, 1). That is, the shape correction unit 17 corrects the geometric information of surface SF7 so that the position coordinates and direction vector of the central axis of surface SF7 are consistent with the position coordinates (0, 0, 0.03) and direction vector (0, 0, 1) of the central axis of surface SF6. Furthermore, the shape correction unit 17 recalculates the intersection lines and intersection points of surface SF7 and the surfaces adjacent to surface SF7 to match the corrected surface SF7. However, the shape correction unit 17 does not correct the geometric information of the cylindrical surfaces SF5 and SF6.
[0154] In addition, the shape correction unit 17 can also correct the geometric information of the surface SF7 so that the position coordinates and direction vector of the central axis of the surface SF7 are consistent with the position coordinates (0, 0, 0.029) and direction vector (0, 0, 1) of the central axis of the surface SF5.
[0155] Furthermore, if, in surfaces SF5 and SF6, the shape correction unit 17 determines that correction of either surface SF5 or SF6 is required when both the difference in position coordinates and the difference in direction vectors are greater than or equal to the geometric allowable error, and at least one of the difference in position coordinates and the direction vectors is less than the set error.
[0156] When the shape correction unit 17 corrects two of the surfaces SF5 to SF7, it corrects the geometric information of surfaces SF5 and SF7 so that the position coordinates and direction vectors of the central axis of surfaces SF5 and SF7 are consistent with the position coordinates and direction vectors of the central axis of surface SF6, which is adjacent to surfaces SF5 and SF7. As a result, the shape correction unit 17 can suppress the amount of correction.
[0157] Figure 12 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the third example. Figure 12 processing and Figure 2The processing corresponds to step S5. The third example of shape correction processing performed by the shape correction unit 17 is a process of correcting the plane perpendicular to the turning direction. In the third example of shape correction processing, for example, the plane whose normal vector of the plane contained in the product shape is near the vector (0, 0, 1) or near the vector (0, 0, -1) is corrected.
[0158] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinates of the normal vector of the plane contained in the product shape are consistent with a specific direction (second direction) and position coordinates. Here, the first direction and the second direction are the directions of the turning axis. That is, the first direction and the second direction are the directions of either vector (0, 0, 1) or vector (0, 0, -1).
[0159] The difference detection unit 16 acquires all the faces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S31). The difference detection unit 16 extracts the planes from the acquired faces by referring to the geometric information of the acquired faces (step S32).
[0160] The difference detection unit 16 refers to the obtained geometric information of the surface and selects planes whose normal vectors are near vector (0, 0, 1) or vector (0, 0, -1) (step S33). Specifically, the difference detection unit 16 selects planes whose difference between the obtained normal vector and vector (0, 0, 1) or vector (0, 0, -1) falls within a specific range.
[0161] The difference detection unit 16 calculates the difference between the normal vector of the selected plane and either the vector (0, 0, 1) or the vector (0, 0, -1) (step S34). As the amount of difference between the normal vector of the selected plane and either the vector (0, 0, 1) or the vector (0, 0, -1), the difference detection unit 16 calculates the difference in the magnitude of the vectors. As described above, the difference detection unit 16 determines the amount of difference representing how much the normal vector of the selected plane has shifted relative to either the vector (0, 0, 1) or the vector (0, 0, -1).
[0162] The shape correction unit 17 determines whether the product shape needs to be corrected based on the difference between the normal vector of the selected plane and the vector (0, 0, 1) or the vector (0, 0, -1) (step S35). The shape correction unit 17 determines whether correction is needed using the same determination method as in the shape correction process of the first example (the determination method in step S14).
[0163] If the shape correction unit 17 determines that correction is needed (in step S35, it is needed), it corrects the plane that is determined to need correction (step S36). When plane correction is needed, the shape correction unit 17 corrects the plane so that the plane's normal vector coincides with either vector (0, 0, 1) or vector (0, 0, -1). The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the plane corrected in step S36 with adjacent planes (step S37). If it determines that correction is not needed (in step S35, it is not needed), the shape correction unit 17 does not perform correction.
[0164] Figure 13 This diagram illustrates the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the third example. Here, the planes of the recess formed into product shape 83 will be described. For example, the recess formed into product shape 83 includes planar surfaces SF8, SF9, SF11, SF13, and SF15, and a portion of a cylindrical surface (hereinafter referred to as the cylindrical portion surface) namely surfaces SF10, SF12, SF14, and SF16. Surface SF8 is the plane of the bottom surface of the recess, surfaces SF9, SF11, SF13, and SF15 are the planes of the side surfaces of the recess, and surfaces SF10, SF12, SF14, and SF16 are the cylindrical portion surfaces of the corners of the side surfaces of the recess. Figure 13 The text describes the calibration process for the SF8 on the other side.
[0165] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction of the normal vector of the surface SF8 contained in the product shape 83 is consistent with the direction of the turning axis, i.e., vector (0, 0, 1) or vector (0, 0, -1). In this case, the geometric information of surface SF8 has the following information. This geometric information is, for example, information resulting from an offset after being rewritten for some reason during format transformation.
[0166] SF8: Plane Location coordinates (0, 0, 0.02) Normal vector (0.0001, 0.0001, 0.99999999) The difference detection unit 16 calculates the difference between the central axis of the SF8 and the Z-axis direction vector set in the program coordinate system. The Z-axis direction vector is... Figure 12 The vector (0, 0, 1) or vector (0, 0, -1) described in the document.
[0167] When the geometric information of surface SF8 is as described above, the difference between the vector of the comparison object, i.e., the Z-axis direction vector (0, 0, 1), and the normal vector of surface SF8 is 0.000141. When the geometric tolerance of the direction vector is 1.0e-10 and the setting error of the direction vector set by the operator is 1.0e-6, the shape correction unit 17 performs shape correction on surface SF8.
[0168] The shape correction unit 17 corrects the geometric information of the plane surface SF8 in the following manner.
[0169] Normal vector (0, 0, 1)
[0170] That is, the shape correction unit 17 corrects the geometric information of the surface SF8 so that the normal vector of the surface SF8 is consistent with the normal vector (0, 0, 1) of the XY plane. In addition, the shape correction unit 17 recalculates the intersection line and intersection point of the surface SF8 and the surface adjacent to the surface SF8 in a matching manner with the corrected surface SF8.
[0171] Figure 14 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the fourth example. Figure 14 processing and Figure 2 The processing corresponds to step S5. The shape correction process performed by the shape correction unit 17 in the fourth example is a process of correcting the plane where the angle between the normal vector of the surface included in the product shape and the normal vector (0, 0, 1) of the XY plane is about 90 degrees.
[0172] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinates of the normal vector of the surface included in the product shape are consistent with the specific direction (second direction) and position coordinates perpendicular to the direction of the turning axis set in the program coordinate system. Here, the first direction and the second direction are the Y-axis directions. That is, the first direction and the second direction are the directions of either vector (0, 1, 0) or vector (0, -1, 0). In addition, the direction of the turning axis is the Z-axis direction.
[0173] The difference detection unit 16 acquires all the faces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S41). The difference detection unit 16 extracts the planes from the acquired faces by referring to the geometric information of the acquired faces (step S42).
[0174] The difference detection unit 16, referring to the acquired geometric information of the surface, selects planes perpendicular to the normal vector of the extracted plane and the Z-axis direction vector (0, 0, 1) (step S43). Specifically, the difference detection unit 16 selects planes whose difference between the acquired plane's normal vector and a vector perpendicular to (0, 0, 1) falls within a specific range. The plane perpendicular to the vector (0, 0, 1) is the XY plane, and the vector perpendicular to (0, 0, 1) is either the Y-axis direction vector or the X-axis direction vector. Here, the difference detection unit 16 selects... Figure 13 Select from the planes SF9, SF11, SF13, and SF15 shown.
[0175] The difference detection unit 16 calculates the difference between the angle between the normal vector of the selected plane and the vector (0, 0, 1) and 90 degrees (step S44). As described above, the difference detection unit 16 calculates the difference representing how much the angle between the normal vector of the selected plane and the normal vector (0, 0, 1) of the XY plane has deviated from the right angle.
[0176] The shape correction unit 17 determines whether the product shape needs to be corrected based on the difference between the angle formed by the normal vector of the selected plane and the vector (0, 0, 1) and 90 degrees (step S45). The shape correction unit 17 determines whether correction is needed using the same determination method as in the shape correction process of the first example (the determination method in step S14).
[0177] If the shape correction unit 17 determines that correction is needed (in step S45, it is needed), it corrects the plane that is determined to need correction (step S46). When plane correction is needed, the shape correction unit 17 corrects the plane's normal vector so that the angle between the plane's normal vector and the vector (0, 0, 1) is 90 degrees. The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the plane corrected in step S46 with adjacent planes (step S47). If it determines that correction is not needed (in step S45, it is not needed), the shape correction unit 17 does not perform correction.
[0178] Here, using Figure 13 The shape correction process performed by the shape correction unit 17 in the fourth example will be described. Here, the case where the shape correction unit 17 corrects the surface SF9, which is perpendicular to the direction of the turning axis, will be described.
[0179] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction of the normal vector of the surface SF9 included in the product shape 83 is consistent with the direction perpendicular to the axis (here, the Z-axis direction) of a specific axis set in the program coordinate system (here, the Y-axis direction). That is, the program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the normal vector of the surface SF9 is consistent with the direction perpendicular to the turning axis set in the program coordinate system, i.e., vector (0, 1, 0) or vector (0, -1, 0). Furthermore, the direction of the turning axis is the Z-axis direction. In this case, the geometric information of the surface SF9 has the following information. This geometric information is, for example, information resulting from an offset after being rewritten for some reason during format transformation.
[0180] SF9: Plane Location coordinates (0.04, -0.04, 0.02) Normal vector (0.0001, 0.99999999, 0.0001) The difference detection unit 16 calculates the difference between the normal vector of the opposite SF9 and the Y-axis direction vector perpendicular to the Z-axis set in the program coordinate system.
[0181] When the geometric information of surface SF9 is as described above, the difference between the normal vector of surface SF9 and the vector of the comparison object, i.e., the Y-axis direction vector perpendicular to the Z-axis, is 0.000141. When the geometric tolerance of the direction vector is 1.0e-10 and the operator-set error of the direction vector is 1.0e-6, the shape correction unit 17 performs shape correction on surface SF9.
[0182] The shape correction unit 17 corrects the geometric information of the plane surface SF9 in the following manner.
[0183] Normal vector (0, 1, 0)
[0184] That is, the shape correction unit 17 corrects the geometric information of the surface SF9 so that the angle between the normal vector of the surface SF9 and the normal vector (0, 0, 1) of the XY plane is 90 degrees. In addition, the shape correction unit 17 recalculates the intersection line and intersection point of the surface SF9 and the surface adjacent to the surface SF9 to match the corrected surface SF9.
[0185] Furthermore, when the shape correction unit 17 corrects the surface SF13 of the plane, it corrects the geometric information of the surface SF13 in such a way that the angle between the normal vector of the surface SF13 and the normal vector of the XY plane, i.e., the Z-axis direction vector (0, 0, 1), is 90 degrees.
[0186] Normal vector (0, -1, 0)
[0187] In addition, when the shape correction unit 17 corrects the surface SF11 of the plane, it corrects the geometric information in such a way that the angle between the normal vector of the surface SF11 and the normal vector of the XY plane, i.e., the Z-axis direction vector (0, 0, 1), is 90 degrees.
[0188] Normal vector (1, 0, 0)
[0189] In addition, when the shape correction unit 17 corrects the surface SF15 of the plane, it corrects the geometric information in such a way that the angle between the normal vector of the surface SF15 and the normal vector of the XY plane, i.e., the Z-axis direction vector (0, 0, 1), is 90 degrees.
[0190] Normal vector (-1, 0, 0)
[0191] Furthermore, the shape correction unit 17 is not limited to planes like SF9, SF11, SF13, and SF15, whose normal vectors are aligned with a specific axis. It can also correct planes that are tilted relative to a specific axis. In this case, the shape correction unit 17 corrects the tilted plane so that there is no difference between the normal vector (the ideal normal vector corresponding to the design value) of the tilted plane included in the product shape and the geometric information of the actual plane. For example, if the normal vector of the tilted plane included in the product shape is set to (A, B, C), and the normal vector of the actual plane is (A+a, B+b, C+c), the shape correction unit 17 corrects the normal vector of the plane to (A, B, C).
[0192] Figure 15 This is a flowchart illustrating the processing flow of the fifth example of shape correction processing performed by the shape correction unit of the processing program generation apparatus according to the embodiment. Figure 15 processing and Figure 2 The processing corresponds to step S5. The shape correction process performed by the shape correction unit 17 in the fifth example is a process of correcting the cylindrical part surface in the same direction as the turning direction.
[0193] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinates of the central axis of the cylindrical part surface are consistent with the direction (second direction) and position coordinates of the turning axis. Here, the first direction and the second direction are the directions of the turning axis. That is, the first direction and the second direction are the directions of vector (0, 0, 1) or vector (0, 0, -1). That is, in the shape correction process of the fifth example, for example, the cylindrical part surface whose central axis vector is near vector (0, 0, 1) or vector (0, 0, -1) is corrected.
[0194] The difference detection unit 16 acquires all the surfaces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S51). The difference detection unit 16 extracts the cylindrical portion surfaces of the acquired surfaces by referring to the geometric information of the acquired surfaces (step S52).
[0195] The difference detection unit 16, referring to the acquired geometric information of the surface, selects cylindrical surfaces whose central axis vector is near vector (0, 0, 1) or vector (0, 0, -1) (step S53). Specifically, the difference detection unit 16 selects cylindrical surfaces whose difference between the acquired central axis vector and vector (0, 0, 1) or vector (0, 0, -1) falls within a specific range. Here, the difference detection unit 16 selects... Figure 13 Select from the planes SF10, SF12, SF14, and SF16 shown.
[0196] The difference detection unit 16 calculates the difference between the angle between the central axis vector of the selected cylindrical surface and the vector (0, 0, 1) or the vector (0, 0, -1) (step S54). As described above, the difference detection unit 16 calculates the difference amount representing how much the central axis vector of the selected cylindrical surface has shifted from the normal vector of the XY plane, i.e., the vector (0, 0, 1) or the vector (0, 0, -1).
[0197] The shape correction unit 17 determines whether the product shape needs to be corrected based on the difference between the central axis vector of the selected cylindrical part and the vector (0, 0, 1) or the vector (0, 0, -1) (step S55). The shape correction unit 17 determines whether correction is needed using the same determination method as in the shape correction process of the first example (the determination method in step S14).
[0198] If the shape correction unit 17 determines that correction is needed (in step S55, it is needed), it corrects the cylindrical part surface that is determined to need correction (step S56). When correction of the cylindrical part surface is needed, the shape correction unit 17 corrects the central axis vector of the cylindrical part surface so that the central axis vector of the cylindrical part surface is consistent with either vector (0, 0, 1) or vector (0, 0, -1). The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the surface corrected in step S56 with adjacent surfaces (step S57). If it determines that correction is not needed (in step S55, it is not needed), the shape correction unit 17 does not perform correction.
[0199] Here, using Figure 13 The fifth example of shape correction processing performed by the shape correction unit 17 will be described. Here, the case where the shape correction unit 17 corrects the surface SF10, which has a central axis parallel to the direction of the turning axis.
[0200] The program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the direction of the central axis vector of the surface SF10 included in the product shape 83 is consistent with the axial direction (here, the Z-axis direction) of a specific axis set in the program coordinate system. That is, the program coordinate setting unit 15 sets the workpiece origin, the program coordinate system, and the direction of the turning axis so that the central axis vector of the surface SF10 is consistent with the direction of the turning axis set in the program coordinate system, i.e., vector (0, 0, 1) or vector (0, 0, -1). In this case, the geometric information of the surface SF10 has the following information. This geometric information is, for example, information resulting from an offset after being rewritten for some reason during format transformation.
[0201] Surface SF10: Cylindrical section surface The position coordinates of the central axis are (-0.03, -0.03, 0.02). The direction vector of the central axis (0.0001, 0.0001, 0.999999) The difference detection unit 16 calculates the difference between the direction vector of the central axis of the opposite SF10 and the Z-axis direction vector set in the program coordinate system.
[0202] When the geometric information of surface SF10 is as described above, the difference between the direction vector of the central axis of surface SF10 and the axial vector of a specific axis of the comparison object (here, the Z-axis direction vector (0, 0, 1)) is 0.000141. When the geometric tolerance of the direction vector is 1.0e-10 and the setting error of the direction vector set by the operator is 1.0e-6, the shape correction unit 17 performs shape correction on surface SF10.
[0203] The shape correction unit 17 corrects the geometric information of the surface SF10 of the cylindrical part in the following manner.
[0204] The direction vector of the central axis is (0, 0, 1).
[0205] That is, the shape correction unit 17 corrects the geometric information of the surface SF10 so that the central axis vector of the surface SF10 is consistent with the normal vector of the XY plane, i.e., the Z-axis direction vector (0, 0, 1). In addition, the shape correction unit 17 recalculates the intersection line and intersection point of the surface SF10 and the surface adjacent to the surface SF10 in a matching manner with the corrected surface SF10.
[0206] Figure 16 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the sixth example. Figure 16 processing and Figure 2 The processing corresponds to step S5. The shape correction process in the sixth example, performed by the shape correction unit 17, is a process for correcting the R-shaped chamfer surface.
[0207] The shape configuration unit 14 configures the product shape so that a series of R-shaped chamfered surfaces included in the product shape have the same radius value (R value) as a specific value (reference radius value). The difference detection unit 16 acquires all the surfaces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S61). The difference detection unit 16 extracts the R-shaped chamfered surfaces from the acquired surfaces by referring to the geometric information of the acquired surfaces (step S62). The R-shaped chamfered surfaces are surfaces composed of cylindrical surfaces, toroidal surfaces, or freeform surfaces, and the corners of the shape are rounded by the curved surfaces.
[0208] The difference detection unit 16 selects R-bevel surfaces whose radius values are near the reference radius value from the extracted R-bevel surfaces, referring to the obtained geometric information of the surface (step S63). Specifically, the difference detection unit 16 selects R-bevel surfaces whose radius difference (radius difference) between the obtained R-bevel surface and the reference radius value falls within a specific range.
[0209] The difference detection unit 16 calculates the difference between the radius value of the selected R-shaped chamfer surface and the reference radius value (step S64). As described above, the difference detection unit 16 calculates the amount of difference indicating how much the radius value of the selected R-shaped chamfer surface has deviated from the reference radius value.
[0210] The shape correction unit 17 determines whether the product shape needs to be corrected based on the difference between the radius value of the selected R-bevel surface and the reference radius value (step S65). The shape correction unit 17 determines whether correction is needed using the same determination method as in the shape correction process of the first example (the determination method in step S14).
[0211] If the shape correction unit 17 determines that correction is needed (in step S65, it is needed), it corrects the R-shaped chamfer surface that is determined to need correction (step S66). When correction of the R-shaped chamfer surface is needed, the shape correction unit 17 corrects the R-shaped chamfer surface so that the radius value of the R-shaped chamfer surface matches the reference radius value. The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the R-shaped chamfer surface that was corrected in step S66 with adjacent surfaces (step S67). If it determines that correction is not needed (in step S65, it is not needed), the shape correction unit 17 does not perform correction.
[0212] Figure 17 This diagram illustrates the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the sixth example. Here, the R-shaped chamfered surfaces of the recesses formed as product shape 84 will be described. For example, the recesses formed as product shape 84 include surfaces SF17, SF18, SF19, and SF20 with R-shaped chamfered surfaces. The shape configuration unit 14 configures product shape 84 such that the radius values of the series of R-shaped chamfered surfaces, namely surfaces SF17 to SF20, included in product shape 84 are consistent with the reference radius values. In this case, the geometric information of surfaces SF17 to SF20 has the following information. This geometric information, for example, is information resulting from an offset caused by being rewritten for some reason during format conversion.
[0213] Surface SF17: R-shaped chamfered surface radius value = 2 SF18: R-shaped chamfered surface Radius value = 2.00016 SF19: R-shaped chamfered surface radius value = 2 SF20: R-shaped chamfered surface radius value = 2 The difference detection unit 16 calculates the difference between the radius values of surfaces SF17 to SF20 and the reference radius value. Given the geometric information of surfaces SF17 to SF20 as described above, and with the reference radius value being 2, the difference between the radius value of surface SF18 and the reference radius value is 0.00016. If the allowable error for the radius value is 1.0e-3, and the operator-set error for the radius value is 1.0e-6, the shape correction unit 17 performs shape correction on surface SF18.
[0214] The shape correction unit 17 corrects the geometric information of the surface SF18 of the R-beveled surface in the following manner.
[0215] radius value = 2
[0216] That is, the shape correction unit 17 corrects the geometric information of the surface SF18 so that the radius value of the surface SF18 is consistent with the reference radius value. In addition, the shape correction unit 17 recalculates the intersection line and intersection point of the surface SF18 and the surface adjacent to the surface SF18 in a matching manner with the corrected surface SF18.
[0217] Figure 18 This is a flowchart illustrating the processing flow of the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the seventh example. Figure 18 processing and Figure 2 The processing corresponds to step S5. The shape correction process in the 7th example, performed by the shape correction unit 17, is a process for correcting the C-shaped chamfer surface.
[0218] The shape configuration unit 14 configures the product shape such that a series of C-bevel surfaces included in the product shape have the same C-bevel surface width as a specific value (reference width). The difference detection unit 16 acquires all the surfaces of the product shape configured by the shape configuration unit 14 and stored by the product shape storage unit 12 (step S71). The difference detection unit 16 extracts the C-bevel surfaces from the acquired surfaces by referring to the geometric information of the acquired surfaces (step S72). The C-bevel surface is a surface composed of a plane, a conical surface, or a freeform surface, and the corners of the shape are obliquely cut off by the plane.
[0219] The difference detection unit 16 selects C-bevel surfaces whose C-bevel width is near the reference width from the extracted C-bevel surfaces, referring to the obtained geometric information of the surface (step S73). Specifically, the difference detection unit 16 selects C-bevel surfaces whose C-bevel width and reference width difference (width difference) fall within a specific range. The C-bevel width is usually not the width of the C-bevel surface, but rather represents the length from which the corner has been rounded, but it can also be set as the width of the C-bevel surface.
[0220] The difference detection unit 16 calculates the difference between the C-bevel width of the selected C-bevel surface and the reference width (step S74). As described above, the difference detection unit 16 calculates the difference amount representing how much the C-bevel width of the selected C-bevel surface has deviated from the reference width.
[0221] The shape correction unit 17 determines whether the product shape needs to be corrected based on the difference between the C-bevel width of the selected C-bevel surface and the reference width (step S75). The shape correction unit 17 determines whether correction is needed using the same determination method as in the shape correction process of the first example (the determination method in step S14).
[0222] If the shape correction unit 17 determines that correction is needed (in step S75, it is needed), it corrects the C-bevel surface that is determined to need correction (step S76). When correction of the C-bevel surface is needed, the shape correction unit 17 corrects the C-bevel surface so that the C-bevel width of the C-bevel surface is consistent with the reference width. The shape correction unit 17 recalculates and corrects the intersection lines and intersection points of the C-bevel surface that was corrected in step S76 with adjacent surfaces (step S77). If it determines that correction is not needed (in step S75, it is not needed), the shape correction unit 17 does not perform correction.
[0223] Figure 19 This diagram illustrates the shape correction process performed by the shape correction unit of the processing program generation apparatus according to the embodiment in the seventh example. Here, the C-bevel surfaces of the recess formed as product shape 85 will be described. For example, the recess formed as product shape 85 includes surfaces SF21, SF22, SF23, and SF24 with C-bevel surfaces. The shape configuration unit 14 configures product shape 85 such that the C-bevel widths of the series of surfaces SF21 to SF24 included in product shape 85 are consistent with the reference width. In this case, the geometric information of surfaces SF21 to SF24 has the following information. This geometric information is, for example, information resulting from an offset caused by being rewritten for some reason during format conversion.
[0224] Surface SF21: C-shaped chamfered surface C bevel width = 2 SF22: C-shaped chamfered surface C bevel width = 2.00016 SF23: C-shaped chamfered surface C bevel width = 2 SF24: C-shaped chamfered surface C bevel width = 2 The difference detection unit 16 calculates the difference between the C-bevel width and the reference width of surfaces SF21 to SF24. Given the geometric information of surfaces SF21 to SF24 as described above, and with the reference width being 2, the difference between the C-bevel width of surface SF22 and the reference width is 0.00016. With an allowable error of 1.0e-3 for the C-bevel width and an operator-set error of 1.0e-6 for the C-bevel width, the shape correction unit 17 performs shape correction on surface SF22.
[0225] The shape correction unit 17 corrects the geometric information of the face SF22 of the C-bevel surface in the following manner.
[0226] C bevel width = 2
[0227] That is, the shape correction unit 17 corrects the geometric information of the surface SF22 so that the C-bevel width of the surface SF22 is consistent with the reference width. In addition, the shape correction unit 17 recalculates the intersection line and intersection point of the surface SF22 and the surface adjacent to the surface SF22 in a matching manner with the corrected surface SF22.
[0228] Figure 20 This is a flowchart illustrating the processing flow of the shape correction process performed by the CNC device involved in the embodiment in the eighth example. Figure 20 processing and Figure 2 The processing corresponds to step S5. The shape correction process in the 8th example executed by the CNC device 100 is a process of reasoning about the first parameter, i.e., the correction method, and correcting the product shape according to the reasoned correction method.
[0229] In the process of inferring the first parameter, the machine learning device 20 uses the second parameter extracted by the processing procedure generation device 10 as input and a learning model Mx generated based on the shape correction case Fc to infer the first parameter. That is, the machine learning device 20 infers the first parameter by inputting the second parameter into the learning model Mx.
[0230] Specifically, the shape correction unit 17 extracts the second parameter of the product shape (product shape, workpiece origin and program coordinate system) based on the product shape data configured by the shape configuration unit 14 and stored by the product shape storage unit 12 and the workpiece origin and program coordinate system stored by the program coordinate setting unit 15, and inputs the second parameter of the product shape into the machine learning device 20 (step S81).
[0231] Here, the shape correction unit 17 specifies, as the first parameter for inference candidates, a "product shape turning surface correction method," a "product shape stepped hole correction method," a "product shape bottom plane correction method," a "product shape wall surface correction method," a "product shape R-chamfer surface correction method," and a "product shape C-chamfer surface correction method." In this case, the shape correction unit 17 obtains the product shape's material, dimensions, etc., from the product shape storage unit 12 as the second parameter for inference based on the first parameter. The dimensions of the product shape include its longitudinal length, transverse length, and depth. The shape correction unit 17 inputs the type of the first parameter specified as an inference candidate and the obtained second parameter to the inference unit 24 of the machine learning device 20.
[0232] Furthermore, the first parameter of the reasoning candidate can be preset in the shape correction unit 17, or it can be set by the operator in the shape correction unit 17 via the instruction input unit 40.
[0233] The inference unit 24 of the machine learning device 20 infers the first parameter using the second parameter (step S82). Specifically, the shape correction unit 17 inputs the generated second parameter to the inference unit 24 of the machine learning device 20, and the inference unit 24 infers the first parameter based on the second parameter. The inference unit 24 uses a learning model Mx for inferring the first parameter based on the second parameter, and infers the first parameter based on the second parameter obtained from the shape correction unit 17. Thus, the inference unit 24 obtains multiple values of the first parameter as a result of the inference. The inference unit 24 sends the multiple values of the first parameter to the shape correction unit 17.
[0234] The shape correction unit 17 corrects the product shape according to the obtained first parameter (step S83). Specifically, the shape correction unit 17 corrects the product shape data configured by the shape configuration unit 14 and stored by the product shape storage unit 12 using the correction method of the first parameter, so that there is no difference between it and the comparison object.
[0235] Figure 21 This is a flowchart illustrating the processing flow of the learning model generation process performed by the machine learning device according to the embodiment. In the learning model generation process, a learning model Mx for generating shape correction data is generated based on the correction method, product shape, workpiece origin, and program coordinate system included in the shape correction example Fc. Here, we will describe the case where the shape correction example Fc is the product shape data before correction stored in the product shape storage unit 12, the workpiece origin and program coordinate system stored in the program coordinate setting unit 15, and the correction method stored in the shape correction unit 17.
[0236] The machine learning device 20 reads the product shape data before correction stored in the product shape storage unit 12 of the machining program generation device 10 (step S91). The machine learning device 20 reads the workpiece origin and program coordinate system stored in the program coordinate setting unit 15 of the machining program generation device 10 (step S92). The machine learning device 20 can also execute the processing of step S91 and step S92 in any order.
[0237] The shape correction unit 17 extracts a first parameter from multiple configured product shape data, workpiece origin, and program coordinate system (step S93). The shape correction unit 17 then extracts a second parameter for each of the extracted first parameters (step S94). That is, the shape correction unit 17 determines the second parameter to be extracted for each first parameter and extracts the determined second parameter. Based on shape recognition information, the shape correction unit 17 extracts the second parameter corresponding to the first parameter. The shape correction unit 17 inputs the extracted first and second parameters to the machine learning unit 22.
[0238] The machine learning unit 22 performs machine learning processing using the input first and second parameters (step S95). Specifically, the machine learning unit 22 generates a dataset based on the first and second parameters, and performs machine learning according to the generated dataset. The dataset is a group of data that associates the first parameter (of the object being adjusted) with the second parameter (a parameter outside the object being adjusted, used to determine the value of the first parameter). The machine learning unit 22 uses a predefined benchmark to generate an optimized model as a learning model Mx. As described above, the machine learning unit 22 generates a learning result, i.e., the learning model Mx.
[0239] The learning model storage unit 23 stores the generated learning model Mx (step S96). Thus, the machine learning device 20 ends the learning model generation process.
[0240] Furthermore, in the embodiment, the processing of the processed shape being concave is described, but the processed shape may also be convex.
[0241] As described above, the machining program generation device 10 can correct only the parts with differences within the range desired by the operator by correcting only the parts whose shape differences are greater than or equal to the geometrical tolerance and less than the set error. The range desired by the operator is the range where the difference with the comparison object is greater than or equal to the geometrical tolerance and less than the set error.
[0242] When creating product shape data, the accuracy of the data can sometimes deteriorate due to various processing methods such as format transformation. For example, through various processing of the product shape data, there can sometimes be inconsistencies in the positional coordinates and axial vectors between the product shape and the turning axis. That is, due to various processing methods such as format transformation of the product shape data, the geometric information of each shape element contained in the product shape data will have errors. Sometimes, there will be unexpected differences between the axes set in the geometric information of each shape element in the product shape data and the axes set in the program coordinate system of the machining program. In this case, if an attempt is made to generate a machining program corresponding to the product shape data, there may sometimes be parts for which no machining program is generated or the accuracy of the machining program may be deteriorated, making it impossible for the machine tool to produce a product that conforms to the design shape.
[0243] The CNC device 100 of this embodiment corrects the product shape data when there is a shape difference with the comparison object, thus preventing the deterioration of the machining program accuracy. As a result, the CNC device 100 can improve the success rate of machining program generation and the accuracy of the machining program.
[0244] Furthermore, by having the operator set a set error amount, the CNC device 100 corrects product shape data whose shape difference from the comparison object falls within a specific range, thereby eliminating product shape data outside the specific range from the correction object. Thus, the CNC device 100 can correct product shape data whose shape difference from the comparison object falls within the range desired by the operator.
[0245] Furthermore, when the central axis of the cylindrical, conical, and toroidal surfaces of the product shape data is inconsistent with the turning axis, and there are parts of the product shape that cannot be unfolded in the machining program as a turning unit, the CNC device 100 corrects the central axis of the product shape data to eliminate the difference between the central axis and the turning axis. Thus, the CNC device 100 can generate a turning unit that can be unfolded in the machining program.
[0246] Furthermore, if the central axis of the cylindrical, conical, or toroidal surface of the product shape data is inconsistent with the central axis of adjacent cylindrical, conical, or toroidal surfaces, and a stepped hole machining unit exists in a part of the product shape that will not be included in the machining program, the CNC device 100 corrects the central axis of the product shape data to eliminate the difference between the central axes. Therefore, the CNC device 100 can generate a stepped hole machining unit that can be included in the machining program. In other words, even when the central axes of the holes are inconsistent due to the difference between them, and each hole machining unit is executed independently, the CNC device 100 can still generate a stepped hole machining unit that can be included in the machining program by correcting the central axis.
[0247] Furthermore, when the plane representing the product shape data is not parallel to the XY plane, and there exists a part of the product shape that will not be unfolded in the machining program as a surface machining unit, the CNC device 100 corrects the normal vector of the product shape data to eliminate the difference between the normal vector of the product shape data and the Z-axis direction vector. That is, when the plane determined to be the product shape data is inclined relative to the XY plane and is not determined to be the bottom surface of a surface machining unit, the normal vector of the product shape data is corrected. Therefore, the CNC device 100 can generate surface machining units that can be unfolded in the machining program. In other words, the CNC device 100 can unfold unevolved parts into surface machining units even when there is no bottom surface determined to be a surface machining unit.
[0248] Furthermore, when the angle between the normal vector of the plane representing the product shape data and the vector (0, 0, 1) is not 90 degrees, and there are parts of the product shape that will not be expanded in the machining program as surface machining units, the CNC device 100 corrects the normal vector of the product shape data to eliminate the difference in angle between the normal vector of the product shape data and the Z-axis direction vector. That is, when the normal vector of the plane representing the product shape data is not parallel to the XY plane and is tilted, and there is no wall surface identified as a surface machining unit, the normal vector of the product shape data is corrected. Therefore, the CNC device 100 can generate surface machining units that can be expanded in the machining program. In other words, the CNC device 100 can expand unexpanded parts into surface machining units even when there are no side walls identified as surface machining units.
[0249] Furthermore, when the central axis of the cylindrical portion of the product shape data is not perpendicular to the XY plane, and there are parts of the product shape that will not be unfolded in the machining program, the CNC device 100 corrects the central axis of the product shape data to eliminate the difference between the central axis of the product shape data and the Z-axis direction vector. That is, when there are wall surfaces in a cylindrical surface perpendicular to the XY plane where the central axis of the cylindrical surface is not perpendicular to the XY plane due to the inclination of the cylindrical surface, and which are not determined to be surface machining units, the central axis of the product shape data is corrected. Therefore, the CNC device 100 can generate surface machining units that can be unfolded in the machining program. In other words, the CNC device 100 can unfold un-unfolded portions into surface machining units even when there are cylindrical portion surfaces that are not determined to be surface machining units.
[0250] Furthermore, when the radius value of the R-shaped chamfer surface in the product shape data is inconsistent with the reference radius value, and the R-shaped chamfer surface exists as multiple chamfering processing units in the part of the product shape that will be unfolded in the processing program, the CNC device 100 corrects the radius value of the R-shaped chamfer surface in the product shape data to eliminate the difference between the radius value of the product shape data and the reference radius value. That is, even if the radius value of a portion of a series of R-shaped chamfer surfaces is inconsistent with the reference radius value, the CNC device 100 will correct the radius value of the inconsistent R-shaped chamfer surfaces to the reference radius value. Therefore, the CNC device 100 can generate a series of R-shaped chamfer surface processing units that can be unfolded in the processing program for a series of R-shaped chamfer surfaces. In other words, the CNC device 100 can unfold an un-expanded part into a series of R-shaped chamfer surface processing units even when it is not determined to be a series of R-shaped chamfer surfaces.
[0251] Furthermore, when the C-bevel width of the C-bevel surface in the product shape data is inconsistent with the reference width, and the C-bevel surface exists as multiple chamfering processing units in the part of the product shape that will be unfolded in the processing program, the CNC device 100 corrects the C-bevel width of the C-bevel surface in the product shape data to eliminate the difference between the C-bevel width of the product shape data and the reference width. That is, even if the radius of a part of a series of C-bevel surfaces is inconsistent with the reference width, the CNC device 100 will correct the radius width of the C-bevel surface that is inconsistent with the reference width to the reference width. As a result, the CNC device 100 can generate C-bevel surface processing units that can be unfolded in the processing program as a series of C-bevel surface processing units. In other words, the CNC device 100 can unfold an un-unfolded part into a series of C-bevel surface processing units even if it is not determined to be a series of C-bevel surfaces.
[0252] In addition, the CNC device 100 can improve the accuracy of the inferred shape correction method by performing machine learning on the shape correction data.
[0253] Next, the hardware structure of the CNC device 100 will be explained. Figure 22 This is a block diagram illustrating the hardware structure of the numerical control device involved in the implementation method.
[0254] Figure 22 The numerical control device 100 shown includes, as a functional unit, a processor 71; a memory 72, which is used as a working area by the processor 71; a storage device 73, which stores computer programs (control programs, machining programs) describing the functions of the numerical control device 100; an input device 74, which is an input interface with the operator; a display device 75, which is an output device for displaying information to the operator; and a communication device 76, which has communication functions with the controlled equipment (machine tool, etc.) or other numerical control devices, etc.
[0255] The processor 71, memory 72, storage device 73, input device 74, display device 75, and communication device 76 are connected to each other via a data bus 77.
[0256] The processor 71 is a processing device, a computing device, a microprocessor, a microcomputer, a CPU (Central Processing Unit), or a DSP (Digital Signal Processor), etc.
[0257] The memory 72 is a non-volatile or volatile semiconductor memory such as RAM (Random Access Memory), ROM (Read Only Memory), flash memory, EPROM (Erasable Programmable ROM), or EEPROM (Electrically EPROM), disk, floppy disk, optical disk, high-density disk, mini disk, or DVD (Digital Versatile Disc).
[0258] The shape input unit 11, shape configuration unit 14, program coordinate setting unit 15, difference detection unit 16, shape correction unit 17 and machining program generation unit 18 of the CNC device 100 can be realized by the processor 71 reading and executing the computer program stored in the memory 72.
[0259] Similarly, the shape correction method analysis unit 21, machine learning unit 22, and inference unit 24 of the machine learning device 20 can be implemented by the processor 71 reading and executing the computer program stored in the memory 72.
[0260] The functions of the product shape storage unit 12, the blank shape storage unit 13, and the shape configuration unit 14 are implemented by the storage device 73. Similarly, the function of the learning model storage unit 23 is implemented by the storage device 73. In addition, the functions of the program coordinate setting unit 15 in storing the coordinate values of the workpiece origin and the direction vectors of each axis of the program coordinate system, and the functions of the shape correction unit 17 in storing shape correction data, are implemented by the storage device 73.
[0261] Furthermore, in the CNC device 100, multiple processors 71 and multiple memories 72 can cooperate to implement the various functions of the CNC device 100. Alternatively, some of the functions of the shape input unit 11, shape configuration unit 14, program coordinate setting unit 15, difference detection unit 16, shape correction unit 17, machining program generation unit 18, shape correction method analysis unit 21, machine learning unit 22, and inference unit 24 can be installed as electronic circuits, and the other parts can be implemented using processors 71 and memories 72.
[0262] The processor 71 and memory 72 used to implement the machining program generation device 10 can be the same as or different from the processor 71 and memory 72 used to implement the machine learning device 20. That is, the processor 71 and memory 72 used to implement the functions of the shape input unit 11, shape configuration unit 14, program coordinate setting unit 15, difference detection unit 16, shape correction unit 17, and machining program generation unit 18 can be the same as or different from the processor 71 and memory 72 used to implement the shape correction method analysis unit 21, machine learning unit 22, and inference unit 24. Furthermore, the hardware structure of the machining program generation device 10 or the machine learning device 20 can be configured as follows: Figure 22 The hardware structure.
[0263] As described above, the CNC device 100 of the embodiment corrects the product shape data when the difference between the position coordinates and direction of the configured product shape and the coordinates and direction of the program coordinate system does not fall within a specific range, so that the difference falls within the specific range, thereby preventing the deterioration of the machining program's accuracy. Therefore, the CNC device 100 enables the machine tool to produce a product with the shape desired by the operator.
[0264] The structure shown in the above embodiments is an example and can be combined with other known technologies. Without departing from the main idea, parts of the structure can be omitted or modified.
[0265] Explanation of the label
[0266] 10 Machining program generation device, 11 Shape input unit, 12 Product shape storage unit, 13 Blank shape storage unit, 14 Shape configuration unit, 15 Program coordinate setting unit, 16 Difference detection unit, 17 Shape correction unit, 18 Machining program generation unit, 20 Machine learning device, 21 Shape correction method analysis unit, 22 Machine learning unit, 23 Learning model storage unit, 24 Inference unit, 30 Dialogue operation processing unit, 40 Indicator input unit, 50 Display unit, 60 Control unit, 71 Processor, 72 Memory, 73 Storage device, 74 Input device, 75 Display device, 76 Communication device, 77 Data bus, 81-85 Product shape, 100 CNC device, 101 Product shape data, 102 Blank shape data, 103 Configuration data, 201 Machining shape data, AX1-AX3 Program coordinate system, Fc Shape correction example, Fd Shape data, Mx Learning model, PM machining program, SA1 product shape, SB2, Sx1 blank shape, SC3 configuration shape, SF4~SF24 face, SH1 turning hole machining shape, SH2, SH3, SH5~SH7 turning machining shape, SH4, SH16 hole machining shape, SH8~SH15 face machining shape.
Claims
1. A control device, characterized in that, have: The coordinate setting unit sets a program coordinate system such that a first direction set in the product shape data representing the product shape is consistent with a second direction set in the program coordinate system. The difference detection unit detects the difference between the coordinates of the configured product shape and the first direction and the coordinates of the program coordinate system and the second direction. as well as The shape correction unit corrects the product shape data so that the difference falls within the specified range when the difference does not fall within a specific range greater than or equal to the geometrically permissible error amount, i.e., the geometrically permissible error amount.
2. The control device according to claim 1, characterized in that, The specific range is less than the error amount set by the operator, i.e., the set error amount.
3. The control device according to claim 1 or 2, characterized in that, The first direction is the direction of the central axis of the cylindrical, conical, or toroidal surface contained in the product shape. The second direction is the direction of the turning axis set in the program coordinate system. The shape correction unit corrects the central axis when the difference does not fall within the specific range, so that the difference falls within the specific range.
4. The control device according to claim 1 or 2, characterized in that, It also includes a shape configuration unit that configures the product shape in a specific coordinate system. The first direction refers to the direction of the central axis of each of the stepped holes, i.e., the stepped holes, included in the product shape. The shape configuration unit configures the product shape so that the central axes are aligned. The difference detection unit detects the difference between the central axes of adjacent hole surfaces within the stepped hole, i.e., the axial difference. The shape correction unit corrects each center axis when the axis difference value does not fall within the specific range, so that the axis difference value falls within the specific range.
5. The control device according to claim 1 or 2, characterized in that, The first direction is the direction of the normal vector of the plane contained in the shape of the product. The shape correction unit corrects the normal vector if the difference does not fall within the specific range, so that the difference falls within the specific range.
6. The control device according to claim 1 or 2, characterized in that, The first direction is the direction of the central axis vector of a portion of the cylindrical surface included in the product shape, i.e., the cylindrical portion surface. The second direction is the direction of the turning axis set in the program coordinate system. The shape correction unit corrects the central axis vector so that the difference falls within the specific range if the difference does not fall within the specific range.
7. The control device according to claim 1 or 2, characterized in that, It also includes a shape configuration unit that configures the product shape in a specific coordinate system. The shape configuration unit configures the product shape such that the radius value of the R-shaped chamfer surface included in the product shape is consistent with the reference radius value. The difference detection unit detects the radius difference between the radius value of the R-shaped chamfered surface and the reference radius value. The shape correction unit corrects the radius value of the R-shaped chamfered surface when the radius difference does not fall within the specific range, so that the radius difference falls within the specific range.
8. The control device according to claim 1 or 2, characterized in that, It also includes a shape configuration unit that configures the product shape in a specific coordinate system. The shape configuration unit configures the product shape such that the C-bevel width of the C-bevel face included in the product shape is consistent with the reference C-bevel width, i.e., the reference width. The difference detection unit detects the difference between the width of the C-bevel surface and the reference width, i.e., the width difference. The shape correction unit corrects the C-bevel width of the C-bevel surface when the width difference does not fall within the specific range, so that the width difference falls within the specific range.
9. The control device according to any one of claims 1 to 8, characterized in that, It also has: The shape correction method analysis unit extracts a first parameter corresponding to the shape correction method and used as the adjustment object from the corrected product shape data, and extracts a second parameter other than the adjustment object from the product shape data before correction for adjusting the first parameter. The machine learning department generates a learning model for inferring about the first parameter based on the second parameter by learning from a dataset including the first parameter and the second parameter; and The inference unit uses the learning model to infer the first parameter based on the second parameter. The shape correction unit uses the first parameter inferred by the inference unit to correct the product shape data.
10. The control device according to any one of claims 1 to 9, characterized in that, The difference is due to the format transformation that occurred when the product shape data was created.
11. A control method, characterized in that, Include: In the coordinate setting step, the control device sets the program coordinate system so that the first direction set in the product shape data representing the product shape is consistent with the second direction set in the program coordinate system. In the difference detection step, the control device detects the difference between the coordinates of the configured product shape and the first direction and the coordinates of the program coordinate system and the second direction. as well as In the shape correction step, the control device corrects the product shape data so that the difference falls within the specified range if the difference does not fall within a specific range greater than or equal to the geometrically permissible error amount.