A semi-physical simulation system and a simulation method

By using a multi-source heterogeneous distributed integrated simulation architecture and a white-box model, the real-time performance and model integration issues in existing semi-physical simulation systems are solved. This enables efficient synchronization of virtual models and physical devices on non-real-time operating systems, improving simulation efficiency and real-time performance.

CN116027684BActive Publication Date: 2026-06-26西安中锐创联科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
西安中锐创联科技有限公司
Filing Date
2023-02-16
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing semi-physical simulation systems, the virtual model runs on a strictly real-time operating system, making it difficult to meet real-time requirements. Furthermore, the model suffers from splitting and integration issues when solving in a distributed manner on multiple CPUs, making it impossible to run effectively on a non-real-time operating system.

Method used

It adopts a multi-source heterogeneous distributed integrated simulation architecture and a white-box model. Through parallel communication between the server and multiple simulation clients and a synchronous clock mechanism, it realizes synchronous data interaction and real-time simulation between the virtual model and physical devices. It uses *.FMU or *.DLL plugins encapsulated with TCP/IP protocol for data transmission.

Benefits of technology

It improves simulation efficiency, ensures the real-time performance and interoperability of virtual models and physical devices, and enables efficient semi-physical simulation on non-real-time operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004080236750000111
    Figure BDA0004080236750000111
  • Figure HDA0004080236760000011
    Figure HDA0004080236760000011
  • Figure HDA0004080236760000012
    Figure HDA0004080236760000012
Patent Text Reader

Abstract

The application belongs to the technical field of simulation, and discloses a kind of semi-physical simulation system;Control input plug-in inputs joint simulation configuration information to server;Model client reads joint simulation configuration information through client communication plug-in, and sends it to modeling tool, runs modeling tool to generate virtual model, model client collects virtual model data in modeling tool, and connects it to server through client plug-in;V2R client reads virtual model data of server through device communication plug-in, and parses its instruction through measurement and control tool to control physical device to run;V2R client collects physical device operation data, and sends it to server through device communication plug-in;Through the way of multi-source heterogeneous distributed integrated simulation architecture and white box model, integrated simulation is carried out, and semi-physical simulation system can be directly run in modeling environment, to improve the fidelity of model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of simulation technology and relates to a semi-physical simulation system and simulation method. Background Technology

[0002] Semi-physical simulation refers to simulation in which some components of the simulated system are embedded in the simulation system, as well as the interface between these components and the simulation equipment. This type of simulation is usually real-time simulation. Based on the distribution relationship between the physical equipment and the virtual model, semi-physical simulation technology can be divided into two implementation forms.

[0003] The first type involves a physical controller or control system, while the rest are virtual models. This is generally called hardware-in-the-loop simulation and is commonly used for testing and calibrating controllers.

[0004] From an engineering application perspective, using the control field as the primary entry point for semi-physical simulation is highly reasonable. Compared to real personnel, controlled objects, and environments, simulation of control systems in physical form is safer, faster, and less costly, with quicker deployment, testing, and integration cycles. Therefore, semi-physical simulation is widely used in the control field. Correspondingly, because control systems have high real-time requirements, semi-physical simulation generally requires strict real-time processing. This presents a challenge to the modeling of the controlled object. If the model is complex and computationally slow, simplification is necessary; otherwise, the strict real-time requirement cannot be met. To further accelerate the solution speed of the controlled object model, real-time machines have emerged. On a real-time machine, the controlled object model can be distributed across multiple CPUs for solution, but model decomposition and heterogeneous integration present new challenges.

[0005] The second type involves physical objects, environments, or boundary conditions, while the rest are virtual models. From the controller's perspective, this is generally called rapid control prototyping, primarily used for rapid controller development and testing. From the perspective of the controlled object, this type of semi-physical simulation is sometimes called virtual testing or virtual experimentation. Its main characteristics are that it involves specific equipment, and its application scenarios are often very important physical processes that must be verified as much as possible before executing real tasks; otherwise, the risk of failure is too high to bear. Alternatively, it may have a long iteration cycle, and once it is put into production and finalized, it is difficult to make major changes, otherwise the cost would be unacceptable.

