Networked control system simulation platform design method and system

By designing a networked control system simulation platform, using matlab-simulink to create models and compile and link them, and combining with the network delay module, the problem that traditional simulation platforms cannot quickly update control algorithms and cannot truly simulate network control environments is solved, and the goal of simplifying the design process, improving debugging efficiency and control effect is achieved.

CN120105633APending Publication Date: 2025-06-06HIWING TECH ACAD OF CASIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311658484.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The traditional automatic control real-time simulation platform cannot quickly update the control algorithm, which increases the difficulty and R&D burden of control system design, and cannot truly simulate the operating environment of the controller in network control.

Method used

Design a networked control system simulation platform, use matlab-simulink to establish a networked control system model, generate a model program, perform RTW compilation, obtain the intermediate model program, compile the target code through the target language compiler, and compile and link it through the linking file to obtain the target program. At the same time, a network delay module is added to truly simulate the network control environment.

Benefits of technology

It simplifies the design process of the controller, improves the debugging efficiency of control algorithms and parameters, and more realistically simulates the operating environment of the controller in network control, improves the control effect, and reduces the R&D burden of designers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120105633A_ABST
    Figure CN120105633A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information, and discloses a networking control system simulation platform design method and system. The method comprises the following steps of: establishing a networked control system model by utilizing matlab-simulink; aiming at the networked control system model, generating a model program; performing RTW compilation on the model program, the system target file and the compilation template file to obtain an intermediate model program; compiling the intermediate model program through a target language compiler to obtain a target code corresponding to an expected hardware environment; and compiling and linking the generated target code according to the compiling and linking file to obtain a target program. Therefore, a transmission medium of control information can be simplified, an iterative control algorithm can be quickly optimized, and a designer is freed from a manual code writing process and more focuses on and focuses on the design of a control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a design method and system for a networked control system simulation platform. Background Art

[0002] With the rapid development of information technology, computer technology and network technology have had a profound impact on the informatization and automation of enterprises. In the field of automatic control, the use of the network as a transmission medium has greatly enriched the technology and means of industrial control, and has greatly changed the system structure, control methods and human-machine collaboration between the automation system and the industrial control system. But at the same time, it has also brought some new problems, such as the coupling of control and communication, delay, information scheduling, etc. At the same time, the traditional automatic control real-time simulation platform, which is mostly based on the waterfall development model, usually cannot quickly update the control algorithm after the controller is designed, so that it cannot quickly update and optimize the control parameters and control methods during the debugging process. These undoubtedly increase the difficulty of control system design and the R&D burden of designers. Summary of the invention

[0003] The present invention provides a networked control system simulation platform design method and system, which can solve the problems in the prior art.

[0004] The present invention provides a method for designing a networked control system simulation platform, wherein the method comprises:

[0005] Use matlab-simulink to build a networked control system model;

[0006] For the networked control system model, generating a model program;

[0007] Performing RTW compilation on the model program, the system target file and the compilation template file to obtain an intermediate model program;

[0008] Compiling the intermediate model program by a target language compiler to obtain a target code corresponding to the expected hardware environment;

[0009] Compile and link the generated target code according to the compilation file to obtain the target program.

[0010] Preferably, using matlab-simulink to establish a networked control system model includes:

[0011] Use matlab-simulink to build a basic model;

[0012] Add a clock synchronization server to the basic model;

[0013] Add a delay module to the basic model after adding the clock synchronization server;

[0014] The basic model with the delay module added is modularized to obtain a networked control system model.

[0015] Preferably, the established basic model includes a controller, an actuator, a sensor and a controlled object, the actuator is connected between the controlled object and the sensor, and the controller is connected to the actuator and the sensor via a network.

[0016] Preferably, the network is Ethernet.

[0017] Preferably, the clock synchronization server is located in the network and is used to provide time synchronization for the controller, the actuator, the sensor and the controlled object.

[0018] Preferably, the delay module comprises a forward control delay module and a feedback control delay module, the forward control delay module is connected between the actuator and the controller, and the feedback control delay module is connected between the sensor and the controller.

[0019] Preferably, the method further comprises:

[0020] The generated target program is verified in real time using the xPC-target real-time kernel.

