A dynamic reactive power compensator simulation method and system based on controller source code
Through the dynamic reactive power compensator simulation method based on the controller source code, the FPGA chip is used to simulate the power grid and the dynamic reactive power compensator controller, which solves the problems of complex wiring and low efficiency of the simulation system in the existing technology, and achieves high efficiency and flexibility. Power grid simulation ensures the accuracy and reliability of simulation results.
Patent Information
- Application Number
- CN202210379351.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-04-12
AI Technical Summary
The existing power grid simulation system has complex wiring and low test efficiency, making it difficult to meet the rapid development needs of the power system.
Adopt a dynamic reactive power compensator simulation method based on the controller source code, build the first real-time simulation system and the second real-time simulation system through simulation tools, use FPGA chips to simulate the dynamic reactive power compensator controller, and compare the simulation results to Adjust the program until consistency is achieved.
It simplifies the system wiring, improves the simulation efficiency, retains the structural functions and dynamic performance characteristics of the physical controller, reduces the equipment footprint and maintenance costs, and realizes the joint simulation of multiple sets of dynamic reactive power compensators.
Smart Images

Figure CN114721291B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid simulation, and in particular to a dynamic reactive power compensator simulation method and system based on controller source code. Background Art
[0002] With the development of the power system, users' electricity demand has increased rapidly, and the stable operation of the power system is crucial.
[0003] Static Var Generator (SVG), also known as high-voltage dynamic reactive compensator, can dynamically compensate for the reactive power of the power grid. In the production process of SVG control and protection devices, in order to verify the design of the SVG control and protection system, multiple tests will be conducted on the control and protection system software and hardware to verify whether the control and protection system meets the requirements of the functional specification and design specification, and to find out whether there are problems in the design, manufacturing and interface with the primary system, so as to minimize the possibility of bringing defects of the SVG control and protection device to the site, reduce the risk of failure to a minimum, and ensure the high reliability and availability of the SVG device.
[0004] The tests of SVG control and protection system are mainly divided into two parts: functional test (FPT) and dynamic performance test (DPT). After the panel test and subsystem test are completed, the FPT test connects all the control and protection system equipment into a complete system for testing. The field analog and switch signals required in the test are provided by the real-time simulation system. The DPT test verifies whether the response characteristics of the SVG control and protection system in transient and dynamic processes meet the technical specifications based on the FPT test. However, the real-time simulation system built in the functional test and dynamic performance test involves many physical control devices, the wiring process is complicated, a lot of construction time is consumed, the test efficiency is low, and the configuration is inflexible. Summary of the invention
[0005] The purpose of the present invention is to provide a dynamic reactive power compensator simulation method and system based on controller source code, so as to solve the technical problems of complex wiring of the simulation system and low test efficiency in the prior art.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] A simulation method for a dynamic reactive power compensator, comprising:
[0008] A first real-time simulation system for a dynamic reactive power compensator is constructed by using a simulation tool; the first real-time simulation system comprises a first workstation, a first real-time simulator and a plurality of field programmable gate array (FPGA) chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of a dynamic reactive power compensator and an interface module, the FPGA chip simulates a dynamic reactive power compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive power compensator and the FPGA chip;
[0009] A second real-time simulation system of the dynamic reactive compensator is constructed according to the source code of the dynamic reactive compensator controller; the second real-time simulation system comprises a second workstation and a second real-time simulator which are in communication connection, and the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers;
[0010] Determine whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system; if they are consistent, the simulation ends; otherwise, modify the program of the FPGA chip until the simulation ends.
[0011] Optionally, determining whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system comprises:
[0012] It is determined whether the error between the first simulation result output by the first real-time simulation system and the second simulation result output by the second real-time simulation system is less than a preset threshold, if so, it indicates consistency, otherwise, it indicates inconsistency.
[0013] Optionally, determining whether an error between a first simulation result output by the first real-time simulation system and a second simulation result output by the second real-time simulation system is less than a preset threshold specifically includes:
[0014] Determine whether the errors between the first reactive current and the second reactive current, and between the first reactive power and the second reactive power are less than a preset threshold at the same time;
[0015] The first simulation result includes a first reactive current and a first reactive power, and the second simulation result includes a second reactive current and a second reactive power.
[0016] Optionally, the preset threshold is 1%.
[0017] Optionally, the simulation tool is Simulink.
[0018] Optionally, the process of constructing a first real-time simulation system of a dynamic reactive power compensator using a simulation tool specifically includes:
[0019] S1: constructing a functional model corresponding to each functional module of the dynamic reactive power compensator controller by using a simulation tool, and encapsulating each functional model to obtain an encapsulated model of the dynamic reactive power compensator controller, wherein the functional module includes a measurement module, a phase-locked loop module, an AC voltage regulation module, a reactive power regulation module, an AC current inner loop module, and a pulse trigger module;
[0020] S2: using an embedded compiler of a simulation tool to convert the package model into a first file;
[0021] S3: using FPGA supporting software to import the first file, and generate a second file after comprehensive compilation;
[0022] S4: constructing models of the power grid, the sampling module, the primary device of the dynamic reactive power compensator and the interface module on the first real-time simulator respectively;
[0023] S5: configuring the input and output ports of the package model according to the interface module model and associating a third file, wherein the third file is generated by converting the first file using a comprehensive compiler of a simulation tool;
[0024] S6: When the simulation end condition is met, the second file is solidified onto the FPGA chip as a program of the dynamic reactive power compensator controller.
[0025] Optionally, modifying the program of the FPGA chip until the simulation ends includes:
[0026] Repeat steps S1-S3 until the simulation ends.
[0027] Optionally, the process of simulating a plurality of dynamic reactive power compensator controllers by the second real-time simulator specifically includes:
[0028] Transplanting the source code .c file of the dynamic reactive power compensator controller to the Cbuilder software module of the second real-time simulator, generating a Cbuilder model of the dynamic reactive power compensator controller, and realizing simulation of the dynamic reactive power compensator controller;
[0029] Models of the power grid, sampling module, primary device of the dynamic reactive power compensator and interface module are respectively constructed on the second real-time simulator.
[0030] Optionally, both the first real-time simulator and the second real-time simulator are RTDS real-time simulators.
[0031] The present invention also provides a dynamic reactive power compensator simulation system based on controller source code, comprising:
[0032] A first real-time simulation system construction module is used to construct a first real-time simulation system of a dynamic reactive power compensator using a simulation tool; the first real-time simulation system includes a first workstation, a first real-time simulator and a plurality of field programmable gate array (FPGA) chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of a dynamic reactive power compensator and an interface module, the FPGA chip simulates a dynamic reactive power compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive power compensator and the FPGA chip;
[0033] A second real-time simulation system construction module is used to construct a second real-time simulation system of the dynamic reactive compensator according to the source code of the dynamic reactive compensator controller; the second real-time simulation system includes a second workstation and a second real-time simulator connected in communication, and the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers;
[0034] The simulation result comparison module is used to determine whether the first simulation result output by the first real-time simulation system is consistent with the second simulation result output by the second real-time simulation system. If they are consistent, the simulation ends; otherwise, the program of the FPGA chip is modified until the simulation ends.
[0035] The present invention provides a method and system for simulating a dynamic reactive compensator based on controller source code, wherein the method comprises: using a simulation tool to construct a first real-time simulation system of a dynamic reactive compensator; the first real-time simulation system comprises a first workstation, a first real-time simulator and a plurality of field programmable gate array (FPGA) chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of a dynamic reactive compensator and an interface module, the FPGA chip simulates a dynamic reactive compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive compensator and the FPGA chip; constructing a second real-time simulation system of the dynamic reactive compensator according to the source code of the dynamic reactive compensator controller; the second real-time simulation system comprises a second workstation and a second real-time simulator connected in communication, the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers; judging whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system, if they are consistent, the simulation ends, otherwise the program of the FPGA chip is modified until the simulation ends.
[0036] In view of this, the beneficial effects brought by the present invention are:
[0037] In the first real-time simulation system, the present invention uses a simulation tool to implement FPGA simulation of a dynamic reactive power compensator controller, which can completely retain the structural functions and dynamic performance characteristics of the physical controller. On the basis of not changing the functions and performance of the original control system, it greatly saves the equipment footprint, simplifies the system wiring, has high simulation efficiency, is easy to maintain, has clear control logic and architecture, and can simultaneously realize the joint simulation of multiple sets of dynamic reactive power compensators. At the same time, a second real-time simulation system based on the source code of the dynamic reactive power compensator controller is constructed as a reference object to ensure the accuracy and reliability of the simulation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the process of the present invention;
[0039] Figure 2 It is a structural schematic diagram of the system of the present invention;
[0040] Figure 3 It is a physical wiring diagram of a real-time simulation system of a dynamic reactive power compensator in the prior art;
[0041] Figure 4 A schematic diagram of the process of constructing a first real-time simulation system of a dynamic reactive power compensator by using a simulation tool according to the present invention;
[0042] Figure 5 A schematic diagram of a process of constructing a second real-time simulation system of a dynamic reactive power compensator according to the source code of a dynamic reactive power compensator controller according to the present invention;
[0043] Figure 6 A schematic diagram of the structure of a first real-time simulation system of a dynamic reactive power compensator according to the method of the present invention;
[0044] Figure 7 The figure is a connection diagram of various functional modules of a dynamic reactive power compensator controller in the prior art. DETAILED DESCRIPTION
[0045] Terminology explanation:
[0046] FPGA (Field Programmable Gate Array) is a new type of programmable logic device that can replace all existing microcomputer interface chips and realize multiple functions such as memory and address decoding in microcomputer systems. It has higher density, faster working speed and greater programming flexibility, and is widely used in various electronic products. FPGA has the characteristics of high speed, high reliability, convenient development and standardization. FPGA chips can transmit data at high speed and reliably.
[0047] The embodiment of the present invention provides a dynamic reactive power compensator simulation method and system based on controller source code, so as to solve the technical problems of complex wiring of the simulation system and low test efficiency in the prior art.
[0048] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0050] See also Figure 3 The actual physical wiring of the real-time simulation system of the dynamic reactive power compensator in the prior art is as follows: Figure 3 As shown, the real-time simulation system of the dynamic reactive power compensator mainly includes four parts, namely, a power grid, a sampling module, a primary device of the dynamic reactive power compensator and a dynamic reactive power compensator controller. The primary device of the dynamic reactive power compensator is directly connected to the power grid; wherein, the sampling module collects the phase voltage and current of the three-phase power grid and sends them to the dynamic reactive power compensator controller, and the dynamic reactive power compensator controller outputs pulses.
[0051] See also Figure 1 , an embodiment of a dynamic reactive power compensator simulation method based on controller source code of the present invention comprises:
[0052] S100: constructing a first real-time simulation system of a dynamic reactive power compensator by using a simulation tool; the first real-time simulation system comprises a first workstation, a first real-time simulator and a plurality of field programmable gate array (FPGA) chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of a dynamic reactive power compensator and an interface module, the FPGA chip simulates a dynamic reactive power compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive power compensator and the FPGA chip;
[0053] S200: constructing a second real-time simulation system of the dynamic reactive compensator according to the source code of the dynamic reactive compensator controller; the second real-time simulation system comprises a second workstation and a second real-time simulator which are in communication connection, and the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers;
[0054] S300: Determine whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system; if they are consistent, the simulation ends; otherwise, modify the program of the FPGA chip until the simulation ends.
[0055] In this embodiment, in step S100, a simulation tool is used to construct a first real-time simulation system for a dynamic reactive power compensator. The first real-time simulation system includes a first workstation, a first real-time simulator, and a plurality of field programmable gate array (FPGA) chips connected in sequence. The first real-time simulator is connected to the workstation via a network cable, and the FPGA chip is connected to the first real-time simulator via an optical fiber.
[0056] In a preferred embodiment, the first real-time simulator is an RTDS real-time simulator. Figure 6 , simulate the power grid, sampling module, dynamic reactive power compensator primary device and interface module in the first real-time simulator, and simulate the dynamic reactive power compensator controller in the FPGA chip. Specifically, the interface module connects the dynamic reactive power compensator primary device with the dynamic reactive power compensator controller through optical fiber, and the optical fiber connects the dynamic reactive power compensator primary device with the dynamic reactive power compensator controller to transmit data through the interface module. In a preferred embodiment, the interface module is simulated by the DOTA model, which is a general interface model of the RTDS real-time simulator.
[0057] In this embodiment, according to the number of dynamic reactive power compensator controllers to be simulated, a corresponding number of FPGA chips can be configured, that is, each FPGA chip simulates a dynamic reactive power compensator controller. Assume that there are n dynamic reactive power compensator controllers, represented by SVG1, SVG2, ..., SVG n , then n FPGA chips are needed to load the curing programs of n dynamic reactive power compensator controllers, which are represented by FPGA1, FPGA2, ..., FPGA n .
[0058] For details, please refer to Figure 4 The process of using the simulation tool to construct the first real-time simulation system of the dynamic reactive power compensator in this embodiment includes:
[0059] S1: Use simulation tools to construct functional models corresponding to the functional modules of the dynamic VAR compensator controller, and encapsulate the functional models to obtain the encapsulated models of the dynamic VAR compensator controller; wherein the functional modules include a measurement module, a phase-locked loop module, an AC voltage regulation module, a reactive power regulation module, an AC current inner loop module, and a pulse trigger module. In a preferred embodiment, Simulink is used to construct functional models corresponding to the functional modules of the dynamic VAR compensator controller and encapsulate them.
[0060] It is worth noting that, in this embodiment, the control logic of the dynamic reactive power compensator controller is:
[0061] The AC voltage and current are sent to the dynamic reactive power compensator controller (i.e., STATCOM controller) through the sampling module, and the current and voltage signals are used to calculate the corresponding virtual DC voltage and the AC active and reactive power through the measurement module; at the same time, the phase-locked loop module obtains the frequency and angle through voltage phase locking; the AC voltage regulation module performs closed-loop calculation through the AC voltage PLL and the AC voltage reference value sent by the measurement module, obtains the reactive current Iq and sends it to the reactive power regulation module, and then obtains the reactive current reference value after comparison with the reactive power reference value, and sends it to the AC current inner loop module; the modulated wave signal is obtained from the AC current inner loop module and sent to the pulse trigger module to trigger the STATCOM related pulses.
[0062] S2: using the embedded compiler of the simulation tool to convert the package model into a first file; in a preferred embodiment, the package model of the dynamic reactive power compensator controller is converted into an embedded .c file through the embedded compiler of Simulink.
[0063] S3: Import the first file using FPGA supporting software, and generate the second file after comprehensive compilation. In a preferred embodiment, the embedded .c file generated in step S2 is imported into Vivado, a Xilinx software package provided by the FPGA manufacturer, and the final .bit file is generated after comprehensive compilation.
[0064] S4: constructing models of the power grid, sampling module, primary device of the dynamic reactive power compensator and interface module respectively on the first real-time simulator, so as to enable the first real-time simulator to simulate the power grid, sampling module, primary device of the dynamic reactive power compensator and interface module.
[0065] S5: using the comprehensive compiler of the simulation tool to convert the first file into a third file; in a preferred embodiment, using the comprehensive compiler of Simulink to convert the embedded .c file generated in step S2 into a .a file.
[0066] S6: Configure the input and output ports of the package model of the dynamic reactive power compensator controller according to the interface module model and associate the third file.
[0067] In a preferred embodiment, the interface module model is simulated by the DOTA model in the RTDS real-time simulator, and the DOTA model realizes the interface data communication with the FPGA by associating the corresponding .a file. After the DOTA model is established in the RTDS real-time simulator, the relevant parameters (associated with the corresponding .a file) and the input and output channel names (input corresponding voltage Vabc, current Iabc, output corresponding pulses pulse signal) are configured.
[0068] S7: When the simulation end condition is met, the second file is solidified on the FPGA chip as the program of the dynamic reactive power compensator controller. If the simulation end condition is not met, steps S1-S3 are repeated until the simulation ends.
[0069] It is worth noting that during the real-time simulation of the dynamic reactive power compensator by the first real-time simulation system, the first real-time simulator calls the dynamic reactive power compensator controller program solidified on the FPGA chip through the interface module, thereby realizing the real-time simulation of the dynamic reactive power compensator.
[0070] In this embodiment, all functional modules of a dynamic VAR compensator controller are virtualized in an FPGA. The FPGA chip uses a VC707 mother card produced by Xilinx and an FM-S18 daughter card produced by Faster. The FM-S18 daughter card is connected through the HPC port on the VC707 mother card.
[0071] In this embodiment, in step S200, a second real-time simulation system of the dynamic reactive compensator is constructed according to the source code of the dynamic reactive compensator controller, and the second real-time simulation system includes a second workstation and a second real-time simulator that are communicatively connected, and the second real-time simulator simulates a power grid, a sampling module, a dynamic reactive compensator primary device and a plurality of dynamic reactive compensator controllers.
[0072] For details, please refer to Figure 5 , the process of constructing the second real-time simulation system of the dynamic reactive power compensator according to the source code of the dynamic reactive power compensator controller includes:
[0073] The source code .c file of the dynamic reactive power compensator controller is transplanted to the Cbuilder software module of the second real-time simulator to generate the Cbuilder model of the dynamic reactive power compensator controller to realize the simulation of the dynamic reactive power compensator controller.
[0074] It is worth noting that the Cbuilder software module of the RTDS real-time simulator includes a compiler, which is used to convert the .c file into an executable model file and integrate it into the model library of the RTDS real-time simulator, thereby forming a Cbuilder model corresponding to the .c file. It can be understood that the Cbuilder model is an executable model file generated by compiling the .c file using the Cbuilder software module of RTDS. The Cbuilder software module of the RTDS real-time simulator can provide RTDS users with the ability to develop their own component models, including components of power systems and control systems, which can all be modeled using the Cbuilder software module. In addition, the Cbuilder software module also provides a structure for defining model parameters, as well as a mechanism component for providing input / output signals.
[0075] In this embodiment, the source code .c file of the dynamic reactive compensator controller is directly used, and the source code .c file is transplanted into the Cbuilder software module of the RTDS real-time simulator. The Cbuilder software module converts the source code .c file of the dynamic reactive compensator controller into an RTDS executable model file through a compiler, and integrates the model file into the model library of the RTDS real-time simulator, thereby generating a corresponding Cbuilder model for the dynamic reactive compensator controller. This embodiment simulates the dynamic reactive compensator controller by establishing the Cbuilder model of the dynamic reactive compensator controller. It is a method of simulating the dynamic reactive compensator controller by pure software, and does not require the corresponding hardware device (such as FPGA).
[0076] Models of the power grid, sampling module, primary device of the dynamic reactive power compensator and interface module are respectively constructed on the second real-time simulator.
[0077] In this embodiment, the Cbuilder model is used in the RTDS real-time simulator to simulate the dynamic reactive power compensator controller. According to the actual number of dynamic reactive power compensator controllers to be simulated, the Cbuilder models of the corresponding number of dynamic reactive power compensator controllers are established. Assume that n dynamic reactive power compensator controllers need to be simulated, which are represented as SVG1, SVG2, ..., SVG n , then n dynamic VAR compensator controller Cbuilder models are needed, represented by CB1, CB2, ..., CB n .
[0078] In this embodiment, in step S300, it is determined whether the first simulation result output by the first real-time simulation system is consistent with the second simulation result output by the second real-time simulation system. If they are consistent, the simulation ends; otherwise, the program of the FPGA chip is modified until the simulation ends.
[0079] In this embodiment, in order to verify the accuracy and effectiveness of the first real-time simulation system constructed by using the simulation tool to construct the dynamic reactive power compensator, it is necessary to use the second real-time simulation system constructed according to the source code of the dynamic reactive power compensator controller as a reference object, and compare the output results of the first real-time simulation system with the second real-time simulation system. Under the same steady-state and transient conditions, it is determined whether the error between the first simulation result output by the first real-time simulation system and the second simulation result output by the second real-time simulation system is less than a preset threshold value. If so, it indicates consistency, otherwise, it indicates inconsistency.
[0080] In a preferred embodiment, the first simulation result includes a first reactive current and a first reactive power, and the second simulation result includes a second reactive current and a second reactive power. The variables for comparison are reactive current and reactive power. When the error between the reactive current and reactive power output by both is less than a preset threshold (for example, 1%), the results output by both are consistent.
[0081] Specifically, judging whether the error between the first simulation result output by the first real-time simulation system and the second simulation result output by the second real-time simulation system is less than a preset threshold includes: judging whether the errors between the first reactive current and the second reactive current, and between the first reactive power and the second reactive power are simultaneously less than the preset threshold; if they are simultaneously less than the preset threshold, the simulation ends; otherwise, the program of the FPGA chip is modified until the simulation ends.
[0082] The simulation method of the dynamic reactive compensator provided in this embodiment uses a simulation tool to implement FPGA simulation of the dynamic reactive compensator controller in the first real-time simulation system, which can completely retain the structural functions and dynamic performance characteristics of the physical controller. On the basis of not changing the functions and performance of the original control system, it saves a lot of equipment floor space, simplifies system wiring, has high simulation efficiency, is easy to maintain, has clear control logic and architecture, and can simultaneously realize the joint simulation of multiple sets of dynamic reactive compensators. At the same time, the second real-time simulation system based on the source code of the dynamic reactive compensator controller is constructed as a reference object to adjust the program of the FPGA chip in the first real-time simulation system, which can ensure the accuracy and reliability of the simulation results.
[0083] See also Figure 2 The present invention also provides a simulation system for a dynamic reactive power compensator, comprising:
[0084] The first real-time simulation system construction module 11 is used to construct the first real-time simulation system of the dynamic reactive power compensator by using a simulation tool; the first real-time simulation system includes a first workstation, a first real-time simulator and a plurality of field programmable gate array FPGA chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of the dynamic reactive power compensator and an interface module, the FPGA chip simulates a dynamic reactive power compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive power compensator and the FPGA chip;
[0085] A second real-time simulation system construction module 22 is used to construct a second real-time simulation system of the dynamic reactive compensator according to the source code of the dynamic reactive compensator controller; the second real-time simulation system includes a second workstation and a second real-time simulator connected in communication, and the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers;
[0086] The simulation result comparison module 33 is used to determine whether the first simulation result output by the first real-time simulation system is consistent with the second simulation result output by the second real-time simulation system. If they are consistent, the simulation ends; otherwise, the program of the FPGA chip is modified until the simulation ends.
[0087] The simulation system of the dynamic reactive power compensator provided by the present invention simplifies the system wiring and facilitates maintenance without changing the functions and performance of the original control system. The control logic and architecture are clear and easy to understand. It provides a solution for the joint test of multiple sets of dynamic reactive power compensators and can ensure the accuracy and reliability of the simulation results.
[0088] The simulation method and system of the dynamic reactive power compensator provided by the present invention is a compact real-time simulation system and test method of the dynamic reactive power compensator, which can simplify the wiring and facilitate maintenance of the function and performance test of the dynamic reactive power compensator. It adopts the controller virtualization technology, can completely retain the structural function and dynamic performance characteristics of the physical controller, greatly saves the equipment floor space and equipment purchase costs, and is a reliable and effective test method solution.
[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0090] In the embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0091] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0092] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0094] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dynamic reactive power compensator simulation method based on controller source code, It is characterized in that include: The first real-time simulation system for dynamic reactive power compensators was built using simulation tools; The first real-time simulation system includes a first workstation, a first real-time simulator and a plurality of field programmable gate array (FPGA) chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of a dynamic reactive power compensator and an interface module, the FPGA chip simulates a dynamic reactive power compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive power compensator and the FPGA chip; A second real-time simulation system of the dynamic reactive compensator is constructed according to the source code of the dynamic reactive compensator controller; the second real-time simulation system comprises a second workstation and a second real-time simulator which are in communication connection, and the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers; Determine whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system, if they are consistent, then the simulation ends; otherwise, modify the program of the FPGA chip until the simulation ends; The process of building the first real-time simulation system of the dynamic reactive power compensator using the simulation tool specifically includes: S1: constructing a functional model corresponding to each functional module of the dynamic reactive power compensator controller by using a simulation tool, and encapsulating each functional model to obtain an encapsulated model of the dynamic reactive power compensator controller, wherein the functional module includes a measurement module, a phase-locked loop module, an AC voltage regulation module, a reactive power regulation module, an AC current inner loop module, and a pulse trigger module; S2: using an embedded compiler of a simulation tool to convert the package model into a first file; S3: using FPGA supporting software to import the first file, and generate a second file after comprehensive compilation; S4: constructing models of a power grid, a sampling module, a primary device of a dynamic reactive power compensator, and an interface module on the first real-time simulator respectively; S5: configuring the input and output ports of the package model according to the interface module model and associating a third file, wherein the third file is generated by converting the first file using a comprehensive compiler of a simulation tool; S6: When the simulation end condition is met, the second file is solidified onto the FPGA chip as a program of the dynamic reactive power compensator controller; The process of simulating a plurality of dynamic reactive power compensator controllers by the second real-time simulator specifically includes: Transplanting the source code .c file of the dynamic reactive power compensator controller to the Cbuilder software module of the second real-time simulator, generating a Cbuilder model of the dynamic reactive power compensator controller, and realizing simulation of the dynamic reactive power compensator controller; Models of the power grid, sampling module, primary device of the dynamic reactive power compensator and interface module are respectively constructed on the second real-time simulator.
2. The dynamic reactive power compensator simulation method based on controller source code according to claim 1, It is characterized in that Determining whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system comprises: It is determined whether the error between the first simulation result output by the first real-time simulation system and the second simulation result output by the second real-time simulation system is less than a preset threshold, if so, it indicates consistency, otherwise, it indicates inconsistency.
3. The dynamic reactive power compensator simulation method based on controller source code according to claim 2, It is characterized in that Determining whether an error between a first simulation result output by the first real-time simulation system and a second simulation result output by the second real-time simulation system is less than a preset threshold specifically includes: Determine whether the errors between the first reactive current and the second reactive current, and between the first reactive power and the second reactive power are less than a preset threshold at the same time; The first simulation result includes a first reactive current and a first reactive power, and the second simulation result includes a second reactive current and a second reactive power.
4. The dynamic reactive power compensator simulation method based on controller source code according to claim 2, It is characterized in that The preset threshold is 1%.
5. The dynamic reactive power compensator simulation method based on controller source code according to claim 1, It is characterized in that The simulation tool is Simulink.
6. The dynamic reactive power compensator simulation method based on controller source code according to claim 1, It is characterized in that Modifying the program of the FPGA chip until the simulation ends includes: Repeat steps S1-S3 until the simulation ends.
7. The dynamic reactive power compensator simulation method based on controller source code according to any one of claims 1 to 6, It is characterized in that The first real-time simulator and the second real-time simulator are both RTDS real-time simulators.
8. A dynamic reactive power compensator simulation system based on controller source code, It is characterized in that include: A first real-time simulation system building module, used to build a first real-time simulation system of a dynamic reactive power compensator using a simulation tool; The first real-time simulation system includes a first workstation, a first real-time simulator and a plurality of field programmable gate array (FPGA) chips connected in sequence, the first real-time simulator simulates a power grid, a sampling module, a primary device of a dynamic reactive power compensator and an interface module, the FPGA chip simulates a dynamic reactive power compensator controller through a program, and the interface module respectively connects the primary device of the dynamic reactive power compensator and the FPGA chip; A second real-time simulation system construction module is used to construct a second real-time simulation system of the dynamic reactive compensator according to the source code of the dynamic reactive compensator controller; the second real-time simulation system includes a second workstation and a second real-time simulator connected in communication, and the second real-time simulator simulates the power grid, the sampling module, the primary device of the dynamic reactive compensator and a plurality of the dynamic reactive compensator controllers; A simulation result comparison module, used for judging whether a first simulation result output by the first real-time simulation system is consistent with a second simulation result output by the second real-time simulation system, if they are consistent, the simulation ends, otherwise, the program of the FPGA chip is modified until the simulation ends; The first real-time simulation system construction module is specifically used to use a simulation tool to construct a functional model corresponding to each functional module of the dynamic reactive power compensator controller, and encapsulate each functional model to obtain a packaged model of the dynamic reactive power compensator controller, wherein the functional module includes a measurement module, a phase-locked loop module, an AC voltage regulation module, a reactive power regulation module, an AC current inner loop module, and a pulse trigger module; and the packaged model is converted into a first file using an embedded compiler of the simulation tool; Importing the first file using FPGA supporting software, generating a second file after comprehensive compilation; constructing models of the power grid, sampling module, primary device of the dynamic reactive power compensator and interface module on the first real-time simulator; The input and output ports of the package model are configured according to the interface module model and associated with a third file, wherein the third file is generated by converting the first file using a comprehensive compiler of a simulation tool; when the simulation end condition is met, the second file is solidified onto the FPGA chip as a program of the dynamic reactive power compensator controller; The second real-time simulation system construction module is specifically used to transplant the source code .c file of the dynamic reactive power compensator controller to the Cbuilder software module of the second real-time simulator, generate the Cbuilder model of the dynamic reactive power compensator controller, and realize the simulation of the dynamic reactive power compensator controller; and respectively construct the models of the power grid, sampling module, dynamic reactive power compensator primary device and interface module on the second real-time simulator.
Citation Information
Patent Citations
Closed-loop testing system for simulating static synchronous compensator and testing method of same
CN102401863A
Software testing and optimizing method and system
CN110188039A
