Numerical control device

JPWO2024042568A5Active Publication Date: 2025-05-01FANUC LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024542444
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2025-05-01
Estimated Expiration
2042-08-22

AI Technical Summary

Technical Problem

Numerical control devices experience discrepancies between the operator's perception and the actual control state, leading to potential operational failures when the execution of operation programs is interrupted, especially during state switching commands like tool exchanges, due to the long processing time and potential misalignment of control state changes.

Method used

Incorporating an execution unit, look-ahead unit, command determination unit, switching determination unit, restoration judgment unit, and restoration unit to read and prefetch commands, determine switching conditions, and restore the control state before executing switching commands, ensuring synchronization between operator perception and actual control state.

Benefits of technology

Prevents discrepancies between operator perception and actual control state, ensuring the industrial machine operates as intended by synchronizing control state changes and restoring conditions before program execution resumes.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

In the present invention, a numerical control device comprises: an execution unit that reads an operation program and sequentially executes commands; a pre-reading unit that pre-reads the commands; a command determination unit that determines whether or not the pre-read commands include a switching command that switches a control state; a switching determination unit that determines whether or not a switching condition for switching the control state on the basis of the switching command is satisfied when it has been determined that the commands include a switching command; a switching unit that switches the control state before the switching command is executed when it has been determined that the switching condition is satisfied; a restoration determination unit that determines whether or not a restoration condition for restoring the switched control state to the state prior to switching; and a restoration unit that restores the control state to the state prior to switching when it has been determined that the restoration condition is satisfied.
Need to check novelty before this filing date? Find Prior Art

Description

Numerical Control Device

[0001] The present disclosure relates to a numerical control device for controlling industrial machinery.

[0002] A numerical control device operates industrial machinery based on an operation program, which includes, for example, commands to drive servo motors to operate control axes and commands to switch control states.

[0003] When a command to switch the control state is executed by the numerical control device, the process of switching the control state begins. However, it may take a long time from the start to the end of the control state switching. For example, when a tool change command is executed as a command to switch the control state, it takes a long time for the tools stored in the tool magazine to be transported to the tool change position.

[0004] Therefore, a command for switching the control state specified in the operation program is read in advance, and the switching of the control state is started before the execution stage of the command is reached (for example, Patent Document 1).

[0005] Japanese Patent Application Publication No. 6-738

[0006] However, there are cases where the execution of an operation program is interrupted after the command to switch the control state is pre-read and the control state is switched, but before the execution stage of the command is reached in the operation program. In this case, the execution block of the operation program has not yet reached the block in which the command to switch the control state is specified, and the operator may perceive that the control state has not yet been switched.

[0007] In other words, there is a risk of a discrepancy occurring between the operator's perception of the control state and the actual control state of the numerical control device. If such a discrepancy occurs, when the operator resumes the operation program, the industrial machine may not operate as intended.

[0008] Therefore, there is a demand for a numerical control device that can prevent discrepancies from occurring between the operator's perception of the control state and the actual control state.

[0009] The numerical control device comprises an execution unit that reads an operating program consisting of a plurality of blocks and sequentially executes instructions contained in each of the plurality of blocks; a look-ahead unit that looks ahead to the instructions contained in each of the plurality of blocks; a command determination unit that determines whether a switching command for switching a control state is included in the commands looked ahead by the look-ahead unit; a switching determination unit that determines whether a switching condition for switching the control state based on the switching command is satisfied if the command determination unit determines that the commands include a switching command; a switching unit that switches the control state before the switching command is executed by the execution unit if the switching determination unit determines that the switching condition is satisfied; a restoration determination unit that determines whether a restoration condition for restoring the control state switched by the switching unit to a state before the switching is satisfied; and a restoration unit that restores the control state to the state before the switching if the restoration determination unit determines that the restoration condition is satisfied.

[0010] According to one aspect of the present disclosure, it is possible to prevent discrepancies from occurring between the operator's perception of the control state and the actual control state.

[0011] 1 is a block diagram showing an example of a hardware configuration of an industrial machine; 2 is a block diagram showing an example of the functions of a numerical control device; 3 is an example of an operation program; 4 is a flowchart showing an example of a processing flow when an operation program is executed; 5 is a flowchart showing an example of a processing executed when execution of an operation program is interrupted; 6 is an example of an operation program; 7 is a flowchart showing an example of a processing executed by a numerical control device; 8 is a flowchart showing an example of a processing executed when execution of an operation program is interrupted; 9 is an example of an operation program; 10 is a flowchart showing an example of a processing executed by a numerical control device; 11 is a flowchart showing an example of a processing executed when execution of an operation program is interrupted;

[0012] Numerical control devices according to embodiments of the present disclosure will be described below with reference to the drawings. Note that not all combinations of features described in the following embodiments are necessarily required to solve the problems. In addition, more detailed explanation than necessary may be omitted. Furthermore, the following description of the embodiments and the drawings are provided to enable those skilled in the art to fully understand the present disclosure, and are not intended to limit the scope of the claims.

