A software-defined controller and its programming method and motion control method

Through the use of software defined controllers in OEM equipment development, the architecture of real -time and non -real -time system separation is used to solve the problem of high motion control card cost and fixed functional fixation in existing technologies. Effect of timeliness.

CN115061403BActive Publication Date: 2025-01-28KYLAND TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210715866.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2025-01-28
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

The existing technology has problems of high cost and fixed functions in the development of OEM equipment, especially in the use of motion control cards. The more axes are controlled, the more control cards need to be configured, and the higher the overall cost. Moreover, the functions implemented by the hardware are fixed and there is almost no possibility of function upgrades.

Method used

Software -defined controllers, including real -time systems installed on the operating system core and non -real -time system, industrial control applications, motion control API functions and motion control dynamic libraries. The motion control API function is installed in the real -time system. The application and motion control dynamic library are installed in a non -real -time system. This architecture reduces the cost of the controller, expands the scope of use, and realizes the later function upgrade.

Benefits of technology

The cost of the controller is reduced, the scope of use has been expanded, the real -time impact of applications on the API function of motion control API, improves the timeliness of industrial control, and realizes the flexible upgrade of the function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115061403B_ABST
    Figure CN115061403B_ABST
Patent Text Reader

Abstract

The present invention provides a software-defined controller and a programming method and a motion control method thereof, wherein the controller includes a real-time system and a non-real-time system installed on an operating system kernel, an industrial control application, a motion control API function and a motion control dynamic library; the motion control API function is installed in the real-time system, and the application and the motion control dynamic library are installed in the non-real-time system; the motion control API function is used to obtain the state of a controlled device and generate a control instruction in real time; the motion control dynamic library includes an interface of the motion control API function; the application is used to call the motion control API function through the motion control dynamic library to obtain the state of a controlled device and control the controlled device in real time. The technical solution of the present invention reduces the cost of the controller, expands the scope of use, and improves the timeliness of industrial control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial control, and in particular to a software-defined controller and a programming method and a motion control method thereof. Background Art

[0002] For system integrators in the discrete manufacturing field, especially in the 3C industry, they have two demands when developing OEM equipment. One is that the OEM equipment can only have one operating screen, and the other is that they hope that all development work of the OEM equipment, including vision, control, and HMI development, can be uniformly developed by a software engineer on Visual Studio. Therefore, the existing technology adopts the industrial computer + motion control card solution. The motion control card provides a C++ API, and then the visual development and HMI screen development of the OEM equipment use C++ and C#. In this way, all development tasks of the entire OEM equipment can be completed using the Visual Studio IDE, and only one software development engineer is required. A unified display interface is provided from the industrial computer to display the HMI and visual software.

[0003] For system integrators, the biggest problem with this solution of using industrial computers + motion control cards is cost. Generally speaking, the cost of motion control cards is related to the number of servo axes of the controlled device. The more axes are controlled, the more control cards need to be configured, and the higher the overall cost. On the other hand, the functions of hardware motion control cards are realized through hardware, and the functions are fixed, and there is almost no possibility of functional upgrades in the later stage. Therefore, an innovative architecture is needed that can reduce the procurement cost of the system while ensuring the development habits and development period, and can realize convenient functional upgrades in the later stage. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a software-defined controller and its programming method and motion control method, wherein the controller includes a real-time system and a non-real-time system installed on an operating system kernel, an industrial control application, a motion control API function and a motion control dynamic library; the motion control API function is installed in the real-time system, and the application and the motion control dynamic library are installed in the non-real-time system; the motion control API function is used to obtain the state of the controlled device and generate control instructions in real time; the motion control dynamic library includes an interface of the motion control API function; the application is used to call the motion control API function through the motion control dynamic library to obtain the state of the controlled device and control the controlled device in real time. The technical solution of the present invention reduces the cost of the controller, expands the scope of use, and at the same time reduces the impact of the application on the real-time performance of the motion control API function, thereby improving the timeliness of industrial control.

[0005] In the first aspect, an embodiment of the present invention provides a software-defined controller, which includes: a real-time system and a non-real-time system, an industrial control application, a motion control API function and a motion control dynamic library installed on an operating system kernel; the motion control API function is installed in the real-time system, and the application and the motion control dynamic library are installed in the non-real-time system; the motion control API function is used to obtain the state of the controlled device in real time, and to generate control instructions in real time according to control data, and the control instructions are used to control the controlled device in real time; the motion control dynamic library includes an interface of the motion control API function; the application is used to call the motion control API function through the motion control dynamic library to obtain the state of the controlled device, generate corresponding control data of the motion control API function according to the state, and call the motion control API function through the motion control dynamic library to control the controlled device in real time.

[0006] From the above, the controller is realized by all software, which reduces the cost of the controller and expands the scope of use compared with the controller of motion control card realized by industrial computer + hardware. At the same time, the motion control API function is located on the real-time system, with an independent resource environment, which reduces the influence of other operations in the application program on the control instructions generated by the motion control API function, and improves the timeliness of the controller.

