CN114690702A - Robot control system combining soft PLC and motion control - Google Patents

Robot control system combining soft PLC and motion control Download PDF

Info

Publication number
CN114690702A
CN114690702A CN202210618926.1A CN202210618926A CN114690702A CN 114690702 A CN114690702 A CN 114690702A CN 202210618926 A CN202210618926 A CN 202210618926A CN 114690702 A CN114690702 A CN 114690702A
Authority
CN
China
Prior art keywords
shared memory
control unit
plc
control
motion control
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.)
Granted
Application number
CN202210618926.1A
Other languages
Chinese (zh)
Other versions
CN114690702B (en
Inventor
李艳华
郑晓慧
朱平步
徐东兴
孙雅倩
刘松涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chenxing Tianjin Automation Equipment Co ltd
Original Assignee
Chenxing Tianjin Automation Equipment Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chenxing Tianjin Automation Equipment Co ltd filed Critical Chenxing Tianjin Automation Equipment Co ltd
Priority to CN202210618926.1A priority Critical patent/CN114690702B/en
Publication of CN114690702A publication Critical patent/CN114690702A/en
Application granted granted Critical
Publication of CN114690702B publication Critical patent/CN114690702B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/11Plc I-O input output
    • G05B2219/1105I-O
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)
  • Manipulator (AREA)

Abstract

The application relates to a robot control system combining soft PLC and motion control, belonging to the technical field of robots, and the system comprises a motion control unit and a PLC control unit; the motion control unit and the PLC control unit realize the interaction of equipment information and control information between an equipment module and controlled equipment based on a shared memory mechanism; wherein the device information and control information interaction comprises: and acquiring the equipment information of the controlled equipment from the outside, processing the control task according to the equipment information, and outputting the processing result to the controlled equipment. The technical scheme of the application is specifically based on a shared memory mechanism, communication interaction between the PLC control part and the motion control part is achieved, and the requirement for the real-time performance of the robot control system in application is favorably met.

Description

