CN115061403A - Software-defined controller and programming method and motion control method thereof - Google Patents

Software-defined controller and programming method and motion control method thereof Download PDF

Info

Publication number
CN115061403A
CN115061403A CN202210715866.5A CN202210715866A CN115061403A CN 115061403 A CN115061403 A CN 115061403A CN 202210715866 A CN202210715866 A CN 202210715866A CN 115061403 A CN115061403 A CN 115061403A
Authority
CN
China
Prior art keywords
motion control
controller
api function
real
control api
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210715866.5A
Other languages
Chinese (zh)
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.)
Kyland Technology Co Ltd
Original Assignee
Kyland Technology 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN202210715866.5A priority Critical patent/CN115061403A/en
Publication of CN115061403A publication Critical patent/CN115061403A/en
Pending legal-status Critical Current

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/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0426Programming the control sequence
    • 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/20Pc systems
    • G05B2219/23Pc programming
    • G05B2219/23146Programmable, reconfigurable via microprocessor or coding switches

Landscapes

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

Abstract

The invention provides a software-defined controller, a programming method and a motion control method thereof, wherein the controller comprises a real-time system and a non-real-time system which are installed on an operating system kernel, an application program for industrial control, a motion control API function and a motion control dynamic library; 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 for acquiring the state of the controlled equipment in real time and generating a control instruction; the motion control dynamic library comprises an interface of the motion control API function; and the application program is used for calling the motion control API function through the motion control dynamic library to acquire the state of the controlled equipment and control the controlled equipment in real time. The technical scheme of the invention reduces the cost of the controller, enlarges the application range and improves the timeliness of industrial control.

Description

