84
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

ETD_FinalReport

Embed Size (px)

Citation preview

Page 1: ETD_FinalReport

E n e r g y R e s e a r c h a n d D e v e l o p m e n t D i v i s i o n F I N A L P R O J E C T R E P O R T

MODELLING AND CONTROL OF MICROGRID Repetitive and Model Predictive Control

CE C-500-2014-OCT

Prepared for: California Energy Commission Prepared by: UCLA

Page 2: ETD_FinalReport

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.

Page 3: ETD_FinalReport

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.

Page 4: ETD_FinalReport

ii

Page 5: ETD_FinalReport

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.

Page 6: ETD_FinalReport

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

Page 7: ETD_FinalReport

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

Page 8: ETD_FinalReport

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

Page 9: ETD_FinalReport

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

Page 10: ETD_FinalReport

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

Page 11: ETD_FinalReport

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

Page 12: ETD_FinalReport

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.

Page 13: ETD_FinalReport

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.

Page 14: ETD_FinalReport

A blank page is inserted to insure Chapter 1 starts on an odd number page. Blank pages are not labeled.

Page 15: ETD_FinalReport

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

Page 16: ETD_FinalReport

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.

Page 17: ETD_FinalReport

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]:

Page 18: ETD_FinalReport

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,

Page 19: ETD_FinalReport

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).

Page 20: ETD_FinalReport

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

Page 21: ETD_FinalReport

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

Page 22: ETD_FinalReport

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:

Page 23: ETD_FinalReport

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.

Page 24: ETD_FinalReport

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.

Page 25: ETD_FinalReport

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

Page 26: ETD_FinalReport

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.

Page 27: ETD_FinalReport

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

Page 28: ETD_FinalReport

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.

Page 29: ETD_FinalReport

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

EnergyGeneration

Single-PhaseInverter

DC LinkSinusoidal

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

Page 30: ETD_FinalReport

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.

Page 31: ETD_FinalReport

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

Page 32: ETD_FinalReport

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 InverterIder

Vder

Vlink

MPPTDuty1

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

Page 33: ETD_FinalReport

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.

Page 34: ETD_FinalReport

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 InverterIabc

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

Page 35: ETD_FinalReport

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

Page 36: ETD_FinalReport

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-PhaseInverter

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.

Page 37: ETD_FinalReport

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

βˆ‘+–

PIVdc

V*dc

CurrentController

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

Page 38: ETD_FinalReport

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.

Page 39: ETD_FinalReport

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-PhaseInverter

Voltage Controller (Island)

Current Controller

(Grid)

EnergyGeneration

Single-PhaseInverter

DC Link

Current Mode

Controller

EnergyGeneration

Single-PhaseInverter

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

.

Page 40: ETD_FinalReport

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.

Page 41: ETD_FinalReport

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

βˆ‘+–

βˆ‘++

1z-1

Kix

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

Page 42: ETD_FinalReport

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.

Page 43: ETD_FinalReport

33

Figure 29- reduction of cross coupling using LQI

Page 44: ETD_FinalReport

34

3.3.4 Plug-In Repetitive Control Design

Figure 30-Block diagram of the "plug-in" repetitive controller

Simplifed Inverter Model

Kfb

βˆ‘++

1z-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

.

Page 45: ETD_FinalReport

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

Page 46: ETD_FinalReport

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)

Vol

tage

(Vol

ts)

LQI Reference Tracking

2.65 2.66 2.67 2.68 2.69 2.7

-100

-50

0

50

100

Time (secs)

Vol

tage

(Vol

ts)

Repetitive Control Voltage Tracking

ReferenceActual

Page 47: ETD_FinalReport

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

Page 48: ETD_FinalReport

38

Figure 36- Fourier transform of the output currents during island mode

Page 49: ETD_FinalReport

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

Page 50: ETD_FinalReport

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

Page 51: ETD_FinalReport

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

Page 52: ETD_FinalReport

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.

Page 53: ETD_FinalReport

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:

