SlideShare ist ein Scribd-Unternehmen logo
1 von 84
Downloaden Sie, um offline zu lesen
Energy Research and Development Division
FINAL PROJECT REPORT
MODELLING AND CONTROL OF
MICROGRID
Repetitive and Model Predictive Control
CEC-500-2014-OCT
Prepared for: California Energy Commission
Prepared by: UCLA
PREPARED BY:
Primary Author(s):
Kuo-Tai Teng
Sandeep Rai
Lieven Vandenberghe
Tsu-Chin Tsao
UCLA
420 Westwood Plaza
Los Angeles, Ca 90095
Phone: 310-206-2819
http://www.mae.ucla.edu
Contract Number: 500-01-043
Prepared for:
California Energy Commission
Therese Peffer
Contract Manager
Matthew Fung
Office Manager
Energy XXXXXXXX Research Office
Laurie ten Hope
Deputy Director
ENERGY RESEARCH AND DEVELOPMENT DIVISION
Robert P. Oglesby
Executive Director
DISCLAIMER
This report was prepared as the result of work sponsored by the California Energy Commission. It
does not necessarily represent the views of the Energy Commission, its employees or the State of
California. The Energy Commission, the State of California, its employees, contractors and
subcontractors make no warranty, express or implied, and assume no legal liability for the
information in this report; nor does any party represent that the uses of this information will not
infringe upon privately owned rights. This report has not been approved or disapproved by the
California Energy Commission nor has the California Energy Commission passed upon the
accuracy or adequacy of the information in this report.
i
PREFACE
The California Energy Commission Energy Research and Development Division
supports public interest energy research and development that will help improve the
quality of life in California by bringing environmentally safe, affordable, and reliable
energy services and products to the marketplace.
The Energy Research and Development Division conduct public interest research,
development, and demonstration (RD&D) projects to benefit California.
The Energy Research and Development Division strives to conduct the most promising
public interest energy research by partnering with RD&D entities, including
individuals, businesses, utilities, and public or private research institutions.
Energy Research and Development Division funding efforts are focused on the
following RD&D program areas:
β€’ Buildings End-Use Energy Efficiency
β€’ Energy Innovations Small Grants
β€’ Energy-Related Environmental Research
β€’ Energy Systems Integration
β€’ Environmentally Preferred Advanced Generation
β€’ Industrial/Agricultural/Water End-Use Energy Efficiency
β€’ Renewable Energy Technologies
β€’ Transportation
Modelling and Control of Microgrid: Repetitive and Adaptive Control is the final report for
the Enabling Technology Development project contract number 500‐01‐043 conducted
by UCLA. The information from this project contributes to Energy Research and
Development Division’s Environmentall Preferred Advanced Generation Program.
For more information about the Energy Research and Development Division, please
visit the Energy Commission’s website at www.energy.ca.gov/research/ or contact the
Energy Commission at 916-327-1551.
ii
iii
ABSTRACT
In this research, a control system that contains Model Predictive Adaptive Control and
Repetitive Control is proposed to provide superior power quality and maintain the safety of the
microgrid during islanded, grid-connected, and transition modes. First, the overall microgrid
consisting of a photovoltaic arrays, windmill, battery, and microturbine was modeled and
analyzed using computer simulations, and then a Hardware-in-the-loop simulation of the
microgrid proved the control algorthms can be implemented in hardware.
The simulation revealed four major findings. Firstly, in grid-connected mode, the DERs
in the microgrid system are decoupled with each other. Therfore, the dynamic response from
one DER will not affect the other, while the coupling effect is significant in islanded mode.
Seconly, the strong coupling effect in islanded mode can be attenuated by applying LQI control
to each DER, and then the decoupled closed-loop system enables the design of repetitive control
for each individual DER. Thirdly, the power spectrum from Hardware-in-the-loop simulation
shows that repetitive control is able to effectively suppress the 3th harmonic in the output
current and enables a smooth transistion from grid connected to islanded. Lastly, the proposed
Model Predictive Control is able to utilize the predicted renewable energy production and
predicted critical load demand to make optimal decision for controllable DERs.
Keywords: Microgrid, Repetitive control, Hardwar in the loop, LQI, harmonic rejection, Model
Predictive Control, grid transition
Tsao, Tsu-Chin; Kuo-Tai Teng; Sandeep Rai. (UCLA). 2014. Modelling and Control of
Micorgrid: Repetitive and Model Predictive Control. California Energy Commission.
Publication number: CEC-500-2014-Oct.
iv
Contents
PREFACE.....................................................................................................................................................i
ABSTRACT..............................................................................................................................................iii
List of Figures ......................................................................................................................................... vii
EXECUTIVE SUMMARY........................................................................................................................1
Introduction ............................................................................................................................................1
Project Purpose.......................................................................................................................................1
Project Results.........................................................................................................................................2
Project Benefits .......................................................................................................................................3
Chapter 1: Introduction............................................................................................................................5
Chapter 2: Modeling of the Microgrid..................................................................................................7
2.1 Single Phase Converters..................................................................................................................7
2.1.1 Inverter.......................................................................................................................................7
2.1.2 LCL Inverter Model .................................................................................................................8
2.1.3 DC/DC Boost Converter..........................................................................................................9
2.2 Power Converters for Single Phase Microgrid ..........................................................................10
2.2.1 DC/DC – DC/AC Boost Inverter..........................................................................................10
2.2.2DC/AC Bidirectional Converter ...........................................................................................12
2.3 Distributed Energy Models ..........................................................................................................13
2.3.1 Windmill/ Turbine Model....................................................................................................13
2.3.2 Photovoltaic Model................................................................................................................16
2.3.3 Microturbine Model ..............................................................................................................17
2.3.4Battery Model...........................................................................................................................19
2.4 Microgrid Model ............................................................................................................................19
Chapter 3: Control of the Microgrid....................................................................................................22
3.1 Windmill and Photovoltaic Control Strategy ............................................................................22
v
3.2 Microturbine Control Strategy.....................................................................................................24
3.3 Inverter Control..............................................................................................................................25
3.3.1 LCL filter design.....................................................................................................................27
3.3.2 Current/Voltage Controller ..................................................................................................28
3.3.3 Linear Quadratic Regulator with Integral Design...........................................................31
3.3.4 Plug-In Repetitive Control Design.....................................................................................34
Chapter 4: Simulation Results..............................................................................................................35
4.1 Island Mode Repetitive Control and LQI...................................................................................35
4.2 Grid Connected Simulation..........................................................................................................39
4.3 Different Power Scenarios ............................................................................................................41
Chapter 5: Hardware-in-the-loop Simulation....................................................................................43
5.1 Numerical Solver ...........................................................................................................................44
5.2 Parallel solving structure ..............................................................................................................46
5.3 HIL simulation results with Repetitive Control ........................................................................46
Chapter 6: System Level Model and Problem Formulation............................................................50
6.1 Introduction ....................................................................................................................................50
6.2 Modeled elements..........................................................................................................................50
6.2.1 Storage unit .............................................................................................................................50
6.2.2 Interaction with main grid ...................................................................................................51
6.2.3 Power generation....................................................................................................................52
6.2.4 Conservation of energy.........................................................................................................53
6.2.5 Physical constraints ...............................................................................................................53
6.3 Cost function...................................................................................................................................53
6.4 Forecasts..........................................................................................................................................54
6.5 Resulting problem..........................................................................................................................56
Chapter 7: Model Predictive Simulation and results.......................................................................57
7.1 Methods...........................................................................................................................................57
7.2 Simulations .....................................................................................................................................57
vi
7.3 Results..............................................................................................................................................58
7.3.1 Cost comparison.....................................................................................................................58
7.3.2 System elements.....................................................................................................................58
Chapter 8: Conclusion............................................................................................................................61
References.................................................................................................................................................63
Appendix A ................................................................................................................................................1
A.1 Final MPC optimization problem.................................................................................................1
Appendix B.................................................................................................................................................1
B.1 Mixed-integer linear programs......................................................................................................1
B.1.1 Introduction to MILPs ............................................................................................................1
B.1.2 Solving MILPs..........................................................................................................................1
B.1.3 Algorithm..................................................................................................................................1
B.1.4 Bounding methods..................................................................................................................2
B.1.5 Pruning......................................................................................................................................3
Appendix C ................................................................................................................................................1
C.1 Model predictive control................................................................................................................1
C.1.1 Introduction to MPC...............................................................................................................1
C.1.2 Problem formulation ..............................................................................................................1
C.1.3 Handling Infeasibility............................................................................................................2
Appendix D................................................................................................................................................1
D.1 MPC model parameters .................................................................................................................1
D.1.1 Parameters................................................................................................................................1
D.1.2 Forecasted quantities..............................................................................................................2
D.1.3 Variables...................................................................................................................................2
D.1.4 Auxiliary variables .................................................................................................................2
vii
List of Figures
Figure 1- Inverters are a key component in the microgrid ..................................................................7
Figure 2-Full PWM bridge inverter topology used in the simulation................................................8
Figure 3 -Schematic of the DC DC Boost converter ............................................................................10
Figure 4- A boost converter and inverter is cascaded to supply maximum power to the loads..10
Figure 5-Circuit schematic of a boost converter and inverter cascaded together...........................11
Figure 6- A circuit schematic for the bi-directional inverter..............................................................12
Figure 7- General schematic of the windmill system with all subsystems included .....................13
Figure 8- the nonlinear dependence of the windmill power with various parameters.................15
Figure 9- detailed circuit diagram of the windmill model.................................................................15
Figure 10-Single diode photovoltaic model .........................................................................................16
Figure 11- Example of the output power as the impedance varies...................................................17
Figure 12-Main components of a microturbine for microgrid application......................................17
Figure 13-Block diagram of the turbine model typically used for microturbines ..........................18
Figure 14-Simple battery model.............................................................................................................19
Figure 15-High level representation of each leg..................................................................................19
Figure 16-General representation and visualization of interconnecting individual legs. .............21
Figure 17-Overall control strategy for windmill and photovoltaic...................................................22
Figure 18: Flowchart of the Perturb and Observe method.................................................................23
Figure 19: Block diagram of the incremental conductance algorithm..............................................24
Figure 20-Microturbine control strategy, speed control for PMSG and inverter control ..............24
Figure 21-Block diagram of the rectifier control strategy...................................................................25
Figure 22-Control strategy for the battery during grid connected mode ........................................25
Figure 23-Control strategy for the battery inverter during island mode.........................................26
Figure 24-Control strategy for PV, windmill, and microturbine leg ................................................27
Figure 25-Frequency response of the LCL inverter using the specified inductor and capacitor
values.........................................................................................................................................................28
Figure 26-Overall schematic for the microgrid. The battery leg is able to operate in voltage mode
during islanding and current mode during grid connected..............................................................29
Figure 27-Descretization of the linear coupled island model............................................................31
Figure 28-LQI controller block diagram ...............................................................................................31
Figure 29- reduction of cross coupling using LQI...............................................................................33
Figure 30-Block diagram of the "plug-in" repetitive controller.........................................................34
Figure 31: Schematic of a Microgrid system.........................................................................................35
Figure 32-Error in output voltage during island mode using LQI and repetitive control ............36
Figure 33-LQI error is because of the phase error in trying to track a sinusoid .............................36
Figure 34-Fourier transform of the output voltage. It is seen that repetitive control eliminates the
third harmonic..........................................................................................................................................37
Figure 35-Error of the output currents from the microturbine, windmill, and PV during island
mode ..........................................................................................................................................................37
viii
Figure 36-Fourier transform of the output currents during island mode........................................38
Figure 37-Error in the output currents using LQI and repetitive control for grid connected mode
....................................................................................................................................................................39
Figure 38-Fourier transform of the output current in grid connected mode...................................40
Figure 39-Example of the phase error in the PV leg present during grid connected mode..........40
Figure 40-Battery is commanded 3 KW, repetitive control is able to produce the exact amount
while LQI is only about to produce 2600 W.........................................................................................41
Figure 41-Power output test in both grid connected and islanded mode. The PV output is
reduced at 4 seconds, while the microturbine output is increased at 7 seconds. ...........................42
Figure 42: Overview of the Hardware-in-the-loop simulation..........................................................43
Figure 43: Setup of the Hardware-in-the-loop simulation system....................................................44
Figure 44-Current during island mode for PV, windmill, and microturbine for both the
Simulink model and hardware in the loop simulation.......................................................................47
Figure 45-Dc link voltages for the PV, windmill, and microturbine for both the simulink model
and Hardware in the loop.......................................................................................................................47
Figure 46-Output voltage during island mode for both the simulink and Hil simulation ...........48
Figure 47-Battery current during power changes for both simulink and hil simulations.............49
Figure 48: Forecasted power production from renewable energy sources (RES)...........................54
Figure 49: Forecasted demand from the single critical load ..............................................................55
Figure 50: Forecasted spot energy price for purchasing power from the grid................................55
Figure 51: Power generation in DG units .............................................................................................59
Figure 52: Power exchange with the grid.............................................................................................59
Figure 53: Behavior of the storage unit.................................................................................................60
Figure 54: Graphical representation of a branch and bound method. Partitioning of regions in
the feasible space is synonymous to branching a binary tree. Lower and upper bounds of the
region are stored at each node. Taken from EE364b: Convex Optimization IIβ€”Branch and
Bound Methods, Stephen Boyd (2013) [16]. ..........................................................................................2
1
EXECUTIVE SUMMARY
Introduction
According to International Energy Agency, global electricity demand increases
every year from 117,687 TWh in 2000 to 143,851 TWh in 2008. As the energy
consumption keeps climbing, concerns about transmission costs, power quality, and the
lack of power generations for localized demand are crucial for the future power
distribution system. Researchers strive to find alternatives to typical radial form power
distribution systems, and the deployment of distributed generation (DG) across the grid
seems to be a logical and reasonable solution to the aforementioned issues. Those DGs
are usually small in size and adapt to local resources, they utilize renewable energy and
provide an alternative means of power production than traditional centralized power
systems.
Microgrids are systems that contain at least one distributed energy resource (DER)
and local loads. The islanding of a microgrid can be formed intentionally in the power
distribution system. There are two types of DER in a microgrid, one is DG the other is
distributed storage (DS). Most of the microgrid systems use both of them to provide
energy. Interconnection switches are used to disconnect and reconnect DERs between
the main grid and microgrid but the transition has to be smooth or with minimal
disruption to the local loads. Also, microgrid system relies heavily on pwm inverters to
transfer power from the DERs to the loads; therefore, the inverters must be able to
output harmonic free power to increase efficiency.
Project Purpose
The purpose of the project is to develop algorthms that can prove to efficiently and
safely transfer power from DERs to loads using a microgrid. The major objectives can be
stated as:
β€’ A simulation of a microgrid system that can be used predict the microgrid
power transfer using different control algorthms.
β€’ Develop a repetitive control algorthm for the pwm converters and analyze the
harmonic content produced versus typical control algorthms. Increased
harmonic content reduces the power transfer efficiency which is a major issue
using pwm converters.
β€’ Most of the power converter control algorithm for DER in the literature has the
capability to work smoothly in both grid -tied and off-grid modes, but they do
not consider the issue of a smooth transition from one mode to another. Another
2
objective is to verify with the simulation that the transition from grid-connected
to island mode is smooth or with minimal disruption to the local loads.
β€’ In order to asses the viability of the controls developed, a hardware in the loop
simulation with the control and the models running on different platforms is
investigated and compared against the overall simulation
β€’ Lastly, a high level model predictive controller is developed and implemented.
The high level control satisfies the load’s power needs while minimizing the
cost. A cost is associated with running the microturbine, storing energy, and
shedding non-critical load. So, the high level controller will decide which DERs
to use given a certain power output from the photovoltaic and windmill. Also,
the high level controller will take into account the forecasted load demand for
the day.
Project Results
In this research, a control system that contains Model Predictive Adaptive
Control and Repetitive Control is implemented on the microgrid simulation. The
controllers provide superior power quality and maintain the safety of the microgrid
during grid transition. The following results of the project can be summarized relative
to the objectives:
β€’ The simulation of the microgrid has detailed models of the power converter,
microturbine, windmill, and photovoltaic array. Having such a detailed model
enables both transient and steady state power flow in the microgrid. Also,
different control algorthms can be implemented in the simulation.
β€’ The power spectrum from Hardware-in-the-loop simulation shows that
repetitive control is able to effectively suppress the 3th harmonic in the output
current. So it can transfer power more efficiently than traditional methods.
β€’ Using repetitive control and aligning the reference with the grid, it was also
observed a smoother grid transition from both grid-connected to island and vice
versa.
β€’ The proposed Model Predictive Control is able to utilize the predicted
renewable energy production and predicted critical load demand to make
optimal decision for controllable DERs.
To summarize, the repetitive controller can output a high power quality in a microgrid
while minimizing unwanted grid transition fluctuations. Also, the high-level model
predictive controller can minimize microgrid costs by minimizing the usage of high cost
DERs.
3
Project Benefits
The benefits of the project can help in the development of microgrids, which will
result in more renewable and alternative forms of energy integerated into the grid.
Firstly, the detailed simulation developed can predict the transient behavior and control
algorithm changes without having to invest in costly hardware. The benefits of a
simulation can greatly reduce iterations and trial errors.
Moreover, a repetitive control in the inverters can deliver high quality power, while
minimizing grid fluctuations. The results clearly show that a simple control algorithm
can result in large fluctions during transition and that an advanced controller can be
minimize these fluctuations. A repetitive controller can track commands from a high
level controller, so it is very advantageous when used in conjunction with one.
Also since the microgrid can have many DERs, the model predictive controller
developed can make automated decisions about which DERs to turn on and off. In the
current research, the primary objective was to minimize the cost; however, pollution
and other factors can be added into the formulation. Overall, a repetitive and model
predictive controller used together is a viable control strategy for the microgrid.
A blank page is inserted to insure Chapter 1 starts on an odd number page. Blank pages are not
labeled.
5
Chapter 1: Introduction
According to International Energy Agency, global electricity demand increases
every year from 117,687 TWh in 2000 to 143,851 TWh in 2008 [1]. As the energy
consumption keeps climbing, concerns about transmission costs, power quality, and the
lack of power generations for localized demand are crucial for the future power
distribution system. Researchers strive to find alternatives to typical radial form power
distribution systems, and the deployment of distributed generation (DG) across the grid
seems to be a logical and reasonable solution to the aforementioned issues. Those DGs
are usually small in size and adapt to local resources, they utilize renewable energy and
provide an alternative means of power production than traditional centralized power
systems [2].
Microgrids are systems that contain at least one distributed energy resource
(DER) and local loads. And the islanding of a microgrid can be formed intentionally in
the power distribution system [3]. There are two types of DER in microgrid, one is DG
the other is distributed storage (DS). Most of the microgrid systems use both of them to
provide energy. Interconnection switches are used to disconnect and reconnect DERs
between the main grid and microgrid but the transition has to be smooth or with
minimal disruption to the local loads. During power outage, the DERs will be
disconnected from the main grid and the intentional island is formed. In the meantime,
the DERs have to pick up the local loads and guarantee the voltage and frequency are
aligned with the main grid. When power is restored on the main grid, the DERs cannot
be reconnected to the grid unless the main grid and microgrid are synchronized. This
procedure requires voltage measurement on both main grid and microgrid to allow
synchronization of the island and the grid [4]. Most of the power converter control
algorithm for DER in the literature have the capability to work smoothly in both grid -
tied and off-grid modes, but they do not consider the issue of a smooth transition from
one mode to another [5] [6] [7].
In order to convert the energy to compatible AC power in the grid, a power
electronic system is required for most of the DG. Depending on the type of DG, the
power electronic system may include inverter or rectifier or even both. The
compatibility in voltage and frequency with the main grid is the crucial requirement for
these power converters. By controlling the power converter on each DG, the voltage
and frequency of the power in the microgrid can be manipulated. The control system of
microgrid is designed to safely operate the system in grid-tied, off-grid, and transition
modes which it has to control both the voltage and frequency of the microgrid. In off-
grid mode, frequency control is a challenging problem. Some of the DGs, such as gas
turbine, have slow response to control signal but higher power capacity while others
6
may have faster response but smaller power capacity. The frequency control must have
the capability to change active power through control droops with respect to the mode
that is operating. On the other hand, appropriate voltage regulation is necessary for
microgrid reliability and stability. Without local voltage control, system may experience
voltage oscillations causes by the DER.
In this research, a control system that contains Model Predictive Adaptive
Control and Repetitive Control is presented to provide superior power quality and
maintain the safety of the microgrid. The Model Predictive Adaptive Control is a
governor control which assigns the desired power for each DER in the microgrid. The
Repetitive Control is local control that controls the power electronic systems along with
the DER. Repetitive Control is a special case of the internal model principle in control
systems with periodic signals, hence Repetitive Control providers zero tracking error
and low total harmonic distortion for power electronic system. The proposed Repetitive
and Adaptive control system guarantees good power quality during all modes of
operation.
7
Chapter 2: Modeling of the Microgrid
This section covers the overall modeling of a single phase microgrid. A low level
model of single phase inverters is used as a starting point and as built up until a
microgrid model is obtained from low level average models of inverters. It turns out
one the average models for each leg is obtained, they can be connected in parallel
relatively easily.
2.1 Single Phase Converters
First the basic single phase converters are covered, which from more complex
converter topologies can be obtained.
2.1.1 Inverter
Figure 1- Inverters are a key component in the microgrid
As shown in Figure 1, the main component in a microgrid is the inverter as it is
responsible for converting DC voltage sources, such as the battery and photovoltaic
cells, into an AC voltage suitable for the grid. The objective of the inverter depends on
whether the grid is connected to the microgrid.
If the grid is not tied to the microgrid, known as islanding mode, the inverter
must produce an output sinusoidal voltage that is not significantly distorted and of
proper amplitude. Since the grid is not available, one (or more) of the inverters must
create a sinusoidal AC line so the others can follow. On the other hand, when the grid
is tied to the microgrid the goal is to achieve unity power factor ratio. The power factor
ratio which is defined as the ratio of the average power to apparent power delivered to
the load can be expressed for sinusoidal signals as [8]:
8
Therefore to achieve unity power factor the converter must be able to produce a current
that is in phase with the voltage and the THD is small.
Figure 2-Full PWM bridge inverter topology used in the simulation
Figure 2 shows the power inverter topology that is being used for simulation. It
is a full bridge PWM inverter that uses four IGBTs to change the polarity of the input
DC signal. There are 3 main reasons for choosing this topology: 1) The switches allow
for active power factor compensation and by using feedback the output current and
voltage can be made robust to load changes 2) The topology is easily extended to three
phase voltage 3) it can also be used as a rectifier in the reverse direction. The output of
the inverter can be either in grid connected or island mode depending on whether is
connected to the grid.
2.1.2 LCL Inverter Model
In order to design a model based control system such as repetitive control to
provide the AC output, a mathematical model of the inverter being used is necessary. It
is important to note that to avoid shorting the circuit
Therefore the inverter has only one binary input which can take on two values 1 or -1.
Therefore, a high frequency pwm signal is needed to switch the transistors ON and OFF
accordingly.
By applying KVL and KCL for the inductor current and capacitor voltages a state
space model can be derived. The model is an average model since the D, the duty cycle,
9
can take on continuous values from [-1 1] and is not a pwm signal. In this research,
average models were used since the main focus was much lower harmonics than the
pwm switching frequency which can range from 5 kHz to 100’s of kHz. Typically,
filtering is intended to suppress the high frequency switching, so an average model
works well.
The average model technique is standard in literature, so a detailed derivation is
unnecessary. In island mode, the following equation describes the single phase LCL
inverter.
Similarly, the following equation describes LCL inverter in grid connected mode. Aside
from Vs the AC grid voltage now being an input, the main difference is the presence of
the load, R, in the lower right hand corner of the matrix. In grid connected mode, since
the load is powered by the grid, the inverter does not include an R term.
Lastly, it is important to note the above average model is linear and suitable to linear
control design techniques. However, the linear model is only valid at frequencies below
the switching frequency, since the averaging is over one switching period.
2.1.3 DC/DC Boost Converter
Another common converter that is used for the microgrid simulation is a DC/DC
boost converter shown in Figure 3. The duty cycle of the IGBT switch controls the output
voltage across the resistor. Using the boost topology the voltage across the resistor is
greater than the input supplied voltage. Therefore, typically the control objective of a
boost converter is to supply a higher output voltage to a given load. Therefore, the
boost converter is ideal for maximum power tracking (MPPT).
10
Figure 3 -Schematic of the DC DC Boost converter
Similar to the inverter and rectifier, the average model is obtained by averaging
the switching model over one switching cycle. More detailed analysis of the average
model is shown in any fundamental of power electronics book. The model is described
as
2.2 Power Converters for Single Phase Microgrid
2.2.1 DC/DC – DC/AC Boost Inverter
Figure 4- A boost converter and inverter is cascaded to supply maximum power to the loads
The DC/DC – DC/AC Boost inverter is, as illustrated in Figure 4, used to
converter power generated from a power source to AC voltage or current suitable for
the grid. The power source can be photovoltaic, windmill, or a turbine. The converter’s
objective is to extract maximum power from the power source and make it available to
11
the AC bus. It is assumed the input power from the source is a DC voltage (easily
accomplished using a diode bridge); therefore the boost converter extracts maximum
power while the inverter outputs a sinusoidal voltage/current.
Figure 5-Circuit schematic of a boost converter and inverter cascaded together
Shown above in Figure 5 is a circuit schematic of the boost inverter for the
simulation. A key component of the converter is the link capacitor, as it decouples the
boost converter from the inverter. Simulations have shown a fairly large link capacitor
is needed for proper decoupling. In a similar vein, the output inductor and capacitor
must be designed so the high frequency switching is filtered while low frequency
harmonics are not affected.
A mathematical model of the boost inverter can be derived by cascading the
average models of the boost converter and inverter. Essentially the output of the boost
inverter is the input of inverter, this leads to the following model
Boost
Inverter
12
Where
𝐼𝐿1 is the current in boost converter’s inductor
𝑉𝑙𝑙𝑙𝑙 is the voltage across the DC link capacitor
𝑉𝑑𝑑𝑑 is the voltage across the capacitor from the DER output
𝐼𝐿2 is the current inverter’s inductor
𝑉𝑏𝑏𝑏 is the voltage in the AC bus
2.2.2DC/AC Bidirectional Converter
A bidirectional converter is crucial in a microgrid system, since there must be some
form of energy storage and power must flow in and out of the energy storage device. In
this simulation, a battery is used for energy storage. In the figure below, the
bidirectional converter used is shown. The input is a battery voltage and the output is
the bus AC voltage. The current in inductor L1 cannot have large ripples since it is
directly connected to the battery, therefore the input LC filter needs to be low
bandwidth. This is similar to the boost inverter case, where a large DC link capacitor is
critical in achieving decoupling of the DC and AC converter.
Figure 6- A circuit schematic for the bi-directional inverter
Writing down the average model the following equation is obtained:
13
.
Where
𝐼𝐿1 is the current in the battery’s inductor
𝐼𝐿2 is the current inverter’s inductor
𝑉1 is the voltage across the input capacitor
𝑉𝑏𝑏𝑏 is the voltage in the AC bus
It is worthwhile viewing this equation as a hybrid of the inverter and rectifier models
given above. The bi-directionality is most apparent in the input inductor as the current
can flow in both directions.
2.3 Distributed Energy Models
For the microgrid simulation four different energy types are considered: 1) Windmill
2) Photovoltaic 3) Micrturbine 4) Battery. These four were chosen since they are
relatively clean and seem like good options for the future.
2.3.1 Windmill/ Turbine Model
Figure 7- General schematic of the windmill system with all subsystems included
A schematic of how wind energy is transferred to the grid is shown above. The
converters were discussed in the previous section and will only be touched upon.
14
Windmill models are typically divided into two parts: 1) Modeling the wind energy
transferred to the generator shaft 2) Modeling the permanent magnet synchronous
generator (PMSG). Essentially, the PMSG takes a mechanical input torque and converts
it into a sinusoidal voltage and current. Viewed in this light, a PMSG model can also be
used for a gas turbine.
Permanent Magnetic Synchronous Generator
The following are the dynamical equations for a sinusoidal PMSG, which are
obtained from the datasheet of Matlab’s PMSG block and are widely used to model
generators. They are expressed in a DQ frame fixed to the principle axis of the rotor.
The equations give the electrical torque (Te) generated by the PMSG, and must be
accompanied by a mechanical torque balance at the shaft which is given by
Here Tf is friction and Tm is the input torque generated by the wind or gas energy. So
for purposes of a microgrid simulation these equations can be solved if the mechanical
torque Tm can be modeled. Since the model for PMSG is widely published a derivation
of the model is not presented.
Wind Energy Model
The power generated by the wind can be expressed as
Where Cp is the power coefficient and varies in a very nonlinear manner with
and Ξ². Here R is the radius of the blade, v is the wind speed, w is the blade speed, and Ξ²
is the pitch angle. The output torque is the product of the power generated and the
speed. Since Ξ² is varying and Cp is nonlinear it is difficult to know if maximum power
is being achieved. Therefore an MPPT algorithm as described previously is necessary.
The following plots show an example of the output power varying with Ξ² and rotor
speed.
15
Figure 8- the nonlinear dependence of the windmill power with various parameters
The windmill model is shown in more detail in Figure 9. The AC-DC converter
topology in series with DC/AC converter is shown. The AC-DC converter ensures the
rotor speed is operating so to produce maximum power from the windmill, while the
DC-AC converter produces a sinusoidal output and controls the DC link voltage.
Figure 9- detailed circuit diagram of the windmill model
16
2.3.2 Photovoltaic Model
Figure 10-Single diode photovoltaic model
A single diode model as shown in the figure above and was used to model the
photovoltaic cell. The model can be mathematically expressed as
The series and parallel resistance are given by the manufacturer or can be measured.
Also Vt and a are constants that are given. Ipv is the current generated by the sun, I0 is
the dark current when there is no sunlight and both vary with temperature as given by
G is the input irradians generated from the sun. The model is highly nonlinear and
implicit; therefore solving the equation can be difficult. The model presented is
standard in photovoltaic literature and more information be found in [8].
Shown in Figure 11 is the output resistance being varied and the power generated.
Clearly there is optimal impedance which generates maximum power. Therefore, when
using the DC/DC – DC/AC converter the MPPT algorithm is searching for the
impedance that produces maximum power. Since the irradians varies and the diode
model does not exactly apply, an MPPT algorithm is necessary.
17
Figure 11- Example of the output power as the impedance varies
2.3.3 Microturbine Model
Figure 12-Main components of a microturbine for microgrid application
Micro turbines are another key component of microgrids. They allow for distributed
generation by using various types fuel to produce small amounts of power (<500Kw).
Along with being highly efficient, micro turbines are also very reliable and can provide
variable power unlike windmill and photovoltaic cells. Even more, micro turbines can
operate in both grid-connected and island modes. Although cleaner and cheaper than
traditional diesel generators, microturbines can still use fossil fuels so an objective of a
microgrid system can be to minimize the use of a microturbine.
The major components of a microturbine system for a microgrid are shown in Figure
12. A turbine running off fuel supplies torque to the Permanent magnet generator shaft
which produces energy, this is similar to the windmill case. The shaft is typically
rotating at a very high speed (1500-4000 Hz), so the high frequency current must be
18
converted to a 50 or 60 Hz output. Following [9], a back to back rectifier/inverter
converter is used for this simulation. An active rectifier converts the PSMG output into
a DC voltage and then a single phase bidirectional inverter converts the output to a 50
Hz current/voltage. The benefit of using an active rectifier is an increase in efficiency
and no separate starting circuitry as opposed to a diode bridge.
Figure 13-Block diagram of the turbine model typically used for microturbines
Shown in Figure 13 is a block diagram of the turbine model typically used by
researchers for microturbine modeling. On a high level, the input is the PMSG shaft
speed and the output is the torque to the shaft. Simple first order filters and delays are
used to model the turbine and fuel system dynamics. The torque output is used to drive
the generator; the equations for a PMSG were shown in the windmill section.
Once again using KCL and KVL, the equations for a back to back converter can be
derived. The rectifier is three phase and u is a vector of the three duty cycles. The single
phase LCL inverter is attached to a three phase rectifier and the following equations are
obtained. The inputs to the system are u and Iabc, the three phase duty cycle and
current generated from PMSG respectively. The output is Vabc the three phase voltage
fed into the PMSG equations. The state variables are Capacitor voltage and inductor
currents.
19
The previous equations for the back to back converter, along with the PMSG and
turbine model complete the equations for modeling the microturbine. Further details
can be found in [9].
2.3.4Battery Model
Figure 14-Simple battery model
For purposes of the simulation a simple battery, which is shown above, was
used. The model is just a voltage source and resistor in series. Although there are many
shortcomings of this model and may not be suitable when charging and discharging
profiles are explored, it is used now to simplify the microgrid simulation. In the future
different models will be explored and tradeoffs between LI-ON and lead acid will be
investigated.
2.4 Microgrid Model
Figure 15-High level representation of each leg
Energy
Generation
Single-Phase
Inverter
DC Link
Sinusoidal
Current
Although the modeling of the converters along with energy sources can become
large, it is relatively simple to add together each individual leg to build a full microgrid
simulation. First Figure 15 represents a general configuration of a leg. There is energy
20
generation from a source into the dc link and an LCL inverter that converts the dc into
AC. As expected, the larger the capacitor is the better both are decoupled from each
other. Indeed, in the CERTS microgrid batteries are used to fully decouple the energy
generation and inverter dynamics [3]. For the purposes of the simulation a large
capacitor is used.
Mathematically each leg can be generalized as
.
Here the A matrix is a function of the duty cycle, and b represents the influence from
the energy generators. A necessary state in the formulation of the microgrid is Iout,
which is the output current (rightmost inductor current in the LCL filter) into the Ac
link. By applying KCL at the load, it is seen that the following figure holds true. So
therefore, in order to combine individual legs into a microgrid simulation the output
currents must summed and either multiplied by the load (Island mode) or the Grid
voltage is feedback (grid connected mode). It should be noted this technique works for
resistive loads.
21
Figure 16-General representation and visualization of interconnecting individual legs.
Battery Inverter
PV Inverter
Windmill Inverter
Microturbine Inverter
βˆ‘+
+
βˆ‘+
+
Rload
Vaclink
Iout2
Iout3
Iout4
Iout1
Island
Grid
22
Chapter 3: Control of the Microgrid
This section focuses on the various control aspects of the microgrid. It uses the
models in the previous section and simplifies them to facilitate control design. The main
aspects of control design are the maximum power point tracking, PMSG speed control,
and the inverter controller.
3.1 Windmill and Photovoltaic Control Strategy
Figure 17-Overall control strategy for windmill and photovoltaic
Power Source Boost Converter Inverter
Ider
Vder
Vlink
MPPT
Duty1
Current Mode
Controller
Duty2
Vcap
I1
I2
Shown in Figure 17 is the control strategy for the boost inverter used in both PV
and windmill generation. The maximum power point controller adjusts the duty cycle
of the boost converter to extract maximum power from the power source and is
discussed in greater detail in the next section. The inverter controller is the standard
design consisting of an inner current loop and outer voltage loop. The current loop
ensure the output current (hence voltage) is sinusoidal, while the voltage regulates the
dc link voltage for stable output power. If there is too much power being generated the
inverter outputs power, however if there isn’t enough power to regulate the DC link the
inverter actually consumes power.
The Current Mode controller is responsible for outputting a sinusoidal current to
the grid, a PV or windmill is not operated as a voltage source inverter in this
23
simulation. The controller of the inverters is discussed in greater detail in the next
section.
The MPPT controller adjusts the duty cycle of the boost converter until maximum
power is achieved. There are many algorithms to achieve this, however only the
primary two that is used in industry will be discussed: 1) Perturb and observe 2)
Incremental conductance. The flowchart for the Perturb and observe algorithm is
shown in the figure below. It is the most basic algorithm, as the power is increasing
then the input is further increased or decreased; however, if the power decreases the
input is decreased. As long as the power function is convex oscillations around the
maximum power point will occur.
Figure 18: Flowchart of the Perturb and Observe method
The other popular algorithm is the incremental conductance algorithm, which can be
derived from𝑃 = 𝐼𝐼. Taking the derivative
𝑑𝑑
𝑑𝑑
= 𝐼 + 𝑉
𝑑𝐼
𝑑𝑑
and then setting it to 0, it is
seen the following equation is necessary for MPPT,
𝑑𝑑
𝑑𝑑
=
βˆ’πΌ
𝑉
. So, the incremental
conductance algorithm adjusts the input so the aforementioned criterion is met. A block
diagram of the algorithm is shown in Figure 19.
24
Figure 19: Block diagram of the incremental conductance algorithm
Notice that an integrator is added to increase the rate at which the power point is
achieved.
3.2 Microturbine Control Strategy
Figure 20-Microturbine control strategy, speed control for PMSG and inverter control
Turbine +
PMSG
Three phase Rectifer Inverter
Iabc
Vabc
Vlink
Speed
Control
Duty1
Current Mode
Controller
Duty2
Vcap
I1
I2
The microturbine controller is different than the WM and PV because of the three
phase rectifier which is responsible for controlling the speed of the shaft by adjusting
the electrical torque. However, the inverter control is the same. The control topology
25
for the rectifier follows from literature and is shown in Figure 20. The controller
transforms the PMSG current into its dq coordinates and then employs one PI controller
to make Id follow a setpoint based on the efficiency of the generator and another PI to
track Iq which is adjusted to track a set speed. The speed directly influences the amount
power the microturbine delivers (higher the set speed the more power). Figure 21
shows a block diagram of the rectifier control strategy.
Figure 21-Block diagram of the rectifier control strategy
abc
dq
βˆ‘+
–
βˆ‘-
+
PI
PI
βˆ‘-
+
PI
dq
abc
Idref
speed
Ref speed
Iabc Dabc
3.3 Inverter Control
Figure 22-Control strategy for the battery during grid connected mode
2
2
Vamp
βˆ‘+
+
P
Q
Iref
Sine
Cos
Current
Controller
Duty
26
The inverter controller for the battery leg outputs a set amount of real power when
connected to the grid and maintains the Ac link voltage while islanded. In this
simulation the battery leg is the master in island mode, a load sharing scheme was not
implemented. This allowed for simpler controller validation. Shown in Figure 22 is the
battery inverter control strategy; a set point of real and reactive power is transformed
into a current command for the current controller. The current controller must be able
accurately track the reference free of harmonics that may get injected into the grid or
loads.
Figure 23-Control strategy for the battery inverter during island mode
Single-Phase
Inverter
Sinusoidal
Voltage
Voltage
Controller
Shown in the figure above is the control topology for the battery used in islanded
mode. The controller outputs a harmonic free Ac link voltage. In islanded mode, the
battery inverter instead of the grid provides a reference for the other legs so they can
continue to operate in current mode. Therefore, once islanded operation is detected the
control strategy must switch. The simplification of having one master allows the other
legs to have a single controller be designed. However, it is evident that the controller
must provide harmonic free current in grid connected mode and harmonic free voltage
in islanded mode.
27
The inverter controller for the PV, windmill, and microturbine leg is similar to
the battery controller in grid connected mode except that an addition PI loop is added.
The additional PI loop controls the dc link voltage for stable output power. Moreover, if
the dc link is unstable then power outputted will also diverge. The dc link PI controller
ideally adjusts the amplitude of the current to be tracked by the current controller. The
dc link PI gains were tuned manually for acceptable results.
Figure 24-Control strategy for PV, windmill, and microturbine leg
2
2
Vamp
βˆ‘+
+
Q
Iref
Sine
Cos
βˆ‘+
–
PI
Vdc
V*
dc
Current
Controller
Duty
3.3.1 LCL filter design
For grid connected inverters, LCL output filter on the inverter is used since it has
60dB/decade roll off above the resonant frequency and provides better decoupling from
the grid impedance. Using a inductor at the output of the filter effectively decouples the
grid impedance. Also smaller values of inductors and capacitors can be used in LCL.
However, the filter brings resonances into the system which makes control design more
difficult. Later, it is seen that LQI is particularly adept at handling these issues without
using a damping resistor. The primary concern in designing a LCL filter is the cut-off
frequency
28
Li and Lg were chosen to be 5mH, while C was 10uF so the cutoff was at approximately
1 kHz, while the switching frequency (Sample time) was set to be 20 kHz. Shown below
is the frequency response of the LCL inverter in both grid connected and Island mode.
Figure 25-Frequency response of the LCL inverter using the specified inductor and capacitor values
3.3.2 Current/Voltage Controller
For the creation of a benchmark simulation, the control strategy used was a LQI
(Linear quadratic with integrator) controller, which is similar to a PI in that it can
perfectly track step inputs and is easier to design a stable filter for a LCL inverter than a
PI.
29
Figure 26-Overall schematic for the microgrid. The battery leg is able to operate in voltage mode
during islanding and current mode during grid connected
Single-Phase
Inverter
Voltage
Controller
(Island)
Current
Controller
(Grid)
Energy
Generation
Single-Phase
Inverter
DC Link
Current
Mode
Controller
Energy
Generation
Single-Phase
Inverter
DC Link
Current
Mode
Controller
Grid
Duty
Duty
Duty
AC link
LCL
Filter
LCL
Filter
LCL
Filter
Load
The overall system with inverter control is shown Figure 26, the battery leg can
switch controller depending on whether the grid is connected, while the other legs
operate in current mode. Using this figure, and by applying KVL at the output it can be
seen that in grid connected mode each inverter is not coupled to the others. Therefore,
assuming a sufficiently large DC link decoupling capacitor, individual controllers can
be designed using
.
30
However, in island mode the coupling effect is present. Assuming a resistive
load and a large DC link capacitor and applying KCL the following model can be
derived for each inverter leg
This model describes the coupling effect for an inverter based microgrid in islanding. It
is linear model with the system matrix as
Where Ai and Bi are the individual matrices of a single LCL inverter. Using this overall
structure, controllers can be designed using the individual inverter models and checked
to see if they are still stable with the coupling effect included.
In this research, the controller is designed using the islanded coupled model. Before
proceeding with discrete time control design, the continuous model above needs to be
discretized. A zero order hold discretization was applied to the model above in order to
facilitate discrete time design. The figure below shows the frequency response of both
the continuous and discrete time models. As can be seen the resonance is presence for
both model and the discrete time model with a sample time of 20 kHz accurately
matches the continuous time model.
31
Figure 27-Descretization of the linear coupled island model
3.3.3 Linear Quadratic Regulator with Integral Design
Figure 28-LQI controller block diagram
Simplifed
Inverter Model
Kfb
βˆ‘+
–
βˆ‘+
+
1
z-1
Ki
x
Current/
voltageCurrent/
Voltage
reference
Each leg runs an LQI controller, which is shown in Figure 28. A LQI controller is
composed of two parts: 1) state feedback, where the state x is multiplied by a gain 2)
Integrator part that attempts to eliminate the error in tracking a reference (Current or
32
Voltage). The states are just the currents and voltage in the LCL filter so it
is readily measurable. Determination of the gains is done by solving the Riccati
Equation for the augmented system.
It is worth noting that design is done on the decoupled plant models in islanded mode.
With the LQI compensator designed the closed loop system can be expressed as
The same individual design procedure can be done for all four legs. However, it is not
clear whether the coupling will adversely influence the controller in island mode. To see
the effect of the coupling on the controller, the overall system can be seen to have
system matrices as
,
where Acl and Bcl are the closed loop system matrices for each individual leg.
Shown in Figure 29 is the frequency response of the closed loop LCL inverter and
the open loop LCL inverter. The open loop frequency response shows large coupling
effects on the off diagonal plots, indicating coupling between inverters. However, the
closed loop response shows the coupling terms below -10 dB. Also the resonant peak is
eliminated. The benefit of lightly decoupling the system using LQI is that now
repetitive control can β€œplugged β€œ in for each individual inverter.
33
Figure 29- reduction of cross coupling using LQI
34
3.3.4 Plug-In Repetitive Control Design
Figure 30-Block diagram of the "plug-in" repetitive controller
Simplifed
Inverter Model
Kfb
βˆ‘+
+
1
z-1 x
Current/
voltage
Current/
Voltage
reference
Ki
Z-N
Q(z) F(z)
The plug in repetitive control structure is shown above. The additional repetitive
control loop is plugged into the LQI design mentioned in section 0. By the internal
model principle, the controller can track any periodic reference and reject periodic
references. Two filters are needed for this controller, F and Q. First, F(z) is a zero phase
inversion filter of the closed loop plant. If , then F can be designed as
. N+
is the part of the numerator transfer function that has its
poles inside the unit circle, while N- has its pole outside the unit circle. F(z) allows the
closed loop plant to be approximately inverted and the loop to stay stable. Lastly, b is
defined as .
This high performance controller assumes an accurate model of the plant which is
rarely the case. As stated earlier, the assumption that the DC link is constant was used
to obtain the linear models previously. However, this assumption is not completely true
as the DC link does fluctuate which can introduce some error to the linear models.
Luckily, repetitive control is robust to model uncertainty by adjusting the Q(z) low pass
filter at the expense of reduced performance. The following Q filter was used for the
simulation
.
35
Chapter 4: Simulation Results
Figure 31: Schematic of a Microgrid system
Figure 31 shows an overview of the microgrid system, it has four different DERs
along with different power converters to interface with the grid power. In chapter 2, all
types of power converters and different DER models used in the microgrid system was
introduced. In this section the overall microgrid model is implemented in Simulink.
First repetitive control is compared against LQI, which highlight some of the attractive
features of the controller. Then a simulation changing the power produced by the PV,
microturbine, and battery is shown to highlight the key features of the simulation.
4.1 Island Mode Repetitive Control and LQI
In islanded mode the battery inverter must control the Ac link voltage, while the
other converters either operate at MPPT or output the specified amount of power. The
microgrid simulation ran until the output voltages and currents stabilized, while signals
were recorded. For this section, two different scenarios were run: 1) LQI as the
current/voltage control 2) Repetitive control as the controller. Overall, repetitive control
performs much better than LQI in the island case.
Shown below is the output voltage error for LQI and Repetitive control. The grid
voltage was 120V and 50Hz for the simulation. Evident is repetitive control has much
less error than using LQI. This is expected since Repetitive has an internal model the
sinusoid in its transfer function. LQI has errors up to 25 V, while repetitive errors are
below .5 V. Upon closer inspection, from Figure 33 it is seen the LQI errors in
36
magnitude are well behaved but the phase difference is the main cause of the errors.
Repetitive control has an advantage that it can track the voltage command in phase.
Figure 32-Error in output voltage during island mode using LQI and repetitive control
Figure 33-LQI error is because of the phase error in trying to track a sinusoid
2.58 2.59 2.6 2.61 2.62
-100
-50
0
50
100
Time (secs)
Voltage(Volts)
LQI Reference Tracking
2.65 2.66 2.67 2.68 2.69 2.7
-100
-50
0
50
100
Time (secs)
Voltage(Volts)
Repetitive Control Voltage Tracking
Reference
Actual
37
Taking the fft of the output voltage from both the LQI and Repetitive control
simulation, it is further seen that repetitive control reduces the third harmonic. This also
is expected as the controller can reject all harmonics of the fundamental, while LQI is
only capable of rejecting a constant. Interestingly the noise floor is decreased at higher
frequencies.
Figure 34-Fourier transform of the output voltage. It is seen that repetitive control eliminates the third
harmonic
A similar trend can be seen with the output currents of the PV, Windmill, and
Microturbine legs. As is shown on
Figure 35, repetitive control is able to track its reference, while LQI has significant
error. Once again the error is primarily due to the phase mismatch; repetitive control
can accurately track the phase of the voltages and currents in the simulation. Also, from
Figure 36, third harmonic suppression is seen in the Miroturbine current but not
in the PV or Windmill. This is because of the DC link controller design has harmonics
that the repetitive controller attempts to track. But the overall noise floor is lowered by
the use of repetitive control.
Figure 35- Error of the output currents from the microturbine, windmill, and PV during island mode
38
Figure 36- Fourier transform of the output currents during island mode
39
4.2 Grid Connected Simulation
In Grid connected mode all the inverters must operate in current control mode
since the grid supplies the reference voltage. In this case, the microgrid simulation ran
in grid connected mode until the output voltages and currents stabilized, while signals
were recorded. Once again, the simulation was run using LQI and repetitive control.
The results parallel the islanded mode case.
Shown in Figure 37, is the error in all the current outputs using LQI and repetitive
control. Clearly, LQI is not able to track the sinusoidal references. The frequency
domain of the current signals is plotted in Figure 38. As in the islanded case, the overall
noise floor is lowered using repetitive control; however, the third harmonics is not
rejected for converters with high harmonics content in the dc link which was designed
by manual PI tuning. Lastly, Figure 39 shows the phase error when using LQI.
Figure 37-Error in the output currents using LQI and repetitive control for grid connected mode
40
Figure 38-Fourier transform of the output current in grid connected mode
Figure 39-Example of the phase error in the PV leg present during grid connected mode
41
4.3 Different Power Scenarios
One of the essential features of the microgrid is that different legs outputting
different power levels. In grid connected mode, any amount of energy produced is
acceptable as excess energy is fed back into the grid. In islanded mode, the battery plays
the role of the grid and stores or extracts energy as is needed. Moreover, the phase error
introduced when using LQI is unacceptable as it leads to deviations in power. For
example, Figure 40 shows the output power of the batter in grid connected mode when
it is asked to supply 3KW using LQI and Repetitive. Repetitive control correctly outputs
the 3 KW, while LQI outputs 2.6 KW. The error stems from the phase error mentioned
in previous sections. Therefore, for power simulations, only repetitive control is used.
Figure 40-Battery is commanded 3 KW, repetitive control is able to produce the exact amount while
LQI is only about to produce 2600 W
This simulation was intended to test operation when the PV, battery, and
microturbine output different power levels. Both grid connected and islanded mode
was tested. In island mode, at 4 seconds the PV irradians was changed from 1000
42
irradians to 750 irradians. Then at 7 seconds the microturbine was commanded at 2 KW.
From Figure 41, it is seen when the PV outputs less energy the battery outputs more.
The direction of power flow changes in the battery. However, at 7 seconds when the
microturbine outputs 2 KW the direction of power once against changes in the battery.
The battery controls the AC link.
In grid-connected mode, the same simulation was run except the battery at 2
seconds outputted 4.5 KW instead of 3 KW. The same dynamical behavior is seen on the
other legs but the battery is able to produce varying amount of power.
Figure 41-Power output test in both grid connected and islanded mode. The PV output is reduced at 4
seconds, while the microturbine output is increased at 7 seconds.
43
Chapter 5: Hardware-in-the-loop Simulation
In this section, the microgrid simulation introduced in Chapter 3 and the embedded
control hardware will be integrated as a hardware-in-the-loop simulation. Also, the
benchmark performance will be established by implementing industrial standard
control methods to the hardware-in-the-loop simulation.
The hardware in the hardware-in-the-loop simulation is: PXI chassis, desktop real-
time system, and the reconfigurable FPGA board in both of these systems. The setup of
the hardware-in-the-loop system is shown in Figure 42.
Figure 42: Overview of the Hardware-in-the-loop simulation
The top blue dashed block is the real-time controller which is the PXI chassis and the
bottom red dashed block is the microgrid system emulator which is executing in the
desktop real-time target. While the input/output signals between the top and the
bottom block is implementing within the reconfigurable FPGA board. The physical
setup of the hardware-in-the-loop system is shown in the figure below:
44
Figure 43: Setup of the Hardware-in-the-loop simulation system
, the white box at the bottom is the PXI real-time controller, the black box on the top is
the microgrid system emulator, and the two boxes on the right are the breakout box that
direct feed through the outputs from one real-time processor to the proper input ports
of another real-time processor. And the reconfigurable FPGA board is the interface
between the inputs/outputs and the real-time processor.
In the next subsections, more details about the implementation of hardware-in-the-
loop simulation will be introduced in the following order: First of all, the numerical
solver which is implemented in the hardware-in-the-loop simulation will be introduced.
Secondly, the special structure of the mathematical average model derived in section 2.4
will be utilized so that the parallel computation capability of the multi-core CPU
processor can beneficial in the hardware-in-the-loop simulation. And then the
benchmark performance of the hardware-in-the-loop simulation will be established by
implementing industrial standard control method in the real-time controller.
5.1 Numerical Solver
In this research, we have tried two different numerical solvers, Euler method and
Runge-Kutta method, for solving the differential equations in the microgrid systems.
45
The Euler method is a first order numerical method for solving ordinary differential
equations. It is the most basic explicit method and also it is actually the subset of Runge-
Kutta method. The Euler method is a first order method which means the local error is
proportional to the square of the step size, and the global error is proportional to the
step size.
According to the testing results, the largest step size that can provide stable solution
to the microgrid system is around the order of 10-6(sec). In other words, if the Euler
method is going to be deployed as the solver for the microgrid systems, the execution
speed of the hardware-in-the-loop simulation has to be around 1MHz which is above
the capability of the Desktop Real-Time System. Therefore, we investigated into the 4th
order Runge-Kutta method.
The Runge-Kutta method of 4th order works with higher degree of accuracy than
the common Euler method. And it also uses fixed step size during the process, which
makes it easy to implement.
Assuming the differential equation is,
The fixed step rate as a five stage process can be described as,
From the testing results, the Runge-Kutta of 4th order can use much larger step size
than the Euler method. The largest step size that guarantees stable solution to the
microgrid system is around 1x10-5
(sec) which is 50 times larger than the Euler method.
Therefore, with Runge-Kutta solver, the hardware has to execute the simulation at
100kHz to have the hardware-in-the-loop simulation running in real-time.
Unfortunately, the current hardware is not able to finish one simulation cycle in
1x10-5
(sec). It takes at least 10-4
(sec) to finish one simulation cycle. Currently, we decide
to slow down the simulation execution speed but keep the same step size. Meaning the
simulation is not executed in real-time but at a scale down speed.
46
5.2 Parallel solving structure
In Section 2.4, it was shown that the mathematical average model of the microgrid
system has block diagram structure. This special structure implies that the states within
different DERs in the system can be solved independently. The system matrix A can be
divided into a 4x4 matrix. Instead of solving the entire system at once, we propose to
decompose the entire system matrix into four subsystems: three decoupled systems and
one coupling system. The three decoupled systems are the systems on the (1,1), (2,2),
and (3,3) elements of the system matrix A, while the coupled system is the last column
and last row of the system matrix A.
The decomposed microgrid system model can be beneficial if the decoupled systems
are solved in parallel. For a multi-core computer, the CPU can work in parallel in
different thread; Meaning that the subsystems can be solved independently and at the
same time which utilizes the true parallel processing of the multi-core computer.
5.3 HIL simulation results with Repetitive Control
In order to validate the HIL simulation in all modes of operations, first the Hil
simulation is ran under normal conditions; 1000 irradians and 300 W from the
microturbine. Some sample plots are shown in figures 44-46. These figures show good
correlation between the Simulink model and the Hil simulation. Also evident in these
plots is the ripple in some the of DC link voltages. Although the simulations differ in
the transient, the steady state error is small and the Hil simulation is sufficient for
microgrid testing. The Hil simulation uses the repetitive controller since its performance
is seen to be much better than using LQI.
47
Figure 44-Current during island mode for PV, windmill, and microturbine for both the Simulink
model and hardware in the loop simulation
Figure 45-Dc link voltages for the PV, windmill, and microturbine for both the simulink model and
Hardware in the loop
48
Figure 46-Output voltage during island mode for both the simulink and Hil simulation
Also, the similar test condition as used in Chapter 5 will be applied to the HIL
simulation system. The test condition is: At the beginning, the microgrid has enough
power to supply local loads and there is some extra energy being stored into the
battery. While at t=2 (sec), the sudden drop of sun irradiation causes the battery to
discharge to supply the power to the local loads. At t=4 (sec), the mictorturbine outputs
additional energy and the battery again begins to store the additional energy.
Figure 47 shows the current generated from the battery in the HIL. The simulation
results in the HIL simulation has a small dip around t=2(sec) which does not occur in
the average model. The suspect of that could be the noise in the inputs and outputs. In
the HIL simulation, the control commands and the measurements are physical IOs
between the controller and plant model emulator. Therefore, both of the control
commands and the measurements are polluted by unpredictable noises. If the control
algorithm is not robust, the performance could be unpredictable as well. This
49
robustness was partially issued in the repetitive control design by using the third order
Q filter.
Figure 47-Battery current during power changes for both simulink and hil simulations
50
Chapter 6: System Level Model and Problem
Formulation
6.1 Introduction
System-level grid models in literature are typically realized using power flows between
compartments [8, 9, 10, 11]. These compartments can represent individual or groups or
elements, and can be classified as power sources or sinks. Sinks represent loads in the
microgrid. Sources represent generation sources (renewable power sources, distributed
generation, and storage units) that when connected, power can be purchased and sold
over the main grid, and so it can act as a both a sink and a source.
A microgrid model found in literature is described and implemented. The model, by
Parisio et al., is formulated in [9], tested on an experimental microgrid in [10], and
undergoes extensive simulation in [8]. The model is a mixed-integer linear optimization
problem (see Appendix A) that is repeatedly solved in real-time using model predictive
control (see Appendix C).
The model supports both islanded and connected modes, although all published results
have been for connected mode. The model is currently implemented in connected mode
only. Islanded mode is possible by disabling interaction with the main grid, however
measures must be implemented to handle infeasibility.
6.2 Modeled elements
Loads are divided into two categories: critical loads, whose demand must be met, and
controllable loads, whose demand may be curtailed given a set of rules. The demand of
both loads is estimated before the problem is solved, but is not known until the system
is run in real-time (in silico or reality).
Demand on critical load 𝑗 at time π‘˜ is denoted 𝐷𝑗(π‘˜), where 𝑗 = {1, … , 𝑁𝑙} and π‘˜ =
{1, … , 𝑇}. For each controllable load β„Ž = {1, … , 𝑁𝑐} we define a fractional curtailment
limits 0 ≀ 𝛽𝑖,π‘šπ‘šπ‘š, 𝛽𝑖,π‘šπ‘šπ‘š ≀ 1, and a preferred power level π·β„Ž
𝑐
(π‘˜). Curtailment is tracked
by the decision variable π›½β„Ž.π‘šπ‘šπ‘š ≀ π›½β„Ž(π‘˜) ≀ π›½β„Ž.π‘šπ‘šπ‘š. Each curtailment also carries a penalty
coefficient πœŒβ„Ž, to be used in the cost function.
6.2.1 Storage unit
A single storage unit is modeled as a first-order system. Different charge and discharge
rates are used. This property creates a nonlinear model. The charge on the unit at
time π‘˜, π‘₯ 𝑏
(π‘˜), is modeled by
π‘₯ 𝑏(π‘˜ + 1) = π‘₯ 𝑏(π‘˜) + πœ‚π‘ƒ 𝑏(π‘˜) βˆ’ π‘₯ 𝑠𝑠
51
where π‘₯ 𝑠𝑠
is an ambient loss of charge, 𝑃 𝑏(π‘˜) is the power exchanged with the
microgrid (𝑃 𝑏
(π‘˜) > 0$ for charging and 𝑃 𝑏
(π‘˜) ≀ 0 for discharging), and
πœ‚ = οΏ½
πœ‚ 𝑐
, if 𝑃 𝑏(π‘˜) > 0 (charging mode)
πœ‚ 𝑑
, otherwise (discharging mode)
is the efficiency of the energy exchange. Note that 0 ≀ πœ‚ 𝑐
, πœ‚ 𝑑
≀ 1.
The problem is rearranged to two mixed-integer constraints:
π‘₯ 𝑏(π‘˜ + 1) = π‘₯ 𝑏(π‘˜) + οΏ½πœ‚ 𝑐
βˆ’
1
πœ‚ 𝑑
οΏ½ 𝑧 𝑏(π‘˜) +
1
πœ‚ 𝑑
𝑃 𝑏(π‘˜) βˆ’ π‘₯ 𝑠𝑠
𝔼1
𝑏
𝛿 𝑏(π‘˜) + 𝔼2
𝑏
𝑧 𝑏(π‘˜) ≀ 𝔼3
𝑏
𝑃 𝑏(π‘˜) + 𝔼4
𝑏
where 𝑧 𝑏(π‘˜) is an auxiliary variable that masks the nonlinearity
𝑧 𝑏(π‘˜) = 𝛿 𝑏(π‘˜)𝑃 𝑏
(π‘˜)
The column vectors are defined by
𝔼1
𝑏
= [𝐢 𝑏
βˆ’ (𝐢 𝑏
βˆ’ πœ–) 𝐢 𝑏
𝐢 𝑏
βˆ’ 𝐢 𝑏
βˆ’ 𝐢 𝑏] 𝑇
𝔼2
𝑏
= [0 0 1 βˆ’ 1 1 βˆ’ 1] 𝑇
𝔼3
𝑏
= [1 βˆ’ 1 1 βˆ’ 1 0 0] 𝑇
𝔼4
𝑏
= [𝐢 𝑏
βˆ’ πœ– 𝐢 𝑏
𝐢 𝑏
0 0] 𝑇
where 𝐢 𝑏
is the storage output power limit, and πœ– is the machine epsilon.
6.2.2 Interaction with main grid
When the microgrid is not islanded, power can be traded with the main grid. When
the spot price is low, power deficits can be purchased; when the price is high, excess
energy generated can be sold back to the grid for a profit.
Prices for purchasing and selling power are not necessarily equal, presenting a
nonlinearity. 𝑃 𝑔
(π‘˜) is the power exchanged at time π‘˜. A binary decision
variable 𝛿 𝑔
(π‘˜) switches the trading mode (𝛿 𝑔
(π‘˜) = 1 for purchasing power, 𝛿 𝑔
(π‘˜) =
0 for selling it). An auxiliary variable 𝐢 𝑔
(π‘˜) models the cost of this exchange:
𝐢 𝑔(π‘˜) = οΏ½
𝑐 𝑃(π‘˜)𝑃 𝑔
(π‘˜) if 𝛿 𝑔(π‘˜) = 1
𝑐 𝑆(π‘˜)𝑃 𝑔
(π‘˜) otherwise
Then the constraint is compacted as
𝔼1
𝑔
𝛿 𝑔(π‘˜) + 𝔼2
𝑔
𝐢 𝑔(π‘˜) ≀ 𝔼3
𝑔
(π‘˜)𝑃 𝑔(π‘˜) + 𝔼4
𝑔
where
52
𝔼1
𝑔
= [𝑇 𝑔
βˆ’ (𝑇 𝑔
+ πœ–) 𝑀 𝑔
𝑀 𝑔
βˆ’ 𝑀 𝑔
βˆ’ 𝑀 𝑔] 𝑇
𝔼2
𝑔
= [0 0 1 βˆ’ 1 1 βˆ’ 1] 𝑇
𝔼3
𝑔
= [1 βˆ’ 1 𝑐 𝑃(π‘˜) βˆ’π‘ 𝑃(π‘˜) 𝑐 𝑆(π‘˜) βˆ’ 𝑐 𝑆(π‘˜)] 𝑇
𝔼4
𝑔
= [𝑇 𝑔
βˆ’ πœ– 𝑀 𝑔
𝑀 𝑔
0 0] 𝑇
for 𝑀 𝑔
= max π‘˜(𝑐 𝑃(π‘˜), 𝑐 𝑆
(π‘˜)) Β· 𝑇 𝑔
.
6.2.3 Power generation
Power generation cost 𝐢 𝐷𝐷
(𝑃) is modeled as a quadratic function of generated
power 𝑃:
𝐢 𝐷𝐷(𝑃) = π‘Ž1 𝑃2
+ π‘Ž2 𝑃 + π‘Ž3
Cost coefficients π‘Ž1,𝑖, π‘Ž2,𝑖 and π‘Ž3,𝑖 are defined for each generator unit 𝑖 in the
microgrid, where 𝑖 = οΏ½1, … , 𝑁𝑔�. The binary decision variable 𝛿𝑖(π‘˜) controls the on/off
state of each generator at time π‘˜.
Start-up and shut-down costs are penalized as costs. These costs are given in the
parameters 𝑐𝑖
𝑆𝑆
and 𝑐𝑖
𝑆𝑆
for each DG unit. Costs are realized by the following constraints
on auxiliary variables π‘†π‘ˆπ‘–(π‘˜) and 𝑆𝐷𝑖(π‘˜):
π‘†π‘ˆπ‘–(π‘˜) ≀ 𝑐𝑖
𝑆𝑆
(π‘˜)[𝛿𝑖(π‘˜) βˆ’ 𝛿𝑖(π‘˜ βˆ’ 1)]
𝑆𝐷𝑖(π‘˜) ≀ 𝑐𝑖
𝑆𝑆
(π‘˜)[𝛿𝑖(π‘˜ βˆ’ 1) βˆ’ 𝛿𝑖(π‘˜)
π‘†π‘ˆπ‘–(π‘˜) ≀ 0
𝑆𝐷𝑖(π‘˜) ≀ 0
Minimizing over π‘†π‘ˆπ‘–(π‘˜) and 𝑆𝐷𝑖(π‘˜) with this formulation exploits slackness in the
MILP. For example, if unit 𝑖 is turned on at time π‘˜, then 𝛿𝑖(π‘˜ βˆ’ 1) = 0, and 𝛿𝑖(π‘˜) = 1.
Hence π‘†π‘ˆπ‘–(π‘˜) β‰₯ 𝑐𝑖
𝑆𝑆
, and is minimized to π‘†π‘ˆπ‘–
βˆ—
(π‘˜) = 𝑐𝑖
𝑆𝑆
. Otherwise, it is minimized
to π‘†π‘ˆπ‘–
βˆ—
(π‘˜) = 0.
Minimum on and off times 𝑇𝑖
𝑒𝑒
and 𝑇𝑖
𝑑𝑑𝑑𝑑
for the DG units are included in the model,
by constraining
𝛿𝑖(π‘˜) βˆ’ 𝛿𝑖(π‘˜ βˆ’ 1) ≀ 𝛿𝑖(𝜏 𝑒𝑒
)
𝛿𝑖(π‘˜ βˆ’ 1) βˆ’ 𝛿𝑖(π‘˜) ≀ 1 βˆ’ 𝛿𝑖(𝜏 𝑑𝑑𝑑𝑑
)
where 𝜏 𝑒𝑒
= οΏ½π‘˜ + 1, … , min(π‘˜ + 𝑇𝑖
𝑒𝑝
βˆ’ 1, 𝑇)οΏ½ and 𝜏 𝑑𝑑𝑑𝑑
= οΏ½π‘˜ + 1, … , min(π‘˜ + 𝑇𝑖
𝑑𝑑𝑑𝑑
βˆ’
1, 𝑇)οΏ½. These constraints also exploits slackness in the MILP. If the unit is switched on
at π‘˜, 𝛿𝑖(π‘˜) βˆ’ 𝛿𝑖(π‘˜ βˆ’ 1) = 1 and hence the optimal solution includes 𝜏 𝑒𝑒
= 1 for all 𝜏 𝑒𝑒
.
Otherwise 𝛿𝑖(𝜏 𝑒𝑒) β‰₯ 0; this is true regardless as 𝛿𝑖(𝜏 𝑒𝑒
) is a binary variable and
so 𝛿𝑖(𝜏 𝑒𝑒) ∈ {0,1}.
53
6.2.4 Conservation of energy
By conservation of energy, the net sum of power supplied and consumed is zero.
Hence,
οΏ½ 𝑃𝑖(π‘˜) + 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ(π‘˜) + 𝑃 𝑔(π‘˜) + 𝑃 𝑏(π‘˜) = οΏ½ 𝐷𝑗(π‘˜)
𝑁 𝑙
𝑗=1
𝑁 𝑔
𝑖=1
+ οΏ½[1 βˆ’ π›½β„Ž(π‘˜)]π·β„Ž
𝑐
(π‘˜)
𝑁 𝑐
β„Ž=1
Note that the sign of 𝑃 𝑏
(π‘˜) is negative, as 𝑃 𝑏
(π‘˜) > 0 represents the charging of the
storage unit, a consumption of power.
6.2.5 Physical constraints
Some final constraints on the operating limits of the grid elements are imposed:
π‘₯ π‘šπ‘šπ‘š
𝑏
≀ π‘₯ 𝑏(π‘˜) ≀ π‘₯ π‘šπ‘šπ‘š
𝑏
𝑃𝑖,π‘šπ‘šπ‘š 𝛿𝑖(π‘˜) ≀ 𝑃𝑖(π‘˜) ≀ 𝑃𝑖,π‘šπ‘šπ‘š 𝛿𝑖(π‘˜)
|𝑃𝑖(π‘˜ + 1) βˆ’ 𝑃𝑖(π‘˜)| ≀ 𝑅𝑖,π‘šπ‘šπ‘š 𝛿𝑖(π‘˜)
π›½β„Ž,π‘šπ‘šπ‘š ≀ π›½β„Ž(π‘˜) ≀ π›½β„Ž,π‘šπ‘šπ‘š
where π‘₯ π‘šπ‘šπ‘š
𝑏
, π‘₯ π‘šπ‘šπ‘š
𝑏
are charge limitations on the storage unit, 𝑃𝑖,π‘šπ‘šπ‘š, 𝑃𝑖.π‘šπ‘šπ‘š are generation
limits on the DG units, 𝑅𝑖,π‘šπ‘šπ‘š is the ramping limit of the DG units, and π›½β„Ž,π‘šπ‘šπ‘š, π›½β„Ž,π‘šπ‘šπ‘š are
the curtailment limits set on controllable loads.
6.3 Cost function
The problem cost function given in Parisio et al. [8] is a monetary cost in € for the
purchasing and operation of the day. This is converted to US$ by a trivial change in
parameters.
𝐽�π‘₯ π‘˜
𝑏
οΏ½
= min
𝒖 π‘˜
π‘‡βˆ’1
οΏ½ �𝑃 𝑔(π‘˜ + π‘ž) + 𝐢 𝑔(π‘˜ + π‘ž) + 2 Β· 𝑂𝑀 𝑏
Β· 𝑧 𝑏(π‘˜ + π‘ž) βˆ’ 𝑂𝑀 𝑏{𝑃 𝑔(π‘˜ + π‘ž) + 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ(π‘˜ + π‘ž)}
π‘‡βˆ’1
π‘ž=0
+ οΏ½ [𝑂𝑀𝑖 𝛿𝑖(π‘˜ + π‘ž) + πœŽπ‘–(π‘˜ + π‘ž) + π‘†π‘ˆπ‘–(π‘˜ + π‘ž) + 𝑆𝐷𝑖(π‘˜ + π‘ž) βˆ’ 𝑂𝑀 𝑏
𝑃𝑖(π‘˜ + π‘ž)]
𝑁 𝑔
𝑖=1
+ οΏ½ [πœŒβ„Ž(π‘˜ + π‘ž)π·β„Ž
𝑐
(π‘˜ + π‘ž)π›½β„Ž(π‘˜ + π‘ž) βˆ’ 𝑂𝑀 𝑏{βˆ’π·β„Ž
𝑐
(π‘˜ + π‘ž) + π·β„Ž
𝑐
(π‘˜ + π‘ž)π›½β„Ž(π‘˜ + π‘ž)}]
𝑁 𝑐
β„Ž=1
βˆ’ 𝑂𝑀 𝑏
οΏ½ �𝐷 π‘ž(π‘˜ + π‘ž)οΏ½
𝑁 𝑙
π‘ž=1
οΏ½
This function is compressed by vectors to
54
𝐽�π‘₯ π‘˜
𝑏
οΏ½
= min
𝒖 π‘˜
π‘‡βˆ’1
οΏ½ 𝒄 𝒖
𝑇(π‘˜ + 𝑗)𝒖(π‘˜ + 𝑗) + 𝒄 𝒛
𝑇
π‘‡βˆ’1
𝑗=0
𝒛(π‘˜ + 𝑗) βˆ’ 𝑂𝑀 𝑏
𝑭 𝑇(π‘˜ + 𝑗)𝒖(π‘˜ + 𝑗) βˆ’ 𝑂𝑀 𝑏
𝒇 𝑇
π’˜(π‘˜ + 𝑗)
where 𝑭 = [1 … 1, 1, … 𝐷𝑐(π‘˜) … ,0 … 0] 𝑇
𝒇 = [1, βˆ’1 … βˆ’ 1, βˆ’1 … βˆ’ 1] 𝑇
𝒄 𝒛 = [1 … 1,1,1 … 1,2 Β· 𝑂𝑀 𝑏] 𝑇
𝒄 𝒖(π‘˜) = [0 … 0,1, … πœŒπ‘–(π‘˜)𝐷𝑖
𝑐
(π‘˜) … , … 𝑂𝑀𝑖 … ] 𝑇
6.4 Forecasts
All forecasts are time-varying over 24 hours, and are estimated from figures in
Parisio et al. [8]. Renewable power generation 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ
is shown in Figure 48; critical load
demand 𝐷 is shown in Figure 49; and the spot price from the grid 𝑐 𝑃
is given in Figure
50. Note that 𝑐 𝑃
= 𝑐 𝑆
in all simulations in the source literature, which has been
maintained here.
Figure 48: Forecasted power production from renewable energy sources (RES)
0 5 10 15 20 25
0
100
200
300
400
500
600
700
Time (hr)
Power(kW)
Renewable production: Pres
55
Figure 49: Forecasted demand from the single critical load
Figure 50: Forecasted spot energy price for purchasing power from the grid
0 5 10 15 20 25
0
100
200
300
400
500
600
700
800
900
1000
Time (hr)
Power(kW)
Critical load demand: D
0 5 10 15 20 25
0
0.02
0.04
0.06
0.08
0.1
0.12
0.14
0.16
0.18
0.2
Time (hr)
Price($/kWh)
Spot purchasing price: c
P
56
6.5 Resulting problem
The resulting problem is an MILP, summarized in Appendix A. With the parameters
used in Appendix D, the problem has 672 variables and 2286 constraint equations. Of
the variables, 144 are binary and 528 are real numbers. This represents a problem over
24 hours with four DG units, one controllable load, and one critical load.
57
Chapter 7: Model Predictive Simulation and results
7.1 Methods
The problem is constructed in MATLAB [11]. Problem elements 𝑐 , 𝐴, 𝑏 and π’₯ are coded
directly, without use of an optimization modeling tool. Variables are treated as a single
vector π‘₯. Variable indices within π‘₯ are stored to allow for easy access to individual
variables.
The resulting MILP is solved in MOSEK [12] using its general optimization interface.
MOSEK recognizes the integer-bounded set and calls a branch and bound algorithm to
solve the problem. Information on this method is available in Section 0.
A table of parameters used in the model is available in Section 0. Some parameters were
explicitly given in literature [8, 9, 10]. Others were inferred from figures in these papers,
and some were selected as to not impact the outcome of the simulations (e.g. the grid
interconnect limit was set to 𝑇 𝑔
= 500 kW, in significant excess of grid exchanges
shown in Parisio’s results [8]).
Some sensitive parameters were critical to the simulation results of the model, but were
not available or easily inferred from the literature. As they were heavily dependent on
the known parameters of the model, approximations from other literature were of little
use. This constraint jeopardizes the simulations provided. However, it does not impact
the ability of the model to be used in contexts outside of this parameter set.
7.2 Simulations
Three simulations are performed:
Open-loop, deterministic: The problem is solved with perfect data at the beginning of
the day. The optimal control path is made at 𝑑 = 0, and so the system is run open-loop.
As the optimal control path for the problem, this simulation represents the performance
benchmark.
β€’ Open-loop, nondeterministic: The problem is solved with forecasted data at the
beginning of the day. The problem is then simulated at each hour. Deviations in the final
power balance are settled by purchasing deficit power from (or selling excess power to)
the grid.
β€’ Closed-loop (MPC): The system is controlled using model predictive control. The
problem is solved every hour for the remaining hours in the day. Forecasted data is used
to make decisions. The problem is then simulated for the upcoming hour. Deviations in
power are traded across the grid.
Forecasted data is generated by adding randomly-generated noise to the actual values
of 𝐷, 𝑐 𝑃
= 𝑐 𝑆
and 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ
. This noise is normally distributed with zero-mean, with standard
58
deviation 5% of the mean of the data. This leads to time-invariant estimationβ€”forecast
quality is independent of the proximity of the event. This may not be realistic, as
information on requirements and resources is likely to improve with time.
7.3 Results
7.3.1 Cost comparison
The optimal cost for the open-loop deterministic system is $1,025. This value
represents benchmark performance.
The open-loop nondeterministic system and the closed loop system performed
reasonably similarly. The performance difference between the two systems was
negligible. This is likely due to the time-invariant estimation, which may not be a
realistic forecasting model. If estimation noise was increased too large, the system
would become infeasible. Future work will implement infeasibility handling in the
controller.
From a 100-sample Monte Carlo experiment, the median [IQR] estimated cost was
$973 [914–1032], and the resulting cost in simulation was $1044 [1025–1062].
7.3.2 System elements
DG units were fixed on throughout the entire day (𝛿𝑖(π‘˜) = 1, βˆ€π‘–, π‘˜). This was true
even if start-up/shut-down costs were neglected and minimum up/down times were not
enforced. Power generation on all units was only maximized in the evening. Power
generation curves are shown in Figure 51.
59
Figure 51: Power generation in DG units
The controllable load was not curtailed (π›½β„Ž(π‘˜) = 0). All critical load demands were
met.
Power transfer involved both buying and selling power from the grid. Power was
sold in the morning and evenings, and purchased during the peak time of the day.
Although the spot price for purchasing is greatest at midday, this is when demand
spikes, giving explanation to this outcome. Importing behavior is shown in Figure 52.
Figure 52: Power exchange with the grid
0 5 10 15 20 25
0
50
100
P
1
Power level of a DG unit (P)
0 5 10 15 20 25
0
50
100
P
2
0 5 10 15 20 25
0
50
100
P
3
0 5 10 15 20 25
0
50
100
P
4
Time (hr)
0 5 10 15 20 25
-400
-300
-200
-100
0
100
200
300
400
500
Pg
4
Inported power from the grid (Pg
)
Time (hr)
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Ξ΄
g
Importing mode from utility grid (Ξ΄g
)
Time (hr)
60
The storage unit was completely charged in the morning at lowest spot price and
demand. Minimum power to maintain full charge was given to counteract physiological
storage loss. The unit was discharged at 10am, when demand began to spike. It was
then recharged and subsequently discharged at 8pm. Results are shown in .
Figure 53: Behavior of the storage unit
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Ξ΄b
Charging state of storage unit (Ξ΄b
)
Time (hr)
0 5 10 15 20 25
-150
-100
-50
0
50
100
150
Pb
Power exchanged with storage unit (Pb
)
Time (hr)
0 5 10 15 20 25
0
50
100
150
200
250
300
xb
Stored energy (xb
)
Time (hr)
61
Chapter 8: Conclusion
In this research, a control system that contains Model Predictive Adaptive
Control and Repetitive Control is proposed to provide superior power quality and
maintain the safety of the microgrid. The Hardware-in-the-loop simulation of the
microgrid system gives the following conclusions:
β€’ In grid-connected mode, the DERs in the microgrid system are decoupled with
each other. The dynamic response from one DER will not affect the other. While
the coupling effect is significant in islanded mode.
β€’ The strong coupling effect in islanded mode can be attenuated by applying LQI
control to each DER. And the decoupled closed-loop system enables the design
of repetitive control for each individual DER.
β€’ The power spectrum from Hardware-in-the-loop simulation shows that
repetitive control is able to effectively suppress the 3th harmonic in the output
current.
β€’ The proposed Model Predictive Control is able to utilize the predicted
renewable energy production and predicted critical load demand to make
optimal decision for controllable DERs.
62
GLOSSARY
Term Definition
DER Distributed Energy Resource
DG Distributed Generation
HiL Hardware in the Loop
KCL Kirchoff Current Law
KVL Kirchoff Voltage Law
LQI Linear Quadratic Integrator
MILP Mixed Integer Linear Program
MPC Model Predictive Control
MPPT Maximum Power Point Tracking
PI Proportional Integral Control
PMSG Permanent Magnet Synchronus Generator
PV Photovoltaic Array
63
References
[1] IEA, "2012 Key World Energy Statistics," 2012. [Online]. Available:
http://www.iea.org/publications/freepublications/publication/kwes.pdf.
[2] C. M. Colson and M. H. Nehrir, "A Review of Challenges to Real-Time Power Management
of Microgrids," IEEE Power & ENergy Society Generatl Meeting, 2009.
[3] B. Kroposki, R. Lasseter, T. Ise, S. Morozumi, S. Papathanassiou and N. Hatziargyriou,
"Making Microgrids Work," IEEE Power & Energy Magazine, 2008.
[4] B. Kroposki, T. Basso and R. DeBlasio, "Microgrid Standards and Technologies," Power and
Energy Society General Meeting - Conversion and Delivery of Electrical Energy in the 21st
Century, 2008.
[5] S. Cocconi, S. Cuk and R. D. MIddlebrook, "High Frequency Islated 4kW Photovoltaic
Inverter for Utility Interface," Power Conversion International, pp. 26-48, 1984.
[6] H. Watanable, T. Shimizu and G. Kimura, "A Novel Utility Interactive Photovoltaic Inverter
With Generation Control Circuit," Proc. 24th Annual Conference of THe IEEE Industrial
Electronics Society (IECON), pp. 721-5, 19998.
[7] N. Kikuchi, S. Shigeeda, H. Watanabe, T. Ohnishi and F. Harashima, "Singel Phase Amplitude
Modulation Inverter for Utility Interaction Photovoltaic System," Proc. 25th Annual
Conference of the IEEE Industrial Electronics Society (IECON), pp. 385-9, 1999.
[8] M. G. Villalva, J. R. Gazoli and others, "Comprehensive approach to modeling and
simulation of photovoltaic arrays," Power Electronics, IEEE Transactions on, vol. 24, no. 5,
pp. 1198-1208, 2009.
[9] D. Gaonkar, G. Pillai and R. Patel, "Seamless transfer of microturbine generation system
operation between grid-connected and islanding modes," Electric Power Components and
Systems, vol. 37, no. 2, pp. 174-188, 2009.
[10] P. Basak, A. Saha, S. Chowdhury and S. Chowdhury, "Microgrid: Control techniques and
modeling," in Universities Power Engineering Conference (UPEC), 2009 Proceedings of the
44th International, 2009.
[11] R. Halvgaard, "Model Predictive Control for Smart Energy Systems," Technical University of
Denmark, Office for Study Programmes and Student Affairs.
[12] H. Jiefeng, "Advanced Control in Smart Microgrids," 2013.
[13] A. Parisio, E. Rikos and L. Glielmo, "A Model Predictive Control Approach to Microgrid
Operation Optimization," 2014.
[14] A. Parisio and L. Glielmo, "Energy efficient microgrid management using model predictive
control," in Decision and Control and European Control Conference (CDC-ECC), 2011 50th
IEEE Conference on, 2011.
[15] A. Parisio, E. Rikos, G. Tzamalis and L. Glielmo, "Use of model predictive control for
experimental microgrid optimization," Applied Energy, vol. 115, pp. 37-46, 2014.
64
[16] Mathworks, "MATLAB-The Language of Technical Computting," 2014.
[17] MOSEK, "MOSEK ApS-Large scale optimization software," 2014.
[18] S. Boyd and L. Vandenberghe, Convex Optimization, Cambridge Press, 2004.
[19] J. Mattingley, Y. Wang and S. Boyd, "Receding horizon control," Control Systems, IEEE, vol.
31, no. 3, pp. 52-65, 2011.
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport
ETD_FinalReport

Weitere Γ€hnliche Inhalte

Was ist angesagt?

Study and realization of dc micro-grid for remote areas.
Study and realization of dc micro-grid for remote areas.Study and realization of dc micro-grid for remote areas.
Study and realization of dc micro-grid for remote areas.Umair Hashmi
Β 
Microgrid. iettrichy
Microgrid. iettrichyMicrogrid. iettrichy
Microgrid. iettrichySankaraVinayagam
Β 
Microgrid Training Course From Tonex Experts
Microgrid Training Course From Tonex ExpertsMicrogrid Training Course From Tonex Experts
Microgrid Training Course From Tonex ExpertsTonex
Β 
Micro-Grid Site Summaries
Micro-Grid Site SummariesMicro-Grid Site Summaries
Micro-Grid Site SummariesJonathan Bassett
Β 
Island Energy Conference 2014 - Microgrids
Island Energy Conference 2014 - MicrogridsIsland Energy Conference 2014 - Microgrids
Island Energy Conference 2014 - MicrogridsNorthernReliability
Β 
Planning a successful microgrid
Planning a successful microgridPlanning a successful microgrid
Planning a successful microgridTRC Companies, Inc.
Β 
Novel Energy Management System for a DC MicroGrid
Novel Energy Management System for a DC MicroGridNovel Energy Management System for a DC MicroGrid
Novel Energy Management System for a DC MicroGridrahulmonikasharma
Β 
ModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 Presentation
ModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 PresentationModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 Presentation
ModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 PresentationEnergy Technologies, Inc. (ETI)
Β 
Modified ppt for mtech project
Modified ppt for mtech projectModified ppt for mtech project
Modified ppt for mtech projectbetha divya
Β 
Energy trading in microgrids and managment system
Energy trading in microgrids and managment systemEnergy trading in microgrids and managment system
Energy trading in microgrids and managment systemmuhammad yousaf khan
Β 
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPTMicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPTο£Ώ Abin Baby
Β 
Microgrid technology
Microgrid technologyMicrogrid technology
Microgrid technologyAyushi Bhardwaj
Β 
Micro grid
Micro gridMicro grid
Micro gridNadeem Rana
Β 
Microgrid Presentation
Microgrid PresentationMicrogrid Presentation
Microgrid PresentationShahab Khan
Β 

Was ist angesagt? (20)

Study and realization of dc micro-grid for remote areas.
Study and realization of dc micro-grid for remote areas.Study and realization of dc micro-grid for remote areas.
Study and realization of dc micro-grid for remote areas.
Β 
Micro grid2.0.ppt
Micro grid2.0.pptMicro grid2.0.ppt
Micro grid2.0.ppt
Β 
Microgrid. iettrichy
Microgrid. iettrichyMicrogrid. iettrichy
Microgrid. iettrichy
Β 
Microgrid Training Course From Tonex Experts
Microgrid Training Course From Tonex ExpertsMicrogrid Training Course From Tonex Experts
Microgrid Training Course From Tonex Experts
Β 
Microgrid
MicrogridMicrogrid
Microgrid
Β 
Micro-Grid Site Summaries
Micro-Grid Site SummariesMicro-Grid Site Summaries
Micro-Grid Site Summaries
Β 
Island Energy Conference 2014 - Microgrids
Island Energy Conference 2014 - MicrogridsIsland Energy Conference 2014 - Microgrids
Island Energy Conference 2014 - Microgrids
Β 
Planning a successful microgrid
Planning a successful microgridPlanning a successful microgrid
Planning a successful microgrid
Β 
The What and Why of Microgrids 4
The What and Why of Microgrids 4The What and Why of Microgrids 4
The What and Why of Microgrids 4
Β 
Rahul[1]
Rahul[1]Rahul[1]
Rahul[1]
Β 
Novel Energy Management System for a DC MicroGrid
Novel Energy Management System for a DC MicroGridNovel Energy Management System for a DC MicroGrid
Novel Energy Management System for a DC MicroGrid
Β 
Microgrid sem 1
Microgrid sem 1Microgrid sem 1
Microgrid sem 1
Β 
ModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 Presentation
ModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 PresentationModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 Presentation
ModularΒ ScalableΒ MicroΒ Grid: ICEPAG 2016 Presentation
Β 
Modified ppt for mtech project
Modified ppt for mtech projectModified ppt for mtech project
Modified ppt for mtech project
Β 
Energy trading in microgrids and managment system
Energy trading in microgrids and managment systemEnergy trading in microgrids and managment system
Energy trading in microgrids and managment system
Β 
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPTMicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
MicroGrid and Energy Storage System COMPLETE DETAILS NEW PPT
Β 
Shivya
ShivyaShivya
Shivya
Β 
Microgrid technology
Microgrid technologyMicrogrid technology
Microgrid technology
Β 
Micro grid
Micro gridMicro grid
Micro grid
Β 
Microgrid Presentation
Microgrid PresentationMicrogrid Presentation
Microgrid Presentation
Β 

Andere mochten auch

Certsmicrogridwhitepaper
CertsmicrogridwhitepaperCertsmicrogridwhitepaper
CertsmicrogridwhitepaperĐẑi LΓͺ
Β 
MECE3410U Report - Renewable Microgrid for a Community in Fiji
MECE3410U Report - Renewable Microgrid for a Community in FijiMECE3410U Report - Renewable Microgrid for a Community in Fiji
MECE3410U Report - Renewable Microgrid for a Community in FijiTushar Karanwal
Β 
Performance enhancement of actively controlled hybrid dc microgrid incorporat...
Performance enhancement of actively controlled hybrid dc microgrid incorporat...Performance enhancement of actively controlled hybrid dc microgrid incorporat...
Performance enhancement of actively controlled hybrid dc microgrid incorporat...Asoka Technologies
Β 
wireless fault protection and detection for dc microgrid
wireless fault protection and detection for dc microgrid wireless fault protection and detection for dc microgrid
wireless fault protection and detection for dc microgrid MAHESH M
Β 
Hybrid AC/DC microgrid and Electric Vehicles
Hybrid AC/DC microgrid and Electric VehiclesHybrid AC/DC microgrid and Electric Vehicles
Hybrid AC/DC microgrid and Electric VehiclesMd Shamiur Rahman
Β 
IthacaSouthEnergyDistrictMicrogridStudyDec2016
IthacaSouthEnergyDistrictMicrogridStudyDec2016IthacaSouthEnergyDistrictMicrogridStudyDec2016
IthacaSouthEnergyDistrictMicrogridStudyDec2016Louis Monteagudo
Β 
2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...
2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...
2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...OPAL-RT TECHNOLOGIES
Β 
2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos
2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos
2017 Atlanta Regional User Seminar - Real-Time Microgrid DemosOPAL-RT TECHNOLOGIES
Β 

Andere mochten auch (8)

Certsmicrogridwhitepaper
CertsmicrogridwhitepaperCertsmicrogridwhitepaper
Certsmicrogridwhitepaper
Β 
MECE3410U Report - Renewable Microgrid for a Community in Fiji
MECE3410U Report - Renewable Microgrid for a Community in FijiMECE3410U Report - Renewable Microgrid for a Community in Fiji
MECE3410U Report - Renewable Microgrid for a Community in Fiji
Β 
Performance enhancement of actively controlled hybrid dc microgrid incorporat...
Performance enhancement of actively controlled hybrid dc microgrid incorporat...Performance enhancement of actively controlled hybrid dc microgrid incorporat...
Performance enhancement of actively controlled hybrid dc microgrid incorporat...
Β 
wireless fault protection and detection for dc microgrid
wireless fault protection and detection for dc microgrid wireless fault protection and detection for dc microgrid
wireless fault protection and detection for dc microgrid
Β 
Hybrid AC/DC microgrid and Electric Vehicles
Hybrid AC/DC microgrid and Electric VehiclesHybrid AC/DC microgrid and Electric Vehicles
Hybrid AC/DC microgrid and Electric Vehicles
Β 
IthacaSouthEnergyDistrictMicrogridStudyDec2016
IthacaSouthEnergyDistrictMicrogridStudyDec2016IthacaSouthEnergyDistrictMicrogridStudyDec2016
IthacaSouthEnergyDistrictMicrogridStudyDec2016
Β 
2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...
2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...
2017 Atlanta Regional User Seminar - Using OPAL-RT Real-Time Simulation and H...
Β 
2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos
2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos
2017 Atlanta Regional User Seminar - Real-Time Microgrid Demos
Β 

Γ„hnlich wie ETD_FinalReport

APPENDICES California Energy Commission 500-2013-134-APPENDIXES
APPENDICES California Energy Commission 500-2013-134-APPENDIXESAPPENDICES California Energy Commission 500-2013-134-APPENDIXES
APPENDICES California Energy Commission 500-2013-134-APPENDIXESFranco Moriconi
Β 
California Energy Comission 500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...
California Energy Comission  500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...California Energy Comission  500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...
California Energy Comission 500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...Franco Moriconi
Β 
AnnaUniversity electives.pdf
AnnaUniversity electives.pdfAnnaUniversity electives.pdf
AnnaUniversity electives.pdfKandavelEee
Β 
Uk china- partners in energy research-impact case-kang li+yusheng xue
Uk china- partners in energy research-impact case-kang li+yusheng xueUk china- partners in energy research-impact case-kang li+yusheng xue
Uk china- partners in energy research-impact case-kang li+yusheng xueJing Deng
Β 
Phasor Measurement Unit (PMU) Implementation and Applications
Phasor Measurement Unit (PMU) Implementation and ApplicationsPhasor Measurement Unit (PMU) Implementation and Applications
Phasor Measurement Unit (PMU) Implementation and ApplicationsPower System Operation
Β 
Overview of Microgrids
Overview of MicrogridsOverview of Microgrids
Overview of MicrogridsCapeLightEnergy
Β 
microgrid poster big - kim + pat + aaron- edited for LinkedIn
microgrid poster big - kim + pat + aaron- edited for LinkedInmicrogrid poster big - kim + pat + aaron- edited for LinkedIn
microgrid poster big - kim + pat + aaron- edited for LinkedInAaron Baltich-Schecter
Β 
economic-and-resiliency-impact-of-pv-and-storage
economic-and-resiliency-impact-of-pv-and-storageeconomic-and-resiliency-impact-of-pv-and-storage
economic-and-resiliency-impact-of-pv-and-storageTravis Simpkins
Β 
CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)
CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)
CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)Brooke Maushund
Β 
CaLEAP Energy Strategies Workshop June 25, 2013
CaLEAP Energy Strategies Workshop June 25, 2013CaLEAP Energy Strategies Workshop June 25, 2013
CaLEAP Energy Strategies Workshop June 25, 2013Public Technology Institute
Β 
Clean energy microgrids - Hype or Reality?
Clean energy microgrids - Hype or Reality?Clean energy microgrids - Hype or Reality?
Clean energy microgrids - Hype or Reality?Daniel Schwab
Β 
RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab
RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab
RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab OPAL-RT TECHNOLOGIES
Β 
Power quality improvement of distributed generation integrated ne
Power quality improvement of distributed generation integrated nePower quality improvement of distributed generation integrated ne
Power quality improvement of distributed generation integrated neNagaraj Madival
Β 
Kimberly King Resume [June 2017]
Kimberly King Resume [June 2017]Kimberly King Resume [June 2017]
Kimberly King Resume [June 2017]Kimberly L. King
Β 
Multi agent oriented solution for forecasting-based control strategy with loa...
Multi agent oriented solution for forecasting-based control strategy with loa...Multi agent oriented solution for forecasting-based control strategy with loa...
Multi agent oriented solution for forecasting-based control strategy with loa...Mohamed Ghaieth Abidi
Β 
EPRI Flexibility toolkit.pdf
EPRI Flexibility toolkit.pdfEPRI Flexibility toolkit.pdf
EPRI Flexibility toolkit.pdfPRAMODKUMARNANDA
Β 

