Based on the MMC transient emulation method of PSCAD interface C language
Technical field
The present invention relates to a kind of MMC transient emulation method based on PSCAD interface C language, be specifically related to one and realize MMC electromagnetical transient emulation method based on PSCAD/EMTDC interface C language, belong to power system automatic field.
Background technology
Along with the development of high-power all-controlling power electronics device (IGBT), flexible AC and Technology of HVDC based Voltage Source Converter are widely used in power transmission and distribution field, it is the representational technology of intelligent grid field most, and engineer applied at home and abroad gets more and more.Compared with customary DC technology of transmission of electricity, Technology of HVDC based Voltage Source Converter has good control performance, is the HVDC Transmission Technology of latest generation.Flexible AC transmission technology (FlexibleACTransmissionSystem, FACTs) power application electronic technology realizes the quick control to power transmission network, improve electric network transportation ability and safety and stability level, strengthen operation of power networks dirigibility, wherein THE UPFC (UnifiedPowerFlowController, UPFC) highest level of current FACTs technology is represented, gaining merit and the accurate adjustment of reactive power by converter Control being realized circuit, improving transport capacity and damping system vibration.
Along with technical development, transverter technology is from two level, three level technical development to modularization multi-level converter technology (ModularMultilevelConverter, MMC).The proposition of MMC topology facilitates the development of Technology of HVDC based Voltage Source Converter, and it uses module-cascade to realize high voltage, and MMC structure as shown in Figure 1.Compared to the structure of traditional 2 level, 3 level, the modular construction of MMC makes that its extensibility is strong, output level number is high, overcomes traditional electrical Source Con-verters and there is the shortcomings such as switching frequency is high, harmonic wave of output voltage is large, electric pressure is low, dynamic voltage balancing is difficult.But the semiconductor devices quantity of MMC is more, and each submodule SM needs to control separately.In MMC topology, DC side does not have special electric capacity, but is assigned to by electric capacity in each submodule, and DC voltage is by the electric capacity shared being in conducting state submodule, most important in order to ensure that MMC normally can run the control of submodule capacitor voltage balance.At present, MMC converter valve controls usually to adopt nearest level to approach modulation NLM technology, and it effectively can reduce the advantages such as device switching frequency is low, transmission voltage current harmonic content is low, contributes to the application of flexible transmission technology to high-tension high-power field of power transmission.The control of MMC transverter adopts layering principle to realize, and as shown in Figure 2, is generally realized by system layer, transverter layer and valve control layer.Transverter layer controls mainly according to power/voltage instruction, transverter output AC voltage side reference value is produced as modulating wave by the uneoupled control of power outer shroud and current inner loop, valve layer control adopts nearest level to approach modulation strategy according to this voltage modulated ripple and produces the quantity that each brachium pontis drops into submodule, and then submodule capacitance balancing controls the submodule determining input, and produce the input of trigger pip control submodule based on this and exit.These technical characterstics above, bring very large challenge to the flexible AC-HVDC electromagnetic transient simulation based on MMC.
Electromagnetic transient simulation software PSCAD/EMTDC (PowerSystemsComputerAidedDesign/ElectromagneticTransient sincludingDC) is one of most popular electromagnetic transient simulation instrument, the off-line simulation of power electronic devices Microsecond grade duty can be realized, utilize component models in its component library can carry out the modeling of converter valve and relevant primary system, and building of general control logic can be realized.In order to improve MMC and controlling functions completes, emulates flexibly, and taking into account the simple ease for use of simulation modeling, utilizing PSCAD/EMTDC to provide user-defined model and interface function, carry out MMC and steering logic construction mold is significant.
The User Defined element of PSCAD/EMTDC provides the interface with user's favorite subroutine, can make up the deficiency that the model element that carries in PSCAD is relatively single.At present, PSCAD/EMTDC can carry out interface with the program code of Fortran, C and Matlab tri-kinds of language compilation, realizes the carrier of itself and External Program Interface by setting up User Defined element.User Defined code adds in EMTDC two kinds of methods: 1) directly in User Defined element, write Fortran codes implement element function, namely personal code work is directly directly embedded in EMTDC master routine as subroutine; 2) call statement, indirect call external subroutine by adding in self-defined element to external subroutine (Fortran, C or Matlab), the Core Feature of element is realized by external subroutine.
The self-defined element adopting Fortran to write source code generally adopts the mode directly embedded, because PSCAD/EMTDC realizes on Fortran language, without the need to compiling external subroutine and calling frequently, thus its embedded performance is good, and operational efficiency is high.The self-defined element built based on C language and Matlab belongs to the category of indirect call together, but both distinguish again to some extent.The former is the interface of PSCAD/EMTDC and c program design language, outside Integrated Development Environment (as MicrosoftvisualC++ etc.) is in operation and only serves as the role of compiling, do not participate in concrete operation, the C language code directly called after compiling by PSCAD/EMTDC carries out computing; The latter is the interface of PSCAD/EMTDC and Matlab software, computing is carried out by the direct Calling MATLAB of PSCAD/EMTDC, except the difference in both intrinsic arithmetic speeds itself, communication between the two also have impact on the efficiency of whole emulation to a great extent, and thus its operational efficiency is low compared with the former.
The steering logic related elements version that PSCAD software carries and function limited, be not enough to realize based on the flexible AC/DC Power System of MMC technology and the complete emulation of controlling functions thereof, be difficult to operation and the fault transient characteristic of truly and accurately reacting MMC, therefore the present invention adopts PSCAD/EMTDC to provide user-defined model and interface function, carries out MMC and steering logic modeling thereof.In actual applications, Matlab is easy to use, and programming is simple, but low with PSCAD/EMTDC interface code execution efficiency, and arithmetic speed is slow; C language programing function is abundant, use is comparatively extensive, ability to express is strong, and target program efficiency is high, portable good, and professional and technical personnel grasps its art of programming substantially; Fortran language numerical evaluation efficiency is high, but programming is complicated, and form restriction is more, the less use of general engineering technology personnel.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides the MMC transient emulation method based on PSCAD/EMTDC interface.
In order to achieve the above object, the technical solution adopted in the present invention is:
Based on the MMC transient emulation method of PSCAD interface C language, comprise the following steps,
Step one, utilizes PSCAD/EMTDC to carry out MMC and to be correlated with primary system modeling, carry out MMC converter Control logic modeling, and arrange voltage and current measurement point;
Step 2, utilizes the model element that PSCAD/EMTDC carries, and approaches modulation principle according to nearest level, produces voltage modulation signal V by the inner ring current controller based on dq decoupling zero
ref, determine that in each facies unit of MMC, upper and lower bridge arm triggers the submodule quantity dropped into;
Step 3, utilizes C language to build submodule capacitor voltage balance control function;
Described capacitor voltage balance control function realizes a brachium pontis submodule capacitor voltage balance in MMC facies unit and controls;
The input parameter of described capacitor voltage balance control function comprises:
A brachium pontis submodule sum in MMC facies unit;
A bridge arm current in MMC facies unit;
The capacitance voltage of a brachium pontis submodule in MMC facies unit;
In MMC facies unit, a brachium pontis triggers the submodule quantity dropped into;
Step 4, utilizes Fortran language compilation PSCAD/EMTDC interface routine, interface routine input parameter, calls capacitor voltage balance control function, realize MMC transient emulation;
The input parameter of described interface routine is consistent with the input parameter that submodule capacitor voltage balances control function.
Determine that the submodule number calculation formula that in each facies unit of MMC, upper and lower bridge arm triggering drops into is,
Wherein, n
prepresent upper brachium pontis triggers module number in MMC facies unit, n
lrepresent lower brachium pontis triggers module number in MMC facies unit, represent the quantity of a MMC facies unit brachium pontis submodule, [] expression is got and is rounded up.
The process that capacitor voltage balance control function realizes brachium pontis submodule capacitor voltage balance control in MMC facies unit is as follows,
A1) be numbered all submodules of this brachium pontis, initialization each submodule trigger pip array element is 0;
A2) bubble sort method pair is adopted, to the capacitance voltage of submodule by sorting from high to low, simultaneously by the submodule numbering that submodule capacitor voltage sequential storage is from low to high corresponding;
A3) according to the charging and discharging state of electric capacity after the walking direction submodule triggering and conducting of this bridge arm current;
When bridge arm current flows into submodule, submodule is capacitor charging after triggering, and submodule trigger pip array element becomes 1, by a submodule capacitor voltage select progressively n submodule from low to high;
When bridge arm current flows out submodule (bridge arm current is less than zero), submodule is capacitor discharge after triggering, and submodule trigger pip array element becomes 1, by a submodule capacitor voltage select progressively n submodule from high to low;
N is that this brachium pontis triggers the submodule quantity dropped into.
Needed to carry out following setting before calling capacitor voltage balance control function,
Add two FileReference elements at PSCAD/EMTDC, realize the C language file of capacitor voltage balance control function and the Fortran file association of interface routine.
The beneficial effect that the present invention reaches: the present invention can realize the emulation of MMC and controlling functions thereof; can easily for building flexible DC power transmission analogue system; and the electromagnetic transient simulation system of the UPFC connecting system based on MMC topology is established in conjunction with Practical Project, can be used for carrying out MMC transverter and flexible alternating current-direct current Control protection system operation characteristic and fault transient Simulation Analysis and correlative study.
Accompanying drawing explanation
Fig. 1 is MMC structure.
Fig. 2 is MMC control system function and structure.
Fig. 3 is process flow diagram of the present invention.
Fig. 4 is capacitor voltage balance control algolithm flow process.
Fig. 5 is based on MMC modeling one-piece construction of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the invention will be further described.Following examples only for technical scheme of the present invention is clearly described, and can not limit the scope of the invention with this.
As shown in Figure 3, based on the MMC transient emulation method of PSCAD interface C language, comprise the following steps:
Step one, utilizes PSCAD/EMTDC to carry out MMC and to be correlated with primary system modeling, carry out MMC converter Control logic (comprising open sea wharf, inner ring Current Control etc.) modeling, and arrange voltage and current measurement point.
Step 2, utilizes the model element that PSCAD/EMTDC carries, and approaches modulation principle according to nearest level, produces voltage modulation signal V by the inner ring current controller based on dq decoupling zero
rfe, determine that in each facies unit of MMC, upper and lower bridge arm triggers the submodule quantity dropped into.
Computing formula is,
Wherein, n
prepresent upper brachium pontis triggers module number in MMC facies unit, n
lrepresent lower brachium pontis triggers module number in MMC facies unit, represent the quantity of a MMC facies unit brachium pontis submodule, [] expression is got and is rounded up.
Step 3, utilizes C language to build submodule capacitor voltage balance control function.
Here C language programming software (as MicrosoftVisualC++) can be adopted to build capacitor voltage balance control function (i.e. capacitor voltage balance control program), and this capacitor voltage balance control function realizes a brachium pontis submodule SM capacitor voltage balance in MMC facies unit and controls.
The input parameter of capacitor voltage balance control function comprises:
A brachium pontis submodule sum in MMC facies unit;
A bridge arm current in MMC facies unit;
The capacitance voltage of a brachium pontis submodule in MMC facies unit;
In MMC facies unit, a brachium pontis triggers the submodule quantity dropped into.
Detailed process is as shown in Figure 4:
A1) be numbered all submodules of this brachium pontis, initialization each submodule trigger pip array element is 0;
Trigger pip array element comprises 0 and 1, and wherein 0 represents that submodule is not triggered, and 1 represents that submodule is triggered;
A2) bubble sort method pair is adopted, to the capacitance voltage of submodule by sorting from high to low, simultaneously by the submodule numbering that submodule capacitor voltage sequential storage is from low to high corresponding;
A3) according to the charging and discharging state of electric capacity after the walking direction submodule triggering and conducting of this bridge arm current;
When bridge arm current flows into submodule, submodule is capacitor charging after triggering, and submodule trigger pip array element becomes 1, by a submodule capacitor voltage select progressively n submodule from low to high;
When bridge arm current flows out submodule, submodule is capacitor discharge after triggering, and submodule trigger pip array element becomes 1, by a submodule capacitor voltage select progressively n submodule from high to low;
N is that this brachium pontis triggers the submodule quantity dropped into.
The input parameter of capacitor voltage balance control function is trigger the submodule numbering dropped into, and above-mentioned capacitor voltage balance control function is for realizing in emulation the balance control of submodule capacitor voltage and the generation of submodule trigger pip; For three-phase MMC, three facies units totally six brachium pontis, each brachium pontis all can adopt above-mentioned algorithm realization.
Step 4, utilizes Fortran language compilation PSCAD/EMTDC interface routine, in conjunction with interface routine input parameter, calls capacitor voltage balance control function, realizes MMC transient emulation.
The input parameter of above-mentioned interface routine is consistent with the input parameter of capacitor voltage balance control function.
Needed to carry out following setting before calling capacitor voltage balance control function: add two FileReference elements at PSCAD/EMTDC, realize the C language file of capacitor voltage balance control function and the Fortran file association of interface routine.
On the basis of above-mentioned emulation mode, can construct the MMC transient emulation system based on PSCAD/EMTDC interface C language, modeling structure as shown in Figure 5.
Above-mentioned emulation mode achieves the MMC transient emulation based on PSCAD/EMTDC interface C language, can complete the simulating, verifying of electro-magnetic transient specificity analysis based on the flexible AC/DC Power System of MMC and relevant control protection system logic.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the prerequisite not departing from the technology of the present invention principle; can also make some improvement and distortion, these improve and distortion also should be considered as protection scope of the present invention.