Software-defined controller and programming method and motion control method thereof
Technical Field
The invention relates to the field of industrial control, in particular to a software-defined controller and a programming method and a motion control method thereof.
Background
For system integrators in the discrete manufacturing field, particularly in the 3C industry, there are two appeal aspects in developing OEM equipment, one is that there is only one operation screen in OEM equipment, and the other is that they want all development work of OEM equipment, including development of vision, control, HMI, to be uniformly developed by a software engineer on Visual Studio. Therefore, in the prior art, an industrial personal computer + motion control card scheme is adopted, a motion control card provides a C + + API on the pair, and then, the C + + and C # are adopted for Visual development and HMI picture development of the OEM equipment, so that all development tasks of the whole OEM equipment can be completed by adopting the Visual Studio IDE, and only one software development engineer needs to be configured. And a uniform display interface is output from the industrial personal computer to display the HMI and visual software.
For system integrators, the biggest problem of the scheme of adopting the industrial personal computer and the motion control card is cost, generally, the cost of the motion control card is related to the number of servo axes of controlled equipment, and the more the number of the controlled axes is, the more the number of the control cards needing to be configured is, and the higher the overall cost is. On the other hand, the function of the hardware motion control card is realized through hardware, the function is fixed, and the possibility of function upgrading is hardly available in the later stage. Therefore, an innovative architecture is needed, which can reduce the procurement cost of the system and realize later-stage convenient function upgrade on the premise of ensuring the development habit and the development period.
Disclosure of Invention
In view of this, an embodiment of the present invention provides a software-defined controller, a programming method thereof, and a motion control method thereof, where the controller includes a real-time system and a non-real-time system installed on an operating system kernel, an application program for industrial control, a motion control API function, and a motion control dynamic library; 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 for acquiring the state of the controlled equipment in real time and generating a control instruction; the motion control dynamic library comprises an interface of the motion control API function; and the application program is used for calling the motion control API function through the motion control dynamic library to acquire the state of the controlled equipment and control the controlled equipment in real time. The technical scheme of the invention reduces the cost of the controller, enlarges the application range, simultaneously reduces the influence of an application program on the real-time performance of the motion control API function, and improves the timeliness of industrial control.
In a 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 program, a motion control API function and a motion control dynamic library which are installed on an operating system kernel; 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 for acquiring the state of the controlled equipment in real time and generating a control instruction in real time according to control data, and the control instruction is used for controlling the controlled equipment in real time; the motion control dynamic library comprises an interface of the motion control API function; the application program is used for calling the motion control API function through the motion control dynamic library to acquire the state of the controlled equipment, generating corresponding control data of the motion control API function according to the state, and calling the motion control API function through the motion control dynamic library to control the controlled equipment in real time.
By the above, the controller is realized through full software, and compared with the controller of the motion control card realized by an industrial personal computer and hardware, the cost of the controller is reduced, and the application range is expanded. Meanwhile, the motion control API function is positioned on a real-time system and has an independent resource environment, the influence of other operations in an application program on the motion control API function to generate a control instruction is reduced, and the timeliness of the controller is improved.
In a possible implementation of the first aspect, the interface of the motion control API function remains unchanged when modifying the code of the control logic within the motion control API function.
Therefore, when the codes of the control logic in the motion control API function are modified, the interface of the motion control API function is kept unchanged, and the cost of the motion control card is further reduced.
In one possible implementation of the first aspect, a software-defined controller further comprises: and the axis configuration debugging program is used for calling the motion control API function configuration and debugging the servo driver of the controlled equipment through the motion control dynamic library.
Therefore, the motion control card can be used for the whole process of industrial control by adding the axis configuration debugging program on the motion control card.
In one possible implementation of the first aspect, the controller further comprises: the motion control API function is installed on the virtual PLC, the virtual PLC is installed on the real-time operation environment, and the real-time operation environment is installed on the real-time system; the real-time operating environment is used for sending the control command to a servo driver of the controlled equipment and is also used for acquiring the state from the controlled equipment.
Therefore, the timeliness of the motion control API function of the motion control card is further improved by adding the real-time running environment and the virtual PLC to the motion control card.
In one possible implementation of the first aspect, the real-time execution environment and the servo driver communicate via EtherCAT protocol; and the real-time operating environment is communicated with the virtual PLC through a Modbus TCP protocol.
In the above, the motion control card is made available to the distributed controlled devices by the EtherCAT protocol.
In one possible implementation of the first aspect, the controller further comprises: the human-computer interface is arranged in a non-real-time system; the human-computer interface is used for managing the controller and displaying a control result of the controller on the controlled equipment.
Therefore, the control result is displayed in real time through the human-computer interface, and the control effect of the application program is monitored in time.
In a second aspect, an embodiment of the present invention provides a method for controlling a motion of a software-defined controller, where the method is executed on the controller according to any implementation manner of the first aspect, and includes: calling the motion control API function to acquire the state of the controlled equipment by the application program of the controller through an interface of the motion control API function in the motion control dynamic library of the controller; obtaining, by the application program, control parameters of a corresponding motion control API function according to a business logic of the application program using the state; calling the motion control API function by the application program through an interface of the motion control API function, so that the motion control API function generates the control instruction by using the control parameter; and the motion control API function sends a control instruction to the controlled equipment.
Therefore, the controller obtains and controls the state of the controlled device by calling the motion control API function in the motion control card realized by software, and compared with the motion control card realized by hardware, the cost of the controller is reduced, and the application range is expanded.
In a possible implementation manner of the second aspect, when the controller further includes a shaft configuration debugger, the method further includes: and calling the motion control API function by the axis configuration debugging program through an interface of the motion control API function, and configuring and debugging a servo driver of the controlled equipment.
Therefore, the motion control card can be used for the whole process of industrial control by adding the axis configuration debugging program on the motion control card.
In a possible implementation manner of the second aspect, when the controller further comprises 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 method of motion control for a software defined controller further comprising: and sending the control command to a servo driver of the controlled device by the real-time operating environment, and acquiring the state from the controlled device.
Therefore, the timeliness of the motion control API function of the motion control card is further improved by adding the real-time running environment and the virtual PLC to the motion control card.
In one possible embodiment of the second aspect, the real-time execution environment and the servo driver communicate via EtherCAT protocol; and the real-time running environment is communicated with the virtual PLC through a Modbus TCP protocol.
In the above, the motion control card is made available to the distributed controlled devices by the EtherCAT protocol.
In one possible implementation of the second aspect, the controller further comprises: the human-computer interface is arranged in a non-real-time system; a method of motion control for a software defined controller further comprising: and the human-computer interface is used for managing the controller and displaying a control result of the controller on the controlled equipment.
Therefore, the control result is displayed in real time through the human-computer interface, and the control effect of the application program is monitored in time.
In a third aspect, an embodiment of the present invention provides a method for programming a software-defined controller, including: acquiring a motion control dynamic library of the controller and storing the motion control dynamic library in a corresponding directory of an IDE (integrated drive interface) of the controller, wherein the motion control dynamic library comprises an interface of a motion control API (application program interface) function of the controller, the motion control API function is used for controlling a controlled device, and the motion control API function is installed on a real-time system of the controller; and calling the motion control API function interface by using C + +/C language in the IDE of the controller, programming an application program of the controller, and compiling the application program into an executable program, wherein the application program is installed on a non-real-time system of the controller.
Therefore, the application program of the motion control dynamic library programming controller is called by using the C/C + + language, and compared with the traditional ladder diagram language or S/T language development of the industrial personal computer, the application program of the controller is reduced, and the development cost is reduced.
In one possible implementation manner of the third aspect, the method further includes: downloading the application executable and the motion control dynamic library into the same directory of the non-real time system of the controller.
Thus, the executable program of the application program and the motion control dynamic library are downloaded in the same directory, and the application program is convenient to call the motion control API function.
In one possible implementation manner of the third aspect, the method further includes: the motion control API function is programmed in the IDE of the controller using the C + +/C language and compiled into an executable library of the motion control API function and the motion control dynamic library.
In this way, the motion control API function is compiled into the motion control dynamic library, such that the application program may invoke the motion control API function.
In one possible implementation manner of the third aspect, the method further includes: when the motion control API function is modified using the 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.
Therefore, when the motion control API function is modified, the application program is not changed, and the use range of the controller is expanded.
In one possible implementation manner of the third aspect, the method further includes: programming a shaft configuration debugging program by using the programming method, wherein the shaft configuration debugging program is used for calling a motion control API function configuration and debugging a servo driver of the controlled equipment through the motion control dynamic library; the axis configuration debugger runs on the non-real-time system or the IDE of the controller.
Therefore, the motion control card can be used for the whole process of industrial control by adding the axis configuration debugging program on the motion control card.
In one possible implementation manner of the third aspect, the method further includes: and programming and compiling a program of a human-computer interface of the controller in the IDE of the controller, and downloading the program into a non-real-time system for managing the controller and displaying a control result of the controller on a controlled device.
Therefore, the control result is displayed in real time through the human-computer interface, and the control effect of the application program is monitored in time.
In a fourth aspect, embodiments of the present invention provide a computing device, comprising,
a bus;
a communication interface connected to the bus;
at least one processor coupled to the bus; and
at least one memory coupled to the bus and storing program instructions that, when executed by the at least one processor, cause the at least one processor to perform any of the embodiments of the second or third aspects of the invention.
In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which program instructions are stored, and the program instructions, when executed by a computer, cause the computer to execute the implementation manner of any of the second aspect or the third aspect.
Drawings
FIG. 1 is a schematic diagram of an application scenario of the present invention;
FIG. 2 is a schematic diagram of a first embodiment of a software-defined controller according to the present invention;
FIG. 3 is a schematic diagram of a second embodiment of a software-defined controller according to the present invention;
FIG. 4 is a schematic diagram of a layer structure of a second embodiment of a software defined controller according to the present invention;
FIG. 5 is a flowchart illustrating an embodiment of a method for controlling motion of a software-defined controller according to the present invention;
FIG. 6 is a flowchart illustrating a first embodiment of a method for programming a software-defined controller according to the present invention;
FIG. 7 is a flowchart illustrating a first embodiment of a method for programming a software-defined controller according to the present invention;
fig. 8 is a schematic structural diagram of a computing device according to various embodiments of the present invention.
Detailed Description
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is 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.
In the following description, references to the terms "first \ second \ third, etc." or module a, module B, module C, etc. are used solely to distinguish between similar objects or different embodiments and are not intended to imply a particular ordering with respect to the objects, it being understood that where permissible any particular ordering or sequence may be interchanged to enable embodiments of the invention described herein to be practiced otherwise than as shown or described herein.
In the following description, reference to reference numerals indicating steps, such as S110, S120 … …, etc., does not necessarily indicate that the steps are performed in this order, and the order of the preceding and following steps may be interchanged or performed simultaneously, where permissible.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
The embodiment of the invention provides a software-defined controller, a programming method and a motion control method thereof, wherein the controller comprises a real-time system and a non-real-time system which are installed on an operating system kernel, an industrial control application program, a motion control API function and a motion control dynamic library; 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 for acquiring the state of the controlled equipment in real time and generating a control instruction; the motion control dynamic library comprises an interface of the motion control API function; and the application program is used for calling the motion control API function through the motion control dynamic library to acquire the state of the controlled equipment and control the controlled equipment in real time. The technical scheme of the invention reduces the cost of the controller, enlarges the application range, simultaneously reduces the influence of an application program on the real-time performance of the motion control API function, and improves the timeliness of industrial control.
First, the structure of an application scenario of embodiments of the present invention is described below, and fig. 1 shows an application scenario of embodiments of the present invention, which includes a controller, a controlled device, a status display, and a development environment.
Illustratively, the controlled devices include protocol stack devices, servo drivers to control the servo axes, I/O controlled button indicator lights, and industrial cameras.
The controller realizes the collection of the state of the controlled equipment and the control of the controlled equipment, and the operation control card of the invention runs in the controller.
The status display is used for HMI display and industrial field display.
The development environment is used for application program development of industrial control, axis configuration and debugging of controlled equipment, visual development and HMI picture development.
In some embodiments, the development environment is implemented using the computational power of the controller. In other embodiments, the development environment is implemented using a stand-alone computer.
Embodiments of the invention are described below with reference to fig. 2-7.
First, a first embodiment of a software defined controller according to the present invention will be described with reference to fig. 2.
A software-defined controller embodiment, first deployed in the controller of fig. 1, includes real-time and non-real-time systems installed on an operating system kernel, industrial control applications, motion control API functions, and motion control dynamic libraries; 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 for acquiring the state of the controlled equipment in real time and generating a control instruction; the motion control dynamic library comprises an interface of the motion control API function; and the application program is used for calling the motion control API function through the motion control dynamic library to acquire the state of the controlled equipment and control the controlled equipment in real time. The software-defined controller embodiment reduces the cost of the motion control card, enlarges the application range, simultaneously enables the application program of the controller and the motion control API function of the motion control card to be on different systems of the same kernel, reduces the influence of the application program on the real-time performance of the motion control API function, and improves the timeliness of the controller.
FIG. 2 illustrates the architecture of one embodiment of a software-defined controller, 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 computer system hardware resources 320.
The motion control API function 110 is installed on the real-time system 220, the motion control dynamic library 120 and the application program 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 hardware resource 320 of the computer system, and the real-time system 220 is connected with the controlled device through a set protocol.
Some motion control API functions 110 are configured to obtain a state of the controlled device in real time through the real-time system 220, and other motion control API functions 110 are configured to generate a control command in real time according to control data, where the control command is configured to control the controlled device in real time through the real-time system 220, and the control data is generated by the application 130 according to the state of the controlled device.
The state of the controlled device comprises the state of a servo driver of the controlled device and the state of an external IO port, and the control instruction comprises a servo driver control instruction and an external IO port control instruction of the controlled device.
The motion control dynamic library 120 includes an interface for each motion control API function 110, which is called by the application 130, so that the application 130 obtains the state of the controlled device and/or generates a control command through the corresponding motion control API function 110.
Illustratively, the application 130 uses the C + + language, and the motion control dynamics library 120 includes an interface to the C + + motion control API function 110.
Wherein the interface of the motion control API function 110 in the motion control dynamic library 120 remains unchanged when modifying the code of the control logic within the motion control API function 110.
The application 130 is an industrial control program that implements a stand-alone manufacturing 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 for the corresponding motion control API function 110 using the state of the controlled device according to the business logic of the industrial control. The application 130 is further configured to enable the corresponding motion control API function 110 to generate a control command of the controlled device by 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.
The operating system kernel 310 virtualizes the computer system hardware resources 320 and provides independent resources for the non-real time system 210 and the real time system 220, respectively.
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 operate using isolated resources, and the influence of the application 130 on the real-time performance of the motion control API function 110 is degraded, especially when the application 130 occupies a large amount of calculation during image display or prediction motion trajectory calculation.
It is to 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, referred to as motion control card software, that may be installed together.
In summary, in the first embodiment of the 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, so that the implementation cost is low, and different scenarios are easily matched. Meanwhile, the application program of the controller and the motion control API function of the motion control card are on different systems of the same kernel, so that the influence of the application program on the real-time performance of the motion control API function is reduced, and the timeliness of the controller is improved.
A second software defined controller embodiment of the present invention is described below with reference to fig. 3 and 4.
The device of the second embodiment of the software-defined controller is deployed in the controller of fig. 1. The second embodiment of the software-defined controller is additionally provided with a virtual PLC and a real-time operating environment (RTE), the real-time environment is improved for the real-time operation of a motion control API function, and a shaft configuration debugging program is added, so that the method not only can collect the state of the controlled equipment and generate a control instruction of the controlled equipment, but also can be used for generating a servo controller for configuring the controlled equipment, and the full-flow management of the controlled equipment is realized.
Fig. 3 shows the structure of a second embodiment of the software-defined controller, which includes an application 152, an axis configuration debugger 162, and a human-machine interface 172 at an application level, an API function 112 and a motion control dynamic library 122 at an API function level, a virtual PLC 132, and a real-Time execution Environment (RTE) 142 (RTE 142) at an execution Environment level; the operating 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.
The motion control dynamic library 122, the application 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. Non-real time system 212 and real time system 222 are installed on operating system kernel 312, and operating system kernel 312 is installed on computer system hardware resources 322.
The application 152, the non-real-time system 212, the operating system kernel 312 and the computer system hardware resources 322 are 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 embodiment, respectively, and the newly added parts and the changed parts are emphasized here.
The motion control API function 112 adds servo controller configuration and debug functions to the controlled device based on the motion control API function 110 of one of the software-defined controller embodiments.
The motion control dynamic library 122 is based on the motion control dynamic library 120 of the first software-defined controller embodiment, and correspondingly adds an interface of the motion control API function 112 for configuring and debugging the servo controller of the controlled device.
The virtual PLC 132 provides a runtime environment for the motion control API function 112, and the motion control API function 112 runs in the virtual PLC 132.
RTE 142 has contained EtherCAT and Modbus TCP protocol stack, and RTE 142 passes through Modbus TCP protocol communication with virtual PLC 132, and RTE 142 passes through EtherCAT communication with the servo driver of the controlled equipment.
The RTE 142 is used for acquiring a motion control API function 112 through a Modbus TCP protocol to generate a control instruction, and sending the control instruction to a servo driver of the controlled equipment through an EtherCAT protocol; the RTE 142 is further configured to obtain the status of the controlled device from the controlled device through an EtherCAT protocol, and send the status to the corresponding motion control API function 112 in the virtual PLC 132 through a Modbus TCP protocol.
The RTE 142 further includes functions of task management of industrial control, mapping management of variables of the virtual PLC, system state diagnosis of the virtual PLC, and the like, and provides an operating environment for the virtual PLC.
Real-time system 222 is configured to provide operating resources for RTE 142, and to improve timeliness of virtual PLC 132 and motion control API function 112 on RTE 142.
The axis configuration debugger 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.
The human-machine interface 172 is used for graphically displaying the motion control result of the controller on the controlled device through the state display.
In some embodiments, a development environment IDE is also installed on the non-real time system 212 for programming and compiling the application 152, and in other embodiments, the development environment IDE is installed on a separate computer. The development environment IDE utilizes the C + +/C language to program the application 152 using the interface to the motion control API functions provided by the motion control dynamic library, the ladder language or the ST language used by the non-legacy PLC.
Illustratively, the 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 functions provided by the motion control dynamic library.
It is to be emphasized that: the motion control API functions 112, motion control dynamic library 122, virtual PLC 132, RTE 142, real-time system 222, and axis configuration debugger 162 are packaged in a software package, referred to as motion control card software, that may be installed together. In this embodiment, the axis configuration debugger 162 is installed on the real-time system 222, and in other embodiments, the axis configuration debugger 162 is installed in a computer of the development environment of the controller application.
Illustratively, the non-real-time system 222 is a windows system, the operating system kernel 312 is an Intewll system of eastern earthtechnology, and the motion control card is a software-defined motion control card in Maview, an industrial control product of eastern earthtechnology.
FIG. 4 is a layered architectural diagram illustrating operation of a second embodiment of a controller of the present invention, including an application layer, an API function layer, a driver layer, a real-time environment layer, and an operating system layer. The application layer comprises an application program of the controller and an axis configuration debugging program of the motion control card; the application program and the axis configuration debugging program call a motion control API function of the API function layer to acquire the state of the controlled equipment or generate a control instruction of the controlled equipment; the motion control API function is communicated with the RTE of the real-time environment layer through a Modbus TCP protocol of the driving layer; the RTE obtains kernel resources from an intewell RTOS (Real Time Operation System) of the operating System layer.
In summary, in the second embodiment of the software-defined controller, a virtual PLC and a real-time operating environment (RTE) are added, so that the real-time environment is improved for the real-time operation of the motion control API function, and the timeliness of the controller control is further improved. And a shaft configuration debugging program is added, so that the method not only can collect the state of the controlled equipment and generate a control instruction of the controlled equipment, but also can be used for generating a servo controller for configuring the controlled equipment, and the full-flow management of the controlled equipment is realized.
An embodiment of the motion control method of the software-defined controller of the present invention is described below with reference to fig. 5.
For clarity of description, an embodiment of a motion control method of a software-defined controller is to use the controller in the second embodiment of the software-defined controller as an example to perform motion control, where the motion control card is a software-defined motion control card in Maview, an industrial control product of eastern earth technologies, ltd, a non-real-time system is a windows system, and an operating system kernel is an Intewll system of eastern earth technologies, ltd.
Fig. 5 shows a flow of an embodiment of a motion control method of the present invention, which includes steps S510 to S560.
S510: and configuring and debugging a servo driver of the controlled device by using the axis configuration debugging program of the motion control card.
Wherein, one possible implementation manner of the step is as follows:
1) and respectively copying the motion control dynamic library file '. dll' of the motion control card into a corresponding engineering directory of a Maview IDE (integrated drive electronics device), wherein the Maview IDE can be arranged on a Windows system of a controller or an independent computer.
2) And configuring the configuration of an EtherCAT master station and a slave station of the controller and the configuration of an engineering task by using an axis configuration debugging program of the motion control card in the Maview IDE, generating a configuration file, and downloading the configuration file to the controller.
3) In the Windows system of the controller, a servo driver of a controlled device is modulated by an EtherCAT protocol by using a shaft configuration debugging program.
S520: and copying the executive program of the application program of the controller and the motion control dynamic library file into a corresponding directory of a Windows system of the controller.
Wherein the corresponding directory is a directory of engineering tasks for control created by the controller's Windows system.
Wherein this step can be skipped if it is already performed when developing the application.
S530: and the application program of the controller calls the motion control API function obtained by the state to obtain the state of the controlled equipment through the interface of the motion control API function obtained by the state in the motion control dynamic library.
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.
Wherein, one possible implementation manner of the step is as follows:
1) and the application program of the controller calls the motion control API function obtained by the state in the virtual PLC through the interface of the motion control API function obtained by the state in the motion control dynamic library.
2) And the motion control API function for state acquisition sends a state acquisition command to the RTE by utilizing a Modbus TCP protocol.
3) And the RTE acquires the state of the controlled equipment by using an EtherCAT protocol.
4) And the RTE feeds back the acquired state to the motion control API function acquired by the state by utilizing a Modbus TCP protocol.
5) The state-derived motion control API function feeds back the state of the controlled device to the controller's application.
S540: the application program of the controller generates control data of the motion control API function of the control class according to the service logic of the application program by using the state of the controlled equipment.
For example, in the application program of the track control, the application program interpolates the track according to the acquired state of the controlled device, such as the actual position of the motion axis, and the interpolation calculation amount is large, so the application program is put into the Windows of the non-real-time system so as not to influence the real-time performance of the motion control API function in the real-time system.
S550: and 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 using the control data of the motion control API function.
Wherein, one possible implementation manner of the step is as follows:
1) and 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.
2) The motion control API function of the control class generates control instructions using its control data.
For example, SET _ HOME (WORD axis, WORD org _ logic) is a motion control API function of a control class, and the SET _ HOME is operated by using control data thereof according to a specific definition of internal logic to generate a control command.
3) And the motion control API function of the control class sends a control command to the RTE by utilizing a Modbus TCP protocol.
S560: and the RTE sends a control command to the controlled equipment to control the controlled equipment.
And the RTE sends a control command to an external I/O (input/output) and a servo driver of the controlled equipment by using an EtherCAT (Ethernet control and Automation technology) protocol so as to control the controlled equipment.
A method embodiment of programming a software defined controller of the present invention is described below in conjunction with fig. 6 and 7.
First, a first programming method embodiment of a software-defined controller according to the present invention is described with reference to fig. 6, and a first programming method embodiment of a software-defined controller operates in the development environment of the controller of fig. 1, calls a motion control API function interface in a motion control dynamic library, programs an application program for industrial control, and compiles the application program into an executable program.
Fig. 6 shows a flow of a first embodiment of a programming method of a software-defined controller, which includes steps S610 to S630.
S610: and acquiring a motion control dynamic library, and storing the motion control dynamic library in a corresponding directory of the IDE of the controller.
And the motion control dynamic library file is a 'dll' file and comprises an interface of a motion control API function. The corresponding directory is a directory of the compiled application of the IDE of the controller.
In some embodiments, a motion control dynamic library is obtained that has already been compiled.
In other embodiments, the motion control API functions are programmed with C/C + + via the IDE of the controller and packaged for their interface to generate the motion control dynamic library. While modifying code of control logic within the motion control API function, an interface of the motion control API function remains unchanged to keep the application program unchanged.
S620: and calling a motion control API function interface in the motion control dynamic library by using a C + +/C language, programming an application program of the controller by combining the service logic of the controller, and compiling the application program into an executable program.
Illustratively, taking the motion control API function SET _ HOME (WORD axis, WORD org _ logic) as an example, in IDE software of the controller, for example, Visual Studio, the interface of the SET _ HOME (WORD axis, WORD org _ logic) is called by using C + +/C language through the motion control dynamic library to be programmed, which is actually the process of deriving the SET _ HOME function and symbols from the motion control dynamic library file ". dll".
S630: the executable program of the application program and the motion control dynamic library are downloaded into a corresponding directory of the non-real-time system of the controller.
Wherein the corresponding directory is a directory of the created engineering task for control.
In summary, in an embodiment of a programming method for a software-defined controller, a motion control API function interface in the motion control dynamic library is called to program an application program for industrial control, and the application program is compiled into an executable program.
A second embodiment of the programming method of the software-defined controller according to the present invention is described below with reference to fig. 7, where the second embodiment of the programming method of the software-defined controller runs in a development environment of the controller shown in fig. 1, and on the basis of the first embodiment of the programming method of the software-defined controller, the motion control API function is programmed and compiled to generate a motion control dynamic library, and a motion control API function interface in the motion control dynamic library is also called to program an axis configuration debugging program of an industrial control. The second embodiment of the programming method of the software-defined controller not only has low development cost, but also realizes the full-flow development of the control software.
Fig. 7 shows a flow of an embodiment of a programming method of a software-defined controller, which includes steps S710 to S750.
S710: the motion control API function is programmed in the IDE of the controller using the C + +/C language and compiled into an executable library of motion control API functions and a motion control dynamic library.
Wherein, in some embodiments, the motion control API function is also modified with this step, and when the motion control API function is modified, the interface of the motion control API function remains unchanged to keep the application program unchanged.
S720: the motion control dynamic library is stored in a corresponding directory in the IDE of the controller, and the executable library of the motion control API function is downloaded into the real-time system of the controller.
And the motion control dynamic library file is a 'dll' file and comprises an interface of a motion control API function. The corresponding directory is a directory of the compiled application of the IDE of the controller.
Wherein, in some embodiments, the real-time system of the controller includes a virtual PLC that downloads an executable library of the motion control API function into the virtual PLC of the real-time system of the controller.
S730: and calling a motion control API function interface in a motion control dynamic library by using C + +/C language in the IDE of the controller, programming an application program of the controller by combining service logic of the controller, compiling the application program into an executable program, and downloading the executable program of the application program and the motion control dynamic library into a corresponding directory of a non-real-time system of the controller.
The method of this step is the same as the programming method of the software-defined controller in steps S620 and S630 of the first embodiment.
S740: and calling a motion control API function interface in a motion control dynamic library by using C + +/C language in the IDE of the controller, configuring a debugging program by the axis of the programming controller, compiling the debugging program into an executable program, and downloading the executable program into a running directory of the executable program.
Wherein in some embodiments the axis configuration debugger runs in the IDE of the controller, and in other embodiments the axis configuration debugger runs in a non-real time system of the controller.
S750: the human-machine interface program of the controller is programmed and compiled in the IDE of the controller using C + +/C language, and its executable program is downloaded into the corresponding directory of the non-real-time system of the controller.
In summary, an embodiment of a programming method for a software-defined controller is based on the first embodiment of the programming method for a software-defined controller, and is configured to program and compile a motion control API function to generate a motion control dynamic library, and call a motion control API function interface in the motion control dynamic library to program an axis configuration debugging program for industrial control. The second embodiment of the programming method of the software-defined controller not only has low development cost, but also realizes the full-flow development of the control software.
The embodiment of the invention also provides a computing device, which is described in detail below with reference to fig. 8.
The computing device 800 includes a processor 810, a memory 820, a communication interface 830, and a bus 840.
It is to be appreciated that the communication interface 830 in the computing device 800 illustrated in this figure can be utilized to communicate with other devices.
The processor 810 may be coupled to the memory 820. The memory 820 may be used to store the program codes and data. Therefore, the memory 820 may be a storage unit inside the processor 810, may be an external storage unit independent of the processor 810, or may be a component including a storage unit inside the processor 810 and an external storage unit independent of the processor 810.
Optionally, computing device 800 may also include a bus 840. The memory 820 and the communication interface 830 may be connected to the processor 810 through a bus 840. The bus 840 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 840 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one line is shown, but this does not represent only one bus or one type of bus.
It should be understood that, in the embodiment of the present invention, the processor 810 may employ a Central Processing Unit (CPU). The processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Or the processor 810 adopts one or more integrated circuits for executing related programs to implement the technical solutions provided by the embodiments of the present invention.
The memory 820 may include both read-only memory and random access memory, and provides instructions and data to the processor 810. A portion of the processor 810 may also include non-volatile random access memory. For example, the processor 810 may also store information of the device type.
When the computing device 800 is run, the processor 810 executes the computer-executable instructions in the memory 820 to perform the operational steps of the various method embodiments.
It should be understood that the computing device 800 according to the embodiment of the present invention may correspond to a corresponding main body for executing the method according to the embodiments of the present invention, and the above and other operations and/or functions of each module in the computing device 800 are respectively for implementing corresponding flows of each method of the embodiment, and are not described herein again for brevity.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program for performing, when executed by a processor, the operational steps of the method embodiments.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a 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.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious modifications, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in more detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention.