Robot control system combining soft PLC and motion control
Technical Field
The application belongs to the technical field of robots, and particularly relates to a robot control system combining soft PLC and motion control.
Background
In the robot control system, the development and realization of motion control are mainly completed by C + + and other high-level programming languages, and the motion control is serial logic and is not suitable for processing the problem of complex parallel logic interaction; in the related art, the logic control of the PLC is periodic scanning logic and is suitable for parallel logic interaction. Therefore, in the related art of robot control, a related implementation solution combining the PLC technology and the motion control is developed.
In the prior art, two main implementation modes of the technical scheme are provided, namely, firstly, motion control and a PLC are respectively placed on independent hardware platforms to be implemented, and then the two independent hardware platforms are connected through wired communication, so that extra hardware cost (related hardware needs to be configured) is brought, and meanwhile, the real-time performance cannot be guaranteed in a system with high real-time requirement, such as a robot control system; another is to move one part of logic to another part, for example, writing motion control logic on a soft PLC, this type of scheme cannot guarantee the continuity of the robot motion process in the actual robot control because the motion control and the PLC are based on different logic.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
In order to overcome the problems in the related art at least to a certain extent, the application provides a robot control system combining soft PLC and motion control, and specifically, based on a shared memory mechanism, information interaction between a PLC control part and a motion control part in the system is realized, so that the real-time requirement on the robot control system in application is met under the condition of taking two control logics into consideration.
In order to achieve the purpose, the following technical scheme is adopted in the application:
in a first aspect,
the application provides a robot control system that soft PLC and motion control combined together, this system includes: a motion control unit and a PLC control unit;
the motion control unit and the PLC control unit realize the interaction of equipment information and control information between an equipment module and controlled equipment based on a shared memory mechanism;
wherein the device information and control information interaction comprises: and acquiring the equipment information of the controlled equipment from the outside, processing the control task according to the equipment information, and outputting the processing result to the controlled equipment.
Optionally, the process of acquiring device information of the controlled device from the outside includes:
the controlled device writes an input data packet containing device information into a first shared memory;
the motion control unit reads the input data packet from the first shared memory, and the PLC control unit copies a copy of the input data packet from the first shared memory by using a second shared memory to read the input data packet from the second shared memory.
Optionally, the process of processing the control task according to the device information and outputting a processing result to the controlled device includes:
based on the input data packet, the motion control unit performs control data processing according to a control requirement, writes an identification data packet containing identification information of a completed task into the second shared memory after the completion of a corresponding control task, and notifies the PLC control unit;
the PLC control unit compares the input data packet and the identification data packet in the second shared memory according to the notification of the motion control unit, excludes the control task completed by the motion control unit, processes the rest control tasks based on the input data packet, writes PLC processing result data obtained after the tasks are completed into a third shared memory, and notifies the motion control unit;
and the motion control unit reads the PLC processing result data from the third shared memory according to the notification of the PLC control unit, integrates the PLC processing result data with the motion control processing result data obtained by the motion control unit completing the control task, and writes the integrated final result data into a fourth shared memory so that the controlled equipment reads the final result data from the fourth shared memory to execute the action.
Optionally, the remaining control tasks include a direct task for directly controlling the controlled device by the PLC control unit;
and aiming at the direct task, based on the input data packet, the PLC control unit processes the direct task and writes direct processing result data obtained after the task is completed into the fourth shared memory, so that the controlled device reads the direct processing result data from the fourth shared memory and performs action execution.
Optionally, the control system performs communication interaction with the controlled device through a field bus system;
the first shared memory and the fourth shared memory are respectively mapped to designated areas in the field bus shared memory correspondingly;
and the second shared memory and the third shared memory are respectively mapped to a designated area in the virtual shared memory created by the control system correspondingly.
Optionally, the fieldbus system is implemented based on EtherCAT bus technology.
Optionally, the PLC control unit is implemented based on a Beremiz software architecture.
Optionally, in the shared memory mechanism, a synchronous mutual exclusion mechanism is implemented based on a semaphore manner.
Optionally, the motion control unit and the PLC control unit further implement information interaction related to a state module, a control module, an IO module, and a variable module of the system based on a shared memory mechanism.
This application adopts above technical scheme, possesses following beneficial effect at least:
according to the technical scheme, the motion control and the soft PLC system can run together on the same system, so that the control system combines the advantages of the soft PLC and the motion control; and the communication interaction between the two processes is realized based on a shared memory mechanism, so that the real-time requirement on the robot control system in application can be met.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention.
Drawings
The accompanying drawings are included to provide a further understanding of the technology or prior art of the present application and are incorporated in and constitute a part of this specification. The drawings expressing the embodiments of the present application are used for explaining the technical solutions of the present application, and should not be construed as limiting the technical solutions of the present application.
FIG. 1 is a schematic diagram of an overall model of the soft PLC and motion control combination according to the present invention;
fig. 2 is a schematic illustration of a principle implementation of a shared memory in the technical solution of the present application;
FIG. 3 is a schematic diagram illustrating the composition of shared intrinsic system dimensions according to the teachings of the present application;
fig. 4a is a schematic diagram of an implementation flow when reading a shared memory in a signal quantity manner in the technical solution of the present application;
fig. 4b is a schematic diagram of an implementation flow when the shared memory is written in the signal quantity mode in the technical solution of the present application;
fig. 5 is a schematic flowchart illustrating initialization of a shared memory according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating the existence of a data interaction dimension in a share in accordance with the present disclosure;
fig. 7 is a schematic explanatory diagram of the PLC control unit and the motion control unit implementing joint control in the present technical solution.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present application.
To facilitate understanding of the technical solutions of the present application, a description will be given below of some related technologies related to the present application.
PLC:
The implementation of PLC is divided into hard PLC and soft PLC. The hard PLC is to realize the execution of PLC instructions by hardware or a special ASIC chip; in the technical field of soft PLC, a development system of the soft PLC is actually a PLC programmer with debugging and compiling functions, and hardware and software resources on a PC platform are utilized, so that a control system is more distinctive. The soft PLC generally uses some general CPUs (X86 architecture) or MCUs to implement interpretation or compilation execution of PLC instructions, is a control system based on a PC development structure, and also has the characteristics of the functionality, reliability, processing speed, troubleshooting, and the like of the hard PLC, whereas the X86 architecture has the advantages of high speed, strong single instruction function, relatively small instruction number, low bandwidth requirement, relatively small instruction number, and no need of a large bandwidth to transmit instructions to the CPUs even when operating at a high frequency.
The soft PLC integrates the functions of on-off control, analog quantity control, mathematical operation, numerical value processing, network communication, PID regulation and the like of a computer and the PLC, provides a powerful instruction set, a fast and accurate scanning period, reliable operation and an open structure which can be connected with various I/O systems and networks through a multitask control kernel. Soft PLCs provide the same functionality as hard PLCs, while providing various advantages of PC environments. However, soft PLCs are not friendly to the continuous logic of the process of robot motion. The communication realization basis of the soft PLC is periodic scanning, which is more suitable for parallel logic interaction, and the motion control of the robot is serial logic, so that the last step is completed and the next step is executed, thereby causing the soft PLC to be unfriendly to the continuity of the motion control of the robot.
And (3) motion control:
in the related art, many commercial robot real-time operating systems, such as QNX, VxWorks, LynxOS, VRTX, etc., have been provided, and these systems have the advantages of good compatibility, reliability and real-time performance. However, most commercial systems, such as VxWorks, are generally expensive and incompatible with each other, subject to their respective patent protection. Different from the above systems, the Linux operating system under the common public authorization protocol has a series of advantages of itself, and is favored in the field of embedded applications today. With the continuous update of computer hardware equipment, the Linux operating system is continuously evolving, expands from the initial support of the Intel386 to various different platforms, and has good compatibility with various platforms. Due to the implementation mode and complexity of the Linux kernel, the Linux kernel cannot be used for strong real-time application. Xenomai is a free software project and completely follows the GNU/Linux free software protocol. Xenomai is a strong real-time extension of a Linux kernel adopting a dual-kernel mechanism, has higher priority than the Linux kernel, and is responsible for processing real-time tasks of a system. Because the real-time performance of the existing robot control system is poor, the movement of the robot and the signal acquisition are asynchronous, and the discontinuity in production is easily caused. In the technical scheme of the application, the robot control system integrally adopts a scheme of combining Xenomai and Linux.
Based on the above, it can be seen that the PLC employs logic of timed sequential scan, which has significant advantages for complex I/O logic, but is not suitable for processing serial logic. In the field of robotics, motion logic is serial logic and has a certain time duration. In addition, a certain foresight is needed in the motion trajectory planning module, so that the motion trajectory planning module is not easy to realize only by using a PLC. If only motion logic is used, it is not easy to implement for complex I/O concurrency logic.
Therefore, based on the above related technologies, in combination with the prior art mentioned in the background art, the applicant studies that in the mode of combining the soft PLC and the motion control, if the mode of combining the soft PLC and the motion control in the same system is adopted, since they belong to different processes, how to implement fast IPC (inter-process communication) is the key for effectively implementing the technical solution.
Common ipcs (inter Process communication) include FIFO, message queue, and shared memory, wherein the shared memory only needs to be input from a file to a shared memory area and output from the shared memory area to the file.
Therefore, in order to effectively combine the soft PLC with the X86, the complex I/O logic can be solved, and the serial property of the robot motion logic can be ensured. According to the technical scheme, in the implementation of combining motion control and soft PLC, the soft PLC is transplanted to a motion control platform by utilizing the open construction capacity of the soft PLC, and a shared memory mechanism is introduced aiming at the information interaction problem between the soft PLC and the motion control platform, so that the robot control system combining the soft PLC and the motion control is better realized.
The robot control system in the application is a set of control system developed based on an X86 platform and used for controlling the motion of a robot. The open basic characteristic of the soft PLC is utilized, and meanwhile, the computing capability of the existing hardware platform is fully exerted.
Fig. 1 is a schematic diagram illustrating an overall model combining soft PLC and motion control according to the present invention.
As shown in fig. 1, a motion control unit 1 and a PLC control unit 3 are main parts of the robot control system of the present application;
it is easy to understand that the motion control unit 1 herein combines motion control and logic control in implementation, integrates a set of instruction sets required by a controller, relates to coordinate transformation, variable and instruction, instruction superposition, object processing, and multithread calling in the robot motion process, and provides an interface combined with a soft PLC to ensure the stability of docking with complex I/O;
the daemon process 2 in fig. 1 is used for reading and writing files in the robot configuration process, monitoring safety and stability when a motion instruction is executed, and calling again after halting, and realizing interaction among processes, such as communication between a PLC and motion control in a system to complete complex robot control, and the daemon process 2 is similar to the related system implementation in which the PLC and the motion control are combined in the prior art, and details of the implementation are not described in the present application;
in fig. 1, a PLC control unit 3 interacts with a motion control unit through a shared memory 4, provides a concurrent logic of docking with a complex I/O system and periodic scanning, and complements a disadvantage of a robot running program, and based on a specific application requirement, the PLC unit also supports a direct data interaction with a field bus protocol 5, so as to meet a requirement of directly controlling a controlled device;
the shared memory 4 shown in fig. 1 represents one implementation mechanism that interacts with external hardware via a fieldbus protocol 5; a field bus protocol 5, which is used for realizing communication interaction between the system and the outside (relative to the control system), for example, a bus protocol such as EtherCAT is specifically adopted; device 6 refers to a controlled hardware entity device.
In the technical scheme of the application, the PLC control unit is a virtual software entity, has the same function with a hard PLC, is not directly interacted with hardware, but is interacted with motion control through a shared memory, and then interacts an instruction with the hardware through a field bus protocol, and specifically comprises the following processes:
and (3) motion control processing: the device information is transmitted to a shared memory, the motion control reads the device information and carries out instruction conversion according to a preset scene, the target position parameters are periodically written into the shared memory, and the target position parameters are sent to a device driver through a field bus protocol to control the robot to operate;
soft PLC processing process: return signals of the equipment in the running process are sent to the shared memory through field bus protocol communication, and the soft PLC system processes the signals to perform format conversion and temporarily stores the converted signals in the shared memory, so that the motion control can be conveniently called at any time;
and (3) equipment interaction process: motion control provides a part of variables needing interaction and shares the variables in a shared memory, and the PLC controls the shared memory to realize indirect control on actual hardware, such as adding sensor control;
in addition, in order to facilitate a user to write an industrial control program, in the implementation of an actual system, the soft PLC portion in the technical solution of the present application may provide a multi-language programming environment, such as a language supported by IEC61131-3, a Python language, a C language, and the like.
To understand the technical solution of the present application, the following introduces the corresponding technical contents of the shared memory involved in the present application:
in terms of realizing functions, the shared memory can enable a plurality of processes to access the memory space in the same block, and is an inter-process communication mode; in other words, shared memory allows two unrelated processes to access the same logical memory, which is a very efficient way to share and transfer data between two running processes, and generally, the shared memory between different processes is usually the same physical memory.
In Linux, as shown in fig. 2, each process has its own Process Control Block (PCB) and address space, and has a page table corresponding to the process, and is responsible for mapping a virtual address and a physical address of the process and managing the process through a Memory Management Unit (MMU). Two different virtual addresses are mapped to the same region of physical space through a page table, and the region of the block to which they point shares memory.
In the technical scheme of this application, the combination of soft PLC and motion control is with two originally incoherent systems, through the call to a memory, puts together the operation to both solved PLC and be difficult for writing the problem of motion control logic in the function realization, solved the unsuitable problem of writing complicated logic interaction of robot again, and compared prior art there is better real-time performance.
In the technical scheme of the application, based on the consideration of development cost, a soft PLC part (a PLC control unit in fig. 1) is realized based on an open-source Beremiz software architecture, and the Beremiz software displays variables in an equipment description file on a software interface by analyzing the equipment description file. In the created shared memory, memory addresses are distributed to each data type analyzed from the device description file, each data type called in programming has a specific address, and based on the characteristics of a Beremiz software architecture, the PLC part in the system supports multiple programming languages to realize the logic of the PLC. It is understood that, based on the technical idea of the present application, the PLC control portion in the system may also be implemented in other manners.
In the technical scheme of the application, a robot control system can be divided into a state module, a control module, an IO module, a variable module and an equipment module in a system function dimension, a shared memory corresponding to the dimension is divided into five parts (as shown in fig. 3) for the five modules of the control system to use, wherein each part can be divided into an input shared memory and an output shared memory which are respectively used for writing data and reading data (input in fig. 3 refers to the input shared memory of a certain module for the shared memory, and output refers to the output shared memory of a certain module for the shared memory);
in other words, when data is written, the corresponding module writes data into the output shared memory module corresponding to the module, so that other modules can read the data as the input of other modules; in order to ensure the integrity of data read by each module, only one module in the corresponding part of the shared memory needs to be locked with a semaphore (a semaphore mode realizes a synchronous mutual exclusion mechanism) when data is written into the module, so that the module cannot be read. Similarly, as long as one module is reading in the corresponding part of the shared memory, other modules cannot be written in.
The above-mentioned synchronous mutual exclusion mechanism is described, and the information quantity mode belongs to the related technology of interprocess communication. In the shared memory mechanism in the technical scheme of the application, a synchronous mutual exclusion mechanism is realized specifically based on a semaphore mode;
in particular, as described above, the shared memory exists in the process address space of each process, and is mapped to the same physical memory block by the address space and the page table mechanism, so that it belongs to each process, and since it does not require system call intervention and data copying, its efficiency is very high. However, the shared memory does not provide a synchronous mutual exclusion mechanism, that is, under the using mechanism of the shared memory, the motion control and the soft PLC system operate the shared memory at the same time;
therefore, it is necessary to add a synchronous mutual exclusion mechanism: synchronization, namely, in order to complete a certain task on the shared memory, a coordination is formed between the process and the multithreading, the shared memory is operated according to convention or conditions in sequence, and the use condition of the shared memory is informed mutually; mutex is a constraint that is blocked when a process or thread enters a code segment that operates shared memory and then attempts to use the shared memory by another process (thread) until the resource is released.
As shown in fig. 4a and 4b, a flow when the soft PLC and the motion control read the shared memory, and a flow when the soft PLC and the motion control write the shared memory are correspondingly shown respectively;
in fig. 4a and 4b, the Input semaphore is the Input semaphore, and the Output semaphore is the Input semaphore. The Input/Output semaphore exists in the robot control system, when the soft PLC or the motion control needs to read and write, corresponding semaphores are respectively applied, and the semaphores are locked after the application is successful according to the mutual exclusion characteristic. Specifically, when the Input/Output semaphore is equal to 1, the shared memory is a global attribute, and the soft PLC or motion control can send a read-write request; when the Input/Output semaphore is equal to 0, the local attribute is set, the soft PLC or motion control has successfully applied for the functional memory, and at this time, the Input/Output semaphore is locked, and then the read-write operation is performed, for example, the implementation principle is as follows:
step 1: motion control applies for Input semaphore, and at this time, the Input semaphore is equal to 0, which indicates that the shared memory is occupied; proceed to step 5.
Step 2: if the Input semaphore is equal to 1 at the moment, the shared memory can be applied, and after the application is successful, the Input semaphore is subtracted by 1 to read the shared memory; and (5) carrying out step 3.
And step 3: releasing an Input semaphore and adding 1 to the Input semaphore; and (5) carrying out step 4.
And 4, step 4: if the Input semaphore is not equal to 0, go to step 3. Otherwise, go to step 5.
And 5: and finishing the request and waiting for the next request.
By adopting the mode, aiming at the problem that the soft PLC and the motion control can crash when reading and writing the same shared memory at the same time, the soft PLC and the motion control utilize the semaphore to prevent the PLC and the motion control from operating the same shared memory at the same time when reading and writing the shared memory, thereby realizing a synchronous mutual exclusion mechanism.
In addition, regarding the use of the shared memory, in the technical solution of the present application, the initialization process as shown in fig. 5 must be performed before the use. As shown in fig. 5, the initialization execution process is as follows:
the first step is as follows: the PLC or the motion control opens the Input shared memory (the Input shared memory is based on each module needing to use the shared memory), the size of the Input shared memory space is set, and the address space is linked
The second step is that: the PLC or the motion control opens the Output shared memory (the Output shared memory is based on each module needing to use the shared memory), the size of the Output shared memory space is set, and the address space is linked.
The third step: and judging whether the real-time shared memory exists at the moment.
The fourth step: if the real-time shared memory exists at the moment, the existing real-time shared memory is directly used. And if the real-time shared memory does not exist at the moment, creating the real-time shared memory.
With respect to the shared memory mechanism in the present application, it is described in the following from the data interaction dimension. In the process of data interaction between the soft PLC and the motion control by utilizing the real-time shared memory, two small shared memory spaces need to be opened up on the created real-time shared memory space, and are named as an Output real-time shared memory space and an Input real-time shared memory space respectively; here, Input and Output are for a robot control system, a schematic process of performing data interaction by using a real-time shared memory for the soft PLC and the motion control is shown in fig. 6, and the following flow is followed for performing data interaction by using the real-time shared memory for the whole soft PLC and the motion control:
the first step is as follows: and (3) writing data into the cache region 1 by motion control, waiting for the clock signal trigger of the robot control system by the cache region 1, and writing the content of the cache region 1 into the Output shared memory by the robot control system.
The second step is that: the robot control system controls the cache region 2 to read in motion control written data from the Output shared memory, the cache region 2 waits for the clock signal of the robot control system to trigger, the soft PLC periodically reads in the content of the cache region 2, and then the processing is carried out.
The third step: the soft PLC writes the processed result into the cache area 3, the cache area 3 waits for the clock signal of the robot control system to trigger, and the robot control system writes the content of the cache area 3 into the Input shared memory.
The fourth step: the robot control system controls the buffer area 4 to periodically read data in the Input shared memory, the buffer area 4 waits for the triggering of the clock signal of the robot control system, and the motion control is performed after the data in the buffer area 4 is periodically read and processed.
The fifth step: and the motion control carries out motion control according to the transmitted data, then continues to write data into the Output shared memory, and continues to the first step, thereby realizing circulation.
Based on the above description of the related technical contents of the shared memory, the technical solution to be protected in the present application is further described with reference to an embodiment.
As shown in fig. 7, in an embodiment, the robot control system combining soft PLC and motion control proposed by the present application includes: a motion control unit and a PLC control unit;
the motion control unit and the PLC control unit realize the interaction of equipment information and control information between an equipment module (taking the equipment module as an example for explanation) and controlled equipment based on a shared memory mechanism; wherein, the equipment information and control information interaction comprises: and acquiring the equipment information of the controlled equipment from the outside, processing the control task according to the equipment information, and outputting the processing result to the controlled equipment.
Specifically, as shown in fig. 7, the process of acquiring the device information of the controlled device from the outside includes:
first, the controlled device writes an input data packet containing device information into a first shared memory (shared memory 1 in fig. 7);
in the second step, the motion control unit reads the input data packet from the first shared memory, and the PLC control unit copies one copy of the input data packet from the first shared memory using the second shared memory (shared memory 2 in fig. 7) to read the input data packet from the second shared memory;
furthermore, in this embodiment, the process of performing processing of a control task according to device information and outputting a processing result to a controlled device includes:
thirdly, based on the input data packet, the motion control unit performs control data processing according to the control requirement, writes the identification data packet containing identification information of the completed task into a second shared memory after the corresponding control task is completed, and notifies the PLC control unit (notifying PLC processing in fig. 7) and waits for the completion of part of the control tasks of the PLC;
fourthly, the PLC control unit compares the input data packet (copied in the foregoing) and the identification data packet in the second shared memory according to the notification of the motion control unit, excludes the control task completed by the motion control unit, processes the rest control tasks based on the input data packet, writes the PLC processing result data obtained after the task is completed into a third shared memory (shared memory 3 in FIG. 7), and notifies the motion control unit;
and fifthly, the motion control unit reads the PLC processing result data from the third shared memory according to the notification of the PLC control unit, integrates the PLC processing result data (the PLC processing result in fig. 7) with the motion control processing result data (the motion control processing result in fig. 7) obtained by the motion control unit completing the control task, and writes the final result data after the integration into the fourth shared memory (the shared memory 4 in fig. 7), so that the controlled device reads the final result data from the fourth shared memory and performs action execution.
As a specific implementation manner, in the fourth step, if the remaining control tasks include a direct task for directly controlling the controlled device by the PLC control unit;
and aiming at the direct task, based on the input data packet, the PLC control unit processes the direct task and writes the direct processing result data obtained after the task is completed into a fourth shared memory, so that the controlled device reads the direct processing result data from the fourth shared memory and performs action execution, namely the PLC directly changes the running condition of the device.
As a specific implementation manner, in some application scenarios, only the motion control unit needs to perform processing of the control task, in this case, the control implementation process of the system is similar to that of the existing robot control system with only motion control, and only a brief description is made here, and the process is:
after the first step, the motion control unit reads the input data packet from the first shared memory, based on the input data packet, the motion control unit processes the control data according to the control requirement, and after the control task is completed, the motion control processing result data is directly written into the fourth shared memory, so that the controlled device reads the processing result data from the fourth shared memory and performs action execution.
Furthermore, it is easily understood that the above-described control procedure implementation is only one loop process in the control implementation loop, and when the controlled device writes new device-related information into the first shared memory again (the first step in the process), the above-described process is repeated (i.e., the subsequent steps after the first step are continued), so as to form the control loop.
As a specific implementation manner, in this embodiment, the control system performs communication interaction with the controlled device through a fieldbus system, for example, the fieldbus system is implemented based on EtherCAT bus technology; as shown in fig. 7, the first shared memory and the fourth shared memory are respectively mapped to designated areas in the fieldbus shared memory (EtherCAT shared memory in fig. 7);
and the second shared memory and the third shared memory are respectively mapped to a designated area in the virtual shared memory created by the control system.
In addition, it should be noted that, in the present application, the motion control unit and the PLC control unit further implement information interaction related to the state module, the control module, the IO module, and the variable module based on a shared memory mechanism, and the implementation of the information interaction is substantially similar to the implementation of the shared memory mechanism in the device module (actually, adaptive adjustment is required), and repeated description of the implementation is omitted here.
The technical scheme of the application has the following advantages:
1. based on a mechanism of sharing a memory by the soft PLC and the motion control, the defects of corresponding logic of the motion control to complex logic interaction and actual I/O interface response logic are made up by the soft PLC, and the defects of prospective and continuous motion control of a soft PLC system are made up by the motion control, in other words, the robot control system combining the soft PLC and the motion control respectively combines the advantages of the soft PLC and the motion control;
2. the fastest interprocess communication mode is used, and the memory is shared to realize the communication between the two processes, so that the real-time performance of the whole system is improved;
3. aiming at the defects of the shared memory, namely, the problem that a system is crashed due to the fact that a plurality of processes send read-write requests to the same shared memory at the same time, a semaphore mode is specifically adopted to realize a synchronous mutual exclusion mechanism, and the stability of the system is effectively guaranteed.
The above description is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A robot control system combining soft PLC and motion control, comprising: a motion control unit and a PLC control unit;
the motion control unit and the PLC control unit realize the interaction of equipment information and control information between an equipment module and controlled equipment based on a shared memory mechanism;
wherein the device information and control information interaction comprises: and acquiring the equipment information of the controlled equipment from the outside, processing the control task according to the equipment information, and outputting the processing result to the controlled equipment.
2. The robot control system according to claim 1, wherein the process of acquiring the device information of the controlled device from the outside includes:
the controlled device writes an input data packet containing device information into a first shared memory;
the motion control unit reads the input data packet from the first shared memory, and the PLC control unit copies a copy of the input data packet from the first shared memory by using a second shared memory to read the input data packet from the second shared memory.
3. The robot control system according to claim 2, wherein the process of performing the processing of the control task according to the device information and outputting the processing result to the controlled device includes:
based on the input data packet, the motion control unit performs control data processing according to a control requirement, writes an identification data packet containing identification information of a completed task into the second shared memory after the completion of a corresponding control task, and notifies the PLC control unit;
the PLC control unit compares the input data packet and the identification data packet in the second shared memory according to the notification of the motion control unit, excludes the control task completed by the motion control unit, processes the rest control tasks based on the input data packet, writes PLC processing result data obtained after the tasks are completed into a third shared memory, and notifies the motion control unit;
and the motion control unit reads the PLC processing result data from the third shared memory according to the notification of the PLC control unit, integrates the PLC processing result data with the motion control processing result data obtained by the motion control unit completing the control task, and writes the integrated final result data into a fourth shared memory so that the controlled equipment reads the final result data from the fourth shared memory to execute the action.
4. The robot control system according to claim 3, wherein the remaining control tasks include a direct task of directly controlling the controlled device by the PLC control unit;
and aiming at the direct task, based on the input data packet, the PLC control unit processes the direct task and writes direct processing result data obtained after the task is completed into the fourth shared memory, so that the controlled device reads the direct processing result data from the fourth shared memory and performs action execution.
5. The robotic control system of claim 3, wherein the control system communicatively interacts with the controlled device via a fieldbus system;
the first shared memory and the fourth shared memory are respectively mapped to designated areas in the field bus shared memory correspondingly;
and the second shared memory and the third shared memory are respectively mapped to a designated area in the virtual shared memory created by the control system correspondingly.
6. A robotic control system as claimed in claim 5, in which the fieldbus system is implemented on the basis of EtherCAT bus technology.
7. A robot control system according to any of claims 1-6, characterized in that the PLC control unit is implemented based on the Beremiz software architecture.
8. A robot control system according to any of claims 1-6, characterized in that in the shared memory mechanism, a synchronous mutual exclusion mechanism is implemented on the basis of a semaphore approach.
9. A robot control system according to any of claims 1 to 6, wherein the motion control unit and the PLC control unit are further based on a shared memory mechanism to realize information interaction related to a state module, a control module, an IO module and a variable module of the system.
CN202210618926.1A 2022-06-02 2022-06-02 Robot control system combining soft PLC and motion control Active CN114690702B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210618926.1A CN114690702B (en) 2022-06-02 2022-06-02 Robot control system combining soft PLC and motion control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210618926.1A CN114690702B (en) 2022-06-02 2022-06-02 Robot control system combining soft PLC and motion control