[0006] In existing semi-physical simulations, whether virtual testing or hardware-in-the-loop simulation, virtual models are mostly run in C code on specific real-time machines. This is done to ensure real-time performance; virtual models need to run on strictly real-time operating systems and real-time machines (such as dSPACE in Germany, NI in the US, and RT-LAB in Canada). These strictly real-time operating systems generally have good compatibility with C code. However, most simulation modeling tools run on Windows systems (a very small number can run on Linux systems), and their models and simulation files cannot run on various real-time machine computers. Summary of the Invention

[0007] The technical problem solved by this invention is to provide a semi-physical simulation system and simulation method, which integrates simulation by adopting a multi-source heterogeneous distributed integrated simulation architecture and a white-box model, and can directly run the semi-physical simulation system in the modeling environment, thereby improving the fidelity of the model.

[0008] This invention is achieved through the following technical solution:

[0009] A semi-physical simulation system includes a server, a device client, and multiple simulation clients. The device clients and simulation clients access the server through a model client and a V2R client, respectively. The server generates a communication plugin to communicate with the device clients and simulation clients.

[0010] The server and multiple simulation clients form a multi-source heterogeneous distributed integrated simulation architecture. The simulation client provides a modeling tool to generate virtual models of physical devices. The communication plugin is imported into the modeling tool and generated as a client communication plugin after being parsed by the modeling tool. The model client collects data from the virtual models of physical devices in the modeling tool and sends it to the server through the client plugin. The server communicates with multiple simulation clients in parallel and uses a synchronous clock to achieve synchronous data interaction among all simulation clients during the simulation process.

[0011] The device client is used to provide measurement and control tools. The device client imports the communication plugin into the measurement and control tools, which then parse it to generate the device communication plugin. Physical devices connect to the device client through the V2R client. The V2R client collects the physical device's operating data and sends it to the server through the device communication plugin.

[0012] The server builds a joint simulation interface between the modeling tool and the measurement and control tool and generates a V2R client joint information input plugin. The server imports the V2R client joint information input plugin into the measurement and control tool, which then parses it to generate a control input plugin.

[0013] The control input plugin inputs co-simulation configuration information to the server; the model client reads the co-simulation configuration information through the client communication plugin and sends it to the modeling tool, which then generates a virtual model of the physical equipment; the model client collects data from the virtual model of the physical equipment within the modeling tool and sends it to the server through the client plugin; the V2R client reads data from the server's virtual model of the physical equipment through the device communication plugin and parses its instructions through the measurement and control tool to control the operation of the physical equipment; the V2R client collects the physical equipment's operating data and sends it to the server through the device communication plugin; the model client collects the physical equipment's operating data from the server through the client plugin and sends it to the modeling tool of the simulation client, which then parses the physical equipment's operating data and corrects the virtual model of the physical equipment.

[0014] Furthermore, the server establishes a white-box model that integrates all virtual models and V2R client models, and displays it on the server interface.

[0015] Furthermore, the communication plugin is a *.FMU or *.DLL plugin encapsulated using the TCP / IP protocol.

[0016] Furthermore, the joint simulation configuration information includes operating parameters, communication step size, and simulation duration.

[0017] Furthermore, the server enables synchronized data interaction among all simulated clients through a synchronized clock;

[0018] Within a certain communication step, after all virtual models have completed their operation and progressed to that communication step, the server uses a multi-threaded concurrent method to simultaneously complete the synchronous data interaction with each virtual model within the current communication step. The faster virtual models wait in place until the synchronous data interaction of all virtual models is completed. Then, the server issues a command to advance the time step by one frame, and the simulation enters the next communication step.

[0019] Furthermore, the server interacts with physical devices through a cyber-physical fusion synchronization mechanism;