Page 54: ETD_FinalReport

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.

Page 55: ETD_FinalReport

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.

Page 56: ETD_FinalReport

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.

Page 57: ETD_FinalReport

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

Page 58: ETD_FinalReport

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

Page 59: ETD_FinalReport

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

Page 60: ETD_FinalReport

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) = π‘₯𝑏(π‘˜) + πœ‚π‘ƒπ‘(π‘˜) βˆ’ π‘₯𝑏𝑏

Page 61: ETD_FinalReport

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

Page 62: ETD_FinalReport

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}.

Page 63: ETD_FinalReport

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

Page 64: ETD_FinalReport

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 250

100

200

300

400

500

600

700

Time (hr)

Pow

er (k

W)

Renewable production: Pres

Page 65: ETD_FinalReport

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 250

100

200

300

400

500

600

700

800

900

1000

Time (hr)

Pow

er (k

W)

Critical load demand: D

0 5 10 15 20 250

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

0.2

Time (hr)

Pric

e ($

/kW

h)

Spot purchasing price: cP

Page 66: ETD_FinalReport

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.

Page 67: ETD_FinalReport

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

Page 68: ETD_FinalReport

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.

Page 69: ETD_FinalReport

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 250

50

100

P1

Power level of a DG unit (P)

0 5 10 15 20 250

50

100

P2

0 5 10 15 20 250

50

100

P3

0 5 10 15 20 250

50

100

P4

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)

Page 70: ETD_FinalReport

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 250

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 250

50

100

150

200

250

300

xb

Stored energy (xb)

Time (hr)

Page 71: ETD_FinalReport

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.

Page 72: ETD_FinalReport

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

Page 73: ETD_FinalReport

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.

Page 74: ETD_FinalReport

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.

Page 75: ETD_FinalReport

A-1

Appendix A A.1 Final MPC optimization problem The final MILP problem is given as follows

minimize minπ’–π‘˜π‘‡βˆ’1

οΏ½ 𝒄𝒖𝑇(π‘˜ + π‘ž)𝒖(π‘˜ + π‘ž) + π’„π’›π‘‡π‘‡βˆ’1

π‘ž=0

𝒛(π‘˜ + π‘ž) βˆ’ 𝑂𝑀𝑏𝑭𝑇(π‘˜ + π‘ž)𝒖(π‘˜ + π‘ž) βˆ’ π‘‚π‘€π‘π’‡π‘‡π’˜(π‘˜ + π‘ž)

subject to 0 ≀ 𝛿𝑙(π‘˜) ≀ 1 0 ≀ 𝛿𝑏(π‘˜) ≀ 1

0 ≀ 𝛿𝑔(π‘˜) ≀ 1

π‘₯𝑏(π‘˜ + 1) = π‘₯𝑏(π‘˜) + οΏ½πœ‚π‘ +1πœ‚π‘‘οΏ½ 𝑧𝑏(π‘˜) +

1πœ‚π‘‘

[𝑭𝑇(π‘˜)𝒖(π‘˜) + π’‡π‘‡π’˜(π‘˜)]βˆ’ π‘₯𝑏𝑏

𝔼1𝑔𝛿𝑔(π‘˜) + 𝔼2

𝑔𝐢𝑔(π‘˜) ≀ 𝔼3𝑔(π‘˜)𝑃𝑔(π‘˜) + 𝔼4

𝑔

𝔼1𝑏𝛿𝑏(π‘˜) + 𝔼2𝑏𝑧𝑏(π‘˜) ≀ 𝔼3𝑏𝑃𝑏(π‘˜) + 𝔼4𝑏

𝛿𝑙(π‘˜ βˆ’ 1) βˆ’ 𝛿𝑙(π‘˜) ≀ 1 βˆ’ 𝛿𝑙(πœπ‘‘π‘‘π‘‘π‘™)𝛿𝑙(π‘˜) βˆ’ 𝛿𝑙(π‘˜) ≀ 𝛿𝑙(πœπ‘π‘’)

