Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real ›...

5
1 Real-Time Digital Simulation of Microgrid Control Strategies Chanaka Keerthisinghe * , Member, IEEE, Daniel S. Kirschen * , Fellow, IEEE, and Scott Gibson * Department of Electrical and Computer Engineering, University of Washington, Seattle, Washington 98195, USA Snohomish County Public Utility District, Everett, Washington 98201, USA Email: [email protected], [email protected] and [email protected] Abstract—This paper evaluates microgrid control strategies prior to actual implementation using a real-time digital simulator. The microgrid model includes photovoltaic generation, a battery, an emergency generator, loads and a vehicle-to-grid enabled electric vehicle charging station. Three operational scenarios are studied: grid-connected operation; seamless transition to islanded mode with the battery inverter operating in grid-forming mode; and islanded operation using the emergency generator when the battery is discharged. Index Terms—microgrid, real-time digital simulation, OPAL- RT R , Simulink R I. I NTRODUCTION R EAL-TIME digital simulations can be used to evaluate and design microgrid control strategies without any risk prior to actual deployment in the field [1]–[8]. This paper describes a model of the microgrid that the Snohomish County Public Utility District (Snohomish PUD) is building in Arlington, Washington State. This microgrid is currently in the design stage and is expected to be completed by the end of 2020 [9]. It consists of PV generation, a battery, an emergency generator, loads and a vehicle-to-grid (V2G) enabled electric vehicle (EV) charging station. When the microgrid is synchronized to the main grid, the battery will be used for solar smoothing, peak-shaving and energy arbitrage. The battery and PV inverters will then operate in grid-following mode. On the other hand, when the micro- grid is islanded, the battery inverter will operate in grid- forming mode while the PV inverter will operate in grid- following mode. The emergency generator will only be used when the battery is discharged and there is insufficient PV generation. The batteries of the EVs are capable of supporting the microgrid and the electrical grid. The simulation models developed in MathWorks R Simulink R using the Simscape Power Systems TM (formerly SimPowerSystems TM ) toolbox are available to the public and could be adapted to model other microgrids [10]. The rest of the paper is structured as follows: Section II presents the Simulink R models of the microgrid. Section III describes the setup used for the real-time digital simulation. Section IV presents simulation results for different operating scenarios. Section V draws conclusions and outlines future work. Electrical Grid Loads - Arlington Office and Clean Energy Technology Center PV System A B C a b c Yg D1 2 MVA 480 V / 12 kV A B C a b c Yg Yg 500 kVA 12 kV / 480 V A B C a b c Emergency Generator A B C a b c A B C a b c A B C a b c ? ? ? Point of common coupling (PCC) A B C a b c Battery Storage System A B C a b c Vehicle-Grid Integration A B C a b c A B C a b c Yg D1 200 kVA 480 V / 240 V Fig. 1. Components of the Arlington Microgrid. TABLE I SPECIFICATIONS OF THE REC TWINPEAK 2S MONO 72 SERIES 375 W PV MODULE Parameters Values Maximum power 375 W Open circuit voltage (Voc) 48 V Rated Voltage (Vr) 40.1 V Short circuit current (Isc) 9.96 A Rated current (Ir) 9.36 A Temperature coefficient of Voc -0.28 %/C Temperature coefficient of Isc 0.04 %/C Number of cells per module 144 II. MICROGRID MODEL Figure 1 shows the connections between the various com- ponents of the microgrid. The following subsections describe in detail how each of these components is modeled. A. PV System The PV system consists of the PV array, maximum power point tracker (MPPT) and an inverter. The PV array [11] consists of multiple PV modules connected in series and parallel to achieve the desired voltage and current. Table I provides the specifications of the PV modules. The PV array consists of 1640 modules divided into four sub-arrays, each of which contains 410 modules organized in 41 strings of 10 series-connected modules, and is rated at 615 kWdc. Fig. 2 shows the current-voltage and power-voltage charac- teristics of each sub-array for different solar irradiances and temperatures. Each array is equipped with an MPPT to keep

Transcript of Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real ›...

Page 1: Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real › microgrid_RTDS › RTDSpaper.pdf · 2019-11-21 · Fig. 6 illustrates this real-time digital

1

Real-Time Digital Simulation of Microgrid ControlStrategies

Chanaka Keerthisinghe∗, Member, IEEE, Daniel S. Kirschen∗, Fellow, IEEE, and Scott Gibson†∗Department of Electrical and Computer Engineering, University of Washington, Seattle, Washington 98195, USA

†Snohomish County Public Utility District, Everett, Washington 98201, USAEmail: [email protected], [email protected] and [email protected]

