Control device and control method
Patent Information
- Application Number
- JP2024532966
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2044-01-24
AI Technical Summary
Existing control devices for machine tools fail to accurately align the geometric information of product shape data with the program coordinate system of the NC program, leading to errors in producing the designed product shape.
A control device that includes a coordinate setting unit to match the axes of product shape data with the program coordinate system and a shape correction unit to adjust product shape data within a specific error range, ensuring accurate alignment and correction.
The control device enables machine tools to produce products with the intended shape by accurately aligning and correcting geometric differences between product shape data and the program coordinate system, improving the accuracy of the machining process.
Smart Images

Figure 00000033_0000 
Figure 00000033_0001 
Figure 00000033_0002
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a control device and a control method for controlling a machine tool. [Background technology]
[0002] Machine tools that cut products by turning materials are controlled by a control device such as a numerical control device. It is desired that this control device controls the machine tool so as to manufacture products with the shape intended by the operator, i.e., the shape as designed. Here, in machine tools equipped with a numerical control device, a workpiece is machined into the desired product shape by executing an NC (Numeral Control) program. When an NC creation program for creating this NC program is generated, product shape data representing the product shape, such as CAD (Computer-Aided Design) data, is imported and defined in the NC creation program. However, there is a problem in that an error occurs between the designed product shape and the product shape defined in the NC creation program due to various factors.
[0003] To address this problem, the self-interference solid correction device described in Patent Document 1 separates all faces of a three-dimensional solid corresponding to the product shape data into thin plates, checks the self-interference of all the thin plates, and uses the results of this check to reconstruct the three-dimensional solid, thereby correcting the self-interfering solid. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Application Publication No. 4-213168 Summary of the Invention [Problem to be solved by the invention]
[0005] However, when the technology of Patent Document 1 is applied to the creation of an NC creation program, although it is possible to correct the self-interfering product shape data itself, various processes such as format conversion of the product shape data can cause errors in the geometric information of each shape element contained in the product shape data, and a difference that the operator cannot anticipate can occur between the axes set in the geometric information of each shape element of the product shape data and the axes set in the program coordinate system of the NC program. This difference cannot be corrected, and there is a problem that it is not possible to cause the machine tool to manufacture a product with the designed shape.
[0006] The present disclosure has been made in consideration of the above, and aims to obtain a control device that can cause a machine tool to manufacture a product having a designed shape, even if a difference occurs between the axes set in the geometric information of each shape element contained in the product shape data and the axes set in the program coordinate system of the NC program. [Means for solving the problem]
[0007] In order to solve the above-mentioned problems and achieve the object, the control device of the present disclosure is a control device that takes in product shape data representing a product shape, generates a machining program, and controls a machine tool using the generated machining program, and includes a coordinate setting unit that sets a program coordinate system so that a first direction set in the product shape data and a second direction set in the program coordinate system coincide with each other. Due to the format conversion of product shape data when the program coordinate system is set, The difference between the coordinates and the first direction of the placed product shape and the coordinates and the second direction of the program coordinate system When this occurs, the difference and a shape correction unit that corrects the product shape data so that the difference falls within a specific range if the difference is not within a specific range equal to or greater than a geometric allowable error, which is a geometrically allowable error amount. Effect of the Invention
[0008] The control device according to the present disclosure has the effect of being able to cause a machine tool to manufacture a product having a designed shape, even if there is a difference between the axes set in the geometric information of each shape element included in the product shape data and the axes set in the program coordinate system of the NC program. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 is a diagram showing a configuration of a numerical control device according to an embodiment; [Diagram 2] 1 is a flowchart showing a processing procedure of a machining program generation process executed by a machining program generation device according to an embodiment; [Diagram 3] FIG. 2 is a diagram showing an example of a product shape corresponding to product shape data stored in a product shape storage unit of the machining program generating device according to the embodiment; [Figure 4] FIG. 2 is a diagram showing an example of a material shape corresponding to material shape data stored in a material shape storage unit of the machining program generating device according to the embodiment; [Diagram 5] FIG. 1 is a diagram showing an example of a product shape and a material shape arranged by a shape arrangement unit of the machining program generating device according to the embodiment; [Figure 6] FIG. 2 is a schematic diagram showing an example of machining shape data generated by a machining program generating unit of the machining program generating device according to the embodiment; [Figure 7] FIG. 1 is a diagram showing an example of a machining program generated by a machining program generating unit of the machining program generating device according to the embodiment; [Figure 8] 1 is a flowchart showing a processing procedure of a first example of shape correction processing executed by a shape correction unit of the machining program generating device according to the embodiment; [Figure 9] FIG. 1 is a diagram for explaining a first example of a shape correction process executed by a shape correction unit of the machining program generation device according to the embodiment; [Figure 10] 11 is a flowchart showing a procedure of a second example of a shape correction process executed by a shape correction unit of the machining program generating device according to the embodiment; [Figure 11]FIG. 13 is a diagram for explaining a second example of shape correction processing executed by the shape correction unit of the machining program generation device according to the embodiment; [Figure 12] 11 is a flowchart showing a processing procedure of a third example of shape correction processing executed by a shape correction unit of the machining program generating device according to the embodiment; [Figure 13] FIG. 11 is a diagram for explaining a third example of shape correction processing executed by the shape correction unit of the machining program generating device according to the embodiment; [Figure 14] 11 is a flowchart showing a processing procedure of a fourth example of shape correction processing executed by a shape correction unit of the machining program generating device according to the embodiment. [Figure 15] 11 is a flowchart showing a processing procedure of a fifth example of shape correction processing executed by a shape correction unit of the machining program generating device according to the embodiment. [Figure 16] 13 is a flowchart showing a processing procedure of a sixth example of shape correction processing executed by a shape correction unit of the machining program generating device according to the embodiment. [Figure 17] FIG. 13 is a diagram for explaining a sixth example of shape correction processing executed by the shape correction unit of the machining program generating device according to the embodiment; [Figure 18] 13 is a flowchart showing a processing procedure of a seventh example of shape correction processing executed by a shape correction unit of the machining program generating device according to the embodiment. [Figure 19] FIG. 13 is a diagram for explaining a seventh example of a shape correction process executed by the shape correction unit of the machining program generating device according to the embodiment; [Figure 20] 13 is a flowchart showing a procedure of an eighth example of shape correction processing executed by the numerical control device according to the embodiment; [Figure 21] 1 is a flowchart showing a processing procedure of a learning model generation process executed by a machine learning device according to an embodiment. [Figure 22] FIG. 1 is a block diagram showing a hardware configuration of a numerical control device according to an embodiment; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, a control device and a control method according to an embodiment of the present disclosure will be described in detail with reference to the drawings.
[0011] Embodiment Fig. 1 is a diagram showing the configuration of a numerical control device according to an embodiment. The numerical control device 100, which is a control device, is a computer that automatically creates a machining program PM (not shown), which is an NC program for numerically controlling a machine tool (not shown), and controls the machine tool using the machining program PM. The numerical control device 100 generates the machining program PM based on product shape data that indicates the shape of a product. The machine tool performs cutting, in which a workpiece, which is a material, is fixed and a tool is rotated, or turning, in which a tool is fixed and the workpiece tool is rotated.
[0012] When a difference occurs between an axis (first axis) of a specific portion of the product shape and an axis (second axis) set in the program coordinate system due to format conversion of product shape data, etc., the numerical control device 100 generates the machining program PM by correcting this difference. That is, the numerical control device 100 generates the machining program PM after correcting the product shape so as to be advantageous for generating the machining program PM.
[0013] The numerical control device 100 may be mounted on a machine tool, or may be an external device connected to the machine tool. The numerical control device 100 numerically controls the operation of the machine tool according to a created machining program PM. The machining program PM is used to cut a workpiece, which is a machined object, from its raw material state to cut out a product shape of a machined product.
[0014] The product shape is the finished shape of a machined product. The material shape is the shape of an object before machining. Examples of material shapes include a cylindrical shape or a rectangular parallelepiped shape that contains the product shape. Note that the material shape does not necessarily have to contain the product shape, and may be a shape in which any face of the product shape is thickened, or a shape in which holes in the product shape are removed. Examples of machine tools include machining centers, lathes, and combined lathes. Below, a case in which the machine tool is a combined lathe will be described.
[0015] The numerical control device 100 includes a machining program generating device 10, a machine learning device 20, an interactive operation processing unit 30, an instruction input unit 40, a display unit 50, and a control unit 60. In the example shown in FIG. 1, the machining program generating device 10 and the machine learning device 20 are mounted on the numerical control device 100, but the embodiment is not limited to this example. For example, at least one of the machining program generating device 10 and the machine learning device 20 may be a device different from the numerical control device 100. That is, at least one of the machining program generating device 10 and the machine learning device 20 may be provided independently outside the numerical control device 100. In addition, the machining program generating device 10 and the machine learning device 20 may be configured as different separate devices, or may be configured as a single device.
[0016] The machining program generating device 10 is a device that generates a machining program PM including a plurality of cutting processes for cutting out a machined product from a workpiece (material) by numerical control. The machining program generating device 10 receives shape data Fd and shape correction examples Fc from an external device. The shape correction examples Fc may be stored in the numerical control device 100 or in an external device of the numerical control device 100.
[0017] The shape correction example Fc is data of a plurality of shape correction examples created in the past. The shape correction example Fc is an example of correction of a product shape that was performed on the product shape in the past. The shape correction example Fc may include data of shape correction performed by the numerical control device 100. The shape correction example Fc may also include data of shape correction performed by another device.
[0018] The shape correction example Fc includes information on the method for correcting the product shape data, the corrected product shape (product shape data after correction), product shape placement data, the position (coordinates) of the workpiece origin, and information on the direction vectors of each axis of the program coordinate system.
[0019] The machining program generating device 10 generates a machining program PM based on shape data Fd input to the machining program generating device 10 from outside the numerical control device 100. The shape data Fd includes material shape data, which is data on an object to be machined, and product shape data, which is data on the product shape.
[0020] The product shape data may include product material information indicating the material of the product shape, and the material shape data may include material material information indicating the material of the material shape. The shape data Fd may also include assembly data of the material shape. In this case, the assembly data of the material shape is composed of a plurality of material shape data. The shape data Fd may also include assembly data of the product shape. In this case, the assembly data of the product shape is composed of a plurality of product shape data.
[0021] The material shape data is data that defines the material shape, which is the shape of the workpiece before machining. The product shape data is data that defines the product shape, which is the shape of the workpiece after machining. The material shape data and the product shape data are, for example, CAD data. Note that the product shape data and the material shape data are not limited to CAD data, and may be any data that can be interpreted by the machining program generation device 10.
[0022] Upon receiving the product shape data, the machining program generation device 10 corrects the product shape by using the shape correction data which is the inference result of the machine learning device 20. The shape correction data is data (such as a correction method) related to shape correction of the product shape corresponding to the product shape data.
[0023] The machining program generating device 10 of the embodiment generates a machining program PM based on the product shape data after the product shape is corrected and the material shape data. The machining program generating device 10 generates a machining program PM including information on machining units (hereinafter referred to as machining unit information) based on the placement data (placement positions of the material shape data and the product shape data), the workpiece origin, and the program coordinate system.
[0024] The workpiece origin is the origin set for the workpiece, which is the object to be machined. The workpiece origin is the origin of the program coordinate system and is the reference point used when generating the machining program PM. The workpiece origin is used to define the position and posture of the object to be machined. For example, the origin of the coordinate system of the machine tool is set as the workpiece origin. The machining program PM calculates the machining position and the movement path of the tool based on the workpiece origin. For example, if the workpiece origin is set at X=0, Y=0, Z=0, the machining program PM calculates the machining position and the movement path of the tool based on this position.
[0025] A machining unit is a unit of machining in which continuous machining is performed using the same spindle and the same tool. Machining unit information is data on machining processes. Specifically, the machining unit information includes machining data including information on machining methods (hole machining, surface machining, etc.), tool data including information on tools used for machining and information on cutting conditions, and shape information that defines a machining shape consisting of a single shape.
[0026] Examples of the machining units include a turning machining unit, a stepped hole machining unit, a surface machining unit, an R chamfering machining unit, and a C chamfering machining unit. The turning machining unit is a machining unit that performs turning, and the stepped hole machining unit is a machining unit that performs stepped hole machining (machining of a hole with a step). The surface machining unit is a machining unit that performs surface machining, the R chamfering machining unit is a machining unit that performs R chamfering, and the C chamfering machining unit is a machining unit that performs C chamfering. Note that the shape information that defines the machining shape may include information such as the surface roughness of the workpiece.
[0027] The tool information includes the type of tool, the shape of the tool, etc. The tool information may include the information of the tool holder. The tool holder information includes the type of tool holder, the shape of the tool holder, etc. The cutting condition information includes the cutting speed, the number of revolutions, the feed amount, etc. when the machine tool performs machining.
[0028] The machine learning device 20 generates a learning model Mx (not shown), which is a machine learning model used for correcting the product shape, based on a plurality of shape correction examples included in the shape correction example Fc.
[0029] The machine learning device 20 extracts product shape information (product shape, workpiece origin, and program coordinate system) and a correction method, which is shape correction data, from multiple shape correction examples included in the shape correction examples Fc. Hereinafter, the product shape information including the product shape, workpiece origin, and program coordinate system may be referred to as product shape information.
[0030] 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 the embodiment, the correction method (shape correction data) corresponds to a first parameter described later, and the product shape information corresponds to a second parameter described later.
[0031] The learning model Mx is a model for inferring a correction method from product shape information. When product shape information is input, the learning model Mx infers and outputs a correction method corresponding to the product shape information. The machine learning device 20 infers a correction method from the product shape information using the generated learning model Mx, and sends the correction method that is the inference result to the machining program generation device 10.
[0032] The dialogue processing unit 30 is an interface between the numerical control device 100 and an operator, and is also an interface between the machining program generating device 10 or the machine learning device 20 and the operator.
[0033] The dialogue operation processing unit 30 transmits instruction information input by the operator via the instruction input unit 40 to the machining program generation device 10 or the machine learning device 20. In addition, 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. Note that in FIG. 1, the connection line between the dialogue operation processing unit 30 and the machine learning device 20 is omitted.
[0034] The instruction input unit 40 is configured using input devices such as a mouse, a keyboard, etc. The instruction input unit 40 receives instruction information from an operator and transmits the instruction information to the dialogue operation processing unit 30.
[0035] The display unit 50 is a display device such as a liquid crystal monitor. The display unit 50 displays the machining program PM, shape correction examples Fc, shape data Fd which is CAD data, instruction information input by an operator via the instruction input unit 40, etc. The display unit 50 also displays various information related to the processing executed by the numerical control device 100. The control unit 60 controls the machine tool using the machining program PM generated by the machining program generating device 10.
[0036] The machining program generation device 10 has a shape input unit 11, a product shape memory unit 12, a material shape memory unit 13, a shape placement 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.
[0037] The shape input unit 11 receives product shape data and material shape data input from an external device as shape data Fd. Note that the shape input unit 11 may receive the product shape data and material shape data separately from the external device.
[0038] The product shape storage unit 12 stores product shape data out of the shape data Fd input to the shape input unit 11. The material shape storage unit 13 stores material shape data out of the shape data Fd input to the shape input unit 11.
[0039] The shape placement unit 14 places the product shape of the product shape data stored in the product shape storage unit 12 and the material shape of the material shape data stored in the material shape storage unit 13. The shape placement unit 14 places the product shape and the material shape such that the product shape, which is the shape of the workpiece after processing, is contained within the material shape, which is the shape of the workpiece before processing. The shape placement unit 14 stores the product shape data of the placed product shape in the product shape storage unit 12, and stores the material shape data of the placed material shape in the material shape storage unit 13. The product shape data in which the product shape is placed includes information on the coordinates of the product shape (coordinates set in the product shape data) and the program coordinate system. Furthermore, the material shape data in which the material shape is placed includes information on the coordinates of the material shape and the program coordinate system.
[0040] The product shape storage unit 12 stores identification information (hereinafter referred to as shape identification information) for identifying a combination of the arranged product shape and material shape, in association with the product shape data. The material shape storage unit 13 stores the shape identification information of the arranged product shape and material shape, in association with the material shape data.
[0041] The shape placement unit 14 does not necessarily need to place the material shape and the product shape at a position where the material shape contains the product shape. The shape placement unit 14 may also place at least one of the product shape and the material shape at a position instructed by the operator via the dialogue processing unit 30.
[0042] The program coordinate setting unit 15 places a work origin and a program coordinate system at an arbitrary position from either the product shape or the material shape placed by the shape placement unit 14. The program coordinate setting unit 15 sets the work origin and the program coordinate system so that the position and direction (first direction) set in the product shape coincide with the position and direction (second direction) set in the program coordinate system. That is, the program coordinate setting unit 15 aligns the product shape data with the program coordinate system and aligns the direction. 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 value of the work origin and the direction vector of each axis of the program coordinate system in association with the shape identification information.
[0043] The program coordinate setting unit 15 may place a workpiece origin and a program coordinate system designated at an arbitrary position by the operator. In this case, the program coordinate setting unit 15 stores the coordinate values of the workpiece origin designated at an arbitrary position by the operator and the direction vectors of each axis of the program coordinate system.
[0044] The program coordinate setting unit 15 also sets an initially set direction (for example, the Z-axis direction) as the turning direction and stores the set turning direction. The program coordinate setting unit 15 may also set a direction designated by an operator at an arbitrary position as the turning direction and store the set turning direction.
[0045] The workpiece origin is the origin for creating the machining program PM, and is set, for example, at a specific position (center, corner, etc.) of the material shape. The program coordinate system is a coordinate system with the workpiece origin as its origin, and for example, a world coordinate system having X-axis, Y-axis, and Z-axis is set. Note that the workpiece origin does not have to be set at the center or corner of the surface, and may be set at any position by the operator.
[0046] The difference detection unit 16 reads out the product shape data arranged by the shape arrangement 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 out the program coordinate system stored in the program coordinate setting unit 15 from the program coordinate setting unit 15.
[0047] The difference detection unit 16 detects a difference between a position or direction (first direction) set in the product shape and a position or direction (second direction) set in the program coordinate system 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.
[0048] The shape correction unit 17 stores a correction method for the product shape data as shape correction data. The shape correction unit 17 stores the shape identification information and the shape correction data in association with each other. The shape correction data may be stored in an area other than the shape correction unit 17.
[0049] Furthermore, the shape correcting unit 17 stores the corrected product shape data in the product shape storing unit 12. That is, the shape correcting unit 17 overwrites the product shape data before correction stored in the product shape storing unit 12 with the corrected product shape data.
[0050] The product shape storage unit 12 stores the shape identification information and the corrected product shape data in association with each other. The shape correction unit 17 may 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 arrangement data and product shape dimensions.
[0051] Information including the corrected product shape, the workpiece origin, and the program coordinate system is product shape information. The correction method used by the shape correcting unit 17 is shape correction data. A combination of the product shape information and the shape correction data is a shape correction example Fc.
[0052] The machining program generation unit 18 reads out the product shape data and shape identification information arranged by the shape placement unit 14 and corrected by the shape correction unit 17 from the product shape storage unit 12. Furthermore, the machining program generation unit 18 reads out the material shape data arranged by the shape placement unit 14 from the material shape storage unit 13 based on the shape identification information. Furthermore, the machining program generation unit 18 reads out the program coordinate system from the program coordinate setting unit 15 based on the shape identification information.
[0053] The machining program generation unit 18 generates a machining program PM based on the product shape data arranged by the shape placement unit 14 and corrected by the shape correction unit 17, the material shape data arranged by the shape placement unit 14, and the program coordinate system.
[0054] The machine learning device 20 generates a learning model Mx for inferring a correction method from product shape information, using the shape correction example Fc generated by the machining program generation device 10 or the shape correction example Fc read from an external device. Moreover, the machine learning device 20 infers a correction method by inputting the product shape information generated by the machining program generation device 10 to the learning model Mx.
[0055] In the following, a case will be described in which the machine learning device 20 generates a learning model Mx for inferring a correction method from product shape information by using a shape correction example Fc generated by the machining program generation device 10.
[0056] The machine learning device 20 has 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 out from the product shape storage unit 12 the product shape data and shape identification information that have been arranged by the shape arrangement unit 14 and corrected by the shape correction unit 17 and that are stored in the product shape storage unit 12.
[0057] The shape correction method analysis unit 21 extracts a first parameter and a second parameter from the product shape data read out from the product shape storage unit 12, the program coordinate system stored in the program coordinate setting unit 15, and the shape correction data stored in the shape correction unit 17. That is, the shape correction method analysis unit 21 extracts a first parameter (a correction method for the product shape data) from the shape correction data, and extracts a second parameter (product shape, workpiece origin, and program coordinate system) from the corrected product shape, product shape arrangement data, workpiece origin position, and direction vectors of each axis of the program coordinate system.
[0058] The method of correcting product shape data includes the following correction methods. -How to correct turned surfaces (cylinder, cone, ring) -How to correct the hole surface and step hole surface of a stepped hole -How to correct the XY plane -How to correct the relationship between the Z-axis direction and the plane and cylindrical surface that become walls during surface machining -How to correct the amount of R chamfer between adjacent round fillets -How to correct the amount of chamfer between adjacent chamfer fillets
[0059] The first parameter and the second parameter are parameters used in the machining program generation device 10. The first parameter is a parameter to be adjusted in the machining program generation device 10. The second parameter is a parameter that is not to be adjusted in the machining program PM and is used to adjust the first parameter. The parameter adjustment process is a process for determining the value of a parameter.
[0060] The value of the first parameter is generated when the product shape of the product shape data stored in the product shape storage unit 12 is corrected. The first parameter is, for example, a parameter representing a method of correcting the product shape in the shape correction example Fc, and is data necessary for correcting the product shape.
[0061] The second parameters are fixed-length data that are not adjusted. The second parameters are, for example, data generated based on the product shape and the dimensions of the product shape. The second parameters are, for example, the product dimensions (height, width, length, etc.) extracted from the product shape, the position coordinates of the work origin, and the direction vectors of each axis of the program coordinate system. The second parameters may also be image data of the three-dimensional shape of the product shape, voxel data of the three-dimensional shape of the product shape, inside / outside determination data on the three-dimensional lattice space of the product shape, etc.
[0062] The inside / outside determination data is data on a lattice space obtained by dividing a three-dimensional space into a lattice. Data is assigned to each lattice point, and the inside / outside data is classified into two types: data that exists within the lattice space (inside data) and data that exists outside the lattice space (outside data). The inside data is data within the lattice space, and can represent, for example, the shape of an object or the distribution of physical quantities. On the other hand, the outside data is data outside the lattice space, and can represent, for example, inputs from outside the object or boundary conditions.
[0063] A second parameter is associated with each first parameter. The shape correction method analysis unit 21 adjusts the first parameter based on the second parameter corresponding to the first parameter. The shape correction method analysis unit 21 determines a second parameter to be extracted for each first parameter, 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.
[0064] The machine learning unit 22 generates a learning model Mx by learning using a data set including the extracted first parameter and second parameter. That is, the machine learning unit 22 generates a learning model Mx for inferring the first parameter from the second parameter set by the operator. In the embodiment, the machine learning unit 22 performs, for example, supervised learning for generating the learning model Mx. The machine learning unit 22 inputs the generated learning model Mx to the learning model storage unit 23.
[0065] The learning algorithm used by the machine learning unit 22 may be any algorithm. An example of the learning algorithm used by the machine learning unit 22 is a neural network. The neural network may be a deep learning with a multi-layer structure. The learning algorithm used by the machine learning unit 22 may be genetic programming, inductive logic programming, SVM (Support Vector Machine), or the like. Machine learning is a process of optimizing parameters such as the weights or biases of a neural network.
[0066] The learning model storage unit 23 stores the learning model Mx, which is the learning result of the machine learning unit 22. The learning model Mx outputs optimal first parameters for input second parameters. In other words, the learning model Mx is a model for deriving, from the second parameters, the first parameters that are optimal for the second parameters.
[0067] Input data including the second parameter is input to the inference unit 24 as input data. The inference unit 24 infers the first parameter from the second parameter using the learning model Mx. The inference unit 24 inputs the second parameter to the learning model Mx and causes the learning model Mx to output the first parameter, which is the inference result. The inference unit 24 sends the inference result to the shape correction unit 17. That is, the inference unit 24 returns the first parameter, which is the inference result, to the shape correction unit 17 in response to the second parameter sent from the shape correction unit 17. The inference unit 24 outputs the first parameter to the shape correction unit 17 as the inference result.
[0068] The numerical control device 100 may determine the first parameter (correction method) from the second parameter using the machine learning device 20, or may determine the first parameter from the second parameter without using the machine learning device 20. When determining the first parameter without using the machine learning device 20, the numerical control device 100 determines the correction method, which is the first parameter, based on the shape of the region (surface) to be machined, etc.
[0069] Next, a description will be given of the operation of the numerical control device 100. The processing executed by the numerical control device 100 includes a machining program generation processing executed by the machining program generation device 10, a learning model generation processing executed by the machine learning device 20, and an inference processing executed by the machine learning device 20.
[0070] 2 is a flowchart showing a processing procedure of a machining program generation process executed by the machining program generation device according to the embodiment. The machining program generation device 10 corrects the product shape using an inference result obtained by using a learning model Mx, which is a learning result of the machine learning device 20, and generates a machining program PM for the shape-corrected product shape.
[0071] The shape input unit 11 reads product shape data from an external device or a storage area (not shown) in the numerical control device 100 (step S1). The shape input unit 11 stores the product shape data in the product shape storage unit 12.
[0072] The shape input unit 11 reads material shape data from an external device or a storage area (not shown) in the numerical control device 100 (step S2). The shape input unit 11 stores the material shape data in the material shape storage unit 13. The machining program generation device 10 may generate a material shape based on the product shape data stored in the product shape storage unit 12, and store the generated material shape data in the material shape storage unit 13. The machining program generation device 10 may execute the process of step S1 and the process of step S2 in any order.
[0073] 3 is a diagram showing an example of a product shape corresponding to product shape data stored in a product shape storage unit of a machining program generating device according to an embodiment. The product shape data 101 stored in the product shape storage unit 12 includes a three-sided view and a perspective view Pv1 of the product shape SA1. The three-sided view of the product shape SA1 is a front view Fv1, a left side view Ls1, and a plan view Gp1 of the product shape. A program coordinate system AX1 is set in the three-sided view and the perspective view Pv1 of the product shape SA1.
[0074] 4 is a diagram showing an example of a material shape corresponding to material shape data stored in a material shape storage unit of a machining program generating device according to an embodiment. Material shape data 102 stored in material shape storage unit 13 includes a three-sided view and a perspective view Pv2 of material shape SB2. The three-sided view of material shape SB2 is a front view Fv2, a left side view Ls2, and a plan view Gp2 of material shape SB2. A program coordinate system AX2 is set in the three-sided view and the perspective view Pv2 of material shape SB2. FIG. 4 shows a case where the program coordinate system AX2 is equal to the program coordinate system AX1.
[0075] The shape placement unit 14 places each of the product shape and material shape (step S3). That is, the shape placement unit 14 generates placement data for the product shape and material shape. In other words, the shape placement unit 14 generates placement data indicating the placement position of the product shape and the placement position of the material shape. The placement data is data indicating the position and orientation of the product shape and material shape on the three-dimensional coordinate system. At the time the placement data is generated, the product shape and material shape are not necessarily placed in a position that is easy to process.
[0076] Therefore, the shape placement unit 14 rearranges the product shape data and the material shape data based on the generated placement data. That is, the shape placement unit 14 rearranges the product shape and the material shape by rotating and moving them according to the placement data. For example, the shape placement unit 14 rearranges the product shape and the material shape so that the direction of the axis (first axis) of the machining shape (machining area) included in the product shape data matches the direction of the axis (second axis) set in the program coordinate system. Note that at least one of the product shape data and the material shape data may be placed at an arbitrary position by the operator using the dialogue processing unit 30, the instruction input unit 40, and the display unit 50.
[0077] The program coordinate setting unit 15 places the coordinate value of the work origin and the program coordinate system at an arbitrary position from either the product shape or the material shape placed by the shape placement unit 14 (step S4). The program coordinate setting unit 15 sets, for example, a position on the central axis of the product shape or the material shape as the work origin. In addition, the program coordinate setting unit 15 places the program coordinate system so that, for example, the direction of the cutting axis coincides with the axial direction of the program coordinate system. The program coordinate setting unit 15 stores the coordinate value of the work origin and the direction vector of each axis of the program coordinate system.
[0078] The workpiece origin and the program coordinate system may be placed at any position and in any direction by the operator using the dialogue processing unit 30, the instruction input unit 40, and the display unit 50. When the program coordinate system is the world coordinate system, the machining program generation device 10 can omit the processing of step S4. In other words, 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.
[0079] 5 is a diagram showing an example of a product shape and a material shape arranged by the shape arranging unit 14 of the machining program generating device according to the embodiment. The shape arranging unit 14 arranges the product shape and the material shape to synthesize the product shape and the material shape.
[0080] The product shape and material shape arrangement data 103 generated by arranging the product shape and material shape by the shape arrangement unit 14 includes a three-sided view and a perspective view Pv3 of the arrangement shape SC3 in which the product shape SA1 and material shape SB2 are arranged. The three-sided view of the arrangement shape SC3 is a front view Fv3, a left side view Ls3, and a plan view Gp3 of the arrangement shape SC3. A program coordinate system AX3 is set for the arrangement shape SC3. FIG. 5 shows a case where the program coordinate system AX3 is equal to the program coordinate systems AX1 and AX2.
[0081] The product is formed by cutting the material. Therefore, Fig. 5 shows a case where the product shape SA1 is disposed inside the material shape SB2.
[0082] The shape correction unit 17 analyzes all the shape data of the product shape arranged by the shape arrangement unit 14, and corrects the product shape based on the work origin and the program coordinate system (step S5). The machining program generation unit 18 develops a machining shape indicating the area (shape) to be machined. Specifically, the machining program generation unit 18 generates machining shape data from the product shape data stored in the product shape storage unit 12, the shape of which has been corrected by the shape correction unit 17, and the material shape data stored in the material shape storage unit 13.
[0083] The machining shape data corresponds to the difference between the product shape data and the material shape data. In other words, the machining shape data is data on the shape (area) to be machined on the material. The machining program generation unit 18 generates turning data, facing data, chamfering data, and hole machining data from the machining shape data.
[0084] The turning data is data that indicates an area of turning in which a material is rotated. The facing data is data that indicates an area to be faced, the chamfering data is data that indicates an area to be chamfered, and the hole machining data is data that indicates an area to be drilled. The facing, chamfering, and hole machining are processes that involve rotating a tool.
[0085] Next, the machining program generating unit 18 assigns a machining unit to the developed machining shape. That is, the machining program generating unit 18 determines a machining method, a tool, and cutting conditions for the generated machining shape. The machining program generating unit 18 generates machining unit information by assigning information on the machining method, the tool, and the cutting conditions to the machining shape. Then, the machining program generating unit 18 generates a machining program PM based on the generated machining unit information, the machining method, the tool, the cutting conditions, the machining shape, and the result of the interference check (step S6). The interference check is a process for checking whether the tool interferes with the non-machining area.
[0086] 6 is a schematic diagram showing an example of machining shape data generated by a machining program generating unit of a machining program generating device according to an embodiment. Machining shape data 201 in FIG. 6 shows material shape data, turning shape data, face machining shape data, and hole machining shape data.
[0087] The diagram of machining shape data shown on the left side of Figure 6 shows, in a schematic perspective view, the material shape Sx1, the turning hole machining shape SH1 which is an example of a shape indicated by the turning machining shape data for the front side process, the turning machining shapes SH2 and SH3, and the hole machining shape SH4 which is an example of a shape indicated by the hole machining shape data.
[0088] The diagram of machining shape data shown on the right side of Figure 6 shows, in schematic perspective views, the material shape Sx1, turning shapes SH5 to SH7 which are example shapes indicated by the turning shape data for the back side process, face machining shapes SH8 to SH15, and a hole machining shape SH16 which is an example shape indicated by the hole machining shape data.
[0089] The hole machining shape SH4 is a hole machining shape that is composed of four hole machining shapes, and the same hole machining is performed for each of them. Also, the hole machining shape SH16 is a hole machining shape that is composed of two hole machining shapes, and the same hole machining is performed for each of them.
[0090] Fig. 7 is a diagram showing an example of a machining program generated by a machining program generating unit of a machining program generating device according to an embodiment. Fig. 7 shows a list of machining steps of the machining program PM. Here, a case is shown in which a front side machining step HD1 of the machining program PM includes Uno1. to Uno4. Also, a case is shown in which a back side machining step HD2 of the machining program PM includes Uno.5. to Uno.16.
[0091] "Uno1. Turning drill...SH1" indicates that the machine tool processes the turning hole machining shape SH1 as a turning drill unit. "Uno2. End face...SH2" indicates that the machine tool processes the turning hole machining shape SH2 as a turning end face unit. "Uno3. Bar stock...SH3" indicates that the machine tool processes the turning hole machining shape SH3 as a turning bar stock unit. "Uno4. C-axis drill...SH4" indicates that the machine tool processes four hole machining shapes SH4 as C-axis drill units. In Uno1. to Uno4., the machine tool holds the material on the first spindle side and processes it from the front side. The first spindle is one of the spindles that face in the axial direction in the opposite direction to each other. The first spindle and the second spindle are the central axes of the material shape Sx1 shown in FIG. 6.
[0092] "Uno5. Face...SH5" indicates that the machine tool processes turning shape SH5 as a turning face unit. "Uno6. Bar...SH6" and "Uno7. Bar...SH7" indicate that the machine tool processes turning shapes SH6 and SH7 as turning bar units. "Uno8. Face mill...SH8", "Uno9. Face mill...SH9", "Uno10. Face mill...SH10", and "Uno11. Face mill...SH11" indicate that the machine tool processes facing shapes SH8, SH9, SH10, and SH11 as face mill units. "Uno12. Pocket mill...SH12", "Uno13. Pocket mill...SH13", "Uno14. Pocket mill...SH14", and "Uno15. Pocket mill...SH15" indicate that the machine tool processes facing shapes SH12, SH13, SH14, and SH15 as pocket mill units. "Uno16.C-axis drill…SH16" indicates that the machine tool will machine two hole drilling shapes SH16 as a C-axis drilling unit.
[0093] In Uno5 to Uno16, the material machined by the first spindle of the machine tool is held by the second spindle again and processed from the back side. The first and second spindles are both turning spindles, and are called the main spindle and the sub-spindle, respectively, and are positioned opposite each other. In the case of a machine tool that does not have a second spindle, after the machine tool processes the front side, the material being processed is removed from the first spindle, the machined material is reversed and re-gripped by the first spindle, and the machine tool processes the back side.
[0094] The turning drill unit is a processing unit that uses a turning drill to machine holes in the center of the material. The turning end face unit is a processing unit that cuts off protruding parts on the end face (front or back) of the material. The turning bar stock unit is a processing unit that uses a turning tool to turn the outer circumference, inner circumference, front or back of a round bar material. The face mill unit is a processing unit that uses a face mill tool to machine the surface of the workpiece (object to be machined) flat. In the face mill unit, machining is performed so that it goes beyond the range of the machining shape. The pocket mill unit is a processing unit that uses an end mill tool to machine a pocket shape. In the pocket mill unit, machining is performed so that it does not go beyond the machining shape. The C-axis drill is a processing unit that uses a drill tool to machine holes, and C-axis machining is performed by clamping the C-axis when positioning. The C-axis is an axis that rotates around the Z-axis.
[0095] Fig. 8 is a flowchart showing a processing procedure of a first example of shape correction processing executed by the shape correcting unit 17 of the machining program generating device according to the embodiment. The processing in Fig. 8 corresponds to the processing of step S5 in Fig. 2. The first example of shape correction processing executed by the shape correcting unit 17 is processing for correcting a cylindrical surface, a conical surface, and a torus surface.
[0096] The program coordinate setting unit 15 sets the work 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, the conical surface, or the toric surface coincide with the direction (second direction) and position coordinates of the turning axis. The first direction and the second direction here are the directions of the turning axis. In other words, the first direction and the second direction are the directions of the vector (0,0,1) or the vector (0,0,-1).
[0097] The difference detection unit 16 acquires all faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 (step S11). The difference detection unit 16 refers to the geometric information of the acquired faces and extracts cylindrical faces, conical faces, and toric faces from the acquired faces (step S12). A cylindrical face is an inner wall face of a cylindrical hole shape, and a conical face is an inner wall face of a conical hole shape. A toric face is an inner wall face of a circular ring-shaped hole shape.
[0098] The difference detection unit 16 and the shape correction unit 17 calculate the difference between the central axis of the extracted surface 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 toric surfaces with the position coordinates and direction vectors of the turning axes stored by the program coordinate setting unit 15, and obtains the difference amounts of the position coordinates and the direction vectors. The position coordinates of the central axes are the coordinates of a specific point on the central axes, and the position coordinates of the turning axes are the coordinates of a specific point on the turning axes.
[0099] The shape correction unit 17 judges whether or not the product shape needs to be corrected based on the difference amount of the position coordinates and the difference amount of the direction vector (step S14). The shape correction unit 17 judges that correction is necessary when the difference amount of the position coordinates is within a specific range and the difference amount of the direction vector is within a specific range. That is, the shape correction unit 17 judges that correction is necessary when the difference amount of the position coordinates and the difference amount of the direction vector are equal to or greater than the geometric allowable error amount (geometric accuracy) and are less than the set error amount set by the operator. The set error amount may be a fixed value or may be arbitrarily set by the operator. When the set error amount is set by the operator, a difference equal to or greater than the set error amount is a difference intentionally set by the operator, and a product shape having such a difference is not subject to correction. That is, a difference set by design is a difference necessary to realize a product shape as designed, and a judgment is executed such that this difference is not subject to correction.
[0100] The shape corrector 17 determines that correction is necessary when one of the position coordinate difference amount and the direction vector difference amount is less than the geometric allowable error amount and the other is equal to or greater than the geometric allowable error amount and less than the set error amount.
[0101] Furthermore, the shape correction unit 17 determines that correction is unnecessary when either the position coordinate difference amount or the direction vector difference amount is equal to or greater than the set error amount, and determines that correction is unnecessary when both the position coordinate difference amount and the direction vector difference amount are less than the geometric allowable error amount.
[0102] In other words, the shape correction unit 17 determines that correction is necessary when at least one of the difference in position coordinates and the difference in direction vector is equal to or greater than the geometric tolerance, and both the difference in position coordinates and the direction vector are less than the set error amount.
[0103] The geometric tolerance is the amount of error that is geometrically permitted, and errors greater than the geometric tolerance are not geometrically permitted. The geometric tolerance corresponds to the linear accuracy and angular accuracy of the system. If the difference in position coordinates is less than the linear accuracy, the distance (error amount), which is the difference in position coordinates, is treated as zero, and if the difference in distance is smaller than the linear accuracy, it is treated as the same position.
[0104] Furthermore, if the difference in the direction vectors is less than the angular precision, the angle, which is the difference in the direction vectors, is treated as zero, and if the angle difference is smaller than the angular precision, they are treated as the same direction vectors with the same angle.
[0105] The set error amount set by the operator is the linear accuracy and angular accuracy set separately from the geometric allowable error amount. The operator sets the set error amount to a value equal to or greater than the geometric allowable error amount, taking into account shape data with poor accuracy. The set error amount is the error amount assumed by the operator, and an error equal to or greater than the set error amount assumed by the operator is permitted, but an error less than the set error amount is not permitted. In other words, an error greater than the error intended by the operator is permitted, but an error not intended by the operator is not permitted. An error not assumed by the operator is an error that is inconvenient for the side that creates the machining program, and the shape correction unit 17 corrects the product shape to reduce this error to an error less than the set error amount. In other words, when the error (difference) is not within a specific range equal to or greater than the geometric allowable error amount, which is a geometrically permitted error amount, the shape correction unit 17 corrects the product shape so that the error is within the specific range. In this way, the shape correction unit 17 corrects only the error within the specific range assumed by the operator.
[0106] When the shape correction unit 17 determines that correction is necessary (step S14, necessary), it corrects the surface determined to require correction (step S15). When the position coordinate of the central axis of the cylindrical surface, conical surface, or toric surface requires correction, the shape correction unit 17 corrects the position coordinate of the central axis so that it coincides with the position coordinate of the turning axis. When the direction vector of the central axis of the cylindrical surface, conical surface, or toric surface requires correction, the shape correction unit 17 corrects the direction vector of the central axis so that it coincides with the direction vector of the turning axis. The shape correction unit 17 recalculates and corrects the intersection line and intersection point between the surface corrected in step S15 and the adjacent surface (step S16). When the shape correction unit 17 determines that correction is unnecessary (step S14, unnecessary), it does not execute correction.
[0107] 9 is a diagram for explaining a first example of a shape correction process executed by the shape correcting unit of the machining program generating device according to the embodiment. Here, a conical surface formed on a product shape 81 will be explained.
[0108] The program coordinate setting unit 15 sets the work origin, the program coordinate system, and the direction of the turning axis so that the central axis of face SF4 included in the product shape 81 coincides with the vector (0,0,1) or vector (0,0,-1), which is the direction of the turning axis set in the program coordinate system. In this case, for example, it is assumed that the geometric information of face SF4, a conical surface formed in the product shape 81, has the following information. This geometric information is information that has been rewritten due to some factor, for example, during format conversion, resulting in a deviation.
[0109] Surface SF4: Cone surface Position coordinates of the central axis (0.00001,0,0) -Direction vector of central axis (0.0001,0.0001,0.99999999) ·Radius=0.025 ·Half apex angle=2.86 degrees
[0110] The difference detection unit 16 calculates the difference in position coordinates and direction vector between the central axis of the surface SF4 and the turning axis.
[0111] When the turning axis to be compared has 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.
[0112] The direction vector of the turning axis and the direction vector of the central axis of surface SF4 are both unit vectors. Therefore, in the embodiment, the difference between the two direction vectors is the magnitude of the difference between the direction vectors, but the difference between the direction vectors may be the angle between the direction vector of the turning axis and the direction vector of the central axis of surface SF4.
[0113] If the geometric tolerance of the position coordinates is 1.0e-8, the geometric tolerance of the direction vector is 1.0e-10, the set error of the position coordinates set by the operator is 1.0e-3, and the set error of the direction vector is 1.0e-6, the shape correction unit 17 performs shape correction of surface SF4.
[0114] The shape correction unit 17 corrects the geometric information of the conical surface SF4 as follows. -Center axis position coordinates (0,0,0) -Direction vector of the central axis (0,0,1)
[0115] That is, the shape correction unit 17 corrects the geometric information of the face SF4 so that the position coordinates and the direction vector of the central axis of the face SF4 coincide with the position coordinates (0,0,0) and the direction vector (0,0,1) of the turning axis. In addition, the shape correction unit 17 recalculates the intersection lines and points between the face SF4 and the faces adjacent to the face SF4 in accordance with the corrected face SF4.
[0116] Fig. 10 is a flowchart showing the procedure of a second example of shape correction processing executed by the shape correction unit of the machining program generation device according to the embodiment. The processing in Fig. 10 corresponds to the processing in step S5 in Fig. 2. The second example of shape correction processing executed by the shape correction unit 17 is processing for correcting adjacent cylindrical surfaces, conical surfaces, and toric surfaces in a stepped hole.
[0117] The shape arrangement unit 14 arranges the product shape so that the directions of the central axes of the stepped holes, which are holes with a step included in the product shape, coincide with each other. The program coordinate setting unit 15 sets the work origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinates of the central axes of the stepped holes, which are holes with a step included in the product shape, coincide with the direction (second direction) and position coordinates of the turning axis. That is, the program coordinate setting unit 15 sets the work origin, the program coordinate system, and the direction of the turning axis so that the directions of the central axes of the cylindrical surface, the conical surface, and the toric surface in the stepped hole coincide with the direction of the turning axis. The first direction and the second direction here are the directions of the turning axis. That is, the first direction and the second direction are the directions of the vector (0,0,1) or the vector (0,0,-1).
[0118] The difference detection unit 16 acquires all faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 (step S21). The difference detection unit 16 refers to the geometric information of the acquired faces, and extracts cylindrical faces, conical faces, and toric faces that are hole-shaped (empty on the inside) from among the acquired faces (step S22).
[0119] The difference detection unit 16 selects adjacent faces from among the acquired faces by referring to the geometric information of the acquired faces. That is, the shape correction unit 17 selects a combination of adjacent faces (hole faces) from among the extracted cylindrical faces, conical faces, and toric faces (step S23).
[0120] The difference detection unit 16 calculates the difference (axis difference) between the central axes of adjacent faces (hole faces) (step S24). That is, the difference detection unit 16 acquires the position coordinates and direction vectors of the central axes of the selected adjacent cylindrical faces, conical faces, and torus faces, and acquires the difference amounts of the position coordinates and direction vectors between the acquired adjacent faces. In this way, the difference detection unit 16 acquires the difference amount indicating how much the central axes are misaligned between the adjacent faces.
[0121] The shape correction unit 17 determines whether or not correction is required for the product shape based on the difference amount of the position coordinates and the difference amount of the direction vector (step S25). The shape correction unit 17 determines whether or not correction is required by a determination method similar to the determination method in the shape correction process of the first example (the determination method in step S14).
[0122] When it is determined that correction is necessary (step S25, necessary), shape correction unit 17 corrects the surface determined to require correction (step S26). When correction is necessary for the position coordinates of the central axis of a cylindrical surface, a conical surface, or a torus surface, shape correction unit 17 corrects the position coordinates of the central axis of one surface such that the position coordinates of the central axis of one surface of adjacent surfaces coincide with the position coordinates of the central axis of the other surface.
[0123] Furthermore, when the direction vector of the central axis of a cylindrical surface, a conical surface, or a toric surface needs to be corrected, the shape correction unit 17 corrects the direction vector of the central axis of one of the adjacent surfaces so that the direction vector of the central axis of one surface coincides 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 one of the adjacent surfaces so that the position coordinates and direction vectors of both central axes of the adjacent surfaces coincide with each other.
[0124] The shape correction unit 17 may correct the position coordinates and direction vectors of the central axes of both adjacent faces so that the position coordinates and direction vectors of the central axes of both adjacent faces coincide with each other. The shape correction unit 17 recalculates and corrects the intersection lines and points between the face corrected in step S26 and the adjacent face (step S27). If the shape correction unit 17 determines that correction is unnecessary (step S25, unnecessary), it does not execute the correction.
[0125] 11 is a diagram for explaining a second example of shape correction processing executed by the shape correction unit of the machining program generating device according to the embodiment. Here, a stepped hole formed in a product shape 82 will be explained. For example, the stepped hole formed in the product shape 82 includes a conical surface SF5, a cylindrical surface SF6, and a cylindrical surface SF7.
[0126] The shape placement unit 14 places the product shape 82 so that the central axes of the faces SF5 to SF7 included in the product shape 82 coincide with each other. 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 the faces SF5 to SF7 coincide with the direction of the turning axis. In this case, it is assumed that the geometric information of the conical surface SF5, the cylindrical surface SF6, and the cylindrical surface SF7 have the following information. This geometric information is information that has been rewritten due to some factor during format conversion, for example, resulting in a deviation.
[0127] Surface SF5: Cone surface Position coordinates of the central axis (0,0,0.029) -Direction vector of the central axis (0,0,1) ·Radius=0.0075 ·Half apex angle = 45 degrees
[0128] Face SF6: Cylindrical face -Center axis position coordinates (0,0,0.03) -Direction vector of the central axis (0,0,1) ·Radius=0.0075
[0129] Surface SF7: Cylindrical surface Position coordinates of the central axis (0.00001, 0.0001, 0.03) -Direction vector of central axis (0.0001,0.0001,0.99999999) ·Radius=0.005
[0130] The difference detection unit 16 calculates the differences between the position coordinates and direction vectors of the faces SF5 to SF7. That is, the difference detection unit 16 calculates the difference between the central axis of the face SF5 and the central axis of the face SF6 adjacent to the face SF5, and calculates the difference between the central axis of the face SF7 adjacent to the face SF6 and the central axis of the face SF6.
[0131] The difference in position coordinates between the conical surface SF5 and the cylindrical surface SF6 is 0.001, and the difference in the direction vectors of the central axes is 0. Furthermore, the difference in position coordinates between the cylindrical surface SF6 and the cylindrical surface SF7 is 0, and the difference in the direction vectors of the central axes is 0.000141.
[0132] If the geometric tolerance of the position coordinates is 1.0e-8, the geometric tolerance of the direction vector is 1.0e-10, the set error of the position coordinates set by the operator is 1.0e-3, and the set error of the direction vector is 1.0e-6, the shape correction unit 17 performs shape correction of surface SF7.
[0133] The shape correcting unit 17 corrects the geometric information of the cylindrical surface SF7 as follows. -Center axis position coordinates (0,0,0.03) -Direction vector of the central axis (0,0,1)
[0134] That is, the shape correcting unit 17 corrects the geometric information of the face SF7 so that the position coordinates and direction vector of the central axis of the face SF7 match the position coordinates (0,0,0.03) and direction vector (0,0,1) of the central axis of the face SF6. The shape correcting unit 17 also recalculates the intersection lines and points between the face SF7 and the faces adjacent to the face SF7 according to the corrected face SF7. The shape correcting unit 17 also does not correct the geometric information of the cylindrical faces SF5 and SF6.
[0135] Note that shape corrector 17 may correct the geometric information of surface SF7 so that the position coordinates and direction vector of the central axis of surface SF7 match the position coordinates (0,0,0.029) and direction vector (0,0,1) of the central axis of surface SF5.
[0136] In addition, the shape correction unit 17 determines that correction of either face SF5 or SF6 is necessary if both the position coordinate difference amount and the direction vector difference amount are equal to or greater than the geometric tolerance, and at least one of the position coordinate difference amount and the direction vector is less than the set error amount.
[0137] When correcting two of the faces SF5 to SF7, the shape correcting unit 17 corrects the geometric information of the faces SF5 and SF7 so that the position coordinates and direction vector of the central axis of the faces SF5 and SF7 match the position coordinates and direction vector of the central axis of the face SF6 adjacent to the faces SF5 and SF7. This allows the shape correcting unit 17 to reduce the amount of correction.
[0138] Fig. 12 is a flowchart showing the processing procedure of a third example of shape correction processing executed by the shape correction unit of the machining program generation device according to the embodiment. The processing in Fig. 12 corresponds to the processing in step S5 in Fig. 2. The third example of shape correction processing executed by the shape correction unit 17 is processing for correcting a plane perpendicular to the turning direction. In the third example of shape correction processing, for example, a plane included in the product shape is corrected whose normal vector is near the vector (0,0,1) or near the vector (0,0,-1).
[0139] The program coordinate setting unit 15 sets the work origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) of the normal vector of the plane included in the product shape and the position coordinates coincide with the specific direction (second direction) and the position coordinates. The first direction and the second direction here are the directions of the turning axis. In other words, the first direction and the second direction are the directions of the vector (0,0,1) or the vector (0,0,-1).
[0140] The difference detection unit 16 acquires all faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 (step S31). The difference detection unit 16 refers to the geometric information of the acquired faces and extracts planes from among the acquired faces (step S32).
[0141] The difference detection unit 16 refers to the geometric information of the acquired surface and selects, from the extracted planes, a plane whose normal vector is near the vector (0,0,1) or near the vector (0,0,-1) (step S33). Specifically, the difference detection unit 16 selects a plane whose difference between the normal vector of the acquired plane and the vector (0,0,1) or the vector (0,0,-1) is within a specific range.
[0142] The difference detection unit 16 calculates the difference between the normal vector of the selected plane and the vector (0,0,1) or vector (0,0,-1) (step S34). The difference detection unit 16 calculates the difference in the magnitude of the vector as the amount of difference between the normal vector of the selected plane and the vector (0,0,1) or vector (0,0,-1). In this way, the difference detection unit 16 finds the amount of difference indicating how much the normal vector of the selected plane deviates from the vector (0,0,1) or vector (0,0,-1).
[0143] The shape correction unit 17 determines whether or not correction of the product shape is required 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 or not correction is required by a determination method similar to the determination method in the shape correction process of the first example (the determination method in step S14).
[0144] When shape correction unit 17 determines that correction is necessary (step S35, necessary), it corrects the plane determined to require correction (step S36). If the plane requires correction, shape correction unit 17 corrects the plane so that the normal vector of the plane coincides with vector (0,0,1) or vector (0,0,-1). Shape correction unit 17 recalculates and corrects the intersection lines and points between the surface corrected in step S36 and the adjacent surfaces (step S37). When shape correction unit 17 determines that correction is unnecessary (step S35, unnecessary), it does not execute correction.
[0145] FIG. 13 is a diagram for explaining a third example of shape correction processing executed by the shape correction unit of the machining program generating device according to the embodiment. Here, the plane of a pocket formed in a product shape 83 will be explained. For example, the pocket formed in the product shape 83 includes plane faces SF8, SF9, SF11, SF13, and SF15, and faces SF10, SF12, SF14, and SF16 which are parts of a cylindrical face (hereinafter, referred to as cylindrical portion faces). Face SF8 is a plane of the bottom face of the pocket, faces SF9, SF11, SF13, and SF15 are plane faces of the pocket side faces, and faces SF10, SF12, SF14, and SF16 are cylindrical portion faces of corners of the pocket side faces. In FIG. 13, a case where face SF8 is corrected will be explained.
[0146] 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 face SF8 included in the product shape 83 coincides with the vector (0,0,1) or vector (0,0,-1), which is the direction of the turning axis. In this case, it is assumed that the geometric information of face SF8 has the following information. This geometric information is information that has been rewritten due to some factor during format conversion, for example, resulting in a deviation.
[0147] Surface SF8: Plane ·Position coordinates (0,0,0.02) Normal vector (0.0001,0.0001,0.99999999)
[0148] The difference detection unit 16 calculates the difference between the central axis of the surface SF8 and the Z-axis direction vector set in the program coordinate system. The Z-axis direction vector is the vector (0,0,1) or the vector (0,0,-1) described in FIG.
[0149] When the geometric information of surface SF8 is the above information, the difference between the Z-axis direction vector (0,0,1) which is the vector to be compared and the normal vector of surface SF8 is 0.000141. When the geometric allowable error of the direction vector is 1.0e-10 and the set error of the direction vector set by the operator is 1.0e-6, shape correction unit 17 executes shape correction of surface SF8.
[0150] The shape correcting unit 17 corrects the geometric information of the planar surface SF8 as follows. Normal vector (0,0,1)
[0151] That is, the shape correcting unit 17 corrects the geometric information of the face SF8 so that the normal vector of the face SF8 coincides with the normal vector (0,0,1) of the XY plane. Furthermore, the shape correcting unit 17 recalculates the intersection lines and points of intersection between the face SF8 and the faces adjacent to the face SF8 in accordance with the corrected face SF8.
[0152] Fig. 14 is a flowchart showing a processing procedure of a fourth example of shape correction processing executed by the shape correction unit of the machining program generation device according to the embodiment. The processing in Fig. 14 corresponds to the processing in step S5 in Fig. 2. The fourth example of shape correction processing executed by the shape correction unit 17 is processing for correcting a plane in which the angle between the normal vector of a face included in the product shape and the normal vector (0,0,1) of the XY plane is close to 90 degrees.
[0153] The program coordinate setting unit 15 sets the work origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinate of the normal vector of the surface included in the product shape coincide with a specific direction (second direction) perpendicular to the direction of the turning axis set in the program coordinate system and the position coordinate. The first direction and the second direction here are the Y-axis direction. That is, the first direction and the second direction are the direction of the vector (0,1,0) or the direction of the vector (0,-1,0). The direction of the turning axis is the Z-axis direction.
[0154] The difference detection unit 16 acquires (step S41) all faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12. The difference detection unit 16 refers to the geometric information of the acquired faces and extracts planes from among the acquired faces (step S42).
[0155] The difference detection unit 16 refers to the geometric information of the acquired surface and selects a plane perpendicular to the vicinity of the vector (0,0,1) whose normal vector is a Z-axis direction vector from among the extracted planes (step S43). Specifically, the difference detection unit 16 selects a plane whose difference between the normal vector of the acquired plane and a vector perpendicular to the vector (0,0,1) is within a specific range. The plane perpendicular to the vicinity of the vector (0,0,1) is the XY plane, and the vector perpendicular to the vector (0,0,1) is the Y-axis direction vector or the X-axis direction vector. Here, the difference detection unit 16 selects the surfaces SF9, SF11, SF13, and SF15 of the planes shown in FIG. 13.
[0156] 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). In this way, the difference detection unit 16 finds the amount of difference indicating how much the angle between the normal vector of the selected plane and the normal vector (0,0,1) of the XY plane deviates from a right angle.
[0157] The shape correction unit 17 determines whether or not correction of the product shape is necessary based on the difference between the angle between 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 or not correction is necessary by a determination method similar to the determination method in the shape correction process of the first example (the determination method in step S14).
[0158] When shape correction unit 17 determines that correction is necessary (step S45, necessary), it corrects the plane determined to require correction (step S46). When a plane requires correction, shape correction unit 17 corrects the normal vector of the plane so that the angle between the normal vector of the plane and the vector (0,0,1) becomes 90 degrees. Shape correction unit 17 recalculates and corrects the intersection lines and points of intersection between the surface corrected in step S46 and the adjacent surfaces (step S47). When shape correction unit 17 determines that correction is unnecessary (step S45, unnecessary), it does not execute correction.
[0159] A fourth example of shape correction processing executed by the shape correcting unit 17 will now be described with reference to Fig. 13. Here, a case will be described in which the shape correcting unit 17 corrects the surface SF9 that is perpendicular to the direction of the turning axis.
[0160] 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 coincides with the direction (here, the Y-axis direction) perpendicular to the axial direction of a specific axis (here, the Z-axis direction) 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 normal vector of the surface SF9 coincides with the vector (0,1,0) or the vector (0,-1,0) which is the direction perpendicular to the turning axis set in the program coordinate system. The direction of the turning axis is the Z-axis direction. In this case, it is assumed that the geometric information of the surface SF9 has the following information. This geometric information is information resulting from a shift caused by rewriting due to some factor during format conversion, for example.
[0161] Surface SF9: Plane ·Position coordinates (0.04,-0.04,0.02) Normal vector (0.0001, 0.99999999, 0.0001)
[0162] The difference detection unit 16 calculates the difference between the normal vector of the surface SF9 and a Y-axis direction vector perpendicular to the Z-axis set in the program coordinate system.
[0163] When the geometric information of surface SF9 is as described above, the difference between the normal vector of surface SF9 and the Y-axis direction vector perpendicular to the Z-axis, which is the vector to be compared, is 0.000141. When the geometric allowable error of the direction vector is 1.0e-10 and the error of the direction vector set by the operator is 1.0e-6, shape correction unit 17 executes shape correction of surface SF9.
[0164] The shape correcting unit 17 corrects the geometric information of the planar surface SF9 as follows. ·Normal vector (0,1,0)
[0165] That is, the shape correcting unit 17 corrects the geometric information of the face SF9 so that the angle between the normal vector of the face SF9 and the normal vector (0,0,1) of the XY plane becomes 90 degrees. Furthermore, the shape correcting unit 17 recalculates the intersection lines and points of intersection between the face SF9 and the faces adjacent to the face SF9 in accordance with the corrected face SF9.
[0166] In addition, when correcting the planar surface SF13, the shape correction unit 17 corrects the geometric information of surface SF13 as follows so that the angle between the normal vector of surface SF13 and the Z-axis direction vector (0,0,1), which is the normal vector of the XY plane, becomes 90 degrees. ·Normal vector (0,-1,0)
[0167] Furthermore, when correcting plane surface SF11, shape correction unit 17 corrects the geometric information as follows so that the angle between the normal vector of surface SF11 and the Z-axis direction vector (0,0,1), which is the normal vector of the XY plane, becomes 90 degrees. ·Normal vector (1,0,0)
[0168] Furthermore, when correcting plane surface SF15, shape correction unit 17 corrects the geometric information as follows so that the angle between the normal vector of surface SF15 and the Z-axis direction vector (0,0,1), which is the normal vector of the XY plane, becomes 90 degrees. ·Normal vector (-1,0,0)
[0169] The shape correction unit 17 may correct a plane inclined with respect to a specific axis direction, not limited to a plane whose normal vector coincides with a specific axis direction, such as the faces SF9, SF11, SF13, and SF15. In this case, the shape correction unit 17 corrects the inclined plane so that there is no difference between the normal vector (ideal normal vector corresponding to the design value) set on the inclined plane included in the product shape and the geometric information of the actual plane. For example, if the normal vector set on the inclined plane included in the product shape is (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).
[0170] Fig. 15 is a flowchart showing a processing procedure of a fifth example of shape correction processing executed by the shape correction unit of the machining program generation device according to the embodiment. The processing in Fig. 15 corresponds to the processing in step S5 in Fig. 2. The fifth example of shape correction processing executed by the shape correction unit 17 is processing for correcting a cylindrical partial surface in the same axial direction as the turning direction.
[0171] The program coordinate setting unit 15 sets the work origin, the program coordinate system, and the direction of the turning axis so that the direction (first direction) and position coordinate of the central axis of the cylindrical portion surface coincide with the direction (second direction) and position coordinate of the turning axis. The first direction and the second direction here are the directions of the turning axis. That is, the first direction and the second direction are the directions of the vector (0,0,1) or the vector (0,0,-1). That is, in the shape correction process of the fifth example, for example, a cylindrical portion surface whose central axis vector is in the vicinity of the vector (0,0,1) or the vector (0,0,-1) is corrected.
[0172] The difference detection unit 16 acquires all faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 (step S51). The difference detection unit 16 refers to the geometric information of the acquired faces and extracts cylindrical partial faces from among the acquired faces (step S52).
[0173] The difference detection unit 16 refers to the geometric information of the acquired faces and selects, from among the extracted cylindrical partial faces, cylindrical partial faces whose central axis vectors are near the vector (0,0,1) or near the vector (0,0,-1) (step S53). Specifically, the difference detection unit 16 selects cylindrical partial faces whose differences between the central axis vectors of the acquired cylindrical partial faces and the vector (0,0,1) or vector (0,0,-1) are within a specific range. Here, the difference detection unit 16 selects the plane faces SF10, SF12, SF14, and SF16 shown in FIG. 13.
[0174] The difference detection unit 16 calculates the difference in angle between the central axis vector of the selected cylindrical partial surface and the vector (0,0,1) or vector (0,0,-1) (step S54). In this way, the difference detection unit 16 finds the difference amount indicating how much the central axis vector of the selected cylindrical partial surface deviates from the vector (0,0,1) or vector (0,0,-1), which is the normal vector of the XY plane.
[0175] The shape correction unit 17 determines whether or not correction of the product shape is required based on the difference between the central axis vector of the selected cylindrical partial surface and the vector (0,0,1) or the vector (0,0,-1) (step S55). The shape correction unit 17 determines whether or not correction is required by a determination method similar to the determination method in the shape correction process of the first example (the determination method in step S14).
[0176] When the shape correction unit 17 determines that correction is necessary (step S55, necessary), it corrects the cylindrical surface determined to require correction (step S56). When correction is necessary for the cylindrical surface, the shape correction unit 17 corrects the central axis vector of the cylindrical surface so that the central axis vector of the cylindrical surface coincides with the vector (0,0,1) or the vector (0,0,-1). The shape correction unit 17 recalculates and corrects the intersection lines and points of intersection between the surface corrected in step S56 and the adjacent surfaces (step S57). When the shape correction unit 17 determines that correction is unnecessary (step S55, unnecessary), it does not execute the correction.
[0177] Here, a fifth example of shape correction processing executed by the shape correcting unit 17 will be described with reference to Fig. 13. Here, a case will be described in which the shape correcting unit 17 corrects a surface SF10 having a central axis parallel to the direction of the turning axis.
[0178] 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 center axis vector of the surface SF10 included in the product shape 83 coincides with the axial direction of a specific axis (here, the Z-axis direction) 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 center axis vector of the surface SF10 coincides with the vector (0,0,1) or vector (0,0,-1), which is the direction of the turning axis set in the program coordinate system. In this case, it is assumed that the geometric information of the surface SF10 has the following information. This geometric information is information resulting from a shift caused by rewriting due to some factor during format conversion, for example.
[0179] Face SF10: Cylinder part face -Center axis position coordinates (-0.03,-0.03,0.02) -Direction vector of central axis (0.0001, 0.0001, 0.999999)
[0180] The difference detection unit 16 calculates the difference between the direction vector of the central axis of the surface SF10 and the Z-axis direction vector set in the program coordinate system.
[0181] When the geometric information of surface SF10 is the above-mentioned information, the difference between the direction vector of the central axis of surface SF10 and the axial direction vector of the specific axis to be compared (here, the Z-axis vector (0,0,1)) is 0.000141. When the geometric allowable error of the direction vector is 1.0e-10 and the setting error of the direction vector set by the operator is 1.0e-6, shape correction unit 17 executes shape correction of surface SF10.
[0182] The shape correcting unit 17 corrects the geometric information of the surface SF10 of the cylindrical portion as follows. -Direction vector of the central axis (0,0,1)
[0183] That is, the shape correcting unit 17 corrects the geometric information of the surface SF10 so that the central axis vector of the surface SF10 coincides with the Z-axis direction vector (0,0,1) which is the normal vector of the XY plane. The shape correcting unit 17 also recalculates the intersection lines and points between the surface SF10 and the surfaces adjacent to the surface SF10 according to the corrected surface SF10.
[0184] Fig. 16 is a flowchart showing a processing procedure of a sixth example of shape correction processing executed by the shape correcting unit 17 of the machining program generating device according to the embodiment. The processing in Fig. 16 corresponds to the processing in step S5 in Fig. 2. The sixth example of shape correction processing executed by the shape correcting unit 17 is processing for correcting a R-chamfered surface.
[0185] The shape arrangement unit 14 arranges the product shape so that a series of R-chamfered faces 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 faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 (step S61). The difference detection unit 16 refers to the geometric information of the acquired faces and extracts R-chamfered faces from the acquired faces (step S62). The R-chamfered faces are faces consisting of a cylindrical face, a torus face, or a free-form face, and the corners of the shape are rounded by the curved face.
[0186] The difference detection unit 16 refers to the geometric information of the acquired faces and selects the R-chamfered faces whose radius values are close to the reference radius value from among the extracted R-chamfered faces (step S63). Specifically, the difference detection unit 16 selects the R-chamfered faces whose difference (radius difference) between the radius value of the acquired R-chamfered face and the reference radius value is within a specific range.
[0187] The difference detection unit 16 calculates the difference between the radius value of the selected R-chamfered surface and the reference radius value (step S64). In this manner, the difference detection unit 16 obtains a difference amount indicating how much the radius value of the selected R-chamfered surface deviates from the reference radius value.
[0188] The shape correction unit 17 determines whether or not correction of the product shape is required based on the difference between the radius value of the selected R-chamfered surface and the reference radius value (step S65). The shape correction unit 17 determines whether or not correction is required by a determination method similar to the determination method in the shape correction process of the first example (the determination method in step S14).
[0189] When the shape correction unit 17 determines that correction is necessary (step S65, necessary), it corrects the R-chamfered surface determined to require correction (step S66). When the R-chamfered surface requires correction, the shape correction unit 17 corrects the R-chamfered surface so that the radius value of the R-chamfered surface matches the reference radius value. The shape correction unit 17 recalculates and corrects the intersection lines and points between the R-chamfered surface corrected in step S66 and the adjacent surfaces (step S67). When the shape correction unit 17 determines that correction is unnecessary (step S65, unnecessary), it does not execute the correction.
[0190] FIG. 17 is a diagram for explaining a sixth example of shape correction processing executed by the shape correction unit of the machining program generating device according to the embodiment. Here, the R-chamfered surface of a pocket formed in the product shape 84 will be explained. For example, the pocket formed in the product shape 84 includes R-chamfered surfaces SF17, SF18, SF19, and SF20. The shape placement unit 14 places the product shape 84 so that the radius values of the surfaces SF17 to SF20, which are a series of R-chamfered surfaces included in the product shape 84, match the reference radius value. In this case, it is assumed that the geometric information of the surfaces SF17 to SF20 has the following information. This geometric information is information resulting from a deviation caused by rewriting due to some factor during format conversion, for example.
[0191] · Surface SF17: R chamfered surface Radius value = 2
[0192] · Surface SF18: R chamfered surface Radius value = 2.00016
[0193] · Surface SF19: R chamfered surface Radius value = 2
[0194] · Surface SF20: R chamfered surface Radius value = 2
[0195] Difference detection unit 16 calculates the difference between the radius values of surfaces SF17-SF20 and the reference radius value. When the geometric information of surfaces SF17-SF20 is the above-mentioned information and the reference radius value to be compared is 2, the difference between the radius value of surface SF18 and the reference radius value is 0.00016. When the allowable error of the radius value is 1.0e-3 and the setting error of the radius value set by the operator is 1.0e-6, shape correction unit 17 performs shape correction of surface SF18.
[0196] The shape correcting unit 17 corrects the geometric information of the R-chamfered surface SF18 as follows. Radius value = 2
[0197] That is, the shape correcting unit 17 corrects the geometric information of the face SF18 so that the radius value of the face SF18 coincides with the reference radius value. Furthermore, the shape correcting unit 17 recalculates the intersection lines and points of intersection between the face SF18 and the faces adjacent to the face SF18 in accordance with the corrected face SF18.
[0198] Fig. 18 is a flowchart showing a processing procedure of a seventh example of shape correction processing executed by the shape correcting unit 17 of the machining program generating device according to the embodiment. The processing in Fig. 18 corresponds to the processing in step S5 in Fig. 2. The seventh example of shape correction processing executed by the shape correcting unit 17 is processing for correcting a C-chamfered surface.
[0199] The shape arrangement unit 14 arranges the product shape so that a series of C-chamfered faces included in the product shape have the same C-chamfered face width as a specific value (reference width). The difference detection unit 16 acquires all faces of the product shape arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 (step S71). The difference detection unit 16 refers to the geometric information of the acquired faces and extracts C-chamfered faces from the acquired faces (step S72). The C-chamfered face is a face consisting of a plane, a cone, or a free-form surface, and the corners of the shape are beveled off by the plane.
[0200] The difference detection unit 16 refers to the geometric information of the acquired faces and selects the C-chamfered faces whose C-chamfered width is close to the reference width from among the extracted C-chamfered faces (step S73). Specifically, the difference detection unit 16 selects the C-chamfered faces whose difference (width difference) between the acquired C-chamfered width and the reference width is within a specific range. The C-chamfered width generally does not represent the width of the C-chamfered face but represents the length rounded from the corner, but may be the width of the C-chamfered face.
[0201] The difference detection unit 16 calculates the difference between the C-chamfer width of the selected C-chamfered surface and the reference width (step S74). In this manner, the difference detection unit 16 obtains a difference amount indicating how much the C-chamfer width of the selected C-chamfered surface deviates from the reference width.
[0202] The shape correction unit 17 determines whether or not correction of the product shape is required based on the difference between the C-chamfering width of the selected C-chamfering surface and the reference width (step S75). The shape correction unit 17 determines whether or not correction is required by a determination method similar to the determination method in the shape correction process of the first example (the determination method in step S14).
[0203] When the shape correction unit 17 determines that correction is necessary (step S75, necessary), it corrects the C-chamfered surface determined to require correction (step S76). When correction is necessary for the C-chamfered surface, the shape correction unit 17 corrects the C-chamfered surface so that the C-chamfered width of the C-chamfered surface matches the reference width. The shape correction unit 17 recalculates and corrects the intersection lines and points between the C-chamfered surface corrected in step S76 and the adjacent surfaces (step S77). When the shape correction unit 17 determines that correction is unnecessary (step S75, unnecessary), it does not execute the correction.
[0204] 19 is a diagram for explaining a seventh example of shape correction processing executed by the shape correction unit of the machining program generating device according to the embodiment. Here, the C-chamfered surface of a pocket formed in the product shape 85 will be explained. For example, the pocket formed in the product shape 85 includes the faces SF21, SF22, SF23, and SF24 of the C-chamfered surface. The shape placement unit 14 places the product shape 85 so that the C-chamfered width of the series of faces SF21 to SF24 included in the product shape 85 matches the reference width. In this case, it is assumed that the geometric information of the faces SF21 to SF24 has the following information. This geometric information is information resulting from a deviation caused by rewriting due to some factor during format conversion, for example.
[0205] · Surface SF21: C chamfered surface ·C chamfer width=2
[0206] · Surface SF22: C chamfered surface ·C chamfer width = 2.00016
[0207] · Surface SF23: C chamfered surface ·C chamfer width=2
[0208] · Surface SF24: C chamfered surface ·C chamfer width=2
[0209] The difference detection unit 16 calculates the difference between the C chamfer width of faces SF21 to SF24 and the reference width. When the geometric information of faces SF21 to SF24 is the above-mentioned information and the reference width to be compared is 2, the difference between the C chamfer width of face SF22 and the reference width is 0.00016. When the allowable error amount of the C chamfer width is 1.0e-3 and the set error amount of the C chamfer width set by the operator is 1.0e-6, the shape correction unit 17 executes shape correction of face SF22.
[0210] The shape correcting unit 17 corrects the geometric information of the C-chamfered surface SF22 as follows. ·C chamfer width=2
[0211] That is, the shape correcting unit 17 corrects the geometric information of the face SF22 so that the C-chamfer width of the face SF22 coincides with the reference width. In addition, the shape correcting unit 17 recalculates the intersection lines and points of intersection between the face SF22 and the faces adjacent to the face SF22 in accordance with the corrected face SF22.
[0212] Fig. 20 is a flowchart showing the procedure of an eighth example of shape correction processing executed by the numerical control device according to the embodiment. The processing in Fig. 20 corresponds to the processing in step S5 in Fig. 2. The eighth example of shape correction processing executed by the numerical control device 100 is processing for inferring a correction method, which is a first parameter, and correcting a product shape according to the inferred correction method.
[0213] In the process of inferring the first parameter, the machine learning device 20 infers the first parameter by using a learning model Mx generated based on the shape correction example Fc, with the second parameter extracted by the machining program generation device 10 as an input. That is, the machine learning device 20 infers the first parameter by inputting the second parameter to the learning model Mx.
[0214] Specifically, the shape correction unit 17 extracts second parameters of the product shape (product shape, workpiece origin, and program coordinate system) based on the product shape data arranged by the shape arrangement unit 14 and stored in the product shape memory unit 12 and the workpiece origin and program coordinate system stored by the program coordinate setting unit 15, and inputs the second parameters of the product shape to the machine learning device 20 (step S81).
[0215] Here, it is assumed that the shape correction unit 17 has specified "a lathe surface correction method of the product shape", "a step hole correction method of the product shape", "a bottom plane correction method of the product shape", "a wall surface correction method of the product shape", "a R chamfered surface correction method of the product shape", and "a C chamfered surface correction method of the product shape" as the first parameters of the inference candidates. In this case, the shape correction unit 17 acquires the material of the product shape, the dimensional values of the product shape, and the like from the product shape storage unit 12 as second parameters for inferring the first parameters. The dimensional values of the product shape are the vertical length, horizontal length, depth, and the like of the product shape. The shape correction unit 17 inputs the type of the first parameter specified as the inference candidate and the acquired second parameter to the inference unit 24 of the machine learning device 20.
[0216] The first parameter of the inference candidate may be set in advance in the shape correcting unit 17, or may be set in the shape correcting unit 17 via the instruction input unit 40 by the operator.
[0217] 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 infers the first parameter from the second parameter acquired from the shape correction unit 17 using a learning model Mx for inferring the first parameter from the second parameter. As a result, the inference unit 24 obtains a plurality of values of the first parameter, which are the inference results. The inference unit 24 transmits the plurality of values of the first parameter to the shape correction unit 17.
[0218] The shape correcting unit 17 corrects the product shape according to the acquired first parameters (step S83). Specifically, the shape correcting unit 17 corrects the product shape data arranged by the shape arrangement unit 14 and stored in the product shape storage unit 12 by the correction method of the first parameters so that there is no difference from the comparison target.
[0219] 21 is a flowchart showing the procedure of a learning model generation process executed 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, a case will be described in which 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.
[0220] The machine learning device 20 reads the pre-correction product shape data 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 the 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 may execute the process of step S91 and the process of step S92 in any order.
[0221] The shape correction unit 17 extracts a plurality of first parameters used in any of the product shape data after placement, the work origin, and the program coordinate system from the product shape data, the work origin, and the program coordinate system (step S93). The shape correction unit 17 extracts a second parameter for each of the extracted plurality of 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. The shape correction unit 17 extracts the second parameter corresponding to the first parameter based on the shape identification information. The shape correction unit 17 inputs the extracted first parameter and second parameter to the machine learning unit 22.
[0222] The machine learning unit 22 executes a machine learning process using the input first parameter and second parameter (step S95). Specifically, the machine learning unit 22 generates a data set based on the first parameter and the second parameter, and executes machine learning according to the generated data set. The data set is a set of data in which a first parameter to be adjusted is associated with a second parameter that is a parameter not to be adjusted and is used to determine the value of the first parameter. The machine learning unit 22 generates an optimized model as a learning model Mx using a predetermined criterion. In this way, the machine learning unit 22 generates a learning model Mx that is a learning result.
[0223] The learning model storage unit 23 stores the generated learning model Mx (step S96). This causes the machine learning device 20 to end the learning model generation process.
[0224] In the embodiment, the processing that results in a concave shape after processing has been described, but the shape after processing may also be convex.
[0225] In this way, the machining program generating device 10 corrects only the portions having a difference within the range desired by the operator by correcting only the portions having a difference in shape that is equal to or greater than the geometric allowable error and less than the set error amount. The range desired by the operator is the range in which the difference from the comparison target is equal to or greater than the geometric allowable error and less than the set error amount.
[0226] When the product shape data is created, various processes such as format conversion may cause the accuracy of the product shape data to deteriorate. For example, various processes on the product shape data may cause the position coordinates and axial direction vectors to not match between the product shape and the turning axis. That is, various processes such as format conversion of the product shape data may cause an error in the geometric information of each shape element included in the product shape data, and a difference that the operator cannot imagine may occur between the axis set in the geometric information of each shape element of the product shape data and the axis set in the program coordinate system of the machining program. In this case, when an attempt is made to generate a machining program corresponding to the product shape data, there may be a portion for which the machining program is not generated, or the accuracy of the machining program may deteriorate, making it impossible to make the machine tool manufacture a product with a shape as designed.
[0227] The numerical control device 100 according to the embodiment corrects the product shape data when there is a difference in shape between the comparison target, thereby preventing the accuracy of the machining program from deteriorating. As a result, the numerical control device 100 can improve the success rate of generating the machining program and the accuracy of the machining program.
[0228] Furthermore, by having the operator set the set error amount, the numerical control device 100 can correct product shape data whose difference in shape with the comparison target is within a specific range and exclude product shape data outside the specific range from the correction target. This allows the numerical control device 100 to correct product shape data whose difference in shape with the comparison target is within a range desired by the operator.
[0229] Furthermore, when there is a part of the product shape that cannot be developed into the machining program as a turning unit because the central axis of the cylindrical surface, conical surface, and toric surface of the product shape data does not match the turning axis, the numerical control device 100 corrects the central axis of the product shape data to eliminate the difference between the central axis and the turning axis. This allows the numerical control device 100 to generate a turning unit that can be developed into the machining program.
[0230] Furthermore, when there is a part of the product shape in which the central axis of a cylindrical surface, a conical surface, or a torus surface of the product shape data does not coincide with the central axis of an adjacent cylindrical surface, a conical surface, or a torus surface, and the part is not expanded into the machining program as one stepped hole machining unit, the numerical control device 100 corrects the central axis of the product shape data so as to eliminate the difference between the central axes. This allows the numerical control device 100 to generate one stepped hole machining unit that can be expanded into the machining program. In other words, even in a situation in which the central axes of the holes do not coincide due to the difference between the central axes, and the holes are expanded into separate hole machining units, the numerical control device 100 can generate one stepped hole machining unit that can be expanded into the machining program by correcting the central axis.
[0231] Furthermore, when the plane of the product shape data is not parallel to the XY plane and there is a part of the product shape that is not expanded in the machining program as a surface machining unit, the numerical control device 100 corrects the normal vector of the product shape data so as to eliminate the difference between the normal vector of the product shape data and the Z-axis direction vector. That is, when the plane of the product shape data is determined to be inclined with respect to the XY plane and is not determined as the bottom surface of the surface machining unit, the numerical control device 100 corrects the normal vector of the product shape data. This allows the numerical control device 100 to generate a surface machining unit that can be expanded in the machining program. That is, the numerical control device 100 can expand a part that is not determined as the bottom surface of the surface machining unit and is not expanded as a surface machining unit.
[0232] Furthermore, when the angle between the normal vector of the plane of the product shape data and the vector (0,0,1) is not 90 degrees and there is a part of the product shape that is not developed in the machining program as a surface machining unit, the numerical control device 100 corrects the normal vector of the product shape data so as to eliminate the difference in angle between the normal vector of the product shape data and the Z-axis direction vector. That is, when it is determined that the normal vector of the plane of the product shape data is not parallel but inclined with respect to the XY plane and is not determined as a wall surface of the surface machining unit, the numerical control device 100 corrects the normal vector of the product shape data. In other words, the numerical control device 100 can generate a surface machining unit that can be developed in the machining program. That is, the numerical control device 100 can develop a part that is not determined as a side wall surface of the surface machining unit and is not developed as a surface machining unit.
[0233] Furthermore, when the central axis of the cylindrical surface of the product shape data is not perpendicular to the XY plane and there is a part of the product shape that is not expanded in the machining program, the numerical control device 100 corrects the central axis of the product shape data so as to eliminate the difference between the central axis of the product shape data and the Z-axis direction vector. That is, when the central axis of a cylindrical surface that is perpendicular to the XY plane is not perpendicular to the XY plane due to the inclination of the cylindrical surface and is not determined as a wall surface of a surface machining unit, the numerical control device 100 corrects the central axis of the product shape data. In this way, the numerical control device 100 can generate a surface machining unit that can be expanded in the machining program. That is, the numerical control device 100 can expand a part that is not determined as a cylindrical surface of a surface machining unit and is not expanded as a surface machining unit.
[0234] Furthermore, when there is a part of the product shape where the radius value of the R-chamfered surface in the product shape data does not match the reference radius value and the R-chamfered surface is expanded into the machining program as a plurality of chamfering processing units, the numerical control device 100 corrects the radius value of the R-chamfered surface in the product shape data so as 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 part of a series of R-chamfered surfaces consisting of a plurality of surfaces does not match the reference radius value, the numerical control device 100 corrects the radius value of the R-chamfered surface that does not match the reference radius value to the reference radius value. This allows the numerical control device 100 to generate a series of R-chamfered surface processing units that can be expanded into the machining program for a series of R-chamfered surfaces consisting of a plurality of surfaces. That is, the numerical control device 100 can expand a portion that is not determined as a series of R-chamfered surfaces and is not expanded into a series of R-chamfered surface processing units.
[0235] Furthermore, when there is a part of the product shape where the C-chamfer width of the C-chamfered surface of the product shape data does not match the reference width and the C-chamfered surface is expanded into the machining program as a plurality of chamfering processing units, the numerical control device 100 corrects the C-chamfer width of the C-chamfered surface of the product shape data so as to eliminate the difference between the C-chamfer width of the product shape data and the reference width. That is, even when the radial width of a part of a series of multiple C-chamfered surfaces does not match the reference width, the numerical control device 100 corrects the radial width of the C-chamfered surface that does not match the reference width to the reference width. This allows the numerical control device 100 to generate a C-chamfered surface machining unit that can be expanded into the machining program as a series of C-chamfered surface machining units. That is, the numerical control device 100 can expand a part that is not determined as a series of C-chamfered surfaces and is not expanded into a series of C-chamfered surface machining units.
[0236] Furthermore, the numerical control device 100 can improve the accuracy of the inferred shape correction method by machine learning the shape correction data.
[0237] Next, a description will be given of a hardware configuration of the numerical control device 100. Fig. 22 is a block diagram showing a hardware configuration of the numerical control device according to the embodiment.
[0238] The numerical control device 100 shown in FIG. 22 comprises, as functional units, a processor 71, a memory 72 used by the processor 71 as a work area, a storage device 73 that stores computer programs (control programs, machining programs) that describe each function of the numerical control device 100, an input device 74 that is an input interface with an operator, a display device 75 that is an output device that displays information to the operator, and a communication device 76 that has a communication function with controlled equipment (such as a machine tool) or other numerical control devices.
[0239] The processor 71 , memory 72 , storage device 73 , input device 74 , display device 75 , and communication device 76 are connected to each other by a data bus 77 .
[0240] The processor 71 is a processing device, an arithmetic unit, a microprocessor, a microcomputer, a CPU (Central Processing Unit), a DSP (Digital Signal Processor), or the like.
[0241] The memory 72 may be a non-volatile or volatile semiconductor memory such as a RAM (Random Access Memory), a ROM (Read Only Memory), a flash memory, an EPROM (Erasable Programmable ROM), or an EEPROM (Electrically EPROM), a magnetic disk, a flexible disk, an optical disk, a compact disk, a mini disk, or a DVD (Digital Versatile Disc).
[0242] The shape input unit 11, shape placement unit 14, program coordinate setting unit 15, difference detection unit 16, shape correction unit 17, and machining program generation unit 18 of the numerical control device 100 can be realized by the processor 71 reading and executing a computer program stored in the memory 72.
[0243] Similarly, the shape correction method analysis unit 21, the machine learning unit 22, and the inference unit 24 of the machine learning device 20 can be realized by the processor 71 reading and executing a computer program stored in the memory 72.
[0244] The functions of the product shape storage unit 12, the material shape storage unit 13, and the shape placement unit 14 are realized by the storage device 73. Similarly, the function of the learning model storage unit 23 is realized by the storage device 73. In addition, the function of the program coordinate setting unit 15 to store the coordinate values of the workpiece origin and the direction vectors of each axis of the program coordinate system, and the function of the shape correction unit 17 to store shape correction data are realized by the storage device 73.
[0245] In the numerical control device 100, a plurality of processors 71 and a plurality of memories 72 may cooperate with each other to realize each function of the numerical control device 100. Also, some of the functions of the shape input unit 11, the shape arrangement unit 14, the program coordinate setting unit 15, the difference detection unit 16, the shape correction unit 17, the machining program generation unit 18, the shape correction method analysis unit 21, the machine learning unit 22, and the inference unit 24 may be implemented as electronic circuits, and the other parts may be realized using the processors 71 and the memories 72.
[0246] The processor 71 and memory 72 for realizing the machining program generating device 10 may be the same as the processor 71 and memory 72 for realizing the machine learning device 20, or may be a processor 71 and memory 72 different from the processor 71 and memory 72 for realizing the machine learning device 20. That is, the processor 71 and memory 72 for realizing the functions of the shape input unit 11, the shape arrangement unit 14, the program coordinate setting unit 15, the difference detection unit 16, the shape correction unit 17, and the machining program generating unit 18 may be the same as or different from the processor 71 and memory 72 for realizing the shape correction method analysis unit 21, the machine learning unit 22, and the inference unit 24. The hardware configuration of the machining program generating device 10 or the machine learning device 20 may be the hardware configuration of FIG. 22.
[0247] In this way, the numerical control device 100 of the embodiment corrects the product shape data so that the difference between the position coordinates and direction of the placed product shape and the coordinates and direction of the program coordinate system falls within a specific range when the difference is not within the specific range, thereby preventing the accuracy of the machining program from deteriorating. Therefore, the numerical control device 100 can cause the machine tool to manufacture a product with a shape desired by the operator.
[0248] The configurations shown in the above embodiments are merely examples, and may be combined with other known technologies. Parts of the configurations may be omitted or modified without departing from the spirit of the invention. [Explanation of symbols]
[0249] 10 machining program generating device, 11 shape input unit, 12 product shape memory unit, 13 material shape memory unit, 14 shape placement unit, 15 program coordinate setting unit, 16 difference detection unit, 17 shape correction unit, 18 machining program generating unit, 20 machine learning device, 21 shape correction method analysis unit, 22 machine learning unit, 23 learning model memory unit, 24 inference unit, 30 dialogue operation processing unit, 40 instruction 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 to 85 product shape, 100 numerical control device, 101 product shape data, 102 material shape data, 103 placement data, 201 machining shape data, AX1 to AX3 program coordinate system, Fc shape correction example, Fd shape data, Mx learning model, PM machining program, SA1 Product shape, SB2, Sx1 material shape, SC3 arrangement shape, SF4~SF24 surface, SH1 turning hole machining shape, SH2, SH3, SH5~SH7 turning shape, SH4, SH16 hole machining shape, SH8~SH15 surface machining shape.
Claims
1. A control device that takes in product shape data representing a product shape to generate a machining program and controls a machine tool using the generated machining program, a coordinate setting unit that sets the program coordinate system so that a first direction set in the product shape data and a second direction set in the program coordinate system coincide with each other; a difference detection unit that detects a difference between the coordinates and the first direction of the placed product shape and the coordinates and the second direction of the program coordinate system; a shape correction unit that corrects the product shape data when the difference is not within a specific range equal to or greater than a geometric allowable error, which is a geometrically allowable error amount, so that the difference falls within the specific range; Equipped with A control device characterized by:
2. The specific range is less than a set error amount, which is an error amount set by an operator.
2. The control device according to claim 1.
3. the first direction is a direction of a central axis of a cylindrical surface, a conical surface, or a torus surface included in the product shape; the second direction is the direction of the turning axis set in the program coordinate system, When the difference is not within the specific range, the shape correction unit corrects the central axis so that the difference is within the specific range.
3. The control device according to claim 1 or 2.
4. a shape placement unit that places the product shape in a specific coordinate system; the first direction is a direction of each central axis of a stepped hole that is a hole with a step included in the product shape, the shape placement unit places the product shape so that the central axes coincide with each other; the difference detection unit detects an axial difference that is a difference between central axes of adjacent hole surfaces of the stepped hole, the shape correction unit corrects the central axes when the axis difference is not within the specific range so that the axis difference is within the specific range.
3. The control device according to claim 1 or 2.
5. the first direction is a direction of a normal vector of a plane included in the product shape, the shape correction unit corrects the normal vector when the difference is not within the specific range so that the difference is within the specific range.
3. The control device according to claim 1 or 2.
6. the first direction is a direction of a central axis vector of a cylindrical partial surface that is a part of a cylindrical surface included 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 vector when the difference is not within the specific range so that the difference is within the specific range.
3. The control device according to claim 1 or 2.
7. a shape placement unit that places the product shape in a specific coordinate system; the shape placement unit places the product shape so that a radius value of the R-chamfered surface included in the product shape matches a reference radius value, the difference detection unit detects a radius difference that is a difference between a radius value of the R-chamfered surface and the reference radius value; the shape correction unit corrects the radius value of the R-chamfered surface when the radius difference is not within the specific range so that the radius difference is within the specific range.
3. The control device according to claim 1 or 2.
8. a shape placement unit that places the product shape in a specific coordinate system; the shape placement unit places the product shape so that a C-chamfer width of a C-chamfered surface included in the product shape coincides with a reference width that is a reference C-chamfer width; the difference detection unit detects a width difference that is a difference between a C-chamfering width of the C-chamfered surface and the reference width, the shape correction unit corrects a C-chamfer width of the C-chamfered surface when the width difference is not within the specific range so that the width difference is within the specific range.
3. The control device according to claim 1 or 2.
9. a shape correction method analysis unit that extracts, from the corrected product shape data, first parameters that correspond to a shape correction method and are to be adjusted, and extracts, from the pre-correction product shape data, second parameters that are used to adjust the first parameters and are not to be adjusted; a machine learning unit that generates a learning model for inferring the first parameter from the second parameter by learning using a data set including the first parameter and the second parameter; an inference unit that infers the first parameter from the second parameter using the learning model; Furthermore, the shape correction unit corrects the product shape data using the first parameter inferred by the inference unit.
3. The control device according to claim 1 or 2.
10. The difference is a difference that occurs due to format conversion when the product shape data is created.
3. The control device according to claim 1 or 2.
11. A control method for generating a machining program by importing product shape data representing a product shape, and controlling a machine tool using the generated machining program, comprising: a coordinate setting step in which the control device sets the program coordinate system so that a first direction set in the product shape data and a second direction set in the program coordinate system coincide with each other; a difference detection step in which the control device detects a difference between the coordinates and the first direction of the placed product shape and the coordinates and the second direction of the program coordinate system; a shape correction step in which, when the difference is not within a specific range equal to or greater than a geometric allowable error, the control device corrects the product shape data so that the difference falls within the specific range; Including, A control method comprising: