Numerical control device

By introducing a pre-read adequacy determination and analysis unit into the numerical control device, dynamically setting the reference block, and appropriately controlling the number of pre-read blocks, the problem of execution result time difference and load concentration caused by unnecessary pre-reading in the existing technology is solved, and the problem is improved. Improves the accuracy and efficiency of pre-read control.

CN111796555BActive Publication Date: 2024-09-20FANUC LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010260757.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-04-05
Filing Date
2020-04-03
Publication Date
2024-09-20
Estimated Expiration
2040-04-03

AI Technical Summary

Technical Problem

Existing numerical control devices have the problem of unnecessary pre-reading in the pre-reading function, resulting in time differences in execution results and concentration of program execution load. Especially when the buffer capacity is large, there is a gap between the timing of pre-reading blocks and the timing of executing blocks. increases, affecting execution results and processing efficiency.

Method used

By introducing a pre-read adequacy determination unit and a pre-read analysis unit into the numerical control device, the number of pre-read blocks is appropriately controlled according to the status of the currently executing program, ensuring that pre-reading continues when pre-reading is sufficient, and pre-reading is interrupted to avoid unnecessary pre-reading. Read, dynamically set the reference block to optimize read-ahead control.

Benefits of technology

It effectively reduces the negative impact of unnecessary pre-reading on execution results, disperses the load of program execution, improves the accuracy and efficiency of pre-reading control, and avoids time gaps and load concentration problems caused by unnecessary pre-reading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111796555B_ABST
    Figure CN111796555B_ABST
Patent Text Reader

Abstract

The present invention provides a numerical control device. The numerical control device determines whether the pre-reading of blocks from a program is sufficient based on whether a block after a predetermined reference block required for the execution of the reference block after the block being executed by the program is pre-read, and performs pre-reading of blocks from the program when the determination result indicates that the pre-reading is insufficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a numerical control device, and in particular to a numerical control device with a program pre-reading function. Background Art

[0002] Numerical control devices often have a pre-reading function that reads a block of a program from a memory and analyzes it in advance before executing the block (for example, see Japanese Patent Publication No. 09-069003, Japanese Patent Publication No. 2007-094936, and Japanese Patent Publication No. 2008-293261). This pre-reading function can realize a command shape that takes into account the block to be executed at the destination of the program, a speed command correction function, and speed control.

[0003] For example, the following technology is disclosed in Japanese Patent Gazette No. 09-069003: when performing tool diameter correction, multiple program blocks are pre-read, and when interference between the tool and the workpiece occurs due to correction in the pre-read instruction blocks, the correction direction and correction amount are changed to avoid interference between the tool and the workpiece.

[0004] Japanese Patent Application Laid-Open No. 2007-094936 discloses a technique for pre-reading a plurality of program blocks, taking into account the previously instructed speed, and performing speed control that does not cause a sudden deceleration or the like.

[0005] When the pre-read function is enabled, macro statements contained in the program are processed during pre-reading and parsing. Therefore, when it is necessary to process macro statements at the time of executing a block, it is necessary to take measures such as placing a cache disable command immediately before the block. For example, if a macro statement that performs branch processing corresponding to the position of the axis after the execution of the immediately preceding block is processed at the time of pre-reading and parsing, branch processing will be performed based on the wrong axis position obtained when the immediately preceding block is not executed, and there is a concern that the assumed processing cannot be performed. In such a case, a cache disable command is placed immediately before the block, and the processing is performed after the execution of the immediately preceding block is completed.

[0006] If the cache inhibit command is included in the program, the block containing the command cannot be pre-read, which will affect the above-mentioned correction function and speed control. Therefore, there are cases where the execution timing of macro statements is not strict, and the program is compiled without the cache inhibit command when the pre-reading is to be given priority. In addition, even if the cache inhibit command is not included in the position where it should be included because the characteristics of the pre-reading are not understood, there are cases where the program occasionally operates without problems.

[0007] Figure 7 This is a diagram showing an example of a program including macro statements.

[0008] exist Figure 7 In the program shown, in the macro statements of the N0100 block and the N0500 block, the time when the macro statement is processed is obtained and substituted into the variable #100 and the variable #101. Then, in the N0510 block, the difference between the variable #100 and the variable #101 is calculated and substituted into the variable #500. The variable #500 indicates how much time is spent on the execution of the block between the N0100 block and the N0500 block. In such a program, if you want to correctly know the execution time of the block between the N0100 block and the N0500 block, you need to put a cache prohibition command just before the N0100 block and just before the N0500 block. However, even if the operator forgets to put in the cache prohibition command, the processing of the program will not cause major problems and will act, so there is also a situation where the actual operation is performed carelessly.

[0009] Generally, the pre-reading function performs pre-reading as long as the processing capacity allows before the pre-reading buffer prepared in advance is filled. Therefore, if the above-mentioned cache prohibition command is not included in the program, the larger the buffer capacity of the pre-reading buffer, the larger the time gap between the timing of processing the macro statement and the timing of actually executing the blocks located before and after the macro statement (the timing of outputting the instructions of the blocks located before and after the macro statement to the machine tool and peripheral devices).

[0010] Figure 8 as well as Fig. 9 This is a diagram illustrating how blocks of a program are pre-read and executed.

[0011] Figure 8 An example of preparing a buffer capable of storing data of blocks of 10 block sizes read in advance is shown. Fig. 9 An example of preparing a buffer capable of storing data of 100 blocks of pre-read size is shown. Figure 8 as well as Fig. 9 In the diagram, one rectangle represents one block, and a plurality of rectangles (blocks) stacked vertically represent a program.

[0012] exist Figure 8 as well as Fig. 9 In the diagram, the time of pre-reading and execution of program blocks is shown side by side from left to right. Program blocks are pre-read in order from the top and executed in order from the top. Figure 8 as well as Fig. 9 In the figure, the rectangles shaded by diagonal lines are blocks containing macro statements, and the other blocks are assumed to be normal NC blocks. In addition, the black rectangles represent the blocks currently being executed, and the rectangles shaded by vertical lines represent the blocks that have been executed. In addition, the blocks indicated by arrows were previously pre-read by the pre-read buffer. For example, in Figure 8, it is shown that the program is pre-read and executed at time t0. At time t1, the fifth block is pre-read by the cache and the first block is in the execution state.

[0013] Here, in Figure 8 In the example shown (capable of pre-reading 10 blocks in size), pre-reading is performed from the currently executed block for 10 blocks in size. At the start time t0 of the program, pre-reading is performed in sequence from the block at the front end of the program, and the first block is executed. Then, at time t2 when pre-reading is performed until the 10th block, the buffer is filled, and the pre-reading stops. At this stage, the 1st block is being executed. Then, when the execution of the 1st block is completed, the area of ​​the buffer used for pre-reading the 1st block is released, so that the 11th block can be pre-read. In this way, the pre-reading and execution of the blocks progress, and at time t2 when the execution of the 7th block is completed and the execution of the 8th block is performed. i , pre-read the 17th block (the rectangle indicated by the diagonal hatching) and parse it (the macro statements are processed at this time).

[0014] On the other hand, Fig. 9 In the example shown (capable of pre-reading 100 blocks), pre-reading is performed from the currently executed block to block 100. At the start time t0 of the program, pre-reading is performed in order from the block at the front end of the program, and the first block is executed. Then, for example, the 17th block of the program (the rectangle indicated by the oblique line hatching) is pre-read and parsed at time t4 (the macro statement is processed at this time). In addition, the blocks of the second block are executed at this time.

[0015] Thus, when the buffer capacity of the buffer storing the pre-read block data is large, the time gap between the timing of pre-reading the block and the timing of executing the block is larger than when the buffer capacity is small. Therefore, if a program without a cache prohibition command is implemented by a numerical control device having a large buffer capacity of the buffer storing the pre-read block data, there is a case where a large difference due to the time gap occurs between the assumed execution result and the actual execution result, which becomes a problem. For example, Figure 7 When the program is executed by a numerical control device with a smaller buffer capacity that stores the pre-read block data and when it is executed by a numerical control device with a larger buffer capacity, there is a large difference in the value substituted into the variable #500, which causes the execution results (the judgment result of block N0520) to change. Summary of the invention

[0016] In order to minimize the occurrence of such problems, it is desirable to not only prioritize the pre-reading required by functions that require pre-reading (speed control, etc.), but also control the pre-reading in a manner that does not perform unnecessary pre-reading, because unnecessary pre-reading may have a negative impact such as changing the execution result to an unexpected result.

[0017] In addition, if the buffer capacity of the buffer storing the data of the pre-read block is large, there is another problem that the load of the analysis process of the pre-read block is concentrated at the start of program execution. For example, in a system of multiple systems, when the program execution starts at the same time, there is a possibility that the load of the program analysis process in each system is concentrated at the start of program execution, thereby affecting each other's processing. Therefore, it is preferable that the load is dispersed in time during the execution time of the program. From this point of view, it is also considered that unnecessary pre-reading can be avoided.