[0013] A numerical control device is a control device that controls industrial machines, such as machine tools, wire electric discharge machines, injection molding machines, industrial robots, and three-dimensional printers, and machine tools, such as lathes, machining centers, and multi-tasking machines.

[0014] 1 is a block diagram showing an example of the hardware configuration of an industrial machine equipped with a numerical control device 2. The industrial machine 1 includes a numerical control device 2, an input / output device 3, a servo amplifier 4, a servo motor 5, a spindle amplifier 6, a spindle motor 7, and an auxiliary device 8.

[0015] The numerical control device 2 is a device that controls the entire industrial machine 1. The numerical control device 2 includes a hardware processor 201, a bus 202, a read-only memory (ROM) 203, a random access memory (RAM) 204, and a non-volatile memory 205.

[0016] The hardware processor 201 is a processor that controls the entire numerical control device 2 in accordance with a system program. The hardware processor 201 reads the system program stored in the ROM 203 via the bus 202 and performs various processes based on the system program. The hardware processor 201 controls, for example, the servo motor 5 and the spindle motor 7 based on an operation program. The hardware processor 201 is, for example, a CPU (Central Processing Unit) or an electronic circuit.

[0017] The hardware processor 201 analyzes the operation program and outputs control commands to the servo motor 5 and the spindle motor 7 for each control period, for example.

[0018] The bus 202 is a communication path that connects the various pieces of hardware within the numerical control device 2. The various pieces of hardware within the numerical control device 2 exchange data via the bus 202.

[0019] The ROM 203 is a storage device that stores a system program for controlling the entire numerical control device 2. The ROM 203 is a computer-readable storage medium.

[0020] The RAM 204 is a storage device that temporarily stores various data and functions as a work area for the hardware processor 201 to process various data.

[0021] The nonvolatile memory 205 is a storage device that retains data even when the industrial machine 1 is turned off and no power is supplied to the numerical control device 2. The nonvolatile memory 205 stores, for example, operation programs and various parameters. The nonvolatile memory 205 is a computer-readable storage medium. The nonvolatile memory 205 is, for example, a battery-backed memory or an SSD (Solid State Drive).

[0022] The numerical control device 2 further includes an interface 206 , an axis control circuit 207 , a spindle control circuit 208 , a PLC (Programmable Logic Controller) 209 , and an I / O unit 210 .

[0023] The interface 206 connects the bus 202 and the input / output device 3. The interface 206 sends various data processed by the hardware processor 201 to the input / output device 3, for example.

[0024] The input / output device 3 receives and displays various data via the interface 206. The input / output device 3 also receives input of various data and sends the data via the interface 206 to, for example, the hardware processor 201.

[0025] The input / output device 3 is, for example, a touch panel. The input / output device 3 is, for example, a capacitive touch panel. Note that the touch panel is not limited to a capacitive touch panel and may be a touch panel of another type. The input / output device 3 is installed on an operation panel (not shown) in which the numerical control device 2 is housed.

[0026] The axis control circuit 207 is a circuit that controls the servo motor 5. The axis control circuit 207 receives control commands from the hardware processor 201 and sends various commands to the servo amplifier 4 for driving the servo motor 5. The axis control circuit 207 sends, for example, a torque command for controlling the torque of the servo motor 5 to the servo amplifier 4.

[0027] The servo amplifier 4 receives a command from the axis control circuit 207 and supplies a current to the servo motor 5 .

[0028] The servo motors 5 are driven by receiving a current supply from the servo amplifier 4. The servo motors 5 are provided for each control axis of the industrial machine 1. When the industrial machine 1 is a machine tool having five axes, the servo motors 5 include, for example, an X-axis servo motor, a Y-axis servo motor, a Z-axis servo motor, an A-axis servo motor, and a C-axis servo motor.

[0029] The servo motor 5 is connected to, for example, a ball screw that drives a tool post. When the servo motor 5 is driven, a structure of the industrial machine 1, such as the tool post, moves in a predetermined control axis direction. The servo motor 5 has a built-in encoder (not shown) that detects the position and feed rate of the control axis. Position feedback information and speed feedback information indicating the position and feed rate of the control axis detected by the encoder, respectively, are fed back to the axis control circuit 207. In this way, the axis control circuit 207 performs feedback control of the control axis.

[0030] The spindle control circuit 208 is a circuit for controlling the spindle motor 7. The spindle control circuit 208 receives a control command from the hardware processor 201 and sends a command to the spindle amplifier 6 to drive the spindle motor 7. The spindle control circuit 208 sends, for example, a spindle speed command to the spindle amplifier 6 to control the rotation speed of the spindle motor 7.

[0031] The spindle amplifier 6 receives a command from the spindle control circuit 208 and supplies a current to the spindle motor 7 .

[0032] The spindle motor 7 is driven by receiving a current supplied from the spindle amplifier 6. The spindle motor 7 is connected to the main shaft and rotates the main shaft.

[0033] The PLC 209 is a device that executes a ladder program to control the auxiliary device 8. The PLC 209 sends commands to the auxiliary device 8 via an I / O unit 210.