[0007] In a possible implementation manner of the first aspect, when the code of the control logic in the motion control API function is modified, the interface of the motion control API function remains unchanged.

[0008] As described above, by keeping the interface of the motion control API function unchanged when modifying the code of the control logic in the motion control API function, the cost of the motion control card is further reduced.

[0009] In a possible implementation of the first aspect, a software-defined controller further includes: an axis configuration debugging program, wherein the axis configuration debugging program is used to configure and debug a servo driver of a controlled device by calling a motion control API function through the motion control dynamic library.

[0010] From the above, by adding an axis configuration debugging program to the motion control card, the motion control card can be used in the entire process of industrial control.

[0011] In a possible implementation of the first aspect, the controller also includes: a virtual PLC and a real-time operating environment, the motion control API function is installed on the virtual PLC, the virtual PLC is installed on the real-time operating environment, and the real-time operating environment is installed on the real-time system; the real-time operating environment is used to send the control instruction to the servo driver of the controlled device, and is also used to obtain the status from the controlled device.

[0012] From the above, by adding a real-time operating environment and a virtual PLC to the motion control card, the timeliness of the motion control API function of the motion control card is further improved.

[0013] In a possible implementation manner of the first aspect, the real-time operating environment communicates with the servo drive via an EtherCAT protocol; and the real-time operating environment communicates with the virtual PLC via a Modbus TCP protocol.

[0014] From the above, the motion control card can be used for distributed controlled devices through the EtherCAT protocol.

[0015] In a possible implementation manner of the first aspect, the controller further includes: the human-machine interface is installed in a non-real-time system; the human-machine interface is used to manage the controller and display the control result of the controller on the controlled device.

[0016] From the above, the control results are displayed in real time through the human-machine interface, so as to monitor the control effect of the application in time.

[0017] In a second aspect, an embodiment of the present invention provides a motion control method for a software-defined controller, which runs on the controller of any implementation mode of the first aspect, and comprises: an application of the controller calls the motion control API function through the interface of the motion control API function in the motion control dynamic library of the controller to obtain the state of the controlled device; the application uses the state to obtain the control parameters of the corresponding motion control API function according to the business logic of the application; the application calls the motion control API function through the interface of the motion control API function, so that the motion control API function generates the control instruction using the control parameters; and the motion control API function sends the control instruction to the controlled device.

[0018] From the above, the controller acquires and controls the state of the controlled device by calling the motion control API function in the motion control card implemented by software. Compared with the motion control card implemented by hardware, the cost of the controller is reduced and the scope of use is expanded.

[0019] In a possible implementation of the second aspect, when the controller further includes an axis configuration debugging program, it also includes: the axis configuration debugging program calls the motion control API function through the interface of the motion control API function to configure and debug the servo driver of the controlled device.

[0020] From the above, by adding an axis configuration debugging program to the motion control card, the motion control card can be used in the entire process of industrial control.

[0021] In a possible implementation of the second aspect, when the controller also includes a virtual PLC and a real-time operating environment, the motion control API function is installed on the virtual PLC, the virtual PLC is installed on the real-time operating environment, and the real-time operating environment is installed on the real-time system; a motion control method for a software-defined controller also includes: the real-time operating environment sends the control instruction to the servo driver of the controlled device, and is also used to obtain the status from the controlled device.

[0022] From the above, by adding a real-time operating environment and a virtual PLC to the motion control card, the timeliness of the motion control API function of the motion control card is further improved.

[0023] In a possible implementation manner of the second aspect, the real-time operating environment communicates with the servo drive via an EtherCAT protocol; and the real-time operating environment communicates with the virtual PLC via a Modbus TCP protocol.

[0024] From the above, the motion control card can be used for distributed controlled devices through the EtherCAT protocol.

[0025] In a possible implementation of the second aspect, the controller also includes: the human-machine interface is installed in a non-real-time system; a motion control method for a software-defined controller also includes: the human-machine interface is used to manage the controller and display the control results of the controller on the controlled device.

[0026] From the above, the control results are displayed in real time through the human-machine interface, so as to monitor the control effect of the application in time.

[0027] In the third aspect, an embodiment of the present invention provides a programming method for a software-defined controller, comprising: obtaining a motion control dynamic library of the controller and saving it in a corresponding directory of the IDE of the controller, the motion control dynamic library comprising an interface of a motion control API function of the controller, the motion control API function being used to control a controlled device, and the motion control API function being installed on a real-time system of the controller; calling the motion control API function interface using C++ / C language in the IDE of the controller, programming an application of the controller, and compiling it into an executable program, and the application being installed on a non-real-time system of the controller.

[0028] From the above, using C / C++ language to call motion control dynamic library to program controller application reduces the controller application and reduces development costs compared to using traditional ladder diagram language or S / T language of industrial computer.

[0029] In a possible implementation manner of the third aspect, the method further includes: downloading the executable program of the application and the motion control dynamic library into the same directory of the non-real-time system of the controller.

