Optimization device

To optimize NC program cores included in a generated machining program and expedite operation of a machine tool. An optimization device includes a block analysis unit, a code processing unit, and a program generation unit. The block analysis unit analyzes a preparatory function code and/or an auxiliary function code for each of a plurality of blocks included in a first program. The code processing unit performs a process on the preparatory function code and/or the auxiliary function code in a plurality of successive blocks based on a result of the analysis by the block analysis unit and optimizes the first program. The program generation unit generates the first program optimized by the code processing unit as a second program.

This application is based on and claims the benefit of priority from Japanese Patent Application No. 2019-192896, filed on 23 Oct. 2019, the content of which is incorporated herein by reference.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an optimization device.

Related Art

Machining programs are, for example, generated by a CAD/CAM device or an operator or the like of a machine tool. Most of NC program codes such as preparatory functions (G functions) and auxiliary functions (M functions) by NC program codes included in machining programs are standardized by standards such as JIS B6314.

Aside from standards such as JIS B6314, however, machine tool builders have devised their own unique NC program codes for various additional functions including G functions and M functions for improving functions of machine tools and the like.

In this regard, a known technique is to refer to a conversion table storing the association between such unique NC program codes and other NC program codes specifying the same functions as the unique NC program codes, and upon an input of an NC program code according to different specifications, execute a machining program by translating the inputted NC program code into a corresponding unique code. See, for example, Patent Document 1.

SUMMARY OF THE INVENTION

Machining programs for various machine tools are generated by a postprocessor of a CAD/CAM device. However, the machining programs are generated with an emphasis on reliable operation, and can therefore involve duplication of NC program codes and insertion of an NC program code being a G function (also referred to below as “G code”) and an NC program code being an M function (also referred to below as “M code”) that are not necessarily required. Furthermore, the processing time is not necessarily considered in determining the order of processes. This disadvantageously makes operation of the machine tools slow and the cycle time longer. It is to be noted that machining programs created by an operator, particularly by an operator unfamiliar with machining programs, also involve similar problems.

It is therefore desired to optimize NC program codes included in a generated machining program and expedite operation of a machine tool.

An optimization device according to an aspect of the present disclosure includes: a block analysis unit configured to analyze a preparatory function code and/or an auxiliary function code for each of a plurality of blocks included in a first program; a code processing unit configured to perform a process on the preparatory function code and/or the auxiliary function code in a plurality of successive blocks based on a result of the analysis by the block analysis unit and optimize the first program; and a program generation unit configured to generate the first program optimized by the code processing unit as a second program.

According to one embodiment, it is possible to optimize NC program codes included in a generated machining program and to expedite operation of a machine tool.

DETAILED DESCRIPTION OF THE INVENTION

The following first describes an overview of the present embodiment. An optimization device according to the present embodiment analyzes a preparatory function code and/or an auxiliary function code for each of blocks included in a first program. The optimization device performs an optimization process for reducing the processing time on the preparatory function code and/or the auxiliary function code in a plurality of successive blocks based on a result of the analysis, optimizes the first program, and generates the optimized first program as a second program.

Thus, according to the present embodiment, it is possible to address the problem of “optimizing NC program codes included in a generated machining program and expediting operation of a machine tool”.

Through the above, an overview of the present embodiment has been described.

The following then describes a constitution of the present embodiment in detail with reference to the drawings.

FIG. 1is a functional block diagram illustrating a functional constitution example of a control system according to one embodiment. As illustrated inFIG. 1, a control system1includes a numerical controller10and a machine tool20.

The numerical controller10and the machine tool20may be connected to each other directly via connection interfaces, not shown. Alternatively, the numerical controller10and the machine tool20may be connected to each other via a network, not shown, such as a local area network (LAN) or the Internet. In this case, the numerical controller10and the machine tool20each include a communication unit, not shown, for communication therebetween using the above-described connection. It is to be noted that the machine tool20may include the numerical controller10as described below.

The numerical controller10is a numerical controller known to those skilled in the art, and generates an operation command based on control information and sends the generated operation command to the machine tool20. Thus, the numerical controller10controls operation of the machine tool20. In a case where the machine tool20is a robot or the like, the numerical controller10may be, for example, a robot controller or the like.

Furthermore, the control target of the numerical controller10is not limited to the machine tool20or a robot. The numerical controller10is widely applicable to industrial machines in general. Examples of industrial machines include various machines and tools such as machine tools, industrial robots, service robots, forging machines, and injection molding machines.