[0021] The present invention also provides a networked control system simulation platform design system, wherein the design system includes a host machine, and the host machine is used to run matlab-simulink to perform the following steps:

[0022] Establish a networked control system model;

[0023] For the networked control system model, generating a model program;

[0024] Performing RTW compilation on the model program, the system target file and the compilation template file to obtain an intermediate model program;

[0025] Compiling the intermediate model program by a target language compiler to obtain a target code corresponding to the expected hardware environment;

[0026] Compile and link the generated target code according to the compilation file to obtain the target program.

[0027] Preferably, the design system further comprises a target machine, wherein the target machine is used to run an xPC-target real-time kernel to perform real-time verification on the generated target program.

[0028] Preferably, the target machine comprises an embedded board.

[0029] Through the above technical scheme, the v design mode can be adopted, the rapid prototyping design method can be used, and the design process of the controller can be simplified by establishing a networked control system simulation platform (model), and the debugging efficiency of the control algorithm and parameters can be improved. At the same time, in the simulation model, a network delay module is added to more realistically simulate the operating environment of the controller in the network control, thereby improving the control effect. In general, the present invention can simplify the transmission medium of the control information, quickly optimize the iterative control algorithm, free the designer from the process of manually writing code, and focus more on the design of the control system. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The included drawings are used to provide a further understanding of the embodiments of the present invention, which constitute a part of the specification, are used to illustrate the embodiments of the present invention, and together with the text description, explain the principles of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 A flow chart of a method for designing a networked control system simulation platform according to an embodiment of the present invention is shown;

[0032] Figure 2 A schematic diagram of a basic model according to an embodiment of the present invention is shown;

[0033] Figure 3 A schematic diagram showing a basic model after a clock synchronization server is added according to an embodiment of the present invention;

[0034] Figure 4 A schematic diagram of a basic model with a delay module added according to an embodiment of the present invention is shown;

[0035] Figure 5 A schematic diagram of a networked control system simulation platform design system according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0036] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0038] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, numerical expressions and numerical values ​​do not limit the scope of the present invention. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be regarded as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.

[0039] Figure 1 A flow chart of a method for designing a networked control system simulation platform according to an embodiment of the present invention is shown.

[0040] like Figure 1 As shown, an embodiment of the present invention provides a method for designing a networked control system simulation platform, wherein the method includes:

[0041] Use matlab-simulink to build a networked control system model, namely matlab-simulink modeling;

[0042] For the networked control system model, a model program (Model.mdl) is generated;

[0043] Perform RTW compilation on the model program, system target file and compilation template file to obtain an intermediate model program (Model.rtw);

[0044] Compiling the intermediate model program by a target language compiler to obtain a target code corresponding to the expected hardware environment;

[0045] Compile and link the generated target code according to the compilation file (Model.mk) to obtain the target program.

[0046] Through the above technical scheme, the v design mode can be adopted, the rapid prototyping design method can be used, and the design process of the controller can be simplified by establishing a networked control system simulation platform (model), and the debugging efficiency of the control algorithm and parameters can be improved. At the same time, in the simulation model, a network delay module is added to more realistically simulate the operating environment of the controller in the network control, thereby improving the control effect. In general, the present invention can simplify the transmission medium of the control information, quickly optimize the iterative control algorithm, free the designer from the process of manually writing code, and focus more on the design of the control system.

[0047] In the compilation step, relevant parameters may be input through a runtime interface, for example, the relevant parameters may include simulation step length and monitoring parameters.

[0048] According to an embodiment of the present invention, using matlab-simulink to establish a networked control system model includes:

[0049] Use matlab-simulink to build a basic model;

[0050] Add a clock synchronization server to the basic model;

[0051] Add a delay module (network delay compensation module) to the basic model after adding the clock synchronization server;

[0052] The basic model with the delay module added is modularized to obtain a networked control system model.

[0053] Through modular processing, the controller, actuator, sensor, delay module, etc. are formed into independent modules, and their own changes and optimizations do not affect other modules, which makes it more convenient to build various simulation environments.

[0054] According to one embodiment of the present invention, the established basic model includes a controller, an actuator, a sensor and a controlled object, the actuator is connected between the controlled object and the sensor, and the controller is connected to the actuator and the sensor via a network.