[0020] The V2R client collects the running data of the virtual model on the server through the device communication plugin, parses its instructions through the measurement and control tool, and then sends them to the physical device, which runs according to the instructions. The V2R client collects the running data of the physical device, converts its data format through the device communication plugin, and then sends the running data of the physical device to the server.

[0021] Furthermore, the modeling tools used by multiple clients to generate virtual models can be the same or different, and their communication step sizes can also be different.

[0022] Furthermore, a simulation method for a semi-physical simulation system includes the following steps:

[0023] 1) Establish a multi-source heterogeneous distributed integrated simulation architecture:

[0024] Multiple simulation clients access the server through the model client and communicate with the server through client plugins; the server communicates with multiple simulation clients in parallel and uses a synchronous clock to achieve synchronous data interaction among all simulation clients during the simulation process.

[0025] 2) Establish a connection between the server and the physical device:

[0026] The device client accesses the server through the V2R client; the physical device accesses the device client through the V2R client and communicates with the server through the device communication plugin;

[0027] 3) Establish a co-simulation interface:

[0028] The server builds a joint simulation interface between the modeling tool and the measurement and control tool, and generates a V2R client joint information input plugin. The V2R client joint information input plugin is imported into the measurement and control tool in the device client, and after being parsed by the measurement and control tool, a control input plugin is generated.

[0029] 4) Perform simulation:

[0030] The control input plugin inputs co-simulation configuration information to the server; the model client reads the co-simulation configuration information through the client communication plugin and sends it to the modeling tool, which then runs to generate a virtual model of the physical equipment; the model client collects data from the virtual model of the physical equipment within the modeling tool and sends it to the server through the client plugin; the V2R client reads the data from the virtual model of the physical equipment on the server through the device communication plugin and parses its instructions through the measurement and control tool to control the operation of the physical equipment.

[0031] The V2R client collects physical device operation data and sends it to the server through the device communication plugin; the model client collects physical device operation data from the server through the client plugin and sends it to the modeling tool of the simulation client. The modeling tool parses the physical device operation data and corrects the virtual model of the physical device.

[0032] Compared with the prior art, the present invention has the following beneficial technical effects:

[0033] The semi-physical simulation system provided by this invention comprises a server and multiple simulation clients forming a multi-source heterogeneous distributed integrated simulation architecture. Parallel communication is used between the server and the multiple simulation clients. Compared to the time consumption of traditional single simulations, the multi-source heterogeneous distributed integrated simulation architecture delivers higher simulation efficiency. Through white-box models, interoperability and clock synchronization between multiple virtual models are ensured during simulation. Virtual models generated by the modeling tools on the simulation clients are accessed by the server through model clients, and physical devices are accessed by the server through V2R clients. This further enables data distribution on the server, interoperability and synchronization control between multiple virtual models, and ensures the real-time performance of the virtual model and physical device simulations. Attached Figure Description

[0034] Figure 1 This is a framework diagram of a semi-physical simulation system;

[0035] Figure 2 This is a connection block diagram of the physical devices in Example 1;

[0036] Figure 3 This is the joint information simulation interface between the AMESim modeling tool and the LabVIEW measurement and control tool in Example 1;

[0037] Figure 4 This is a client plugin for the V2R client within the LabVIEW Measurement and Control Tool in Example 1;

[0038] Figure 5 This is the V2R client communication plugin for the V2R client within the LabVIEW Measurement and Control Tool in Example 1;

[0039] Figure 6 The PID control model established by the AMESim modeling tool in Example 1;

[0040] Figure 7 This refers to the model client communication plugin between the AMESim modeling tool and the server in Example 1;

[0041] Figure 8 This is the hardware association plugin for the V2R client within the LabVIEW Measurement and Control Tool in Example 1;

[0042] Figure 9 The results are from a semi-physical simulation of the closed-loop speed control of the stepper motor in Example 1.

[0043] Figure 10 The results are the frame time statistics of the semi-physical simulation of the closed-loop control of the stepper motor speed in Example 1.