As illustrated inFIG. 1, the numerical controller10has a control unit100and a storage unit200. In order for the numerical controller10to operate as an optimization device, the control unit100has an optimization unit110and a program execution unit120. Furthermore, the optimization unit110has a block analysis unit111, a code processing unit112, an information output unit113, and an NC program generation unit114. Furthermore, the code processing unit112has a deletion processing unit1121, a first integration processing unit1122, a second integration processing unit1123, a block rearrangement processing unit1124, a coordinate rearrangement processing unit1125, and a replacement processing unit1126.

The storage unit200is, for example, random access memory (RAM) or a hard disk drive (HDD). The storage unit200stores a source program210and an object program220therein.

The source program210is an unoptimized machining program generated by and acquired from an external device such as a CAD/CAM device or an operator or the like of the machine tool20.

The object program220is an optimized machining program, which is the source program210processed by the code processing unit112described below and generated by the NC program generation unit114described below.

The control unit100includes a central processing unit (CPU), read-only memory (ROM), RAM, complementary metal-oxide semiconductor (CMOS) memory, and the like known to those skilled in the art, which are configured to communicate with one another via a bus.

The CPU is a processor that performs overall control of the numerical controller10. The CPU reads out a system program and an application program stored in the ROM via the bus, and performs overall control of the numerical controller10in accordance with the system program and the application program. Thus, the control unit100is configured to implement functions of the block analysis unit111, the code processing unit112, the information output unit113, and the NC program generation unit114as illustrated inFIG. 1. Various data such as temporary calculation data and display data are stored in the RAM. The CMOS memory is backed up using a battery, not shown, and is non-volatile memory that retains stored information even after the numerical controller10has been turned off.

The block analysis unit111acquires, for example, a machining program generated by the external device such as a CAD/CAM device and/or the operator as the source program210from the storage unit200. The block analysis unit111analyzes a preparatory function code (G code) and/or an auxiliary function code (M code) for each of blocks included in the acquired source program210.

It is to be noted that the source program210is, for example, based on a standard such as JIS B6315-1 or JIS B6315-2.

The code processing unit112performs an optimization process on a predetermined preparatory function code and/or a predetermined auxiliary function code in a plurality of successive blocks of the source program210based on a result of the analysis by the block analysis unit111and optimizes the source program210.

The deletion processing unit1121determines a duplication of a preparatory function code, which is unnecessary, in a plurality of successive blocks if the preparatory function code in one block is not a code that only affects the one block, and the preparatory function code in the one block is the same as a preparatory function code in any other block adjacent to the one block. The deletion processing unit1121deletes the preparatory function code from every block other than the first block among the plurality of successive blocks to have the preparatory function code.

FIGS. 2A and 2Billustrate an example of the source program210for describing a deletion process that is performed by the deletion processing unit1121.

The source program210inFIG. 2Afirst causes a tool (not shown) in the machine tool20to move from the current tool position by “−10” in an X axis direction and “+10” in a Y axis direction at a speed “F350” through linear interpolation. Next, the source program210causes the tool (not shown) in the machine tool20to move from the post-move position by “−10” in the X axis direction and “−10” in the Y axis direction at a speed “F350” through linear interpolation. Lastly, the source program210causes the tool (not shown) in the machine tool20to move from the post-move position by “+10” in the X axis direction and “+10” in the Y axis direction at a speed “F350” through linear interpolation.

It is to be noted that preparatory function codes “G91” and “G01” are codes of modal groups, and therefore remain in effect once set until the setting thereof is changed or canceled. Accordingly, as illustrated inFIG. 2B, the deletion processing unit1121deletes the codes “G91” and “G01” from every block other than the first block in the source program210inFIG. 2A. This optimizes the source program210, reducing processing by the numerical controller10and shortening the execution time in execution of the object program220.

The first integration processing unit1122integrates a plurality of blocks among a plurality of successive blocks in a case where a preparatory function code in one block is not a code that only affects the one block, and the preparatory function code in the one block is a member of a modal group differing from that of a preparatory function code in any other block adjacent to the one block.

The second integration processing unit1123integrates a plurality of blocks among a plurality of successive blocks in a case where a preparatory function code in one block is not a code that only affects the one block, the preparatory function code in the one block is a member of a modal group differing from that of a preparatory function code in any other block adjacent to the one block, and an auxiliary function code included in the block adjacent to the one block does not have to independently give a command to the block adjacent to the one block and is not a conflicting operation.