[0018] In view of this, a numerical controller is desired that performs control to read ahead an appropriate number of blocks according to the status of a currently executed program.

[0019] A numerical controller according to one embodiment of the present invention solves the above-mentioned problem by continuing to read ahead until the number of blocks (which differs for each block) required for executing a predetermined block after a currently executing block is secured (read ahead and analyzed), and interrupting the read ahead if the number of blocks can be secured.

[0020] A numerical control device according to the present invention has a function of pre-reading a block of a program, and comprises: a pre-reading sufficiency determination unit for determining whether pre-reading of a block from the program is sufficient, based on whether a block after a predetermined reference block required for executing the block after the block being executed in the program is pre-read; and a pre-reading analysis unit for performing pre-reading of a block from the program when the pre-reading sufficiency determination unit determines that pre-reading of a block from the program is insufficient.

[0021] The pre-reading adequacy determination unit may determine that the block from the program is pre-read sufficiently if the axis can be stopped within the execution time of the pre-read block when the axis is moved at the speed limit in the command when the reference block instructs axis feed.

[0022] The pre-reading sufficiency determination unit may determine whether the pre-reading of blocks from the program is sufficient based on the number of required blocks set for each instruction or each function or a formula for calculating the number of required blocks.

[0023] The reference block may be statically set in advance as a relationship with the block being executed.

[0024] The numerical control device may further include a reference block setting unit that dynamically sets the reference block based on an execution status of a block being executed or an execution time of a block read in advance.

[0025] According to the present invention, an appropriate number of blocks can be read in advance according to the status of the currently executed program. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a schematic hardware configuration diagram of a numerical controller according to one embodiment.

[0027] Figure 2 This is a schematic functional block diagram of the numerical control device according to the first embodiment.

[0028] Figure 3A as well as Figure 3B This is a diagram showing a situation where the movement of an axis cannot be stopped during the execution of a pre-read block.

[0029] Figure 4 This is a diagram showing a case where the movement of an axis can be stopped during execution of a pre-read block.

[0030] Figure 5 This is a schematic functional block diagram of a numerical control device according to the second embodiment.

[0031] Figure 6 This is a diagram for explaining the method of setting the reference block.

[0032] Figure 7 This is a diagram showing an example of a program including macro statements.

[0033] Figure 8 This is a diagram showing an example of how a program block is pre-read and executed.

[0034] Fig. 9 This is a diagram showing another example of how program blocks are pre-read and executed. DETAILED DESCRIPTION

[0035] Figure 1 This is a schematic hardware configuration diagram showing a main part of a numerical controller according to an embodiment of the present invention.

[0036] The numerical control device 1 of the present invention can be implemented as a numerical control device that controls a machine tool based on a program, for example.

[0037] The CPU 11 included in the numerical controller 1 of the present embodiment is a processor that controls the entire numerical controller 1. The CPU 11 reads a system program stored in the ROM 12 via the bus 20, and controls the entire numerical controller 1 according to the system program. Temporary calculation data, display data, various data input from the outside, and the like are temporarily stored in the RAM 13.

[0038] The nonvolatile memory 14 is composed of, for example, a memory backed by a battery (not shown), an SSD (Solid State Drive), etc., and can maintain the storage state even if the power supply of the numerical control device 1 is turned off. The nonvolatile memory 14 stores programs read from the external device 72 via the interface 15, programs input via the display / MDI unit 70, etc. The programs and various data stored in the nonvolatile memory 14 can also be loaded into the RAM 13 when executed / used. In addition, various system programs such as well-known analysis programs are pre-written in the ROM 12.

[0039] The interface 15 is an interface for connecting to the CPU 11 of the numerical controller 1 and an external device 72 such as a USB device. The program, various parameters, etc. used for controlling the machine tool are read from the external device 72. In addition, the program, various parameters, etc. edited in the numerical controller 1 can be stored in an external storage device (not shown) via the external device 72. The programmable logic controller (PLC) 16 outputs signals to the machine tool (not shown) and the peripheral devices of the machine tool (for example, tool changers, actuators of robots, etc., sensors installed on the machine tool, etc.) through the sequence program built into the numerical controller 1 via the I / O unit 17 to perform control. In addition, the PLC 16 receives signals from various switches and peripheral devices on the operation panel of the main body of the machine tool, and delivers them to the CPU 11 after necessary signal processing.

