Automatic control method, system and equipment for mechanical motion and storage medium

By using user threads and worker thread pools to process axis motion instructions in the motion control system, the problem of chaotic instruction response in multi-axis motion control is solved, and the response speed and stability of the system are improved.

CN118550254AInactive Publication Date: 2024-08-27HUIZHOU BAOJIEXIN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410556962.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing motion control system adopts a non-sequential execution method for multi-axis motion control. As a result, when the axis is being controlled by a function block to move, the command response may be chaotic when other function blocks send instructions, affecting the response speed and stability of the system.

Method used

Obtain axis motion operation instructions by generating user threads, access the instruction storage queue to obtain axis motion information, and store it in the buffer component, generate a motion adjustment working thread, input it to the working thread pool, generate motion adjustment instructions for processing, and ensure that the instructions are processed according to the Sequential execution reduces user thread competition and response delays.

Benefits of technology

It effectively improves the system's response speed to mechanical axis motion instructions, reduces the system's chaotic response to axis motion control, and improves the system's stability and response efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550254A
    Figure CN118550254A
Patent Text Reader

Abstract

The invention relates to the technical field of automatic control, in particular to a mechanical motion automatic control method, system and device and a storage medium, and the mechanical motion automatic control method comprises the steps: generating a plurality of user threads based on user operation input, and obtaining a shaft motion operation instruction according to the plurality of user threads; accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component; generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread to a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread; and in response to the motion adjustment instruction, performing motion adjustment processing on the shaft motion information, and performing response operation on a plurality of user threads based on the shaft motion information subjected to the motion adjustment processing. The method has the effects that the response speed of the system to the mechanical axis motion instruction is increased, and the situation that the response of the system to the axis motion control is disordered is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic control, and in particular to a mechanical motion automatic control method, system, device and storage medium. Background Art

[0002] Motion control is a branch of automation. It uses some devices commonly known as servo mechanisms, such as hydraulic pumps, linear actuators or motors to control the position, speed and acceleration of mechanical devices. Motion control can be roughly divided into two categories: one is the motion control of master and slave axes: generating the positioning command of the slave axis according to the positioning of the master axis; the other is multi-axis coordinated motion control, in which there is no distinction between master and slave axes, only a collection of multiple axes, called an axis group; motion control technology can be used to control robots, CNC machine tools and automatic handling systems, and is widely used in packaging, printing, textile and assembly industries. It can be seen that motion control systems are an important part of intelligent manufacturing equipment.

[0003] Traditional motion control systems are mostly closed systems. When users want to expand functions, they must seek help from the system supplier. If users directly perform secondary development on a closed motion control system, it is often difficult. In order to make the implementation of motion control software simpler, soft PLC technology is introduced in traditional motion control software design. Soft PLC uses specific hardware as a support platform and implements the basic functions of hardware PLC in the form of software, that is, the control functions of PLC are encapsulated in the software. It is a control system with high openness and strong portability. It uses standard programming languages ​​and unified software models to establish a standard motion control library, making the industrial control system development platform independent of hardware, ensuring that the software has good reusability, maintainability and scalability, and can meet standardization requirements in both the development and maintenance stages.

[0004] However, the existing motion control system uses a non-sequential execution method for the control execution of multi-axis motion. This non-sequential execution method means that if there are multiple function blocks controlling the same axis, but the axis can only execute one of the control instructions, the system will execute the corresponding instructions according to the user's selection, but not necessarily in the order of instruction input. The following problems may occur when the non-sequential execution method is used: when the axis is being controlled by a function block to move, and other function blocks send instructions to the axis at this time, multiple instructions will control one axis at the same time, causing confusion in instruction response. Therefore, there is room for improvement. Summary of the invention

[0005] In order to improve the system's response speed to mechanical axis motion instructions and reduce the system's chaotic response to axis motion control, the present application provides a mechanical motion automatic control method, system, device and storage medium.

[0006] The above-mentioned invention objective of the present application is achieved through the following technical solutions: A method for automatic control of mechanical motion, comprising the steps of: Generate multiple user threads based on user operation input, and obtain axis motion operation instructions according to the multiple user threads; Accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component; Generate a motion adjustment work thread based on the axis motion information, input the motion adjustment work thread into a preset work thread pool, and generate a motion adjustment instruction based on the motion adjustment work thread; In response to the motion adjustment instruction, motion adjustment processing is performed on the axis motion information, and response operations are performed on multiple user threads based on the axis motion information after the motion adjustment processing.

