You are on page 1of 6

1

A Renewable Energy Integration Application in a


MicroGrid Based on Model Predictive Control
Jingran Ma, Student Member, IEEE, Fang Yang, Member, IEEE, Zhao Li, Member, IEEE,
and S. Joe Qin, Fellow, IEEE
AbstractThis paper investigates the application of model
predictive control (MPC) method in a MicroGrid with distributed
energy resources (DERs), including distributed generators, ener-
gy storage and demand response to achieve higher penetration
of renewable energy. A MicroGrid is an aggregation of network
that is connected to a centralized grid and can be operated
autogenously. MPC utilizes a simulation model to make decisions
on the amount of power that the MicroGrid should draw from
the connected main grid and each DER respectively, in a way that
the economical cost is minimized and all operational constraints
are satised. The potential of MPC is shown by simulations on
an IEEE test feeder modeled on the OpenDSS simulator.
Index TermsMicroGrid, renewable energy, model predictive
control, simulation, OpenDSS
I. INTRODUCTION
M
OST of the worlds electricity system was built over
the last 40 to 60 years, so the aging electricity in-
frastructure is inefcient and increasingly unreliable. The
electric system continues to be operated in the same way for
decades while new technologies have signicantly changed the
other industrial sectors. During high-demand period, utilities
companies typically rely on fast and exible coal and gas-
red power stations, which are expensive and polluting. The
penetration of renewable energy is still limited and the electric
system still relies heavily on the fossil energy sources. In
order to reach a low carbon economy and deal with aging
infrastructure and climate change, a strategic transformation
of the electricity system is urgently required.
Thanks to the deregulation processes and implementation of
incentives in the energy sector, the usage of small distributed
energy resources (DERs) has recently received considerable
attention. There are two types of DER in general: conventional
dispatchable distributed generation (DG) and non-dispatchable
DG based on renewable energy sources, such as wind, solar
and geothermal power. The economical and environmental
benets of integrating renewable energy into power systems
have been clearly demonstrated [1]. On the other hand, to
increase the penetration of intermittent energy resources which
feature unpredictable behavior has become one of the biggest
challenges in smart grid.
J. Ma is with the Department of Chemical Engineering and Materials
Science, University of Southern California, Los Angeles, CA, 90089 USA,
During this work, he was a research intern with ABB US Corporate Research
Center, Raleigh, NC. e-mail: jingranm@usc.edu.
F. Yang and Z. Li are with ABB US Corporate Research Center, Raleigh,
NC, 27606 USA e-mail: {fang.yang},{zhao.li}@us.abb.com.
S. J. Qin is with the Department of Chemical Engineering and Materials
Science and Department of Electrical Engineering, University of Southern
California, Los Angeles, CA, 90089 USA e-mail: sqin@usc.edu.
Utility Grid
MicroGrid Central MicroGrid Central
Controller (MGCC)
MicroGrid
MC MC LC LC
DG / Microsources Controllable Loads
Fig. 1. Schematic diagram of a typical MicroGrid
Microgrids are increasingly being viewed as a means
to promote the deployment of DER, meanwhile improving
system reliability at the distribution level [2], [3]. Formed
by a cluster of loads, small scaled generation units and/or
distributed energy storages, MicroGrids can be operated in
grid-connected or isolated-island mode, with the expectation
to provide uninterrupted power supply to the loads. DERs
located near local loads can offer improved reliability and
higher energy quality, if they are properly operated [4], [5]. A
typical MicroGrid structure is illustrated in Fig. 1.
The MicroGrid Central Controller (MGCC) is one of the
most critical components in a MicroGrid architecture [6]. It
controls the connection to the main grid, manages controllable
loads and optimizes system operation based on information of
power quality requirement, energy cost, demand-side requests
and special grid needs etc. It determines the amount of power
that the MicroGrid should draw from the main grid and
from each local DER respectively. The optimal (or near-
optimal) decisions of power dispatch are made in a way that
certain objectives are achieved, while a number of operational
constraints need to be satised [7], [8]. In particular, the
problem becomes more complicated if the generation capacity
of renewable energy sources is signicant, which asks for
advanced modeling, optimization and control techniques [9].
In this work, applying model predictive control (MPC)
methodology to the renewable energy integration problem in
978-1-4673-2729-9/12/$31.00 2012 IEEE
2
Past Future
y
max
y
Prediction horizon
y
min
u
max
Measured
Predicted
Control horizon
max
Current move
Control horizon
k k+1 k+2