Publications (2)

Publication Number Publication Date
CN114690702A true CN114690702A (en) 2022-07-01
CN114690702B CN114690702B (en) 2022-08-23

Family

ID=82131271

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210618926.1A Active CN114690702B (en) 2022-06-02 2022-06-02 Robot control system combining soft PLC and motion control

Country Status (1)

Country Link
CN (1) CN114690702B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080168092A1 (en) * 2007-01-10 2008-07-10 General Electric Company Systems and methods for turbine control simulation
CN103136343A (en) * 2013-02-05 2013-06-05 中国科学院上海微系统与信息技术研究所 Shared resource real-time interaction method
WO2014110749A1 (en) * 2013-01-17 2014-07-24 Abb Technology Ltd. Robot control system and method thereof
CA2901619A1 (en) * 2015-08-26 2015-10-21 Ultralight Technologies Inc. Monitoring alignment of computer file states across a group of users

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080168092A1 (en) * 2007-01-10 2008-07-10 General Electric Company Systems and methods for turbine control simulation
WO2014110749A1 (en) * 2013-01-17 2014-07-24 Abb Technology Ltd. Robot control system and method thereof
CN103136343A (en) * 2013-02-05 2013-06-05 中国科学院上海微系统与信息技术研究所 Shared resource real-time interaction method
CA2901619A1 (en) * 2015-08-26 2015-10-21 Ultralight Technologies Inc. Monitoring alignment of computer file states across a group of users

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
姚舜等: "工业机器人控制器实时多任务软件设计与实现", 《工业控制计算机》 *