[0007] By adopting the above technical solution, when a user operates a motion control system, a corresponding user thread is generated according to the user's operation on the motion control system, and a corresponding user operation instruction is obtained through each user thread. A preset instruction storage queue is accessed according to the user operation instruction. The instruction storage queue refers to a plurality of control instructions for motion control of axis motion. The axis motion information is obtained, and the axis motion information is temporarily stored in a preset buffer component. At the same time, a motion adjustment work thread is generated using the axis motion information, and the motion adjustment work thread is input into a preset work thread pool. A motion adjustment instruction is generated through the motion adjustment work thread, and then, according to the motion adjustment instruction, the axis motion information stored in the buffer component is subjected to motion adjustment processing. After the axis motion adjustment is completed, the axis motion information is responded to and the next axis motion operation instruction to be performed is read from the instruction storage queue to respond to the multi-axis motion of the machine. In the process of the user operating the motion control system, the function of the user thread is only used for the instruction storage queue to obtain the axis motion information, and the buffer component is used to store and record the axis motion information, and the operation of generating the motion adjustment instruction for the instruction storage queue is stored in the work thread pool, which can effectively reduce the user's operation delay on the machine, improve the system's response speed to the mechanical axis motion instruction, and reduce the occurrence of confusion in the system's response to the axis motion control.

[0008] In a preferred example, the present application can be further configured as follows: accessing a preset instruction storage queue according to the axis motion operation instruction, obtaining axis motion information, and storing the axis motion information in a preset buffer component specifically includes: Based on the axis motion operation instruction, acquiring axis motion information in the instruction storage queue; The axis motion information is formed into a ring-shaped buffer data structure and stored in a buffer component.

[0009] By adopting the above technical solution, the motion control system inputs motion instructions to the mechanical axis according to the user's operation, generates corresponding axis motion operation instructions, obtains relevant axis motion information in the instruction storage queue through the axis motion operation instructions, and constructs the axis motion information into a ring buffer data structure, which is stored in the buffer component. The ring buffer data structure is used to temporarily store the axis motion information, and each user thread can be bound to a corresponding axis motion information. When multiple user threads respond at the same time, that is, when the motion control system performs multi-axis motion control on the machine, it can avoid system response confusion caused by competition among multiple user threads.

[0010] In a preferred example, the present application may be further configured as follows: based on the axis motion operation instruction, obtaining the axis motion information in the instruction storage queue specifically includes: Generate a first judgment instruction according to the axis motion operation instruction, and judge whether the axis motion operation instruction is in the instruction storage queue based on the first judgment instruction to obtain a first judgment result; When the first judgment result is that the instruction does not exist, a stop signal is generated and output to the working thread pool, and the response to the axis motion operation instruction is stopped based on the stop signal; When the first judgment result is that the instruction exists, a second judgment instruction is generated, and based on the second judgment instruction, it is judged whether the axis motion operation instruction is expired to obtain a second judgment result, and the axis motion information is obtained based on the second judgment result.

[0011] By adopting the above technical solution, the corresponding axis motion information is read in the instruction storage queue according to the axis motion operation instruction, and the first judgment instruction is used to judge whether the axis motion operation instruction for the machine is in the instruction storage queue. If the axis motion operation instruction is not stored in the instruction storage queue, a termination signal is generated and output to the working thread pool, and the control of the mechanical movement is terminated based on the termination signal; if the axis motion operation instruction is stored in the instruction storage queue, a second judgment instruction is generated, and the second judgment instruction is used to judge whether the axis motion operation instruction is expired, and a second judgment result is obtained, and the axis motion information in response to the axis motion operation instruction is determined according to the second judgment result.

[0012] In a preferred example, the present application may be further configured as follows: generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread into a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread, specifically including: Generate a time wheel working thread and a motion elimination working thread according to the axis motion information; The time wheel working thread and the motion elimination working thread are stored in a working thread pool, a timed motion information processing instruction is generated based on the time wheel working thread, and a motion update instruction is generated based on the motion elimination working thread.

