Project Title
Modelling and simulation of an electrical micro-grid using the MATLAB/Simulink platform
Project Team Members
Aodhgan Gleeson, Ben Hudson
Executive Summary
The structure of the electrical grid has traditionally been based on large centralised power stations
generating electrical power for; transmission over long distances at voltages of the order of 100's of
kV, distribution at voltages of 10's of kV, before ultimately being supplied to the consumer in the
familiar form of 400 V/230 V three-phase and neutral. With the advent of small-scale renewable
energy sources and the increased capability of power electronic converters and associated controls,
the possibility for operating small-scale, isolated electrical grids, independently of this centralised
national grid structure, has become a reality. The design and development of these micro-grids
requires careful consideration and hence the use of simulation tools to gain an insight into detailed
system operation is essential.
The purpose of this project is to develop an accurate, dynamic model of a micro-grid comprising
several different energy sources, various loads, faults and circuit breakers as well as a connection to
the main electrical grid. An appropriate grounding in the relevant theory of three-phase power and
its control was essential. This demanded a comprehensive understanding of dq0 Reference Frame
Theory, synchronous machine theory, electrical power systems and small signal modelling. The
micro-grid model was developed using the MATLAB/Simulink platform in conjunction with the
SimPowerSystems toolbox. This additional toolbox provides component libraries and analysis tools
for modelling and simulating electrical power systems.
Work commenced on creating the micro-grid after studying the relevant literature. Initially, a model
was created that familiarised the students with the dq0 Reference Frame Theory. An adaptation of
this model led to the creation of the main electrical grid model.
The SimPowerSystems toolbox in Simulink allowed for precise models of complex electromagnetic
machines to be implemented into the micro-grid model. Several simulations and calculations were
performed to ensure the students fully understood the workings of both the Permanent Magnet
Synchronous Machine and the Synchronous Machine models.
A model of a three-phase inverter with an LCL filter was adopted from Figueres et al. [1]. This was
developed using small signal modelling techniques. This model acted as a constant voltage source
and was subsequently put forward as a model of a fully charged battery bank. Further adaptations to
this inverter model allowed the students to incorporate any renewable electricity resource that
could be modelled as a current source. 1
A Human Interface Device that enabled the user to interact with the micro-grid model was designed
and constructed. The HID allowed dynamic changes to be made to the micro-grid. Significant work
1
G. G. J. S. F. G.-E. a. J. C. R. Emilio Figueres, “Sensitivity Study of the Dynamics of Three-Phase Photovoltaic
Inverters with an LCL Filter,” IEEE Transactions on Industrial Electronics, vol. 56, no. 3, p. 706, March 2009.
was required for both the construction of the physical device and the infrastructure that allowed the
controlled adjustments in the Simulink environment.
The final micro-grid included a diesel generator, a Photovoltaic array, a battery bank, fixed loads,
variable dynamic load and a connection to the national grid. Simulations were carried out on an
instantaneous solver basis, the implication of which is that transients and their associated effects
can be observed and quantified. The interactive, dynamic micro-grid model created in this project
allows the user to simulate any number of generation scenarios and observe the associated power
flow phenomena. Results from sample scenarios are presented in this report but it is important to
note the versatility of the micro-grid model. The interface device, combined with the simulation
model provides an invaluable platform for educational and demonstrative purposes.
Figure 1 Completed HID Device
Figure 2 Renewable Resource Simulink Schematic
2
Idset
1
Vi_abc_SP
dq0
sin_cos
abc
abc
sin_cos
dq0
In1 Out1
Vdc Limited PI
In1 Out1
Iq Limited PI
In1 Out1
Id Limited PI
[dq]
Goto3
[dd]
[I_invq]
[I_invd]
2
Gain4
1
Gain3
1
Gain2
-K-
-K-
Gain
[dq]
[dd]
[I_invq][I_invd]
[I_invd]
From1
[I_invq]
From
5
Iq set
4
Vdc
3
Vdc*
2
sin cos
1
I Inv
Figure 3 Simulink Model of Micro Grid
Inverter 2 PQ
Dynamic Load
9.47821
vf
abc
sin_cos
dq0
abc
sin_cos
dq0
abc to dq0
Constant Power
v+
-
v+
-
400
-2.901e-013
-1.313e-013
Vdq0_Grid
607.8
Vdc
Uref
A
B
C
+
-
Uref
A
B
C
+
-
Time
To Workspace1
com
A
B
C
A
B
C
Three-Phase Fault
com
A
B
C
a
b
c
com
A
B
C
a
b
c
com
A
B
C
a
b
c
com
A
B
C
a
b
c
com
A
B
C
a
b
c
Vabc
Iabc
A
B
C
a
b
c
Vabc
Iabc
A
B
C
a
b
c
Vabc
Iabc
A
B
C
a
b
c
Vabc
Iabc
A
B
C
a
b
c
Vabc
Iabc
A
B
C
a
b
c
Vabc
Iabc
A
B
C
a
b
c
A
B
C
PQ
m
A
B
C
Amplitude
Phase
Frequency
SinCosOut
Vabc_grid
Va1
Vb1
Vc1
Three Phase Source
Terminator2
Terminator1
Vabc
Iabc
PQ
Synchronous Machine Power
Vf _
m
A
B
C
Pm
Synchronous Machine
Switch
In1Out1
Scope
2.704e+004
SM Power In
SM Power
SM Load Angle
signalrms
signalrms
signalrms
230.9
230.9
230.9
RMS Voltage Inv 2
231.8
231.8
231.8
RMS Voltage Inv 1
230.9
230.9
230.9
RMS Voltage Grid
Vabc
Iabc
PQ
Power to Grid1
Power to Grid
Real Power
Reactiv e Power
Id
Iq
0.4182
Power angle
PQ
Angle
Power Factor
Power Factor Angle Measurement
1
Power Factor
s
-
+
PhotoVoltaic Array
PV Power
Memory1
Memory
0
0
Load Bank
Vcap_abc
Vga
Vgb
Vgc
Via
Vib
Vic
LCL Filter2
Vcap_abc
Vga
Vgb
Vgc
Via
Vib
Vic
LCL Filter
SM Power
Cloud Cov er
Dy namic Load P
Dy namic load Q
Axis 5
Axis 6
Axis 7
Axis 8
Inv erter 1 P
Inv erter 1 Q
Inv erter 2 P
Inv erter 2 Q
Circ On/Of f 1
Circ On/Of f 2
Circ On/Of f 3
Circ On/Of f 4
Circ On/Of f 5
Circ On/Of f 6
ToggOn/Of f 1
ToggOn/Of f 2
ToggOn/Of f 3
ToggOn/Of f 4
ToggOn/Of f 5
Togg On/Of f 6
Mom. On/Of f 1
Mom. On/Of f 2
Mom. On/Of f 3
Mom. On/Of f 4
Joystick
0
0
0
0
0
0
0
Iq_set
0
Io_set
0
Inverter 2 Q Setpoint
3e+004
Inverter 2 P Setpoint
59.98
-0.4378
4.102e-015
Idq0_Grid
Idc Photovoltaic
19.92
Idc
[V_abc_r_out]
[Idq0_set]
Goto8
[V_inv]
Goto7
[Vdc_renew_star]
Goto5
-T-
Goto48-T-
Goto47-T-
Goto46-T-
Goto45-T-
Goto44-T-
Goto43-T-
Goto42-T-
Goto41-T-
Goto40
[V_grid]
-T-
Goto39-T-
Goto38-T-
Goto37-T-
Goto36-T-
Goto35-T-
Goto34-T-
Goto33-T-
Goto32-T-
Goto31-T-
Goto30
[gate]
Goto3
-T-
Goto29-T-
Goto28-T-
Goto27-T-
Goto26-T-
Goto25-T-
Goto24-T-
Goto23-T-
Goto22-T-
Goto21
[I_inv]
Goto2
[I_abc_1_out]
[V_abc_1_out]
[I_abc_1]
[I_grid_out]
[V_grid_out]
[Ism]
Goto13
[Vsm]
Goto12
[vsc1]
Goto11
[I_abc_r_out]
[sin_cos]
-K-
Gain
[Vdc_renew_star]
From9
[I_abc_1_out]
From8
[V_abc_1_out]
From7
[I_abc_1]
From6
[V_grid]
[sin_cos]
[Circ_4]
[Circ_3
[Circ_
[Circ_2]
[Inverter1
[Inverter1
[Togg_5]
From32
[Togg_4]
From31
[SM_Power]
[sin_cos]
From3
[Circ_2]
[Circ_1]
[Togg_3]
From27
[Togg_2]
From26
[Togg_1]
From25
[Mom_1]
[Circ_4]
[Circ_3]
[Circ_2]
[Circ_1]
[I_inv]
From2
[vsc1]
[Dynamic_Load_Q]
[Dynamic_Load_P]
[I_grid_out]
From16
[Ism]
From15
[Vsm]
From14
[V_grid_out]
From13
[sin_cos]
From12
[sin_cos]
From11
[Cloud_Cover]
[gate]
From1
[I_grid_out]
From
20kWon/off
10kWon/off1
10kWon/off
-10kVAron/off
1kW+5kVAron/off
PowerofLoad
PhaseA
PhaseB
PhaseC
Fixed Load Bank
1
3.904e+004
1.978e+004
Dynamic P and Q
i +
-
I Inv
sin cos
Id set
Iq set
Vgrid
Vi_abc_SP
Vi_dd_dq
Control Loops1
I Inv
sin cos
Vdc*
Vdc
Iq set
Vi_abc_SP
Vi_dd_dq
Idset
Control Loops
50
0
Vg_phase_max
Vdc_sp
Constant
Clock
600
Battery Bank Voltage
Battery Bank Power
Vabc
Iabc
PQ
Vabc
Iabc
PQ
<Load angle delta (deg)>
<Output reactiv e power Qeo (W)>
<Output activ e power Peo (W)>
<Rotor speed wm (rad/s)>

Modeling and Simulation of an electrical micro-grid using MATLAB Simulink Summary For LinkedIn

  • 1.
    Project Title Modelling andsimulation of an electrical micro-grid using the MATLAB/Simulink platform Project Team Members Aodhgan Gleeson, Ben Hudson Executive Summary The structure of the electrical grid has traditionally been based on large centralised power stations generating electrical power for; transmission over long distances at voltages of the order of 100's of kV, distribution at voltages of 10's of kV, before ultimately being supplied to the consumer in the familiar form of 400 V/230 V three-phase and neutral. With the advent of small-scale renewable energy sources and the increased capability of power electronic converters and associated controls, the possibility for operating small-scale, isolated electrical grids, independently of this centralised national grid structure, has become a reality. The design and development of these micro-grids requires careful consideration and hence the use of simulation tools to gain an insight into detailed system operation is essential. The purpose of this project is to develop an accurate, dynamic model of a micro-grid comprising several different energy sources, various loads, faults and circuit breakers as well as a connection to the main electrical grid. An appropriate grounding in the relevant theory of three-phase power and its control was essential. This demanded a comprehensive understanding of dq0 Reference Frame Theory, synchronous machine theory, electrical power systems and small signal modelling. The micro-grid model was developed using the MATLAB/Simulink platform in conjunction with the SimPowerSystems toolbox. This additional toolbox provides component libraries and analysis tools for modelling and simulating electrical power systems. Work commenced on creating the micro-grid after studying the relevant literature. Initially, a model was created that familiarised the students with the dq0 Reference Frame Theory. An adaptation of this model led to the creation of the main electrical grid model. The SimPowerSystems toolbox in Simulink allowed for precise models of complex electromagnetic machines to be implemented into the micro-grid model. Several simulations and calculations were performed to ensure the students fully understood the workings of both the Permanent Magnet Synchronous Machine and the Synchronous Machine models. A model of a three-phase inverter with an LCL filter was adopted from Figueres et al. [1]. This was developed using small signal modelling techniques. This model acted as a constant voltage source and was subsequently put forward as a model of a fully charged battery bank. Further adaptations to this inverter model allowed the students to incorporate any renewable electricity resource that could be modelled as a current source. 1 A Human Interface Device that enabled the user to interact with the micro-grid model was designed and constructed. The HID allowed dynamic changes to be made to the micro-grid. Significant work 1 G. G. J. S. F. G.-E. a. J. C. R. Emilio Figueres, “Sensitivity Study of the Dynamics of Three-Phase Photovoltaic Inverters with an LCL Filter,” IEEE Transactions on Industrial Electronics, vol. 56, no. 3, p. 706, March 2009.
  • 2.
    was required forboth the construction of the physical device and the infrastructure that allowed the controlled adjustments in the Simulink environment. The final micro-grid included a diesel generator, a Photovoltaic array, a battery bank, fixed loads, variable dynamic load and a connection to the national grid. Simulations were carried out on an instantaneous solver basis, the implication of which is that transients and their associated effects can be observed and quantified. The interactive, dynamic micro-grid model created in this project allows the user to simulate any number of generation scenarios and observe the associated power flow phenomena. Results from sample scenarios are presented in this report but it is important to note the versatility of the micro-grid model. The interface device, combined with the simulation model provides an invaluable platform for educational and demonstrative purposes. Figure 1 Completed HID Device Figure 2 Renewable Resource Simulink Schematic 2 Idset 1 Vi_abc_SP dq0 sin_cos abc abc sin_cos dq0 In1 Out1 Vdc Limited PI In1 Out1 Iq Limited PI In1 Out1 Id Limited PI [dq] Goto3 [dd] [I_invq] [I_invd] 2 Gain4 1 Gain3 1 Gain2 -K- -K- Gain [dq] [dd] [I_invq][I_invd] [I_invd] From1 [I_invq] From 5 Iq set 4 Vdc 3 Vdc* 2 sin cos 1 I Inv
  • 3.
    Figure 3 SimulinkModel of Micro Grid Inverter 2 PQ Dynamic Load 9.47821 vf abc sin_cos dq0 abc sin_cos dq0 abc to dq0 Constant Power v+ - v+ - 400 -2.901e-013 -1.313e-013 Vdq0_Grid 607.8 Vdc Uref A B C + - Uref A B C + - Time To Workspace1 com A B C A B C Three-Phase Fault com A B C a b c com A B C a b c com A B C a b c com A B C a b c com A B C a b c Vabc Iabc A B C a b c Vabc Iabc A B C a b c Vabc Iabc A B C a b c Vabc Iabc A B C a b c Vabc Iabc A B C a b c Vabc Iabc A B C a b c A B C PQ m A B C Amplitude Phase Frequency SinCosOut Vabc_grid Va1 Vb1 Vc1 Three Phase Source Terminator2 Terminator1 Vabc Iabc PQ Synchronous Machine Power Vf _ m A B C Pm Synchronous Machine Switch In1Out1 Scope 2.704e+004 SM Power In SM Power SM Load Angle signalrms signalrms signalrms 230.9 230.9 230.9 RMS Voltage Inv 2 231.8 231.8 231.8 RMS Voltage Inv 1 230.9 230.9 230.9 RMS Voltage Grid Vabc Iabc PQ Power to Grid1 Power to Grid Real Power Reactiv e Power Id Iq 0.4182 Power angle PQ Angle Power Factor Power Factor Angle Measurement 1 Power Factor s - + PhotoVoltaic Array PV Power Memory1 Memory 0 0 Load Bank Vcap_abc Vga Vgb Vgc Via Vib Vic LCL Filter2 Vcap_abc Vga Vgb Vgc Via Vib Vic LCL Filter SM Power Cloud Cov er Dy namic Load P Dy namic load Q Axis 5 Axis 6 Axis 7 Axis 8 Inv erter 1 P Inv erter 1 Q Inv erter 2 P Inv erter 2 Q Circ On/Of f 1 Circ On/Of f 2 Circ On/Of f 3 Circ On/Of f 4 Circ On/Of f 5 Circ On/Of f 6 ToggOn/Of f 1 ToggOn/Of f 2 ToggOn/Of f 3 ToggOn/Of f 4 ToggOn/Of f 5 Togg On/Of f 6 Mom. On/Of f 1 Mom. On/Of f 2 Mom. On/Of f 3 Mom. On/Of f 4 Joystick 0 0 0 0 0 0 0 Iq_set 0 Io_set 0 Inverter 2 Q Setpoint 3e+004 Inverter 2 P Setpoint 59.98 -0.4378 4.102e-015 Idq0_Grid Idc Photovoltaic 19.92 Idc [V_abc_r_out] [Idq0_set] Goto8 [V_inv] Goto7 [Vdc_renew_star] Goto5 -T- Goto48-T- Goto47-T- Goto46-T- Goto45-T- Goto44-T- Goto43-T- Goto42-T- Goto41-T- Goto40 [V_grid] -T- Goto39-T- Goto38-T- Goto37-T- Goto36-T- Goto35-T- Goto34-T- Goto33-T- Goto32-T- Goto31-T- Goto30 [gate] Goto3 -T- Goto29-T- Goto28-T- Goto27-T- Goto26-T- Goto25-T- Goto24-T- Goto23-T- Goto22-T- Goto21 [I_inv] Goto2 [I_abc_1_out] [V_abc_1_out] [I_abc_1] [I_grid_out] [V_grid_out] [Ism] Goto13 [Vsm] Goto12 [vsc1] Goto11 [I_abc_r_out] [sin_cos] -K- Gain [Vdc_renew_star] From9 [I_abc_1_out] From8 [V_abc_1_out] From7 [I_abc_1] From6 [V_grid] [sin_cos] [Circ_4] [Circ_3 [Circ_ [Circ_2] [Inverter1 [Inverter1 [Togg_5] From32 [Togg_4] From31 [SM_Power] [sin_cos] From3 [Circ_2] [Circ_1] [Togg_3] From27 [Togg_2] From26 [Togg_1] From25 [Mom_1] [Circ_4] [Circ_3] [Circ_2] [Circ_1] [I_inv] From2 [vsc1] [Dynamic_Load_Q] [Dynamic_Load_P] [I_grid_out] From16 [Ism] From15 [Vsm] From14 [V_grid_out] From13 [sin_cos] From12 [sin_cos] From11 [Cloud_Cover] [gate] From1 [I_grid_out] From 20kWon/off 10kWon/off1 10kWon/off -10kVAron/off 1kW+5kVAron/off PowerofLoad PhaseA PhaseB PhaseC Fixed Load Bank 1 3.904e+004 1.978e+004 Dynamic P and Q i + - I Inv sin cos Id set Iq set Vgrid Vi_abc_SP Vi_dd_dq Control Loops1 I Inv sin cos Vdc* Vdc Iq set Vi_abc_SP Vi_dd_dq Idset Control Loops 50 0 Vg_phase_max Vdc_sp Constant Clock 600 Battery Bank Voltage Battery Bank Power Vabc Iabc PQ Vabc Iabc PQ <Load angle delta (deg)> <Output reactiv e power Qeo (W)> <Output activ e power Peo (W)> <Rotor speed wm (rad/s)>