Abstract—This paper evaluates microgrid control strategiesprior to actual implementation using a real-time digital simulator.The microgrid model includes photovoltaic generation, a battery,an emergency generator, loads and a vehicle-to-grid enabledelectric vehicle charging station. Three operational scenarios arestudied: grid-connected operation; seamless transition to islandedmode with the battery inverter operating in grid-forming mode;and islanded operation using the emergency generator when thebattery is discharged.

Index Terms—microgrid, real-time digital simulation, OPAL-RT R©, Simulink R©

I. INTRODUCTION

REAL-TIME digital simulations can be used to evaluateand design microgrid control strategies without any risk

prior to actual deployment in the field [1]–[8].This paper describes a model of the microgrid that the

Snohomish County Public Utility District (Snohomish PUD)is building in Arlington, Washington State. This microgrid iscurrently in the design stage and is expected to be completedby the end of 2020 [9]. It consists of PV generation, abattery, an emergency generator, loads and a vehicle-to-grid(V2G) enabled electric vehicle (EV) charging station. Whenthe microgrid is synchronized to the main grid, the batterywill be used for solar smoothing, peak-shaving and energyarbitrage. The battery and PV inverters will then operate ingrid-following mode. On the other hand, when the micro-grid is islanded, the battery inverter will operate in grid-forming mode while the PV inverter will operate in grid-following mode. The emergency generator will only be usedwhen the battery is discharged and there is insufficient PVgeneration. The batteries of the EVs are capable of supportingthe microgrid and the electrical grid. The simulation modelsdeveloped in MathWorks R© Simulink R© using the SimscapePower SystemsTM (formerly SimPowerSystemsTM) toolbox areavailable to the public and could be adapted to model othermicrogrids [10].

The rest of the paper is structured as follows: Section IIpresents the Simulink R© models of the microgrid. Section IIIdescribes the setup used for the real-time digital simulation.Section IV presents simulation results for different operatingscenarios. Section V draws conclusions and outlines futurework.

Ts_Power=50 usTs_Control=100 us

"rtio_opalrt_common"not found

OpCtrl

Electrical Grid

BatteryVals 1

Bat

Pload 2

Pload

Grid 3

Grid

BatteryControl2

Battery cha / dis

Loads - Arlington Office and Clean Energy Technology Center

Vabc

Iabc

P

Q

Active&ReactivePower

(DGtotal)

VabcDG

IabcDG

4

Total DG

abc

Freq

wt

-K-

(1/1000)V

-K-

(1/1000)I

-K-

(1/1000)P

-K-

(1/1000)Q

1

PCC mode

IslandGrid

3

Load variations

LoadVar

PV System

PVdata 5

PV

4

Solar irradiance

5

Temperature

Temp

SolarIns

A

B

C

a

b

cYgD1

2 MVA480 V / 12 kV

A B C

a b cY

gY

g

500 kVA12 kV / 480 V

ABC

abc

Emergency Generator

Gen 6

EG

6

Generator

DieselGenCon

A

B

C

a

b

c

A

B

C

a

b

c

A

B

C

a

b

c

? ? ?

Point of common coupling (PCC)

A

B

C

a

b

c

"rtlab"not found

OpComm2

PowerDGfPCC

EVdata 7

EV

Battery Storage System

A

B

C

a

b

c

Vehicle-Grid Integration

A

B

C

a

b

c

A

B

C

a

b

cYgD1

200 kVA480 V / 240 V

Fig. 1. Components of the Arlington Microgrid.

TABLE ISPECIFICATIONS OF THE REC TWINPEAK 2S MONO 72 SERIES 375 W

PV MODULE

Parameters ValuesMaximum power 375 WOpen circuit voltage (Voc) 48 VRated Voltage (Vr) 40.1 VShort circuit current (Isc) 9.96 ARated current (Ir) 9.36 ATemperature coefficient of Voc -0.28 %/CTemperature coefficient of Isc 0.04 %/CNumber of cells per module 144

II. MICROGRID MODEL

Figure 1 shows the connections between the various com-ponents of the microgrid. The following subsections describein detail how each of these components is modeled.

A. PV System

The PV system consists of the PV array, maximum powerpoint tracker (MPPT) and an inverter. The PV array [11]consists of multiple PV modules connected in series andparallel to achieve the desired voltage and current. Table Iprovides the specifications of the PV modules. The PV arrayconsists of 1640 modules divided into four sub-arrays, eachof which contains 410 modules organized in 41 strings of 10series-connected modules, and is rated at 615 kWdc.

Fig. 2 shows the current-voltage and power-voltage charac-teristics of each sub-array for different solar irradiances andtemperatures. Each array is equipped with an MPPT to keep

Page 2: Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real › microgrid_RTDS › RTDSpaper.pdf · 2019-11-21 · Fig. 6 illustrates this real-time digital

2

0 100 200 300 400 500

Voltage (V)

0

100

200

300

400

Curr

ent (A

)

1 kW/m2

0.5 kW/m2

0.1 kW/m2

0 100 200 300 400 500

Voltage (V)

0

50

100

150

Pow

er

(kW

)

1 kW/m2

0.5 kW/m2

0.1 kW/m2

(a)

(b)

0 100 200 300 400 500

Voltage (V)

0

100

200

300

400

Curr

ent (A

)

45 oC

25 oC

0 100 200 300 400 500

Voltage (V)

0

50

100

150

Pow

er

(kW

)

45 oC

25 oC

(c)

(d)

Fig. 2. PV sub-array current-voltage and power-voltage characteristics fordifferent solar irradiances (a, b) and temperatures (c, d). The temperaturevalue for diagrams a and b is 25 0C while the solar irradiance for diagrams cand d is 1000 W/m2.

the voltage at the the maximum power point (MPP) as thesolar irradiance and the temperature of the panel change. Thistracking is achieved using a DC-DC converter that implementsa perturb and observe algorithm. Note that the voltages on thePV array and the dc link can therefore be different. Anotheroption would be to connect the PV array directly to the dclink of the inverter and to incorporate the MPPT algorithm inthe controller of this inverter [12].

The PV inverter is a two-level three-bridge voltage sourceconverter (VSC) that operates in grid-following mode. Fig.3 summarizes the inverter control algorithm. The referencevoltage and current signals for phase-locked-loop (PLL) aremeasured from the inverter output. The PLL and measurementsblock calculate the angle synchronized on the rising zero-crossing of the fundamental of the reference signal, andtransform both voltages and currents from the abc to the dq0reference frames.

When the input power from the solar array changes dueto variation in irradiance or temperature, the DC link voltagealso changes because the power obtained from the array doesnot match the power delivered to the grid. The function of thevoltage regulator is thus to change the active power referencecurrent (Id) of the current regulator so that power obtainedfrom the solar array matches the power delivered to the grid[13].

The current regulator uses the current references Id and Iq(reactive current) to calculate the required reference voltagesfor the inverter. The reactive current reference is taken as 0in this model, as the system only supplies active power to thegrid. More details about this controller can be found in [14]. Inthis model, the harmonics produced by the inverter are filteredusing a single inductor (L). However, other filtering optionsare possible [13].

B. Battery Energy Storage

The battery energy storage system consists of a Li-ionbattery, a dc-dc converter and an inverter with both grid-forming and grid-following capabilities. Table II provides thespecifications for the battery model [15]. A bi-directional DC-DC converter is inserted between the inverter and the battery tocontrol the battery charge and discharge rates in grid-following

VSC Main Controller

1Uref

Vdc_mes

Vdc_ref

Id_ref

VDC Regulator

wt

VdVq_conv

Uabc_ref

Uabc_ref Generation max (m) = 1

Vabc_prim

Iabc_prim

wt

VdVq_prim

IdIq_prim

PLL & Measurements

Vdc_ref

0

Iq_ref

VdVq_mes

IdIq_mes

IdIq_ref

VdVq_conv

Current Regulator

3

Vdc_mes

2

Iabc_prim

1

Vabc_prim

Fig. 3. Control of the PV inverter for grid-following operation.

TABLE IISPECIFICATIONS OF THE BATTERY

Parameters ValuesNominal voltage 800 VRated capacity 1250 AhFully charged voltage 931.2 VMaximum capacity 1320 AhCapacity @nominal voltage 1250 AhNominal discharge current 1250 AExponential zone voltage 860 VExponential zone capacity 60 AhInternal resistance 0.0064

1

Vabc_inv

0

Vq_ref (pu)

PI(z)

VqPI Controller

PI(z)

VdPI Controller

0

V0

2

Vabc (pu)

1

Vd_ref (pu)

abc

Freq

wt

3ph PLL60Hz

abc

wtdq0 dq0

wtabc

Vd inverter

Vq inverter

Fig. 4. Battery inverter operation as a voltage regulator during islandedoperation.

mode [16]. The battery inverter control for grid-connectedmode, which is similar to the PV inverter controller [12]. Inislanded mode, this inverter controller operates as a voltageregulator as shown in Fig. 4.

C. Emergency Generator