[0044] Figure 11 The modified PID control model established by the AMESim modeling tool in Example 2;

[0045] Figure 12 The results are semi-physical simulations of the closed-loop speed control of a stepper motor after modifying the PID control algorithm of the PID control model in Example 2. Detailed Implementation

[0046] The present invention will now be described in further detail with reference to the accompanying drawings. These descriptions are intended to explain the invention and not to limit it.

[0047] This invention discloses a semi-physical simulation system, including a server, a device client, and multiple simulation clients. The device client and the simulation client access the server through a model client and a V2R client, respectively. The server generates a communication plugin to communicate with the device client and the simulation client.

[0048] Specifically, the communication plugin is a *.FMU or *.DLL plugin encapsulated using the TCP / IP protocol.

[0049] The server and multiple simulation clients form a multi-source heterogeneous distributed integrated simulation architecture. The simulation client provides a modeling tool to generate virtual models of physical devices. The communication plugin is imported into the modeling tool and generated as a client communication plugin after being parsed by the modeling tool. The model client collects data from the virtual models of physical devices in the modeling tool and sends it to the server through the client plugin. The server communicates with multiple simulation clients in parallel and uses a synchronous clock to achieve synchronous data interaction among all simulation clients during the simulation process.

[0050] Specifically, the modeling tools used by multiple clients to generate virtual models can be the same or different, and their communication step sizes can also be different; the virtual model data files generated by their modeling tools only need to meet the *.FMU or *.DLL format, therefore, the modeling tools can be different; the server realizes the synchronous data interaction of all simulation clients in the simulation process through a synchronous clock. When the communication step sizes are different, the virtual model that completes faster waits in place until all virtual models complete communication.

[0051] The server uses a synchronous clock to achieve synchronous data interaction among all simulation clients. Within a certain communication step, after all virtual models have completed their operation and progressed to that communication step, the server uses a multi-threaded concurrent method to simultaneously complete the synchronous data interaction with each virtual model within the current communication step. The faster virtual models wait in place until the synchronous data interaction of all virtual models is completed. Then, the server issues a command to advance the time step by one frame, and the simulation enters the next communication step.

[0052] The device client is used to provide measurement and control tools. The device client imports the communication plugin into the measurement and control tools, which then parse it to generate the device communication plugin. Physical devices connect to the device client through the V2R client. The V2R client collects the physical device's operating data and sends it to the server through the device communication plugin.

[0053] Specifically, the server interacts with the physical device through a cyber-physical fusion synchronization mechanism; the V2R client collects the running data of the virtual model on the server through the device communication plugin, parses its instructions through the measurement and control tool, and then sends them to the physical device, which runs according to the instructions; the V2R client collects the running data of the physical device, converts its data format through the device communication plugin, and sends the running data of the physical device to the server after the conversion is completed.

[0054] The server establishes a white-box model integrating all virtual models and V2R client models, and displays it on the server interface. The white-box model ensures interoperability and clock synchronization between multiple virtual models during simulation.

[0055] The server builds a joint simulation interface between the modeling tool and the measurement and control tool and generates a V2R client joint information input plugin. The server imports the V2R client joint information input plugin into the measurement and control tool, which then parses it to generate a control input plugin.

[0056] The control input plugin inputs co-simulation configuration information to the server; the model client reads the co-simulation configuration information through the client communication plugin and sends it to the modeling tool, which then generates a virtual model of the physical equipment; the model client collects data from the virtual model of the physical equipment within the modeling tool and sends it to the server through the client plugin; the V2R client reads data from the server's virtual model of the physical equipment through the device communication plugin and parses its instructions through the measurement and control tool to control the operation of the physical equipment; the V2R client collects the physical equipment's operating data and sends it to the server through the device communication plugin; the model client collects the physical equipment's operating data from the server through the client plugin and sends it to the modeling tool of the simulation client, which then parses the physical equipment's operating data and corrects the virtual model of the physical equipment.