[0013] By adopting the above technical solution, a time wheel working thread and a motion elimination working thread are generated according to the axis motion information, and the generated time wheel working thread and motion elimination working thread are input into the working thread pool in the motion control system. After receiving the time wheel working thread and the motion elimination working thread, the working thread pool generates a timed processing motion information instruction and a motion update instruction, and executes the operation of the motion control processing of the machine in the working thread in the motion control system, thereby reducing the operation on the user side and improving the system's response speed to the mechanical axis motion instruction.

[0014] In a preferred example, the present application may be further configured as follows: before accessing a preset instruction storage queue according to the axis motion operation instruction, obtaining axis motion information, and storing the axis motion information in a preset buffer component, the mechanical motion automatic control method includes: Obtaining a current storage capacity of the instruction storage queue, and determining whether the current storage capacity of the instruction storage queue is greater than a storage threshold; When the storage capacity of the instruction storage queue is greater than the storage threshold, an elimination order is set for the motion instructions in the instruction storage queue, and the motion instructions are deleted regularly according to the elimination order; Input the axis motion operation command into the processed command storage queue.

[0015] By adopting the above technical solution, before writing the axis motion operation instruction, the current storage capacity of the instruction storage queue in the motion control system is obtained to determine whether the storage capacity of the instruction storage queue has exceeded the storage threshold of the instruction storage queue. When the current storage capacity of the instruction storage queue exceeds the storage threshold, an elimination order is set for the motion instructions of the instruction storage queue. According to the set elimination order, the motion instructions of the instruction storage queue are deleted at regular intervals, thereby releasing the storage capacity of the instruction storage queue. After the instruction storage queue is processed, the axis motion operation instruction is input into the instruction storage queue, which can avoid the mechanical motion control being unresponsive due to insufficient storage space in the instruction storage queue.

[0016] In a preferred example, the present application may be further configured as follows: in response to the motion adjustment instruction, the axis motion information is subjected to motion adjustment processing, and a response operation is performed on multiple user threads based on the axis motion information after the motion adjustment processing, specifically including: In response to the motion adjustment instruction, a motion processing ranking value is obtained, and the axis motion information in the buffer component is sorted based on the motion processing ranking value; Respond to the mechanical motion control operation corresponding to the user thread according to the sorted axis motion information.

[0017] By adopting the above technical solution, when the working thread issues a motion adjustment instruction, for the motion control operation of the machine, a motion processing sorting value is generated according to the motion adjustment instruction, and the axis motion information in the buffer component is sorted and processed according to the motion processing sorting value, and then the axis motion information can be sorted according to the motion priority order of the machine, and the axis motion information with higher priority is placed at the front, so that the machine can complete the first step of movement first and respond to the mechanical motion control operation corresponding to the user thread.

[0018] The second object of the invention is achieved by the following technical solutions: A mechanical motion automatic control system, the mechanical motion automatic control system comprising: An instruction generation module, used for generating a plurality of user threads based on user operation input, and obtaining an axis motion operation instruction according to the plurality of user threads; A motion information acquisition module, used to access a preset instruction storage queue according to the axis motion operation instruction, acquire the axis motion information, and store the axis motion information in a preset buffer component; A motion adjustment module, used for generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread into a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread; The motion response module is used to respond to the motion adjustment instruction, perform motion adjustment processing on the axis motion information, and perform response operations on multiple user threads based on the axis motion information after the motion adjustment processing.

[0019] By adopting the above technical solution, when a user operates a motion control system, a corresponding user thread is generated according to the user's operation on the motion control system, and a corresponding user operation instruction is obtained through each user thread. A preset instruction storage queue is accessed according to the user operation instruction. The instruction storage queue refers to a plurality of control instructions for motion control of axis motion. The axis motion information is obtained, and the axis motion information is temporarily stored in a preset buffer component. At the same time, a motion adjustment work thread is generated using the axis motion information, and the motion adjustment work thread is input into a preset work thread pool. A motion adjustment instruction is generated through the motion adjustment work thread, and then, according to the motion adjustment instruction, the axis motion information stored in the buffer component is subjected to motion adjustment processing. After the axis motion adjustment is completed, the axis motion information is responded to and the next axis motion operation instruction to be performed is read from the instruction storage queue to respond to the multi-axis motion of the machine. In the process of the user operating the motion control system, the function of the user thread is only used for the instruction storage queue to obtain the axis motion information, and the buffer component is used to store and record the axis motion information, and the operation of generating the motion adjustment instruction for the instruction storage queue is stored in the work thread pool, which can effectively reduce the user's operation delay on the machine, improve the system's response speed to the mechanical axis motion instruction, and reduce the occurrence of confusion in the system's response to the axis motion control.