FIGS. 3A and 3Billustrate an example of the source program210for describing a block integration process that is performed by the second integration processing unit1123.

The source program210illustrated inFIG. 3Aexecutes a tool change command “M6” in a block in the third line and executes a positioning command “G00” in a block in the fourth line. Here, the positioning command “G00” is not a code that only affects the block in the fourth line and is a member of a modal group differing from that of a cancel tool length offset command “G49” in the block in the adjacent third line. Furthermore, the tool change command “M6” does not have to independently give a command to other block and is not a conflicting operation. Accordingly, as illustrated inFIG. 3B, the second integration processing unit1123integrates the tool change command “M6” in the block in the third line and the positioning command “G00” in the block in the fourth line. This optimizes the source program210, allowing the tool change command “M6” and the positioning command “G00” to be simultaneously executed, and reducing the cycle time.

FIGS. 4A and 4Billustrate an example of the source program210for describing the block integration process that is performed by the second integration processing unit1123.

The source program210illustrated inFIG. 4Aexecutes a tool length offset command “G43” in a block in the second line and executes a spindle rotation command “M3” in a block in the third line. Here, the tool length offset command “G43” is not a code that only affects the block in the second line and is a member of a modal group differing from that of the cancel tool length offset command “G49” or any other code in a block in the adjacent first line. Furthermore, the spindle rotation command “M3” does not have to independently give a command to other block and is not a conflicting operation. Accordingly, as illustrated inFIG. 4B, the second integration processing unit1123integrates the tool length offset command “G43” in the block in the second line and the spindle rotation command “M3” in the block in the third line. This optimizes the source program210, allowing the tool length offset command “G43” and the spindle rotation command “M3” to be simultaneously executed, and reducing the influence of the processing time of the auxiliary function code on the cycle time.

The block rearrangement processing unit1124rearranges the order of a plurality of successive blocks in a case where an auxiliary function code in one block is not an operation conflicting with a preparatory function code or an auxiliary function code included in a block preceding the one block.

FIGS. 5A and 5Billustrate an example of the source program210for describing a rearrangement process that is performed by the block rearrangement processing unit1124.

The source program210illustrated inFIG. 5Afirst executes the positioning command “G00”, executes a coolant ejection command “M08”, and then executes a linear interpolation movement command “G01”. Here, the coolant ejection command “M08” is not an operation conflicting with the positioning command “G00” or the linear interpolation movement command “G01”, which are preparatory function codes. Accordingly, as illustrated inFIG. 5B, the block rearrangement processing unit1124interchanges the coolant ejection command “M08” and the positioning command “G01” in the block in the first line. This optimizes the source program210, reducing the execution time.

When the coolant ejection command “M08” is executed, there is a lag time before the coolant is actually ejected. The block rearrangement processing unit1124can therefore move the coolant ejection command “M08” from the block immediately before the linear interpolation movement command “G01” in the block in the third line to a block before the line having the positioning command “G00” to cause the machine tool20to perform a machining operation after it has been confirmed that the coolant is being ejected.

The coordinate rearrangement processing unit1125rearranges a plurality of coordinate values specified by dimension words included among a plurality of successive blocks to minimize the moving distance between the coordinate values or the total moving time in a case where a preparatory function code in the first block among the plurality of successive blocks is a fixed cycle preparatory function code, and a preparatory function code in the last block among the plurality of successive blocks is a preparatory function code of cancellation of the fixed cycle corresponding to the preparatory function code in the first block.

FIGS. 6A and 6B, andFIGS. 7A and 7Billustrate an example of the source program210for describing a rearrangement process that is performed by the coordinate rearrangement processing unit1125.

The source program210inFIG. 6Ahas a drilling cycle, spot boring cycle command “G81”, which is a fixed cycle preparatory function code, in the first block, and a cancel fixed cycle command “G80” corresponding to the “G81”, in the fourth block. Accordingly, as illustrated inFIG. 6B, the source program210causes a tool (not shown) such as a drill in the machine tool20to move in the order of a commanded position A to a commanded position D based on coordinate values specified by dimension words included between the blocks in the first and fourth lines.

However, according to a route illustrated inFIG. 6B, the tool (not shown) in the machine tool20has to move an unnecessarily long distance, and the cycle time is long. The coordinate rearrangement processing unit1125therefore optimizes the order of the move from the commanded position A to the commanded position D to minimize the moving distance or the total moving time by, for example, taking the commanded positions A through D as nodes in the traveling salesman problem.