[0034] The I / O unit 210 is an interface that connects the PLC 209 and the auxiliary device 8. The I / O unit 210 sends commands received from the PLC 209 to the auxiliary device 8.

[0035] The auxiliary device 8 is installed in the industrial machine 1 and performs auxiliary operations in the industrial machine 1. The auxiliary device 8 operates based on commands received from the I / O unit 210. The auxiliary device 8 may be a device installed in the periphery of the industrial machine 1. The auxiliary device 8 is, for example, a tool changer, a cutting fluid injection device, or an opening / closing door drive device.

[0036] 2 is a block diagram showing an example of the functions of a numerical control device 2 that controls an industrial machine 1. The numerical control device 2 includes a program storage unit 211, an execution unit 212, a look-ahead unit 213, a command determination unit 214, a switching determination unit 215, a switching unit 216, a restoration determination unit 217, a restoration unit 218, and a switching storage unit 219. The program storage unit 211 is realized, for example, by storing an operation program in the non-volatile memory 205. The switching storage unit 219 is realized by storing switching information, which will be described later, in the RAM 204.

[0037] The execution unit 212, the look-ahead unit 213, the command judgment unit 214, the switching judgment unit 215, the switching unit 216, the restoration judgment unit 217, and the restoration unit 218 are realized, for example, by the hardware processor 201 performing arithmetic processing using the system program stored in the ROM 203, and the operating program and various data stored in the non-volatile memory 205.

[0038] The program storage unit 211 stores an operation program for operating the industrial machine 1. The operation program is, for example, a machining program. The operation program is made up of a plurality of blocks.

[0039] Figure 3 is an example of an operation program. "O0001" means that the program number is "0001". "N(n)" means that the sequence number of the block is "n". A block is one line. ";" means the end of the block.

[0040] An "X-axis movement command" is a command to move the control axis in the X-axis direction. A "Z-axis movement command" is a command to move the control axis in the Z-axis direction. An "X-axis and Z-axis movement command" is a command to move the control axis in the X-axis and Z-axis directions.

[0041] The "tool change command" is a command to move a tool stored in a magazine to a tool change position and replace the tool moved to the tool change position with a tool attached to the spindle. Moving a tool stored in a magazine to the tool change position will be referred to as "tool change preparation" below.

[0042] A "program end command" is a command that ends a program. These commands are actually specified using G codes, M codes, F codes, T codes, etc. Now, let's return to the explanation of FIG. 2.

[0043] The execution unit 212 reads the operation program stored in the program storage unit 211. The execution unit 212 may read the operation program from a server or the like via a network, for example.

[0044] The execution unit 212 reads the operation program and sequentially executes the commands contained in each of the blocks. For example, when the execution unit 212 reads the operation program of Fig. 3, the execution unit 212 executes the operation program in order, starting with the block with sequence number N(1).

[0045] Specifically, the execution unit 212 first reads the "X-axis movement command" with sequence number N(1) and moves the control axis in the X-axis direction. Next, the execution unit 212 reads the "Z-axis movement command" with sequence number N(2) and moves the control axis in the Z-axis direction.

[0046] Next, the execution unit 212 reads the "X-axis and Z-axis movement command" with sequence number N(3) and moves the control axes in the X-axis and Z-axis directions. This process is executed sequentially for each block. Note that the execution unit 212 may read the command of the next block while executing the command of a block.

[0047] The prefetching unit 213 prefetches the instructions contained in each of the multiple blocks. Prefetching means reading the instructions of each block in advance before the instructions of each block are executed by the execution unit 212.

[0048] While the execution unit 212 is executing instructions in a certain block, the prefetching unit 213 reads and interprets instructions in blocks ranging from several blocks to several tens of blocks ahead of the block being executed by the execution unit 212. Alternatively, the prefetching unit 213 may prefetch instructions from the block with sequence number N(1) to several tens of blocks ahead immediately after execution of the operating program is started.

[0049] When the operating program shown in Figure 3 is executed, the pre-reading unit 213 pre-reads the instructions specified in the blocks with sequence numbers N(1) to N(n) before the execution unit 212 executes the instructions in the block with sequence number N(1).

[0050] The command determination unit 214 determines whether or not a switching command for switching the control state is included in the commands read ahead by the read-ahead unit 213. The control state refers to the state of signals inside the numerical control device 2 and the state of the industrial machine 1 that is the control target of the numerical control device 2. The command for switching the control state does not include a command for operating a control axis. In other words, the command for switching the control state does not include a drive command for a servo motor that drives a control axis.

[0051] Examples of the switching command for switching the control state include the above-mentioned tool change command, a command to operate the C-axis by offsetting the maximum torque of the C-axis, and a command to change the control period. The command to operate the C-axis by offsetting the maximum torque of the C-axis and the command to change the control period will be described in detail later.