Claims (16)

1. A software defined controller, comprising: a real-time system and a non-real-time system, an industrial control application program, a motion control API function and a motion control dynamic library which are installed on an operating system kernel;
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 for acquiring the state of the controlled equipment in real time and generating a control instruction in real time according to control data, and the control instruction is used for controlling the controlled equipment in real time;
the motion control dynamic library comprises an interface of the motion control API function;
the application program is used for calling the motion control API function through the motion control dynamic library to acquire the state of the controlled equipment, obtaining the control data according to the service logic of the application program by using the state, and calling the motion control API function through the motion control dynamic library to generate the control instruction.
2. The controller of claim 1, wherein the interface of the motion control API function remains unchanged when modifying code of control logic within the motion control API function.
3. The controller of claim 1, further comprising: and the axis configuration debugging program is used for calling the motion control API function configuration and debugging the servo driver of the controlled equipment through the motion control dynamic library.
4. The controller of claim 1, further comprising: the motion control API function is installed in the virtual PLC, the virtual PLC is installed on a real-time operation environment, and the real-time operation environment is installed on a real-time system;
and the motion control API function acquires the state from the controlled equipment through the real-time running environment and sends the control instruction to a servo driver of the controlled equipment.
5. The controller of claim 4, wherein the real-time operating environment communicates with the servo driver via an EtherCAT protocol;
and the real-time operating environment is communicated with the virtual PLC through a Modbus TCP protocol.
6. The controller of claim 4, further comprising a human-machine interface, the human-machine interface being installed in a non-real-time system;
the human-computer interface is used for managing the controller and displaying a control result of the controller on the controlled equipment.
7. A method of controlling the movement of a software defined controller, the method being run on the controller of any one of claims 1 to 6, comprising:
calling the motion control API function to acquire the state of the controlled equipment by the application program of the controller through an interface of the motion control API function in the motion control dynamic library of the controller;
obtaining, by the application program, control parameters of a corresponding motion control API function according to a business logic of the application program using the state;
calling the motion control API function by the application program through an interface of the motion control API function, so that the motion control API function generates the control instruction by using the control parameter;
and sending a control instruction to the controlled equipment by the motion control API function.
8. The method of claim 7, wherein when the controller further comprises a shaft configuration debugger, further comprising:
and calling the motion control API function by the axis configuration debugging program through an interface of the motion control API function, and configuring and debugging a servo driver of the controlled equipment.
9. A method of programming a software defined controller, comprising:
acquiring a motion control dynamic library of the controller and storing the motion control dynamic library in a corresponding directory of an IDE (integrated drive interface) of the controller, wherein the motion control dynamic library comprises an interface of a motion control API (application program interface) function of the controller, the motion control API function is used for controlling a controlled device, and the motion control API function is installed on a real-time system of the controller;
and calling the motion control API function interface by using C + +/C language in the IDE of the controller, programming an application program of the controller, and compiling the application program into an executable program, wherein the application program is installed on a non-real-time system of the controller.
10. The method of claim 9, further comprising: downloading the application executable and the motion control dynamic library into the same directory of the non-real time system of the controller.
11. The method of claim 9, further comprising:
the motion control API function is programmed in the IDE of the controller using the C + +/C language and compiled into an executable library of the motion control API function and the motion control dynamic library.
12. The method of claim 9, further comprising:
when the motion control API function is modified using the 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.
13. The method of claim 9, further comprising: programming a shaft configuration debugging program by using the programming method, wherein the shaft configuration debugging program is used for calling a motion control API function configuration and debugging a servo driver of the controlled equipment through the motion control dynamic library;
the axis configuration debugger runs on the non-real-time system or the IDE of the controller.
14. The method of claim 9, wherein the programming and compiling of the human machine interface program of the controller is performed in an IDE of the controller and downloaded to a non-real time system for managing the controller and displaying the results of the controller's control of the controlled device.
15. A computing device, comprising,
a bus;
a communication interface connected to the bus;
at least one processor coupled to the bus; and
at least one memory coupled to the bus and storing program instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of any of claims 7 to 14.
16. A computer readable storage medium having stored thereon program instructions, which when executed by a computer, cause the computer to perform the method of any of claims 7 to 14.
CN202210715866.5A 2022-06-22 2022-06-22 Software-defined controller and programming method and motion control method thereof Pending CN115061403A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210715866.5A CN115061403A (en) 2022-06-22 2022-06-22 Software-defined controller and programming method and motion control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210715866.5A CN115061403A (en) 2022-06-22 2022-06-22 Software-defined controller and programming method and motion control method thereof