[0020] The third objective of the present application is achieved through the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned mechanical motion automatic control method when executing the computer program.

[0021] The fourth objective of the present application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned mechanical motion automatic control method when executed by a processor.

[0022] In summary, the present application includes at least one of the following beneficial technical effects: 1. When the user operates the motion control system, a corresponding user thread is generated according to the user's operation on the motion control system, and the corresponding motion operation instruction is obtained through each user thread. The preset instruction storage queue is accessed according to the motion operation instruction. The instruction storage queue refers to a plurality of control instructions for motion control of the axis motion. The axis motion information is obtained, and the axis motion information is temporarily stored in the preset buffer component. At the same time, the axis motion information is used to generate a motion adjustment work thread, and the motion adjustment work thread is input into the preset work thread pool. The motion adjustment instruction is generated by the motion adjustment work thread, and then the axis motion information stored in the buffer component is processed according to the motion adjustment instruction. After the axis motion adjustment is completed, the axis motion information is responded to and the next axis motion operation instruction to be performed is read from the instruction storage queue to respond to the multi-axis motion of the machine. In the process of the user operating the motion control system, the function of the user thread is only used for the instruction storage queue to obtain the axis motion information, and the buffer component is used to store and record the axis motion information, and the operation of generating the motion adjustment instruction for the instruction storage queue is stored in the work thread pool, which can effectively reduce the user's operation delay on the machine, improve the system's response speed to the mechanical axis motion instruction, and reduce the occurrence of the system's chaotic response to the axis motion control. 2. According to the user's operation, the motion control system inputs the motion command of the mechanical axis, generates the corresponding axis motion operation command, obtains the relevant axis motion information in the command storage queue through the axis motion operation command, forms the axis motion information into a ring buffer data structure, and stores it in the buffer component. The ring buffer data structure is used to temporarily store the axis motion information, and each user thread can be bound to a corresponding axis motion information. When multiple user threads respond at the same time, that is, when the motion control system performs multi-axis motion control on the machine, it can avoid the system response confusion caused by the competition of multiple user threads; 3. Generate a time wheel working thread and a motion elimination working thread through the axis motion information, and input the generated time wheel working thread and motion elimination working thread into the working thread pool in the motion control system. After receiving the time wheel working thread and the motion elimination working thread, the working thread pool generates a timing processing motion information instruction and a motion update instruction, and executes the motion control processing operation of the machine in the working thread in the motion control system, thereby reducing the operation of the user end and improving the system's response speed to the mechanical axis motion instruction; 4. Before writing the axis motion operation instruction, obtain the current storage capacity of the instruction storage queue in the motion control system to determine whether the storage capacity of the instruction storage queue has exceeded the storage threshold of the instruction storage queue. When the current storage capacity of the instruction storage queue exceeds the storage threshold, set an elimination order for the motion instructions of the instruction storage queue. According to the set elimination order, the motion instructions of the instruction storage queue are deleted periodically to release the storage capacity of the instruction storage queue. After the instruction storage queue is processed, the axis motion operation instruction is input into the instruction storage queue, which can avoid the mechanical motion control being unresponsive due to insufficient storage space in the instruction storage queue. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart of a mechanical motion automatic control method in one embodiment of the present application; Figure 2 is a flowchart for implementing step S20 in a method for automatic control of mechanical motion in one embodiment of the present application; Figure 3 This is a flowchart for implementing step S21 in a mechanical motion automatic control method in one embodiment of the present application; Figure 4 is a flowchart for implementing step S30 in a mechanical motion automatic control method in one embodiment of the present application; Figure 5 This is another implementation flow chart of a mechanical motion automatic control method in one embodiment of the present application; Figure 6 is a flowchart for implementing step S40 in a mechanical motion automatic control method in one embodiment of the present application; Figure 7 This is a principle block diagram of a mechanical motion automatic control system in one embodiment of the present application; Figure 8 It is a schematic diagram of a computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0024] The present application is further described in detail below in conjunction with the accompanying drawings.