It is to be noted that the traveling salesman problem is a known method and detailed description thereof will be omitted. Furthermore, the method for optimizing the moving order to minimize the moving distance and the total moving time is not limited to the traveling salesman problem, and any other known method may be employed.

FIG. 7Aillustrates an example of the source program210after the rearrangement process.FIG. 7Billustrates an example of a route of the tool (not shown) in the machine tool according to the source program210illustrated inFIG. 7A.

As illustrated inFIG. 7A, the coordinate values in the blocks in the second and third lines in the source program210are interchanged compared to the source program210inFIG. 6A. As a result, as illustrated inFIG. 7B, the tool (not shown) such as a drill in the machine tool20moves in the order of the commanded position A, the commanded position C, the commanded position B, and the commanded position D. This reduces the cumulative moving distance of the tool (not shown) in the machine tool20, shortening the cycle time.

It is to be noted that where the distance between the commanded positions is taken as a cost and the moving distance is taken as an evaluation function based on the traveling salesman problem, the evaluation function of the route illustrated inFIG. 6Bis “48” and the evaluation function of the route illustrated inFIG. 7Bis “40”. That is, the route illustrated inFIG. 7Bis the shortest.

The replacement processing unit1126replaces a plurality of successive blocks with a combination of preparatory function codes from a fixed cycle preparatory function code to an interpolation preparatory function code in a case where a preparatory function code in the first block among the plurality of successive blocks is a fixed cycle preparatory function code, and a preparatory function code in the last block among the plurality of successive blocks is a preparatory function codes of cancellation of the fixed cycle corresponding to the preparatory function code in the first block.

FIGS. 8A and 8Billustrate an example of the source program210for describing a replacement process that is performed by the replacement processing unit1126.

The source program210inFIG. 8Ahas the drilling cycle, spot boring cycle command “G81”, which is a fixed cycle preparatory function code, in the first block, and the cancel fixed cycle command “G80” corresponding to the “G81”, in the second block. In this case, as illustrated inFIG. 8B, the replacement processing unit1126replaces the fixed cycle preparatory function codes such as the drilling, spot boring cycle command “G81” with various interpolation preparatory function codes such as the positioning command “G00” and the linear interpolation movement command “G01”. Replacing fixed cycle preparatory function codes with various interpolation preparatory function codes as described above enables shortening of the execution time.

The information output unit113outputs information indicating the content of the process performed by the code processing unit112to a block immediately before or after a block including a preparatory function code or an auxiliary function code optimized by the code processing unit112. The information output unit113outputs the source program210having the outputted information to the NC program generation unit114.

It is to be noted that the information output unit113may output the information indicating the content of the process performed by the code processing unit112to a display unit (not shown) such as a liquid crystal display included in the numerical controller10. The display unit (not shown) may then display the content of the process performed by the code processing unit112. This enables an operator of the numerical controller10to know what process has been performed on the source program210.

Additionally, the information output unit113may calculate an estimated value of the execution time of the object program220based on the content of the process performed by the code processing unit112and output the estimated value to the display unit (not shown). The display unit (not shown) may then display the estimated value calculated by the information output unit113. This enables the operator of the numerical controller10to know how much the execution time is to be shortened by the optimization process performed on the source program210.

The NC program generation unit114generates the source program210optimized by the code processing unit112as the object program220.

Specifically, the NC program generation unit114generates the object program220from the source program210processed by the code processing unit112. The NC program generation unit114then stores the generated object program220in the storage unit200.

It is to be noted that the NC program generation unit114may generate the object program220separately from the source program210or may generate the object program220to replace the source program210.

The program execution unit120reads the object program220generated by the NC program generation unit114out of the storage unit200and executes the object program220. The program execution unit120generates an operation command based on the object program220and sends the generated operation command to the machine tool20to control operation of the machine tool20.

<Optimization Process by Numerical Controller10>

The following describes operation related to the optimization process that is performed by the numerical controller10according to the present embodiment.

FIGS. 9 to 13are flowcharts for describing the optimization process that is performed by the numerical controller10. The flows shown herein are repeated every time a new source program210is acquired.

At step S11inFIG. 9, the block analysis unit111determines whether or not one block of the source program210includes an auxiliary function code. If an auxiliary function code is included, the process advances to step S12. If no auxiliary function code is included, the process advances to step S13.