[0030] As described above, the executable program of the application and the motion control dynamic library are installed in the same directory, so that the application can call the motion control API function.

[0031] In a possible implementation of the third aspect, it also includes: programming the motion control API function using C++ / C language in the IDE of the controller, and compiling it into an executable library of the motion control API function and the motion control dynamic library.

[0032] As described above, the motion control API function is compiled into the motion control dynamic library, so that the application program can call the motion control API function.

[0033] In a possible implementation of the third aspect, it also includes: when the motion control API function is modified using C++ / C language in the IDE of the controller, the interface of the motion control API function remains unchanged to keep the application unchanged.

[0034] From the above, when the motion control API function is modified, the application program remains unchanged, thereby expanding the scope of use of the controller.

[0035] In a possible implementation of the third aspect, it also includes: programming an axis configuration debugging program using the programming method, the axis configuration debugging program is used to call the motion control API function through the motion control dynamic library to configure and debug the servo driver of the controlled device; the axis configuration debugging program runs on the non-real-time system or the IDE of the controller.

[0036] From the above, by adding an axis configuration debugging program to the motion control card, the motion control card can be used in the entire process of industrial control.

[0037] In a possible implementation of the third aspect, it also includes: programming and compiling a human-machine interface program of the controller in the IDE of the controller, and downloading it to a non-real-time system for managing the controller and displaying the control results of the controller on the controlled device.

[0038] From the above, the control results are displayed in real time through the human-machine interface, so as to monitor the control effect of the application in time.

[0039] In a fourth aspect, an embodiment of the present invention provides a computing device, including:

[0040] bus;

[0041] A communication interface connected to the bus;

[0042] at least one processor connected to the bus; and

[0043] At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes any implementation of the second aspect or the third aspect of the present invention.

[0044] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having program instructions stored thereon, wherein when the program instructions are executed by a computer, the computer executes any implementation method described in the second aspect or the third aspect of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a structural schematic diagram of the application scenarios of various embodiments of the present invention;

[0046] Figure 2 A schematic diagram of the structure of a software-defined controller embodiment 1 of the present invention;

[0047] Figure 3 A schematic diagram of the structure of a software-defined controller embodiment 2 of the present invention;

[0048] Figure 4 A schematic diagram of a layered structure of a software-defined controller embodiment 2 of the present invention;

[0049] Figure 5 A schematic flow chart of an embodiment of a motion control method of a software-defined controller of the present invention;

[0050] Figure 6 A flowchart of a first embodiment of a programming method for a software-defined controller of the present invention;

[0051] Figure 7 A flowchart of a first embodiment of a programming method for a software-defined controller of the present invention;

[0052] Figure 8 A schematic diagram of the structure of a computing device according to various embodiments of the present invention. DETAILED DESCRIPTION

[0053] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0054] In the following description, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects, or to distinguish different embodiments, and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted, so that the embodiments of the present invention described here can be implemented in an order other than that illustrated or described here.

[0055] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0057] The embodiment of the present invention provides a software-defined controller and its programming method and motion control method, wherein the controller includes a real-time system and a non-real-time system installed on an operating system kernel, an industrial control application, a motion control API function and a motion control dynamic library; the motion control API function is installed in the real-time system, and the application and the motion control dynamic library are installed in the non-real-time system; the motion control API function is used to obtain the state of the controlled device and generate control instructions in real time; the motion control dynamic library includes an interface of the motion control API function; the application is used to call the motion control API function through the motion control dynamic library to obtain the state of the controlled device and control the controlled device in real time. The technical solution of the present invention reduces the cost of the controller, expands the scope of use, and at the same time reduces the impact of the application on the real-time performance of the motion control API function, thereby improving the timeliness of industrial control.

[0058] The following first introduces the structure of the application scenario of each embodiment of the present invention. Figure 1 The application scenarios of various embodiments of the present invention are shown, which include a controller, a controlled device, a status display and a development environment.

[0059] By way of example, the controlled devices include a protocol stack device, a servo driver for controlling a servo axis, a button indicator light for I / O control, and an industrial camera.

[0060] The controller collects the state of the controlled device and controls the controlled device, and the operation control card of the present invention runs in the controller.

[0061] Among them, the status display is used for HMI display and industrial site display.

[0062] Among them, the development environment is used for industrial control application development, axis configuration and debugging of controlled equipment, visual development, and HMI screen development.

[0063] In some embodiments, the development environment is implemented using the computing power of the controller. In other embodiments, the development environment is implemented using an independent computer.

[0064] According to the following Figures 2 to 7 Various embodiments of the present invention are described.

[0065] First combine Figure 2 A first embodiment of a software-defined controller of the present invention is introduced.