π‘†π‘ˆπ‘™(π‘˜) β‰₯ 𝑐𝑙𝑆𝑆(π‘˜)[𝛿𝑙(π‘˜) βˆ’ 𝛿𝑙(π‘˜ + 1)]𝑆𝐷𝑙(π‘˜) β‰₯ 𝑐𝑙𝑆𝐷(π‘˜)[𝛿𝑙(π‘˜ + 1) βˆ’ 𝛿𝑙(π‘˜)]

π‘†π‘ˆπ‘™(π‘˜) β‰₯ 0𝑆𝐷𝑙(π‘˜) β‰₯ 0

π‘₯π‘šπ‘™π‘™π‘ ≀ π‘₯𝑏(π‘˜) ≀ π‘₯π‘šπ‘šπ‘šπ‘

𝑃𝑙,π‘šπ‘™π‘™π›Ώπ‘™(π‘˜) ≀ 𝑃𝑙(π‘˜) ≀ 𝑃𝑙,π‘šπ‘šπ‘šπ›Ώπ‘™(π‘˜)|𝑃𝑙(π‘˜ + 1) βˆ’ 𝑃𝑙(π‘˜)| ≀ 𝑅𝑙,π‘šπ‘šπ‘šπ›Ώπ‘™(π‘˜)

π›½β„Ž,π‘šπ‘™π‘™ ≀ π›½β„Ž(π‘˜) ≀ π›½β„Ž,π‘šπ‘šπ‘š

οΏ½ 𝑃𝑙(π‘˜) + 𝑃𝑑𝑑𝑏(π‘˜) + 𝑃𝑔(π‘˜) + 𝑃𝑏(π‘˜) = οΏ½ 𝐷𝑗(π‘˜)𝑁𝑙

𝑗=1

𝑁𝑔

𝑙=1+ οΏ½ [1 βˆ’ π›½β„Ž(π‘˜)]π·β„Žπ‘(π‘˜)

𝑁𝑐

β„Ž=1

where 𝑭 = [1 … 1, 1, …𝐷𝑐(π‘˜) … ,0 … 0]𝑇

𝒇 = [1,βˆ’1 β€¦βˆ’ 1,βˆ’1 β€¦βˆ’ 1]𝑇

𝒄𝒛 = [1 … 1,1,1 … 1,2 Β· 𝑂𝑀𝑏]𝑇

𝒄𝒖(π‘˜) = [0 … 0,1, β€¦πœŒπ‘™(π‘˜)𝐷𝑙𝑐(π‘˜) … , …𝑂𝑀𝑙 … ]𝑇

Page 76: ETD_FinalReport

A-2

and 𝛿𝑙(π‘˜) ∈ β„€ 𝛿𝑏(π‘˜) ∈ β„€

𝛿𝑔(π‘˜) ∈ β„€πœπ‘‘π‘‘π‘‘π‘™ = {1, … , min(𝑇 + π‘˜,𝑇𝑑𝑑𝑑𝑙 + π‘˜)}πœπ‘π‘’ = {1, … , min(𝑇 + π‘˜,𝑇𝑏𝑒 + π‘˜)}

𝔼1𝑏 = [𝐢𝑏 βˆ’ (𝐢𝑏 βˆ’ πœ–) 𝐢𝑏 𝐢𝑏 βˆ’ 𝐢𝑏 βˆ’ 𝐢𝑏]𝑇

𝔼2𝑏 = [0 0 1 βˆ’ 1 1 βˆ’ 1]𝑇

𝔼3𝑏 = [1 βˆ’ 1 1 βˆ’ 1 0 0]𝑇

𝔼4𝑏 = [𝐢𝑏 βˆ’ πœ– 𝐢𝑏 𝐢𝑏 0 0]𝑇

𝔼1𝑔 = [𝑇𝑔 βˆ’ (𝑇𝑔 + πœ–) 𝑀𝑔 𝑀𝑔 βˆ’π‘€π‘” βˆ’π‘€π‘”]𝑇