[0052] When command determination unit 214 determines that a switching command is included in the commands pre-read by pre-read unit 213, switching determination unit 215 determines whether or not a switching condition for switching the control state based on the switching command is satisfied. In other words, when a switching command is pre-read by pre-read unit 213 in a state in which the switching command has not yet been executed by execution unit 212, switching determination unit 215 determines whether or not the control state can be switched based on the switching command.

[0053] The switching conditions include at least one of a control command for the control object not being pre-read by the pre-reading unit 213 and a control command for the control object not being executed by the execution unit 212. Here, the control command is a command different from the switching command pre-read by the pre-reading unit 213.

[0054] The controlled object is, for example, a controlled object of a numerical control device whose operation is affected by switching of the control state. In other words, the controlled object is a controlled object of a numerical control device whose operation differs before and after switching of the control state even if the same command is executed before and after switching of the control state.

[0055] The controlled objects include at least one of motors and peripheral devices. The motors include a plurality of servo motors that drive the X-axis, Y-axis, Z-axis, A-axis, B-axis, and C-axis. The peripheral devices include, for example, a tool changer, a chip discharge device, and a cutting fluid chiller.

[0056] 3 is executed, the execution unit 212 first executes the command with sequence number N(1). At this time, the prefetch unit 213 prefetches the commands from the block with sequence number N(1) to the block with sequence number N(n).

[0057] Here, it is assumed that a tool change command to change to tool number 2 is specified in sequence number N(6), and a tool change command to change to tool number 3 is specified in sequence number N(n).

[0058] In this case, if the above-mentioned switching conditions are not set, preparation for tool change for tool number 2 is performed based on the look-ahead unit 213 having looked ahead to the command in the block with sequence number N(6). Furthermore, preparation for tool change for tool number 3 is performed based on the look-ahead unit 213 having looked ahead to the command in the block with sequence number N(n).

[0059] Then, when the execution block reaches sequence number N(6) and the execution unit 212 executes the tool change command specified by sequence number N(6), the tool is changed to tool number 3 specified by sequence number N(n). In other words, the numerical control device 2 controls an operation different from the operation specified in the operation program.

[0060] Therefore, in order to avoid such control, it is necessary to set a switching condition that the control command for the control object whose operation is affected by the switching of the control state is not pre-read by the pre-reading unit 213.

[0061] Here, "not read ahead" means that a control command for a control object whose operation is affected by the switching of the control state is not specified in the operation program before the switching command.

[0062] 3, the switching condition is that no tool change command is included in any block prior to the block with sequence number N(n). In other words, if no tool change command is included in any block prior to the block with sequence number N(n), the look-ahead unit 213 will not look ahead to a tool change command in any block prior to the block with sequence number N(n). In this case, the switching determination unit 215 determines that the switching condition is satisfied.

[0063] When the switching determination unit 215 determines that the switching condition is satisfied, the switching unit 216 switches the control state before the switching command is executed by the execution unit 212. In the example shown in Fig. 3, the switching unit 216 switches the control state while the command of the block with sequence number N(1), for example, is being executed by the execution unit 212. In other words, the switching unit 216 executes tool change preparation for the tool number specified by sequence number N(n).

[0064] The restoration determination unit 217 determines whether a restoration condition is satisfied for restoring the control state switched by the switching unit 216 to the state before the switching. When the execution of the operation program is interrupted after the control state is switched by the switching unit 216 and before the switching command is executed by the execution unit 212, the restoration determination unit 217 determines whether the restoration condition is satisfied.

[0065] The restoration condition is that a control command for the control object is not being executed by the execution unit 212. Alternatively, the restoration condition may be that a control command for the control object is not being pre-read by the pre-read unit 213.

[0066] The interruption may be, for example, a reset of the operation program based on a reset operation, or a temporary suspension of the operation program.

[0067] 3, the restoration determination unit 217 determines whether the restoration condition is satisfied, for example, after the switching unit 216 moves the tool specified by the sequence number N(n) to the tool change position and before the tool change command specified in the block of the sequence number N(n) is executed by the execution unit 212. Furthermore, the restoration determination unit 217 determines that the restoration condition is satisfied when a tool change is not being executed and a tool change command has not been pre-read in a block earlier than the block of the sequence number N(n).

[0068] The restoration unit 218 restores the control state to the state before the switching when the restoration determination unit 217 determines that the restoration condition is satisfied. In the example shown in Fig. 3, the restoration unit 218 restores the control state to the state before the tool specified by the sequence number N(n) was moved to the tool changing position.

[0069] The switching storage unit 219 stores switching information indicating that the control state has been switched by the switching unit 216. The switching storage unit 219 may store, for example, a switching command, a switching time, etc. along with the switching information. For example, when the operation program shown in Fig. 3 is executed, the switching storage unit 219 may store information that tool change preparation has been performed based on a tool change command designated by sequence number N(n) during the execution of the command with sequence number N(1).

[0070] 4 is a flowchart showing an example of the processing flow when the numerical control device 2 executes the operation program of FIG. 3. When the operation program is executed, the execution unit 212 first reads and executes the command specified by the sequence number N(1) (step SA1). That is, the execution unit 212 executes the X-axis movement command.