[0040] The display / MDI unit 70 is a manual data input device having a display and a keyboard, and the interface 18 receives commands and data from the keyboard of the display / MDI unit 70 and transmits them to the CPU 11. The interface 19 is connected to an operation panel 71 having a manual pulse generator used when manually driving each axis.

[0041] The axis control circuit 30 for controlling the axis of the machine tool receives the axis movement instruction from the CPU 11 and outputs the axis instruction to the servo amplifier 40. The servo amplifier 40 receives the instruction and drives the servo motor 50 for moving the axis of the machine tool. The servo motor 50 of the axis has a built-in position speed detector, and feeds back the position speed feedback signal from the position speed detector to the axis control circuit 30, thereby performing position speed feedback control. Figure 1 In the hardware configuration diagram of FIG. 1 , only one axis control circuit 30 , one servo amplifier 40 , and one servo motor 50 are shown respectively. However, in reality, each of the axes to be controlled is prepared in accordance with the number of axes that the machine tool has.

[0042] The spindle control circuit 60 receives the spindle rotation command and outputs a spindle speed signal to the spindle amplifier 61. The spindle amplifier 61 receives the spindle speed signal and rotates the spindle motor 62 of the machine tool at the commanded rotation speed, thereby driving the tool. The spindle motor 62 is combined with a position encoder 63, and the position encoder 63 outputs a feedback pulse in synchronization with the rotation of the spindle, and the feedback pulse is read by the CPU 11.

[0043] Figure 2 This is a schematic functional block diagram of the numerical control device 1 according to the first embodiment of the present invention.

[0044] Figure 2 The functional modules shown are Figure 1 This is achieved by the CPU 11 included in the numerical controller 1 executing a system program to control the operation of each unit of the numerical controller 1 .

[0045] The numerical control device 1 of this embodiment includes a pre-reading analysis unit 100 and a program execution unit 110. In addition, a program 200 used for controlling the machine tool 2 is pre-stored in the non-volatile memory 14. In addition, an execution data buffer 210 for storing execution data required for executing a block of the program is provided on the RAM 13 or the non-volatile memory 14.

[0046] The pre-reading analysis unit 100 Figure 1 The numerical controller 1 shown is implemented by executing a system program read from a ROM 12 by a CPU 11, and mainly performing arithmetic processing using a RAM 13 and a nonvolatile memory 14 of the CPU 11. The pre-reading analysis unit 100 pre-reads and analyzes a block of a program 200, and delivers execution data obtained as a result of the analysis to an execution data buffer 210. When there is space in the execution data buffer 210, and when a pre-reading sufficiency determination unit 102 described later determines that a block required for the execution of a reference block is not pre-read, the pre-reading analysis unit 100 performs pre-reading of a block of the program 200. The pre-reading analysis unit 100 includes a pre-reading sufficiency determination unit 102 and an analysis unit 104.

[0047] The pre-reading sufficiency determination unit 102 determines whether the pre-reading of the block from the program 200 is sufficient. The pre-reading sufficiency determination unit 102 determines whether the pre-reading is sufficient based on whether the blocks required for the operation of the reference block are pre-read, with respect to the reference block that serves as the reference for the pre-reading sufficiency determination in the pre-read blocks. The reference block may be, for example, the next block of the block currently executed by the program execution unit 110, or may be the first two or the first three blocks of the block currently executed by the program execution unit 110. The reference block may also be statically set in advance in a setting area provided on the non-volatile memory 14 as a relationship with the block currently executed by the program execution unit 110. The pre-reading sufficiency determination unit 102 always determines that the pre-reading is insufficient when the block determined as the reference block is not pre-read.

[0048] For example, when the reference block is a block for instructing axis feed, the lookahead adequacy determination unit 102 determines whether the lookahead is sufficient based on whether a block that can generate only a sufficient speed in the axis feed instruction of the reference block is lookedahead.

[0049] use Figure 3A , Figure 3B as well as Figure 4 , the relationship between block pre-reading and speed limitation during axis feed is explained.