𝔼2𝑔 = [0 0 1 βˆ’ 1 1 βˆ’ 1]𝑇

𝔼3𝑔 = [1 βˆ’ 1 𝑐𝑑(π‘˜) βˆ’π‘π‘‘(π‘˜) 𝑐𝑆(π‘˜) βˆ’ 𝑐𝑆(π‘˜)]𝑇

𝔼4𝑔 = [𝑇𝑔 βˆ’ πœ– 𝑀𝑔 𝑀𝑔 0 0]𝑇

𝑀𝑔 = max𝑙

(𝑐𝑑(π‘˜), 𝑐𝑆(π‘˜)) Β· 𝑇𝑔

π‘˜ = {1, … ,𝑇}𝑖 = {1, … ,𝑁𝑔}𝑗 = {1, … ,𝑁𝑙}β„Ž = {1, … ,𝑁𝑐}

Page 77: ETD_FinalReport

B-1

Appendix B B.1 Mixed-integer linear programs

B.1.1 Introduction to MILPs A mixed-integer linear program (MILP) is an optimization problem with linear objective function and constraints, where some set of elements in the variable vector are integer-constrained. An MILP is of the form

minimize 𝑐𝑇π‘₯ subject to 𝐴π‘₯ ≀ 𝑏

π‘₯𝑙 ∈ β„€, βˆ€π‘– ∈ π’₯

where π‘₯ ∈ ℝ𝑙 is the variable vector to be optimized, 𝑐𝑇π‘₯ is the objective function (with 𝑐 ∈ ℝ𝑙), 𝐴π‘₯ ≀ 𝑏 is the constraint set (with 𝐴 ∈ β„π‘šπ‘šπ‘™ and 𝑏 ∈ β„π‘š), and π’₯ is the set of integer-constrained elements of π‘₯.

B.1.2 Solving MILPs

Branch and bound methods MILPs are solved using branch and bound methods [16]. Branch and bound methods are a set of algorithms for solving global non-convex optimization problems. As global methods, they converge to the global optimal solution and can provide a certificate of optimality. However, they have an exponential-time worst-cast computational complexity.

Branch and bound methods require two subroutines that can calculate a lower and upper bound of the optimal value in a given space. Any suitable subroutines may be used, although they should be computationally inexpensive, and should be tight as the space diminishes.

The region is partitioned into convex sets, and the bounds on the optimal point are found in each set. These bounds allow the algorithm to refine its search into deeper partitions. These partitions are defined by the method of interest.

B.1.3 Algorithm Given the lower and upper bound functions Φ𝑙𝑏(𝑄) and Φ𝑏𝑏(𝑄), the optimal point Ξ¦π‘šπ‘™π‘™(𝑄) lies in

Φ𝑙𝑏(𝑄) ≀ Ξ¦π‘šπ‘™π‘™(𝑄) ≀ Φ𝑏𝑏(𝑄)

It is important to note that no value in the region is lesser than Φ𝑙𝑏(𝑄), as it is a lower bound on the minimum value π‘“βˆ—. However Φ𝑏𝑏(𝑄) is the upper bound on π‘“βˆ—, not the entire region, and so values in the region may exceed Φ𝑏𝑏(𝑄).

Page 78: ETD_FinalReport

B-2

Then the following algorithm [16] is run:

1. Compute the lower and upper bounds Φ𝑙𝑏(𝑄), Φ𝑏𝑏(𝑄) in the region 𝑄. a. Choose 𝐿1 = Φ𝑙𝑏(𝑄) and π‘ˆ1 = Φ𝑏𝑏(𝑄) b. Terminate if π‘ˆ1 βˆ’ 𝐿1 ≀ πœ–, where πœ– is the tolerance on the solution

2. Select a partition by splitting 𝑄 into 𝑄1, 𝑄2. 3. Take the most informative lower and upper bounds from the leaves and parent nodes in