[0025] In one embodiment, if Figure 1 As shown, the present application discloses a method for automatic control of mechanical motion, which specifically includes the following steps: S10: Generate multiple user threads based on user operation input, and obtain axis movement operation instructions according to the multiple user threads.

[0026] In this embodiment, the user thread refers to a mechanical motion task thread generated when a user operates the motion control system, and the axis motion operation instruction is a specific instruction for controlling the mechanical motion corresponding to the user thread.

[0027] Specifically, when a user operates the motion control system, a corresponding user thread is generated according to the user's operation on the motion control system, and a corresponding specific instruction for controlling the mechanical motion is obtained through each user thread.

[0028] S20: Accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component.

[0029] In this embodiment, the axis motion information refers to specific motion data of the machine, such as acceleration, speed, motion direction, motion type and other information, and the instruction storage queue refers to a storage of multiple control instructions for motion control of the axis motion.

[0030] Specifically, a preset instruction storage queue is accessed according to the motion operation instruction, the instruction storage queue stores a plurality of control instructions for motion control of the axis motion, and the axis motion information is obtained, and the axis motion information is temporarily stored in a preset buffer component.

[0031] S30: generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread into a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread.

[0032] In this embodiment, the motion adjustment work thread refers to the control of the motion adjustment of the machine, and the motion adjustment instruction refers to the control instruction for controlling and adjusting the motion of the machine.

[0033] Specifically, the axis motion information is used to generate a motion adjustment work thread, the motion adjustment work thread is input into a preset work thread pool, and the motion adjustment instruction is generated by the motion adjustment work thread.

[0034] S40: responding to the motion adjustment instruction, performing motion adjustment processing on the axis motion information, and performing response operations on multiple user threads based on the axis motion information after the motion adjustment processing.

[0035] Specifically, according to the motion adjustment instruction, the axis motion information stored in the buffer component is motion adjusted. After the axis motion adjustment is completed, the axis motion information is responded to, and the next axis motion operation instruction to be performed is read from the instruction storage queue to respond to the multi-axis motion of the machine. In the process of user operation of the motion control system, the function of the user thread is only used for the instruction storage queue to obtain the axis motion information, and the buffer component is used to store and record the axis motion information, and the operation of generating the motion adjustment instruction for the instruction storage queue is stored in the working thread pool, which can effectively reduce the user's operation delay on the machine, improve the system's response speed to the mechanical axis motion instruction, and reduce the occurrence of confusion in the system's response to the axis motion control.

[0036] In this embodiment, when a user operates the motion control system, a corresponding user thread is generated according to the user's operation on the motion control system, and a corresponding user operation instruction is obtained through each user thread. A preset instruction storage queue is accessed according to the user operation instruction. The instruction storage queue refers to a storage of multiple control instructions for motion control of axis motion. The axis motion information is obtained, and the axis motion information is temporarily stored in a preset buffer component. At the same time, a motion adjustment work thread is generated using the axis motion information, and the motion adjustment work thread is input into a preset work thread pool. The motion adjustment instruction is generated through the motion adjustment work thread, and then the axis motion information stored in the buffer component is subjected to motion adjustment processing according to the motion adjustment instruction. After the axis motion adjustment is completed, the axis motion information is responded to and the next axis motion operation instruction to be performed is read from the instruction storage queue to respond to the multi-axis motion of the machine. In the process of the user operating the motion control system, the function of the user thread is only used for the instruction storage queue to obtain the axis motion information, and the buffer component is used to store and record the axis motion information, and the operation of generating the motion adjustment instruction for the instruction storage queue is stored in the work thread pool, which can effectively reduce the user's operation delay on the machine, improve the system's response speed to the mechanical axis motion instruction, and reduce the occurrence of confusion in the system's response to the axis motion control.