k+N
p
k+N
c
u
min
Fig. 2. Basic MPC scheme
MicroGrids is explored. MPC has been shown as a successful
approach by numerous industrial applications [10]. It is es-
sentially an optimization based strategy in which a prediction
model is employed to predict the behavior of the controlled
plants over a nite receding horizon over future [11]. As
shown in Fig. 2 [12], in each discrete time step an open-
loop optimal control problem is formulated by measured and
predicted inputs/outputs under certain objective function. In
the optimal solution, only the control action for current time
step will be implemented on the plant. This routine is repeated
in subsequent intervals with new measurements and updated
plant information.
Modeling and optimization are two crucial components
of MPC implementations. Given that short-term forecasting
methods for renewable energy resource output have been
extensively studied [13], [14], the scope of this paper is
to demonstrate the effectiveness of MPC with a simulation-
based model in solving the economic dispatch problems for
MicroGrids with intermittent DGs. MPC is technically favor-
able because it naturally incorporates prediction models and
constraints that can ensure the MicroGrid running along the
desired path.
The reminder of this paper is organized as follows. Section
II introduces the project structure. MPC problem formulation
is described in section III. Section 4 introduces the OpenDSS
simulator and shows the simulation results conducted on it.
The nal section concludes the paper.
II. SYSTEM STRUCTURE
In this work, a simplied MicroGrid model with conven-
tional dispatchable DGs, wind and solar generators, energy
storages and a single bus connected to the distribution substa-
tion is studied. The project system structure is illustrated in
Fig. 3.
Load Shape
Predictions
Generation
Forecasts
(Wind, Solar)
MicroGrid
(OpenDSS)
Prediction
Noise
MPC
(Matlab)
Electricity cost
Power loss
(Objectives)
Power flow
(Constraints)
Fig. 3. Project block diagram
Although not in the scope of this study, modeling the
intermittent behaviors of DERs and load forecasting play im-
portant roles in the success of MPC implementation. Utilizing
historical data les of wind and solar outputs, we suppose
the difference between the predicted and actual DER outputs
is a white noise sequence. The load proles are assumed
to be following certain pattern. An optimization problem is
formulated over the moving horizon for minimizing the total
electricity generation cost. The optimal control actions are
obtained by MPC controller out of this optimization with
several constraints, and sent to the MicroGrid model before
proceeding to the next time step.
The Microgrid is modeled in the OpenDSS simulation
platform and its specic conguration is described in the
section IV-A.
III. MPC PROBLEM FORMULATION
Based on the general MPC approach, the problem for
maximizing the penetration of renewable energy resources,
in other words, optimizing the generation cost (because the
power generated by local renewable DGs is much cheaper than
demanding from the main grid), is formulated in this section.
A. Objective Function
The length of prediction horizon N
p
and control horizon
N
c
are set to be identical, i.e. N
p
= N
c
= N. The time step
for each interval is denoted as t. At the current time step k,
the objective function to be optimized accounts for the total
generation cost in the prediction horizon, as Eq.(1).
min
U
F(U, k) =
k+N1

t=k
(C
g
(t) +

m
C
cg,m
(t)) (1)
where C
g
(t) is the generation cost from the main grid, and
is proportional to the power demand P
g
(t). C
cg,m
(t) is the
cost of the mth conventional distributed generator in the Mi-
croGrid, which is usually expressed as a quadratic polynomial
with respect to its power outputs P
cg,m
(t).
C
g
(t) = b
g
(t)P
g
(t)t (2)
C
cg,m
(t) = a
m
+b
m
P
cg,m
(t)t +c
m
(P
cg,m
(t)t)
2
(3)
Note that in Eq.(2), b
g
(t) is a time varying cost coefcient,
indicating the rate depends on time-of-use.
3
The decision variable in Eq. (1) U is a vector containing
control actions in the entire control horizon,
U(t) =

u(k)
T
u(k + 1)
T
u(k +N 1)
T