[0071] Before the execution unit 212 executes the command specified in the block with sequence number N(1), the prefetch unit 213 may prefetch the commands specified in the blocks with sequence numbers N(1) to N(n) (step SAp1). Note that the processing performed by the prefetch unit 213, command determination unit 214, switching determination unit 215, and switching unit 216 prior to the processing in the execution unit 212 is referred to as prefetching processing.

[0072] Next, in the advance processing, the command determination unit 214 determines whether or not a tool change command is included in the commands pre-read by the pre-read unit 213 (step SAp2). That is, the command determination unit 214 determines whether or not a tool change command is included in the blocks up to sequence number N(n).

[0073] If the command determination unit 214 determines that the pre-read commands include a switching command (Yes in step SAp2), the switching determination unit 215 determines whether the switching condition is satisfied (step SAp3). In other words, if the command determination unit 214 determines that the pre-read commands include a tool change command, the switching determination unit 215 determines whether the switching condition is satisfied. The switching determination unit 215 determines whether the switching condition is satisfied by determining whether a tool change command is included in a block before the block with sequence number N(n).

[0074] If the switching condition is satisfied (Yes in step SAp3), the switching unit 216 switches the control state (step SAp4). That is, if a tool change command is not included in the block before the block with sequence number N(n), the switching unit 216 moves the tool specified by sequence number N(n) to the tool change position.

[0075] If the commands pre-read by the pre-reading unit 213 do not include a switching command (if No in step SAp2), and if the switching condition is not satisfied (if No in step SAp3), the control state is not switched and the advance processing ends.

[0076] On the other hand, when the execution of sequence number N(1) is completed, the execution unit 212 reads and executes the commands specified in sequence numbers N(2) to N(n-1) (step SA2).

[0077] Next, the execution unit 212 executes the command specified by the sequence number N(n) (step SA3). That is, the execution unit 212 executes tool change to the tool specified in the block with sequence number N(n). Finally, the execution unit 212 reads and executes the program end command specified by the sequence number N(n+1) (step SA4), thereby terminating the process.

[0078] Next, a process executed by the numerical control device 2 when the execution of the operation program is interrupted after the control state is switched by the switching unit 216 will be described.

[0079] 5 is a flowchart showing an example of processing executed when execution of an operation program is interrupted after the control state is switched by the switching unit 216. When the operation program is interrupted, the restoration determination unit 217 determines whether a restoration condition is satisfied (step SB1). The restoration condition is, for example, that the execution unit 212 is not currently executing a tool change command specified in a block with sequence number N(n), and that a tool change command has not been pre-read in a block prior to the block with sequence number N(n).

[0080] If the restoration determination unit 217 determines that the restoration condition is satisfied (Yes in step SB1), the restoration unit 218 restores the control state to the state before the switching (step SB2). That is, if the restoration determination unit 217 determines that a tool change command is not being executed and that a tool change command is not specified in a block prior to the block with sequence number N(n), the restoration unit 218 moves the tool specified in the block with sequence number N(n) to the position before it was moved to the tool change position.

[0081] Next, the switching storage unit 219 stores the switching information (step SB3). For example, the switching storage unit 219 stores information indicating that tool change preparation has been performed based on the tool change command specified in the block with sequence number N(n) during the execution of the command specified in the block with sequence number N(1).

[0082] Next, when the execution of the interrupted operation program is resumed (Yes in step SB4), the prefetching unit 213 resumes prefetching (step SB5). The prefetching unit 213 resumes prefetching from the block for which the switching command stored in the switching storage unit 219 is specified.

[0083] Next, the switching determination unit 215 determines whether or not switching of the control state is possible (step SB6). After the operation program is interrupted, if the operation program is resumed from a position before the execution of the switching command by the execution unit 212 and if switching information is stored in the switching storage unit 219, the switching determination unit 215 determines that switching of the control state is possible. Here, the position before the execution of the switching command means a block before the block in which the switching command is specified.

[0084] For example, in the operation program shown in Fig. 3, a switching command is specified in the block with sequence number N(n). In other words, in the operation program shown in Fig. 3, the position before the switching command is executed is the block before the block with sequence number N(n).

[0085] If the switching information is stored in the switching storage unit 219, the control state has been switched once before the execution of the operation program was interrupted. In other words, if the operation program is resumed from a position before the switching command was executed and the switching information is stored in the switching storage unit 219, it has already been verified that the control state can be switched. Therefore, in this case, it is not necessary for the command determination unit 214 and the switching determination unit 215 to again determine whether the switching conditions are met.

[0086] In addition, the switching judgment unit 215 may judge that the control state can be switched if the control state when the control state is restored in step SB2 is the same as the control state when pre-reading is resumed in step SB5.

[0087] If it is determined that the control state can be switched (Yes in step SB6), the switching unit 216 switches the control state (step SB7), and the process ends. That is, the switching unit 216 moves the tool specified in the block with sequence number N(n) to the tool change position.

[0088] In addition, if the restoration condition is not satisfied (No in step SB1), if the operation program is not resumed (No in step SB4), or if switching of the control state is not possible (No in step SB6), the processing in the numerical control device 2 ends.