At step S12, the block analysis unit111determines whether or not the one block of the source program210includes a preparatory function code. If a preparatory function code is included, the process advances to step S41inFIG. 12. If no preparatory function code is included, the process advances to step S31inFIG. 11.

At step S13, the block analysis unit111determines whether or not the one block of the source program210includes a preparatory function code. If a preparatory function code is included, the process advances to step S14. If no preparatory function code is included, the process advances to step S15.

At step S14, the deletion processing unit1121determines whether or not the preparatory function code in the one block determined at step S13is effective only in the one block. If the preparatory function code is effective only in the one block, the process advances to step S15. If the preparatory function code is not a code that is effective only in the one block, that is, if the preparatory function code is effective also in another block, the process advances to step S21inFIG. 10.

At step S15, the code processing unit112generates a processed command code. Then, the numerical controller10ends the optimization process.

At step S21inFIG. 10, the deletion processing unit1121determines whether or not the preparatory function code in the one block determined at step S14inFIG. 9is the same as a preparatory function code in a block preceding the one block. If the preparatory function code is the same as that in the preceding block, the process advances to step S22. If the preparatory function code differs from that in the preceding block, the process advances to step S23.

At step S22, the deletion processing unit1121deletes the preparatory function code in every block other than the first block to have the preparatory function code in the same manner as inFIG. 2B.

At step S23, the second integration processing unit1123determines whether or not the preparatory function code in the one block determined at step S21includes a member of the same modal group as the preparatory function code in the preceding block. If the preparatory function code is a member of the same modal group as the preparatory function code in the preceding block, the process advances to step S29. If the preparatory function code is a member of a different modal group from the preparatory function code in the preceding block, the process advances to step S24.

At step S24, the coordinate rearrangement processing unit1125determines whether or not the one block determined at step S23includes a fixed cycle preparatory function code. If a fixed cycle preparatory function code is included, the process advances to step S25. If no fixed cycle preparatory function code is included, the process advances to step S51inFIG. 13.

At step S25, the coordinate rearrangement processing unit1125reads from the one block determined at step S24up to a block including a preparatory function code of cancellation of the fixed cycle corresponding to the preparatory function code in the one block while saving coordinate values (addresses) of commanded positions in blocks succeeding the one block determined at step S24.

At step S26, the coordinate rearrangement processing unit1125rearranges the moving order by solving the traveling salesman problem with respect to the coordinate values of the commanded positions saved at step S25, taking the moving distance between the commanded positions or the moving time as an evaluation function.

At step S27, the replacement processing unit1126replaces the fixed cycle preparatory function codes with a combination of various interpolation preparatory function codes including the positioning command “G00”, the linear interpolation movement command “G01”, a clockwise circular interpolation “G02”, and a counter-clockwise circular interpolation “G03”.

At step S28, the information output unit113generates a character string (information) indicating the content of the process performed by the code processing unit112and outputs the generated character string to a block immediately before or after the block including the preparatory function code processed at step S26or S27.

At step S29, the code processing unit112generates the processed command code. Then, the numerical controller10ends the optimization process.

At step S31inFIG. 11, the block rearrangement processing unit1124determines whether or not the auxiliary function code in the one block determined at step S12inFIG. 1is inexecutable simultaneously with a preparatory function code. If the auxiliary function code is inexecutable simultaneously with the preparatory function code in the preceding block, the process advances to step S32. If the auxiliary function code is executable simultaneously with the preparatory function code in the preceding block, the process advances to step S35.

At step S32, the block rearrangement processing unit1124determines whether or not the auxiliary function code does not affect an operation of the preparatory function code. If the auxiliary function code does not affect the operation of the preparatory function code, the process advances to step S33. If the auxiliary function code affects the operation of the preparatory function code, the process advances to step S38.

At step S33, the block rearrangement processing unit1124moves the one block including the auxiliary function code ahead of the preceding block in the same manner as inFIG. 5B.

At step S34, the information output unit113generates a character string indicating the content of the process performed by the code processing unit112and outputs the generated character string to a block immediately before or after the one block including the auxiliary function code processed at step S33.

At step S35, the second integration processing unit1123determines whether or not the preceding block does not include an auxiliary function code inexecutable simultaneously. If the preceding block does not include an auxiliary function code inexecutable simultaneously with the auxiliary function code in the one block, the process advances to step S36. If the preceding block includes an auxiliary function code inexecutable simultaneously with the auxiliary function code in the one block, the process advances to step S38.

