Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Machine Model DER_A Model DER_A

Distributed Energy Resource Aggregate model


States : θ
1 – Vmeas Vref0 (user defined)
Iqh1
Iqmax
+
2 – Pmeas 1 − Iqv + Iqmin = −Iqmax Iqcmd
1
dbd1
3 – Q_V Vt
1 + 𝑠𝑠𝑇𝑇𝑟𝑟𝑟𝑟 Vmeas

dbd2
𝐾𝐾𝐾𝐾𝐾𝐾 ∑
1 + 𝑠𝑠𝑇𝑇𝑔𝑔
Q Priority (PqFlag = 0)
4 – Iq 1 Iql1
5 – Mult PfFlag
+ Iqmax = Imax Iqmin 4 𝐼𝐼𝑄𝑄
Feedback of 1 1 1 Ipmax = 2
�Imax − 2
Iqcmd
6 – Fmeas Pord
1 + 𝑠𝑠𝑇𝑇𝑝𝑝
× ÷
1 + 𝑠𝑠𝑇𝑇𝑖𝑖𝑖𝑖 Current
2
7 – Power PI State 9 3 P Priority (PqFlag = 1) PqFlag Limit
Logic

0.01
8 – dPord Ipmax = Imax For Rup and Rdown,
Qref see note on
0 Vmeas 1 (Imax)
9 – Pord 2
Iqmax = �Imax 2
− Ipcmd Implementation of
1 Pref Vmeas rrpwr on next page
10 - Ip 𝑅𝑅𝑅𝑅𝑅𝑅

0.01
dPmax Pmax
Freq_ref = 1.0 0 Pmax Ipmax
− femax 0
Ddn +
+ + 1 1
÷
1 − 𝐾𝐾𝑖𝑖𝑖𝑖 1 + 𝑠𝑠𝑇𝑇𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 Pord Ipcmd 1 + 𝑠𝑠𝑇𝑇𝑔𝑔
∑ fdbd1 ∑ ∑ 𝐾𝐾𝑝𝑝𝑝𝑝 + 8
FreqPU 𝑠𝑠
1 + 𝑠𝑠𝑇𝑇𝑟𝑟𝑟𝑟 Fmeas fdbd2 + 1
dPmin 9
+ FreqFlag Pmin Ipmin 𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅
6 Dup femin
Pmin 7
If TypeFlag = 0, I𝑝𝑝min = −Ipmax 10
0 −1
Else I𝑝𝑝min = 0
Vlmult 1.0
0
1 𝐼𝐼𝑃𝑃
𝐴𝐴𝐴𝐴
𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉 = 1 + 𝑠𝑠𝑇𝑇𝑣𝑣
𝐴𝐴𝐴𝐴 + 𝐵𝐵𝐵𝐵 VtripFlag 5
Vmin 𝐵𝐵𝐵𝐵 Vlmult
See pseudo code on following page for complete description 𝐸𝐸𝑞𝑞 = 0 + 𝐼𝐼𝑃𝑃 𝑋𝑋𝑒𝑒
𝐴𝐴𝐴𝐴 1 𝐼𝐼𝑄𝑄𝑄𝑄𝑄𝑄𝑄𝑄
Vlmult always tracks the black line until following conditions are met. If the voltage stays 𝐸𝐸𝑑𝑑 = 𝑉𝑉𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 − 𝐼𝐼𝑄𝑄𝑄𝑄𝑄𝑄𝑄𝑄 𝑋𝑋𝑒𝑒
Vl0 Vl1 below vl1 for a duration greater than tvl1, then it will now always follow the path of the red
1
line when the voltage recovers. If the voltage stays below vl0 for greater than tvl0, then the
output will always remain at zero. 𝑉𝑉𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 isthe per unit
Vmeas Vhmult terminal voltage
Vhmult always tracks the black line until following conditions are met. If the voltage stays
above vh1 for a duration greater than tvh1, then it will now always follow the path of the magnitude at last time
𝐵𝐵h step
Vmax red line when the voltage recovers. If the voltage stays above vh0 for greater than tvh0,
𝐴𝐴ℎ Vhmult then the output will always remain at zero. θ is the per unit voltage
𝐴𝐴ℎ
𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉 = angle at terminal
𝐴𝐴ℎ + 𝐵𝐵ℎ Vrfrac determines the location of the red lines showing what factor returns after tripping.
Vh1
𝑗𝑗𝑋𝑋𝑒𝑒
Vh0 Vmin = track lowest value of voltage (state 1) after the Tvl1 timer has expired
Vmax = track highest value of voltage (state 1) after the Tvh1 timer has expired
+
6 Vt > 𝑉𝑉𝑉𝑉𝑉𝑉 Vpr is tested against the terminal voltage Vt (not the measured voltage Vmeas) �𝐸𝐸𝑑𝑑 + 𝑗𝑗𝐸𝐸𝑞𝑞 �𝑒𝑒𝑗𝑗θ --
Fmeas
Nominal If FTripFlag <> 0 then a frequency relay will act to trip the entire generator under the following conditions
Frelay
Frequency • If Frelay goes below fl for more than tfl seconds, then the entire model will trip
1.0 • If Frelay goes above fh for more than tfh seconds, then the entire model will trip Parameters 𝐼𝐼𝑚𝑚𝑚𝑚𝑚𝑚 and 𝑃𝑃𝑄𝑄𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 are also used in
Vt ≤ 𝑉𝑉𝑉𝑉𝑉𝑉 (Note: Fl and Fh have units of Hertz) algebraic network equations to enforce maximum
current. See REGC B for more details.
Pseudo Code for the Under and Over Voltage Tripping and Reconnection:

The following is performed each time step to model the low and high voltage tripping and reconnection.
Inputs Parameters // The variables come from the simulation // Note: the pseudo code in the left column here is run before the pseudo code below
Vl0
Vl1
theVolt = voltage measurement (state 1) // Use Timers to see if on fractional restart curve
theTime = present time of simulation if (not ActiveFracLow) and ActiveTimerVl1 and ((TheTime - TimeBelowVl1) >= Tvl1)
Vh0
Vh1 ActiveFracLow = true
Tvl0 // Note: the pseudo code in this column is run endif
Tvl1 before the pseudo code on the right column if (not ActiveFracHigh) and ActiveTimerVh1 and ((TheTime - TimeAboveVh1) >= Tvh1)
Tvh0 ActiveFracHigh = true
endif
Tvh1 // Handle starting timers for low voltage
if (theVolt >= Vl1) // Use Timers to see if completely tripped
Simulation Inputs ActiveTimerVl1 = false if (not ActiveTripLow) and ActiveTimerVl0 and ((TheTime - TimeBelowVl0) >= Tvl0)
theVolt elseif (not ActiveTimerVl1) ActiveTripLow = true
theTime ActiveTimerVl1 = true endif
TimeBelowVl1 = TheTime if (not ActiveTripHigh) and ActiveTimerVh0 and ((TheTime - TimeAboveVh0) >= Tvh0)
Results endif ActiveTripHigh = true
Vlmult endif
Vhmult if (theVolt >= Vl0) // keep track of the minimum and the maximum voltage found after Fractional timers expire
ActiveTimerVl0 = false if (Vmin > theVolt) and ActiveFracLow
elseif (not ActiveTimerVl0) Vmin = theVolt
Following Vl1 ddd DDD Vh1
Variables are
ActiveTimerVl0 = true if Vmin < Vl0 1.0
TimeBelowVl0 = TheTime Vmin = Vl0 CCC
internal to the endif endif ccc EEE
model eee Vmax
endif Vmin BBB
Numbers // Handle starting timers for high voltage if (Vmax < theVolt) and ActiveFracHigh
bbb
if (theVolt <= Vh1) Vmax = theVolt
Vmin
0.0 aaa AAA
ActiveTimerVh1 = false if Vmax > Vh0
Vmax Vmax = Vh0 0.0
Initialization Numbers elseif (not ActiveTimerVh1) Vl0 Vh0
ActiveTimerVh1 = true endif
Vmin = Vl1 endif
Vmax = Vh1 TimeAboveVh1 = TheTime
endif // Calculate the Low Voltage multiplier
Timers if (theVolt <= Vl0) or ActiveTripLow
TimeBelowVl1 if (theVolt <= Vh0) Vlmult = 0.0 // aaa
TimeAboveVh1 ActiveTimerVh0 = false elseif (theVolt <= Vl1) and (theVolt > VMin) and ActiveFracLow
TimeBelowVl0 elseif (not ActiveTimerVh0) Vlmult = ((Vmin - Vl0) + Vrfrac * (theVolt - VMin)) / (Vl1 - Vl0) // bbb
TimeAboveVh0 ActiveTimerVh0 = true elseif (theVolt <= Vl1)
TimeAboveVh0 = TheTime Vlmult = (theVolt - Vl0) / (Vl1 - Vl0) // ccc
Boolean endif elseif (not ActiveFracLow)
(Initialize all Booleans to Vlmult = 1.0 // ddd
else
FALSE)
Vlmult = ((Vmin - Vl0) + Vrfrac * (Vl1 - Vmin)) / (Vl1 - Vl0) // eee
ActiveTimerVl1
endif
ActiveTimerVh1
ActiveFracLow // Calculate the High voltage multiplier
ActiveFracHigh if (theVolt >= Vh0) or ActiveTripHigh
ActiveTimerVl0 Vhmult = 0.0 // AAA
ActiveTimerVh0 else if (theVolt >= Vh1) and (theVolt < VMax) and ActiveFracHigh
ActiveTripLow Vhmult = ((Vmax - Vh0) + Vrfrac * (theVolt - VMax)) / (Vh1 - Vh0) // BBB
ActiveTripHigh elseif (theVolt >= Vh1)
Vhmult = (theVolt - Vh0) / (Vh1 - Vh0) // CCC
elseif (not ActiveFracHigh)
Vhmult = 1.0 // DDD
else
Vhmult = ((Vmax - Vh0) + Vrfrac * (Vh1 - Vmax)) / (Vh1 - Vh0) // EEE
endif
Calculation of Iqmax, Iqmin, Ipmax, and Ipmin
The values of Iqmax, Iqmin, Ipmax, and Ipmin are updated at the if (PqFlag = 0)
Iqmax = Imax
beginning of each time step. They are a function of the following. Ipmax = sqrt(sqr(Imax) - sqr(IqCMD_LastTimeStep))
1. Imax input parameter else
Ipmax = Imax
2. PqFlag integer input parameter Iqmax = sqrt(sqr(Imax) - sqr(IpCMD_LastTimeStep))
3. TypeFlag integer input parameter endif
4. Ipcmd at last timestep Iqmin = -Iqmax
if TypeFlag = 0
5. Iqcmd at last timestep Ipmin = -Ipmax
Pseudo-code for this logic s shown on the right. else
Ipmin = 0
endif
Clarification on the meaning of Vmin (and Vmax) Blue Line represents the
Vmin is initialized to Vl1. The value of Vmin will not then change until after the timer Tvl1 expires. Vmin time-varying voltage trace
Multiplier
tracks the lowest value of voltage (state 1) after the Tvl1 timer has expired. As an example, consider the 1.0
blue line to the right representing a hypothetical time varying voltage tracing down the curve to VminA,
then recovering up to Vr, then tracing back down to VminB at which time the timer Tvl1 expires. The Tvl1 time
expires
value of Vmin is thus set to VminB at the moment the timer expires. The voltage may have gone lower
earlier in the simulation (such as down to VminA), but this does not matter. The value of Vmin is not
tracked until after the timer expires.