[0055] That is, in the control loop, the monitoring quantity is collected, information is transmitted, and real-time control is performed through the network. The communication network is introduced into the control system to connect the field equipment and the automation system, realizing the distribution and networking of the field equipment control, so that it can share more information resources and perform remote operation and control through the network, which greatly reduces the lines between the controller and the sensor and actuator, making the entire control loop easier to expand and maintain.

[0056] According to an embodiment of the present invention, the network is Ethernet.

[0057] That is, in the control loop, Ethernet can be used to collect monitoring quantities, transmit information, and perform real-time control.

[0058] According to an embodiment of the present invention, the clock synchronization server is located in the network and is used to provide time synchronization for the controller, the actuator, the sensor and the controlled object.

[0059] In this way, the clock synchronization of each node in the control loop can be guaranteed.

[0060] According to an embodiment of the present invention, the delay module includes a forward control delay module and a feedback control delay module, the forward control delay module is connected between the actuator and the controller, and the feedback control delay module is connected between the sensor and the controller.

[0061] By adding a network delay compensation module, the delay problem in networked control can be compensated, making it closer to the real networked control environment, thereby ensuring the timeliness of data is more guaranteed.

[0062] Among them, the forward channel is the control between the controller and the controlled object, and its network delay is compensated; the feedback channel is the control between the sensor and the controller, and its network delay is compensated.

[0063] For example, the forward control path: the network delay between the controller and the actuator is defined as τ sc ; Feedback control path: The network delay between the sensor and the controller is defined as τ ca , then the delay of the networked control system is τ = τ sc +τ ca To calculate the network delay at each stage, the time when the data is generated can be sent together with the data. The data packets transmitted between networks contain both data information and time information. In a network control system, the sensor can put the measurement value and its time in a data packet, so that the controller can get the timestamp when receiving the measurement value, and compare the timestamp value with the local clock to calculate the network delay.

[0064] Convert the time of different nodes to the same node for calculation. The specific method is as follows:

[0065] Take two nodes A and B in the system as an example, let t i is the base time (absolute time), is the local time of node A, is the local time of Node B, where:

[0066]

[0067]

[0068] where α A and α B are the time errors of node A and node B respectively, and if the clock error is Δ, then:

[0069] Δ=α A +α B

[0070] From the above formula we can get:

[0071]

[0072] Node A is When a read request signal is sent, node B receives the signal and then The signal is returned and Arrives at node A. Then T AB It is the transmission time of the signal from node A to node B, which is the delay.

[0073]

[0074] For the clock error Δ, it can be obtained by taking the average value through multiple calculations:

[0075]

[0076] Furthermore, τ can be easily calculated using the timestamp method. sc and τ ca , and finally obtain the delay model (delay module).

[0077] According to one embodiment of the present invention, the method further includes:

[0078] The generated target program is verified in real time using the xPC-target real-time kernel.

[0079] That is, simulation experiments are conducted on the effects of the controller to continuously optimize and adjust the design of the controller.

[0080] The xPC-target real-time kernel is used for real-time verification to ensure the real-time performance of the control system.

[0081] Figure 5 A schematic diagram of a networked control system simulation platform design system according to an embodiment of the present invention is shown.

[0082] like Figure 5 As shown, an embodiment of the present invention further provides a networked control system simulation platform design system, wherein the design system includes a host machine, and the host machine is used to run matlab-simulink to perform the following steps:

[0083] Establish a networked control system model;

[0084] For the networked control system model, generating a model program;

[0085] Performing RTW compilation on the model program, the system target file and the compilation template file to obtain an intermediate model program;

[0086] Compiling the intermediate model program by a target language compiler to obtain a target code corresponding to the expected hardware environment;

[0087] Compile and link the generated target code according to the compilation file to obtain the target program.

[0088] The v design mode can be adopted, and the design method of rapid prototyping can be used to simplify the design process of the controller by establishing a networked control system simulation platform (model), thereby improving the debugging efficiency of the control algorithm and parameters. At the same time, in the simulation model, a network delay module is added to more realistically simulate the operating environment of the controller in network control, thereby improving the control effect. In general, the present invention can simplify the transmission medium of the control information, quickly optimize the iterative control algorithm, free the designer from the process of manually writing code, and focus more on the design of the control system.