[0057] A simulation method for a semi-physical simulation system includes the following steps:

[0058] 1) Establish a multi-source heterogeneous distributed integrated simulation architecture:

[0059] Multiple simulation clients access the server through the model client and communicate with the server through client plugins; the server communicates with multiple simulation clients in parallel and uses a synchronous clock to achieve synchronous data interaction among all simulation clients during the simulation process.

[0060] 2) Establish a connection between the server and the physical device:

[0061] The device client accesses the server through the V2R client; the physical device accesses the device client through the V2R client and communicates with the server through the device communication plugin;

[0062] 3) Establish a co-simulation interface:

[0063] The server builds a joint simulation interface between the modeling tool and the measurement and control tool, and generates a V2R client joint information input plugin. The V2R client joint information input plugin is imported into the measurement and control tool in the device client, and after being parsed by the measurement and control tool, a control input plugin is generated.

[0064] 4) Perform simulation:

[0065] The control input plugin inputs co-simulation configuration information to the server; the model client reads the co-simulation configuration information through the client communication plugin and sends it to the modeling tool, which then runs to generate a virtual model of the physical equipment; the model client collects data from the virtual model of the physical equipment within the modeling tool and sends it to the server through the client plugin; the V2R client reads the data from the virtual model of the physical equipment on the server through the device communication plugin and parses its instructions through the measurement and control tool to control the operation of the physical equipment.

[0066] The V2R client collects physical device operation data and sends it to the server through the device communication plugin; the model client collects physical device operation data from the server through the client plugin and sends it to the modeling tool of the simulation client. The modeling tool parses the physical device operation data and corrects the virtual model of the physical device.

[0067] The modeling tool of the simulation client is one or more of the following: SimulationX, MATLAB / simulink, code integration, Virtual.Lab.Motion, Modelook, Python, Simcenter3D, Dymola, AMESim, ADAMS, CFX, OpenModelica, Simpler, MWorks, AVL CRUISE, AVL CRUISE M, Activate, PLECS, or RecurDyn;

[0068] The measurement and control tool is LabVIEW.

[0069] Specific implementation examples are given below.

[0070] Example 1

[0071] This embodiment provides a semi-physical simulation system, specifically a semi-physical simulation system for closed-loop control of stepper motor speed, including a server, a device client, and multiple simulation clients, all of which run on a host computer based on a Windows operating system.

[0072] The device client and simulation client access the server through the model client and V2R client respectively. The server generates communication plugins for communication with the device client and simulation client.

[0073] Specifically, the communication plugin is a *.FMU or *.DLL plugin encapsulated using the TCP / IP protocol.

[0074] Virtual gateways include model clients and V2R clients;

[0075] The server and multiple simulation clients form a multi-source heterogeneous distributed integrated simulation architecture. The simulation clients provide the AMESim modeling tool for generating virtual models of stepper motor speed closed-loop control systems. The communication plugin is imported into the AMESim modeling tool, parsed by the AMESim modeling tool, and then a client communication plugin is generated. The model clients collect data from the virtual model of the stepper motor speed closed-loop control system within the AMESim modeling tool and connect it to the server through the client plugin. The server communicates with multiple simulation clients in parallel and uses a synchronous clock to achieve synchronized data interaction among all simulation clients during the simulation process.

[0076] Specifically, the AMESim modeling tools used by multiple clients to generate virtual models of stepper motor speed closed-loop control systems can be the same or different, and their communication step lengths can also be different.

[0077] The server uses a synchronous clock to achieve synchronous data interaction among all simulation clients. Within a certain communication step, after all virtual models have completed their operation and progressed to that communication step, the server uses a multi-threaded concurrent method to simultaneously complete the synchronous data interaction with each virtual model within the current communication step. The faster virtual models wait in place until the synchronous data interaction of all virtual models is completed. Then, the server issues a command to advance the time step by one frame, and the simulation enters the next communication step.