[0066] A software-defined controller embodiment 1 is deployed in Figure 1 The controller includes a real-time system and a non-real-time system installed on an operating system kernel, an industrial control application, a motion control API function and a motion control dynamic library; the motion control API function is installed in the real-time system, and the application and the motion control dynamic library are installed in the non-real-time system; the motion control API function is used to obtain the state of the controlled device and generate control instructions in real time; the motion control dynamic library includes an interface of the motion control API function; the application is used to call the motion control API function through the motion control dynamic library to obtain the state of the controlled device and control the controlled device in real time. A software-defined controller embodiment 1 reduces the cost of the motion control card and expands the scope of use. At the same time, the controller's application and the motion control API function of the motion control card are placed on different systems of the same kernel, which reduces the impact of the application on the real-time performance of the motion control API function and improves the timeliness of the controller.

[0067] Figure 2 The structure of a software-defined controller embodiment 1 is shown, which includes a motion control API function 110, a motion control dynamic library 120, an application 130, a non-real-time system 210, a real-time system 220, an operating system kernel 310 and a computer system hardware resource 320.

[0068] The motion control API function 110 is installed on the real-time system 220, the motion control dynamic library 120 and the application 130 are installed on the non-real-time system 210, the non-real-time system 210 and the real-time system 220 are installed on the operating system kernel 310, the operating system kernel 310 is installed on the computer system hardware resources 320, and the real-time system 220 connects to the controlled device through a set protocol.

[0069] Among them, some motion control API functions 110 are used to obtain the status of the controlled device in real time through the real-time system 220, and other motion control API functions 110 are used to generate control instructions in real time according to control data. The control instructions are used to control the controlled device in real time through the real-time system 220. The control data is generated by the application 130 according to the status of the controlled device.

[0070] The state of the controlled device includes the state of the servo driver of the controlled device and the state of the external IO port, and the control instruction includes the servo driver control instruction of the controlled device and the external IO port control instruction.

[0071] The motion control dynamic library 120 includes interfaces of various motion control API functions 110 , which are called by the application program 130 , so that the application program 130 can obtain the state of the controlled device and / or generate control instructions through the corresponding motion control API function 110 .

[0072] By way of example, the application 130 uses C++ language, and the motion control dynamic library 120 includes an interface of the C++ motion control API function 110 .

[0073] When the code of the control logic in the motion control API function 110 is modified, the interface of the motion control API function 110 in the motion control dynamic library 120 remains unchanged.

[0074] The application 130 is an industrial control program that implements an independent production process. It is specifically used to obtain the state of the controlled device through the interface of the corresponding motion control API function 110 in the motion control dynamic library 120. The application 130 is also used to generate control data of the corresponding motion control API function 110 using the state of the controlled device according to the business logic of industrial control. The application 130 is also used to enable the corresponding motion control API function 110 to generate control instructions for the controlled device using the control data generated by the application 130 through the interface of the corresponding motion control API function 110, so as to control the controlled device.

[0075] The operating system kernel 310 virtualizes the computer system hardware resources 320 to provide independent resources for the non-real-time system 210 and the real-time system 220 .

[0076] The non-real-time system 210 provides an operating environment for the application 130, and the real-time system 220 provides an operating environment for the motion control API function 110, so that the application 130 and the motion control API function 110 can run using isolated resources, downgrading the impact of the application 130 on the real-time performance of the motion control API function 110, especially when the application 130 occupies a large amount of computing power when performing image display or predicting motion trajectory calculations.

[0077] It should be emphasized that the motion control API function 110, the motion control dynamic library 120, and the real-time system 222 are packaged in a software package, called the motion control card software, and can be installed together.

[0078] In summary, in a first embodiment of a software-defined controller, the application 130 on the non-real-time system controls the controlled device through the motion control API function on the real-time system, and when the function of the internal control logic of the motion control API function is modified, the application of the industrial control is not changed, the implementation cost is low, and it is easy to match different scenarios. At the same time, the application of the controller and the motion control API function of the motion control card are on different systems of the same kernel, which reduces the impact of the application on the real-time performance of the motion control API function and improves the timeliness of the controller.

[0079] Combine the following Figure 3 and Figure 4 A second embodiment of a software-defined controller of the present invention is introduced.

[0080] A device of a software-defined controller embodiment 2 is deployed in Figure 1 A second embodiment of a software-defined controller adds a virtual PLC and a real-time operating environment (RTE), improves the real-time environment for the real-time operation of the motion control API function, and adds an axis configuration debugging program, which is not only used to collect the state of the controlled device and generate the control instructions of the controlled device, but also used to generate and configure the servo controller of the controlled device, so as to realize the full process management of the controlled device.

[0081] Figure 3 The structure of a software-defined controller embodiment 2 is shown, which includes an application program 152, an axis configuration debugging program 162 and a human-machine interface 172 at the application level, a motion control API function 112 and a motion control dynamic library 122 at the API function level, and a virtual PLC 132 and a real-time running environment (Running Time Environment, RTE) 142, namely RTE 142 at the operating environment level; the operating system system layer includes a non-real-time system, a real-time system 222 and an operating system kernel 312, and the hardware layer includes computer system hardware resources 322.