the search a. New lower bound 𝐿2 = min {Φ𝑙𝑏(𝑄1),Φ𝑙𝑏(𝑄2)} b. New upper bound π‘ˆ2 = min{Φ𝑏𝑏(𝑄1),Φ𝑏𝑏(𝑄2)} c. Terminate if π‘ˆ2 βˆ’ 𝐿2 ≀ πœ–

4. Repeat steps 2–4

Region partitioning is not defined by the method class. However, a popular method is to split the region containing the smallest lower bound, along the longest edge, and into two even halves. These partitions can be treated as a binary tree, with each node containing a lower and upper bound of the region. This representation is shown in Figure 54 [16].

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].

B.1.4 Bounding methods Any lower and upper bounding subroutines can be used in a branch and bound method, as long as they are tight as the region diminishes. The selection of subroutine represents a tradeoff between computational complexity and proximity to the minimum in the region of interest.

To calculate an upper bound:

Page 79: ETD_FinalReport

B-3

β€’ Call a local optimization method over the region. This method may find the optimal point. Otherwise it will find a locally optimal point for some localized region inside the region. This point is taken as an upper bound on the globally optimal point.

β€’ One or more points can be chosen in the region. These may be chosen systematically or randomly. The minimum value of these points is a computationally trivial upper bound on the minimum value in the region.

For lower bounds:

β€’ If a convex relaxation of the function is readily available, it can serve as a lower bound. β€’ If the function is known to be Lipschitz continuous, its rate of change is known to be

limited, providing information that can lead to a lower bound. β€’ The Lagrange dual of the function always bounds the original (primal) function below,

and can be used as a lower bound.

B.1.5 Pruning It is possible to remove a region in the search if it cannot contain the optimal solution. Pruning is performed on regions 𝑄 in which

Φ𝑙𝑏(𝑄) > π‘ˆπ‘™

as there is a point π‘ˆπ‘™ outside of 𝑄 that is smaller than every point inside of 𝑄. Therefore π‘“βˆ— is not inside of 𝑄.

While pruning is helpful conceptually, it is not necessary for the algorithm to converge to a solution. It does however have storage benefits in large-scale problems [16]. Furthermore, the amount of pruning performed at a given iteration can be used a metric of algorithm progress.

Page 80: ETD_FinalReport

C-1

Appendix C C.1 Model predictive control C.1.1 Introduction to MPC Model predictive control (MPC) [16] is a closed-loop control method for controlling systems with difficult disturbance and low sampling frequencies. An optimization problem is solved at each timestep, determining the controller action over a fixed horizon. Every timestep, the horizon is shifted back, and the entire problem is re-solved. For this reason MPC is sometimes referred to as receding horizon control (RHC).

C.1.2 Problem formulation Consider a discrete, linear dynamical system:

π‘₯𝑑+1 = 𝐴π‘₯𝑑 + 𝐡𝑒𝑑 + 𝑐𝑑

where π‘₯𝑑 ∈ ℝ𝑙 is the system state output, 𝑒𝑑 ∈ β„π‘š is the controller input that is chosen, 𝐴𝑑 ∈ β„π‘™π‘šπ‘™ is the system dynamics, 𝐡𝑑 ∈ β„π‘™π‘šπ‘š is the input dynamics, and 𝑐𝑑 ∈ ℝ𝑙 is some external disturbance. The system is also constrained by the constraint set

(π‘₯𝑑,𝑒𝑑) ∈ π’žπ‘‘

An overall cost function is developed that is the average instantaneous cost function 𝑙𝑑(π‘₯𝑑,𝑒𝑑) for all remaining timesteps:

𝐽 = limπ‘β†’βˆž

1𝑁� 𝑙𝑑(π‘₯𝑑,𝑒𝑑)π‘βˆ’1

𝑑=0

In reality, the cost is calculated over a finite horizon 𝑇. For every timestep, this horizon is shifted back by Δ𝑑. Hence,

𝐽 =1𝑇� 𝑙𝑑(π‘₯𝑑,𝑒𝑑)π‘‡βˆ’1

𝑑=0