[0037] In one embodiment, if Figure 2 As shown, in step S20, the preset instruction storage queue is accessed according to the axis motion operation instruction, the axis motion information is obtained, and the axis motion information is stored in a preset buffer component, which specifically includes: S21: Based on the axis motion operation instruction, obtain axis motion information in the instruction storage queue.

[0038] S22: The axis motion information is formed into a ring buffer data structure and stored in a buffer component.

[0039] Specifically, the motion control system inputs motion instructions to the mechanical axis according to the user's operation, generates corresponding axis motion operation instructions, obtains relevant axis motion information in the instruction storage queue through the axis motion operation instructions, and constructs the axis motion information into a ring buffer data structure, which is stored in the buffer component. The ring buffer data structure is used to temporarily store the axis motion information, and each user thread can be bound to a corresponding axis motion information. When multiple user threads respond at the same time, that is, when the motion control system performs multi-axis motion control on the machine, it can avoid system response confusion caused by competition among multiple user threads.

[0040] In one embodiment, if Figure 3 As shown, in step S21, based on the axis motion operation instruction, the axis motion information is obtained in the instruction storage queue, specifically including: S211: Generate a first judgment instruction according to the axis motion operation instruction, and judge whether the axis motion operation instruction exists in the instruction storage queue based on the first judgment instruction to obtain a first judgment result.

[0041] S212: When the first judgment result is that the instruction does not exist, a stop signal is generated and output to the working thread pool, and the response to the axis movement operation instruction is stopped based on the stop signal.

[0042] S213: When the first judgment result is that the instruction exists, a second judgment instruction is generated, and whether the axis motion operation instruction is expired is judged based on the second judgment instruction to obtain a second judgment result, and the axis motion information is obtained based on the second judgment result.

[0043] In this embodiment, the second determination instruction is to determine whether the axis motion operation instruction is expired in the instruction storage queue.

[0044] Specifically, the corresponding axis motion information is read in the instruction storage queue according to the axis motion operation instruction, and the first judgment instruction is used to determine whether the axis motion operation instruction for the machine is in the instruction storage queue. If the axis motion operation instruction is not stored in the instruction storage queue, a termination signal is generated and output to the working thread pool, and the control of the mechanical movement is terminated based on the termination signal; if the axis motion operation instruction is stored in the instruction storage queue, a second judgment instruction is generated, and the second judgment instruction is used to determine whether the axis motion operation instruction is expired, and a second judgment result is obtained, and the axis motion information in response to the axis motion operation instruction is determined according to the second judgment result.

[0045] In one embodiment, if Figure 4 As shown, in step S30, a motion adjustment work thread is generated based on the axis motion information, the motion adjustment work thread is input into a preset work thread pool, and a motion adjustment instruction is generated based on the motion adjustment work thread, specifically including: S31: Generate a time wheel working thread and a motion elimination working thread according to the axis motion information.

[0046] S32: storing the time wheel working thread and the motion elimination working thread in a working thread pool, generating a timed motion information processing instruction based on the time wheel working thread, and generating a motion update instruction based on the motion elimination working thread.

[0047] In this embodiment, the time wheel work thread refers to a work task that uses the time wheel to perform motion control processing, and the motion elimination work thread refers to a work task that uses the LRU elimination strategy to perform motion control instruction adjustment processing.

[0048] Specifically, a timing wheel working thread and a motion elimination working thread are generated through the axis motion information, and the generated timing wheel working thread and motion elimination working thread are input into the working thread pool in the motion control system. After receiving the timing wheel working thread and the motion elimination working thread, the working thread pool generates a timed processing motion information instruction and a motion update instruction, and puts the operation of the mechanical motion control processing into the working thread in the motion control system for execution, thereby reducing the operation on the user side and improving the system's response speed to the mechanical axis motion instructions.

[0049] In one embodiment, if Figure 5 As shown, before step S20, the mechanical motion automatic control method further includes: S201: Obtain the current storage capacity of the instruction storage queue, and determine whether the current storage capacity of the instruction storage queue is greater than a storage threshold.

[0050] S202: When the storage capacity of the instruction storage queue is greater than the storage threshold, an elimination order is set for the motion instructions in the instruction storage queue, and the motion instructions are deleted regularly according to the elimination order.

[0051] S203: Input the axis motion operation instruction into the processed instruction storage queue.