[0078] The device client is used to provide LabVIEW measurement and control tools. It imports the communication plugin into the LabVIEW measurement and control tools, which then parse it to generate the device communication plugin. The physical device connects to the device client through the V2R client. The V2R client collects the physical device's operating data and connects it to the server through the device communication plugin.

[0079] Specifically, the server interacts with the physical device through a cyber-physical fusion synchronization mechanism; the V2R client collects the running data of the virtual model on the server through the device communication plugin, parses its instructions through the LabVIEW measurement and control tool, and then sends them to the physical device, which runs according to the instructions; the V2R client collects the running data of the physical device, converts its data format through the device communication plugin, and sends the running data of the physical device to the server after the conversion is completed.

[0080] The server establishes a white-box model that integrates all virtual models and V2R client models, and displays it on the server interface; the white-box model can ensure interoperability and clock synchronization between multiple virtual models during simulation.

[0081] The server builds a joint simulation interface between the AMESim modeling tool and the LabVIEW measurement and control tool and generates a V2R client joint information input plugin. The V2R client joint information input plugin is then imported into the LabVIEW measurement and control tool, and after being parsed by the LabVIEW measurement and control tool, a control input plugin is generated.

[0082] In this embodiment, the physical device includes: a 24V power supply module, a motor controller, a motor driver, and an angle encoder; the 24V power supply module is connected to the motor controller via a relay, which controls the 24V power supply module to supply power to the motor controller; the motor controller is connected to the motor driver, which is connected to a stepper motor, and the motor driver executes the control commands of the motor controller and drives the stepper motor; the angle encoder is connected to the output shaft of the stepper motor via a coupling; the angle encoder detects the speed information of the stepper motor; it also includes a data acquisition board connected to the simulation host computer, which is connected to the 24V power supply module; the data acquisition board is connected to the angle encoder, which acquires the speed information of the angle encoder and sends it to the simulation host computer; the data acquisition board is connected to the motor controller, which sends the control signals from the simulation host computer to the motor controller.

[0083] Connect the physical devices as follows: Connect the P0.0 and DGND pins of the acquisition board to the 1st and S / S pins of the 24V power module, respectively; connect the P1.0, P1.1, and P1.2 pins of the acquisition board to the black, white, and orange terminals of the angle encoder, respectively; connect the A00 and AGND pins of the acquisition board to the AD1 and COM pins of the motor controller, respectively; connect the SW1 and COM pins of the motor controller to the 5th and 9th pins of the relay, respectively; connect the SW5 / ENA, DIR-, and PUL- pins of the motor controller to the ENA-, DIR-, and PUL- pins of the motor driver, respectively; connect the ENA+, DIR+, and PUL+ pins of the motor driver and connect them to the 5V+ pin of the motor controller; connect the A+, A-, B+, and B- pins of the motor driver to the black, green, red, and blue terminals of the stepper motor, respectively; connect the 14th pin of the relay to the 3rd pin of the 24V power module.

[0084] In the semi-physical simulation system for closed-loop speed control of a stepper motor, the co-simulation configuration information of the server is set, namely, a communication step size of 0.01s and a simulation duration of 80s. After running the server, the AMESim modeling tool and the LabVIEW measurement and control tool are run respectively. After the simulation starts, the control input plug-in inputs the target speed value and the co-simulation configuration information (communication step size of 0.01s and simulation duration of 80s) to the server. The AMESim modeling tool generates virtual models such as a PID control model, a data processing model, and a command transmission and reception model. The model client collects the virtual model data in the AMESim modeling tool and connects it to the server through the client plug-in. The V2R client connects to the server via... The device communication plugin reads the virtual model data from the server, parses its instructions using the LabVIEW measurement and control tool, and then sends the instructions to the motor controller via the acquisition board. The motor controller generates control signals, and the motor driver executes these control signals to drive the stepper motor. The angle encoder detects the speed information of the stepper motor output shaft, which is then acquired by the acquisition board and sent to the V2R client. The V2R client then sends this information to the server via the device communication plugin. The model client acquires the physical device operation data from the server via the client plugin and sends it to the modeling tool in the simulation client. The modeling tool parses the physical device operation data and corrects the virtual model of the physical device.

[0085] The semi-physical simulation results of stepper motor speed closed-loop control are as follows: Figure 9 It can be seen that the stepper motor follows the PID control signal well, but because the linearity between the stepper motor speed and voltage is not very good, the stepper motor will drift when the speed is higher or lower than 1000rpm.

[0086] In simulation, real-time performance is measured by frame time. Frame time refers to the computation cycle of discrete-time recursive processing in the simulation system, that is, the machine time used by the computer used for simulation to complete one full operation from dynamic input, calculation, processing to dynamic output. The frame time for statistical stepper motor speed closed-loop control semi-physical simulation is as follows: Figure 10 The simulation communication step size was 0.01s, the simulation duration was 80s, and a total of 8000 frames were used. Figure 10 In the simulation, because the timestamp precision of the Windows operating system is only down to the millisecond level, a frame time less than 1ms will be displayed as 0ms. Statistical results show that the frame times are concentrated within the range of 0-5ms, with three larger frame times occurring: 12ms, 23ms, and 30ms, verifying that the simulation system has good real-time performance.

[0087] A statistical table of stepper motor response delay to step commands is established based on the target speed command, the command issuance time, and the measured speed response time, as shown in Table 1:

[0088]

[0089] Since the sampling period of the angle encoder in this embodiment is 100ms, the response delay is equal to the sampling period. For cyber-physical simulation systems that include physical devices, the response time generally follows slower time metrics, including frame time, sampling period, and communication period. The frame time is no more than 30ms, the sampling period is 100ms, and the communication period is 10ms, so the response delay will be based on the period with the longest delay.

[0090] Example 2

[0091] Because the stepper motor in Example 1 can only maintain good control accuracy around 1000 rpm, its characteristics will drift significantly when the speed varies over a wider range. Therefore, the PID control algorithm in the PID control model is modified and re-simulated, with the specific operation being the same as in Example 1.

[0092] The method for correcting the PID control algorithm within the PID control model is as follows:

[0093] Add the f(x) algorithm function to the PID control model, i.e.:

[0094] f(x) = 0.000070060*x 2 +0.565219942*x+361.50872373;

[0095] Where x is the input and f(x) is the output;

[0096] The simulation results after the PID control model was corrected were compared with the simulation results before correction. Specifically, as follows: Figure 12 It can be seen that after modifying the PID control algorithm in the PID control model, there is almost no drift between the measured speed of the stepper motor and the target speed value, which improves the control accuracy of the PID control model for the stepper motor.

[0097] The embodiments given above are preferred examples for implementing the present invention, and the present invention is not limited to the above embodiments. Any non-essential additions or substitutions made by those skilled in the art based on the technical features of the present invention are within the protection scope of the present invention.

Claims

1. A semi-physical simulation system, characterized in that, It includes a server, device clients, and multiple simulation clients. The device clients and simulation clients access the server through the model client and V2R client, respectively. The server generates communication plugins to communicate with the device clients and simulation clients. The server and multiple simulation clients form a multi-source heterogeneous distributed integrated simulation architecture; the simulation client provides a modeling tool to generate virtual models of physical devices, imports the communication plugin into the modeling tool, and generates the client communication plugin after the modeling tool parses it; The model client collects data from the virtual physical device model within the modeling tool and sends it to the server via the client plugin; the server communicates in parallel with multiple simulation clients and uses a synchronous clock to achieve synchronized data interaction among all simulation clients during the simulation process; The device client is used to provide measurement and control tools. The device client imports the communication plugin into the measurement and control tools, which then parse it to generate the device communication plugin. Physical devices connect to device clients via V2R clients; The V2R client collects physical device operating data and sends it to the server through the device communication plugin; The server builds a joint simulation interface between the modeling tool and the measurement and control tool and generates a V2R client joint information input plugin. The server imports the V2R client joint information input plugin into the measurement and control tool, which then parses it to generate a control input plugin. The control input plugin inputs co-simulation configuration information to the server. The model client reads the co-simulation configuration information through the client communication plugin and sends it to the modeling tool, which then generates a virtual model of the physical equipment. The model client collects data from the virtual model of the physical equipment within the modeling tool and sends it to the server through the client plugin. The V2R client reads data from the server's virtual model of the physical equipment through the device communication plugin and parses its instructions through the measurement and control tool to control the operation of the physical equipment. The V2R client collects the physical equipment's operating data and sends it to the server through the device communication plugin. The model client collects the physical equipment's operating data from the server through the client plugin and sends it to the modeling tool in the simulation client. The modeling tool parses the physical equipment's operating data and corrects the virtual model of the physical equipment.