The emergency diesel generator consists of a synchronousgenerator, diesel engine governor and an excitation system,as shown in Fig. 5. The model of the synchronous machinetakes into account the dynamics of the stator, field, anddamper windings and is represented using a sixth-order model[17]. Table III. provides the specifications of this emergencygenerator.

In order to synchronise the emergency generator it’s fre-quency, voltage magnitude and phase angle must be matchedwith those of the microgrid. The frequency of the emergencygenerator, fg is given by:

ns =120fgP

(1)

where ns is the synchronous speed of the generator in revo-lutions per minute and P is the number of poles. The desiredfrequency is obtained by changing the speed reference of the

Page 3: Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real › microgrid_RTDS › RTDSpaper.pdf · 2019-11-21 · Fig. 6 illustrates this real-time digital

3

1

a

3

c

2

b

VabcG

IabcG Qg

Va (pu)2

Va (pu)3

-K-

(1/1000)

abcFreq

wtFrequency1

P_B8

P_B9

Vabc

Iabc

P

Q

Active&ReactivePower

-K-

(1/1000)1

Pg

Fg

P_B1

Pg

P(kW)1

1

wref (pu)

1

Vtref (pu)

SM

wref (pu)

w (pu)

Pmec (pu)

Diesel EngineGovernor

Vf1

m

A

B

C

Pm

Synchronous Motor350 kVA

a b c

A B C

A

B

C

a

b

c

Vref

Vd

Vq

Vstab

Vf

Excitation System

VabcG

Qg

Fg

Gen

IabcG

Pg

VrmsGen

EGcurrent

MechPow

SpeedRot

Excit

abc

|u|

∠u

VPositiveSequence1

Vm_EG

Va_EG

Vm EG

-T-

I EG

-K-(1/1000)V2

abc

|u|

∠u

VPositiveSequence2

Ia EG1

-T-

-K-

(1/1000)V1

MechPow

Excit

SpeedRot

"rtlab"not found

OpWriteFile1

"rtlab"not found

OpTrigger2

DataSave

P (kW)

Pm

Not implemented

<Rotor speed wm (pu)>

<Output active power Peo (pu)>

<Stator voltage vd (pu)>

<Stator voltage vq (pu)>

Fig. 5. Emergency generator model including synchronous machine, excita-tion system and diesel engine governor.

TABLE IIISPECIFICATIONS OF THE EMERGENCY GENERATOR

Parameters ValuesPower rating 350 kWVoltage rating 480 VFrequency 60 HzStator resistance 0.0036 ΩInertia coefficient 20Pole pairs 4

diesel engine governor, such that 1 pu corresponds to fg=60Hz, P=4, ns=1800 rpm [18].

The generator voltage is adjusted by controlling the refer-ence voltage of the excitation system. Note that a referenceof 1 V (pu) corresponds to the rated voltage of the generator.The emergency generator is connected to the microgrid whenthe phase angle difference is close to zero [18].

D. Vehicle-grid integration

The vehicle-grid integration system is modeled using an EVbattery and an inverter that controls the charge and dischargerates. The EV battery has the specifications given in TableIV. An average model has been used for the DC-AC inverter,which is based on the work described in [19]–[21].

III. REAL-TIME SIMULATION

Simulating this microgrid at 50 µs fixed time-steps inSimulink R© over a long period of time requires an excessiveamount of computing time. We also wanted to have the abilityto perform hardware-in-the-loop simulations to test some ofthe components and their controllers. The Simulink R© model

TABLE IVSPECIFICATIONS OF THE EV BATTERY

Parameters ValuesNominal voltage 200 VRated capacity 500 AhFully charged voltage 232.8 VMaximum capacity 500 AhCapacity @nominal voltage 452.2 AhNominal discharge current 217.4 AExponential zone voltage 216.1 VExponential zone capacity 24.6 AhInternal resistance 0.004

TCP/IP

RT-LAB Target PC (Linux based Redhat OS)

OPAL-RT Real-Time Digital Simulator

- RT-LAB- Microgrid model in MATLAB/Simulink

- User Interface

Power Amplifier

Oscilloscope

Hardware (PV Emulator, Battery, Inverter, etc)

Fig. 6. Setup for power hardware-in-the-loop and software-in-the loop testing.

was therefore ported to an OPAL-RT R© eMEGAsim real-time digital simulator [22]. The simulator hardware consistsof an OP5600 chassis equipped with up to 12 parallel 3.3-GHz processor cores, a flexible high-speed front-end processorand a signal conditioning stage. The solver used is calledARTEMiS (advanced real-time electromagnetic simulation).Fig. 6 illustrates this real-time digital simulation testbed.