Also Published As

Publication number Publication date
CN114690702B (en) 2022-08-23

Similar Documents

Publication Publication Date Title
Balasubramanian et al. An architecture for metamorphic control of holonic manufacturing systems
US20070168082A1 (en) Task-based robot control system for multi-tasking
US4922413A (en) Method for concurrent execution of primitive operations by dynamically assigning operations based upon computational marked graph and availability of data
JPH0236969B2 (en)
US7669002B1 (en) System and method for providing an application with memory access methods
JPS61256406A (en) Controller
CN111427310A (en) Industrial robot controller operation system
CN109983411B (en) Flow control of program modules
CN102955460A (en) Control system of numerical control system master station over input/output (IO) terminal slave station
US20240100697A1 (en) Multi-Thread Controller for Parallel Robot
US9152454B2 (en) Method for enabling sequential, non-blocking processing of statements in concurrent tasks in a control device
Bruzzone et al. Standard Linux for embedded real-time robotics and manufacturing control systems
CN114690702B (en) Robot control system combining soft PLC and motion control
JP5131269B2 (en) Multi-processing system
US20060155968A1 (en) Electronic computer, semiconductor integrated circuit, control method, program generation method, and program
US6418540B1 (en) State transfer with throw-away thread
CN112802527B (en) Method for realizing high-speed programming of embedded flash memory and programming system of embedded flash memory
EP4296856A1 (en) Computer system and method for executing an automotive customer function
CN117272412B (en) Interrupt control register protection method, device, computer equipment and storage medium
Balasubramanian A metamorphic control architecture for holonic systems.
Colnaric State of the art review paper: advances in embedded hard real-time systems design
JPS63173130A (en) Apparatus for expanding instruction set of computer
JPH0687221B2 (en) Information processing equipment
Seifert et al. Identification of WCET Analysis Parameters for Asynchronous I/O Processing in MCUs
JP2023049531A (en) Control device

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
GR01 Patent grant
GR01 Patent grant