Publications (1)

Publication Number Publication Date
CN115061403A true CN115061403A (en) 2022-09-16

Family

ID=83201884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210715866.5A Pending CN115061403A (en) 2022-06-22 2022-06-22 Software-defined controller and programming method and motion control method thereof

Country Status (1)

Country Link
CN (1) CN115061403A (en)

Similar Documents

Publication Publication Date Title
US10705511B2 (en) Abstraction layers for automation applications
KR102183185B1 (en) Controlling runtime access to application programming interfaces
CN109445323B (en) WEB-based distributed intelligent measurement and control software platform design method
Belsare et al. Micro-ros
WO2020172089A1 (en) Automation code generator for interoperability across industrial ecosystems
CN115237428A (en) AI application deployment method, and related platform, cluster, medium, and program product
CN113434131A (en) Programming method and device, computer equipment and storage medium
Wenzel et al. Getting started with CAPI SNAP: Hardware development for software engineers
CN115061403A (en) Software-defined controller and programming method and motion control method thereof
CN115934062A (en) Industrial control program development platform and method
CN114860401A (en) Heterogeneous cloud desktop scheduling system, method, service system, device and medium
Mraidha et al. An execution framework for MARTE-based models
García-Valls Prototyping low-cost and flexible vehicle diagnostic systems
CN113961232A (en) Terminal, method and platform server for providing integrated development environment
CN112306539A (en) Method, system, terminal and medium for developing application layer of single chip microcomputer
Wood et al. Triton: a domain specific language for cyber-physical systems
Beierlein et al. UML-based co-design for run-time reconfigurable architectures
Navas et al. Reconciling run-time evolution and resource-constrained embedded systems through a component-based development framework
Di Trapani et al. NTGsim: A graphical user interface and a 3D simulator for nonlinear trajectory generation methodology
US11635998B2 (en) Standard API for integrated development environments
JP2014532223A (en) Method and apparatus for enabling a first computer program to execute application logic of a second computer program, for interfacing the first computer program and the second computer program And apparatus for generating computer program code for the same, a computer program, and a software interface for enabling a first computer program to execute application logic of a second computer program For providing information (computer program interface)
CN115079641A (en) Numerical control system and numerical control method
US20230419745A1 (en) Systems and techniques for providing an adaptable and container-based internet of things platform environment
Eberhardt et al. Getting Started with CAPI SNAP: Hardware Development for Software Engineers
Hosoai et al. System product line engineering for small appliances with driver derivation

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