The Simulink R© model of the microgrid is first to run as aneffective platform for developing and testing the real-time mi-crogrid. The Simulink R© microgrid model has to be separatedinto different subsystems (master, slave, and console) in orderto execute the model on several cores, before being compiledusing RT-LAB. Each master and slave subsystem in RT-LAB isassigned to a separate core to perform their parallel processesin a fast and efficient way.

Power system models are typically decoupled at largetransmission lines because these lines introduce a delay insignal propagation. Because there are obviously no such linesin a microgrid, we decoupled the system at dc busses. Anotheroption is to use OPAL-RT’s ARTEMiS state-space nodal(SSN) solver, which results in the same solution.

IV. SIMULATION RESULTS AND DISCUSSION

This section discusses the simulation of three operatingscenarios.

A. Scenario A: Grid-connected operation

The microgrid is operated in grid-connected mode, with thePV system injecting a variable amount of power into the gridas solar irradiance changes. From t = 1 second to t = 60seconds, the battery is used for solar smoothing. From t = 60second to t = 100 seconds, the battery charges and dischargesat a constant rate. From t = 50 second to t = 90 seconds, theactive load varies. The EV is discharged at 50 kW from t = 0second to t = 40 seconds and charges from t = 40 seconds to t= 80 seconds at the same rate. Fig. 7 shows the correspondingsimulation results.

The output current of the PV array (b.2) decreases when thesolar irradiance (a.1) decreases, however, the voltage (b.1) is

Page 4: Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real › microgrid_RTDS › RTDSpaper.pdf · 2019-11-21 · Fig. 6 illustrates this real-time digital

4

maintained around the same value. This is because the voltagecorresponding to the MPP does not change significantly withchanging solar irradiance as shown in Fig. 2. Note that thevoltage and current corresponding to the MPP at 25 0C and1000 W/m2 are 401 V and 383.8 A, respectively. The dc linkvoltage of the PV inverter is not affected by the changing solarirradiance, in fact it is regulated at a constant value to supplythe required output voltage.

During the first 60 seconds of Scenario A, since the batteryis used for solar smoothing, the power output at the point-of-common-coupling (PCC) is regulated at the chosen 600 kW(f.1) regardless of the changing solar irradiance. From 60 to80 seconds the battery is charged at 500 kW and from 80 to100 seconds, the battery is discharged at 500 kW. Note that thefrequency at the PCC is fixed at 60 Hz because the microgridis in grid-connected mode. Small spikes in frequency (e.4 andf.4) are due to minor simulation glitches.

B. Scenario B: Battery operating in grid-forming mode

Initially (from t = 0 to t = 10 seconds), the microgrid isgrid-connected and the PV system injects power into the grid,assuming a constant irradiance. The battery neither chargesnor discharges. When the microgrid is suddenly islanded at t= 10 seconds, the battery controller switches to islanded modeto maintain the microgrid’s desired voltage and frequency. Theload varies between t = 50 and t = 90 seconds while the EVcharges from t = 0 to to = 30 seconds and discharge fromt = 60 to t = 100 seconds. Fig. 8 shows the results of thesimulation for this scenario.

While in grid-connected mode, the voltage at the PCC(f.3) is slightly less than 1 p.u. because the microgrid doesnot control the voltage at that point. When the microgrid issuddenly islanded at 10 seconds, the voltage regulator in Fig.4 increases the voltage at the PCC (f.3) to 1 p.u. The activeload also slightly increases because the load model is voltagedependent. Since the microgrid is islanded when the powerflow at the PCC is not zero, a power spike occurs (d.1, e.1,f1). The battery then manages to maintain the voltage (d.3, f.3)and the frequency (d.4, f.4) at a constant value even when theload varies (between t = 50 and t = 90 seconds) and the solarirradiance decreases (between t = 20 and t = 30 seconds).

C. Scenario C: Emergency generator operation in islandedmode

In this scenario, the microgrid operates in islanded modeand the emergency generator maintains the desired voltageand frequency. The load varies between t = 50 and t = 90seconds. The battery charges at 100 kW between t = 10 and t= 100 seconds. The EV charges at 50 kW between t = 0 andt = 100 seconds. Fig 9 shows the simulation results.

The variable load between t = 50 and t = 90 seconds as wellas the decision to charge the battery at t = 10 seconds causefrequency oscillations (b.4, d.4, h.4). However, the frequencyalways stays within ±5 Hz and extending the simulations overa longer duration shows that these oscillations die out. Theiramplitude can be reduced by increasing the inertia of thegenerator, however this causes these oscillations to last longer.

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

0.2

0.4

0.6

0.8

1

So

lar

irra

dia

nce

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

24

24.5

25

25.5

26

PV

panel te

mpera

ture