Γ„hnlich wie ETD_FinalReport (20)

APPENDICES California Energy Commission 500-2013-134-APPENDIXES
APPENDICES California Energy Commission 500-2013-134-APPENDIXESAPPENDICES California Energy Commission 500-2013-134-APPENDIXES
APPENDICES California Energy Commission 500-2013-134-APPENDIXES
Β 
California Energy Comission 500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...
California Energy Comission  500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...California Energy Comission  500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...
California Energy Comission 500-2013-134 DEVELOPMENT OF FAULT CURRENT CONTRO...
Β 
AnnaUniversity electives.pdf
AnnaUniversity electives.pdfAnnaUniversity electives.pdf
AnnaUniversity electives.pdf
Β 
Uk china- partners in energy research-impact case-kang li+yusheng xue
Uk china- partners in energy research-impact case-kang li+yusheng xueUk china- partners in energy research-impact case-kang li+yusheng xue
Uk china- partners in energy research-impact case-kang li+yusheng xue
Β 
Poster
PosterPoster
Poster
Β 
UCLA - Solar Canal Feasibility Study
UCLA - Solar Canal Feasibility StudyUCLA - Solar Canal Feasibility Study
UCLA - Solar Canal Feasibility Study
Β 
Phasor Measurement Unit (PMU) Implementation and Applications
Phasor Measurement Unit (PMU) Implementation and ApplicationsPhasor Measurement Unit (PMU) Implementation and Applications
Phasor Measurement Unit (PMU) Implementation and Applications
Β 
Overview of Microgrids
Overview of MicrogridsOverview of Microgrids
Overview of Microgrids
Β 
microgrid poster big - kim + pat + aaron- edited for LinkedIn
microgrid poster big - kim + pat + aaron- edited for LinkedInmicrogrid poster big - kim + pat + aaron- edited for LinkedIn
microgrid poster big - kim + pat + aaron- edited for LinkedIn
Β 
economic-and-resiliency-impact-of-pv-and-storage
economic-and-resiliency-impact-of-pv-and-storageeconomic-and-resiliency-impact-of-pv-and-storage
economic-and-resiliency-impact-of-pv-and-storage
Β 
my project
my projectmy project
my project
Β 
CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)
CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)
CAL_RAE_RAEL_short_global_microgrids_prospectus_1(1)
Β 
CaLEAP Energy Strategies Workshop June 25, 2013
CaLEAP Energy Strategies Workshop June 25, 2013CaLEAP Energy Strategies Workshop June 25, 2013
CaLEAP Energy Strategies Workshop June 25, 2013
Β 
Clean energy microgrids - Hype or Reality?
Clean energy microgrids - Hype or Reality?Clean energy microgrids - Hype or Reality?
Clean energy microgrids - Hype or Reality?
Β 
RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab
RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab
RT15 Berkeley | Grid Intergration Group - Lawrence Berkeley National Lab
Β 
Power quality improvement of distributed generation integrated ne
Power quality improvement of distributed generation integrated nePower quality improvement of distributed generation integrated ne
Power quality improvement of distributed generation integrated ne
Β 
1.1_Power Systems Engineering R&D_Ton_EPRI/SNL Symposium
1.1_Power Systems Engineering R&D_Ton_EPRI/SNL Symposium1.1_Power Systems Engineering R&D_Ton_EPRI/SNL Symposium
1.1_Power Systems Engineering R&D_Ton_EPRI/SNL Symposium
Β 
Kimberly King Resume [June 2017]
Kimberly King Resume [June 2017]Kimberly King Resume [June 2017]
Kimberly King Resume [June 2017]
Β 
Multi agent oriented solution for forecasting-based control strategy with loa...
Multi agent oriented solution for forecasting-based control strategy with loa...Multi agent oriented solution for forecasting-based control strategy with loa...
Multi agent oriented solution for forecasting-based control strategy with loa...
Β 
EPRI Flexibility toolkit.pdf
EPRI Flexibility toolkit.pdfEPRI Flexibility toolkit.pdf
EPRI Flexibility toolkit.pdf
Β 