Therefore the deterministic problem [16], solved from time 𝑑 through to the end of the horizon 𝑑 + 𝑇 is

minimize1

𝑇 + 1οΏ½ π‘™πœ(π‘₯𝜏,π‘’πœ)

𝑑+𝑇

𝜏=𝑑subject to π‘₯𝜏+1 = 𝐴𝜏π‘₯𝜏 + π΅πœπ‘’πœ + π‘πœ, 𝜏 = 𝑑, … , 𝑑 + 𝑇

(π‘₯𝜏,π‘’πœ) ∈ π’žπœ, 𝜏 = 𝑑, … , 𝑑 + 𝑇

Page 81: ETD_FinalReport

C-2

However, the external disturbance 𝑐𝑑 is not known at the time of calculation. Furthermore, MPC problem allows for linear variant systems that are not necessarily deterministic. Therefore the values

𝐴𝑑 ,𝐡𝑑, 𝑐𝑑,π’žπ‘‘, 𝑙𝑑, π‘₯𝑑

are replaced with estimates

οΏ½Μ‚οΏ½πœ|𝑑,𝐡�𝜏|𝑑, οΏ½Μ‚οΏ½πœ|𝑑 , οΏ½Μ‚οΏ½πœ|𝑑 , π‘™πœ|𝑑 , π‘₯�𝜏|𝑑

where 𝜏|𝑑 is the estimate of a quantity at time 𝜏, based on information at time 𝑑, and 𝜏 β‰₯ 𝑑. This leads to the MPC problem [16]:

minimize1

𝑇 + 1οΏ½ π‘™πœ|𝑑(π‘₯�𝜏,π‘’οΏ½πœ)

𝑑+𝑇

𝜏=𝑑

subject to π‘₯�𝜏+1 = οΏ½Μ‚οΏ½πœ|𝑑π‘₯�𝜏 + 𝐡�𝜏|π‘‘π‘’οΏ½πœ + οΏ½Μ‚οΏ½πœ|𝑑, 𝜏 = 𝑑, … , 𝑑 + 𝑇

(π‘₯�𝜏,π‘’οΏ½πœ) ∈ οΏ½Μ‚οΏ½πœ|𝑑π‘₯�𝑑 = π‘₯�𝑑|𝑑

If π’žπ‘‘ and 𝑙𝑑 are convex, then this is a convex optimization problem and can be solved efficiently using conventional solver methods such as the interior point method.

The MPC problem is solved at each timestep. The optimal control input π‘’π‘‘βˆ— is performed at time 𝑑; future control inputs π‘’πœβˆ—, 𝜏 = 𝑑 + 1, … , 𝑑 + 𝑇 are unused.

C.1.3 Handling Infeasibility As the problem models a real-time control system that is subject to random disturbances and physical constraints, there is the possibility that the optimization problem may be primal infeasible. This is problematic, as such a result does not provide a useful approach to restoring the system to feasibility by its next timestep.

A simple example of this infeasibility is a one-dimensional spring-mass-damper system bound by displacement constraint π‘₯π‘šπ‘™π‘™ ≀ π‘₯𝑑 ≀ π‘₯π‘šπ‘šπ‘š. If a disturbance at time 𝑑 βˆ’ 1 displaces the system outside of these bounds, and there is not a control action available to return it, the problem will become infeasible.

This problem can be mitigated in the modeling stage by including soft constraints [16]. These are constraints that can be violated, albeit with significant penalty to the cost function. The system will then avoid violation of these constraints, and if the problem would be otherwise infeasible, develop an optimal control path to return to the region of feasibility.

While efforts can be made to mitigate the risk of infeasibility by smart modeling, it may still occur. In a real-time system, the best generalizable course of action is to continue on

Page 82: ETD_FinalReport

C-3

the last feasible control path calculated [16]. Although this approach provides an otherwise-uncalculated control path, it does not guarantee that the output will be safe, nor that future timesteps will be feasible.

Page 83: ETD_FinalReport

D-1