T
(4)
For any single time step, the control signal u(t) includes
power outputs of all controllable generators as well as energy
storages. For simplicity, it is assumed only one conventional
generator and one energy storage in the MicroGrid.
u(t) = [P
g
(t) P
cg
(t) P
es
(t)]
T
(5)
where P
g
(t), P
cg
(t) and P
es
(t) denote the power from main
grid, conventional DG and energy storage, respectively.
B. Constraints
The optimization problem subjects to the following con-
straints for t [k, k +N 1].
1) Real power balance:
P
g
(t) +P
cg
(t) +P
es
(t) =

P
l
(t)


P
r
(t)

P
loss
(t) (6)
where

P
l
(t) and

P
loss
(t) are the forecasts of total loads and
real power losses respectively.

P
r
(t) is the predicted output
from renewable energy resources, such as wind and solar
generators.
2) Physical capacity: The power generated by each con-
trollable generator should be within its maximum capacity.
P
cg
(t) P
cg,max
(7)
Since all loads must be energized, there is no constraint
imposed on P
g
. As an isolated MicroGrid is studied, the supply
capacity of the main electricity grid can be treated as innite
large.
The energy storage has its maximum rates in both charging
and discharging modes. The stored energy in energy storage
W
es
(t) should be below its rated kWh value. Only steady-state
behavior of energy storages is considered here.
P
es char,max
P
es
(t) P
es disc,max
(8)
0 W
es
(t) W
es,max
, t = k + 1, k + 2, , k +N (9)
W
es
(t + 1) = W
es
(t) P
es
(t) t, (10)
3) Power ow equations: A feasible control action should
satisfy the power ow equations. The voltage magnitude and
angle at each bus can be determined by he well-known
Newton-Raphson method. From the complex power balance
equation at bus i (non-slack bus),
S
i
= P
i
+jQ
i
= V
i

k
Y

ik
V

k
(11)
Resolving into the real and imaginary parts, the mismatch
equations are
P
i
= P
i
+

k
|V
i
||V
k
|(G
ik
cos(
ik
) +B
ik
sin(
ik
)) (12)
Q
i
= Q
i
+

k
|V
i
||V
k
|(G
ik
sin(
ik
) B
ik
cos(
ik
))
(13)
where G
ik
and B
ik
are the corresponding elements of the
system nodal admittance matrix Y

. The system Jacobian


matrix is factorized as
J =

P
|V |
P

Q
|V |
Q

(14)
The initial guess of unknown |V
i0
| and
i0
is usually made
as a at start in which all voltage magnitudes are set to 1.0
p.u. and all voltage angles are set to zero. The power ow
solution can be obtained by the following iterations,
|V |
m+1
= |V |
m
+ |V |

m+1
=
m
+
(15)
where the incremental guess is given by

|V |

= J
1

P
Q