At step S36, the second integration processing unit1123integrates the auxiliary function code with the preceding block in the same manner as inFIGS. 3B and 4B.

At step S37, the information output unit113generates a character string indicating a result of the process and outputs the generated character string to a block immediately before or after the block including the auxiliary function code processed at step S36.

At step S38, the code processing unit112generates the processed command code. Then, the numerical controller10ends the optimization process.

At step S41inFIG. 12, the second integration processing unit1123determines whether or not the one block determined at step S12inFIG. 9includes a preparatory function code of the same modal group in the preceding block. If the preparatory function code is a member of the same modal group as the preparatory function code in the preceding block, the process advances to step S45. If the preparatory function code is not a member of the same modal group as the preparatory function code in the preceding block, the process advances to step S42.

At step S42, the second integration processing unit1123determines whether or not the preceding block does not include an auxiliary function code inexecutable simultaneously. If the preceding block does not include an auxiliary function code inexecutable simultaneously with the auxiliary function code in the one block, the process advances to step S43. If the preceding block includes an auxiliary function code inexecutable simultaneously with the auxiliary function code in the one block, the process advances to step S45.

At step S43, the second integration processing unit1123integrates the preparatory function code and the auxiliary function code with the preceding block.

At step S44, the information output unit113generates a character string indicating the content of the process performed by the code processing unit112and outputs the generated character string to a block immediately before or after the block including the preparatory function code and/or the auxiliary function code processed at step S43.

At step S45, the code processing unit112generates the processed command code. Then, the numerical controller10ends the optimization process.

At step S51inFIG. 13, the first integration processing unit1122determines whether or not the preceding block does not include an auxiliary function code inexecutable simultaneously with the preparatory function code in the one block. If the preceding block does not include an auxiliary function code inexecutable simultaneously with the preparatory function code in the one block, the process advances to step S52. If the preceding block includes an auxiliary function code inexecutable simultaneously with the preparatory function code in the one block, the process advances to step S54.

At step S52, the first integration processing unit1122integrates the preparatory function code with the preceding block.

At step S53, the information output unit113generates a character string indicating the content of the process performed by the code processing unit112and outputs the generated character string to a block immediately before or after the block including the preparatory function code processed at step S52.

At step S54, the code processing unit112generates the processed command code. Then, the numerical controller10ends the optimization process.

As described above, the numerical controller10according to the present embodiment performs the deletion process, the integration process, the block rearrangement process, the coordinate rearrangement process, and the replacement process depending on the command content and arrangement of preparatory function codes and auxiliary function codes in the blocks of the source program210. This enables the numerical controller10to optimize NC program codes included in a generated machining program and expedite operation of the machine tool20. Consequently, the cycle time is shortened.

One embodiment has been described above. However, the numerical controller10is not limited to the embodiment described above, and changes such as modifications and improvements to the extent that the objective of the numerical controller10is achieved are encompassed by the numerical controller10.

Modification Example 1

The embodiment has been described above using an example in which the numerical controller10is a different device from the machine tool20. However, some or all of the functions of the numerical controller10may be included in the machine tool20.

Furthermore, some or all of the functions of the optimization unit110of the numerical controller10may be implemented as an optimization device through an information processing device such as a computer device.

Alternatively, some or all of the block analysis unit111, the deletion processing unit1121, the first integration processing unit1122, the second integration processing unit1123, the block rearrangement processing unit1124, the coordinate rearrangement processing unit1125, the replacement processing unit1126, the program execution unit120, and the storage unit200of the numerical controller10may be, for example, included in a server. Furthermore, each of the functions of the numerical controller10may be implemented using, for example, a virtual server function on a cloud.

Furthermore, the numerical controller10may be a distributed processing system in which the functions of the numerical controller10are distributed among a plurality of servers as appropriate.

Modification Example 2

The embodiment has been described above using an example in which the information output unit113outputs information indicating the content of the process performed by the code processing unit112to a block immediately before or after a block including a preparatory function code or an auxiliary function code processed by the code processing unit112. However, the information output unit113is not limited as such. For example, the information output unit113may output the information indicating the content of the process performed by the code processing unit112to a display unit (not shown) included in the numerical controller10. The display unit (not shown) may then display the content of the process performed by the code processing unit112. This enables the operator of the numerical controller10to know what process has been performed on the source program210.