[0082] Among them, the motion control dynamic library 122, the application program 152, the axis configuration debugging program 162 and the human-machine interface 172 are installed on the non-real-time system 212, the motion control API function 112 is installed on the virtual PLC 132, the virtual PLC 132 is installed on the RTE 142, and the RTE 142 is installed on the real-time system 222. The non-real-time system 212 and the real-time system 222 are installed on the operating system kernel 312, and the operating system kernel 312 is installed on the computer system hardware resources 322.

[0083] Among them, the application 152, the non-real-time system 212, the operating system kernel 312 and the computer system hardware resources 322 are respectively the application 130, the non-real-time system 210, the operating system kernel 310 and the computer system hardware resources 320 of the same software-defined controller implementation example, and the newly added parts and the changed parts are introduced here.

[0084] The motion control API function 112 is based on the motion control API function 110 of the first software-defined controller embodiment, and adds the servo controller configuration and debugging functions for the controlled device.

[0085] The motion control dynamic library 122 is based on the motion control dynamic library 120 of the first software-defined controller embodiment, and accordingly adds an interface of the motion control API function 112 for configuring and debugging the servo controller of the controlled device.

[0086] The virtual PLC 132 provides an operating environment for the motion control API function 112 , and the motion control API function 112 runs in the virtual PLC 132 .

[0087] The RTE 142 includes EtherCAT and Modbus TCP protocol stacks. The RTE 142 communicates with the virtual PLC 132 via the Modbus TCP protocol, and the RTE 142 communicates with the servo drive of the controlled device via EtherCAT.

[0088] RTE 142 is used to obtain the motion control API function 112 to generate control instructions through the Modbus TCP protocol, and send them to the servo driver of the controlled device through the EtherCAT protocol; RTE 142 is also used to obtain the status of the controlled device from the controlled device through the EtherCAT protocol, and send it to the corresponding motion control API function 112 in the virtual PLC 132 through the Modbus TCP protocol.

[0089] RTE 142 also includes functions such as industrial control task management, mapping management of virtual PLC variables and system status diagnosis of virtual PLC, providing an operating environment for virtual PLC.

[0090] The real-time system 222 is used to provide operating resources for the RTE 142 and improve the timeliness of the virtual PLC 132 and motion control API function 112 on the RTE 142 .

[0091] The axis configuration debugging program 162 is used to call the motion control API function 112 through the motion control dynamic library 122 to configure and debug the servo driver of the controlled device.

[0092] The human-machine interface 172 is used to graphically display the motion control results of the controller on the controlled device through a status display.

[0093] In some embodiments, a development environment IDE is also installed on the non-real-time system 212 for programming and compiling the application 152. In other embodiments, the development environment IDE is installed on a separate computer. The development environment IDE uses C++ / C language to program the application 152 using the interface of the motion control API function provided by the motion control dynamic library, rather than the ladder diagram language or ST language used by traditional PLCs.

[0094] For example, Visual Studio is installed in the development environment IDE, and the application 152 is programmed and compiled using the interface of the motion control API function provided by the motion control dynamic library.

[0095] It should be emphasized that the motion control API function 112, the motion control dynamic library 122, the virtual PLC 132, the RTE 142, the real-time system 222 and the axis configuration debugging program 162 are packaged in a software package, called the motion control card software, and can be installed together. In this embodiment, the axis configuration debugging program 162 is installed on the real-time system 222, and in other embodiments, the axis configuration debugging program 162 is installed in the computer of the development environment of the controller application.

[0096] For example, the non-real-time system 222 is a Windows system, the operating system kernel 312 is an Intel system of Dongtu Technology Co., Ltd., and the motion control card is a software-defined motion control card in Maview, an industrial control product of Dongtu Technology Co., Ltd.

[0097] Figure 4The layered structure diagram of the controller embodiment 2 of the present invention is shown, including the application layer, API function layer, driver layer, real-time environment layer and operating system layer. The application layer includes the application program of the controller and the axis configuration debugging program of the motion control card; the application program and the axis configuration debugging program call the motion control API function of the API function layer to obtain the state of the controlled device or generate the control instruction of the controlled device; the motion control API function communicates with the RTE of the real-time environment layer through the Modbus TCP protocol of the driver layer; the RTE obtains the kernel resources from the Intel RTOS (Real Time Operation System) of the operating system layer.

[0098] In summary, a software-defined controller embodiment 2 adds a virtual PLC and a real-time operating environment (RTE), which improves the real-time environment for the real-time operation of the motion control API function and further improves the timeliness of the controller control. An axis configuration debugging program is added, which not only collects the state of the controlled device and generates the control instructions of the controlled device, but also is used to generate and configure the servo controller of the controlled device, so as to realize the full process management of the controlled device.

[0099] Combine the following Figure 5 An embodiment of a motion control method of a software-defined controller of the present invention is introduced.

[0100] For the sake of clear description, an embodiment of a motion control method of a software-defined controller uses the controller described in Embodiment 2 of a software-defined controller as an example to perform motion control, and the motion control card is the software-defined motion control card in Maview, an industrial control product of Dongtu Technology Co., Ltd., the non-real-time system is a Windows system, and the operating system kernel is the Intel system of Dongtu Technology Co., Ltd.