[0089] As described above, the numerical control device 2 includes an execution unit 212 that reads an operation program consisting of a plurality of blocks and sequentially executes instructions included in each of the plurality of blocks; a look-ahead unit 213 that looks ahead to the instructions included in each of the plurality of blocks; a command determination unit 214 that determines whether a switching command for switching a control state is included in the commands look-ahead by the look-ahead unit 213; a switching determination unit 215 that, when the command determination unit 214 determines that the commands include a switching command, determines whether a switching condition for switching the control state based on the switching command is satisfied; a switching unit 216 that, when the switching determination unit 215 determines that the switching condition is satisfied, switches the control state before the switching command is executed by the execution unit 212; a restoration determination unit 217 that determines whether a restoration condition for restoring the control state switched by the switching unit 216 to the state before the switching is satisfied; and a restoration unit 218 that, when the restoration determination unit 217 determines that the restoration condition is satisfied, restores the control state to the state before the switching.

[0090] In addition, the restoration judgment unit 217 judges whether the restoration condition is satisfied when the execution of the operation program is interrupted after the control state is switched by the switching unit 216 and before the switching command is executed by the execution unit 212.

[0091] Furthermore, if the operation program is resumed from a position before the switching command was executed after the operation program was interrupted, the switching determination unit 215 determines that the control state can be switched.

[0092] In addition, the switching conditions include at least one of the following: a control command for a control object whose operation is affected by the switching of the control state has not been pre-read by the pre-reading unit 213; and the control command is not being executed by the execution unit 212.

[0093] The restoration condition is that a control command for a control object whose operation is affected by the switching of the control state is not being executed by the execution unit 212. The control object includes at least one of a motor and a peripheral device.

[0094] The control device further includes a switching memory unit 219 that stores switching information indicating that the switching unit 216 has switched the control state, and when the switching information is stored in the switching memory unit 219, the switching determination unit 215 determines that the switching condition is satisfied.

[0095] Therefore, the numerical control device 2 can prevent discrepancies from occurring between the operator's recognition of the control state and the actual control state.

[0096] Next, a process will be described in which the numerical control device 2 executes an operation program different from the operation program shown in FIG.

[0097] Fig. 6 is an example of an operation program, and Fig. 7 is a flowchart showing an example of processing executed by the numerical control device 2 when the operation program of Fig. 6 is executed.

[0098] The program number of the operation program shown in Figure 6 is "0002." The commands specified in the blocks from sequence number N(1) to sequence number N(5) are the same as those in the operation program shown in Figure 3. The block with sequence number N(n) specifies a "command to operate the C-axis by offsetting the maximum torque of the C-axis." Hereinafter, this command will be referred to as the C-axis offset command. The block with sequence number N(n+1) specifies a "program end command."

[0099] The execution unit 212 first reads the "X-axis movement command" with sequence number N(1) and moves the control axis in the X-axis direction (step SC1).

[0100] Meanwhile, the prefetching unit 213 prefetches the commands specified in the blocks from sequence number N(1) to sequence number N(n) (step SCp1).

[0101] The command determination unit 214 determines whether the commands pre-read by the pre-read unit 213 include a switching command for switching the control state (step SCp2). The operation program includes a C-axis offset command as a switching command for switching the control state. Therefore, the command determination unit 214 determines that the commands pre-read by the pre-read unit 213 include a switching command.

[0102] In this case, the switching determination unit 215 determines whether a switching condition for switching the control state is satisfied based on the switching command (step SCp3). The switching condition is that the control command for the control object has not been pre-read by the pre-read unit 213. Here, the control object is a control object of the numerical control device 2 whose operation is affected by the switching of the control state. Specifically, the control object is the C-axis, and the control command is a motion command for the C-axis.

[0103] 6, no C-axis operation command is specified in the blocks from sequence number N(1) to sequence number N(n-1), so the switching determination unit 215 determines that the switching condition is met.

[0104] Assume that a motion command for the C-axis is specified in sequence number N(6). In this case, if the look-ahead unit 213 offsets the maximum torque of the C-axis based on the look-ahead of the command with sequence number N(n), the execution unit 212 will operate the C-axis in the block with sequence number N(6) with the maximum torque of the C-axis offset.

[0105] That is, the numerical control device 2 performs control different from that performed when the operation programs are executed sequentially. Therefore, in order to prevent such control, the switching condition is that no operation command for the C-axis is specified in the blocks from sequence number N(1) to sequence number N(n-1).

[0106] If the switching determination unit 215 determines that the switching condition is satisfied, the switching unit 216 switches the control state before the switching command is executed by the execution unit 212 (step SCp4). That is, the switching unit 216 offsets the maximum torque of the C-axis.

[0107] On the other hand, when the execution of sequence number N(1) is completed, the execution unit 212 reads and executes the commands specified in sequence numbers N(2) to N(n-1) (step SC2).