ETD_FinalReport

  • 1. Energy Research and Development Division FINAL PROJECT REPORT MODELLING AND CONTROL OF MICROGRID Repetitive and Model Predictive Control CEC-500-2014-OCT Prepared for: California Energy Commission Prepared by: UCLA
  • 2. PREPARED BY: Primary Author(s): Kuo-Tai Teng Sandeep Rai Lieven Vandenberghe Tsu-Chin Tsao UCLA 420 Westwood Plaza Los Angeles, Ca 90095 Phone: 310-206-2819 http://www.mae.ucla.edu Contract Number: 500-01-043 Prepared for: California Energy Commission Therese Peffer Contract Manager Matthew Fung Office Manager Energy XXXXXXXX Research Office Laurie ten Hope Deputy Director ENERGY RESEARCH AND DEVELOPMENT DIVISION Robert P. Oglesby Executive Director DISCLAIMER This report was prepared as the result of work sponsored by the California Energy Commission. It does not necessarily represent the views of the Energy Commission, its employees or the State of California. The Energy Commission, the State of California, its employees, contractors and subcontractors make no warranty, express or implied, and assume no legal liability for the information in this report; nor does any party represent that the uses of this information will not infringe upon privately owned rights. This report has not been approved or disapproved by the California Energy Commission nor has the California Energy Commission passed upon the accuracy or adequacy of the information in this report.
  • 3. i PREFACE The California Energy Commission Energy Research and Development Division supports public interest energy research and development that will help improve the quality of life in California by bringing environmentally safe, affordable, and reliable energy services and products to the marketplace. The Energy Research and Development Division conduct public interest research, development, and demonstration (RD&D) projects to benefit California. The Energy Research and Development Division strives to conduct the most promising public interest energy research by partnering with RD&D entities, including individuals, businesses, utilities, and public or private research institutions. Energy Research and Development Division funding efforts are focused on the following RD&D program areas: β€’ Buildings End-Use Energy Efficiency β€’ Energy Innovations Small Grants β€’ Energy-Related Environmental Research β€’ Energy Systems Integration β€’ Environmentally Preferred Advanced Generation β€’ Industrial/Agricultural/Water End-Use Energy Efficiency β€’ Renewable Energy Technologies β€’ Transportation Modelling and Control of Microgrid: Repetitive and Adaptive Control is the final report for the Enabling Technology Development project contract number 500‐01‐043 conducted by UCLA. The information from this project contributes to Energy Research and Development Division’s Environmentall Preferred Advanced Generation Program. For more information about the Energy Research and Development Division, please visit the Energy Commission’s website at www.energy.ca.gov/research/ or contact the Energy Commission at 916-327-1551.
  • 4. ii
  • 5. iii ABSTRACT In this research, a control system that contains Model Predictive Adaptive Control and Repetitive Control is proposed to provide superior power quality and maintain the safety of the microgrid during islanded, grid-connected, and transition modes. First, the overall microgrid consisting of a photovoltaic arrays, windmill, battery, and microturbine was modeled and analyzed using computer simulations, and then a Hardware-in-the-loop simulation of the microgrid proved the control algorthms can be implemented in hardware. The simulation revealed four major findings. Firstly, in grid-connected mode, the DERs in the microgrid system are decoupled with each other. Therfore, the dynamic response from one DER will not affect the other, while the coupling effect is significant in islanded mode. Seconly, the strong coupling effect in islanded mode can be attenuated by applying LQI control to each DER, and then the decoupled closed-loop system enables the design of repetitive control for each individual DER. Thirdly, the power spectrum from Hardware-in-the-loop simulation shows that repetitive control is able to effectively suppress the 3th harmonic in the output current and enables a smooth transistion from grid connected to islanded. Lastly, the proposed Model Predictive Control is able to utilize the predicted renewable energy production and predicted critical load demand to make optimal decision for controllable DERs. Keywords: Microgrid, Repetitive control, Hardwar in the loop, LQI, harmonic rejection, Model Predictive Control, grid transition Tsao, Tsu-Chin; Kuo-Tai Teng; Sandeep Rai. (UCLA). 2014. Modelling and Control of Micorgrid: Repetitive and Model Predictive Control. California Energy Commission. Publication number: CEC-500-2014-Oct.
  • 6. iv Contents PREFACE.....................................................................................................................................................i ABSTRACT..............................................................................................................................................iii List of Figures ......................................................................................................................................... vii EXECUTIVE SUMMARY........................................................................................................................1 Introduction ............................................................................................................................................1 Project Purpose.......................................................................................................................................1 Project Results.........................................................................................................................................2 Project Benefits .......................................................................................................................................3 Chapter 1: Introduction............................................................................................................................5 Chapter 2: Modeling of the Microgrid..................................................................................................7 2.1 Single Phase Converters..................................................................................................................7 2.1.1 Inverter.......................................................................................................................................7 2.1.2 LCL Inverter Model .................................................................................................................8 2.1.3 DC/DC Boost Converter..........................................................................................................9 2.2 Power Converters for Single Phase Microgrid ..........................................................................10 2.2.1 DC/DC – DC/AC Boost Inverter..........................................................................................10 2.2.2DC/AC Bidirectional Converter ...........................................................................................12 2.3 Distributed Energy Models ..........................................................................................................13 2.3.1 Windmill/ Turbine Model....................................................................................................13 2.3.2 Photovoltaic Model................................................................................................................16 2.3.3 Microturbine Model ..............................................................................................................17 2.3.4Battery Model...........................................................................................................................19 2.4 Microgrid Model ............................................................................................................................19 Chapter 3: Control of the Microgrid....................................................................................................22 3.1 Windmill and Photovoltaic Control Strategy ............................................................................22
  • 7. v 3.2 Microturbine Control Strategy.....................................................................................................24 3.3 Inverter Control..............................................................................................................................25 3.3.1 LCL filter design.....................................................................................................................27 3.3.2 Current/Voltage Controller ..................................................................................................28 3.3.3 Linear Quadratic Regulator with Integral Design...........................................................31 3.3.4 Plug-In Repetitive Control Design.....................................................................................34 Chapter 4: Simulation Results..............................................................................................................35 4.1 Island Mode Repetitive Control and LQI...................................................................................35 4.2 Grid Connected Simulation..........................................................................................................39 4.3 Different Power Scenarios ............................................................................................................41 Chapter 5: Hardware-in-the-loop Simulation....................................................................................43 5.1 Numerical Solver ...........................................................................................................................44 5.2 Parallel solving structure ..............................................................................................................46 5.3 HIL simulation results with Repetitive Control ........................................................................46 Chapter 6: System Level Model and Problem Formulation............................................................50 6.1 Introduction ....................................................................................................................................50 6.2 Modeled elements..........................................................................................................................50 6.2.1 Storage unit .............................................................................................................................50 6.2.2 Interaction with main grid ...................................................................................................51 6.2.3 Power generation....................................................................................................................52 6.2.4 Conservation of energy.........................................................................................................53 6.2.5 Physical constraints ...............................................................................................................53 6.3 Cost function...................................................................................................................................53 6.4 Forecasts..........................................................................................................................................54 6.5 Resulting problem..........................................................................................................................56 Chapter 7: Model Predictive Simulation and results.......................................................................57 7.1 Methods...........................................................................................................................................57 7.2 Simulations .....................................................................................................................................57
  • 8. vi 7.3 Results..............................................................................................................................................58 7.3.1 Cost comparison.....................................................................................................................58 7.3.2 System elements.....................................................................................................................58 Chapter 8: Conclusion............................................................................................................................61 References.................................................................................................................................................63 Appendix A ................................................................................................................................................1 A.1 Final MPC optimization problem.................................................................................................1 Appendix B.................................................................................................................................................1 B.1 Mixed-integer linear programs......................................................................................................1 B.1.1 Introduction to MILPs ............................................................................................................1 B.1.2 Solving MILPs..........................................................................................................................1 B.1.3 Algorithm..................................................................................................................................1 B.1.4 Bounding methods..................................................................................................................2 B.1.5 Pruning......................................................................................................................................3 Appendix C ................................................................................................................................................1 C.1 Model predictive control................................................................................................................1 C.1.1 Introduction to MPC...............................................................................................................1 C.1.2 Problem formulation ..............................................................................................................1 C.1.3 Handling Infeasibility............................................................................................................2 Appendix D................................................................................................................................................1 D.1 MPC model parameters .................................................................................................................1 D.1.1 Parameters................................................................................................................................1 D.1.2 Forecasted quantities..............................................................................................................2 D.1.3 Variables...................................................................................................................................2 D.1.4 Auxiliary variables .................................................................................................................2
  • 9. vii List of Figures Figure 1- Inverters are a key component in the microgrid ..................................................................7 Figure 2-Full PWM bridge inverter topology used in the simulation................................................8 Figure 3 -Schematic of the DC DC Boost converter ............................................................................10 Figure 4- A boost converter and inverter is cascaded to supply maximum power to the loads..10 Figure 5-Circuit schematic of a boost converter and inverter cascaded together...........................11 Figure 6- A circuit schematic for the bi-directional inverter..............................................................12 Figure 7- General schematic of the windmill system with all subsystems included .....................13 Figure 8- the nonlinear dependence of the windmill power with various parameters.................15 Figure 9- detailed circuit diagram of the windmill model.................................................................15 Figure 10-Single diode photovoltaic model .........................................................................................16 Figure 11- Example of the output power as the impedance varies...................................................17 Figure 12-Main components of a microturbine for microgrid application......................................17 Figure 13-Block diagram of the turbine model typically used for microturbines ..........................18 Figure 14-Simple battery model.............................................................................................................19 Figure 15-High level representation of each leg..................................................................................19 Figure 16-General representation and visualization of interconnecting individual legs. .............21 Figure 17-Overall control strategy for windmill and photovoltaic...................................................22 Figure 18: Flowchart of the Perturb and Observe method.................................................................23 Figure 19: Block diagram of the incremental conductance algorithm..............................................24 Figure 20-Microturbine control strategy, speed control for PMSG and inverter control ..............24 Figure 21-Block diagram of the rectifier control strategy...................................................................25 Figure 22-Control strategy for the battery during grid connected mode ........................................25 Figure 23-Control strategy for the battery inverter during island mode.........................................26 Figure 24-Control strategy for PV, windmill, and microturbine leg ................................................27 Figure 25-Frequency response of the LCL inverter using the specified inductor and capacitor values.........................................................................................................................................................28 Figure 26-Overall schematic for the microgrid. The battery leg is able to operate in voltage mode during islanding and current mode during grid connected..............................................................29 Figure 27-Descretization of the linear coupled island model............................................................31 Figure 28-LQI controller block diagram ...............................................................................................31 Figure 29- reduction of cross coupling using LQI...............................................................................33 Figure 30-Block diagram of the "plug-in" repetitive controller.........................................................34 Figure 31: Schematic of a Microgrid system.........................................................................................35 Figure 32-Error in output voltage during island mode using LQI and repetitive control ............36 Figure 33-LQI error is because of the phase error in trying to track a sinusoid .............................36 Figure 34-Fourier transform of the output voltage. It is seen that repetitive control eliminates the third harmonic..........................................................................................................................................37 Figure 35-Error of the output currents from the microturbine, windmill, and PV during island mode ..........................................................................................................................................................37
  • 10. viii Figure 36-Fourier transform of the output currents during island mode........................................38 Figure 37-Error in the output currents using LQI and repetitive control for grid connected mode ....................................................................................................................................................................39 Figure 38-Fourier transform of the output current in grid connected mode...................................40 Figure 39-Example of the phase error in the PV leg present during grid connected mode..........40 Figure 40-Battery is commanded 3 KW, repetitive control is able to produce the exact amount while LQI is only about to produce 2600 W.........................................................................................41 Figure 41-Power output test in both grid connected and islanded mode. The PV output is reduced at 4 seconds, while the microturbine output is increased at 7 seconds. ...........................42 Figure 42: Overview of the Hardware-in-the-loop simulation..........................................................43 Figure 43: Setup of the Hardware-in-the-loop simulation system....................................................44 Figure 44-Current during island mode for PV, windmill, and microturbine for both the Simulink model and hardware in the loop simulation.......................................................................47 Figure 45-Dc link voltages for the PV, windmill, and microturbine for both the simulink model and Hardware in the loop.......................................................................................................................47 Figure 46-Output voltage during island mode for both the simulink and Hil simulation ...........48 Figure 47-Battery current during power changes for both simulink and hil simulations.............49 Figure 48: Forecasted power production from renewable energy sources (RES)...........................54 Figure 49: Forecasted demand from the single critical load ..............................................................55 Figure 50: Forecasted spot energy price for purchasing power from the grid................................55 Figure 51: Power generation in DG units .............................................................................................59 Figure 52: Power exchange with the grid.............................................................................................59 Figure 53: Behavior of the storage unit.................................................................................................60 Figure 54: Graphical representation of a branch and bound method. Partitioning of regions in the feasible space is synonymous to branching a binary tree. Lower and upper bounds of the region are stored at each node. Taken from EE364b: Convex Optimization IIβ€”Branch and Bound Methods, Stephen Boyd (2013) [16]. ..........................................................................................2
  • 11. 1 EXECUTIVE SUMMARY Introduction According to International Energy Agency, global electricity demand increases every year from 117,687 TWh in 2000 to 143,851 TWh in 2008. As the energy consumption keeps climbing, concerns about transmission costs, power quality, and the lack of power generations for localized demand are crucial for the future power distribution system. Researchers strive to find alternatives to typical radial form power distribution systems, and the deployment of distributed generation (DG) across the grid seems to be a logical and reasonable solution to the aforementioned issues. Those DGs are usually small in size and adapt to local resources, they utilize renewable energy and provide an alternative means of power production than traditional centralized power systems. Microgrids are systems that contain at least one distributed energy resource (DER) and local loads. The islanding of a microgrid can be formed intentionally in the power distribution system. There are two types of DER in a microgrid, one is DG the other is distributed storage (DS). Most of the microgrid systems use both of them to provide energy. Interconnection switches are used to disconnect and reconnect DERs between the main grid and microgrid but the transition has to be smooth or with minimal disruption to the local loads. Also, microgrid system relies heavily on pwm inverters to transfer power from the DERs to the loads; therefore, the inverters must be able to output harmonic free power to increase efficiency. Project Purpose The purpose of the project is to develop algorthms that can prove to efficiently and safely transfer power from DERs to loads using a microgrid. The major objectives can be stated as: β€’ A simulation of a microgrid system that can be used predict the microgrid power transfer using different control algorthms. β€’ Develop a repetitive control algorthm for the pwm converters and analyze the harmonic content produced versus typical control algorthms. Increased harmonic content reduces the power transfer efficiency which is a major issue using pwm converters. β€’ Most of the power converter control algorithm for DER in the literature has the capability to work smoothly in both grid -tied and off-grid modes, but they do not consider the issue of a smooth transition from one mode to another. Another
  • 12. 2 objective is to verify with the simulation that the transition from grid-connected to island mode is smooth or with minimal disruption to the local loads. β€’ In order to asses the viability of the controls developed, a hardware in the loop simulation with the control and the models running on different platforms is investigated and compared against the overall simulation β€’ Lastly, a high level model predictive controller is developed and implemented. The high level control satisfies the load’s power needs while minimizing the cost. A cost is associated with running the microturbine, storing energy, and shedding non-critical load. So, the high level controller will decide which DERs to use given a certain power output from the photovoltaic and windmill. Also, the high level controller will take into account the forecasted load demand for the day. Project Results In this research, a control system that contains Model Predictive Adaptive Control and Repetitive Control is implemented on the microgrid simulation. The controllers provide superior power quality and maintain the safety of the microgrid during grid transition. The following results of the project can be summarized relative to the objectives: β€’ The simulation of the microgrid has detailed models of the power converter, microturbine, windmill, and photovoltaic array. Having such a detailed model enables both transient and steady state power flow in the microgrid. Also, different control algorthms can be implemented in the simulation. β€’ The power spectrum from Hardware-in-the-loop simulation shows that repetitive control is able to effectively suppress the 3th harmonic in the output current. So it can transfer power more efficiently than traditional methods. β€’ Using repetitive control and aligning the reference with the grid, it was also observed a smoother grid transition from both grid-connected to island and vice versa. β€’ The proposed Model Predictive Control is able to utilize the predicted renewable energy production and predicted critical load demand to make optimal decision for controllable DERs. To summarize, the repetitive controller can output a high power quality in a microgrid while minimizing unwanted grid transition fluctuations. Also, the high-level model predictive controller can minimize microgrid costs by minimizing the usage of high cost DERs.
  • 13. 3 Project Benefits The benefits of the project can help in the development of microgrids, which will result in more renewable and alternative forms of energy integerated into the grid. Firstly, the detailed simulation developed can predict the transient behavior and control algorithm changes without having to invest in costly hardware. The benefits of a simulation can greatly reduce iterations and trial errors. Moreover, a repetitive control in the inverters can deliver high quality power, while minimizing grid fluctuations. The results clearly show that a simple control algorithm can result in large fluctions during transition and that an advanced controller can be minimize these fluctuations. A repetitive controller can track commands from a high level controller, so it is very advantageous when used in conjunction with one. Also since the microgrid can have many DERs, the model predictive controller developed can make automated decisions about which DERs to turn on and off. In the current research, the primary objective was to minimize the cost; however, pollution and other factors can be added into the formulation. Overall, a repetitive and model predictive controller used together is a viable control strategy for the microgrid.
  • 14. A blank page is inserted to insure Chapter 1 starts on an odd number page. Blank pages are not labeled.
  • 15. 5 Chapter 1: Introduction According to International Energy Agency, global electricity demand increases every year from 117,687 TWh in 2000 to 143,851 TWh in 2008 [1]. As the energy consumption keeps climbing, concerns about transmission costs, power quality, and the lack of power generations for localized demand are crucial for the future power distribution system. Researchers strive to find alternatives to typical radial form power distribution systems, and the deployment of distributed generation (DG) across the grid seems to be a logical and reasonable solution to the aforementioned issues. Those DGs are usually small in size and adapt to local resources, they utilize renewable energy and provide an alternative means of power production than traditional centralized power systems [2]. Microgrids are systems that contain at least one distributed energy resource (DER) and local loads. And the islanding of a microgrid can be formed intentionally in the power distribution system [3]. There are two types of DER in microgrid, one is DG the other is distributed storage (DS). Most of the microgrid systems use both of them to provide energy. Interconnection switches are used to disconnect and reconnect DERs between the main grid and microgrid but the transition has to be smooth or with minimal disruption to the local loads. During power outage, the DERs will be disconnected from the main grid and the intentional island is formed. In the meantime, the DERs have to pick up the local loads and guarantee the voltage and frequency are aligned with the main grid. When power is restored on the main grid, the DERs cannot be reconnected to the grid unless the main grid and microgrid are synchronized. This procedure requires voltage measurement on both main grid and microgrid to allow synchronization of the island and the grid [4]. Most of the power converter control algorithm for DER in the literature have the capability to work smoothly in both grid - tied and off-grid modes, but they do not consider the issue of a smooth transition from one mode to another [5] [6] [7]. In order to convert the energy to compatible AC power in the grid, a power electronic system is required for most of the DG. Depending on the type of DG, the power electronic system may include inverter or rectifier or even both. The compatibility in voltage and frequency with the main grid is the crucial requirement for these power converters. By controlling the power converter on each DG, the voltage and frequency of the power in the microgrid can be manipulated. The control system of microgrid is designed to safely operate the system in grid-tied, off-grid, and transition modes which it has to control both the voltage and frequency of the microgrid. In off- grid mode, frequency control is a challenging problem. Some of the DGs, such as gas turbine, have slow response to control signal but higher power capacity while others
  • 16. 6 may have faster response but smaller power capacity. The frequency control must have the capability to change active power through control droops with respect to the mode that is operating. On the other hand, appropriate voltage regulation is necessary for microgrid reliability and stability. Without local voltage control, system may experience voltage oscillations causes by the DER. In this research, a control system that contains Model Predictive Adaptive Control and Repetitive Control is presented to provide superior power quality and maintain the safety of the microgrid. The Model Predictive Adaptive Control is a governor control which assigns the desired power for each DER in the microgrid. The Repetitive Control is local control that controls the power electronic systems along with the DER. Repetitive Control is a special case of the internal model principle in control systems with periodic signals, hence Repetitive Control providers zero tracking error and low total harmonic distortion for power electronic system. The proposed Repetitive and Adaptive control system guarantees good power quality during all modes of operation.
  • 17. 7 Chapter 2: Modeling of the Microgrid This section covers the overall modeling of a single phase microgrid. A low level model of single phase inverters is used as a starting point and as built up until a microgrid model is obtained from low level average models of inverters. It turns out one the average models for each leg is obtained, they can be connected in parallel relatively easily. 2.1 Single Phase Converters First the basic single phase converters are covered, which from more complex converter topologies can be obtained. 2.1.1 Inverter Figure 1- Inverters are a key component in the microgrid As shown in Figure 1, the main component in a microgrid is the inverter as it is responsible for converting DC voltage sources, such as the battery and photovoltaic cells, into an AC voltage suitable for the grid. The objective of the inverter depends on whether the grid is connected to the microgrid. If the grid is not tied to the microgrid, known as islanding mode, the inverter must produce an output sinusoidal voltage that is not significantly distorted and of proper amplitude. Since the grid is not available, one (or more) of the inverters must create a sinusoidal AC line so the others can follow. On the other hand, when the grid is tied to the microgrid the goal is to achieve unity power factor ratio. The power factor ratio which is defined as the ratio of the average power to apparent power delivered to the load can be expressed for sinusoidal signals as [8]:
  • 18. 8 Therefore to achieve unity power factor the converter must be able to produce a current that is in phase with the voltage and the THD is small. Figure 2-Full PWM bridge inverter topology used in the simulation Figure 2 shows the power inverter topology that is being used for simulation. It is a full bridge PWM inverter that uses four IGBTs to change the polarity of the input DC signal. There are 3 main reasons for choosing this topology: 1) The switches allow for active power factor compensation and by using feedback the output current and voltage can be made robust to load changes 2) The topology is easily extended to three phase voltage 3) it can also be used as a rectifier in the reverse direction. The output of the inverter can be either in grid connected or island mode depending on whether is connected to the grid. 2.1.2 LCL Inverter Model In order to design a model based control system such as repetitive control to provide the AC output, a mathematical model of the inverter being used is necessary. It is important to note that to avoid shorting the circuit Therefore the inverter has only one binary input which can take on two values 1 or -1. Therefore, a high frequency pwm signal is needed to switch the transistors ON and OFF accordingly. By applying KVL and KCL for the inductor current and capacitor voltages a state space model can be derived. The model is an average model since the D, the duty cycle,
  • 19. 9 can take on continuous values from [-1 1] and is not a pwm signal. In this research, average models were used since the main focus was much lower harmonics than the pwm switching frequency which can range from 5 kHz to 100’s of kHz. Typically, filtering is intended to suppress the high frequency switching, so an average model works well. The average model technique is standard in literature, so a detailed derivation is unnecessary. In island mode, the following equation describes the single phase LCL inverter. Similarly, the following equation describes LCL inverter in grid connected mode. Aside from Vs the AC grid voltage now being an input, the main difference is the presence of the load, R, in the lower right hand corner of the matrix. In grid connected mode, since the load is powered by the grid, the inverter does not include an R term. Lastly, it is important to note the above average model is linear and suitable to linear control design techniques. However, the linear model is only valid at frequencies below the switching frequency, since the averaging is over one switching period. 2.1.3 DC/DC Boost Converter Another common converter that is used for the microgrid simulation is a DC/DC boost converter shown in Figure 3. The duty cycle of the IGBT switch controls the output voltage across the resistor. Using the boost topology the voltage across the resistor is greater than the input supplied voltage. Therefore, typically the control objective of a boost converter is to supply a higher output voltage to a given load. Therefore, the boost converter is ideal for maximum power tracking (MPPT).
  • 20. 10 Figure 3 -Schematic of the DC DC Boost converter Similar to the inverter and rectifier, the average model is obtained by averaging the switching model over one switching cycle. More detailed analysis of the average model is shown in any fundamental of power electronics book. The model is described as 2.2 Power Converters for Single Phase Microgrid 2.2.1 DC/DC – DC/AC Boost Inverter Figure 4- A boost converter and inverter is cascaded to supply maximum power to the loads The DC/DC – DC/AC Boost inverter is, as illustrated in Figure 4, used to converter power generated from a power source to AC voltage or current suitable for the grid. The power source can be photovoltaic, windmill, or a turbine. The converter’s objective is to extract maximum power from the power source and make it available to
  • 21. 11 the AC bus. It is assumed the input power from the source is a DC voltage (easily accomplished using a diode bridge); therefore the boost converter extracts maximum power while the inverter outputs a sinusoidal voltage/current. Figure 5-Circuit schematic of a boost converter and inverter cascaded together Shown above in Figure 5 is a circuit schematic of the boost inverter for the simulation. A key component of the converter is the link capacitor, as it decouples the boost converter from the inverter. Simulations have shown a fairly large link capacitor is needed for proper decoupling. In a similar vein, the output inductor and capacitor must be designed so the high frequency switching is filtered while low frequency harmonics are not affected. A mathematical model of the boost inverter can be derived by cascading the average models of the boost converter and inverter. Essentially the output of the boost inverter is the input of inverter, this leads to the following model Boost Inverter
  • 22. 12 Where 𝐼𝐿1 is the current in boost converter’s inductor 𝑉𝑙𝑙𝑙𝑙 is the voltage across the DC link capacitor 𝑉𝑑𝑑𝑑 is the voltage across the capacitor from the DER output 𝐼𝐿2 is the current inverter’s inductor 𝑉𝑏𝑏𝑏 is the voltage in the AC bus 2.2.2DC/AC Bidirectional Converter A bidirectional converter is crucial in a microgrid system, since there must be some form of energy storage and power must flow in and out of the energy storage device. In this simulation, a battery is used for energy storage. In the figure below, the bidirectional converter used is shown. The input is a battery voltage and the output is the bus AC voltage. The current in inductor L1 cannot have large ripples since it is directly connected to the battery, therefore the input LC filter needs to be low bandwidth. This is similar to the boost inverter case, where a large DC link capacitor is critical in achieving decoupling of the DC and AC converter. Figure 6- A circuit schematic for the bi-directional inverter Writing down the average model the following equation is obtained:
  • 23. 13 . Where 𝐼𝐿1 is the current in the battery’s inductor 𝐼𝐿2 is the current inverter’s inductor 𝑉1 is the voltage across the input capacitor 𝑉𝑏𝑏𝑏 is the voltage in the AC bus It is worthwhile viewing this equation as a hybrid of the inverter and rectifier models given above. The bi-directionality is most apparent in the input inductor as the current can flow in both directions. 2.3 Distributed Energy Models For the microgrid simulation four different energy types are considered: 1) Windmill 2) Photovoltaic 3) Micrturbine 4) Battery. These four were chosen since they are relatively clean and seem like good options for the future. 2.3.1 Windmill/ Turbine Model Figure 7- General schematic of the windmill system with all subsystems included A schematic of how wind energy is transferred to the grid is shown above. The converters were discussed in the previous section and will only be touched upon.
  • 24. 14 Windmill models are typically divided into two parts: 1) Modeling the wind energy transferred to the generator shaft 2) Modeling the permanent magnet synchronous generator (PMSG). Essentially, the PMSG takes a mechanical input torque and converts it into a sinusoidal voltage and current. Viewed in this light, a PMSG model can also be used for a gas turbine. Permanent Magnetic Synchronous Generator The following are the dynamical equations for a sinusoidal PMSG, which are obtained from the datasheet of Matlab’s PMSG block and are widely used to model generators. They are expressed in a DQ frame fixed to the principle axis of the rotor. The equations give the electrical torque (Te) generated by the PMSG, and must be accompanied by a mechanical torque balance at the shaft which is given by Here Tf is friction and Tm is the input torque generated by the wind or gas energy. So for purposes of a microgrid simulation these equations can be solved if the mechanical torque Tm can be modeled. Since the model for PMSG is widely published a derivation of the model is not presented. Wind Energy Model The power generated by the wind can be expressed as Where Cp is the power coefficient and varies in a very nonlinear manner with and Ξ². Here R is the radius of the blade, v is the wind speed, w is the blade speed, and Ξ² is the pitch angle. The output torque is the product of the power generated and the speed. Since Ξ² is varying and Cp is nonlinear it is difficult to know if maximum power is being achieved. Therefore an MPPT algorithm as described previously is necessary. The following plots show an example of the output power varying with Ξ² and rotor speed.
  • 25. 15 Figure 8- the nonlinear dependence of the windmill power with various parameters The windmill model is shown in more detail in Figure 9. The AC-DC converter topology in series with DC/AC converter is shown. The AC-DC converter ensures the rotor speed is operating so to produce maximum power from the windmill, while the DC-AC converter produces a sinusoidal output and controls the DC link voltage. Figure 9- detailed circuit diagram of the windmill model
  • 26. 16 2.3.2 Photovoltaic Model Figure 10-Single diode photovoltaic model A single diode model as shown in the figure above and was used to model the photovoltaic cell. The model can be mathematically expressed as The series and parallel resistance are given by the manufacturer or can be measured. Also Vt and a are constants that are given. Ipv is the current generated by the sun, I0 is the dark current when there is no sunlight and both vary with temperature as given by G is the input irradians generated from the sun. The model is highly nonlinear and implicit; therefore solving the equation can be difficult. The model presented is standard in photovoltaic literature and more information be found in [8]. Shown in Figure 11 is the output resistance being varied and the power generated. Clearly there is optimal impedance which generates maximum power. Therefore, when using the DC/DC – DC/AC converter the MPPT algorithm is searching for the impedance that produces maximum power. Since the irradians varies and the diode model does not exactly apply, an MPPT algorithm is necessary.
  • 27. 17 Figure 11- Example of the output power as the impedance varies 2.3.3 Microturbine Model Figure 12-Main components of a microturbine for microgrid application Micro turbines are another key component of microgrids. They allow for distributed generation by using various types fuel to produce small amounts of power (<500Kw). Along with being highly efficient, micro turbines are also very reliable and can provide variable power unlike windmill and photovoltaic cells. Even more, micro turbines can operate in both grid-connected and island modes. Although cleaner and cheaper than traditional diesel generators, microturbines can still use fossil fuels so an objective of a microgrid system can be to minimize the use of a microturbine. The major components of a microturbine system for a microgrid are shown in Figure 12. A turbine running off fuel supplies torque to the Permanent magnet generator shaft which produces energy, this is similar to the windmill case. The shaft is typically rotating at a very high speed (1500-4000 Hz), so the high frequency current must be
  • 28. 18 converted to a 50 or 60 Hz output. Following [9], a back to back rectifier/inverter converter is used for this simulation. An active rectifier converts the PSMG output into a DC voltage and then a single phase bidirectional inverter converts the output to a 50 Hz current/voltage. The benefit of using an active rectifier is an increase in efficiency and no separate starting circuitry as opposed to a diode bridge. Figure 13-Block diagram of the turbine model typically used for microturbines Shown in Figure 13 is a block diagram of the turbine model typically used by researchers for microturbine modeling. On a high level, the input is the PMSG shaft speed and the output is the torque to the shaft. Simple first order filters and delays are used to model the turbine and fuel system dynamics. The torque output is used to drive the generator; the equations for a PMSG were shown in the windmill section. Once again using KCL and KVL, the equations for a back to back converter can be derived. The rectifier is three phase and u is a vector of the three duty cycles. The single phase LCL inverter is attached to a three phase rectifier and the following equations are obtained. The inputs to the system are u and Iabc, the three phase duty cycle and current generated from PMSG respectively. The output is Vabc the three phase voltage fed into the PMSG equations. The state variables are Capacitor voltage and inductor currents.
  • 29. 19 The previous equations for the back to back converter, along with the PMSG and turbine model complete the equations for modeling the microturbine. Further details can be found in [9]. 2.3.4Battery Model Figure 14-Simple battery model For purposes of the simulation a simple battery, which is shown above, was used. The model is just a voltage source and resistor in series. Although there are many shortcomings of this model and may not be suitable when charging and discharging profiles are explored, it is used now to simplify the microgrid simulation. In the future different models will be explored and tradeoffs between LI-ON and lead acid will be investigated. 2.4 Microgrid Model Figure 15-High level representation of each leg Energy Generation Single-Phase Inverter DC Link Sinusoidal Current Although the modeling of the converters along with energy sources can become large, it is relatively simple to add together each individual leg to build a full microgrid simulation. First Figure 15 represents a general configuration of a leg. There is energy
  • 30. 20 generation from a source into the dc link and an LCL inverter that converts the dc into AC. As expected, the larger the capacitor is the better both are decoupled from each other. Indeed, in the CERTS microgrid batteries are used to fully decouple the energy generation and inverter dynamics [3]. For the purposes of the simulation a large capacitor is used. Mathematically each leg can be generalized as . Here the A matrix is a function of the duty cycle, and b represents the influence from the energy generators. A necessary state in the formulation of the microgrid is Iout, which is the output current (rightmost inductor current in the LCL filter) into the Ac link. By applying KCL at the load, it is seen that the following figure holds true. So therefore, in order to combine individual legs into a microgrid simulation the output currents must summed and either multiplied by the load (Island mode) or the Grid voltage is feedback (grid connected mode). It should be noted this technique works for resistive loads.
  • 31. 21 Figure 16-General representation and visualization of interconnecting individual legs. Battery Inverter PV Inverter Windmill Inverter Microturbine Inverter βˆ‘+ + βˆ‘+ + Rload Vaclink Iout2 Iout3 Iout4 Iout1 Island Grid
  • 32. 22 Chapter 3: Control of the Microgrid This section focuses on the various control aspects of the microgrid. It uses the models in the previous section and simplifies them to facilitate control design. The main aspects of control design are the maximum power point tracking, PMSG speed control, and the inverter controller. 3.1 Windmill and Photovoltaic Control Strategy Figure 17-Overall control strategy for windmill and photovoltaic Power Source Boost Converter Inverter Ider Vder Vlink MPPT Duty1 Current Mode Controller Duty2 Vcap I1 I2 Shown in Figure 17 is the control strategy for the boost inverter used in both PV and windmill generation. The maximum power point controller adjusts the duty cycle of the boost converter to extract maximum power from the power source and is discussed in greater detail in the next section. The inverter controller is the standard design consisting of an inner current loop and outer voltage loop. The current loop ensure the output current (hence voltage) is sinusoidal, while the voltage regulates the dc link voltage for stable output power. If there is too much power being generated the inverter outputs power, however if there isn’t enough power to regulate the DC link the inverter actually consumes power. The Current Mode controller is responsible for outputting a sinusoidal current to the grid, a PV or windmill is not operated as a voltage source inverter in this
  • 33. 23 simulation. The controller of the inverters is discussed in greater detail in the next section. The MPPT controller adjusts the duty cycle of the boost converter until maximum power is achieved. There are many algorithms to achieve this, however only the primary two that is used in industry will be discussed: 1) Perturb and observe 2) Incremental conductance. The flowchart for the Perturb and observe algorithm is shown in the figure below. It is the most basic algorithm, as the power is increasing then the input is further increased or decreased; however, if the power decreases the input is decreased. As long as the power function is convex oscillations around the maximum power point will occur. Figure 18: Flowchart of the Perturb and Observe method The other popular algorithm is the incremental conductance algorithm, which can be derived from𝑃 = 𝐼𝐼. Taking the derivative 𝑑𝑑 𝑑𝑑 = 𝐼 + 𝑉 𝑑𝐼 𝑑𝑑 and then setting it to 0, it is seen the following equation is necessary for MPPT, 𝑑𝑑 𝑑𝑑 = βˆ’πΌ 𝑉 . So, the incremental conductance algorithm adjusts the input so the aforementioned criterion is met. A block diagram of the algorithm is shown in Figure 19.
  • 34. 24 Figure 19: Block diagram of the incremental conductance algorithm Notice that an integrator is added to increase the rate at which the power point is achieved. 3.2 Microturbine Control Strategy Figure 20-Microturbine control strategy, speed control for PMSG and inverter control Turbine + PMSG Three phase Rectifer Inverter Iabc Vabc Vlink Speed Control Duty1 Current Mode Controller Duty2 Vcap I1 I2 The microturbine controller is different than the WM and PV because of the three phase rectifier which is responsible for controlling the speed of the shaft by adjusting the electrical torque. However, the inverter control is the same. The control topology
  • 35. 25 for the rectifier follows from literature and is shown in Figure 20. The controller transforms the PMSG current into its dq coordinates and then employs one PI controller to make Id follow a setpoint based on the efficiency of the generator and another PI to track Iq which is adjusted to track a set speed. The speed directly influences the amount power the microturbine delivers (higher the set speed the more power). Figure 21 shows a block diagram of the rectifier control strategy. Figure 21-Block diagram of the rectifier control strategy abc dq βˆ‘+ – βˆ‘- + PI PI βˆ‘- + PI dq abc Idref speed Ref speed Iabc Dabc 3.3 Inverter Control Figure 22-Control strategy for the battery during grid connected mode 2 2 Vamp βˆ‘+ + P Q Iref Sine Cos Current Controller Duty
  • 36. 26 The inverter controller for the battery leg outputs a set amount of real power when connected to the grid and maintains the Ac link voltage while islanded. In this simulation the battery leg is the master in island mode, a load sharing scheme was not implemented. This allowed for simpler controller validation. Shown in Figure 22 is the battery inverter control strategy; a set point of real and reactive power is transformed into a current command for the current controller. The current controller must be able accurately track the reference free of harmonics that may get injected into the grid or loads. Figure 23-Control strategy for the battery inverter during island mode Single-Phase Inverter Sinusoidal Voltage Voltage Controller Shown in the figure above is the control topology for the battery used in islanded mode. The controller outputs a harmonic free Ac link voltage. In islanded mode, the battery inverter instead of the grid provides a reference for the other legs so they can continue to operate in current mode. Therefore, once islanded operation is detected the control strategy must switch. The simplification of having one master allows the other legs to have a single controller be designed. However, it is evident that the controller must provide harmonic free current in grid connected mode and harmonic free voltage in islanded mode.
  • 37. 27 The inverter controller for the PV, windmill, and microturbine leg is similar to the battery controller in grid connected mode except that an addition PI loop is added. The additional PI loop controls the dc link voltage for stable output power. Moreover, if the dc link is unstable then power outputted will also diverge. The dc link PI controller ideally adjusts the amplitude of the current to be tracked by the current controller. The dc link PI gains were tuned manually for acceptable results. Figure 24-Control strategy for PV, windmill, and microturbine leg 2 2 Vamp βˆ‘+ + Q Iref Sine Cos βˆ‘+ – PI Vdc V* dc Current Controller Duty 3.3.1 LCL filter design For grid connected inverters, LCL output filter on the inverter is used since it has 60dB/decade roll off above the resonant frequency and provides better decoupling from the grid impedance. Using a inductor at the output of the filter effectively decouples the grid impedance. Also smaller values of inductors and capacitors can be used in LCL. However, the filter brings resonances into the system which makes control design more difficult. Later, it is seen that LQI is particularly adept at handling these issues without using a damping resistor. The primary concern in designing a LCL filter is the cut-off frequency
  • 38. 28 Li and Lg were chosen to be 5mH, while C was 10uF so the cutoff was at approximately 1 kHz, while the switching frequency (Sample time) was set to be 20 kHz. Shown below is the frequency response of the LCL inverter in both grid connected and Island mode. Figure 25-Frequency response of the LCL inverter using the specified inductor and capacitor values 3.3.2 Current/Voltage Controller For the creation of a benchmark simulation, the control strategy used was a LQI (Linear quadratic with integrator) controller, which is similar to a PI in that it can perfectly track step inputs and is easier to design a stable filter for a LCL inverter than a PI.
  • 39. 29 Figure 26-Overall schematic for the microgrid. The battery leg is able to operate in voltage mode during islanding and current mode during grid connected Single-Phase Inverter Voltage Controller (Island) Current Controller (Grid) Energy Generation Single-Phase Inverter DC Link Current Mode Controller Energy Generation Single-Phase Inverter DC Link Current Mode Controller Grid Duty Duty Duty AC link LCL Filter LCL Filter LCL Filter Load The overall system with inverter control is shown Figure 26, the battery leg can switch controller depending on whether the grid is connected, while the other legs operate in current mode. Using this figure, and by applying KVL at the output it can be seen that in grid connected mode each inverter is not coupled to the others. Therefore, assuming a sufficiently large DC link decoupling capacitor, individual controllers can be designed using .
  • 40. 30 However, in island mode the coupling effect is present. Assuming a resistive load and a large DC link capacitor and applying KCL the following model can be derived for each inverter leg This model describes the coupling effect for an inverter based microgrid in islanding. It is linear model with the system matrix as Where Ai and Bi are the individual matrices of a single LCL inverter. Using this overall structure, controllers can be designed using the individual inverter models and checked to see if they are still stable with the coupling effect included. In this research, the controller is designed using the islanded coupled model. Before proceeding with discrete time control design, the continuous model above needs to be discretized. A zero order hold discretization was applied to the model above in order to facilitate discrete time design. The figure below shows the frequency response of both the continuous and discrete time models. As can be seen the resonance is presence for both model and the discrete time model with a sample time of 20 kHz accurately matches the continuous time model.
  • 41. 31 Figure 27-Descretization of the linear coupled island model 3.3.3 Linear Quadratic Regulator with Integral Design Figure 28-LQI controller block diagram Simplifed Inverter Model Kfb βˆ‘+ – βˆ‘+ + 1 z-1 Ki x Current/ voltageCurrent/ Voltage reference Each leg runs an LQI controller, which is shown in Figure 28. A LQI controller is composed of two parts: 1) state feedback, where the state x is multiplied by a gain 2) Integrator part that attempts to eliminate the error in tracking a reference (Current or
  • 42. 32 Voltage). The states are just the currents and voltage in the LCL filter so it is readily measurable. Determination of the gains is done by solving the Riccati Equation for the augmented system. It is worth noting that design is done on the decoupled plant models in islanded mode. With the LQI compensator designed the closed loop system can be expressed as The same individual design procedure can be done for all four legs. However, it is not clear whether the coupling will adversely influence the controller in island mode. To see the effect of the coupling on the controller, the overall system can be seen to have system matrices as , where Acl and Bcl are the closed loop system matrices for each individual leg. Shown in Figure 29 is the frequency response of the closed loop LCL inverter and the open loop LCL inverter. The open loop frequency response shows large coupling effects on the off diagonal plots, indicating coupling between inverters. However, the closed loop response shows the coupling terms below -10 dB. Also the resonant peak is eliminated. The benefit of lightly decoupling the system using LQI is that now repetitive control can β€œplugged β€œ in for each individual inverter.
  • 43. 33 Figure 29- reduction of cross coupling using LQI
  • 44. 34 3.3.4 Plug-In Repetitive Control Design Figure 30-Block diagram of the "plug-in" repetitive controller Simplifed Inverter Model Kfb βˆ‘+ + 1 z-1 x Current/ voltage Current/ Voltage reference Ki Z-N Q(z) F(z) The plug in repetitive control structure is shown above. The additional repetitive control loop is plugged into the LQI design mentioned in section 0. By the internal model principle, the controller can track any periodic reference and reject periodic references. Two filters are needed for this controller, F and Q. First, F(z) is a zero phase inversion filter of the closed loop plant. If , then F can be designed as . N+ is the part of the numerator transfer function that has its poles inside the unit circle, while N- has its pole outside the unit circle. F(z) allows the closed loop plant to be approximately inverted and the loop to stay stable. Lastly, b is defined as . This high performance controller assumes an accurate model of the plant which is rarely the case. As stated earlier, the assumption that the DC link is constant was used to obtain the linear models previously. However, this assumption is not completely true as the DC link does fluctuate which can introduce some error to the linear models. Luckily, repetitive control is robust to model uncertainty by adjusting the Q(z) low pass filter at the expense of reduced performance. The following Q filter was used for the simulation .
  • 45. 35 Chapter 4: Simulation Results Figure 31: Schematic of a Microgrid system Figure 31 shows an overview of the microgrid system, it has four different DERs along with different power converters to interface with the grid power. In chapter 2, all types of power converters and different DER models used in the microgrid system was introduced. In this section the overall microgrid model is implemented in Simulink. First repetitive control is compared against LQI, which highlight some of the attractive features of the controller. Then a simulation changing the power produced by the PV, microturbine, and battery is shown to highlight the key features of the simulation. 4.1 Island Mode Repetitive Control and LQI In islanded mode the battery inverter must control the Ac link voltage, while the other converters either operate at MPPT or output the specified amount of power. The microgrid simulation ran until the output voltages and currents stabilized, while signals were recorded. For this section, two different scenarios were run: 1) LQI as the current/voltage control 2) Repetitive control as the controller. Overall, repetitive control performs much better than LQI in the island case. Shown below is the output voltage error for LQI and Repetitive control. The grid voltage was 120V and 50Hz for the simulation. Evident is repetitive control has much less error than using LQI. This is expected since Repetitive has an internal model the sinusoid in its transfer function. LQI has errors up to 25 V, while repetitive errors are below .5 V. Upon closer inspection, from Figure 33 it is seen the LQI errors in
  • 46. 36 magnitude are well behaved but the phase difference is the main cause of the errors. Repetitive control has an advantage that it can track the voltage command in phase. Figure 32-Error in output voltage during island mode using LQI and repetitive control Figure 33-LQI error is because of the phase error in trying to track a sinusoid 2.58 2.59 2.6 2.61 2.62 -100 -50 0 50 100 Time (secs) Voltage(Volts) LQI Reference Tracking 2.65 2.66 2.67 2.68 2.69 2.7 -100 -50 0 50 100 Time (secs) Voltage(Volts) Repetitive Control Voltage Tracking Reference Actual
  • 47. 37 Taking the fft of the output voltage from both the LQI and Repetitive control simulation, it is further seen that repetitive control reduces the third harmonic. This also is expected as the controller can reject all harmonics of the fundamental, while LQI is only capable of rejecting a constant. Interestingly the noise floor is decreased at higher frequencies. Figure 34-Fourier transform of the output voltage. It is seen that repetitive control eliminates the third harmonic A similar trend can be seen with the output currents of the PV, Windmill, and Microturbine legs. As is shown on Figure 35, repetitive control is able to track its reference, while LQI has significant error. Once again the error is primarily due to the phase mismatch; repetitive control can accurately track the phase of the voltages and currents in the simulation. Also, from Figure 36, third harmonic suppression is seen in the Miroturbine current but not in the PV or Windmill. This is because of the DC link controller design has harmonics that the repetitive controller attempts to track. But the overall noise floor is lowered by the use of repetitive control. Figure 35- Error of the output currents from the microturbine, windmill, and PV during island mode
  • 48. 38 Figure 36- Fourier transform of the output currents during island mode
  • 49. 39 4.2 Grid Connected Simulation In Grid connected mode all the inverters must operate in current control mode since the grid supplies the reference voltage. In this case, the microgrid simulation ran in grid connected mode until the output voltages and currents stabilized, while signals were recorded. Once again, the simulation was run using LQI and repetitive control. The results parallel the islanded mode case. Shown in Figure 37, is the error in all the current outputs using LQI and repetitive control. Clearly, LQI is not able to track the sinusoidal references. The frequency domain of the current signals is plotted in Figure 38. As in the islanded case, the overall noise floor is lowered using repetitive control; however, the third harmonics is not rejected for converters with high harmonics content in the dc link which was designed by manual PI tuning. Lastly, Figure 39 shows the phase error when using LQI. Figure 37-Error in the output currents using LQI and repetitive control for grid connected mode
  • 50. 40 Figure 38-Fourier transform of the output current in grid connected mode Figure 39-Example of the phase error in the PV leg present during grid connected mode
  • 51. 41 4.3 Different Power Scenarios One of the essential features of the microgrid is that different legs outputting different power levels. In grid connected mode, any amount of energy produced is acceptable as excess energy is fed back into the grid. In islanded mode, the battery plays the role of the grid and stores or extracts energy as is needed. Moreover, the phase error introduced when using LQI is unacceptable as it leads to deviations in power. For example, Figure 40 shows the output power of the batter in grid connected mode when it is asked to supply 3KW using LQI and Repetitive. Repetitive control correctly outputs the 3 KW, while LQI outputs 2.6 KW. The error stems from the phase error mentioned in previous sections. Therefore, for power simulations, only repetitive control is used. Figure 40-Battery is commanded 3 KW, repetitive control is able to produce the exact amount while LQI is only about to produce 2600 W This simulation was intended to test operation when the PV, battery, and microturbine output different power levels. Both grid connected and islanded mode was tested. In island mode, at 4 seconds the PV irradians was changed from 1000
  • 52. 42 irradians to 750 irradians. Then at 7 seconds the microturbine was commanded at 2 KW. From Figure 41, it is seen when the PV outputs less energy the battery outputs more. The direction of power flow changes in the battery. However, at 7 seconds when the microturbine outputs 2 KW the direction of power once against changes in the battery. The battery controls the AC link. In grid-connected mode, the same simulation was run except the battery at 2 seconds outputted 4.5 KW instead of 3 KW. The same dynamical behavior is seen on the other legs but the battery is able to produce varying amount of power. Figure 41-Power output test in both grid connected and islanded mode. The PV output is reduced at 4 seconds, while the microturbine output is increased at 7 seconds.
  • 53. 43 Chapter 5: Hardware-in-the-loop Simulation In this section, the microgrid simulation introduced in Chapter 3 and the embedded control hardware will be integrated as a hardware-in-the-loop simulation. Also, the benchmark performance will be established by implementing industrial standard control methods to the hardware-in-the-loop simulation. The hardware in the hardware-in-the-loop simulation is: PXI chassis, desktop real- time system, and the reconfigurable FPGA board in both of these systems. The setup of the hardware-in-the-loop system is shown in Figure 42. Figure 42: Overview of the Hardware-in-the-loop simulation The top blue dashed block is the real-time controller which is the PXI chassis and the bottom red dashed block is the microgrid system emulator which is executing in the desktop real-time target. While the input/output signals between the top and the bottom block is implementing within the reconfigurable FPGA board. The physical setup of the hardware-in-the-loop system is shown in the figure below:
  • 54. 44 Figure 43: Setup of the Hardware-in-the-loop simulation system , the white box at the bottom is the PXI real-time controller, the black box on the top is the microgrid system emulator, and the two boxes on the right are the breakout box that direct feed through the outputs from one real-time processor to the proper input ports of another real-time processor. And the reconfigurable FPGA board is the interface between the inputs/outputs and the real-time processor. In the next subsections, more details about the implementation of hardware-in-the- loop simulation will be introduced in the following order: First of all, the numerical solver which is implemented in the hardware-in-the-loop simulation will be introduced. Secondly, the special structure of the mathematical average model derived in section 2.4 will be utilized so that the parallel computation capability of the multi-core CPU processor can beneficial in the hardware-in-the-loop simulation. And then the benchmark performance of the hardware-in-the-loop simulation will be established by implementing industrial standard control method in the real-time controller. 5.1 Numerical Solver In this research, we have tried two different numerical solvers, Euler method and Runge-Kutta method, for solving the differential equations in the microgrid systems.
  • 55. 45 The Euler method is a first order numerical method for solving ordinary differential equations. It is the most basic explicit method and also it is actually the subset of Runge- Kutta method. The Euler method is a first order method which means the local error is proportional to the square of the step size, and the global error is proportional to the step size. According to the testing results, the largest step size that can provide stable solution to the microgrid system is around the order of 10-6(sec). In other words, if the Euler method is going to be deployed as the solver for the microgrid systems, the execution speed of the hardware-in-the-loop simulation has to be around 1MHz which is above the capability of the Desktop Real-Time System. Therefore, we investigated into the 4th order Runge-Kutta method. The Runge-Kutta method of 4th order works with higher degree of accuracy than the common Euler method. And it also uses fixed step size during the process, which makes it easy to implement. Assuming the differential equation is, The fixed step rate as a five stage process can be described as, From the testing results, the Runge-Kutta of 4th order can use much larger step size than the Euler method. The largest step size that guarantees stable solution to the microgrid system is around 1x10-5 (sec) which is 50 times larger than the Euler method. Therefore, with Runge-Kutta solver, the hardware has to execute the simulation at 100kHz to have the hardware-in-the-loop simulation running in real-time. Unfortunately, the current hardware is not able to finish one simulation cycle in 1x10-5 (sec). It takes at least 10-4 (sec) to finish one simulation cycle. Currently, we decide to slow down the simulation execution speed but keep the same step size. Meaning the simulation is not executed in real-time but at a scale down speed.
  • 56. 46 5.2 Parallel solving structure In Section 2.4, it was shown that the mathematical average model of the microgrid system has block diagram structure. This special structure implies that the states within different DERs in the system can be solved independently. The system matrix A can be divided into a 4x4 matrix. Instead of solving the entire system at once, we propose to decompose the entire system matrix into four subsystems: three decoupled systems and one coupling system. The three decoupled systems are the systems on the (1,1), (2,2), and (3,3) elements of the system matrix A, while the coupled system is the last column and last row of the system matrix A. The decomposed microgrid system model can be beneficial if the decoupled systems are solved in parallel. For a multi-core computer, the CPU can work in parallel in different thread; Meaning that the subsystems can be solved independently and at the same time which utilizes the true parallel processing of the multi-core computer. 5.3 HIL simulation results with Repetitive Control In order to validate the HIL simulation in all modes of operations, first the Hil simulation is ran under normal conditions; 1000 irradians and 300 W from the microturbine. Some sample plots are shown in figures 44-46. These figures show good correlation between the Simulink model and the Hil simulation. Also evident in these plots is the ripple in some the of DC link voltages. Although the simulations differ in the transient, the steady state error is small and the Hil simulation is sufficient for microgrid testing. The Hil simulation uses the repetitive controller since its performance is seen to be much better than using LQI.
  • 57. 47 Figure 44-Current during island mode for PV, windmill, and microturbine for both the Simulink model and hardware in the loop simulation Figure 45-Dc link voltages for the PV, windmill, and microturbine for both the simulink model and Hardware in the loop
  • 58. 48 Figure 46-Output voltage during island mode for both the simulink and Hil simulation Also, the similar test condition as used in Chapter 5 will be applied to the HIL simulation system. The test condition is: At the beginning, the microgrid has enough power to supply local loads and there is some extra energy being stored into the battery. While at t=2 (sec), the sudden drop of sun irradiation causes the battery to discharge to supply the power to the local loads. At t=4 (sec), the mictorturbine outputs additional energy and the battery again begins to store the additional energy. Figure 47 shows the current generated from the battery in the HIL. The simulation results in the HIL simulation has a small dip around t=2(sec) which does not occur in the average model. The suspect of that could be the noise in the inputs and outputs. In the HIL simulation, the control commands and the measurements are physical IOs between the controller and plant model emulator. Therefore, both of the control commands and the measurements are polluted by unpredictable noises. If the control algorithm is not robust, the performance could be unpredictable as well. This
  • 59. 49 robustness was partially issued in the repetitive control design by using the third order Q filter. Figure 47-Battery current during power changes for both simulink and hil simulations
  • 60. 50 Chapter 6: System Level Model and Problem Formulation 6.1 Introduction System-level grid models in literature are typically realized using power flows between compartments [8, 9, 10, 11]. These compartments can represent individual or groups or elements, and can be classified as power sources or sinks. Sinks represent loads in the microgrid. Sources represent generation sources (renewable power sources, distributed generation, and storage units) that when connected, power can be purchased and sold over the main grid, and so it can act as a both a sink and a source. A microgrid model found in literature is described and implemented. The model, by Parisio et al., is formulated in [9], tested on an experimental microgrid in [10], and undergoes extensive simulation in [8]. The model is a mixed-integer linear optimization problem (see Appendix A) that is repeatedly solved in real-time using model predictive control (see Appendix C). The model supports both islanded and connected modes, although all published results have been for connected mode. The model is currently implemented in connected mode only. Islanded mode is possible by disabling interaction with the main grid, however measures must be implemented to handle infeasibility. 6.2 Modeled elements Loads are divided into two categories: critical loads, whose demand must be met, and controllable loads, whose demand may be curtailed given a set of rules. The demand of both loads is estimated before the problem is solved, but is not known until the system is run in real-time (in silico or reality). Demand on critical load 𝑗 at time π‘˜ is denoted 𝐷𝑗(π‘˜), where 𝑗 = {1, … , 𝑁𝑙} and π‘˜ = {1, … , 𝑇}. For each controllable load β„Ž = {1, … , 𝑁𝑐} we define a fractional curtailment limits 0 ≀ 𝛽𝑖,π‘šπ‘šπ‘š, 𝛽𝑖,π‘šπ‘šπ‘š ≀ 1, and a preferred power level π·β„Ž 𝑐 (π‘˜). Curtailment is tracked by the decision variable π›½β„Ž.π‘šπ‘šπ‘š ≀ π›½β„Ž(π‘˜) ≀ π›½β„Ž.π‘šπ‘šπ‘š. Each curtailment also carries a penalty coefficient πœŒβ„Ž, to be used in the cost function. 6.2.1 Storage unit A single storage unit is modeled as a first-order system. Different charge and discharge rates are used. This property creates a nonlinear model. The charge on the unit at time π‘˜, π‘₯ 𝑏 (π‘˜), is modeled by π‘₯ 𝑏(π‘˜ + 1) = π‘₯ 𝑏(π‘˜) + πœ‚π‘ƒ 𝑏(π‘˜) βˆ’ π‘₯ 𝑠𝑠
  • 61. 51 where π‘₯ 𝑠𝑠 is an ambient loss of charge, 𝑃 𝑏(π‘˜) is the power exchanged with the microgrid (𝑃 𝑏 (π‘˜) > 0$ for charging and 𝑃 𝑏 (π‘˜) ≀ 0 for discharging), and πœ‚ = οΏ½ πœ‚ 𝑐 , if 𝑃 𝑏(π‘˜) > 0 (charging mode) πœ‚ 𝑑 , otherwise (discharging mode) is the efficiency of the energy exchange. Note that 0 ≀ πœ‚ 𝑐 , πœ‚ 𝑑 ≀ 1. The problem is rearranged to two mixed-integer constraints: π‘₯ 𝑏(π‘˜ + 1) = π‘₯ 𝑏(π‘˜) + οΏ½πœ‚ 𝑐 βˆ’ 1 πœ‚ 𝑑 οΏ½ 𝑧 𝑏(π‘˜) + 1 πœ‚ 𝑑 𝑃 𝑏(π‘˜) βˆ’ π‘₯ 𝑠𝑠 𝔼1 𝑏 𝛿 𝑏(π‘˜) + 𝔼2 𝑏 𝑧 𝑏(π‘˜) ≀ 𝔼3 𝑏 𝑃 𝑏(π‘˜) + 𝔼4 𝑏 where 𝑧 𝑏(π‘˜) is an auxiliary variable that masks the nonlinearity 𝑧 𝑏(π‘˜) = 𝛿 𝑏(π‘˜)𝑃 𝑏 (π‘˜) The column vectors are defined by 𝔼1 𝑏 = [𝐢 𝑏 βˆ’ (𝐢 𝑏 βˆ’ πœ–) 𝐢 𝑏 𝐢 𝑏 βˆ’ 𝐢 𝑏 βˆ’ 𝐢 𝑏] 𝑇 𝔼2 𝑏 = [0 0 1 βˆ’ 1 1 βˆ’ 1] 𝑇 𝔼3 𝑏 = [1 βˆ’ 1 1 βˆ’ 1 0 0] 𝑇 𝔼4 𝑏 = [𝐢 𝑏 βˆ’ πœ– 𝐢 𝑏 𝐢 𝑏 0 0] 𝑇 where 𝐢 𝑏 is the storage output power limit, and πœ– is the machine epsilon. 6.2.2 Interaction with main grid When the microgrid is not islanded, power can be traded with the main grid. When the spot price is low, power deficits can be purchased; when the price is high, excess energy generated can be sold back to the grid for a profit. Prices for purchasing and selling power are not necessarily equal, presenting a nonlinearity. 𝑃 𝑔 (π‘˜) is the power exchanged at time π‘˜. A binary decision variable 𝛿 𝑔 (π‘˜) switches the trading mode (𝛿 𝑔 (π‘˜) = 1 for purchasing power, 𝛿 𝑔 (π‘˜) = 0 for selling it). An auxiliary variable 𝐢 𝑔 (π‘˜) models the cost of this exchange: 𝐢 𝑔(π‘˜) = οΏ½ 𝑐 𝑃(π‘˜)𝑃 𝑔 (π‘˜) if 𝛿 𝑔(π‘˜) = 1 𝑐 𝑆(π‘˜)𝑃 𝑔 (π‘˜) otherwise Then the constraint is compacted as 𝔼1 𝑔 𝛿 𝑔(π‘˜) + 𝔼2 𝑔 𝐢 𝑔(π‘˜) ≀ 𝔼3 𝑔 (π‘˜)𝑃 𝑔(π‘˜) + 𝔼4 𝑔 where
  • 62. 52 𝔼1 𝑔 = [𝑇 𝑔 βˆ’ (𝑇 𝑔 + πœ–) 𝑀 𝑔 𝑀 𝑔 βˆ’ 𝑀 𝑔 βˆ’ 𝑀 𝑔] 𝑇 𝔼2 𝑔 = [0 0 1 βˆ’ 1 1 βˆ’ 1] 𝑇 𝔼3 𝑔 = [1 βˆ’ 1 𝑐 𝑃(π‘˜) βˆ’π‘ 𝑃(π‘˜) 𝑐 𝑆(π‘˜) βˆ’ 𝑐 𝑆(π‘˜)] 𝑇 𝔼4 𝑔 = [𝑇 𝑔 βˆ’ πœ– 𝑀 𝑔 𝑀 𝑔 0 0] 𝑇 for 𝑀 𝑔 = max π‘˜(𝑐 𝑃(π‘˜), 𝑐 𝑆 (π‘˜)) Β· 𝑇 𝑔 . 6.2.3 Power generation Power generation cost 𝐢 𝐷𝐷 (𝑃) is modeled as a quadratic function of generated power 𝑃: 𝐢 𝐷𝐷(𝑃) = π‘Ž1 𝑃2 + π‘Ž2 𝑃 + π‘Ž3 Cost coefficients π‘Ž1,𝑖, π‘Ž2,𝑖 and π‘Ž3,𝑖 are defined for each generator unit 𝑖 in the microgrid, where 𝑖 = οΏ½1, … , 𝑁𝑔�. The binary decision variable 𝛿𝑖(π‘˜) controls the on/off state of each generator at time π‘˜. Start-up and shut-down costs are penalized as costs. These costs are given in the parameters 𝑐𝑖 𝑆𝑆 and 𝑐𝑖 𝑆𝑆 for each DG unit. Costs are realized by the following constraints on auxiliary variables π‘†π‘ˆπ‘–(π‘˜) and 𝑆𝐷𝑖(π‘˜): π‘†π‘ˆπ‘–(π‘˜) ≀ 𝑐𝑖 𝑆𝑆 (π‘˜)[𝛿𝑖(π‘˜) βˆ’ 𝛿𝑖(π‘˜ βˆ’ 1)] 𝑆𝐷𝑖(π‘˜) ≀ 𝑐𝑖 𝑆𝑆 (π‘˜)[𝛿𝑖(π‘˜ βˆ’ 1) βˆ’ 𝛿𝑖(π‘˜) π‘†π‘ˆπ‘–(π‘˜) ≀ 0 𝑆𝐷𝑖(π‘˜) ≀ 0 Minimizing over π‘†π‘ˆπ‘–(π‘˜) and 𝑆𝐷𝑖(π‘˜) with this formulation exploits slackness in the MILP. For example, if unit 𝑖 is turned on at time π‘˜, then 𝛿𝑖(π‘˜ βˆ’ 1) = 0, and 𝛿𝑖(π‘˜) = 1. Hence π‘†π‘ˆπ‘–(π‘˜) β‰₯ 𝑐𝑖 𝑆𝑆 , and is minimized to π‘†π‘ˆπ‘– βˆ— (π‘˜) = 𝑐𝑖 𝑆𝑆 . Otherwise, it is minimized to π‘†π‘ˆπ‘– βˆ— (π‘˜) = 0. Minimum on and off times 𝑇𝑖 𝑒𝑒 and 𝑇𝑖 𝑑𝑑𝑑𝑑 for the DG units are included in the model, by constraining 𝛿𝑖(π‘˜) βˆ’ 𝛿𝑖(π‘˜ βˆ’ 1) ≀ 𝛿𝑖(𝜏 𝑒𝑒 ) 𝛿𝑖(π‘˜ βˆ’ 1) βˆ’ 𝛿𝑖(π‘˜) ≀ 1 βˆ’ 𝛿𝑖(𝜏 𝑑𝑑𝑑𝑑 ) where 𝜏 𝑒𝑒 = οΏ½π‘˜ + 1, … , min(π‘˜ + 𝑇𝑖 𝑒𝑝 βˆ’ 1, 𝑇)οΏ½ and 𝜏 𝑑𝑑𝑑𝑑 = οΏ½π‘˜ + 1, … , min(π‘˜ + 𝑇𝑖 𝑑𝑑𝑑𝑑 βˆ’ 1, 𝑇)οΏ½. These constraints also exploits slackness in the MILP. If the unit is switched on at π‘˜, 𝛿𝑖(π‘˜) βˆ’ 𝛿𝑖(π‘˜ βˆ’ 1) = 1 and hence the optimal solution includes 𝜏 𝑒𝑒 = 1 for all 𝜏 𝑒𝑒 . Otherwise 𝛿𝑖(𝜏 𝑒𝑒) β‰₯ 0; this is true regardless as 𝛿𝑖(𝜏 𝑒𝑒 ) is a binary variable and so 𝛿𝑖(𝜏 𝑒𝑒) ∈ {0,1}.
  • 63. 53 6.2.4 Conservation of energy By conservation of energy, the net sum of power supplied and consumed is zero. Hence, οΏ½ 𝑃𝑖(π‘˜) + 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ(π‘˜) + 𝑃 𝑔(π‘˜) + 𝑃 𝑏(π‘˜) = οΏ½ 𝐷𝑗(π‘˜) 𝑁 𝑙 𝑗=1 𝑁 𝑔 𝑖=1 + οΏ½[1 βˆ’ π›½β„Ž(π‘˜)]π·β„Ž 𝑐 (π‘˜) 𝑁 𝑐 β„Ž=1 Note that the sign of 𝑃 𝑏 (π‘˜) is negative, as 𝑃 𝑏 (π‘˜) > 0 represents the charging of the storage unit, a consumption of power. 6.2.5 Physical constraints Some final constraints on the operating limits of the grid elements are imposed: π‘₯ π‘šπ‘šπ‘š 𝑏 ≀ π‘₯ 𝑏(π‘˜) ≀ π‘₯ π‘šπ‘šπ‘š 𝑏 𝑃𝑖,π‘šπ‘šπ‘š 𝛿𝑖(π‘˜) ≀ 𝑃𝑖(π‘˜) ≀ 𝑃𝑖,π‘šπ‘šπ‘š 𝛿𝑖(π‘˜) |𝑃𝑖(π‘˜ + 1) βˆ’ 𝑃𝑖(π‘˜)| ≀ 𝑅𝑖,π‘šπ‘šπ‘š 𝛿𝑖(π‘˜) π›½β„Ž,π‘šπ‘šπ‘š ≀ π›½β„Ž(π‘˜) ≀ π›½β„Ž,π‘šπ‘šπ‘š where π‘₯ π‘šπ‘šπ‘š 𝑏 , π‘₯ π‘šπ‘šπ‘š 𝑏 are charge limitations on the storage unit, 𝑃𝑖,π‘šπ‘šπ‘š, 𝑃𝑖.π‘šπ‘šπ‘š are generation limits on the DG units, 𝑅𝑖,π‘šπ‘šπ‘š is the ramping limit of the DG units, and π›½β„Ž,π‘šπ‘šπ‘š, π›½β„Ž,π‘šπ‘šπ‘š are the curtailment limits set on controllable loads. 6.3 Cost function The problem cost function given in Parisio et al. [8] is a monetary cost in € for the purchasing and operation of the day. This is converted to US$ by a trivial change in parameters. 𝐽�π‘₯ π‘˜ 𝑏 οΏ½ = min 𝒖 π‘˜ π‘‡βˆ’1 οΏ½ �𝑃 𝑔(π‘˜ + π‘ž) + 𝐢 𝑔(π‘˜ + π‘ž) + 2 Β· 𝑂𝑀 𝑏 Β· 𝑧 𝑏(π‘˜ + π‘ž) βˆ’ 𝑂𝑀 𝑏{𝑃 𝑔(π‘˜ + π‘ž) + 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ(π‘˜ + π‘ž)} π‘‡βˆ’1 π‘ž=0 + οΏ½ [𝑂𝑀𝑖 𝛿𝑖(π‘˜ + π‘ž) + πœŽπ‘–(π‘˜ + π‘ž) + π‘†π‘ˆπ‘–(π‘˜ + π‘ž) + 𝑆𝐷𝑖(π‘˜ + π‘ž) βˆ’ 𝑂𝑀 𝑏 𝑃𝑖(π‘˜ + π‘ž)] 𝑁 𝑔 𝑖=1 + οΏ½ [πœŒβ„Ž(π‘˜ + π‘ž)π·β„Ž 𝑐 (π‘˜ + π‘ž)π›½β„Ž(π‘˜ + π‘ž) βˆ’ 𝑂𝑀 𝑏{βˆ’π·β„Ž 𝑐 (π‘˜ + π‘ž) + π·β„Ž 𝑐 (π‘˜ + π‘ž)π›½β„Ž(π‘˜ + π‘ž)}] 𝑁 𝑐 β„Ž=1 βˆ’ 𝑂𝑀 𝑏 οΏ½ �𝐷 π‘ž(π‘˜ + π‘ž)οΏ½ 𝑁 𝑙 π‘ž=1 οΏ½ This function is compressed by vectors to
  • 64. 54 𝐽�π‘₯ π‘˜ 𝑏 οΏ½ = min 𝒖 π‘˜ π‘‡βˆ’1 οΏ½ 𝒄 𝒖 𝑇(π‘˜ + 𝑗)𝒖(π‘˜ + 𝑗) + 𝒄 𝒛 𝑇 π‘‡βˆ’1 𝑗=0 𝒛(π‘˜ + 𝑗) βˆ’ 𝑂𝑀 𝑏 𝑭 𝑇(π‘˜ + 𝑗)𝒖(π‘˜ + 𝑗) βˆ’ 𝑂𝑀 𝑏 𝒇 𝑇 π’˜(π‘˜ + 𝑗) where 𝑭 = [1 … 1, 1, … 𝐷𝑐(π‘˜) … ,0 … 0] 𝑇 𝒇 = [1, βˆ’1 … βˆ’ 1, βˆ’1 … βˆ’ 1] 𝑇 𝒄 𝒛 = [1 … 1,1,1 … 1,2 Β· 𝑂𝑀 𝑏] 𝑇 𝒄 𝒖(π‘˜) = [0 … 0,1, … πœŒπ‘–(π‘˜)𝐷𝑖 𝑐 (π‘˜) … , … 𝑂𝑀𝑖 … ] 𝑇 6.4 Forecasts All forecasts are time-varying over 24 hours, and are estimated from figures in Parisio et al. [8]. Renewable power generation 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ is shown in Figure 48; critical load demand 𝐷 is shown in Figure 49; and the spot price from the grid 𝑐 𝑃 is given in Figure 50. Note that 𝑐 𝑃 = 𝑐 𝑆 in all simulations in the source literature, which has been maintained here. Figure 48: Forecasted power production from renewable energy sources (RES) 0 5 10 15 20 25 0 100 200 300 400 500 600 700 Time (hr) Power(kW) Renewable production: Pres
  • 65. 55 Figure 49: Forecasted demand from the single critical load Figure 50: Forecasted spot energy price for purchasing power from the grid 0 5 10 15 20 25 0 100 200 300 400 500 600 700 800 900 1000 Time (hr) Power(kW) Critical load demand: D 0 5 10 15 20 25 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 Time (hr) Price($/kWh) Spot purchasing price: c P
  • 66. 56 6.5 Resulting problem The resulting problem is an MILP, summarized in Appendix A. With the parameters used in Appendix D, the problem has 672 variables and 2286 constraint equations. Of the variables, 144 are binary and 528 are real numbers. This represents a problem over 24 hours with four DG units, one controllable load, and one critical load.
  • 67. 57 Chapter 7: Model Predictive Simulation and results 7.1 Methods The problem is constructed in MATLAB [11]. Problem elements 𝑐 , 𝐴, 𝑏 and π’₯ are coded directly, without use of an optimization modeling tool. Variables are treated as a single vector π‘₯. Variable indices within π‘₯ are stored to allow for easy access to individual variables. The resulting MILP is solved in MOSEK [12] using its general optimization interface. MOSEK recognizes the integer-bounded set and calls a branch and bound algorithm to solve the problem. Information on this method is available in Section 0. A table of parameters used in the model is available in Section 0. Some parameters were explicitly given in literature [8, 9, 10]. Others were inferred from figures in these papers, and some were selected as to not impact the outcome of the simulations (e.g. the grid interconnect limit was set to 𝑇 𝑔 = 500 kW, in significant excess of grid exchanges shown in Parisio’s results [8]). Some sensitive parameters were critical to the simulation results of the model, but were not available or easily inferred from the literature. As they were heavily dependent on the known parameters of the model, approximations from other literature were of little use. This constraint jeopardizes the simulations provided. However, it does not impact the ability of the model to be used in contexts outside of this parameter set. 7.2 Simulations Three simulations are performed: Open-loop, deterministic: The problem is solved with perfect data at the beginning of the day. The optimal control path is made at 𝑑 = 0, and so the system is run open-loop. As the optimal control path for the problem, this simulation represents the performance benchmark. β€’ Open-loop, nondeterministic: The problem is solved with forecasted data at the beginning of the day. The problem is then simulated at each hour. Deviations in the final power balance are settled by purchasing deficit power from (or selling excess power to) the grid. β€’ Closed-loop (MPC): The system is controlled using model predictive control. The problem is solved every hour for the remaining hours in the day. Forecasted data is used to make decisions. The problem is then simulated for the upcoming hour. Deviations in power are traded across the grid. Forecasted data is generated by adding randomly-generated noise to the actual values of 𝐷, 𝑐 𝑃 = 𝑐 𝑆 and 𝑃 π‘Ÿπ‘Ÿπ‘Ÿ . This noise is normally distributed with zero-mean, with standard
  • 68. 58 deviation 5% of the mean of the data. This leads to time-invariant estimationβ€”forecast quality is independent of the proximity of the event. This may not be realistic, as information on requirements and resources is likely to improve with time. 7.3 Results 7.3.1 Cost comparison The optimal cost for the open-loop deterministic system is $1,025. This value represents benchmark performance. The open-loop nondeterministic system and the closed loop system performed reasonably similarly. The performance difference between the two systems was negligible. This is likely due to the time-invariant estimation, which may not be a realistic forecasting model. If estimation noise was increased too large, the system would become infeasible. Future work will implement infeasibility handling in the controller. From a 100-sample Monte Carlo experiment, the median [IQR] estimated cost was $973 [914–1032], and the resulting cost in simulation was $1044 [1025–1062]. 7.3.2 System elements DG units were fixed on throughout the entire day (𝛿𝑖(π‘˜) = 1, βˆ€π‘–, π‘˜). This was true even if start-up/shut-down costs were neglected and minimum up/down times were not enforced. Power generation on all units was only maximized in the evening. Power generation curves are shown in Figure 51.
  • 69. 59 Figure 51: Power generation in DG units The controllable load was not curtailed (π›½β„Ž(π‘˜) = 0). All critical load demands were met. Power transfer involved both buying and selling power from the grid. Power was sold in the morning and evenings, and purchased during the peak time of the day. Although the spot price for purchasing is greatest at midday, this is when demand spikes, giving explanation to this outcome. Importing behavior is shown in Figure 52. Figure 52: Power exchange with the grid 0 5 10 15 20 25 0 50 100 P 1 Power level of a DG unit (P) 0 5 10 15 20 25 0 50 100 P 2 0 5 10 15 20 25 0 50 100 P 3 0 5 10 15 20 25 0 50 100 P 4 Time (hr) 0 5 10 15 20 25 -400 -300 -200 -100 0 100 200 300 400 500 Pg 4 Inported power from the grid (Pg ) Time (hr) 0 5 10 15 20 25 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Ξ΄ g Importing mode from utility grid (Ξ΄g ) Time (hr)
  • 70. 60 The storage unit was completely charged in the morning at lowest spot price and demand. Minimum power to maintain full charge was given to counteract physiological storage loss. The unit was discharged at 10am, when demand began to spike. It was then recharged and subsequently discharged at 8pm. Results are shown in . Figure 53: Behavior of the storage unit 0 5 10 15 20 25 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Ξ΄b Charging state of storage unit (Ξ΄b ) Time (hr) 0 5 10 15 20 25 -150 -100 -50 0 50 100 150 Pb Power exchanged with storage unit (Pb ) Time (hr) 0 5 10 15 20 25 0 50 100 150 200 250 300 xb Stored energy (xb ) Time (hr)
  • 71. 61 Chapter 8: Conclusion In this research, a control system that contains Model Predictive Adaptive Control and Repetitive Control is proposed to provide superior power quality and maintain the safety of the microgrid. The Hardware-in-the-loop simulation of the microgrid system gives the following conclusions: β€’ In grid-connected mode, the DERs in the microgrid system are decoupled with each other. The dynamic response from one DER will not affect the other. While the coupling effect is significant in islanded mode. β€’ The strong coupling effect in islanded mode can be attenuated by applying LQI control to each DER. And the decoupled closed-loop system enables the design of repetitive control for each individual DER. β€’ The power spectrum from Hardware-in-the-loop simulation shows that repetitive control is able to effectively suppress the 3th harmonic in the output current. β€’ The proposed Model Predictive Control is able to utilize the predicted renewable energy production and predicted critical load demand to make optimal decision for controllable DERs.
  • 72. 62 GLOSSARY Term Definition DER Distributed Energy Resource DG Distributed Generation HiL Hardware in the Loop KCL Kirchoff Current Law KVL Kirchoff Voltage Law LQI Linear Quadratic Integrator MILP Mixed Integer Linear Program MPC Model Predictive Control MPPT Maximum Power Point Tracking PI Proportional Integral Control PMSG Permanent Magnet Synchronus Generator PV Photovoltaic Array
  • 73. 63 References [1] IEA, "2012 Key World Energy Statistics," 2012. [Online]. Available: http://www.iea.org/publications/freepublications/publication/kwes.pdf. [2] C. M. Colson and M. H. Nehrir, "A Review of Challenges to Real-Time Power Management of Microgrids," IEEE Power & ENergy Society Generatl Meeting, 2009. [3] B. Kroposki, R. Lasseter, T. Ise, S. Morozumi, S. Papathanassiou and N. Hatziargyriou, "Making Microgrids Work," IEEE Power & Energy Magazine, 2008. [4] B. Kroposki, T. Basso and R. DeBlasio, "Microgrid Standards and Technologies," Power and Energy Society General Meeting - Conversion and Delivery of Electrical Energy in the 21st Century, 2008. [5] S. Cocconi, S. Cuk and R. D. MIddlebrook, "High Frequency Islated 4kW Photovoltaic Inverter for Utility Interface," Power Conversion International, pp. 26-48, 1984. [6] H. Watanable, T. Shimizu and G. Kimura, "A Novel Utility Interactive Photovoltaic Inverter With Generation Control Circuit," Proc. 24th Annual Conference of THe IEEE Industrial Electronics Society (IECON), pp. 721-5, 19998. [7] N. Kikuchi, S. Shigeeda, H. Watanabe, T. Ohnishi and F. Harashima, "Singel Phase Amplitude Modulation Inverter for Utility Interaction Photovoltaic System," Proc. 25th Annual Conference of the IEEE Industrial Electronics Society (IECON), pp. 385-9, 1999. [8] M. G. Villalva, J. R. Gazoli and others, "Comprehensive approach to modeling and simulation of photovoltaic arrays," Power Electronics, IEEE Transactions on, vol. 24, no. 5, pp. 1198-1208, 2009. [9] D. Gaonkar, G. Pillai and R. Patel, "Seamless transfer of microturbine generation system operation between grid-connected and islanding modes," Electric Power Components and Systems, vol. 37, no. 2, pp. 174-188, 2009. [10] P. Basak, A. Saha, S. Chowdhury and S. Chowdhury, "Microgrid: Control techniques and modeling," in Universities Power Engineering Conference (UPEC), 2009 Proceedings of the 44th International, 2009. [11] R. Halvgaard, "Model Predictive Control for Smart Energy Systems," Technical University of Denmark, Office for Study Programmes and Student Affairs. [12] H. Jiefeng, "Advanced Control in Smart Microgrids," 2013. [13] A. Parisio, E. Rikos and L. Glielmo, "A Model Predictive Control Approach to Microgrid Operation Optimization," 2014. [14] A. Parisio and L. Glielmo, "Energy efficient microgrid management using model predictive control," in Decision and Control and European Control Conference (CDC-ECC), 2011 50th IEEE Conference on, 2011. [15] A. Parisio, E. Rikos, G. Tzamalis and L. Glielmo, "Use of model predictive control for experimental microgrid optimization," Applied Energy, vol. 115, pp. 37-46, 2014.
  • 74. 64 [16] Mathworks, "MATLAB-The Language of Technical Computting," 2014. [17] MOSEK, "MOSEK ApS-Large scale optimization software," 2014. [18] S. Boyd and L. Vandenberghe, Convex Optimization, Cambridge Press, 2004. [19] J. Mattingley, Y. Wang and S. Boyd, "Receding horizon control," Control Systems, IEEE, vol. 31, no. 3, pp. 52-65, 2011.