Additionally, the information output unit113may calculate an estimated value of the execution time of the object program220based on the content of the process performed by the code processing unit112and output the estimated value to the display unit (not shown). The display unit (not shown) may then display the estimated value calculated by the information output unit113. This enables the operator of the numerical controller10to know how much the execution time is to be shortened by the optimization process performed on the source program210.

Modification Example 3

The embodiment has been described above using an example in which the numerical controller10generates the object program220corresponding to a single machine tool20. However, the numerical controller10is not limited as such. For example, as illustrated inFIG. 14, the numerical controller10may generate the object program220for each of m machine tools20A(1) to20A(m) (m is an integer equal to or greater than two) connected to a network50. The numerical controller10may then provide a numerical controller (not shown) included in each of the machine tools20A(1) to20A(m) with the corresponding object program220so that the object program220is executed therein. It is to be noted that the machine tools20A(1) to20A(m) may be of the same type (version) or of different types (versions).

In a case where the machine tools20A(1) to20A(m) are of different types (versions), however, the numerical controller10may prestore, in the storage unit200, a plurality of optimizers corresponding to the types (versions) of the machine tools20A(1) to20A(m). Furthermore, the numerical controller10may prestore, in the storage unit200, an optimizer table storing the association between the types (versions) of the machine tool20A(1) to20A(m) and the optimizers. This enables the numerical controller10to generate the object programs220optimized according to the respective types (versions) of the machine tools20A(1) to20A(m).

It is to be noted that each of the machine tools20A(1) to20A(m) is equivalent to the machine tool20illustrated inFIG. 1. Hereinafter, the machine tools20A(1) to20A(m) may be referred to also as “machine tool20A” when it is not necessary to distinguish the machine tools20A(1) to20A(m) from one another.

Alternatively, instead of the optimizer table, the numerical controller10may display a human-machine interface300on the display unit (not shown) of the numerical controller10as illustrated inFIG. 15. In this case, the numerical controller10may cause the operator to select the version (type) of the machine tool20A in which the source program210is to be executed, on the human-machine interface300through an input unit (not shown) such as a touch panel included in the numerical controller10.

FIG. 15illustrates an example of the human-machine interface300.

As illustrated inFIG. 15, the human-machine interface300has a selection display region310for displaying the version of the machine tool20A, a display region320for displaying the process corresponding to the selected version, and a display region330for displaying an additional process corresponding to the selected version.

This enables the operator of the numerical controller10to easily know what process is to be performed in the optimization process on the source program210by selecting the version of the machine tool20A.

It is to be noted that each of the functions of the numerical controller10according to the embodiment described above can be implemented by hardware, software, or a combination thereof. Being implemented by software herein means being implemented through a computer reading and executing a program.

The program can be supplied to the computer by being stored on any of various types of non-transitory computer readable media. The non-transitory computer readable media include various types of tangible storage media. Examples of the non-transitory computer readable media include magnetic storage media (such as flexible disks, magnetic tape, and hard disk drives), magneto-optical storage media (such as magneto-optical disks), compact disc read only memory (CD-ROM), compact disc recordable (CD-R), compact disc rewritable (CD-R/W), and semiconductor memory (such as mask ROM, programmable ROM (PROM), erasable PROM (EPROM), flash ROM, and RAM). Alternatively, the program may be supplied to the computer using any of various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. Such transitory computer readable media are able to supply the program to the computer through a wireless communication channel or a wired communication channel such as electrical wires or optical fibers.

It is to be noted that writing the program to be recorded on a storage medium includes processes that are not necessarily performed chronologically and that may be performed in parallel or individually as well as processes that are performed chronologically according to the order thereof.

To put the foregoing into other words, the optimization device according to the present disclosure can take various embodiments having the following constitutions.

(1) An optimization device (numerical controller10) according to an aspect of the present disclosure includes a block analysis unit111, a code processing unit112, and a program generation unit114. The block analysis unit111analyzes a preparatory function code and/or an auxiliary function code for each of a plurality of blocks included in a source program210. The code processing unit112performs a process on the preparatory function code and/or the auxiliary function code in a plurality of successive blocks based on a result of the analysis by the block analysis unit111and optimizes the source program210. The program generation unit114generates the source program210optimized by the code processing unit112as an object program220.

According to the optimization device, it is possible to optimize NC program codes included in a generated machining program and to expedite operation of a machine tool.

(2) In the optimization device described in (1), the code processing unit112may include a deletion processing unit1121. The deletion processing unit1121deletes a preparatory function code from every block other than the first block among the plurality of successive blocks in a case where the preparatory function code in one block is not a code that only affects the one block, and the preparatory function code in the one block is the same as a preparatory function code in any other block adjacent to the one block.