[0108] Next, the execution unit 212 executes the command specified by the sequence number N(n) (step SC3). That is, the execution unit 212 executes the command to operate the C-axis specified in the block with the sequence number N(n). As a result, the C-axis operates with the maximum torque of C offset. Finally, the execution unit 212 reads and executes the program end command specified by the sequence number N(n+1) (step SC4), and the process ends.

[0109] Next, a process that is executed when the execution of the operation program is interrupted after the maximum torque of the C-axis is offset by the switching unit 216 will be described.

[0110] 8 is a flowchart showing an example of processing executed when the execution of an operation program is interrupted after the control state is switched by the switching unit 216. When the operation program being executed is interrupted, the restoration determination unit 217 determines whether the restoration condition is satisfied (step SD1). The restoration condition is that the C-axis offset command specified in the block with sequence number N(n) is not being executed, and that the C-axis offset command has not been read ahead in a block prior to the block with sequence number N(n).

[0111] In other words, the restoration conditions are that the switching command specified in the block with sequence number N(n) is not being executed, and that no C-axis offset command is specified in any block prior to the block with sequence number N(n).

[0112] If the restoration determination unit 217 determines that the restoration condition is satisfied (Yes in step SD1), the restoration unit 218 restores the control state to the state before switching (step SD2). In other words, if the restoration determination unit 217 determines that a C-axis movement command is not being executed and that a C-axis offset command has not been read ahead in a block prior to the block with sequence number N(n), the restoration unit 218 restores the state before the C-axis maximum torque was offset.

[0113] Next, the switching storage unit 219 stores the switching information (step SD3). For example, the switching storage unit 219 stores information indicating that the maximum torque of the C-axis has been offset based on the C-axis offset command specified in the block with sequence number N(n) during the execution of the command specified in the block with sequence number N(1).

[0114] Next, when the execution of the interrupted operation program is resumed (Yes in step SD4), the prefetching unit 213 resumes prefetching (step SD5). The prefetching unit 213 resumes prefetching from the block for which the switching command stored in the switching memory unit 219 is specified.

[0115] Next, the switching determination unit 215 determines whether or not the control state can be switched (step SD6). For example, if the operation program is interrupted and then resumed from a position before the switching command was executed, and switching information is stored in the switching storage unit 219, the switching determination unit 215 determines that the control state can be switched.

[0116] If it is determined that the control state can be switched (YES in step SD6), the switching unit 216 switches the control state (step SD7), and the process ends. In other words, the switching unit 216 offsets the maximum torque of the C-axis.

[0117] If the restoration conditions are not met (No in step SD1), if the operation program is not resumed (No in step SD4), or if switching of the control state is not possible (No in step SD6), the processing in the numerical control device 2 ends.

[0118] Next, a process will be described in which the numerical control device 2 executes an operation program different from the operation programs shown in FIGS.

[0119] Fig. 9 is an example of an operation program, and Fig. 10 is a flowchart showing an example of processing that is executed by the numerical control device 2 when the operation program of Fig. 9 is executed.

[0120] The program number of the operation program shown in Figure 9 is "0003." In addition, "command A" is specified in the block with sequence number N(1). In addition, "command B to switch control cycle" is specified in the block with sequence number N(n). In addition, "program end command" is specified in the block with sequence number N(n+1).

[0121] The execution unit 212 first reads the "command A" specified in the block with sequence number N(1) and executes command A (step SE1).

[0122] Meanwhile, the prefetching unit 213 prefetches the commands specified in the blocks from sequence number N(1) to sequence number N(n) (step SEp1).

[0123] Next, the command determination unit 214 determines whether the commands pre-read by the pre-read unit 213 include a switching command for switching the control state (step SEp2). The operation program includes command B for switching the control period as a switching command for switching the control state. Therefore, the command determination unit 214 determines that the commands pre-read by the pre-read unit 213 include a switching command.

[0124] In this case, the switching determination unit 215 determines whether a switching condition for switching the control state based on the switching command is satisfied (step SEp3). The switching condition is, for example, that a command for switching the control period has not been pre-read by the pre-read unit 213 in a block prior to the block with sequence number N(n). In other words, a command for switching the control period has not been specified in a block prior to the block with sequence number N(n).

[0125] 9, no command to switch the control period is specified in the blocks from sequence number N(1) to sequence number N(n-1), so the switching determination unit 215 determines that the switching condition is met.

[0126] If the switching determination unit 215 determines that the switching condition is satisfied (YES in SEp3), the switching unit 216 switches the control state before the switching command is executed by the execution unit 212 (step SEp4). That is, the switching unit 216 switches the control period.

[0127] On the other hand, when the execution unit 212 finishes executing the command specified in the block with sequence number N(1), it reads and executes the commands specified in sequence numbers N(2) to N(n-1) (step SE2).

[0128] Next, the execution unit 212 executes the command specified by the sequence number N(n) (step SE3). That is, the execution unit 212 executes command B specified in the block with sequence number N(n). Finally, the execution unit 212 reads and executes the program end command specified by the sequence number N(n+1) (step SE4), and the process ends.