(16)
The iteration continues until a termination criterion is
reached, e.g. the norm of P and Q are below specied
thresholds.
It should be noted that in this work, the realization of the
power ow equations is through the use of the OpenDSS simu-
lator, instead of being explicitly formulated in the optimization
scheme. Doing this in practice may bring problem because
in iterations it requires considerable time and computational
cost to run the simulator many times. Therefore, system
identication technique is usually employed to obtain input-
output models out of experimental data, i.e. the work in [15].
4) Voltage limit: In the converged power ow solutions,
all bus voltages need to be maintained within permitted range.
Typically, the range of [V
min
, V
max
] = [0.95, 1.05] in p.u. value
can ensure normal system operations.
V
min
V
i
(t) V
max
(17)
Note that in a practical application there should also be
constraints on current, i.e., I
i
(t) I
rated,i
(t). For simplicity
and the lack of rated current parameters, the current constraints
are not included in the optimization.
IV. SIMULATION STUDIES
The Matlab optimization toolbox is used to solve this
nonlinear constrained optimization problem in the above sec-
tion using interior point algorithm. Matlab and OpenDSS are
integrated to a co-simulation scheme, where Matlab takes
charge optimization and control, and OpenDSS simulates the
distribution network.
A. OpenDSS Simulator
The OpenDSS (Open Distribution System Simulator, used
version 7.4) is developed by Electric Power Research Institute
(EPRI) as a comprehensive open-source simulation tool for
electric utility distribution systems [16]. It aims at providing
a exible research platform and a foundation for special
distribution applications such as DG analysis. It can be used
as either a stand-alone executable program or an in-process
COM server to be driven from external software programs.
4
Wind farms
Energy storage
Distributed generator
Solar photovoltaics
Distributed generator
Fig. 4. Modied IEEE 13 node test feeder
1) IEEE 13 node system: The IEEE 13 node radial test
feeder system which is one of the benchmark systems in the
OpenDSS software package, is selected as the testing system
for this work. It is a three-phase unbalanced system, whose
parameter specication and power ow for the base case can
be retrieved from [17]. Originally there is no DG installed in
the network. Additional DSS scripts as described in Appendix
A are added to the feeder model for modication as shown in
Fig. 4. There are two capacitors installed at bus 675 (3 phases)
and 611.C and a load locates at the bus 670 invisible in Fig.
4, which is connected between bus 632 and 671.
2) Distributed generators: As shown in Fig. 4, one conven-
tional dispatchable distributed generator, one wind generator
and one solar generator are added to the system, specifying
their rated capacities and the buses to which they are connect-
ed. The conventional DG output in kW P
cg
is to be passed by
the controller in Matlab in each time step. The wind and solar
generator daily outputs would follow the multiplication of
rated kW values and duty schedules generated from historical
data les. Wind output is essentially a stochastic disturbance
and solar power contributes only during day time.
3) Energy storage: In OpenDSS, the energy storage ele-
ment is essentially treated as a special class of generator that
can be designated to either produce power (in discharging
mode) or consume power (in charging mode) with its power
rating and stored energy capacity.
The working mode of energy storage is set as discharg-
ing/charging depending on the positive/negative sign of the
demanded power P
es
(t), and the discharging/charging rate in
kW (|P
es
(t)|) is passed from Matlab to the OpenDSS model
in each time step.
The energy storage module is used in a snapshot mode to
compute the power ow for a deterministic state. This means
that its dynamic transient behavior is not considered at present.
The default value of 90% for both charging and discharging
efciency is applied, making a nominal round trip efciency of
81%. The energy storage is placed at the center of MicroGrid,
with the hope to conveniently compensate for short term power
0 3 6 9 12 15 18 21 24
0
0.2
0.4
0.6
0.8
1
1.2
Time (hr)
L
o
a
d

L
e
v
e
l
Fig. 5. Load level daily schedule
variations caused by intermittent generations.
4) Load schedule: A loadshape object is dened for varying
loads in OpenDSS to carry out real-time simulations. The load
schedule is stored in a data set, as shown in Fig. 5. The level
indicates the ratio of current and maximum load. White noise
with standard deviation of 0.025 is added to the load level to
account for the load estimation error.
B. Simulation Results
A 24 hour simulation is conducted on the MicroGrid model
described above. The length of prediction horizon is set as
4, meaning an one-hour ahead prediction is applied. The
contribution to loads from each energy source is shown in
the stacked graph as Fig. 6. Power from main grid follows
the load variation because the main grid is treated as a swing
source. Conventional distributed generator and energy storage
are used as auxiliary resources to maintain the power balance
and as assets to optimize the total generation costs. It can be
seen that the conventional DG is mainly utilized during the
peak hours (8 : 00 18 : 00) when higher price is applied
to the grid power. The behavior of energy storage is subject
to a slow-charging fast-discharging pattern, which allows it to
compensate to unpredictable change of renewable outputs and
avoid sacricing the power stability.
An ordinary control strategy is implemented to compare
with MPC, in which no prediction effect is incorporated. The
controller makes decision to achieve minimum cost only based
on the current measurements. The total electricity generation
cost is shown in Fig. 7. The advantage of MPC appears
from 8 a.m. the generation cost begins to increase, showing
the capability of MPC to foresee the price change and take
appropriate actions in advance.
Fig. 8 shows the bus voltages in the MPC test. The voltages
are repeatedly measured after the convergence of power ow
in each time step with under the control inputs given by MPC.
All bus voltages are within the feasible region showing that
the voltage constraints are always satised.
5
Time (hr)
P
o
w
e
r

o
u
t
p
u
t

(
k
W
)