This enables the optimization device to shorten the execution time of the object program220.

(3) In the optimization device described in (1) or (2), the code processing unit112may include a first integration processing unit1122and a second integration processing unit1123. The first integration processing unit1122integrates a plurality of blocks among the plurality of successive blocks in a case where a preparatory function code in one block is not a code that only affects the one block, and the preparatory function code in the one block is a member of a modal group differing from that of a preparatory function code in any other block adjacent to the one block. The second integration processing unit1123integrates a plurality of blocks among the plurality of successive blocks in a case where a preparatory function code in one block is not a code that only affects the one block, the preparatory function code in the one block is a member of a modal group differing from that of a preparatory function code in any other block adjacent to the one block, and an auxiliary function code included in the block adjacent to the one block does not have to independently give a command to the block adjacent to the one block and is not a conflicting operation.

This enables the optimization device to shorten the cycle time.

(4) In the optimization device described in any one of (1) to (3), the code processing unit112may include a block rearrangement processing unit1124and a coordinate rearrangement processing unit1125. The block rearrangement processing unit1124rearranges an order of the plurality of successive blocks in a case where an auxiliary function code in one block is not an operation conflicting with a preparatory function code or an auxiliary function code included in a block preceding the one block. The coordinate rearrangement processing unit1125rearranges a plurality of coordinate values specified by dimension words included among the plurality of successive blocks to minimize a moving distance between the coordinate values or a total moving time in a case where a preparatory function code in the first block among the plurality of successive blocks is a fixed cycle preparatory function code, and a preparatory function code in the last block among the plurality of successive blocks is a preparatory function code of cancellation of the fixed cycle corresponding to the preparatory function code in the first block.

This enables the optimization device to shorten the execution time of the object program220and the cycle time.

(5) In the optimization device described in any one of (1) to (4), the code processing unit112may include a replacement processing unit1126. The replacement processing unit1126replaces the plurality of successive blocks with a combination of preparatory function codes from a fixed cycle preparatory function code to an interpolation preparatory function code in a case where a preparatory function code in the first block among the plurality of successive blocks is a fixed cycle preparatory function code, and a preparatory function code in the last block among the plurality of successive blocks is a preparatory function code of cancellation of the fixed cycle corresponding to the preparatory function code in the first block.

This enables the optimization device to shorten the execution time of the object program220.

(6) In the optimization device described in any one of (1) to (5), the program generation unit114may generate the object program220to replace the source program210.

This enables the optimization device to conserve the storage capacity of the storage unit200.

(7) In the optimization device described in any one of claims (1) to (5), the program generation unit114may generate the object program220as a new program differing from the source program210.

This enables the optimization device to generate the object program220for a plurality of machine tools20on a per-machine tool basis using a single source program210.

(8) The optimization device described in any one of (1) to (7) may further include an information output unit113. The information output unit113outputs information indicating the content of the process performed by the code processing unit112to a block immediately before or after a block including the processed preparatory function code or the processed auxiliary function code.

This enables the operator of the numerical controller10to know what process has been performed on each block in the source program210.

(9) The optimization device described in any one of (1) to (8) may further include a human-machine interface300and an input unit. The input unit receives, from an operator, a selection of a machine tool20in which the source program210is to be executed, using the human-machine interface300. The code processing unit112may change the process to be performed on the source program210based on the selected machine tool20A.

This enables the optimization device to generate an object program220optimized for the selected machine tool20A.

(10) The optimization device described in any one of (1) to (9) may further include a display unit. The display unit displays information indicating the content of the process performed by the code processing unit112.

This enables the operator of the numerical controller10to know what process has been performed on the source program210.

(11) In the optimization device described in (10), the display unit may display an estimated value of an execution time of the generated object program220based on the process performed by the code processing unit112.

This enables the operator of the numerical controller10to know how much the execution time is to be shortened by the optimization process performed on the source program210.

EXPLANATION OF REFERENCE NUMERALS

1: Control system

20: Machine tool

111: Block analysis unit

112: Code processing unit

1121: Deletion processing unit

1122: First integration processing unit

1123: Second integration processing unit

1124: Block rearrangement processing unit

1125: Coordinate rearrangement processing unit

1126: Replacement processing unit

113: Information output unit

114: NC program generation unit

210: Source program

220: Object program