CN118550254A - A mechanical motion automatic control method, system, device and storage medium - Google Patents
A mechanical motion automatic control method, system, device and storage medium Download PDFInfo
- Publication number
- CN118550254A CN118550254A CN202410556962.9A CN202410556962A CN118550254A CN 118550254 A CN118550254 A CN 118550254A CN 202410556962 A CN202410556962 A CN 202410556962A CN 118550254 A CN118550254 A CN 118550254A
- Authority
- CN
- China
- Prior art keywords
- motion
- instruction
- shaft
- motion information
- adjustment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000033001 locomotion Effects 0.000 title claims abstract description 583
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000012545 processing Methods 0.000 claims abstract description 46
- 230000004044 response Effects 0.000 claims abstract description 43
- 230000008030 elimination Effects 0.000 claims description 32
- 238000003379 elimination reaction Methods 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 17
- 239000000725 suspension Substances 0.000 claims 3
- 230000000739 chaotic effect Effects 0.000 abstract description 3
- 230000000694 effects Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 14
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000033772 system development Effects 0.000 description 1
- 239000004753 textile Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
- G05B19/41865—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by job scheduling, process planning, material flow
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/30—Nc systems
- G05B2219/32—Operator till task planning
- G05B2219/32252—Scheduling production, machining, job shop
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Manufacturing & Machinery (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Numerical Control (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及自动化控制的技术领域,尤其是涉及一种机械运动自动控制方法、系统、设备及存储介质。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
运动控制是自动化的一个分支,它使用通称为伺服机构的一些设备,如液压泵、线性执行机或者是电机来控制机械装置的位置、速度和加速度;运动控制大致可划分为两类:一是主从轴的运动控制:根据主轴的定位生成从轴的定位命令;二是多轴协调运动控制,其中没有主从轴之分,只有由多个轴构成的集合,称之为轴组;运动控制技术既可用于控制机器人、数控机床和自动搬运系统,又被广泛应用在包装、印刷、纺织和装配工业中。可见,运动控制系统是智能制造装备的重要组成部分。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.
传统的运动控制系统多为封闭式系统,用户想扩展功能时,必须求助系统的供应商,如果用户直接在封闭的运动控制系统上进行二次开发,往往难度比较大,为了让运动控制软件的实现变得更加简单,在传统运动控制软件设计中,引入软PLC技术。软 PLC是以特定硬件作为支撑平台,以软件的形式实现硬件PLC的基本功能,即把PLC的控制功能封装在软件内,它是开放程度高、可移植性强的控制系统,使用标准编程语言和统一软件模型,建立标准的运动控制库,让工业控制系统开发平台独立于硬件,保证软件具有良好的可复用性、可维护性和扩展性,以及在开发和维护阶段皆能满足标准化要求。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 supporting platform and implements the basic functions of hardware PLC in the form of software, that is, the control functions of PLC are encapsulated in 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.
但是,现有的运动控制系统对多轴运动的控制执行采用非顺序执行方式,这种非顺序执行方式是指如果有多个功能块对同一个轴进行控制,而轴却只能执行其中一个控制指令,系统会根据用户的选择执行相应的指令,但并不一定按照指令输入顺序来执行。采用非顺序执行方式可能出现如下问题:当轴正在被功能块控制进行运动,此时又有其它功能块对该轴发送指令,就会出现多条指令同时控制一个轴的情况,造成指令响应混乱,因此,存在一定的改进空间。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
为了提高系统对机械轴运动指令的响应速度,减少系统对轴运动控制响应混乱的情况,本申请提供一种机械运动自动控制方法、系统、设备及存储介质。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.
本申请的上述发明目的一是通过以下技术方案得以实现的: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.
通过采用上述技术方案,当用户操作运动控制系统时,根据用户对运动控制系统的操作生成相对应的用户线程,通过每个用户线程获取相对应的用户操作指令,根据用户操作指令对预设的指令存储队列进行访问,指令存储队列是指存储有多个对轴运动进行运动控制的控制指令,获取到轴运动信息,轴运动信息暂时存放于预设的缓冲组件内,同时利用轴运动信息生成运动调整工作线程,将运动调整工作线程输入至预设的工作线程池内,通过运动调整工作线程生成运动调整指令,进而根据运动调整指令,对存储在缓冲组件内的轴运动信息进行运动调整处理,待完成轴运动调整后,响应轴运动信息,从指令存储队列内读取下一个待进行的轴运动操作指令,以响应机械的多轴运动,在用户操作运动控制系统过程中,用户线程的功能只用于指令存储队列以获取轴运动信息,利用缓冲组件进行存储记录轴运动信息,并将对指令存储队列生成运动调整指令的操作存放到工作线程池内,能够有效减少用户对机械的操作延迟,提高系统对机械轴运动指令的响应速度,减少系统对轴运动控制响应混乱的情况出现。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.
本申请在一较佳示例中可以进一步配置为:所述根据所述轴运动操作指令访问预设的指令存储队列,获取轴运动信息,将所述轴运动信息存储于预设的缓冲组件,具体包括: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.
通过采用上述技术方案,根据用户操作运动控制系统对机械轴进行运动指令输入,生成对应的轴运动操作指令,通过轴运动操作指令在指令存储队列内获取相关的轴运动信息,将轴运动信息构成环状缓冲数据结构,存放于缓冲组件内,采用环状缓冲数据结构对轴运动信息进行暂时存储,能够将每个用户线程绑定对应的一个轴运动信息,在多用户线程同时响应时,即运动控制系统对机械进行多轴运动控制时,能够避免多用户线程竞争导致系统响应混乱。By adopting the above technical scheme, 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.
本申请在一较佳示例中可以进一步配置为:所述基于所述轴运动操作指令,在指令存储队列中获取轴运动信息,具体包括: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.
通过采用上述技术方案,根据轴运动操作指令在指令存储队列内读取相对应的轴运动信息,通过第一判断指令判断对机械的轴运动操作指令是否存在指令存储队列内,若指令存储队列内无存储该轴运动操作指令,则生成中止信号并输出至工作线程池内,基于中止信号中止对机械运动的控制;若指令存储队列内存储有该轴运动操作指令时,则生成第二判断指令,通过第二判断指令判断该轴运动操作指令是否过期,并得到第二判断结果,根据第二判断结果确定响应该轴运动操作指令的轴运动信息。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.
本申请在一较佳示例中可以进一步配置为:所述基于所述轴运动信息生成运动调整工作线程,将所述运动调整工作线程输入至预设的工作线程池,基于所述运动调整工作线程生成运动调整指令,具体包括: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.
通过采用上述技术方案,通过轴运动信息生成时间轮工作线程和运动淘汰工作线程,将生成的时间轮工作线程和运动淘汰工作线程输入至运动控制系统内的工作线程池内,工作线程池接收到时间轮工作线程和运动淘汰工作线程后,生成定时处理运动信息指令和运动更新指令,将对机械的运动控制处理的操作放到运动控制系统内的工作线程内执行,进而减少了用户端的操作,提高了系统对机械轴运动指令的响应速度。By adopting the above technical solution, the time wheel working thread and the motion elimination working thread are generated according to the axis motion information, and the generated time wheel working thread and the 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 the timed processing motion information instruction and the motion update instruction, and puts the operation of the motion control processing of the machine 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 instruction.
本申请在一较佳示例中可以进一步配置为:在所述根据所述轴运动操作指令访问预设的指令存储队列,获取轴运动信息,将所述轴运动信息存储于预设的缓冲组件之前,机械运动自动控制方法包括: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.
通过采用上述技术方案,在写入轴运动操作指令前,获取运动控制系统内的指令存储队列的当前存储容量,以判断指令存储队列的存储容量是否已经超过指令存储队列的存储阈值,当指令存储队列的当前存储容量超过存储阈值时,对指令存储队列的运动指令设置淘汰顺序,根据设置的淘汰顺序,定时删除指令存储队列的运动指令,进而能够释放指令存储队列的存储容量,待指令存储队列进行处理完后,将轴运动操作指令输入至指令存储队列内,能够避免指令存储队列内因存储空间不足而导致机械运动控制无反应。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.
本申请在一较佳示例中可以进一步配置为:所述响应所述运动调整指令,对轴运动信息进行运动调整处理,基于运动调整处理后的轴运动信息对多个用户线程进行响应操作,具体包括: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.
通过采用上述技术方案,当工作线程发出运动调整指令后,对于机械的运动控制操作,根据运动调整指令生成运动处理排序值,通过运动处理排序值对缓冲组件内的轴运动信息进行排序处理,进而能够根据机械的运动优先级顺序轴运动信息进行排序,将优先级较高的轴运动信息排在前端,使得机械能够优先完成第一步运动,响应用户线程对应的机械运动控制操作。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.
本申请的上述发明目的二是通过以下技术方案得以实现的: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.
通过采用上述技术方案,当用户操作运动控制系统时,根据用户对运动控制系统的操作生成相对应的用户线程,通过每个用户线程获取相对应的用户操作指令,根据用户操作指令对预设的指令存储队列进行访问,指令存储队列是指存储有多个对轴运动进行运动控制的控制指令,获取到轴运动信息,轴运动信息暂时存放于预设的缓冲组件内,同时利用轴运动信息生成运动调整工作线程,将运动调整工作线程输入至预设的工作线程池内,通过运动调整工作线程生成运动调整指令,进而根据运动调整指令,对存储在缓冲组件内的轴运动信息进行运动调整处理,待完成轴运动调整后,响应轴运动信息,从指令存储队列内读取下一个待进行的轴运动操作指令,以响应机械的多轴运动,在用户操作运动控制系统过程中,用户线程的功能只用于指令存储队列以获取轴运动信息,利用缓冲组件进行存储记录轴运动信息,并将对指令存储队列生成运动调整指令的操作存放到工作线程池内,能够有效减少用户对机械的操作延迟,提高系统对机械轴运动指令的响应速度,减少系统对轴运动控制响应混乱的情况出现。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.
本申请的上述目的三是通过以下技术方案得以实现的: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.
本申请的上述目的四是通过以下技术方案得以实现的: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.
综上所述,本申请包括以下至少一种有益技术效果:In summary, the present application includes at least one of the following beneficial technical effects:
1、当用户操作运动控制系统时,根据用户对运动控制系统的操作生成相对应的用户线程,通过每个用户线程获取相对应的运动操作指令,根据运动操作指令对预设的指令存储队列进行访问,指令存储队列是指存储有多个对轴运动进行运动控制的控制指令,获取到轴运动信息,轴运动信息暂时存放于预设的缓冲组件内,同时利用轴运动信息生成运动调整工作线程,将运动调整工作线程输入至预设的工作线程池内,通过运动调整工作线程生成运动调整指令,进而根据运动调整指令,对存储在缓冲组件内的轴运动信息进行运动调整处理,待完成轴运动调整后,响应轴运动信息,从指令存储队列内读取下一个待进行的轴运动操作指令,以响应机械的多轴运动,在用户操作运动控制系统过程中,用户线程的功能只用于指令存储队列以获取轴运动信息,利用缓冲组件进行存储记录轴运动信息,并将对指令存储队列生成运动调整指令的操作存放到工作线程池内,能够有效减少用户对机械的操作延迟,提高系统对机械轴运动指令的响应速度,减少系统对轴运动控制响应混乱的情况出现;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、根据用户操作运动控制系统对机械轴进行运动指令输入,生成对应的轴运动操作指令,通过轴运动操作指令在指令存储队列内获取相关的轴运动信息,将轴运动信息构成环状缓冲数据结构,存放于缓冲组件内,采用环状缓冲数据结构对轴运动信息进行暂时存储,能够将每个用户线程绑定对应的一个轴运动信息,在多用户线程同时响应时,即运动控制系统对机械进行多轴运动控制时,能够避免多用户线程竞争导致系统响应混乱;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、通过轴运动信息生成时间轮工作线程和运动淘汰工作线程,将生成的时间轮工作线程和运动淘汰工作线程输入至运动控制系统内的工作线程池内,工作线程池接收到时间轮工作线程和运动淘汰工作线程后,生成定时处理运动信息指令和运动更新指令,将对机械的运动控制处理的操作放到运动控制系统内的工作线程内执行,进而减少了用户端的操作,提高了系统对机械轴运动指令的响应速度;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 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、在写入轴运动操作指令前,获取运动控制系统内的指令存储队列的当前存储容量,以判断指令存储队列的存储容量是否已经超过指令存储队列的存储阈值,当指令存储队列的当前存储容量超过存储阈值时,对指令存储队列的运动指令设置淘汰顺序,根据设置的淘汰顺序,定时删除指令存储队列的运动指令,进而能够释放指令存储队列的存储容量,待指令存储队列进行处理完后,将轴运动操作指令输入至指令存储队列内,能够避免指令存储队列内因存储空间不足而导致机械运动控制无反应。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, delete the motion instructions of the instruction storage queue at regular intervals to release the storage capacity of the instruction storage queue. After the instruction storage queue is processed, input the axis motion operation instruction into the instruction storage queue to avoid the mechanical motion control being unresponsive due to insufficient storage space in the instruction storage queue.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请一实施例中一种机械运动自动控制方法的一流程图;FIG1 is a flow chart of a method for automatic control of mechanical motion in one embodiment of the present application;
图2是本申请一实施例中一种机械运动自动控制方法中步骤S20的实现流程图;FIG2 is a flowchart of the implementation of step S20 in a method for automatic control of mechanical motion in an embodiment of the present application;
图3是本申请一实施例中一种机械运动自动控制方法中步骤S21的实现流程图;FIG3 is a flowchart of the implementation of step S21 in a method for automatic control of mechanical motion in an embodiment of the present application;
图4是本申请一实施例中一种机械运动自动控制方法中步骤S30的实现流程图;FIG4 is a flowchart of the implementation of step S30 in a method for automatic control of mechanical motion in an embodiment of the present application;
图5是本申请一实施例中一种机械运动自动控制方法的另一实现流程图;FIG5 is another implementation flow chart of a method for automatic control of mechanical motion in one embodiment of the present application;
图6是本申请一实施例中一种机械运动自动控制方法中步骤S40的实现流程图;FIG6 is a flowchart of implementing step S40 in a method for automatic control of mechanical motion in an embodiment of the present application;
图7是本申请一实施例中一种机械运动自动控制系统的一原理框图;FIG7 is a principle block diagram of a mechanical motion automatic control system according to an embodiment of the present application;
图8是本申请一实施例中的计算机设备示意图。FIG. 8 is a schematic diagram of a computer device in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
以下结合附图对本申请作进一步详细说明。The present application is further described in detail below in conjunction with the accompanying drawings.
在一实施例中,如图1所示,本申请公开了一种机械运动自动控制方法,具体包括如下步骤:In one embodiment, as shown in FIG1 , the present application discloses a method for automatic control of mechanical motion, which specifically includes the following steps:
S10:基于用户操作输入生成多个用户线程,根据多个所述用户线程获取轴运动操作指令。S10: Generate multiple user threads based on user operation input, and obtain axis movement operation instructions according to the multiple user threads.
在本实施例中,用户线程是指用户对运动控制系统进行操作时产生的机械运动任务线程,轴运动操作指令是至用户线程相对应的控制机械运动的具体指令。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.
具体的,当用户操作运动控制系统时,根据用户对运动控制系统的操作生成相对应的用户线程,通过每个用户线程获取相对应的控制机械运动的具体指令。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.
S20:根据所述轴运动操作指令访问预设的指令存储队列,获取轴运动信息,将所述轴运动信息存储于预设的缓冲组件。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.
在本实施例中,轴运动信息是指机械的具体运动数据,如加速度、速度、运动方向、运动类型等信息,指令存储队列是指存储有多个对轴运动进行运动控制的控制指令。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.
具体的,根据运动操作指令对预设的指令存储队列进行访问,指令存储队列是指存储有多个对轴运动进行运动控制的控制指令,获取到轴运动信息,轴运动信息暂时存放于预设的缓冲组件内。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.
S30:基于所述轴运动信息生成运动调整工作线程,将所述运动调整工作线程输入至预设的工作线程池,基于所述运动调整工作线程生成运动调整指令。S30: 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 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.
具体的,利用轴运动信息生成运动调整工作线程,将运动调整工作线程输入至预设的工作线程池内,通过运动调整工作线程生成运动调整指令。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.
S40:响应所述运动调整指令,对轴运动信息进行运动调整处理,基于运动调整处理后的轴运动信息对多个用户线程进行响应操作。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.
具体的,,进而根据运动调整指令,对存储在缓冲组件内的轴运动信息进行运动调整处理,待完成轴运动调整后,响应轴运动信息,从指令存储队列内读取下一个待进行的轴运动操作指令,以响应机械的多轴运动,在用户操作运动控制系统过程中,用户线程的功能只用于指令存储队列以获取轴运动信息,利用缓冲组件进行存储记录轴运动信息,并将对指令存储队列生成运动调整指令的操作存放到工作线程池内,能够有效减少用户对机械的操作延迟,提高系统对机械轴运动指令的响应速度,减少系统对轴运动控制响应混乱的情况出现。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.
在本实施例中,当用户操作运动控制系统时,根据用户对运动控制系统的操作生成相对应的用户线程,通过每个用户线程获取相对应的用户操作指令,根据用户操作指令对预设的指令存储队列进行访问,指令存储队列是指存储有多个对轴运动进行运动控制的控制指令,获取到轴运动信息,轴运动信息暂时存放于预设的缓冲组件内,同时利用轴运动信息生成运动调整工作线程,将运动调整工作线程输入至预设的工作线程池内,通过运动调整工作线程生成运动调整指令,进而根据运动调整指令,对存储在缓冲组件内的轴运动信息进行运动调整处理,待完成轴运动调整后,响应轴运动信息,从指令存储队列内读取下一个待进行的轴运动操作指令,以响应机械的多轴运动,在用户操作运动控制系统过程中,用户线程的功能只用于指令存储队列以获取轴运动信息,利用缓冲组件进行存储记录轴运动信息,并将对指令存储队列生成运动调整指令的操作存放到工作线程池内,能够有效减少用户对机械的操作延迟,提高系统对机械轴运动指令的响应速度,减少系统对轴运动控制响应混乱的情况出现。In this embodiment, 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.
在一实施例中,如图2所示,在步骤S20中,即根据所述轴运动操作指令访问预设的指令存储队列,获取轴运动信息,将所述轴运动信息存储于预设的缓冲组件,具体包括:In one embodiment, as shown in FIG. 2 , in step S20, namely, 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:
S21:基于所述轴运动操作指令,在指令存储队列中获取轴运动信息。S21: Based on the axis motion operation instruction, obtain axis motion information in the instruction storage queue.
S22:将所述轴运动信息构成环状缓冲数据结构存放于缓冲组件内。S22: The axis motion information is formed into a ring buffer data structure and stored in a buffer component.
具体的,根据用户操作运动控制系统对机械轴进行运动指令输入,生成对应的轴运动操作指令,通过轴运动操作指令在指令存储队列内获取相关的轴运动信息,将轴运动信息构成环状缓冲数据结构,存放于缓冲组件内,采用环状缓冲数据结构对轴运动信息进行暂时存储,能够将每个用户线程绑定对应的一个轴运动信息,在多用户线程同时响应时,即运动控制系统对机械进行多轴运动控制时,能够避免多用户线程竞争导致系统响应混乱。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.
在一实施例中,如图3所示,在步骤S21中,即基于所述轴运动操作指令,在指令存储队列中获取轴运动信息,具体包括:In one embodiment, as shown in FIG. 3 , in step S21, based on the axis motion operation instruction, the axis motion information is obtained in the instruction storage queue, specifically including:
S211:根据所述轴运动操作指令生成第一判断指令,基于所述第一判断指令判断轴运动操作指令是否存在指令存储队列中,得到第一判断结果。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.
S212:当第一判断结果为指令不存在,则生成中止信号并输出至工作线程池,基于所述中止信号停止对轴运动操作指令的响应。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.
S213:当第一判断结果为指令存在,生成第二判断指令,基于所述第二判断指令判断轴运动操作指令是否过期,得到第二判断结果,基于所述第二判断结果获取轴运动信息。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.
在本实施例中,第二判断指令为判断轴运动操作指令在指令存储队列内是否过期。In this embodiment, the second determination instruction is to determine whether the axis motion operation instruction is expired in the instruction storage queue.
具体的,根据轴运动操作指令在指令存储队列内读取相对应的轴运动信息,通过第一判断指令判断对机械的轴运动操作指令是否存在指令存储队列内,若指令存储队列内无存储该轴运动操作指令,则生成中止信号并输出至工作线程池内,基于中止信号中止对机械运动的控制;若指令存储队列内存储有该轴运动操作指令时,则生成第二判断指令,通过第二判断指令判断该轴运动操作指令是否过期,并得到第二判断结果,根据第二判断结果确定响应该轴运动操作指令的轴运动信息。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.
在一实施例中,如图4所示,在步骤S30中,即基于所述轴运动信息生成运动调整工作线程,将所述运动调整工作线程输入至预设的工作线程池,基于所述运动调整工作线程生成运动调整指令,具体包括:In one embodiment, as shown in FIG. 4 , 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:根据所述轴运动信息生成时间轮工作线程和运动淘汰工作线程。S31: Generate a time wheel working thread and a motion elimination working thread according to the axis motion information.
S32:将所述时间轮工作线程和运动淘汰工作线程存储于工作线程池,基于所述时间轮工作线程生成定时处理运动信息指令,基于所述运动淘汰工作线程生成运动更新指令。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.
在本实施例中,时间轮工作线程是指利用时间轮进行运动控制处理的工作任务,运动淘汰工作线程是指利用LRU淘汰策略进行运动控制指令调整处理的工作任务。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.
具体的,通过轴运动信息生成时间轮工作线程和运动淘汰工作线程,将生成的时间轮工作线程和运动淘汰工作线程输入至运动控制系统内的工作线程池内,工作线程池接收到时间轮工作线程和运动淘汰工作线程后,生成定时处理运动信息指令和运动更新指令,将对机械的运动控制处理的操作放到运动控制系统内的工作线程内执行,进而减少了用户端的操作,提高了系统对机械轴运动指令的响应速度。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.
在一实施例中,如图5所示,在步骤S20之前,机械运动自动控制方法还包括:In one embodiment, as shown in FIG5 , before step S20, the mechanical motion automatic control method further includes:
S201:获取指令存储队列的当前存储容量,判断指令存储队列的当前存储容量是否大于存储阈值。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.
S202:当指令存储队列的存储容量大于存储阈值时,对指令存储队列内的运动指令设定淘汰顺序,按照所述淘汰顺序定时删除运动指令。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.
S203:将轴运动操作指令输入至处理后的指令存储队列内。S203: Input the axis motion operation instruction into the processed instruction storage queue.
具体的,在写入轴运动操作指令前,获取运动控制系统内的指令存储队列的当前存储容量,以判断指令存储队列的存储容量是否已经超过指令存储队列的存储阈值,当指令存储队列的当前存储容量超过存储阈值时,对指令存储队列的运动指令设置淘汰顺序,根据设置的淘汰顺序,定时删除指令存储队列的运动指令,进而能够释放指令存储队列的存储容量,待指令存储队列进行处理完后,将轴运动操作指令输入至指令存储队列内,能够避免指令存储队列内因存储空间不足而导致机械运动控制无反应。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.
在一实施例中,如图6所示,在步骤S40中,即响应所述运动调整指令,对轴运动信息进行运动调整处理,基于运动调整处理后的轴运动信息对多个用户线程进行响应操作,具体包括:In one embodiment, as shown in FIG. 6 , 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:响应运动调整指令,获取运动处理排序值,基于所述运动处理排序值对缓冲组件内的轴运动信息进行排序。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.
S42:根据排序后的轴运动信息响应用户线程对应的机械运动控制操作。S42: Respond to the mechanical motion control operation corresponding to the user thread according to the sorted axis motion information.
具体的,当工作线程发出运动调整指令后,对于机械的运动控制操作,根据运动调整指令生成运动处理排序值,通过运动处理排序值对缓冲组件内的轴运动信息进行排序处理,进而能够根据机械的运动优先级顺序轴运动信息进行排序,将优先级较高的轴运动信息排在前端,使得机械能够优先完成第一步运动,响应用户线程对应的机械运动控制操作。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.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。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.
在一实施例中,提供一种机械运动自动控制系统,该机械运动自动控制系统与上述实施例中机械运动自动控制方法一一对应。如图7所示,该机械运动自动控制系统包括指令生成模块、运动信息获取模块、运动调整模块和运动响应模块。各功能模块详细说明如下:In one embodiment, a mechanical motion automatic control system is provided, which corresponds to the mechanical motion automatic control method in the above embodiment. As shown in FIG7 , 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. Each functional module is described in detail 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.
可选的,运动信息获取模块包括: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.
关于机械运动自动控制系统的具体限定可以参见上文中对于机械运动自动控制方法的限定,在此不再赘述。上述机械运动自动控制系统中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。The specific definition of the mechanical motion automatic control system can be found in 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 in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储机械运动控制数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种机械运动自动控制方法。In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. 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 via a network connection. When the computer program is executed by the processor, a method for automatic control of mechanical motion is implemented.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤: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.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤: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.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。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.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。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.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。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 (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410556962.9A CN118550254A (en) | 2024-05-07 | 2024-05-07 | A mechanical motion automatic control method, system, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410556962.9A CN118550254A (en) | 2024-05-07 | 2024-05-07 | A mechanical motion automatic control method, system, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118550254A true CN118550254A (en) | 2024-08-27 |
Family
ID=92447339
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410556962.9A Pending CN118550254A (en) | 2024-05-07 | 2024-05-07 | A mechanical motion automatic control method, system, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118550254A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111737030A (en) * | 2020-06-24 | 2020-10-02 | 广东浪潮大数据研究有限公司 | A control instruction processing method, apparatus, device and computer storage medium |
CN111745636A (en) * | 2019-05-15 | 2020-10-09 | 北京京东尚科信息技术有限公司 | Robot control method and control system, storage medium, and electronic device |
CN116125786A (en) * | 2022-11-25 | 2023-05-16 | 深圳市金奥博科技股份有限公司 | Hydraulic robot control method and system |
CN116560875A (en) * | 2023-05-19 | 2023-08-08 | 广州经传多赢投资咨询有限公司 | High-speed asynchronous buffer method, system, equipment and medium based on log |
-
2024
- 2024-05-07 CN CN202410556962.9A patent/CN118550254A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111745636A (en) * | 2019-05-15 | 2020-10-09 | 北京京东尚科信息技术有限公司 | Robot control method and control system, storage medium, and electronic device |
CN111737030A (en) * | 2020-06-24 | 2020-10-02 | 广东浪潮大数据研究有限公司 | A control instruction processing method, apparatus, device and computer storage medium |
CN116125786A (en) * | 2022-11-25 | 2023-05-16 | 深圳市金奥博科技股份有限公司 | Hydraulic robot control method and system |
CN116560875A (en) * | 2023-05-19 | 2023-08-08 | 广州经传多赢投资咨询有限公司 | High-speed asynchronous buffer method, system, equipment and medium based on log |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10317879B2 (en) | Intelligent engine for managing operations for a computer numerical control (CNC) machine in a computer-aided manufacturing (CAM) system | |
US7561930B2 (en) | Dynamic modifier function blocks for use in a process control system | |
DiCesare et al. | Modeling, control, and performance analysis of automated manufacturing systems using Petri nets | |
DE102015105436A1 (en) | Translation module, processing module and control system | |
CN114676647B (en) | Numerical control machine tool part service life prediction method based on deep learning method | |
US20180264651A1 (en) | Controller, control system, and control method | |
US20080103625A1 (en) | Numerical controller with machining resume function | |
US10712731B2 (en) | Control device, control method, and non-transitory computer-readable recording medium | |
EP1899824A2 (en) | Interrupt-responsive non-volatile memory system and method | |
US10437230B2 (en) | Numerical controller having function of automatically selecting storage destination of machining program | |
CN118550254A (en) | A mechanical motion automatic control method, system, device and storage medium | |
CN115877736A (en) | Multi-robot cooperative work simulation monitoring method based on digital twin | |
JPH09128255A (en) | Programable logic controller | |
CN116560875B (en) | High-speed asynchronous buffer method, system, equipment and medium based on log | |
CN112147953B (en) | Numerical controller | |
US20220397880A1 (en) | Control device | |
JP2017157219A (en) | Controlled provision of control data | |
US20210149570A1 (en) | Method for Configuring a Memory Unit of a Computing Unit | |
US20200117167A1 (en) | Control system of machine tool | |
CN115335812A (en) | Information processing device, information processing method, and program | |
JP7496891B2 (en) | Control Management Device | |
CN117349203B (en) | A control data processing method and device | |
JP2023151731A (en) | Control system, control method, and control program | |
Paul et al. | Documenting and Controlling the Behavior of the ASML Lot Operations Expose Wafer | |
JP2003248514A (en) | Supervision and control system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |