A digital twin monitoring system for the operating status of a DC microgrid
By adopting digital twin technology and "virtual real mapping" technology in the microgrid control system, the problems of long design cycles and potential design defects in the existing technology are solved, and more efficient and accurate control system design is achieved.
Patent Information
- Application Number
- CN202510386685.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-03-31
AI Technical Summary
When designing microgrid control systems, the prior art faces a large number of parameters to be identified and dynamic equations of unmodeled dynamics, resulting in a long design cycle, a lot of manpower and material resources, and potential design defects may lead to damage to electrical components.
Digital twin technology is used to establish a digital twin system for DC microgrid. By building a microgrid physical model in the digital space, the voltage and current physical quantity are monitored in real time, the control algorithm effect is evaluated, and the control algorithm is verified in the digital space through "virtual and real mapping" technology to avoid property losses caused by design defects.
It greatly shortens the time-consuming of simulation and physical verification, improves the efficiency and accuracy of the control system design, and avoids property losses caused by improper design.
Smart Images

Figure CN119891564B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of microgrid monitoring, and in particular to a digital twin monitoring system for the operating status of a direct current microgrid. Background Art
[0002] When designing a control system in the microgrid field, the main control target is the output voltage and current of each microgrid node. Excellent microgrid control algorithms often have features such as power balance and voltage and current coordinated control. Therefore, voltage and current are important indicators that characterize the quality of a microgrid control system. Monitoring and examining the voltage and current physical quantities of a microgrid is an important part of designing a control system.
[0003] The existing traditional power system is generally expressed in various algebraic, differential or partial differential forms of dynamic equations. Faced with dynamic equations with a large number of parameters to be identified and unmodeled dynamics, the traditional control system design based on this often requires simulation and multiple rounds of physical verification, which leads to a long design cycle and consumes a lot of manpower and material resources. If there are potential defects in the system design, it is easy to damage electrical components and cause property losses.
[0004] In view of the above difficulties, the present invention considers establishing a digital twin system of the DC microgrid when studying the DC microgrid control algorithm, which is responsible for monitoring and examining the voltage and current physical quantities of the microgrid to evaluate the effect of the control algorithm. When designing the control algorithm, by building a digital twin model, a trial run can be carried out in the digital space. In the digital space, thanks to the running speed of the program, the time consumption of simulation and physical verification is greatly shortened. For potential design defects, the control algorithm is verified by the "virtual-real mapping" technology in the digital space, avoiding property losses caused by improper design.
[0005] Digital twin refers to the technology of copying all elements, processes, dynamics and firmware of real physical systems into digital bodies. The two systems exist in parallel, share all inputs and operations, and use real-time data communication and information transmission to achieve "virtual-real mapping". In the design and optimization of control systems, digital twin systems can provide seamless monitoring, analysis, evaluation and prediction, and achieve synchronous and consistent operation of physical and digital bodies. At the same time, digital twin systems can easily integrate optimization learning, data analysis, state prediction, visualization, etc. in digital space, reflecting the entire life cycle of the entity, and providing more convenience for the development and maintenance of physical systems.
[0006] "Virtual-reality mapping" refers to two-way communication between the digital body and the physical body. The digital body monitors, analyzes, evaluates and predicts in real time, while the physical body can respond to operations in the digital space in real time, achieving synchronous and consistent operation of the physical and digital bodies, and facilitating the optimization of control algorithms. Summary of the Invention
[0007] To solve the above technical problems, the present invention proposes a digital twin monitoring system for the operating conditions of a DC microgrid, including: a physical layer, a digital layer and a service layer, a communication connection layer, and a data layer;
[0008] The physical layer is a physical platform of the microgrid;
[0009] The digital layer and the service layer, with the Unity platform as the main body, perform physical modeling on the physical platform of the microgrid through digital twin technology to obtain a physical model of the microgrid, map the physical model of the microgrid as a digital twin into the digital space, and monitor the data of the physical platform of the microgrid in real time;
[0010] The data layer uses an Stm32 microcontroller board to calculate the control quantities of the voltage and current of the physical platform of the microgrid;
[0011] The communication connection layer connects the physical platform of the microgrid and the Stm32 microcontroller board in the data layer through a CAN bus, and connects the Stm32 microcontroller board and the Unity platform through a serial cable.
[0012] In a preferred embodiment, the application scenarios of the digital twin system are distinguished:
[0013] Scenario 1: Connect to an existing physical platform of the microgrid. The physical platform of the microgrid directly serves as the physical layer. The digital twin system does not need to perform physical modeling of the microgrid. Design a control algorithm on the Stm32 microcontroller board, perform data interaction with the physical platform of the microgrid through the communication connection layer, display voltage and current data and control parameters on the computer side, and modify the control quantity instructions through the graphical user interface;
[0014] Scenario 2: Do not connect to an existing physical platform of the microgrid. Establish a physical model of the microgrid for the physical platform of the microgrid, establish a dynamic equation by monitoring the data of the microgrid nodes, and convert it into a state space equation.
[0015] In a preferred embodiment, for a physical model of a microgrid with 4 microgrid nodes, each microgrid node includes a controller, a distributed power source, a load, and a wire, connecting two microgrid nodes and the resistance of the power line is , admittance ;
[0016] If the microgrid nodes and are not directly connected, then ;
[0017] The initial value of the output voltage in each microgrid node is known, and the output current 、Control quantity 、Converter output voltage The initial values are all 0;
[0018] Directly use the converter output voltage As the control input of the microgrid node converter, it can be obtained that:
[0019] ; ;
[0020] In the formula, r i Is the shunt resistance, Is the current flowing through the shunt resistance, I is the current vector output by the microgrid node, ; Is the voltage vector output by the microgrid node, ; Is the admittance matrix, .
[0021] In the preferred embodiment, according to Kirchhoff's law, algebraic transformation is performed to obtain the voltage V and current I output by the microgrid physical model t :
[0022] ;
[0023] Among them, the N-order identity matrix , the droop coefficient matrix , Represents the per-unit value of the current of the distributed power source, the equivalent admittance matrix , the converter output voltage, which can be equivalently regarded as the control input here .
[0024] In the preferred embodiment, a current sharing and voltage regulation controller is introduced:
[0025] ;
[0026] In the formula, Is the control input; Is the virtual voltage; Is the compromise variable for adjusting the current sharing degree and voltage regulation degree; Is the node output voltage; Is the Laplacian matrix of the microgrid node network; Is the weight matrix of the edge from the virtual leader to the th microgrid node, Is the reference voltage.
[0027] In the preferred embodiment, the discretized voltage and current expressions are as follows:
[0028] ;
[0029] Wherein, is the voltage at the (i + 1)-th step, is the current at the (i + 1)-th step, is the N-order identity matrix, is the droop coefficient matrix, represents the per-unit value of the current of the distributed power source, and the equivalent admittance matrix , is the control input at the (i + 1)-th step.
[0030] In a preferred embodiment, the discrete form of the controller is as follows:
[0031] ;
[0032] In the formula, is the control input at the (i + 1)-th step; is the virtual voltage at the (i + 1)-th step; is the node output voltage at the i-th step.
[0033] In a preferred embodiment, the discrete form equation of the controller is converted into a C language program and burned into the Stm32 microcontroller board, and interacts with the microgrid physical platform and the digital space through the communication connection layer.
[0034] In a preferred embodiment, the voltage and current data are monitored in real time on the computer side, and the voltage and current of the microgrid physical platform are controlled by changing the control quantity.
[0035] In a preferred embodiment, the communication connection layer includes a CAN communication protocol and a UART serial communication protocol, and nine data need to be transmitted and read for each frame, including 1 time data, 4 current data, and 4 voltage data.
[0036] Compared with the prior art, the present invention has the following beneficial technical effects:
[0037] First, for the dynamic equations with a large number of parameters to be identified and unmodeled dynamics, traditional control system design often requires simulation and multiple rounds of physical verification. During simulation and physical verification, data such as voltage and current need to be continuously monitored, which results in a long design cycle and consumes a lot of manpower and material resources. Traditional methods will take up a large amount of time and energy in the design of power system control algorithms. In the monitoring scheme based on the digital twin system, due to the technical concept of "virtual-real mapping", in the digital space, whether it is dSPACE or Stm32, the microgrid nodes are realized through program logic simulation. This leads to the steady-state time and convergence speed of the algorithm output quantities, namely the microgrid node voltage and microgrid node current, depending on the code execution speed, and the result is much faster than actual experiments. Therefore, when studying the DC microgrid control algorithm, the present invention greatly shortens the time-consuming of simulation and physical verification.
[0038] Second, poor control system design will cause abnormal voltage and current monitoring results. For example, when the voltage is too high, it will lead to problems such as long-term full-load output of distributed power sources at microgrid nodes and exceeding the sensor range, which will cause certain damage to physical assets such as power sources, transmission lines, and sensors. Therefore, when the monitoring results are abnormal, the operation of the microgrid platform must be stopped, and the electrical components that may be damaged need to be checked and replaced one by one. In addition, it is necessary to re-verify the stability of the control system, correct the control parameters that cause system instability, and conduct multiple rounds of physical simulation verification again. In the digital twin system, "digital assets" are used to replace physical assets in reality. For potential control system design defects, they are verified in the digital space built on the Unity platform through the technology of "virtual-real mapping", avoiding property losses caused by improper design. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is the software and hardware platform framework diagram of the present invention;
[0040] Figure 2 It is the hierarchical interaction logic schematic diagram of the digital twin monitoring system of the present invention;
[0041] Figure 3 It is the rendering physical comparison diagram of the present invention;
[0042] Figure 4 It is the effect diagram of the model imported into the Unity platform of the present invention;
[0043] Figure 5 It is the data visualization and graphical user interface of the present invention;
[0044] Figure 6 It is the single microgrid node model example diagram of the present invention;
[0045] Figure 7 It is the four microgrid node model example diagram of the present invention;
[0046] Figure 8 Schematic diagram of the transmission data packet of the present invention;
[0047] Figure 9 Schematic diagram of the CAN communication of the present invention;
[0048] Figure 10 Schematic diagram of the experimental platform of the present invention. Specific implementation manners
[0049] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0050] I. Overall system framework
[0051] The overall software and hardware platform framework of the digital twin system of the present invention is as Figure 1 shown: Using the Unity platform as the construction and display platform, the Stm32 microcontroller board as the controller, and using the Blender modeling software to measure and model physical entities such as voltage sources, voltage / current sensors, etc., and map them into the Unity platform.
[0052] Use CAN and serial communication to sense data such as voltage and current, and develop game components through C# scripts and real-time data, map entity characteristics, drive the digital body in the Unity platform, and store the data in the database developed by SQLite. That is, it is divided into three major parts: 1. The digital layer and service layer with the Unity platform as the main body; 2. The communication connection layer dominated by the serial port and CAN; 3. The data layer managed by SQLite.
[0053] Based on the digital layer and service layer, communication connection layer, and data layer mentioned above, plus the physical object of the microgrid platform as the physical layer, the digital twin platform framework composed of software and hardware such as the Unity platform, SQlite, and Stm32 can be abstracted into Figure 2 the system framework shown:
[0054] The hierarchical interaction logic of the digital twin monitoring system is shown by Figure 2 shown, and the construction methods and main functions of each layer are as follows:
[0055] II. Digital layer and service layer
[0056] The main function of the digital layer is to complete the real-time mapping of physical objects. The key to achieving this goal lies in the accurate modeling of physical entities, including: geometric models and physical models.
[0057] The geometric model focuses on the dimensions of physical entities, the number of firmware, communication topologies, etc., while the physical model focuses on the response characteristics of physical entities, physical constraints, etc.
[0058] The service layer realizes seamless monitoring, analysis, evaluation, and prediction through physical characteristic modeling and data-driven methods, and finally provides services such as real-time control, data monitoring, and algorithm verification.
[0059] To ensure the intuitive presentation effect of the digital twin platform and reflect the rendering function of the Unity platform, in the digital twin system built for the physical microgrid on the Unity platform, as the basis of the interaction interface and one of the requirements of "virtual-real mapping", it is first necessary to model the physical entities in reality and map them as digital twins into the digital space. Compared with other modeling software, Blender has rich software resources, covers the whole process, has strong scalability, and is highly compatible with the Unity platform.
[0060] The basic process of modeling with Blender software is as follows:
[0061] (1) On-site measurement: Ensure accurate recording of object characteristics such as the physical dimensions, proportions, and colors of the microgrid platform, and take clear photos for reference.
[0062] (2) Modeling: Use tools in Blender software, such as extrusion and lofting, to model the physical object according to the measured data, ensure the accurate proportion of the model, and make it conform to the contour and shape of the physical object as much as possible.
[0063] (3) Applying materials: According to the material characteristics of different physical objects, apply different materials to the model and adjust the colors to make them as close as possible to the physical objects. If necessary, textures can be added to enhance the realism, such as metals, plastics, etc.
[0064] (4) Texturing: For models that require more fineness, textures can be applied to the model surface according to the three views of the physical object to achieve a better restoration effect. Ensure that the proportion and position of the texture are consistent with the physical object, and ensure the clarity and realism of the texture.
[0065] (5) Rendering and exporting: Set the position and angle of the camera in Blender, make appropriate adjustments and render the model, and then perform the rendering. Finally, export the rendered model as a file in.fbx format for use in importing into the Unity platform.
[0066] According to the above process, the dSPACE platform, pure resistive load, oscilloscope, DC power supply, voltage sensor, current sensor and other entities are modeled in Blender software and exported in .fbx format. Some renderings are compared with the actual objects as shown below. Figure 3 As shown:
[0067] Import the model into Unity, add basic Camera and Directional Light components, and get a rough digital space. The display effect is as follows: Figure 4 As shown:
[0068] Considering that users need to interact with the digital space, the next step is to mount the C# script file on the model in the Unity platform.
[0069] Taking voltage and current sensors as an example, in order to facilitate the interaction between the user cursor and the sensor, you first need to add a collision detection component Box Collider to the model, and then add a C# script, which uses the functions OnMouseOver(), OnMouseExit() and the collision detection component Box Collider to determine the relative position relationship between the cursor and the digital twin in the digital space.
[0070] After achieving normal interaction between the cursor and the model, the next step is to implement two major functions in the digital space: data visualization and graphical user interface design:
[0071] (1) Data visualization
[0072] In the digital twin system, data visualization is very important. The present invention uses the third-party resource Xcharts to complete the data visualization presentation. In the resource library Xcharts, the LineChart class is used to create a line chart.
[0073] In the specific C# script writing process, since the Xcharts chart is part of the UI component in the Unity platform, the process of reading chart data, drawing charts, chart interaction, etc. designed to operate the UI component must be located in the main thread. In order to improve the real-time performance of drawing, the present invention puts the functions that affect the performance of the main thread, such as serial port communication, data processing, and data storage, into the sub-thread for operation.
[0074] (2) Graphical User Interface
[0075] Design the human-computer interaction interface, namely the graphical user interface (GUI). After summary and analysis, its interface should meet the following requirements: it can display real-time data and historical data of the operating status; it can switch the data display method through cursor interaction.
[0076] Data visualization and graphical user interfaces such asFigure 5 As shown, in the graphical user interface, Voltage_1-4 and Current_1-4 in the upper left corner can display the magnitudes of the voltage and current values of the current microgrid physical platform in real time; the function keys Chart_Show and Chart_hide represent showing and hiding the data curve graph; the function key Replay_History represents replaying the specified historical operating state; the slider theta represents the control parameter, and the chart in the center of the screen is the data visualization function implemented based on the resource library Xcharts.
[0077] The Blender modeling and interactive function development of the present invention are completed here. However, the key to the "virtual-real mapping" technology is the physical modeling of the microgrid platform. Next, how to implement the "virtual-real mapping" will be introduced. First, the application scenarios of the digital twin system need to be distinguished:
[0078] Scenario 1: Connect to the existing microgrid physical platform. At this time, the microgrid physical platform directly serves as the physical layer, and the digital twin system does not need to perform physical modeling of the microgrid. Only the control algorithm needs to be designed on the Stm32 microcontroller board, which conducts data interaction with the physical platform through the communication connection layer, and displays physical quantities such as voltage and current data and control parameters on the computer side. The computer side modifies instructions such as control quantities through the graphical user interface.
[0079] Scenario 2: Do not connect to the existing microgrid physical platform. At this time, compared with Scenario 1, the digital twin system needs to perform physical modeling of the microgrid physical platform, that is, obtain the dynamic equations of the system related to voltage and current through electrical components such as capacitors and inductors of the microgrid nodes, and convert them into the form of state space equations.
[0080] Take a microgrid physical platform as an example for physical modeling. In this scenario, dSPACE (a compact laboratory system, a hardware-in-the-loop simulation platform) serves as the physical layer. Considering a general DC microgrid, where the load is represented by a constant impedance, the network is simplified to a microgrid with 4 microgrid nodes. Each microgrid node contains a controller, distributed power supply, load, wires, etc. Here, the wires are modeled with pure resistors. The power line connecting two microgrid nodes and is represented by the resistor , and the relevant admittance . If the microgrid nodes and are not directly connected, then , and the specific schematic diagram is shown in Figure 6 .
[0081] In the figure: : The resistance between microgrid nodes; : The output voltage of the microgrid node; : Output current of the microgrid node; : Load resistance; : Shunt resistance; : Control signal; : Converter output voltage. The output voltage within each microgrid node has a known initial value, and the output current , control quantity , and converter output voltage all have an initial value of 0. Directly use as the control input of the microgrid node converter, as shown in Figure 7 .
[0082] From Figure 6 we can obtain , combined with Figure 6 we can get:
[0083] ;
[0084] In the formula, is the output current vector of the microgrid node, ; is the output voltage vector of the microgrid node, ;
[0085] is the admittance matrix, .
[0086] Immediately after that, according to Kirchhoff's law for algebraic transformation, the output voltage and current expressions of the system can be obtained:
[0087] ;
[0088] Droop coefficient matrix , equivalent admittance matrix . For the above theoretical model, a current sharing and voltage regulation controller
[0089] is cited here;
[0090] In the formula, is the virtual voltage; is the compromise variable for adjusting the current sharing degree and voltage regulation degree; is the Laplacian matrix of the microgrid node network; is the weight matrix of the edge from the virtual leader to the -th microgrid node, is the reference voltage.
[0091] Considering that both simulation and experiment in the simulation software and the Stm32 platform are discrete, and certain discretization processes are required for the output voltage and current expressions and the voltage and current controllers. The discretized voltage and current expressions are as follows:
[0092] ;
[0093] The discrete form of the controller is as follows:
[0094] ;
[0095] Thus, the theoretical model of the microgrid platform and its controller are obtained. First, build the theoretical model in Simulink, download the model in Simulink to dSPACE, and dSPACE will act as the physical platform, interacting with Stm32 and the computer terminal through the communication connection layer. For the controller, it is necessary to convert the equation of its discrete form into a C language program and burn it into the Stm32 microcontroller board, and also interact with the physical platform and the computer terminal through the communication connection layer.
[0096] Through the description of the above two scenarios, the present invention has completed the physical layer modeling of the microgrid physical platform in dSPACE and Stm32. Cooperating with the digital layer and service layer developed based on the Unity platform on the computer terminal, the digital twin system has taken initial shape. Next, the communication connection layer and data layer supporting the system are introduced.
[0097] III. Communication Connection Layer
[0098] The communication connection layer is responsible for establishing and managing the communication connections between various components within the digital twin system to ensure the smooth transmission and exchange of data. This aspect includes work such as the design of communication protocols, the definition of data packet formats, and the stability of data transmission.
[0099] In the application, the digital twin system serves as the host computer, and microcontrollers such as single-chip microcomputers and the microgrid physical platform serve as the slave computers. The communication connections of the system mainly include the communication between the computer terminal and the microcontroller through the serial port protocol, and the communication between the microcontroller and the microgrid physical entity through the CAN protocol.
[0100] The serial port data packet is defined in the microgrid physical platform, which includes a total of four Hall voltage sensors and four Hall current sensors. And the microgrid node controller uses the Stm32 microcontroller, and the communication protocol uses the UART serial communication protocol. To ensure the integrity and real-time nature of the data, a total of nine data need to be transmitted and read for each frame. Therefore, the data packet is defined as Figure 8 shown.
[0101] In the figure, both the packet header and the packet tail represent marker data with a memory size of a single byte, serving as the flag bits for the host computer to receive a complete data packet. Among the data bits, there is a total of 1 time data, 4 current data, and 4 voltage data. Each data represents a floating-point number of the float type with a length of 4 bytes. In addition, the transmitted data also includes necessary delimiter bits such as space characters and line break characters. In summary, the complete data packet contains a total of 86 bytes.
[0102] CAN data packaging Considering the need to implement the microgrid control algorithm in a physical platform, and there are multiple distributed microgrid nodes in the microgrid platform, the topological communication between multiple microgrid nodes and controllers in the platform is inevitable. For the commonly used UART communication protocol, it mainly meets the communication requirements of point-to-point. If the UART protocol is used, then each microgrid node in the platform will waste a large amount of hardware resources and electrical interfaces to meet the communication requirements of multiple microgrid nodes simultaneously, and the anti-interference ability of UART is weak.
[0103] However, CAN communication supports multiple topological structures and communication modes, and can flexibly respond to different application requirements. For the communication requirements of multiple microgrid nodes mentioned above, CAN communication can complete the communication tasks of multiple microgrid nodes through a pair of CAN buses, greatly reducing the waste of hardware resources. Thanks to the design of the differential lines of the CAN protocol, in the face of external interference, CAN communication has excellent anti-interference performance.
[0104] In summary, for the purpose of reducing the waste of microcontroller resources of microgrid nodes and enhancing the anti-interference ability, the CAN protocol is adopted for the communication between the physical platform and the controller. The schematic diagram is shown in Figure 9 .
[0105] By agreeing on the data arrangement method and the specified memory address, we can obtain complete and accurate data. From Figure 5 It can be known that in the physical platform, dynamic data such as the physical operation time, voltage and current of each microgrid node are packaged. The data types of time, voltage, and current are all floating-point numbers (float) that occupy 4 bytes of memory. The maximum data length that can be transmitted each time by a standard frame is 8 bytes. Therefore, for the voltage and current data of the same microgrid node, in the present invention, the voltage data occupies the high 4 bytes of the data segment, and the current data occupies the low 4 bytes of the data segment. The data and the address are transmitted in big-endian mode, and each frame is assigned a specific CAN ID for the receiving party to identify.
[0106] IV. Data Layer
[0107] The data layer is mainly responsible for storing and managing sensor data, historical data, etc. It is an important support for the service layer of the digital twin system. For example, the function key Replay_History in the service layer mentioned above - playing back historical states makes use of the historical data stored in the data layer. This invention uses SQLite as the database management system, and the storage table format is shown in Table 1:
[0108] Table 1 Data table format
[0109]
[0110] The database design is based on the requirements of the digital twin system, including key information such as the voltage of microgrid nodes, the current of microgrid nodes, and the program running time. Each time the digital twin system database SQLite runs, a new table will be created. The table name uses an automatic numbering method and automatically increments with the increase in the number of runs, ensuring that the organizational structure of the database is simple and clear, facilitating management and maintenance.
[0111] For dSPACE, which is the microgrid experimental platform, all physical microgrid models except the controller are mounted on the platform; for the STM32H743-IIT6 microcontroller board, which is the microgrid controller, the controller is discretized from Equation (4.5); for the Unity platform, which is the host computer, it receives the dynamic data transmitted back by the STM32 microcontroller board through the serial port.
[0112] In the specific implementation, this solution uses dSPACE (a compact laboratory system, a hardware-in-the-loop simulation platform) as the microgrid physical platform, on which all physical microgrid models except the controller are mounted; the STM32 microcontroller board as the microgrid controller; and the Unity platform as the host computer, which receives the dynamic data transmitted back by the STM32 microcontroller board through the serial port. The schematic diagram is shown in Figure 10 :
[0113] The implementation steps are as follows:
[0114] 1. Build the theoretical model of the microgrid physical platform in Simulink.
[0115] 2. Download the model in Simulink to the control software ControlDesk of dSPACE.
[0116] 3. Set the data packet format of voltage and current and the interface of control signals in ControlDesk.
[0117] 4. Write the program for the Stm32 microcontroller board according to the designed control algorithm to output control signals.
[0118] 5. Connect the Stm32 microcontroller to the microgrid physical platform via the CAN bus, and connect the Stm32 microcontroller to the computer via a serial cable.
[0119] 6. The Stm32 microcontroller transmits voltage and current signals to the computer, and the computer transmits command signals to the Stm32 microcontroller.
[0120] 7. Monitor the voltage and current values of each microgrid node of the microgrid on the computer side, issue commands as needed, and complete data interaction.
[0121] 8. The computer side stores the obtained data in the database built by SQLite in real time.
[0122] After completing the above steps, the voltage and current data can be seen in real time on the computer side, and the voltage and current can be changed by changing the control parameters. A historical data table will also be obtained after the experiment.
[0123] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms. Therefore, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be embraced by the present invention. Any reference signs in the claims should not be regarded as limiting the claimed rights.
Claims
1. A digital twin monitoring system for the operation status of a DC microgrid, characterized in that: include: Physical layer, digital layer and service layer, communication connection layer and data layer; the physical layer is the microgrid physical platform; The digital layer and service layer are based on the Unity platform. The digital twin technology is used to physically model the physical platform of the microgrid to obtain the physical model of the microgrid. The physical model of the microgrid is mapped into the digital space as a digital twin to monitor the data of the physical platform of the microgrid in real time. Data visualization and graphical user interface are used to provide users with different functional services. The data layer is responsible for storing and managing sensor data and historical data, including SQLite database and Stm32 microcontroller board. SQLite database is used as database management system, and Stm32 microcontroller board is used to calculate the voltage and current control quantity of microgrid physical platform. The communication connection layer connects the microgrid physical platform with the Stm32 microcontroller board in the data layer through the CAN bus, and connects the Stm32 microcontroller board with the Uni ty platform through a serial port line; Differentiate the application scenarios of digital twin systems: Scenario 1: Connect to the existing physical microgrid platform. The physical microgrid platform is directly used as the physical layer. The digital twin system does not need to perform physical modeling of the microgrid. The control algorithm is designed on the Stm32 microcontroller board. Data is exchanged with the physical microgrid platform through the communication connection layer. The voltage and current data and control parameters are displayed on the computer. The control quantity instructions are modified through the graphical user interface. Scenario 2: Without connecting to the existing physical microgrid platform, a physical model of the microgrid is established for the physical microgrid platform. The dynamic equations are established by monitoring the data of the microgrid nodes and converted into state space equations. For the microgrid physical model with 4 microgrid nodes, each microgrid node contains a controller, a distributed power source, a load, and a wire. The resistance of the power line connecting two microgrid nodes i and j is R ij , admittance Y ij =1 / R ij ; If microgrid nodes i and j are not directly connected, then Y ij =0; Output voltage V in each microgrid node i The initial value is known, the output current I i , control quantity v i , converter output voltage u i The initial value is 0; Directly use the converter output voltage u i As the control input of the microgrid node converter, it is obtained: V i =u i -r i ·I ti ;I=YV; In the formula, r i is the shunt resistor, I ti is the current flowing through the shunt resistor, I is the current vector output by the microgrid node, I=[I1...I4] T ; V is the voltage vector output by the microgrid node, V=[V1...V4] T ; Y is the admittance matrix, Y = [Y ij ]∈R 4×4 .
2. The digital twin monitoring system for the operation status of a DC microgrid according to claim 1 is characterized in that: According to Kirchhoff's law, algebraic transformation is performed to obtain the voltage V and current I output by the microgrid physical model. t : Among them, the N-order unit matrix I N , the droop coefficient matrix Λ=diag(I rat ), I rat Represents the current per unit value of the distributed power supply, the equivalent admittance matrix The converter output voltage can be equivalent to the control input u here.
3. The digital twin monitoring system for the operation status of a DC microgrid according to claim 2 is characterized in that: Quote current sharing and voltage regulation controller: Where u is the control input; Φ is the virtual voltage; θ is the compromise variable for regulating the equal flow and voltage regulation; V is the node output voltage; L is the Laplace matrix of the microgrid node network; G is the weight matrix of the edge from the virtual leader to the i-th microgrid node, V ref is the reference voltage.
4. The digital twin monitoring system for the operation status of a DC microgrid according to claim 3 is characterized in that: The discretized voltage and current expressions are as follows: Where, V(i+1) is the voltage of the i+1th step, I t (i+1) is the current of the i+1th step, I N is the N-order unit matrix, Λ=diag(I rat ) is the droop coefficient matrix, I rat Represents the current per unit value of the distributed power supply, the equivalent admittance matrix u(i+1) is the control input of the i+1th step.
5. The digital twin monitoring system for the operation status of a DC microgrid according to claim 4 is characterized in that: The discrete form of the controller is as follows: Where u(i+1) is the control input of the i+1th step; Φ(i+1) is the virtual voltage of the i+1th step; and V(i) is the node output voltage of the i-th step.
6. The digital twin monitoring system for the operation status of a DC microgrid according to claim 5 is characterized in that: The discrete form equations of the controller are converted into C language programs and burned into the Stm32 microcontroller board, which interacts with the microgrid physical platform and digital space through the communication connection layer.
7. The digital twin monitoring system for the operation status of a DC microgrid according to claim 6, characterized in that: The voltage and current data are monitored in real time on the computer, and the voltage and current of the microgrid physical platform are controlled by changing the control quantity.
8. The digital twin monitoring system for the operation status of a DC microgrid according to claim 1, characterized in that: The communication connection layer contains CAN communication protocol and UART serial communication protocol. Each frame needs to transmit and read nine data, including 1 time data, 4 current data and 4 voltage data.
Citation Information
Patent Citations
Mobile mechanical arm virtual-real control system architecture based on digital twinning
CN117733859A
Digital twin center construction method, system and equipment and storage medium
CN118552138A