Implementation of the rate limit for dPmin and dPmax


The rate limit dPmin and dPmax are implemented using single time step integrator as follows.
dPmax 0.0
Voltage
dPmax Vl0 VminB Vr Vl1
+ 1 VminA

8 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 ∗ 𝑠𝑠 8
dPmin − dPmin

Implementation of the PI controller with non-windup limits


When (Kpg <> 0) and (Kig <> 0), then the non-windup PI control is implemented using the following block diagram.
𝑚𝑚𝑚𝑚𝑚𝑚 𝑚𝑚𝑚𝑚𝑚𝑚
+
𝐾𝐾𝑝𝑝 ∑
𝐾𝐾𝑖𝑖
𝐾𝐾𝑝𝑝 + + 𝑚𝑚𝑚𝑚𝑚𝑚
𝑠𝑠
1
𝐾𝐾
𝑚𝑚𝑚𝑚𝑚𝑚 1 + 𝑝𝑝 𝑠𝑠
𝐾𝐾𝑖𝑖

Implementation of the rrpwr Rate Limit


The parameter rrpwr represents an absolute value rate limit. It applies in the direction of the present sign of Ip. Thus it can be written as follows
If Ip >= 0 then Rup = +abs(rrpwr) Else Rup = +Infinity
If Ip <= 0 then Rdown = -abs(rrpwr) Else Rdown = -Infinity

You might also like