Summary of the invention
The technical problem to be solved is to provide a kind of active power distribution network of based on FPGA transient state real-time simulation system
System method for designing.It can give full play to FPGA hardware concurrency and pipelined architecture technical advantage, it is ensured that whole system
Real-time during transient emulation, and be that the detailed dynamic process using less step-length accurately to solve active power distribution network provides
Reliable basis.
The technical solution adopted in the present invention is: a kind of active power distribution network transient state real-time emulation system based on FPGA designs
Method, active power distribution network transient state real-time emulation system is divided into off-line simulation environment and in-circuit emulation environment, wherein off-line simulation ring
Real-time simulation used time t is responsible in bordertotalCalculating, according to real-time simulation used time ttotalSimulation step length Δ t is set, and will be according to imitative
Relevant parameter that true step delta t calculates and the basic parameter information read are uploaded to in-circuit emulation ring based on FPGA
Border;In-circuit emulation environment completes the real-time calculating of emulation, including the history entries current source column vector of class component each in each step-length
Calculate, total history entries current source column vector is formed, Solving Linear and update step, specifically includes following steps:
The first step: under offline environment, uses primary element to be modeled active power distribution network, reads the most passive unit
Part, circuit element, source element, circuit breaker element, the basic parameter information of electronic power switch element, statistics obtain described respectively
The quantity of class component;
Second step: under offline environment, calculates basic passive element, circuit element, source element, chopper unit respectively
The clock periodicity that part, the history entries current source column vector of electronic power switch element solve: nH, RLC, nH, LINE, nH, SOURCE,
nH, BREAKER, nH, PE, and update the clock periodicity of step: nU, RLC, nU, LINE, nU, SOURCE, nU, BREAKER, nU, PE, wherein, nh
Represent the clock periodicity that history entries current source column vector solves, take the integer more than or equal to 0, nuRepresent the clock updating step
Periodicity, takes the integer more than or equal to 0, and RLC represents basic passive element, and LINE represents that circuit element, SOURCE represent power supply
Element, BREAKER represents that circuit breaker element, PE represent electronic power switch element;
3rd step: under offline environment, calculates each class component history entries current source column vector described in the first step and is formed always
Clock periodicity n needed for history entries current source column vectorhist, calculate and use parallel matrix-vector multiplication to realize linear equation
The clock periodicity n that group solvesmatrix;
4th step: under offline environment, calculating the calculating clock cycle sum needed for the emulation of each step is ntotal=max
(nH, RLC, nH, Line, nH, SOURCE, nH, BREAKER, nH, PE)+nhist+nmatrix+max(nU, RLC, nU, Line, nU, SOURCE, nU, BREAKER,
nU, PE)+nother, wherein the history entries current source column vector of each class component described in the first step solves and updates the calculating of step
Concurrently carrying out, max function representation takes maximum, notherRepresent the total clock cycle number of some scattered operations;
5th step: under offline environment, according to drive clock frequency f and the clock cycle sum n of FPGAtotal, obtain
T actual time needed for each step emulates in 4th steptotal, ttotal=ntotal/ f, sets simulation calculation step delta t, and Δ t need to expire
Foot ttotal< Δ t is to ensure emulation real-time;
6th step: under offline environment, according to the equivalent electric of each class component described in the simulation step length Δ t calculating first step
Lead, form nodal-admittance matrix, history entries current source and update the meter needed for computing in all kinds of component models described in calculating
Calculate parameter, calculate the inverse matrix of nodal-admittance matrix;
7th step: history entries current source and renewal fortune in the equivalent conductance that the 6th step has been obtained, all kinds of component models
Imitative described in basic parameter information described in calculating parameter needed for calculation, the inverse matrix of nodal-admittance matrix, the first step, the 5th step
True step delta t is uploaded to in-circuit emulation environment based on FPGA;
8th step: under at thread environment, arranges emulation moment t=0, the emulation shape of finite state machine in global control module
State is idle condition, starts emulation;
9th step: under at thread environment, simulation status enters state one, and simulation timer starts timing, calculates the first step
The history entries current source of described each class component, generates history entries current source column vector, the calculating of wherein said each class component
Being parallel, respective end signal is set high level after completing by the calculating task of each class component;
Tenth step: under at thread environment, carries out logical AND operation to the end signal of each class component described in the 9th step, when
This signal is high level, after the most all elements complete the calculating of history entries current source, and the history entries current source that all elements are generated
Column vector combines, and obtains total history entries current source column vector Ih, and store, generate state one end signal;
11st step: under at thread environment, simulation status enters state two, reads corresponding according to circuit breaker switch state
Inverse matrix G of nodal-admittance matrix-1, use parallel matrix-vector multiplication by inverse matrix G-1And total history entries current source row
Vector IhCalculate node voltage column vector v, generate state two end signal;
12nd step: under at thread environment, simulation status enters state three, is updated described each class component respectively
Computing, calculates terminal voltage and the branch current of each element, and stores, and the renewal of wherein said each class component calculates
It is parallel;
13rd step: under at thread environment, simulation result user specified passes offline environment back, in order to Yong Hucha
See;
14th step: under at thread environment, it is judged that when simulation timer whether timing is to Δ t, as met condition, then generate
Step-length end signal, otherwise emulator waits until timing is to Δ t;
15th step: judge whether simulation time reaches emulation and end the moment, ends the moment as reached emulation, then emulates knot
Bundle, otherwise returns the 9th step.
Primary element described in the first step includes: basic passive element, circuit element, source element, circuit breaker element, electricity
Power electronic switching element.
Basic parameter information described in the first step includes: the basic resistance of passive element, inductance and capacitance parameter, circuit unit
The resistance of part and inductance matrix, the amplitude of source element, frequency and initial phase, the offresistance of circuit breaker element, Guan Bi electricity
Resistance, breaker actuation time, electronic power switch element represents the resistance of open circuit, electric capacity and represents the inductance of Guan Bi, all kinds of
The node serial number of element, nodal-admittance matrix dimension.
The control scheduling of simulation status one, simulation status two and simulation status three in real-time simulation, is by finite state
Machine realizes.
The active power distribution network transient state real-time emulation system method for designing based on FPGA of the present invention, it is possible to give full play to FPGA
Hardware concurrent and the technical advantage of pipelined architecture, it is ensured that the real-time during whole system transient emulation, and be
The detailed dynamic process using less step-length accurately to solve active power distribution network provides reliable basis.The simulation result of the present invention
Can fit like a glove in stable state with transient process with the simulation result of business simulation software, the dynamic response characteristic of the two is protected
Having held highly consistent, embodied good simulation accuracy, fully demonstrate present invention proposition is suitable to the active of FPGA realization
The feasibility of power distribution network transient state real-time emulation system frame design method.The present invention has preferable feasibility and the suitability, for
Realize containing distributed power source, energy storage device active power distribution network transient state real-time simulation in provide a kind of well resolving ideas.
Detailed description of the invention
Below in conjunction with embodiment and accompanying drawing, the active power distribution network transient state real-time emulation system based on FPGA of the present invention is set
Meter method is described in detail.
The active power distribution network transient state real-time emulation system method for designing based on FPGA of the present invention, as shown in Figure 2, active
Power distribution network transient state real-time emulation system is divided into off-line simulation environment and in-circuit emulation environment, and wherein off-line simulation environment is responsible in real time
Emulation used time ttotalCalculating, according to real-time simulation used time ttotalSimulation step length Δ t is set, and will count according to simulation step length Δ t
The relevant parameter calculated and the basic parameter information read are uploaded to in-circuit emulation environment based on FPGA;In-circuit emulation ring
Border completes the real-time calculating of emulation, including the history entries current source column vector calculation of class component each in each step-length, total history entries
The formation of current source column vector, Solving Linear and renewal step are concrete as it is shown in figure 9, comprise the steps:
The first step: under offline environment, uses primary element to be modeled active power distribution network, reads all kinds of primary element
Basic parameter information, statistics obtains the quantity of described each class component, and wherein, described primary element includes: the most passive unit
Part, circuit element, source element, circuit breaker element, electronic power switch element etc.;Described basic parameter information includes: base
The resistance of this passive element, inductance and capacitance parameter, the resistance of circuit element and inductance matrix, the amplitude of source element, frequency
And initial phase, the offresistance of circuit breaker element, closed resistance, breaker actuation time, electronic power switch element represents
The resistance of open circuit, electric capacity and the inductance of expression Guan Bi, the node serial number of each class component, nodal-admittance matrix dimension.
Second step: under offline environment, calculates basic passive element, circuit element, source element, chopper unit respectively
The clock periodicity that the history entries current source column vector of each class components such as part, electronic power switch element solves: nH, RLC, nH, LINE,
nH, SOURCE, nH, BREAKER, nH, PE, and update the clock periodicity of step: nU, RLC, nU, LINE, nU, SOURCE, nU, BREAKER, nU, PE,
Wherein, nhRepresent the clock periodicity that history entries current source column vector solves, take the integer more than or equal to 0, nuRepresent and update step
Clock periodicity, take the integer more than or equal to 0;
Active power distribution network includes the multiclass primary elements such as power supply, motor, transformator, circuit and switch models.Consider
The element related in active power distribution network is more, here only for have the basic passive element of exemplary process mode, circuit element,
Power supply class component and electronic power switch element illustrate, and provide the history entries current source of these several class components under offline environment
Column vector solve and update step clock cycle sum computational methods.
(1) basic passive element
Basic passive element includes resistance R, inductance L and electric capacity C and RL, RC composite component etc. being made up of them.Right
In this class component, its history amount solves and updates shown in general type such as formula (5) and the formula (6) of step.In formula, according to R, L, C
Combining form is different, A1、A2、GeqExpression the most different, as shown in table 1.
Ih(t-Δt)=A1v(t-Δt)+A2i(t-Δt) (5)
i(t)=Geqv(t)+Ih(t-Δt) (6)
The basic passive element of table 1 calculates parameter expression
For the emulation of basic passive element, the massive parallelism of FPGA can be made full use of and realize deep pipeline knot
Structure.As a example by history entries solves, as shown in Figure 4.Computing formula, A is solved according to history entries1、A2And the branch road electricity of a upper time step
((t-Δ t) can read from 4 RAM t-Δ t) and branch current i pressure v simultaneously, and entered by 2 Floating-Point Multipliers simultaneously
Row multiplying, obtains history entries I finally by floating-point adder deviceh(t-Δ t), is stored in RAMhistIn, based on next time step
Calculate.In this module, RAM reading data needs 2 clock cycle, and floating number multiplication and additive operation employ integrated compiling
The IP kernel that environment carries, it calculates clock number nmultiplyAnd naddIt is respectively 5 and 7 clock cycle.Therefore, module initial time delay
It it is 14 clock cycle.Under pipelined architecture, the result of calculation of first basic passive element will be after 14 clock cycle
Obtain, work as NRLCIndividual passive element passes sequentially through history entries and solves module when processing, its total clock cycle number nH, RLC=14+
(NRLC-1) the individual clock cycle.In like manner, its renewal step comprises two floating-point adders and a floating number multiplication, its total clock
Periodicity nU, RLC=21+(NRLC-1) the individual clock cycle.
(2) circuit element
The history entries computing formula of circuit element and renewal calculate shown in publicity such as formula (7) and formula (8):
As a example by history entries solves, as shown in Figure 5.[A] and [B] is 3x3 matrix, can use RAM respectivelyA1、
RAMA2、RAMA3、RAMB1、RAMB2、RAMB3Store each circuit element [A] and a line of [B] matrix.When emulation starts, [A]
The branch voltage vector sum branch current vector of [B] and a upper time step reads from RAM simultaneously, and according to shown in accompanying drawing 5
Flow process carries out parallel matrix vector dot computing and parallel vector additive operation.History entries electric current when each circuit element
Source Ih1(t-Δt)、Ih2(t-Δt)、Ih3(after t-Δ t) is calculated, it is re-converted into floating number, and by time delay, whole
Close, extraction is stored in memory RAM after operatinghist.Delay_nclk module in accompanying drawing 5 represents and carries out prolonging of n clock cycle
Time, it mostly being alignment of data and arrange, Fix2Float and Float2Fix module is for fixed-point number and the mutual conversion of floating number.When
NLINEIndividual circuit element passes sequentially through history entries and solves module when processing, the clock periodicity n of solution procedureH, LINE=22+
(3*NLINE-1).It addition, the clock periodicity n of its renewal processU, LINE=33+(3*NLINE-1)。
(3) power supply class component
Power module can process and includes single-phase electricity potential source, single-phase current, three-phase voltage source, three-phase current source and be subject to
The control multiple power sources such as voltage source and controlled current source.As a example by alternating current source, its output is general all as shown in formula (9):
f(t)=Asin(ωt+θ) (9)
Wherein, A represents that amplitude, ω represent that angular frequency, θ represent initial phase.Look-up table is used to realize asking of this function
Solving, its principle is as shown in Figure 6.
First by the sampling step length T less than simulation step length Δ tsIn calculating a cycle in advance, all of unit is sinusoidal
Value sin (ω t+ θ), and it is stored in RAMsin, the initial phase θ of each alternating current source extrapolates corresponding to RAM simultaneouslysinInitially
Location is also sequentially stored into RAMθIn, RAM simultaneouslyθEach phase place of middle storage advances with emulation and is incremented by, and its increment Inc is imitative
True step-length and ratios delta t/T of sampling step lengths.Thus without calculating Nonlinear Sinusoidal function by complicated algorithm, only need
Pass through RAMθAddress date from RAMsinMiddle reading unit sine value also carries out floating number multiplication, each exchange with amplitude A
Amplitude A in source is stored in memory RAM the most in advanceAIn.Work as NSOURCEIndividual source element passes sequentially through history entries and solves module and carry out
During process, the clock periodicity n of solution procedureH, SOURCE=9+(NSOURCE-1).It addition, it updates step for the clock week solved
Issue nU, SOURCE=7+(NSOURCE-1)。
(4) electronic power switch element
The present invention makes to carry out switch modeling with the following method, method particularly includes: use small inductor simulation during switch Guan Bi, open
Closing and use small capacitances form simulation in series with a resistor when disconnecting, formula (10) row have been write and have been used switching off of obtaining of trapezoidal method difference
With characteristic equation during Guan Bi.
L in formula (10)sRepresent inductance during switch Guan Bi, CsRepresent electric capacity when switching off, RsWhen expression switches off
Resistance, (t-Δ t) represents that (t-Δ t) represents this time for this time step and the switching current of a upper time step, u (t) and u to i (t) with i
Step and the switch both sides voltage of a upper time step, Δ t represents simulation step length.Admittance when if formula (10) breaker in middle disconnects and closes
Meet formula (11) and then ensure that when on off state switches, admittance matrix is constant, only rely on history amount change the most changeable switch shape
State.
Use the method time, though switch how to change, admittance matrix remains constant, the most only need to store one inverse
Matrix, greatly alleviates the storage pressure of inverse matrix.
The Realization of Simulation for switch element can make full use of the massive parallelism of FPGA, and realizes deep pipeline knot
Structure.Illustrate as a example by its history amount solves, shown in its solution formula such as formula (12), two expression formulas in formula (10) combine
Conjunction forms, and concrete FPGA realizes block diagram as shown in Figure 7.
i(t)=Gu(t)+Ih(t-Δt) (12)
Ih(t-Δt)=A1u(t-Δt)+A2i(t-Δt)
In formula (12), A1And A2Value determined by off state, RAMv、RAMiAnd RAMhistFor storage switch voltage,
Switching current and history amount, RAMA1_open、RAMA1_closed、RAMA2_openAnd RAMA2_closedIt is respectively used to store each open
A when pass is opened or closed1And A2Value A1_open、A1_closed、A2_openAnd A2_closed, RAMstateFor storing each IGBT's
On off state state.As shown in Figure 8, each time step calculates when starting, A1_open、A1_closed、A2_open、A2_closedAnd
State reads from memorizer simultaneously, wherein A1_open、A1_closed、A2_openAnd A2_closedDistributed by two data respectively
Device, and judged this time step A by by off state state1And A2Value.The switch terminals voltage v of a upper time step (t-Δ t) and
(t-Δ t) postpones a clock and reads, with output result A of data distributor switching current i1、A2Keep alignment of data, and same
Time carry out multiplying by 2 Floating-Point Multipliers, obtain history amount I finally by floating-point adder deviceh(t-Δ t), deposits
Enter RAMhistIn, calculate for next time step.Work as NPEIndividual electronic power switch element passes sequentially through history entries and solves module and carry out
During process, the clock periodicity n of solution procedureH, PE=15+(NPE-1).It addition, the clock periodicity n of its renewal processU, PE=21+
(NPE-1)。
3rd step: under offline environment, calculates each class component history entries current source column vector described in the first step and is formed always
Clock periodicity n needed for history entries current source column vectorhist, calculate and use parallel matrix-vector multiplication to realize linear equation
The clock periodicity n that group solvesmatrix;
Accompanying drawing 2 comprises total history entries current source column vector generation module and based on parallel matrix vector multiplication linear
Solving equations module, its required clock periodicity is as described below.
In total history entries current source column vector generation module, need the history entries current source calculated according to each class component
Column vector, total history entries current source is obtained in superposition.Superposition completes under fixed-point number numeral system in this process, needs to examine
Worry floating number mutually changes, with fixed-point number, the clock cycle n consumedconvert, the clock periodicity of superposition is equal to matrix
Dimension Nmatrix, wherein floating number employs, with the mutually conversion of fixed-point number, the IP kernel that integrated translation and compiling environment carries, and it calculates clock
Number nconvertIt is 6, the therefore clock periodicity n of this stephist=2*nconvert+Nmatrix。
Solving Linear is often part the most time-consuming in transient emulation, in order to reach to calculate faster speed,
Ensureing emulation real-time, can prestore conductance matrix inverse matrix, shown in its computing formula such as formula (10).It is N for dimensionmatrix
Matrix, use NmatrixIndividual RAM stores, the data line of each RAM storage matrix.Now, system of linear equations can be asked
Solution is converted into NmatrixIndividual can be parallel vector dot computing, as shown in formula (11).This module in accumulation process with circuit element
Identical, repeat no more here, it calculates needs priority consider the mutually conversion of floating number multiplication, floating number and fixed-point number and determine
Count cumulative, therefore its clock periodicity nmatrix=nmultiply+2nconvert.Module implementations as shown in Figure 8, by this
Module can be calculated the instantaneous voltage value of each node.
v=YIh, Y=G-1 (10)
Use double Resistance model for prediction to be simulated in view of chopper, when i.e. chopper disconnects, use the resistance that resistance is bigger
Representing, during breaker closing, the resistance using resistance the least represents, circuit-breaker status change causes the change of system conductance matrix
Change.Therefore in real-time simulation, all possible matrix structure is required for calculating in advance and storing to RAM, needs storage
Calculating matrix number is 2Nbreaker, wherein NbreakerFor chopper number, form state by the current state of each chopper
Sequence, thus read corresponding conductance matrix inverse matrix.
4th step: under offline environment, as shown in Figure 2, the history entries current source row of each class component described in the first step
Vector solves and updates the calculating and sending of step and carries out, and their clock periodicity that solves is determined, therefore by time-consuming elder
Calculating the calculating clock cycle sum needed for the emulation of each step is ntotal=max(nH, RLC, nH, Line, nH, SOURCE, nH, BREAKER,
nH, PE...) and+nhist+nmatrix+max(nU, RLC, nU, Line, nU, SOURCE, nU, BREAKER, nU, PE...) and+nother, max letter
Number expression takes maximum, notherRepresent the total clock cycle number of some scattered operations, such as the behaviour of systematic function module end signal
Make;
5th step: under offline environment, according to drive clock frequency f and the clock cycle sum n of FPGAtotal, obtain
T actual time needed for each step emulates in 4th steptotal, ttotal=ntotal/ f, sets simulation calculation step delta t, and Δ t need to expire
Foot ttotal< Δ t is to ensure emulation real-time;
6th step: under offline environment, according to the equivalent electric of each class component described in the simulation step length Δ t calculating first step
Lead, form nodal-admittance matrix, history entries current source and update the meter needed for computing in all kinds of component models described in calculating
Calculate parameter, calculate the inverse matrix of nodal-admittance matrix;
7th step: history entries current source and renewal fortune in the equivalent conductance that the 6th step has been obtained, all kinds of component models
Imitative described in basic parameter information described in calculating parameter needed for calculation, the inverse matrix of nodal-admittance matrix, the first step, the 5th step
True step delta t etc. is uploaded to in-circuit emulation environment based on FPGA;
The first step as above~the 7th step, complete under offline environment, and the simulation status in thread environment
Control is realized by finite state machine, as shown in Figure 3, is provided with four kinds of running statuses and for every kind of state assignment one
3 bits represent, respectively idle condition (IDLE:000);Simulation status one (STEP_I:001);Simulation status two
(STEP_II:010);Simulation status three (STEP_III:100).
The operational process of this finite state machine is: emulator is initially in idle condition IDLE, when emulation commencing signal
After Start draws high, system enters simulation status one STEP_I;After total history entries current source column vector generates, simulation status one
End signal end_STEP_I puts 1, promotes emulation to enter simulation status two STEP_II;After Solving Linear completes, it is
System draws high simulation status two end signal end_STEP_II, promotes emulation to enter simulation status three STEP_III;When emulation timing
Device timing, to Δ t, draws high step-length end signal end_ Δ t, and this time step calculates and terminates, and promotes emulation to come back to simulation status one
STEP_I also starts the emulation of next time step.Thus, real-time simulation is in simulation status one STEP_I, state two STEP_II, state
Between three STEP_III tri-states, circulation advances, until emulation terminates.When reset signal Reset is drawn high, system can be returned again
To idle condition.Idiographic flow is as described below.
8th step: under at thread environment, arranges emulation moment t=0, the emulation shape of finite state machine in global control module
State is idle condition (IDLE), starts emulation;
9th step: under at thread environment, simulation status enters state one (STEP_I), and simulation timer starts timing, meter
The history entries current source of the calculation each class component described in the first step, generates history entries current source column vector, wherein said all kinds of units
The calculating of part is parallel, and respective end signal is set high level after completing by the calculating task of each class component;
Tenth step: under at thread environment, carries out logical AND operation to the end signal of each class component described in the 9th step, when
This signal is high level, after the most all elements complete the calculating of history entries current source, and the history entries current source that all elements are generated
Column vector combines, and obtains total history entries current source column vector Ih, and store, generate state one end signal (end_
STEP_I);
11st step: under at thread environment, simulation status enters state two (STEP_II), according to circuit breaker switch state
Read inverse matrix G of corresponding nodal-admittance matrix-1, use parallel matrix-vector multiplication by inverse matrix G-1And total history
Item current source column vector IhCalculate node voltage column vector v, generate state two end signal (end_STEP_II);
12nd step: under at thread environment, simulation status enters state three (STEP_III), divides described each class component
It is not updated computing, calculates terminal voltage and the branch current of each element, and store, wherein said each class component
Update calculate be parallel;
13rd step: under at thread environment, simulation result user specified passes offline environment back, in order to Yong Hucha
See;
14th step: under at thread environment, it is judged that when simulation timer whether timing is to Δ t, as met condition, then generate
(end_ Δ t), otherwise emulator waits until timing is to Δ t step-length end signal;
15th step: judge whether simulation time reaches emulation and end the moment, ends the moment as reached emulation, then emulates knot
Bundle, otherwise returns the 9th step.
The system framework that this method for designing proposes can give full play to the skill of FPGA hardware concurrency and pipelined architecture
Art advantage, it is ensured that the real-time during whole system transient emulation, and for using less step-length accurately to solve active distribution
The detailed dynamic process of net provides reliable basis.
Simulation status one (STEP_I) in heretofore described real-time simulation, simulation status two (STEP_II) and imitative
The control scheduling of true state three (STEP_III), is realized by finite state machine.
The active power distribution network transient state real-time emulation system method for designing based on FPGA that the present invention proposes, belongs to power system
Emulation field, is particularly well-suited to the real-time transient emulation of the active power distribution network containing distributed power source, energy storage device.The present invention proposes
Active power distribution network transient state real-time emulation system RTDG (Real-Time Transient Simulator for based on FPGA
Distributed Generation and Microgrid).Here enter as a example by European Union's low-voltage active power distribution network example system
Row explanation, as shown in Figure 10, containing various lines and load type in system.Implement step and describe in detail as follows:
The first step: under offline environment, uses primary element to be modeled active power distribution network, reads the most passive unit
The basic parameter information of all kinds of primary elements such as part, circuit element, source element, circuit breaker element, electronic power switch element,
Statistics obtains the quantity of each class component, in this example, source element 3, basic passive element 42, circuit element 15,
Circuit breaker element 1, electronic power switch element 0;
Second step: under offline environment, calculates basic passive element, circuit element, source element, circuit breaker element, electricity
Clock cycle sum (the n that the history entries current source column vector of the elements such as power electrical switch solvesH, RLC, nH, LINE, nH, SOURCE,
nH, BREAKER, nH, PE...) and the clock cycle sum (n of renewal stepU, RLC, nU, LINE, nU, SOURCE, nU, BREAKER,
nU, PE...).N in this exampleH, RLC=55, nH, LINE=66, nH, SOURCE=11, nH, BREAKER=0, nH, PE=0, nU, RLC=62,
nU, LINE=77, nU, SOURCE=13, nU, BREAKER=22, nU, PE=0;
3rd step: under offline environment, calculates each class component history entries current source column vector and forms total history entries current source
Process clock periodicity n needed for column vectorhist, calculate use parallel matrix vector multiplication realize Solving Linear time
Clock periodicity nmatrix;N in this examplematrix=67, nhist=79, nmatrix=17;
4th step: under offline environment, calculating the total clock periodicity that calculates needed for the emulation of each step is ntotal=max
(nH, RLC, nH, Line, nH, SOURCE, nH, BREAKER, nH, PE...) and+nhist+nmatrix+max(nU, RLC, nU, Line, nU, SOURCE,
nU, BREAKER, nU, PE...) and+nother, the history entries current source column vector of the most each class component solves and updates step
Calculating and sending is carried out, and max function representation takes maximum, nother=25, in this example, the n calculated according to formulatotalFor
264;
5th step: under offline environment, according to drive clock frequency f and the n of FPGAtotal, obtain each step and calculate institute
T actual time neededtotal, ttotal=ntotal/ f, sets simulation calculation step delta t, and Δ t need to meet ttotal< Δ t is to ensure emulation
Real-time.In this example, clock frequency f is 135MHz, therefore ttotalBeing 1.956 μ s, Δ t is set as 2 μ s;
6th step: under offline environment, according to the equivalent electric of each class component described in the simulation step length Δ t calculating first step
Lead, form nodal-admittance matrix, history entries current source and update the meter needed for computing in all kinds of component models described in calculating
Calculate parameter, calculate the inverse matrix of nodal-admittance matrix;
7th step: history entries current source and renewal fortune in the equivalent conductance that the 6th step has been obtained, all kinds of component models
Imitative described in basic parameter information described in calculating parameter needed for calculation, the inverse matrix of nodal-admittance matrix, the first step, the 5th step
True step delta t is uploaded to in-circuit emulation environment based on FPGA;
8th step: under at thread environment, arranges emulation moment t=0, the emulation shape of finite state machine in global control module
State is idle condition (IDLE), starts emulation;
9th step: under at thread environment, simulation status enters state one (STEP_I), and simulation timer starts timing, meter
The history entries current source of the calculation each class component described in the first step, generates history entries current source column vector, wherein said all kinds of units
The calculating of part is parallel, and respective end signal is set high level after completing by the calculating task of each class component;
Tenth step: under at thread environment, carries out logical AND operation to the end signal of each class component described in the 9th step, when
This signal is high level, after the most all elements complete the calculating of history entries current source, and the history entries current source that all elements are generated
Column vector combines, and obtains total history entries current source column vector Ih, and store, generate state one end signal (end_
STEP_I);
11st step: under at thread environment, simulation status enters state two (STEP_II), according to circuit breaker switch state
Read inverse matrix G of corresponding nodal-admittance matrix-1, use parallel matrix-vector multiplication by inverse matrix G-1And total history
Item current source column vector IhCalculate node voltage column vector v, generate state two end signal (end_STEP_II);
12nd step: under at thread environment, simulation status enters state three (STEP_III), divides described each class component
It is not updated computing, calculates terminal voltage and the branch current of each element, and store, wherein said each class component
Update calculate be parallel;
13rd step: under at thread environment, simulation result user specified passes offline environment back, in order to Yong Hucha
See;
14th step: under at thread environment, it is judged that when simulation timer whether timing is to Δ t, as met condition, then generate
(end_ Δ t), otherwise emulator waits until timing is to Δ t step-length end signal;
15th step: judge whether simulation time reaches emulation and end the moment, ends the moment as reached emulation, then emulates knot
Bundle, otherwise returns the 9th step.
The environment that performs of this example is altera corpIV GX FPGA530 official development board.Development board is joined
Having Stratix IV Series FPGA EP4SGX530KH40C2N, this chip comprises 531200 logical blocks, and 212480 adaptive
Answer logic module, 1280 M9K memorizeies, 64 M144K memorizeies, 1024 18x18 special multiplier, 8 PLL and
744 I/O.Except EP4SGX530KH40C2N chip, development board additionally provides the clock circuit of multiple frequency, and 3 users can
Configuration button, a large amount of external memory storages, PCI Express slot, the peripheral circuit such as 10/100/1000Ethernet interface.
In terms of simulation velocity, the active power distribution network transient state real-time emulation system based on FPGA proposed by the present invention is set
Meter method, it is possible to give full play to FPGA hardware concurrency and pipelined architecture, it is ensured that the real-time of whole system transient emulation;
Accompanying drawing 11~12 compares the active power distribution network transient state real-time emulation system based on FPGA using the inventive method and imitates with business
The simulation result of true software Matlab/SimPowerSystems.It can be seen in the drawings that Matlab/
The simulation result of SimPowerSystems can fit like a glove in stable state with transient process with the simulation result of FPGA, and two
The dynamic response characteristic of person maintains highly consistent, has embodied good simulation accuracy, fully demonstrates what the present invention proposed
Be suitable to the feasibility of the active power distribution network transient state real-time emulation system frame design method that FPGA realizes.
Above numerical testing proves, a kind of based on FPGA active power distribution network transient state real-time simulation that the present invention proposes
Design method has preferable feasibility and the suitability, for realizing containing distributed power source, the active power distribution network of energy storage device
Transient state real-time simulation provides a kind of well resolving ideas.