Numerical control device
The numerical control device provides a safe interface for adding functions by managing task execution through memory management and monitoring, ensuring reliable operation and stability.
Patent Information
- Application Number
- DE102018008369
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-10-25
- Filing Date
- 2018-10-23
- Publication Date
- 2026-05-13
- Estimated Expiration
- 2038-10-23
AI Technical Summary
Numerical control systems lack a safe interface for adding original functions like condition monitoring and emergency safety without compromising reliability and stability.
A numerical control device with a task control unit that manages task registration, start, stop, and deletion, utilizing memory management, execution time calculation, and task monitoring to ensure safe execution.
Ensures reliable and stable operation by ensuring sufficient memory and CPU resources, optimizing task execution, and preventing unexpected behavior.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Background of the invention; Field of the invention
[0001] The present invention relates to a numerical control device and, in particular, a numerical control device to which original functions can be safely added. Description of the relevant state of the art
[0002] There is a need to add original functions, such as condition monitoring, high-speed axis control, and emergency safety functions for a machine tool, to a numerical control device. To meet this need, it is necessary to provide an interface for registering tasks at any time, e.g., during the execution of a machining program, a mechanism to make a specific processing operation memory-resident and execute it multiple times, and the like.
[0003] A universal multitasking operating system can perform operations to register, start, stop, and delete tasks at any given time, providing a software developer with an interface to implement such task control according to purpose and task execution situations. Furthermore, by specifying the task start cycle and priority, the execution sequence and timing of multiple tasks can be managed, allowing for finer control of system operation.
[0004] The published Japanese patent application JP 2000-293 386 A, for example, describes an operating system which, when it is determined that the current remaining memory capacity is insufficient to execute a new task, calculates the task utilization rate, stops a running task with the lowest utilization rate, and repeats the calculation and task stopping so that free space is created.
[0005] However, numerical control systems require higher levels of reliability and security than general-purpose multitasking operating systems. Therefore, conventional numerical control systems, based on the assumption that tasks to be executed are pre-registered, are designed such that task switching times and the like are set to maintain a reasonable memory utilization rate and CPU operating speed. In other words, the conventional numerical control system is not based on the assumption that tasks are registered or started at a time specified by a user.
[0006] Simply adding an interface for arbitrarily controlling tasks to a conventional numerical control device of this type can cause unexpected changes in behavior. For example, if tasks are registered or started at arbitrary times, system errors can occur due to a delay in axis control processing, a reduction in communication speed, or memory exhaustion. This can potentially reduce the reliability and operational stability of the numerical control device. Therefore, there is a need for an interface capable of arbitrarily controlling tasks without compromising the necessary reliability and safety. Summary of the invention
[0007] The present invention was made to solve the above problems and aims to provide a numerical control device to which original functions can be safely added.
[0008] A numerical control device according to one aspect of the present invention is capable of providing an interface that performs safe task control for adding an original function.The numerical control unit comprises a memory management unit configured to develop or initialize a program executed by the task in memory, to analyze the program and to gather information about the program; an execution time calculation unit configured to calculate an execution time of the task; an execution condition determination unit configured to determine an execution condition of the task based on the execution results of the memory management unit and the execution time calculation unit; a task monitoring unit configured to monitor the state of a computing unit and to determine the computing unit to which the task is assigned; and a task control unit configured to register and start the task in the assigned computing unit based on the execution condition.
[0009] The task control unit can stop the started task in response to a command.
[0010] The task control unit can delete the stopped task in response to a command.
[0011] The task monitoring unit can determine the computing unit executing the task based on the idle times or sleep / dormant mode times of a plurality of computing units.
[0012] The numerical control unit may issue a message if the memory management unit is unable to develop the program in memory, or if the task monitoring unit is unable to determine the computing unit that is executing the task.
[0013] According to the present invention, a numerical control device can be provided to which original functions can be safely added. Brief description of the drawings
[0014] The foregoing and other objectives and features of the present invention are evident from the following description of embodiments with reference to the accompanying drawings. These show: Fig. 1 a block diagram showing the functional configuration of a numerical control device; Fig. 2. A block diagram showing components of a task registration process; Fig. 3 a representation showing a method for arranging executable programs in a memory; Fig. 4. A block diagram showing components of a task start processing; Fig. 5. A representation showing how tasks are performed; Fig. 6. A block diagram showing components of a task stop processing; Fig. 7. A block diagram showing components of a task deletion process; Fig. 8 a representation showing the task registration processing in one embodiment; Fig. 9 a representation showing the task start processing in one embodiment; Fig. 10 a representation showing task stop processing in one embodiment; and Fig. Figure 11 shows a representation illustrating the task deletion processing in one embodiment. Detailed description of the preferred embodiments
[0015] A numerical control device 100 according to an embodiment of the present invention is described with reference to the accompanying drawings. Fig. Figure 1 is a block diagram showing the functional configuration of the numerical control unit 100.
[0016] The numerical control unit 100 comprises a task control unit 110, a processing program analysis unit 120, an execution data conversion unit 130, an execution control unit 140, an axis drive unit 150, a memory management unit 160, an execution time calculation unit 170, an execution condition setting unit 180, and a task monitoring unit 190. The numerical control unit 100 typically includes a central processing unit (CPU), a memory device, an input / output device, and the like. These processing units are logically implemented when the CPU executes programs stored in the memory device.
[0017] The task control unit 110, the machining program analysis unit 120, the execution data conversion unit 130, the execution control unit 140 and the axis drive unit 150, as typical components of the numerical control device, are described first.
[0018] The Task Control Unit 110 performs operations such as registering, starting, stopping and deleting tasks, task scheduling and task resource management.
[0019] The processing program analysis unit 120 reads a processing program, performs a lexical analysis block by block, and outputs a processing-related command to the execution data conversion unit 130. Furthermore, according to the present embodiment, it is assumed that task-related commands can be described in the processing program. The task-related commands comprise a command group constituting an execution program and commands related to the registration, start, stop, and deletion of the tasks. The execution program is output to the execution data conversion unit 130. The commands related to the registration, start, stop, and deletion of the tasks are output to the task monitoring unit 190.
[0020] The execution data conversion unit 130 converts the processing-related instruction into executable binary data and outputs it to the execution control unit 140. Furthermore, when the execution program is entered, the execution data conversion unit 130 converts the instruction group of the execution program into executable binary data and outputs it to the memory management unit 160.
[0021] The execution control unit 140 performs interpolation processing based on the executable binary data, calculates the movement amounts of axes and outputs them to the axis drive unit 150.
[0022] Based on the movement amounts calculated by the execution control unit 140, the axis drive unit 150 controls current and voltage and drives the axes.
[0023] The following is a description of the memory management unit 160, the execution time calculation unit 170, the execution condition definition unit 180, and the task monitoring unit 190, which are original components of the numerical control device 100 according to the present embodiment. The task registration processing, task start processing, task stop processing, and task deletion processing, which are characteristic functions of the present invention, are implemented by these components.
[0024] As in Fig. As shown in Figure 2, the components related to task registration processing mainly comprise the memory management unit 160, the execution time calculation unit 170, and the execution condition setting unit 180.
[0025] The memory management unit 160 temporarily stores the executable binary data of the task output by the execution data conversion unit 130 and calculates the size of the program executed by the task. Additionally, the memory management unit 160 calculates available free space in memory and determines a method for developing the program in memory. If sufficient contiguous free space in memory can be ensured for the development of the entire program, the program is developed in this free space (see above representation of Fig. 3) If the entire program can be developed by adding a plurality of free spaces, although a sufficient contiguous free space cannot be guaranteed for the development of the entire program, the program is divided into a plurality of fragments, connection information is appended to the divided programs, and the divided programs are then developed in the plurality of free spaces (middle representation in Fig. 3) Typically, the connection information specifies the starting address of the next program fragment to be read and is appended to the end of each program fragment. If there is insufficient contiguous free space to develop the entire program (see below for more details), the connection information is used. Fig. 3) This will be reported to a user via an alarm or other similar means. The user may be prompted to choose whether to continue operation without registering a task, so that operation can continue or be suspended depending on the outcome of the selection.
[0026] Furthermore, the Memory Management Unit 160 analyzes the program to determine connection information, the number of variables used, the type of variables, and similar data. Based on this information, Memory Management Unit 160 calculates the resources required for task operation and reports these calculated resources to the Task Control Unit 110. Typical resources include, for example, batch size, user permissions, and account information. The Task Control Unit 110 verifies whether the required resources can be ensured and reports the result of this verification to Memory Management Unit 160.
[0027] The execution cycle and priority can be predefined in the processing program or predefined by the user as parameters, in addition to calculations by the memory management unit 160. The execution cycle and priority described in the processing program can be detected by the memory management unit 160 and the execution time calculation unit 170.
[0028] If the resources can be secured, the memory management unit 160 reports information to the execution time calculation unit 170 and the execution condition setting unit 180, such as an address obtained by developing the program, a program size, and a task entry point (initial code to start processing when the task is started).
[0029] If the resources cannot be guaranteed, the same processing will be carried out as in the case described above, where sufficient contiguous free space for the development of the entire program cannot be guaranteed.
[0030] The execution time calculation unit 170 estimates the execution time of each registered task based on information reported by the memory management unit 160. For example, the execution time can be calculated by multiplying the consumption time (number of clock cycles required for execution) of each instruction in the program by the number of instructions that the task can execute. With respect to a group of instructions that is executed twice due to calls to a loop and a subroutine, etc., times corresponding to an execution frequency are summed. The execution time calculation unit 170 reports the calculated execution time to the execution condition setting unit 180 as task information.
[0031] The execution condition setting unit 180 classifies the information reported by the execution time calculation unit 170 into information required for task registration and information required for task start, and reports the classification to the task control unit 110, thereby necessitating a new task registration. Information required for task registration includes, for example, a task execution cycle, a priority, a batch size, and an entry point. Information required for task start includes, for example, an execution program size and a task execution time.
[0032] The Task Control Unit 110 can prioritize setting the task execution cycle based on the task execution time. If the task execution time is longer than the task execution cycle, it is highly likely that the task will not function correctly. Therefore, in this case, the task execution cycle is modified so that the task execution time is as close as possible to the task execution cycle. If this is not possible, the task execution cycle should be set to the longest possible length.
[0033] As in Fig. As shown in Figure 4, the components related to task start processing mainly comprise the task monitoring unit 190.
[0034] If the CPU is a multi-core CPU, the Task Monitor Unit 190 constantly monitors the execution state of each core and designates one core that can ensure the execution time of each registered task. As shown in Fig. As shown in Figure 5, for example, an idle time (or sleep time) within each core's execution cycle is measured, and a core with a task execution time no longer than the idle time is extracted as the registry target. If multiple cores are extracted, the task can be assigned to a core with the longest idle time within the execution cycle. In the above assessment, an average or integrated value of idle times across multiple execution cycles can be compared to the task execution time. In the case of Fig. For example, at point 5, the integrated idle time value (indicated by bold dashed lines) of core 1 is highest, therefore it is determined that core 1 has ample processing time. In this case, task monitor unit 190 designates core 1 as the new task assignment target.
[0035] Once the task assignment target is determined, the task monitoring unit 190 requests the task control unit 110 to start the task. The task control unit 110 then starts the task specified by the task monitoring unit 190.
[0036] If the idle times (or their average, integrated, etc.) of all cores are so low that the task execution time calculated by the execution time calculation unit 170 cannot be guaranteed, this will be reported to the user by an alarm or other similar means. The user may be prompted to choose whether to continue operation without registering a task, so that operation can continue or be suspended depending on the outcome of the selection.
[0037] Alternatively, tasks can be assigned to a core in which other tasks with a similar priority to the new task have already been executed (so that operation can be carried out in an environment that facilitates an average distribution of execution times in a round-robin system), or to a core in which a small number of tasks have already been executed (so that operation can be carried out in an environment in which few other tasks are affected by a new task registration).
[0038] As in Fig. As shown in Figure 6, the components related to task stop processing mainly comprise the task monitoring unit 190.
[0039] When the processing program analysis unit 120 reports a stop command for a specific task to the task monitoring unit 190, it requests the task control unit 110 to stop the task. The task control unit 110 then stops the task specified by the task monitoring unit 190. It is preferable to report the task stop request to the task control unit 110 only after a series of processes executed by the task have completed. This is because inconsistent data may remain in memory or machine behavior may become unstable if the task is stopped during execution.
[0040] As in Fig. As shown in Figure 7, the components related to task deletion processing mainly comprise the Task Monitoring Unit 190 and the Memory Management Unit 160.
[0041] When the task monitoring unit 190 receives a delete command for a specific task from the processing program analysis unit 120, it confirms that the task is being stopped. Once the task is stopped, the task monitoring unit 190 requests the task control unit 110 to delete the task and reports this to the memory management unit 160.
[0042] When the task monitor 190 reports a delete request for a specific task to the memory management unit 160, it specifies a program that has been executed by the task so far and confirms that the program is not being used by any other task. If the program is not being used by any other task, the program is deleted and the memory is initialized (or released). If, however, the program is being used by another task, the program is left in memory, or only some unnecessary memory areas are initialized, after which processing ends. Designs
[0043] One embodiment of the numerical control device 100 is described with reference to the Fig. 8 to 11 described. The numerical control device 100 according to this embodiment registers, starts, stops and deletes tasks in response to commands described in the processing program. Task registration
[0044] In this embodiment, as described in Fig. Figure 8 shows the command group forming the execution program and the task registration commands (sections surrounded by dashed lines in Fig. 8) be described in the editing program. “@@CREATE [A]” is a registration command for a task [A]. “PRIORITY LOW” is a command to set the task priority to LOW. “EXECCYCLE 32” is a command to set the task execution cycle to 32. Blocks that begin with “IF…” and end with “END IF;” constitute the execution program.
[0045] The task registration commands and the command group forming the execution program are lexically analyzed by the processing program analysis unit 120. Furthermore, after being converted into executable binary data by the execution data conversion unit 130, the command group forming the execution program is output to the memory management unit 160.
[0046] The following is a description of examples of lexical analysis processing and binary data conversion processing based on a block “G110 C50.0;” in the processing program. First, the processing program analysis unit 120 splits a string of the block into “G”, “110”, “C”, “50.0”, and “;”. “G” is interpreted as a code specifying a preparatory function of the numeric control unit. “110” is interpreted as a code specifying peripheral axis control of the preparatory function. “C” is interpreted as a code to set the address of a peripheral axis C. “50.0” is interpreted as a code to store a floating-point number 50.0 at the address of C. “;” is interpreted as a code specifying the end of the block.
[0047] The execution data conversion unit 130 then generates the binary data based on the result of the lexical analysis. For example, the execution data conversion unit 130 first generates a binary file "0x36D00000" to specify the peripheral axis control. Then it generates a binary file "0x00001000" to which the address of C is appended. Finally, based on these binary files, the execution data conversion unit 130 generates executable binary data "0x36D010000" and outputs it to the memory management unit 160.
[0048] Memory management unit 160 calculates the amount of memory used by the received executable binary data. If sufficient free space is available in memory to develop the binary data, the executable binary data is registered in memory. If no free space is available, the user is notified, via an alarm, warning, or similar message, that the task cannot be registered.
[0049] Furthermore, the memory management unit 160 reports information to the execution time calculation unit 170 and the execution condition setting unit 180, specifying various attributes of the task. The execution time calculation unit 170 calculates the execution time of the task and reports this to the execution condition setting unit 180. The execution condition setting unit 180 reports the execution time and the information specifying the various attributes of the task to the task control unit 110 and requests the registration of the task. Task start
[0050] In this embodiment, as described in Fig. 9 shown, commands (sections surrounded by dashed lines in Fig. 9) to start the task in the editing program. “@@START [A]” is a start command for task [A]. “@@START [B]” is a start command for task [B].
[0051] When the processing program analysis unit 120 interprets the task start command, it notifies the task monitoring unit 190 that the specified task should be started. If an unregistered task or a task that is already running is specified as the object to be started, the task monitoring unit 190 notifies the user, by means of an alarm, warning, or similar message, that the task cannot be started.
[0052] The Task Monitor Unit 190 monitors the execution states of all tasks running on each CPU core and assigns a task to a core with ample processing time. If no CPU has sufficient capacity to execute a new task, the user is notified via an alarm, warning, or similar message that the task cannot be started, without actually starting the task. Task Stop
[0053] In this embodiment, as in Fig. 10 shown, a command (the section surrounded by dashed lines in Fig. 10) to stop the task in the editing program. “@@HOLD [A]” is a stop command for task [A].
[0054] When the processing program analysis unit 120 interprets the task stop command, it notifies the task monitoring unit 190 that the specified task should be stopped. If an already stopped task is specified as the object to be stopped, the task monitoring unit 190 notifies the user, via an alarm, warning, or similar message, that the task has already been stopped. Task deletion
[0055] In this embodiment, as in Fig. 11 shown, a command (the section surrounded by dashed lines in Fig. 11) to delete the task in the editing program. “@@DELETE [A]” is a delete command for task [A].
[0056] When the processing program analysis unit 120 interprets the task delete command, it notifies the task monitoring unit 190 that the specified task should be deleted. If a non-existent task or a running task is specified as the object to be deleted, the task monitoring unit 190 notifies the user, via an alarm, warning, or similar message, that the task cannot be deleted.
[0057] If the program executed by the specified task is not being used by any other task, memory management unit 160 deletes the program's executable data from memory. If the program is in use, memory management unit 160 only deletes some unnecessary executable data from memory.
[0058] According to the present embodiment, a secure task control interface can be provided for adding original functions to the numerical control device 100.
[0059] Although one embodiment of the present invention has been described above, the invention is not limited to the embodiment or examples described above and can be suitably modified and implemented in various ways.
[0060] In the processing described above, for example, the task monitoring unit 190 determines, in the case where the CPU is a multi-core CPU, the core that is to be the task assignment target. However, the present invention is not limited to this, and the same processing can be performed, for example, if, in the case where multiple CPUs are present, one CPU is determined to be the task assignment target, or if, in the case where multiple information processors are present, one information processor is determined to be the task assignment target. In the present invention, the cores, CPUs, and information processors are collectively referred to as "processing units" that execute tasks.
[0061] Furthermore, the task registration, start, stop and delete commands are given as purely exemplary examples in one embodiment and can be described in any other form.
Claims
[1] Numerical control device capable of providing an interface that performs safe task control for adding an original function, wherein the numerical control device comprises: - a memory management unit that is set up to develop or initialize a program executed by a task in memory, analyze the program, and gather information about the program, - an execution time calculation unit that is set up to calculate an execution time of the task, - an execution condition setting unit configured to set an execution condition of the task based on the execution results of the memory management unit and the execution time calculation unit, - a task monitoring unit that is configured to monitor the state of a computing unit and to determine the computing unit to which the task is assigned, and - a task control unit that is configured to register and start the task in the assigned computing unit based on the execution condition. [2] Numerical control device according to claim 1, wherein the task control unit stops the started task in response to a command. [3] Numerical control device according to claim 2, wherein the task control unit deletes the stopped task in response to a command. [4] Numerical control device according to claim 1, wherein the task monitoring unit determines the computing unit that performs the task based on the idle times or sleep or slumber times of a plurality of the computing units. [5] Numerical control device according to claim 1, wherein a message is issued when the memory management unit is unable to develop the program in memory, or when the task monitoring unit is unable to determine the computing unit that is performing the task.