Appendix D D.1 MPC model parameters D.1.1 Parameters Parameter Value Unit Description Source 𝑇 24 hr Number of timesteps in receding horizon [11] 𝑁𝑔 4 Number of DG units [11] π‘Ž1 [0.0013; 0.001; 0.0004;

0.0006] 𝐢𝐷𝐷 consumption curve coefficient

[11] π‘Ž2

[0.062; 0.057; 0.06; 0.058]

𝐢𝐷𝐷 consumption curve coefficient [11]

π‘Ž3

[1.34; 1.14; 1.14; 1.9]

𝐢𝐷𝐷 consumption curve coefficient [11]

𝑂𝑀 0.001 $/hr Operating cost of a DG unit [11] π‘…π‘šπ‘šπ‘š 250 kW/hr Ramp-up limit of a DG unit

𝑇𝑏𝑒 1 hr Minimum up-time of a DG unit 𝑇𝑑𝑑𝑑𝑙 1 hr Minimum down-time of a DG unit π‘ƒπ‘šπ‘™π‘™ [6; 16.4; 16; 12.3] kW Minimum power of a DG unit [11]

π‘ƒπ‘šπ‘šπ‘š [50; 92; 90; 72] kW Maximum power of a DG unit [11] 𝑐𝑆𝑆 0.002 $ Start-up cost of a DG unit

𝑐𝑆𝐷 0.001 $ Shut-down cost of a DG unit 𝑂𝑀𝑏 0.1 $/kWh Operating cost from energy exchanged with

storage unit π‘₯𝑏𝑏 0.9 kW Energy loss rate from storage unit π‘₯π‘šπ‘™π‘™

𝑏 25 kWh Minimum energy in storage unit [11] π‘₯π‘šπ‘šπ‘šπ‘ 250 kWh Maximum energy in storage unit [11] 𝐢𝑏 150 kW Output power limit of storage unit [11] πœ‚π‘ 0.9 Charging efficiency of storage unit [11] πœ‚π‘‘ 0.9 Discharging efficiency of storage unit [11]

𝑁𝑙 1 Number of critical loads 𝑁𝑐 1 Number of controllable loads π›½π‘šπ‘™π‘™ 0.9 Minimum allowed curtailment of a

controllable load π›½π‘šπ‘šπ‘š 1 Maximum allowed curtailment of a

controllable load 𝐷𝑐 125 kW Preferred power level of a controllable load [11]

πœŒπ‘ 1 Penalty weight on curtailments 𝑇𝑔 500 kW Maximum interconnection power flow limit

with grid 𝑁𝑒𝑑𝑙 10 Number of piecewise linear (PWL) lines in

𝐢𝐷𝐷 approximation

Page 84: ETD_FinalReport

D-2

D.1.2 Forecasted quantities Parameter Unit Description Source 𝑃𝑑𝑑𝑏 kW Sum of RES power production [11] 𝐷 kW Power level required by critical load [11] 𝑐𝑑 $/kWh Spot purchase price from grid [11] 𝑐𝑆 $/kWh Spot selling price from grid [11]

D.1.3 Variables Variable Unit Description 𝛿 {0,1} Off/On (0/1) state of a DG unit 𝛿𝑏 {0,1} Dis/Charging (0/1) state of the storage unit 𝛿𝑔 {0,1} Ex/Importing (0/1) power from the grid 𝑃 kW Power level of a DG unit 𝑃𝑏 kW Power exchanged (charging +ve) with storage

unit 𝑃𝑔 kW Im/Exporting (+ve/-ve) power from the grid π‘₯𝑏 kWh Energy in storage unit 𝛽 Curtailed power percentage on a controllable

load

D.1.4 Auxiliary variables The following variables are not formally listed in Parisio et al. [11], but are used to assist computation.

Variable Description 𝜎 Cost estimate of DG operation 𝐢𝑔 Purchasing/selling from grid

switch π‘†π‘ˆ Start-up cost of DG unit 𝑆𝐷 Shut-down cost of DG unit 𝑧𝑏 Storage exchange switch