[0089] According to an embodiment of the present invention, the design system further includes a target machine, and the target machine is used to run the xPC-target real-time kernel to perform real-time verification on the generated target program.

[0090] Wherein, the target machine is connected to the host machine via Ethernet.

[0091] That is, by transmitting the generated target program from the host machine to the target machine via Ethernet, the effect of the controller can be simulated and the real-time simulation and control of the entire control loop can be achieved to continuously optimize and adjust the design of the controller.

[0092] Through the host machine and the target machine, monitoring and operation can be more convenient.

[0093] According to an embodiment of the present invention, the target machine includes an embedded board.

[0094] Wherein, the target machine also includes a capture card.

[0095] The networked control system simulation platform design method and system of the present invention are described below with reference to examples.

[0096] Taking the driver writing of the actuator module dadriver2004 as an example, according to the hardware information, the modular code can be written through S-functions. After completing the construction of each module of the simulation loop, the designer can devote more energy to the design of the controller. For example, the PID control module provided by simulink can be used, or more types of controllers can be designed as needed, and the method and system described in the present invention can be used to automatically generate the target code, and finally generate the target program corresponding to the hardware platform, so as to complete the verification of the effect of the controller and the control algorithm in the control loop.

[0097] It can be seen from the above embodiments that the networked control system simulation platform design method and system described in the present invention can adopt the v-model development method, by compiling template files and target files, the established graphical simulation model is converted into target code and finally an executable program is generated, which reduces the design difficulty of the control system and improves the design efficiency of the control system.

[0098] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the devices or elements referred to must have a specific direction or be constructed and operated in a specific direction. Therefore, they cannot be understood as limiting the scope of protection of the present invention. The directional words "inside and outside" refer to the inside and outside relative to the contours of each component itself.

[0099] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0100] In addition, it should be noted that the use of terms such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above terms have no special meaning and therefore cannot be understood as limiting the scope of protection of the present invention.

[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A design method for a networked control system simulation platform. It is characterized in that The method includes: Use matlab-simulink to build a networked control system model; For the networked control system model, generating a model program; Performing RTW compilation on the model program, the system target file and the compilation template file to obtain an intermediate model program; Compiling the intermediate model program by a target language compiler to obtain a target code corresponding to the expected hardware environment; Compile and link the generated target code according to the compilation file to obtain the target program.

2. The method according to claim 1, It is characterized in that Using matlab-simulink to build a networked control system model includes: Use matlab-simulink to build a basic model; Add a clock synchronization server to the basic model; Add a delay module to the basic model after adding the clock synchronization server; The basic model with the delay module added is modularized to obtain a networked control system model.

3. The method according to claim 2, It is characterized in that The established basic model includes a controller, an actuator, a sensor and a controlled object, wherein the actuator is connected between the controlled object and the sensor, and the controller is connected to the actuator and the sensor through a network.

4. The method according to claim 3, It is characterized in that The network is Ethernet.

5. The method according to claim 4, It is characterized in that The clock synchronization server is located in the network and is used to provide time synchronization for the controller, the actuator, the sensor and the controlled object.

6. The method according to claim 5, It is characterized in that The delay module includes a forward control delay module and a feedback control delay module. The forward control delay module is connected between the actuator and the controller, and the feedback control delay module is connected between the sensor and the controller.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further includes: The generated target program is verified in real time using the xPC-target real-time kernel.

8. A networked control system simulation platform design system, It is characterized in that The design system includes a host machine, which is used to run matlab-simulink to perform the following steps: Establish a networked control system model; For the networked control system model, generating a model program; Performing RTW compilation on the model program, the system target file and the compilation template file to obtain an intermediate model program; Compiling the intermediate model program by a target language compiler to obtain a target code corresponding to the expected hardware environment; Compile and link the generated target code according to the compilation file to obtain the target program.

9. The design system according to claim 8, It is characterized in that The design system also includes a target machine, which is used to run the xPC-target real-time kernel to perform real-time verification on the generated target program.

10. The design system according to claim 9, It is characterized in that The target machine includes an embedded board.