3 6 9 12 15 18 21 24
0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
Energy Storage
Solar Power
Wind Power
Conventional DG
Main Grid
Fig. 6. Generation output proles under MPC
0 3 6 9 12 15 18 21 24
1
2
3
4
5
6
7
Time (hr)
C
o
s
t

(
1
0
3
$
)


Ordinary
MPC
Fig. 7. Generation cost comparison between ordinary control strategy and
MPC
V. CONCLUSIONS AND FUTURE WORK
In this paper, we studied the renewable energy integration
problem in a MicroGrid taking advantage of MPC method.
With a prediction model embedded, MPC is capable of re-
ducing the generation cost over a future horizon. A number
of constraints can be naturally satised to ensure the power
quality and network stability.
In a co-simulation framework, Matlab optimization tool-
box is used to solve the nonlinear optimization problem
and OpenDSS is the platform to simulate virtual distribution
system model with renewable energy resources and energy
storage installed.
The demonstrating work can be continued and extended in
the following directions:
1) Although modeling for the wind and solar generators is
not the focus of this work and we assume accurate models
are available by certain techniques, incorporating the forecast
models that are not built from historical data to optimization
in MPC is still challenging.
2) In addition to steady-state, taking in to account dynamic
behavior of devices such as energy storages is of signicance.
650 633 634 671 645 692 675 611 652 670 632 680 646
0.9
1
1.1
Phase A
V
o
l
t
s

(
p
u
)
650 633 634 671 645 692 675 611 652 670 632 680 646
0.9
1
1.1
Phase B
V
o
l
t
s

(
p
u
)
650 633 634 671 645 692 675 611 652 670 632 680 646
0.9
1
1.1
Phase C
V
o
l
t
s