[0050] Figure 3A , Figure 3B as well as Figure 4 The relationship between speed and time is shown when the axis is moved in the reference block N and then stopped. Figure 3A , Figure 3B as well as Figure 4 In the example, the reference block N is an instruction for axis feed, and the speed limit in the instruction is set to V1. In addition, the horizontal axis represents the time taken to execute the block. For example, when the axis starts to execute block N+1 in a state where the axis moves at the speed limit V1, decelerates at the maximum deceleration, and executes block N+1, the execution of block N+1 takes (t2-t1) time. The speed limit V1 is set based on, for example, the maximum speed value set in the numerical control device 1 or the machine tool 2 as the maximum speed of the axis, the instruction value in the block, and other important factors. The relationship between the speed and time when the axis is stopped is calculated by analyzing the pre-read block.

[0051] exist Figure 3A as well as Figure 3B In the example, the block before block N+4 is read in advance from program 200. At this time, if the axis is fed at the limited speed V1 in the reference block N, Figure 3AAs shown in the graph of , even if the axis is decelerated at the maximum deceleration calculated based on the maximum deceleration of each axis set for the axis, the axis cannot be stopped before the end time t5 of block N+4 (i.e., the start time of block N+5). Therefore, in the case of reading the block before block N+4, Figure 3B As shown in the graph of , the speed in block N is limited to a speed Vr that can reliably stop the axis feed before the time t5' when the execution of block N+4 ends. In this case, the pre-reading adequacy determination unit 102 determines that the pre-reading is insufficient even if a block that can generate only a sufficient speed is not pre-read in the axis feed command of the reference block N.

[0052] exist Figure 4 In the example, the block before block N+5 is pre-read from program 200. At this time, when the axis is fed at the limit speed V1 in the reference block N, for example, when the axis needs to be stopped in the block N+6 that has not been pre-read, if the axis is decelerated at the maximum deceleration set for the axis, the axis can be stopped before the start time of block N+6. Therefore, when the block before block N+5 is read, the feed speed of the axis in block N does not need to be limited, and the speed can be increased to the limit speed V1. In such a case, the pre-reading adequacy determination unit 102 determines that the pre-reading is sufficient even if the pre-reading can only generate a sufficient speed in the axis feed instruction of the reference block N.

[0053] In addition to the pre-reading sufficiency judgment based on the speed of the axis feed described above, the pre-reading sufficiency judgment unit 102 may also use the required number of blocks predetermined for each instruction to judge whether the pre-reading is sufficient according to whether the number of blocks required for the instruction of the reference block is pre-read. In addition, in the numerical control device 1, it is also possible to judge whether the pre-reading is sufficient according to whether the number of blocks required for the function is pre-read in accordance with the currently used function (tool diameter correction function, curve approximation function, etc.). The tool diameter correction function requires tool diameter correction, so that there is no step difference between blocks, interference between the tool and the workpiece, etc., so it is necessary to pre-read at least the first two blocks and analyze the corrected path. In addition, the curve approximation function uses a predetermined algorithm to calculate a curve that approximates a series of instruction points instructed by multiple blocks. Moreover, it is necessary to pre-read the instruction only to calculate the number of instruction points required by the algorithm or the number of instruction points that are correct in the algorithm. When using such a required number of blocks for each instruction and each function, it is sufficient to set the required number of blocks for each instruction and each function or the formula for calculating the required number of blocks in advance in the setting area set on the non-volatile memory 14.

[0054] The parsing unit 104 parses the blocks pre-read from the program 200, and stores the execution data obtained as a result of the parsing in the execution data buffer 210. The execution data buffer 210 stores information such as the modal information of each pre-read block, the movement amount of each axis, the spindle command speed, and the feed speed. The parsing of the blocks by the parsing unit 104 means converting the blocks as source code into target code as execution data that can be recognized by the computer. This conversion includes the steps of (1) word parsing, (2) macro parsing, (3) macro execution, (4) syntax parsing, (5) meaning parsing, (6) generation of target code, and (7) optimization. The details of the parsing process by the parsing unit 104 are fully described in, for example, Japanese Patent Application Laid-Open No. 2008-293261, and therefore the description in the specification of this application is omitted.

[0055] The program execution unit 110 performs Figure 1 The numerical control device 1 shown in the figure is implemented by executing the system program read from the ROM 12 by the CPU 11, mainly performing the calculation processing using the RAM 13 and the non-volatile memory 14 of the CPU 11, and the control processing of the machine tool 2 with the axis control circuit 30, the spindle control circuit 60, the PLC 16, etc. The program execution unit 110 controls the operation of the machine tool 2 based on the execution data stored in the execution data buffer 210. The program execution unit 110 has the general control function required for controlling each part of the machine tool 2, so that the motor driving each axis of the machine tool 2 is output with the execution data every control cycle, and the peripheral devices of the machine tool 2 are controlled. In addition, the program execution unit 110 has the function of notifying the pre-reading analysis unit 100 of the block currently being executed.