[0052] Specifically, before writing the axis motion operation instruction, the current storage capacity of the instruction storage queue in the motion control system is obtained to determine whether the storage capacity of the instruction storage queue has exceeded the storage threshold of the instruction storage queue. When the current storage capacity of the instruction storage queue exceeds the storage threshold, an elimination order is set for the motion instructions of the instruction storage queue. According to the set elimination order, the motion instructions of the instruction storage queue are deleted at regular intervals to release the storage capacity of the instruction storage queue. After the instruction storage queue is processed, the axis motion operation instruction is input into the instruction storage queue, which can avoid the mechanical motion control being unresponsive due to insufficient storage space in the instruction storage queue.

[0053] In one embodiment, if Figure 6 As shown, in step S40, that is, in response to the motion adjustment instruction, the axis motion information is subjected to motion adjustment processing, and a response operation is performed on multiple user threads based on the axis motion information after the motion adjustment processing, specifically including: S41: Responding to the motion adjustment instruction, obtaining the motion processing sorting value, and sorting the axis motion information in the buffer component based on the motion processing sorting value.

[0054] S42: Respond to the mechanical motion control operation corresponding to the user thread according to the sorted axis motion information.

[0055] Specifically, when the working thread issues a motion adjustment instruction, a motion processing sort value is generated for the motion control operation of the machine according to the motion adjustment instruction, and the axis motion information in the buffer component is sorted and processed according to the motion processing sort value. Then, the axis motion information can be sorted according to the motion priority order of the machine, and the axis motion information with higher priority is placed at the front, so that the machine can complete the first step of movement first and respond to the mechanical motion control operation corresponding to the user thread.

[0056] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0057] In one embodiment, a mechanical motion automatic control system is provided, which corresponds one-to-one to the mechanical motion automatic control method in the above embodiment. Figure 7 As shown, the mechanical motion automatic control system includes an instruction generation module, a motion information acquisition module, a motion adjustment module and a motion response module. The detailed description of each functional module is as follows: An instruction generation module, used for generating a plurality of user threads based on user operation input, and obtaining an axis motion operation instruction according to the plurality of user threads; A motion information acquisition module, used to access a preset instruction storage queue according to the axis motion operation instruction, acquire the axis motion information, and store the axis motion information in a preset buffer component; A motion adjustment module, used for generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread into a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread; The motion response module is used to respond to the motion adjustment instruction, perform motion adjustment processing on the axis motion information, and perform response operations on multiple user threads based on the axis motion information after the motion adjustment processing.

[0058] Optionally, the motion information acquisition module includes: The information sorting submodule is used to obtain the axis motion information in the instruction storage queue based on the axis motion operation instruction; and to form a ring buffer data structure with the axis motion information and store it in the buffer component.

[0059] For the specific definition of the mechanical motion automatic control system, please refer to the definition of the mechanical motion automatic control method above, which will not be repeated here. Each module in the above-mentioned mechanical motion automatic control system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0060] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store mechanical motion control data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for automatic control of mechanical motion is implemented.

[0061] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Generate multiple user threads based on user operation input, and obtain axis motion operation instructions according to the multiple user threads; Accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component; Generate a motion adjustment work thread based on the axis motion information, input the motion adjustment work thread into a preset work thread pool, and generate a motion adjustment instruction based on the motion adjustment work thread; In response to the motion adjustment instruction, motion adjustment processing is performed on the axis motion information, and response operations are performed on multiple user threads based on the axis motion information after the motion adjustment processing.

[0062] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: Generate multiple user threads based on user operation input, and obtain axis motion operation instructions according to the multiple user threads; Accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component; Generate a motion adjustment work thread based on the axis motion information, input the motion adjustment work thread into a preset work thread pool, and generate a motion adjustment instruction based on the motion adjustment work thread; In response to the motion adjustment instruction, motion adjustment processing is performed on the axis motion information, and response operations are performed on multiple user threads based on the axis motion information after the motion adjustment processing.

[0063] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0064] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0065] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for automatic control of mechanical motion, characterized in that: The mechanical motion automatic control method comprises the steps of: Generate multiple user threads based on user operation input, and obtain axis motion operation instructions according to the multiple user threads; Accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component; Generate a motion adjustment work thread based on the axis motion information, input the motion adjustment work thread into a preset work thread pool, and generate a motion adjustment instruction based on the motion adjustment work thread; In response to the motion adjustment instruction, motion adjustment processing is performed on the axis motion information, and response operations are performed on multiple user threads based on the axis motion information after the motion adjustment processing.