[0129] Next, a process that is executed when the execution of the operating program is interrupted after the switching unit 216 has switched the control period will be described.

[0130] 11 is a flowchart showing an example of processing executed when execution of an operation program is interrupted after the control state has been switched by the switching unit 216. When the operation program is interrupted, the restoration determination unit 217 determines whether a restoration condition is met (step SF1). The restoration condition is, for example, that a command to switch the control state specified in the block with sequence number N(n) is not being executed, and that a command to switch the control state has not been pre-read in a block prior to the block with sequence number N(n).

[0131] In other words, the restoration condition is that a command to switch the control state specified in the block with sequence number N(n) is not being executed, and that a command to switch the control state is not specified in a block prior to the block with sequence number N(n).

[0132] If the restoration determination unit 217 determines that the restoration condition is satisfied (Yes in step SF1), the restoration unit 218 restores the control state to the state before the control period was switched (step SF2). In other words, if the restoration determination unit 217 determines that a command to switch the control period is not being executed and that the control period is to be switched but has not been read ahead in a block prior to the block with sequence number N(n), the restoration unit 218 returns the control period to the state before the control period was switched.

[0133] Next, the switching storage unit 219 stores the switching information (step SF3). For example, the switching storage unit 219 stores information indicating that the control period has been switched based on the switching command specified in the block with sequence number N(n) during the execution of the command specified in the block with sequence number N(1).

[0134] Next, when the execution of the interrupted operation program is resumed (Yes in step SF4), the prefetching unit 213 resumes prefetching (step SF5). The prefetching unit 213 resumes prefetching from the block for which the switching command stored in the switching storage unit 219 is specified.

[0135] Next, the switching determination unit 215 determines whether or not the control state can be switched (step SF6). For example, if the operation program is interrupted and then resumed from a position before the switching command was executed, and switching information is stored in the switching storage unit 219, the switching determination unit 215 determines that the control state can be switched.

[0136] If it is determined that the control state can be switched (Yes in step SF6), the switching unit 216 switches the control state (step SF7), and the process ends. In other words, the switching unit 216 switches the control period.

[0137] If the restoration condition is not satisfied (No in step SF1), if the operation program is not resumed (No in step SF4), or if switching of the control state is not possible (No in step SF6), the processing in the numerical control device 2 ends.

[0138] The present disclosure is not limited to the above-described embodiments, and can be appropriately modified without departing from the spirit of the present disclosure. For example, any of the components of the embodiments of the present disclosure can be modified or omitted.

[0139] REFERENCE SIGNS LIST 1 Industrial machine 2 Numerical control device 201 Hardware processor 202 Bus 203 ROM 204 RAM 205 Non-volatile memory 206 Interface 207 Axis control circuit 208 Spindle control circuit 209 PLC 210 I / O unit 211 Program storage unit 212 Execution unit 213 Look-ahead unit 214 Command determination unit 215 Switching determination unit 216 Switching unit 217 Restoration determination unit 218 Restoration unit 219 Switching storage unit 3 Input / output device 4 Servo amplifier 5 Servo motor 6 Spindle amplifier 7 Spindle motor 8 Auxiliary equipment

Claims

1. an execution unit that reads an operation program consisting of a plurality of blocks and sequentially executes commands included in each of the plurality of blocks; a look-ahead unit that looks ahead at the instructions included in each of the plurality of blocks; a command determination unit that determines whether or not a switching command for switching a control state is included in the commands pre-read by the pre-read unit; a switching determination unit that, when it is determined by the command determination unit that the command includes the switching command, determines whether or not a switching condition for switching the control state is satisfied based on the switching command; a switching unit that switches the control state before the switching command is executed by the execution unit when the switching determination unit determines that the switching condition is satisfied; a restoration determination unit that determines whether a restoration condition for restoring the control state switched by the switching unit to a state before the switching is satisfied; a restoration unit that restores the control state to the state before the switching when the restoration determination unit determines that the restoration condition is satisfied; A numerical control device comprising:

2. 2. The numerical control device according to claim 1, wherein the restoration determination unit determines whether the restoration condition is satisfied when execution of the operation program is interrupted after the control state is switched by the switching unit and before the switching command is executed by the execution unit.

3. 3. The numerical control device according to claim 2, wherein the switching determination unit determines that the control state can be switched when the operation program is resumed from a position before the switching command is executed after the operation program is interrupted.

4. A numerical control device according to any one of claims 1 to 3, wherein the switching conditions include at least one of a control command for a control object whose operation is affected by the switching of the control state not being pre-read by the pre-reading unit, and the control command not being executed by the execution unit.

5. A numerical control device according to any one of claims 1 to 3, wherein the restoration conditions include at least one of: a control command for a control object whose operation is affected by the switching of the control state not being pre-read by the pre-reading unit; and the control command not being executed by the execution unit.

6. The numerical control device according to claim 4 , wherein the controlled object includes at least one of a motor and a peripheral device.

7. A numerical control device as described in claim 5, wherein the controlled object includes at least one of a motor and a peripheral device.