[0056] In the numerical controller 1 of the present embodiment having the above-mentioned configuration, it is possible to perform control to pre-read an appropriate number of blocks required for a predetermined reference block according to the status of the currently executed program, so that pre-reading of blocks exceeding the required number is not performed, thereby minimizing the influence of pre-reading on the execution of the macro. In addition, by not pre-reading and analyzing blocks exceeding the required number, it is possible to reduce the concentration of loads in the execution of the program, and, for example, it is possible to expect that the influence of pre-reading on the cooperation between a plurality of programs can be reduced.

[0057] Figure 5 This is a schematic functional block diagram of a numerical control device 1 according to a second embodiment of the present invention.

[0058] Figure 5 The functional modules shown are Figure 1 This is achieved by the CPU 11 included in the numerical controller 1 shown executing a system program to control the operation of each unit of the numerical controller 1 .

[0059] The numerical control device 1 of the present embodiment is different from the numerical control device 1 of the first embodiment in that the look-ahead analysis unit 100 further includes a reference block setting unit 106 .

[0060] The reference block setting unit 106 dynamically sets a reference block that serves as a reference for the pre-reading sufficiency determination unit 102 to determine whether the pre-reading of blocks from the program 200 is sufficient, based on the execution status of the currently executed block and the execution time of the pre-read blocks. The reference block setting unit 106 may set the reference block based on, for example, the execution time of the currently executed block and the execution time of each pre-read block.

[0061] Figure 6 This is a diagram showing the time taken to execute each of the block being executed and the pre-read block N to block N+3.

[0062] The reference block setting unit 106 determines the time required for the pre-read analysis based on a threshold value t ... th , set at the threshold t th The next block of the block that can be executed during the period is used as the reference block. Figure 6 In the example, it is expected that block N will pass the threshold t th Since the process is already being executed at the time of , the reference block setting unit 106 sets the block N+1 which is the next block after the block N as the reference block.

[0063] In the numerical controller 1 of the first embodiment, a reference block is statically set in advance, and a pre-reading adequacy determination process is performed based on the set reference block. However, in a case where the execution of a block currently being executed and a block following the currently being executed block ends in a short time, for example, if a block following the currently being executed block is statically set as the reference block, there is a possibility that the reference block is executed at the time when the pre-reading adequacy determination process ends, and the execution of the reference block ends. Therefore, in the numerical controller 1 of the present embodiment, a reference block setting unit 106 that dynamically sets the reference block is provided, thereby preventing such a problem from occurring.

[0064] As mentioned above, although one embodiment of the present invention has been described, the present invention is not limited to the example of the above-mentioned embodiment, and can be implemented in various forms by adding appropriate changes.

Claims

1. A numerical control device having a pre-reading function for pre-reading a block of a program, It is characterized in that The numerical control device comprises: a pre-reading sufficiency determination unit for determining whether the pre-reading of blocks from the program is sufficient, based on whether a predetermined number of blocks after a predetermined reference block required for execution of the reference block after the block being executed by the program are pre-read; as well as a pre-reading analysis unit that, when the pre-reading sufficiency determination unit determines that the pre-reading of the block from the program is insufficient, performs pre-reading of a predetermined number of blocks after the reference block necessary for the execution of the reference block from the program, wherein The predetermined number of blocks is a number of blocks determined according to the status of the currently executed program. When the pre-reading sufficiency determination unit determines that the pre-reading of the block from the program is sufficient, the pre-reading analysis unit stops the continued pre-reading of the block.

2. The numerical control device according to claim 1, characterized in that: The pre-reading adequacy determination unit determines that the block from the program is pre-read sufficiently when the axis can be stopped within the execution time of the pre-read block when the axis is moved at the speed limit in the instruction when the reference block instructs axis feed.

3. The numerical control device according to claim 1, characterized in that: The pre-reading sufficiency determination unit determines whether pre-reading of blocks from the program is sufficient based on the number of required blocks set for each instruction or each function or a formula for calculating the number of required blocks.

4. The numerical control device according to claim 1, characterized in that: The reference block is statically set in advance as a relationship with the block being executed.

5. The numerical control device according to claim 1, characterized in that: The numerical control device further includes a reference block setting unit that dynamically sets the reference block based on an execution status of a block being executed or an execution time of a block read in advance.