MG in DSS Thesis
MG in DSS Thesis
BY
CHRISTOPHER G. SAIN
THESIS
Urbana, Illinois
Adviser:
ii
For Booster, my most loyal friend.
iii
ACKNOWLEDGMENTS
I would like to thank my advisor, Professor Peter W. Sauer, for his guidance,
support, and wealth of knowledge over the course of my master’s study. I
would also like to thank Professor Alejandro D. Domı́nguez-Garcı́a and the
members of the ARPA-E NODES group for their assistance and dedication
during my time working with them. Finally, I would like to thank all my
family and friends who helped and supported me along the way.
iv
TABLE OF CONTENTS
LIST OF TABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
CHAPTER 1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . 1
1.1 Literature Survey . . . . . . . . . . . . . . . . . . . . . . . . . 2
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
v
LIST OF TABLES
vi
LIST OF FIGURES
vii
LIST OF ABBREVIATIONS
viii
CHAPTER 1
INTRODUCTION
When simulating power systems for research applications, often there arises
the need for simulation tools that are not necessarily in the scope of the
problem. For example, when attempting to test a system’s response to a
control algorithm, the researcher requires a system on which to apply the
control scheme. It would be valuable to have a system model already created
that was made available for such purposes. The topic of this thesis is to
create such a model.
In particular, the goal is to create a “plug-and-play” model of a microgrid
which may be used to test the efficacy of control algorithms under develop-
ment. Because of the close ties between the University of Illinois at Urbana-
Champaign (UIUC) and Ameren Illinois, the microgrid to be modeled is
based upon Ameren’s Technology Applications Center (TAC) microgrid [1],
located next to the university. This model will be used by the NODES group
in the Power and Energy Systems area at UIUC, in support of ongoing re-
search into distributed control algorithms for distributed energy resources
(DERs).
The simulation framework chosen for this model is OpenDSS, developed
by the Electric Power Research Institute (EPRI). This software was chosen
for several reasons.
1. It is free and open source, making the model easily transferred, modi-
fied, and updated as needed.
1
4. It does not implement full dynamic modeling natively, allowing for a
lighter load on computation resources and fast solution convergence.
2
fects of high-penetration levels of photovoltaics into the grid, and how they
can cause problematic voltage conditions around the interconnections. The
models attempt to take into account variations of residential and commer-
cial loads and how different control schemes may assist in mitigating the
over/undervoltage events at the interconnections. This includes Volt/VAR
and Volt/Watt control, as well as the introduction of battery storage units
into the network.
The authors of [6] describe their use of OpenDSS in real-time hardware-
in-the-loop (HIL) studies similar to those that constitute the subject of this
thesis. They use their HIL system to simulate their controls and FPGA hard-
ware for the IEEE 13-bus test feeder, while supplementing their simulation
with OpenDSS to simulate power flow in their distribution system. However,
their OpenDSS simulation differs from the topic of this thesis in that it is
not a microgrid; it is a standard distribution system with a substation and
load buses, lacking generation and storage capabilities.
The authors of [8–10] use OpenDSS and a similar distribution framework,
GridLAB-D, to model active distribution networks (ADNs) independent of
other simulations. The simulations run in these studies are an attempt to
use the various DERs to dynamically maintain power balance and optimize
generator cost. Particularly, they emphasize control of storage resources and
load shaping.
The great advantage of OpenDSS, evident in the current applications, is its
flexibility to be applied effectively in different programming environments.
Among the mentioned papers are OpenDSS implementations in Matlab,
Python, C/C++, Pascal, and even Microsoft Excel. The literature highlights
the co-simulation capability of the simulation framework, one of the chief
reasons it was chosen for this application.
3
CHAPTER 2
THE MICROGRID
4
Figure 2.1: One-line diagram of the microgrid to be modeled
5
2.2 Generators and Storage
The microgrid contains a total of four energy resources: solar array, wind
turbine, natural gas generator, and lithium-ion battery storage. The two DC
sources (solar and battery) are each connected to inverters, producing 480 V.
The wind turbine and gas generators each produce power at 480 V as well.
The generators and their respective parameters are tabulated in Table 2.1.
2.3 Transformers
There are a total of 7 transformers in the system. Their parameters are
outlined in Table 2.2 (note that the superscripts P and S refer to “primary”
and “secondary”, respectively). As mentioned previously, the transformer
responsible for the neighborhood connection is a tap-changing-under-load
(TCUL) transformer, acting as a voltage regulator for the neighborhood bus.
For the sake of this model, the tap changer was set to monitor the voltage
on phase C of the load bus (chosen arbitrarily). Because load magnitudes
are reasonably balanced in the testing scenarios presented, this single-phase
monitoring is sufficient to control the voltage.
6
Table 2.2: Transformer Parameters
7
CHAPTER 3
MODELING IN OPENDSS
3.1 Buses
The OpenDSS framework requires the explicit enumeration of buses in the
system. Each element must be connected to one or more buses, depending
on the element type. A complete list of buses is shown in Table 3.1.
B GRID 69k
B SUB 12.47k
B SOLAR 480
B WIND 480
B BATT 480
B GAS 480
B CONTR 208
B NEIGHB 208
These buses form the framework of the model. Every element within the
network is connected to one or more buses either directly or through a dis-
tribution line.
3.2 Lines
There are 10 transmission lines in the network. They are modeled based upon
per-unit-length impedance taken from the EPRI Test Circuit 5 [2]. In the
network, there exists a transmission line between any two connected nodes,
8
with two exceptions. The distance between the energy resources and their
corresponding transformers was deemed negligible, and thus line impedances
between these nodes are neglected. Additionally, the 200 single-phase neigh-
borhood loads are not all individually connected via separate lines. The
transmission line traveling from the substation to the neighborhood is mod-
eled, whereafter all the loads are connected directly to its termination, with
no final “line-to-home” impedance. Line connections and parameters includ-
ing per-unit-length impedance at 60 Hz are detailed in Table 3.2.
Ω Ω nF
Line Conn 1 Conn 2 L [km] R [ km ] X [ km ] C [ km ]
9
standard power flow equations [12].
N
X
Pk = |Vk ||Vj | (Gkj cos (θk − θj ) + Bkj sin (θk − θj )) (3.1)
j=1
N
X
Qk = |Vk ||Vj | (Gkj sin (θk − θj ) − Bkj cos (θk − θj )) (3.2)
j=1
Here Pk and Qk are the net real and reactive powers injected at bus k, and
Gkj and Bkj are the real and imaginary components of the kj entry in the bus
admittance matrix. OpenDSS calculates the admittance matrix and solves
the equations.
Using this ideal model, a preliminary no-load simulation was run to ensure
the proper setup of the model. In this scenario, the DERs were assigned
arbitrary outputs, in keeping with the PV nature of the model. These outputs
were varied 5 times, with OpenDSS simulating the network behavior after
each variation. Figures 3.1 and 3.2 show the per-phase real generation and
tie-line voltage for this simulation.
10
Figure 3.2: Tie line voltage in preliminary test
This initial no-load simulation shows that the model does seem to be work-
ing as intended, with the generators causing voltage effects on the tie-line (the
expected increase in generation causing an increase in voltage). However, the
changes to the system are instantaneous and not reflective of real-world be-
havior. To remedy this, the model was refined with the goal of successfully
simulating an “normal” day in central Illinois.
11
the array output [14]. Therefore the output power of the solar array given
certain environmental parameters can be calculated.
The efficiency factor for the inverters used for both the solar array and the
battery unit was taken from the California Energy Commission (CEC) ex-
perimental efficiency database matching the voltage and rated power of this
solar array [14]. The efficiency curve [14] is shown in Figure 3.3.
As shown, the AC power output of the solar array in the model will have
a maximum of ≈ 97% of its maximum output before the inverter at a given
temperature, with a minimum of ≈ 86% at lower power levels, such as during
overcast periods, or the sunrise/sunset periods. This inverter efficiency curve
is also used for the battery storage unit for simplicity.
12
3.4.2 Historical Location Data
To perform as accurate a daily simulation as possible, it is crucial to use
realistic data in setting power output levels for the sources in the system. As
such, historical environmental data from Decatur, Illinois, (approximately
50 miles southwest of Champaign), is used to calculate the outputs of the
solar and wind energy sources. This data includes temperature (T ), solar
irradiance (Ee ), and wind speed (vwind ) for July 21, 2017 [16–18]. It was
assumed for this simulation that the wind turbine is always optimally aligned
with the wind direction. The temperature and solar irradiance data for the
chosen date are shown in Figures 3.4 and 3.5.
13
Figure 3.5: Historical wind data, Decatur, IL, 07/21/2017
The solar data was fed into the model based upon Equations 3.3 and 3.4.
The wind data was used to calculate the power output of the wind turbine
using equation 3.5.
1 3
Pout = ρAvwind Cp (3.5)
2
Here ρ is the density of the air at the altitude and mean temperature of
Decatur (ρ ≈ 1.17 mkg3 ), A is the swept area of the blades (A ≈ π · 102 =
314.2 m2 given 10 m blade length). The power coefficient Cp is set to the
Betz limit of 0.59, assuming maximum efficiency of the wind turbine [19].
These power outputs were calculated for each data point and then fed to the
model.
14
on a linear combination of each shape. Using the method described in [20],
these loadshapes were determined based on the assumption that most homes
contain certain common appliances (refrigerator/freezer, electric oven/stove,
microwave oven, heating/cooling, television, lighting), while a smaller num-
ber of homes contain more “luxury” appliances (clothes washer/dryer, dish-
washer, personal computer). Note that due to the fact that the day chosen
to be simulated is July 21st , air-conditioning was assumed to be in heavy use
for most of the day. The generated load shapes are plotted in Figure 3.6.
These three shapes form the basis of the neighborhood loads. In the Mat-
lab driver, each of the 200 residential loads is formed by a linear combination
of these shapes.
Here S1 , S2 , and S3 are the load shapes, and kn1 , kn2 , and kn3 are randomly
chosen constants between 100 and 700, such that the power draw per home
lies between a maximum of 2.1 kW and minimum of 300 W [20]. These
loads are then evenly distributed across the three phases of the load bus (66
phase A, 66 phase B, and 67 phase C), in an attempt to make the system
15
quasi-balanced. The total three-phase load of the neighborhood is shown in
Figure 3.7.
16
Figure 3.8: Simulated generation, full day
17
Figure 3.10: Simulated voltage on tie-line, full day
Figure 3.8 shows the generation of all modeled sources. The renewable
sources generally follow the previously discussed curves, with the addition
18
of the sharp “turn-on” step of the solar array, taking the minimum power
capability of the attached inverter [21]. The battery storage in this case is
used in an attempt to ease the burden on the bulk grid during the heavy
power-consuming portion of the day. It charges during the low-load period
overnight, and discharges during peak hours. Figure 3.9 shows the power
exchanged with the bulk grid through the tie-line. Negative values indicate
power flowing into the microgrid, and positive values indicate power flowing
out of the microgrid. The simulation indicates that for this particular day
and with the gas generator running at 90% capacity, the microgrid both
draws power from and supplies power to the grid depending mostly upon
the demand of the neighborhood. The voltage plots in Figures 3.10 and
3.11 show that across the day, the tie-line voltage varied by approximately
0.15% and the neighborhood voltage varied by approximately 0.6%. The
voltage swings on the neighborhood bus were not enough to trigger the tap
changer (±0.625%), so it remained at the center tap for the duration of the
day. A subsequent simulation was run with artificially inflated load values
to specifically verify that the tap changer behaves as desired. The results of
that simulation are shown in Figures 3.12 and 3.13.
19
Figure 3.13: Neighborhood voltage response to artificially inflated loads
20
3.5.1 Generator Model
The synchronous generator was modeled as described in [12] in dq0 rotor-flux
reference frame. This model is outlined in the following equations.
λd = Ld id + Laf if (3.7)
λq = Lq iq (3.8)
3
λf = Laf id + Lf f if (3.9)
2
λ0 = L0 i0 (3.10)
dλd
vd = Ra Id + − ωm λq (3.11)
dt
dλq
vq = Ra iq + + ωm λd (3.12)
dt
dλf
vf = Rf if + (3.13)
dt
dλ0
v0 = Ra i0 + (3.14)
dt
3 p
Tmech = (λd iq − λq id ) (3.15)
2 2
21
Figure 3.14: Generator dynamic test
The simulation is able to take this dynamic input and show that its effects
are translated through the network. By implementing a dynamic model
22
in Matlab, some dynamics are able to be introduced into the OpenDSS
simulation.
23
CHAPTER 4
AN APPLICATION IN DISTRIBUTED
CONTROL STUDIES
As noted before, the goal of this model is to be able to insert it into other
simulations on an as-needed basis, rather than creating a bespoke model
for every single research application. This chapter presents the use of an
OpenDSS microgrid model in co-simulation with the C-HIL testbed devel-
oped at UIUC [11]. While the model used in this application is not the same
as the one used in previous chapters due to the milestone requirements of
the project, the developed simulation interface and procedure are exactly the
same; the previously described microgrid could be used to seamlessly replace
the one used here. The microgrid model used in this application was de-
veloped in cooperation with researchers at the University of California, San
Diego [11].
24
4.2 Microgrid Model
The milestone requires the use of the microgrid in use on-campus at UCSD.
This model is a radial, balanced network with 3867 nodes and 1289 buses.
Generation is handled by a combination of photovoltaic, gas, and steam
turbines. Loads are composed of buildings and electric vehicle charging sta-
tions. Because the present capability of the C-HIL testbed is 100 controllable
nodes, this model had to be reduced using the distribution feeder reduction
algorithm described in [22].
The reduced model used in this simulation contains 13 generators (10 pho-
tovoltaic) and 107 loads for a total of 120 nodes.
4.3 Simulation
Because the UIUC C-HIL testbed is only capable of simulating 100 control-
lable nodes at the present time, 20 of the microgrid nodes were held constant.
The nodes chosen were 20 load nodes. For the duration of the simulation,
these nodes consumed a constant amount of complex power.
An additional consideration had to be taken into account, as loads are
typically not controllable and there are not 100 generators in the system.
After taking the 13 generators into account, the remaining 87 controllable
nodes had to be loads. To accomplish this in simulation, these nodes were
treated as generators creating “negative” power.
25
3. Controllers update generator outputs with new setpoints
During simulation, the ISO sends its signal through Matlab via the Modbus
protocol to the controllers. After reaching consensus on the desired setpoints,
the controllers then independently update their generators. In a real-world
scenario, these controllers would be attached to their generators. In simu-
lation, they each independently (to preserve the integrity of the distributed
framework) communicate values to a separate Matlab instance via Modbus
again. This Matlab instance is the driver for the OpenDSS simulation.
After updating each node with its new output value, the OpenDSS simula-
tion is then run, recording the tie-line power exchange. This architecture is
illustrated in Figure 4.1, developed by the NODES group [11].
26
Figure 4.1: System architecture for C-HIL co-simulation
27
Figure 4.2: Simulation results for “stepped ramp” input signal
The results show the microgrid simulation output generally following the
input signal. There is a delay between the signal send time and the response,
which corresponds to the communication delay between the components of
the system, as well as the time required by the distributed controllers to
come to consensus (between 4.2 to 4.7 seconds, depending on the connection
graph of the controllers). This, however, meets the requirement of a 5-second
initial response time. The simulation shows that the power generated by the
microgrid is not exactly equal to the requested value. This error is introduced
by two sources in the model. The first is the transmission loss combined with
the constant loads present in the model. These loads are consuming some
set amount of power for the duration of the simulation, and are not taken
into account by the control scheme. The second is the transmission loss. The
power measured at the tie line is equal to the generated power (commanded
by the ISO), less the line losses from all nodes to the interconnect. These
errors could both be corrected in future simulations by factoring them into
how the updated power setpoints are calculated.
28
4.3.3 Second Experimental Scenario
The second input signal tested was the first 5 minutes of the PJM RegD wave.
The PJM interconnect is a regional transmission organization (RTO) that
operates in 13 states in the eastern United States. As part of their service,
they provide a 40-minute regulation self-test signal to aid in development
of technologies to provide ancillary support to the grid. The results of this
simulation of the first 5 minutes of the signal are shown in Figure 4.3.
Figure 4.3: Simulation results for first 5 minutes of PJM RegD signal
The goal of this scenario was to test the model’s response to a steeply
decreasing signal. Again, the results show that the controllers are able to
accurately control the tie-line power injection from the microgrid, with the
same error sources appearing as in the first test, and with some calcula-
tion/communication delay.
29
trials. The system is able to respond adequately to the input commands,
providing the requested power within the required ±5% tolerance for reserve
magnitude variability, even when not compensating for system losses and
unmodeled loads.
Figure 4.4: Simulation results for second 5 minutes of PJM RegD signal
To ensure that the requirements of the test are being met, the signal is
held constant at the end of the test, showing that the microgrid is able to
hold the ±5% magnitude variability.
These simulations confirm that the distributed control is being performed
to meet the time and accuracy requirements, and able to accurately commu-
nicate with the OpenDSS model of the real-world network. The simulation
results of the model show that the system is responding as requested, and
that, even without losses taken into account, the required metrics are still
being met.
30
CHAPTER 5
31
model and the controller architecture.
This model may be useful in many research applications, and future work
may include the following:
32
REFERENCES
33
[10] J. Ma, F. Yang, Z. Li, and S. J. Qin, “A renewable energy integration
application in a microgrid based on model predictive control,” 2012
IEEE Power and Energy Society General Meeting, 2012.
[15] Yingli Solar, “YGE 60 cell HSF smart datasheet.” [Online]. Avail-
able: http://www.yinglisolar.com/static/assets/uploads/products/
downloads/DS YGE60CELLSERIES2HSFSMART-29b 35mm EU EN
20180615 V04.pdf
[17] “Wind generation and total load in the BPA balancing authority.” [On-
line]. Available: https://transmission.bpa.gov/Business/Operations/
Wind/
34