(C

°)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

PV

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

PV

reactive p

ow

er

(kV

AR

)

(a.1)(a.2)

(a.3) (a.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

PV

DC

voltage (

V)

PV sub-array 1

PV sub-array 2

PV sub-array 3

PV sub-array 4

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

PV

DC

curr

ent (A

)

PV sub-array 1

PV sub-array 2

PV sub-array 3

PV sub-array 4

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

PV

DC

pow

er

(kW

)

PV sub-array 1

PV sub-array 2

PV sub-array 3

PV sub-array 4

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

1000

PV

DC

lin

k v

oltage (

V)

(b.1) (b.2)

(b.3) (b.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

49.8

49.9

50

50.1

50.2

50.3

Ba

tte

ry S

oC

(%

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

1000

Battery

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-1

-0.5

0

0.5

1

Battery

curr

ent (k

A)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-600

-400

-200

0

200

400

600

Battery

DC

pow

er

(kW

)

(c.1) (c.2)

(c.3)(c.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-600

-400

-200

0

200

400

600

Battery

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-600

-400

-200

0

200

400

600

Battery

reactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

600

Battery

invert

er

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

Battery

invert

er

frequency (

Hz)

(d.1)(d.2)

(d.3) (d.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-500

0

500

1000

1500

Grid p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-500

0

500

Grid r

eactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

5

10

15

Grid v

oltage (

kV

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

Grid fre

quency (

Hz)

(e.1) (e.2)

(e.3) (e.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

500

1000

1500

DG

s a

ctive p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-500

0

500

DG

s r

eactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

5

10

15

Voltage a

t P

CC

(kV

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

PC

C fre

quency (

Hz)

(f.1) (f.2)

(f.3) (f.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

49

49.5

50

50.5

EV

So

C (

%)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

250

300

EV

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-300

-200

-100

0

100

200

300

EV

curr

ent (A

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

1

EV

availa

bili

ty

(g.1) (g.2)

(g.3)(g.4)

Available = 1

Not available = 0

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

EV

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

EV

re

active

po

we

r (k

VA

R)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

Active

lo

ad

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-100

0

100

200

Re

active

lo

ad

(kV

AR

)

(h.1) (h.2)

(h.3) (h.4)

Fig. 7. Simulation results for Scenario A: PV system (a.1-b.4), battery (c.1-d.4), electrical grid (e.1-e.4), PCC (f.1-f.4), EV (g.1-h.2) and load (h.3-h.4).

There are voltage and power spikes (Fig. 9 (d.1, d.3, g.1, g.3))and a sudden drop in load (Fig. 9 (f.3)) when the battery startscharging at 10 seconds.

CONCLUSIONS

This paper presented a real-time digital simulation on anOPAL-RT real-time digital simulator of a microgrid being builtin by Snohomish PUD in Arlington, WA . This model supportsthe study of different operating conditions before the microgridis deployed in the field at the end of 2021.

Once the microgrid is operational, we will compare oursimulation results with the actual measured data.

REFERENCES

[1] M. Farzinfar and M. Jazaeri and N. C. Nair and F. Razavi, “Stability eval-uation of microgrid using real-time simulation,” in 2014 AustralasianUniversities Power Engineering Conference (AUPEC), Sep. 2014, pp.1–6.

[2] X. Meng, C. Yang, K. Lin, F. Zhang, J. Wu, and J. Shen, “Research onphotovoltaic power system of microgrid based on real-time simulation,”in 2017 IEEE Conference on Energy Internet and Energy SystemIntegration (EI2), Nov 2017, pp. 1–5.

[3] L. Ghomri, M. Khiat, and S. A. Khiat, “Modeling and real time simula-tion of microgrids in Algerian Sahara area,” in 2018 IEEE InternationalEnergy Conference (ENERGYCON), June 2018, pp. 1–5.

[4] I. Leonard, T. Baldwin, and M. Sloderbeck, “Accelerating the customer-driven microgrid through real-time digital simulation,” in 2009 IEEEPower Energy Society General Meeting, July 2009, pp. 1–3.

Page 5: Real-Time Digital Simulation of Microgrid Control Strategieslabs.ece.uw.edu › real › microgrid_RTDS › RTDSpaper.pdf · 2019-11-21 · Fig. 6 illustrates this real-time digital

5

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

0.2

0.4

0.6

0.8

1

Sola

r irra

dia

nce (

kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

24

24.5

25

25.5

26

PV

panel te

mpera

ture

(C

°)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

PV

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

PV

reactive p

ow

er

(kV

AR

)

(a.1) (a.2)

(a.3) (a.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

PV

DC

voltage (

V)

PV sub-array 1

PV sub-array 2

PV sub-array 3

PV sub-array 4

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

PV

DC

curr

ent (A

)

PV sub-array 1

PV sub-array 2

PV sub-array 3

PV sub-array 4

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

PV

DC

pow

er

(kW

)

PV sub-array 1

PV sub-array 2

PV sub-array 3

PV sub-array 4

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

1000

PV

DC

lin

k v

oltage (

V)

(b.1) (b.2)

(b.3) (b.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

49.8

50

50.2

50.4

50.6

50.8

51

Ba

tte

ry S

oC

(%

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

1000

Battery

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-1

-0.5

0

0.5

1

Battery

curr

ent (k

A)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-600

-400

-200

0

200

400

600

Battery

DC

pow

er

(kW

)

(c.1) (c.2)

(c.3) (c.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-600

-400

-200

0

200

400

600

Ba

tte

ry a

ctive

po

we

r (k

W)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-600

-400

-200

0

200

400

600

Ba

tte

ry r

ea

ctive

po

we

r (k

VA

R)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

600

Ba

tte

ry in

ve

rte

r vo

lta

ge

(V

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

Ba

tte

ry in

ve

rte

r fr

eq

ue

ncy (

Hz)

(d.1) (d.2)

(d.3) (d.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-500

0

500

1000

Grid

po

we

r (k

W)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-500

0

500

Grid r

eactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

5

10

15

Grid v

oltage (

kV

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

Grid fre

quency (

Hz)

(e.1) (e.2)

(e.3) (e.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

1000

DG

s a

ctive

po

we

r (k

W)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-500

0

500

DG

s r

ea

ctive

po

we

r (k

VA

R)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

5

10

15

Vo

lta

ge

at

PC

C (

kV

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

PC

C f

req

ue

ncy (

Hz)

(f.1) (f.2)

(f.3) (f.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

49.5

50

50.5

EV

So

C (

%)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

250

300

EV

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-300

-200

-100

0

100

200

300

EV

curr

ent (A

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

1

EV

availa

bili

ty

(g.1) (g.2)

(g.3) (g.4)

Available = 1

Not available =0

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

EV

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

EV

reactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

Active load (

kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-100

0

100

200

Reactive load (

kV

AR

)

(h.1) (h.2)

(h.3) (h.4)

Fig. 8. Simulation results for Scenario B: PV system (a.1-b.4), battery (c.1-d.4), electrical grid (e.1-e.4), PCC (f.1-f.4), EV (g.1-h.2) and load (h.3-h.4).

[5] O. Nzimako and A. Rajapakse, “Real time simulation of a micro-grid with multiple distributed energy resources,” in 2016 InternationalConference on Cogeneration, Small Power Plants and District Energy(ICUE), Sep. 2016, pp. 1–6.

[6] F. Baccino, A. Brissette, D. Ishchenko, A. Kondabathini, and P. Serra,“Real-time hardware-in-the-loop modeling for microgrid applications,”in 2017 6th International Conference on Clean Electrical Power (IC-CEP), June 2017, pp. 152–157.

[7] A. Yamane and S. Abourida, “Real-time simulation of distributed energysystems and microgrids,” in 2015 International Conference on Sustain-able Mobility Applications, Renewables and Technology (SMART), Nov2015, pp. 1–6.

[8] M. Chlela, G. Joos, M. Kassouf, and Y. Brissette, “Real-time testingplatform for microgrid controllers against false data injection cybersecu-rity attacks,” in 2016 IEEE Power and Energy Society General Meeting(PESGM), July 2016, pp. 1–5.

[9] Snohomish County Public Utility District. Arlington Microgrid Project.[Online]. Available: https://www.snopud.com/?p=3326

[10] C. Keerthisinghe and D. S. Kirschen. (2019) Real-Time DigitalSimulation of Microgrid Control Strategies. Renewable EnergyAnalysis Lab, University of Washington. [Online]. Available: https://labs.ece.uw.edu/real/RTDSmain.html

[11] MathWorks. PV array. [Online]. Available: https://www.mathworks.com/help/physmod/sps/powersys/ref/pvarray.html

[12] ——. (250-kW grid-connected PV array). [Online].Available: https://www.mathworks.com/help/physmod/sps/examples/250-kw-grid-connected-pv-array.html

[13] Mohsin Noman Mustafa, “Design of a grid connected photovoltaicpower electronic converter,” Master’s thesis, Universitet i Tromsø, Jun.2017.

[14] P. Giroux, G. Sybille, C. Osorio, S. Chandrachood. Averagemodel of a 100-kW grid-connected PV array. MathWorks.[Online]. Available: https://www.mathworks.com/help/physmod/sps/examples/average-model-of-a-100-kw-grid-connected-pv-array.html

10 20 30 40 50 60 70 80 90 100

Time (seconds)

19.8

19.9

20

20.1

20.2

20.3

20.4

Battery

SoC

(%

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

1000

Battery

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-0.5

0

0.5

Battery

curr

ent (k

A)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-150

-100

-50

0

50

100

Battery

DC

pow

er

(kW

)

(a.1) (a.2)

(a.3) (a.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-150

-100

-50

0

50

100

Battery

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

Battery

reactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

600

Battery

invert

er

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

55

60

65

Battery

invert

er

frequency (

Hz)

(b.1) (b.2)

(b.3) (b.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-100

0

100

200

Grid

po

we

r (k

W)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-100

0

100

200

Grid

re

active

po

we

r (k

VA

R)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

5

10

15

Grid

vo

lta

ge

(kV

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

59

59.5

60

60.5

61

Grid

fre

qu

en

cy (

Hz)

(c.1) (c.2)

(c.3) (c.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

250

300

DG

s a

ctive

po

we

r (k

W)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-300

-200

-100

0

100

200

300

DG

s r

eactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

5

10

15

Voltage a

t P

CC

(kV

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

55

60

65

PC

C fre

quency (

Hz)

(d.1) (d.2)

(d.3) (d.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

45

50

55

EV

SoC

(%

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

250

300

EV

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-400

-300

-200

-100

0

100

EV

curr

ent (A

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

1

EV

availa

bili

ty

(e.1) (e.2)

(e.3)(e.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

EV

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

-50

0

50

100

EV

reactive p

ow

er

(kV

AR

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

50

100

150

200

Active load (

kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-100

0

100

200

Reactive load (

kV

AR

)

(f.1) (f.2)

(f.3) (f.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-100

0

100

200

300

400

Genera

tor

active p

ow

er

(kW

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

-200

-100

0

100

200

Genera

tor

reactive p

ow

er

(kV

AR

)10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

100

200

300

400

500

Genera

tor

voltage (

V)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0

200

400

600

800

Genera

tor

curr

ent (A

)

(g.1) (g.2)

(g.3) (g.4)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0.2

0.4

0.6

0.8

1

1.2

Me

ch

an

ica

l p

ow

er

(pu

)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0.2

0.4

0.6

0.8

1

1.2

Genera

tor

excitation (

pu)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

0.94

0.96

0.98

1

1.02

1.04

1.06

Roto

r speed (

pu)

10 20 30 40 50 60 70 80 90 100

Time (seconds)

55

60

65

Genera

tor

frequency (

Hz)

(h.1) (h.2)

(h.3) (h.4)

Fig. 9. Simulation results for Scenario C: Battery (a.1-b.4), electrical grid(c.1-c.4), PCC (d.1-d.4), EV(e.1-f.2), load (f.3-f.4) and generator (g.1-h.4).

[15] MathWorks. Simulink battery model. [Online]. Available: https://www.mathworks.com/help/physmod/sps/powersys/ref/battery.html

[16] M. Saleh, Y. Esa, Y. Mhandi, W. Brandauer, and A. Mohamed, “Designand implementation of CCNY DC microgrid testbed,” in 2016 IEEEIndustry Applications Society Annual Meeting, Oct 2016, pp. 1–7.

[17] MathWorks. Simplified synchronous machine. [Online].Available: https://www.mathworks.com/help/physmod/sps/powersys/ref/simplifiedsynchronousmachine.html

[18] G. Sybille and Tarik Zabaiou. Emergency diesel-generator and asynchronous motor. MathWorks. [Online].Available: https://www.mathworks.com/help/physmod/sps/examples/emergency-diesel-generator-and-asynchronous-motor.html

[19] IDE4L: ideal grid for all. [Online]. Available: https://ide4l.eu[20] L. Vanfretti, W. Li, A. Egea-Alvarez, and O. Gomis-Bellmunt, “Generic

VSC-based DC grid EMT modeling, simulation, and validation on ascaled hardware platform,” in 2015 IEEE Power Energy Society GeneralMeeting, July 2015, pp. 1–5.

[21] L. Vanfretti, N. A. Khan, W. Li, M. R. Hasan, and A. Haider, “GenericVSC and low level switching control models for offline simulationof VSC-HVDC systems,” in 2014 Electric Power Quality and SupplyReliability Conference (PQ), June 2014, pp. 265–272.

[22] OPAL-RT Techonologies. Microgrid. [Online]. Available: https://www.opal-rt.com/microgrid-overview/