2. The semi-physical simulation system according to claim 1, characterized in that, The server establishes a white-box model that integrates all virtual models and V2R client models, and displays it on the server interface.

3. The semi-physical simulation system according to claim 1, characterized in that, The communication plugin is a *.FMU or *.DLL plugin encapsulated using the TCP / IP protocol.

4. The semi-physical simulation system according to claim 1, characterized in that, The joint simulation configuration information includes operating parameters, communication step size, and simulation duration.

5. A semi-physical simulation system according to claim 1, characterized in that, The server uses a synchronous clock to achieve synchronized data interaction among all simulation clients; Within a certain communication step, after all virtual models have completed their operation and progressed to that communication step, the server uses a multi-threaded concurrent method to simultaneously complete the synchronous data interaction with each virtual model within the current communication step. The faster virtual models wait in place until the synchronous data interaction of all virtual models is completed. Then, the server issues a command to advance the time step by one frame, and the simulation enters the next communication step.

6. The semi-physical simulation system according to claim 1, characterized in that, The server interacts with physical devices through a cyber-physical fusion synchronization mechanism. The V2R client collects the running data of the virtual model on the server through the device communication plugin, parses its instructions through the measurement and control tool, and then sends them to the physical device, which runs according to the instructions. The V2R client collects the running data of the physical device, converts its data format through the device communication plugin, and then sends the running data of the physical device to the server.

7. A semi-physical simulation system according to claim 1, characterized in that, Multiple clients may use the same or different modeling tools to generate virtual models, and their communication step sizes may differ.

8. The simulation method for a semi-physical simulation system according to claims 1-7, characterized in that, Includes the following steps: 1) Establish a multi-source heterogeneous distributed integrated simulation architecture: Multiple simulation clients access the server through the model client and communicate with the server through client plugins; the server communicates with multiple simulation clients in parallel and uses a synchronous clock to achieve synchronous data interaction among all simulation clients during the simulation process. 2) Establish a connection between the server and the physical device: The device client accesses the server through the V2R client; the physical device accesses the device client through the V2R client and communicates with the server through the device communication plugin; 3) Establish a co-simulation interface: The server builds a joint simulation interface between the modeling tool and the measurement and control tool, and generates a V2R client joint information input plugin. The V2R client joint information input plugin is imported into the measurement and control tool in the device client, and after being parsed by the measurement and control tool, a control input plugin is generated. 4) Perform simulation: The control input plugin inputs co-simulation configuration information to the server; the model client reads the co-simulation configuration information through the client communication plugin and sends it to the modeling tool, which then runs to generate a virtual model of the physical equipment; the model client collects data from the virtual model of the physical equipment within the modeling tool and sends it to the server through the client plugin; the V2R client reads the data from the virtual model of the physical equipment on the server through the device communication plugin and parses its instructions through the measurement and control tool to control the operation of the physical equipment. The V2R client collects physical device operation data and sends it to the server through the device communication plugin; the model client collects physical device operation data from the server through the client plugin and sends it to the modeling tool of the simulation client. The modeling tool parses the physical device operation data and corrects the virtual model of the physical device.