[0101] Figure 5 The flowchart of a motion control method embodiment of the present invention includes S510 to S560.

[0102] S510: Use the axis configuration and debugging program of the motion control card to configure and debug the servo drive of the controlled device.

[0103] Among them, a possible implementation method of this step is as follows:

[0104] 1) Copy the motion control dynamic library files "*.dll" of the motion control card to the corresponding project directory of Maview IDE. Maview IDE can be on the Windows system of the controller or on a separate computer.

[0105] 2) Use the axis configuration debugging program of the motion control card in Maview IDE to configure the controller's EtherCAT master and slave configurations and engineering task configurations, generate configuration files, and download them to the controller.

[0106] 3) Use the axis configuration debugging program in the Windows system of the controller to modulate the servo drive of the controlled device through the EtherCAT protocol.

[0107] S520: Copy the execution program of the controller's application and the motion control dynamic library file to the corresponding directory of the controller's Windows system.

[0108] The corresponding directory is a directory for controlling engineering tasks created by the Windows system of the controller.

[0109] If this step has been performed when developing the application, it can be skipped.

[0110] S530: The application program of the controller calls the motion control API function for status acquisition through the interface of the motion control API function for status acquisition in the motion control dynamic library to obtain the status of the controlled device.

[0111] The state of the controlled device includes the state of the external IO and / or the state of the servo driver. Each servo driver controls one axis of the controlled device.

[0112] Among them, a possible implementation method of this step is as follows:

[0113] 1) The controller application calls the motion control API function for state acquisition in the virtual PLC through the interface of the motion control API function for state acquisition in the motion control dynamic library.

[0114] 2) The motion control API function for status acquisition uses the Modbus TCP protocol to send status acquisition instructions to RTE.

[0115] 3)RTE uses the EtherCAT protocol to obtain the status of the controlled device.

[0116] 4)RTE uses the Modbus TCP protocol to feed back the acquired status to the motion control API function for status acquisition.

[0117] 5) The motion control API function for status acquisition feeds back the status of the controlled device to the controller's application program.

[0118] S540: The application program of the controller obtains the state of the controlled device according to its business logic and generates control data of the motion control API function of the control class.

[0119] For example, in a trajectory control application, the application interpolates the trajectory based on the acquired state of the controlled device, such as the actual position of the motion axis. The interpolation calculation is large, so the application is placed in the Windows of a non-real-time system to avoid affecting the real-time performance of the motion control API function in the real-time system.

[0120] S550: The application program of the controller calls the motion control API function of the control class through the interface of the motion control API function of the control class and generates a control instruction by utilizing the control data thereof.

[0121] Among them, a possible implementation method of this step is as follows:

[0122] 1) The controller application calls the motion control API function of the control class through the interface of the motion control API function of the control class.

[0123] 2) The motion control API function of the control class generates control instructions using its control data.

[0124] For example, SET_HOME (WORD axis, WORD org_logic) is a motion control API function of a control class. SET_HOME generates control instructions by using its control data according to the specific definition of the internal logic.

[0125] 3) The motion control API function of the control class uses the Modbus TCP protocol to send control instructions to RTE.

[0126] S560: The RTE sends a control instruction to the controlled device to control the controlled device.

[0127] Among them, RTE uses the EtherCAT protocol to send control instructions to the external I / O and servo drive of the controlled device to control the controlled device.

[0128] Combine the following Figure 6 and Figure 7 An embodiment of a programming method for a software-defined controller according to the present invention is introduced.

[0129] Let's combine Figure 6 A first embodiment of a programming method for a software-defined controller of the present invention is introduced. The first embodiment of a programming method for a software-defined controller is run on Figure 1 In the development environment of the controller, it calls the motion control API function interface in the motion control dynamic library, programs the industrial control application, and compiles it into an executable program. Compared with the traditional controller that uses ladder diagram language or ST language programming for application programs, the application programming method is simple and the development cost is low.

[0130] Figure 6 The flowchart of a first embodiment of a programming method for a software-defined controller is shown, which includes steps S610 to S630.

[0131] S610: Get the motion control dynamic library and save it in the corresponding directory of the controller's IDE.

[0132] The motion control dynamic library file is a "*.dll" file, including the interface of the motion control API function. The corresponding directory is the directory of the compiled application program of the controller's IDE.

[0133] In some embodiments, a compiled motion control dynamic library is obtained.

[0134] In other embodiments, the motion control API function is programmed in C / C++ through the IDE of the controller, and its interface is packaged to generate a motion control dynamic library. When the code of the control logic in the motion control API function is modified, the interface of the motion control API function remains unchanged to keep the application program unchanged.

[0135] S620: Use C++ / C language to call the motion control API function interface in the motion control dynamic library, program the controller application program in combination with the business logic of the controller, and compile it into an executable program.