(
p
u
)
Node number
Fig. 8. Bus voltage distribution measured after convergence of each power
ow calculation
3) Due to the complexity of power ow equations, the
optimization cannot be readily formulated as a programming
problem that can be analytically solved. Therefore, the non-
linear optimization executed by the Matlab built-in functions
usually gives local optima and it requires a deep look into the
iterations to track the searching trajectory of optimal solutions.
APPENDIX A
OPENDSS SCRIPTS TO MODIFY IEEE TEST FEEDER
A. Distributed Generators
! 24HOURS SOLAR RAMP SCREEN
New Loadshape.SolarRamp npts=96 Interval=(1 4 /)
mult= (le= SolarRamp.csv)
! 24HOURS WIND OUTPUT SCREEN
New Loadshape.WindRamp npts=96 Interval=(1 4 /)
mult= (le= WindRamp.csv)
! GENERATOR DEFINITIONS
New Generator.ConGen Bus1=680.1.2.3 Phases=3 kV=4.16 pf=1 Model=1
New Generator.SolarGen Phases=2 Bus1=684.1.3 kV=4.16 kW=300 PF=1
Duty=SolarRamp
New Generator.WindGen Phases=2 Bus1=646.2.3 kV=4.16 kW=300 PF=1
Duty=WindRamp
B. Energy Storage
! ENERGY STORAGE DEFINITION
New Storage.ES1 Phases=3 Bus1=632 kV=4.16 kWRated=100
kWhRated=200 stored=50
C. Load Schedule
! LOADSHAPE DEFINITION
New Loadshape.LoadSchedule npts=96 Interval=(1 4 /)
mult= (le= LoadSchedule.csv)
! LOAD DEFINITION
New Load.675a Bus1=675.1 Phases=1 Conn=Wye Model=1 kV=2.4
kW=485 kvar=190 Duty=LoadSchedule
6
ACKNOWLEDGMENTS
The authors would like to thank Dr. Xiaoming Feng, Dr. Vaibhav Donde,
James Stoupis and Xianda Deng for their valuable help and comments.
REFERENCES
[1] X. Liu and B. Su, Microgrids: an integration of renewable energy tech-
nologies, in China International Conference on Electricity Distribution,
(CICED), 2008.
[2] B. Lasseter, Microgrids [distributed power generation], in IEEE Power
Engineering Society Winter Meeting, 2001, pp. 146149.
[3] R. Lasseter, A. Abbas, C. Marnay, J. Stevens, J. Dagle, R. Guttromson,
A. S. Meliopoulos, R. Yinger, and J. Eto, Integration of distributed
energy resources: The certs microgrid concept, California Energy
Commission, P500-03-089F, oct. 2003.
[4] R. Yokoyama, T. Niimura, and N. Saito, Modeling and evaluation of
supply reliability of microgrids including pv and wind power, in IEEE
Power and Energy Society General Meeting, july 2008.
[5] A. Tsikalakis and N. Hatziargyriou, Centralized control for optimizing
microgrids operation, in IEEE Power and Energy Society General
Meeting, july 2011.
[6] S. Mohagheghi and F. Yang, Applications of microgrids in distribu-
tion system service restoration, in IEEE PES Innovative Smart Grid
Technologies (ISGT), jan. 2011.
[7] A. Hawkes, Optimal selection of generators for a microgrid under
uncertainty, in IEEE Power and Energy Society General Meeting, july
2010.
[8] D. Olivares, C. Canizares, and M. Kazerani, A centralized optimal
energy management system for microgrids, in IEEE Power and Energy
Society General Meeting, july 2011.
[9] S. Lu, M. Elizondo, N. Samaan, K. Kalsi, E. Mayhorn, R. Diao, C. Jin,
and Y. Zhang, Control strategies for distributed energy resources to
maximize the use of wind power in rural microgrids, in IEEE Power
and Energy Society General Meeting, july 2011.
[10] S. J. Qin and T. A. Badgwell, A survey of industrial model predictive
control technology, Control Engineering Practice, vol. 11, no. 7, pp.
733764, 2003.
[11] C. V. Rao and J. B. Rawlings, Linear programming and model
predictive control, Journal of Process Control, vol. 10, no. 2-3, pp.
283289, 2000.
[12] A. Bemporad, M. Morari, and N. L. Ricker, Model Predictive Control
Toolbox Users Guide, Mathworks, Inc., 2011.
[13] S. Kennedy, Reliability evaluation of islanded microgrids with stochas-
tic distributed generation, in IEEE Power and Energy Society General
Meeting, july 2009.
[14] L. Xie and M. Ilic, Model predictive economic/environmental dispatch
of power systems with intermittent resources, in IEEE Power and
Energy Society General Meeting, july 2009.
[15] J. Ma, S. J. Qin, B. Li, and T. Salsbury, Economic model predictive
control for building energy systems, in IEEE PES Innovative Smart
Grid Technologies (ISGT), jan. 2011.
[16] R. Dugan and T. McDermott, An open source platform for collaborating
on smart grid research, in IEEE Power and Energy Society General
Meeting, july 2011.
[17] D. T. F. W. Group, IEEE 13 Node Test Feeder, IEEE PES Distribution
System Analysis Subcommittee, 2001.
Jingran Ma received his B.S. and M.S. degree in Automatic Control from
Tsinghua University in Beijing, China, in 2006 and 2008, respectively. He
is currently a Ph.D. candidate in Chemical Engineering at the University of
Southern California, Los Angeles, CA. His research interests include building
energy efciency, power system modeling and control, model predictive
control and system identication.
Fang Yang is a Sr. R&D engineer with ABB US Corporate Research
Center in Raleigh, North Carolina. Her research interests include distribution
automation, power system reliability analysis, and application of articial
intelligence techniques in power system control.
Zhao Li joined ABB Corporate Research in Raleigh, North Carolina in 2007,
where he is currently a Software Architect. His research interests include the
application of software technologies in process automation and power systems,
performance analysis, and information system design and tuning.
S. Joe Qin is the Fluor Professor at the Viterbi School of Engineering at
University of Southern California and Chang Jiang Professor afliated with
Tsinghua University by the Ministry of Education of China. Prior to joining
USC he held the Paul D. and Betty Robertson Meek and American Petrona
Foundation Centennial Professorship in Chemical Engineering at University of
Texas at Austin. He obtained his B.S. and M.S. degrees in Automatic Control
from Tsinghua University in Beijing, China, in 1984 and 1987, respectively,
and his Ph.D. degree in Chemical Engineering from University of Maryland
at College Park in 1992. Dr. Qins research interests include process control,
model predictive control, process monitoring, fault detection and diagnosis,
control performance monitoring, process optimization, semiconductor process
optimization, system identication and building energy efciency.