2. A mechanical motion automatic control method according to claim 1, characterized in that: The step of accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component specifically includes: Based on the axis motion operation instruction, acquiring axis motion information in the instruction storage queue; The axis motion information is formed into a ring-shaped buffer data structure and stored in a buffer component.

3. A mechanical motion automatic control method according to claim 2, characterized in that: The step of acquiring the axis motion information in the instruction storage queue based on the axis motion operation instruction specifically includes: Generate a first judgment instruction according to the axis motion operation instruction, and judge whether the axis motion operation instruction is in the instruction storage queue based on the first judgment instruction to obtain a first judgment result; When the first judgment result is that the instruction does not exist, a stop signal is generated and output to the working thread pool, and the response to the axis motion operation instruction is stopped based on the stop signal; When the first judgment result is that the instruction exists, a second judgment instruction is generated, and based on the second judgment instruction, it is judged whether the axis motion operation instruction is expired to obtain a second judgment result, and the axis motion information is obtained based on the second judgment result.

4. A mechanical motion automatic control method according to claim 1, characterized in that: The step of generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread into a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread specifically includes: Generate a time wheel working thread and a motion elimination working thread according to the axis motion information; The time wheel working thread and the motion elimination working thread are stored in a working thread pool, a timed motion information processing instruction is generated based on the time wheel working thread, and a motion update instruction is generated based on the motion elimination working thread.

5. A mechanical motion automatic control method according to claim 1, characterized in that: Before accessing a preset instruction storage queue according to the axis motion operation instruction, acquiring axis motion information, and storing the axis motion information in a preset buffer component, the mechanical motion automatic control method includes: Obtaining a current storage capacity of the instruction storage queue, and determining whether the current storage capacity of the instruction storage queue is greater than a storage threshold; When the storage capacity of the instruction storage queue is greater than the storage threshold, an elimination order is set for the motion instructions in the instruction storage queue, and the motion instructions are deleted regularly according to the elimination order; Input the axis motion operation command into the processed command storage queue.

6. A mechanical motion automatic control method according to claim 1, characterized in that: The step of responding to the motion adjustment instruction, performing motion adjustment processing on the axis motion information, and performing response operations on multiple user threads based on the axis motion information after the motion adjustment processing specifically includes: In response to the motion adjustment instruction, a motion processing ranking value is obtained, and the axis motion information in the buffer component is sorted based on the motion processing ranking value; Respond to the mechanical motion control operation corresponding to the user thread according to the sorted axis motion information.

7. A mechanical motion automatic control system, characterized in that: The mechanical motion automatic control system comprises: An instruction generation module, used for generating a plurality of user threads based on user operation input, and obtaining an axis motion operation instruction according to the plurality of user threads; A motion information acquisition module, used to access a preset instruction storage queue according to the axis motion operation instruction, acquire the axis motion information, and store the axis motion information in a preset buffer component; A motion adjustment module, used for generating a motion adjustment work thread based on the axis motion information, inputting the motion adjustment work thread into a preset work thread pool, and generating a motion adjustment instruction based on the motion adjustment work thread; The motion response module is used to respond to the motion adjustment instruction, perform motion adjustment processing on the axis motion information, and perform response operations on multiple user threads based on the axis motion information after the motion adjustment processing.

8. The mechanical motion automatic control system according to claim 7, characterized in that: The motion information acquisition module includes: The information sorting submodule is used to obtain the axis motion information in the instruction storage queue based on the axis motion operation instruction; and to form a ring buffer data structure with the axis motion information and store it in the buffer component.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the mechanical motion automatic control method as claimed in any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for automatic control of mechanical motion as claimed in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Control instruction processing method, device and equipment and computer storage medium

    CN111737030A

  • Robot control method and system, readable storage medium and electronic equipment

    CN111745636A

  • Hydraulic robot control method and system

    CN116125786A

  • Log-based high-speed asynchronous buffering method, system, equipment and medium

    CN116560875A