[0136] For example, taking the motion control API function SET_HOME (WORD axis, WORD org_logic) as an example, in the controller's IDE software, such as Visual Studio, programming is performed using C++ / C language to call the interface of SET_HOME (WORD axis, WORD org_logic) through the motion control dynamic library. This is actually the process of exporting the SET_HOME function and symbol from the motion control dynamic library file "*.dll".

[0137] S630: Download the application executable program and motion control dynamic library to the corresponding directory of the controller's non-real-time system.

[0138] The corresponding directory is a directory of the engineering task created for control.

[0139] In summary, embodiment 1 of a programming method for a software-defined controller calls the motion control API function interface in the motion control dynamic library, programs the industrial control application, and compiles it into an executable program. Compared with traditional controllers that use ladder diagram language or ST language programming for applications, the application programming method is simple and the development cost is low.

[0140] Let's combine Figure 7 A second embodiment of a programming method for a software-defined controller of the present invention is introduced. The second embodiment of a programming method for a software-defined controller is run on Figure 1 In the development environment of the controller, based on the first embodiment of a programming method for a software-defined controller, the motion control API function is programmed and compiled to generate a motion control dynamic library, and the motion control API function interface in the motion control dynamic library is called to program the axis configuration debugging program of the industrial control. The second embodiment of a programming method for a software-defined controller not only has a low development cost, but also realizes the full process development of the control software.

[0141] Figure 7 The flowchart of Embodiment 2 of a programming method for a software-defined controller is shown, which includes steps S710 to S750.

[0142] S710: Use C++ / C language to program motion control API functions in the controller's IDE and compile them into executable libraries and motion control dynamic libraries of motion control API functions.

[0143] In some embodiments, this step is also used to modify the motion control API function. When the motion control API function is modified, the interface of the motion control API function remains unchanged to keep the application program unchanged.

[0144] S720: Save the motion control dynamic library in the corresponding directory of the controller's IDE, and download the executable library of the motion control API function to the real-time system of the controller.

[0145] The motion control dynamic library file is a "*.dll" file, including the interface of the motion control API function. The corresponding directory is the directory of the compiled application program of the controller's IDE.

[0146] In some embodiments, the real-time system of the controller includes a virtual PLC, and the executable library of the motion control API function is downloaded to the virtual PLC of the real-time system of the controller.

[0147] S730: Use C++ / C language in the controller's IDE to call the motion control API function interface in the motion control dynamic library, program the controller's application in combination with the controller's business logic, and compile it into an executable program. Download the application's executable program and the motion control dynamic library to the corresponding directory of the controller's non-real-time system.

[0148] The method of this step is the same as steps S620 and S630 of embodiment 1 of a programming method for a software-defined controller.

[0149] S740: Use C++ / C language in the controller's IDE to call the motion control API function interface in the motion control dynamic library, program the controller's axis configuration debugging program, compile it into an executable program, and download the executable program to its running directory.

[0150] In some embodiments, the axis configuration debugging program runs in the IDE of the controller, and in other embodiments, the axis configuration debugging program runs in the non-real-time system of the controller.

[0151] S750: Use C++ / C language to program and compile the controller's human-machine interface program in the controller's IDE, and download its executable program to the corresponding directory of the controller's non-real-time system.

[0152] In summary, a second embodiment of a programming method for a software-defined controller is based on the first embodiment of a programming method for a software-defined controller, programs and compiles motion control API functions, generates a motion control dynamic library, and calls the motion control API function interface in the motion control dynamic library to program the axis configuration debugging program of the industrial control. The second embodiment of a programming method for a software-defined controller not only has a low development cost, but also realizes the full process development of the control software.

[0153] The embodiment of the present invention further provides a computing device, Figure 8 Detailed introduction.

[0154] The computing device 800 includes a processor 810 , a memory 820 , a communication interface 830 , and a bus 840 .

[0155] It should be understood that the communication interface 830 in the computing device 800 shown in this figure can be used to communicate with other devices.

[0156] The processor 810 may be connected to a memory 820. The memory 820 may be used to store the program code and data. Therefore, the memory 820 may be a storage unit inside the processor 810, or an external storage unit independent of the processor 810, or a component including a storage unit inside the processor 810 and an external storage unit independent of the processor 810.

[0157] Optionally, the computing device 800 may further include a bus 840. The memory 820 and the communication interface 830 may be connected to the processor 810 via the bus 840. The bus 840 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 840 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure is represented by only one line, but it does not mean that there is only one bus or one type of bus.

[0158] It should be understood that in the embodiment of the present invention, the processor 810 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 810 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present invention.

[0159] The memory 820 may include a read-only memory and a random access memory, and provides instructions and data to the processor 810. A portion of the processor 810 may also include a nonvolatile random access memory. For example, the processor 810 may also store information on the device type.

[0160] When the computing device 800 is running, the processor 810 executes the computer-executable instructions in the memory 820 to perform the operation steps of each method embodiment.

[0161] It should be understood that the computing device 800 according to an embodiment of the present invention can correspond to the corresponding subjects in the methods according to the various embodiments of the present invention, and the above-mentioned and other operations and / or functions of each module in the computing device 800 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.

[0162] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0163] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0164] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0165] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0166] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0167] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0168] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it is used to execute the operating steps of each method embodiment.

[0169] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0170] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0171] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0172] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0173] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present invention, all of which belong to the scope of protection of the present invention.

Claims

1. A software-defined controller, characterized in that: It includes: Real-time and non-real-time systems, industrial control applications, motion control API functions and motion control dynamic libraries installed on an operating system kernel; The operating system kernel provides independent resources for the non-real-time system and the real-time system respectively; The motion control API function is installed in a real-time system, and the application program and the motion control dynamic library are installed in a non-real-time system; The motion control API function is used to obtain the state of the controlled device in real time, and is also used to generate control instructions in real time according to the control data, and the control instructions are used to control the controlled device in real time; The motion control dynamic library includes an interface of the motion control API function, and when the code of the control logic in the motion control API function is modified, the interface of the motion control API function remains unchanged; The application is used to call the motion control API function through the motion control dynamic library to obtain the status of the controlled device, and is also used to use the status to obtain the control data according to the business logic of the application, and is also used to call the motion control API function through the motion control dynamic library to generate the control instruction.

2. The controller according to claim 1, characterized in that: Also includes: An axis configuration debugging program is used to configure and debug a servo driver of a controlled device by calling a motion control API function through the motion control dynamic library.

3. The controller according to claim 1, characterized in that: Also includes: A virtual PLC and a real-time operating environment, wherein the motion control API function is installed in the virtual PLC, the virtual PLC is installed in the real-time operating environment, and the real-time operating environment is installed in the real-time system; The motion control API function obtains the state from the controlled device through the real-time operating environment and sends the control instruction to the servo driver of the controlled device.

4. The controller according to claim 3, characterized in that: The real-time operating environment communicates with the servo driver via the EtherCAT protocol; The real-time operating environment communicates with the virtual PLC via the Modbus TCP protocol.

5. The controller according to claim 3, characterized in that: Also included is a human-machine interface, which is installed in the non-real-time system; The human-machine interface is used to manage the controller and display the control result of the controller on the controlled device.

6. A motion control method for a software-defined controller, characterized in that: The method is run on the controller according to any one of claims 1 to 5, comprising: The application program of the controller calls the motion control API function through the interface of the motion control API function in the motion control dynamic library of the controller to obtain the state of the controlled device; The application uses the state to obtain control parameters of the corresponding motion control API function according to the business logic of the application; The application program calls the motion control API function through the interface of the motion control API function, so that the motion control API function generates the control instruction using the control parameter; The motion control API function sends a control instruction to the controlled device.

7. The method according to claim 6, characterized in that: When the controller further includes an axis configuration debugging program, it also includes: The axis configuration and debugging program calls the motion control API function through the interface of the motion control API function to configure and debug the servo driver of the controlled device.

8. A method for programming a software-defined controller, characterized in that: include: Obtaining a motion control dynamic library of the controller and saving it in a corresponding directory of the IDE of the controller, wherein the motion control dynamic library includes an interface of a motion control API function of the controller, wherein the motion control API function is used to control a controlled device, and wherein the motion control API function is installed on a real-time system of the controller; In the IDE of the controller, the motion control API function interface is called using C++ / C language, an application of the controller is programmed and compiled into an executable program, the application is installed on the non-real-time system of the controller, and is used to call the motion control API function through the motion control dynamic library to obtain the state of the controlled device, and is also used to obtain control data according to the business logic of the application using the state, and is also used to call the motion control API function through the motion control dynamic library to generate control instructions; the operating system kernel of the controller provides independent resources for the non-real-time system and the real-time system respectively; When the motion control API function is modified using C++ / C language in the IDE of the controller, the interface of the motion control API function remains unchanged to keep the application program unchanged.

9. The method according to claim 8, characterized in that: Also includes: The executable program of the application and the motion control dynamic library are downloaded to the same directory of the non-real-time system of the controller.

10. The method according to claim 8, characterized in that: Also includes: The motion control API function is programmed in the IDE of the controller using C++ / C language and compiled into an executable library of the motion control API function and the motion control dynamic library.

11. The method according to claim 8, characterized in that: Also includes: Programming an axis configuration debugging program using the programming method, wherein the axis configuration debugging program is used to call the motion control API function through the motion control dynamic library to configure and debug the servo driver of the controlled device; The axis configuration debugger runs on the non-real-time system or the controller's IDE.

12. The method according to claim 8, characterized in that: The program of the human-machine interface of the controller is programmed and compiled in the IDE of the controller, and downloaded to the non-real-time system for managing the controller and displaying the control result of the controller on the controlled device.

13. A computing device, characterized in that: include, bus; A communication interface connected to the bus; at least one processor connected to the bus; as well as At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes the method according to any one of claims 6 to 12.

14. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 6 to 12.

Citation Information

Patent Citations

  • Drive and control integrated technical architecture

    CN111381552A

  • Intelligent equipment response time improving method based on PC platform

    CN114528027A