0% found this document useful (0 votes)
21 views

AC Microgrid Laboratory Answers

The document provides details on three lab assignments for an AC microgrid control system: 1. Lab I involves obtaining the closed loop system model and designing voltage and current control parameters without harmonics. 2. Lab II tests the system with and without a nonlinear load and harmonic compensation. Harmonic compensation is tuned to minimize total harmonic distortion. 3. Lab III involves designing virtual impedance, droop coefficients, and grid connected controller coefficients to stabilize the system connection to the grid. Stability ranges are analyzed for proportional power controller gain.

Uploaded by

Mohsen Mollaali
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

AC Microgrid Laboratory Answers

The document provides details on three lab assignments for an AC microgrid control system: 1. Lab I involves obtaining the closed loop system model and designing voltage and current control parameters without harmonics. 2. Lab II tests the system with and without a nonlinear load and harmonic compensation. Harmonic compensation is tuned to minimize total harmonic distortion. 3. Lab III involves designing virtual impedance, droop coefficients, and grid connected controller coefficients to stabilize the system connection to the grid. Stability ranges are analyzed for proportional power controller gain.

Uploaded by

Mohsen Mollaali
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

AC Microgrid Assignment

Submitted By:
Diptish Saha ([email protected])
Yubo Song ([email protected])
Mojtaba Hajihosseini ([email protected])
LAB I

Task 1: Obtaining the system closed loop

From the block diagram, we have:

By substituting iref into vabc,

Then,

By solving the equation, iL can be obtained as:

Then,

Page 1 of 27
By solving the equation again, vc can be obtained as:

Task 2: Designing the voltage and current control parameters for fundamental frequency (without
harmonics) in stationary frame

Given that R = 0.2 Ohm, we are following these steps:


Inner loop:
 Try different k pI and use the margin function in MATLAB to check the stability. We set
crossover freq = 1/10 of fsw
 Try different k i I and check the dynamic performance (by lsim function in MATLAB)
Outer loop:
 Try different k p V and use the margin function in MATLAB to check the stability. We set
crossover freq = 1/5 of fcr,in
 Try different k iV and check the dynamic performance (by lsim function in MATLAB)

We choose k pI = 15, k i I = 1200, k p V = 0.04, k iV = 200.

Page 2 of 27
Lab II
Task 1

Nonlinear load disabled


Harmonic compensation disabled

5th harmonic: 0.024%


7th harmonic: 0.031%
11th harmonic: 0.040%
THD: 0.2924

Task 2

Nonlinear load enabled


Harmonic compensation disabled

5th harmonic: 2.419%

Page 3 of 27
7th harmonic: 2.083%
11th harmonic: 0.556%
THD: 3.326

Harmonic compensation enabled, tuning KV_H to try to minimize THD


We have:
KV_H5 = 100
KV_H7 = 100
KV_H11 = 90

5th harmonic: 0.202%


7th harmonic: 0.448%
11th harmonic: 0.775%
THD: 1.503

Page 4 of 27
Lab III

Task 1: Design of the virtual impedance

Here,
E=V =230
P=2000
φ=1 °
We know,
EV
XV = sin φ and X V =2 πf LV
P
Therefore,
2 π
230 ×sin
180
XV 2000
LV = = =1.47 mH
2 π × 50 2 π ×50

Task 2: Design of the droop coefficients of the conventional droop method

∆ ω 2 π ×0.16
m= = =0.000503
∆P 2000
∆ V 0.02 ×230
n= = =0.092
∆Q 50

Droop curves:
ω E

– Ϭ͘ ϬϬϬϱϬϯ 2π50 (P*, ω*)


– Ϭ͘ ϬϵϮ (Q*, E*)
rad/s 230 V

2 kW P Q* Q

Page 5 of 27
Task 3: Design of the grid connected controller coefficients

For calculating the stability ranges of k pP and k iQ , the “Task3_Droopcontrol.m” file was used in
MATLAB.
k + s k pP
G P ( s ) = iP
s
k iQ + s k pQ
GQ ( s )=
s
In this case
k iP =m=5.0265 ×10−4
k pQ =n=0.092
Filter transfer function
wc
G F ( s )=
s +w c
Open-loop transfer function,
G L ( s )=G P ( s ) . GF ( s ) . k d

Closed-loop transfer function,


GL
G L ( s )=
1+ GL
EV
Where k d=
XV
Here,
w c =2 π ×2
E=V =230
X V =0.4616 (From Task 1)

Step 1: The for loop for different values of k pP was run to get the step response of the closed-loop
transfer function and phase margin of the open-loop transfer function.
 For a system to be unstable the gain and phase margin of the system should be negative. The
program was run to check the stability of the system.

Page 6 of 27
 Initially the k pP was varied from 0.000001 to 0.0001 with a step size of 0.00001, and it was
observed that the phase margin is not negative, and it does not cross -1800 as shown in fig. 1.
 The k pP was reduced and varied from 0.000000001 to 0.000001 with a step size of 0.0000001
, and it was observed that the phase margin is still not negative, and it does not cross -1800 as
shown in fig. 2.
 The k pP was increased and varied from 0.01 to 1 with a step size of 0.05 , and it was observed
that the phase margin is still not negative, and it does not cross -1800 as shown in fig. 3.
 Therefore, it was concluded that the system is stable.

Fig. 1: Gain and phase margin when k pP was varied from 0.000001 to 0.0001 with a step size of
0.00001

Page 7 of 27
Fig. 2: Gain and phase margin when k pP was varied from 0.000000001 to 0.000001 with a step size
of 0.0000001

Fig. 3: Gain and phase margin when k pP was varied from 0.01 to 1 with a step size of 0.05

Step 2: The for loop for different values of k pP was run to get the step response of the closed-loop
transfer function and phase margin of the open-loop transfer function.
 Initially the k pP was varied from 0.000001 to 0.0001 with a step size of 0.00001 and it was
observed that the peak overshoot is reducing from 1.429299453 to 0.997595458 as shown in
fig. 4 and fig. 5. The Phase margin was observed to be increasing from 29.14015184 to
93.07693639.

Page 8 of 27
Fig. 4: Step response of the closed-loop transfer function with k pP varied from 0.000001 to 0.0001
with a step size of 0.00001

Fig. 5: Zoomed Step response of the closed-loop transfer function with k pP varied from 0.000001 to
0.0001 with a step size of 0.00001

k pP Phase margin Rise Time Settling Time Overshoot Peak Peak Time
0.000001 29.14015184 0.047435059 0.519919936 42.9299453 1.429299453 0.118364183
0.000011 55.63686539 0.049866934 0.275370023 17.8446615 1.178446615 0.110236789
0.000021 75.27813444 0.046573473 0.185390152 7.15685089 1.071568509 0.105426011
0.000031 85.83803566 0.042250713 0.122851277 2.11822575 1.021182257 0.108165854

Page 9 of 27
0.000041 90.28510974 0.037691536 0.068955126 0 0.997522397 0.123209229
0.000051 92.07710296 0.033323589 0.093060918 0 0.999859077 0.612982936
0.000061 92.79789333 0.029327827 0.131770306 0 0.999427928 0.586381705
0.000071 93.06126493 0.025823237 0.158740706 0 0.99554168 0.382925172
0.000081 93.11935459 0.022840647 0.178502309 0 0.997955845 0.567135273
0.000091 93.07693639 0.020335291 0.193707989 0 0.997595458 0.598682795

Step 3: Optimal design consideration for k pP


 A high (low) peak and overshoot in the step response of the closed-loop transfer function
denotes that the system is underdamped (overdamped)
 For the controller’s optimal design, considering the step response peak of the closed-loop
transfer function is less than 20% of the step response’s nominal amplitude. Thus, the step
response’s peak is kept below 1.2.
 For a stable system, the “phase margin” should be in the range of 450 to 700.

Step 4: The for loop for different values of k pP was again run to get the step response of the closed-
loop transfer function and phase margin of the open-loop transfer function
 The k pP was varied from 0.000011 to 0.000018 with a step size of 0.0000005 and it was
observed that the peak overshoot is reducing from 1.17844661 to 1.09539236 as shown in
fig. 6 and fig. 7. The Phase margin was observed to be increasing from 55.63686539 to
70.33477756.

Fig. 6: Step response of the closed-loop transfer function with k pP varied from 0.000011 to 0.000018
with a step size of 0.0000005

Page 10 of 27
Fig. 7: Zoomed step response of the closed-loop transfer function with k pP varied from 0.000011 to
0.000018 with a step size of 0.0000005

k pP Phase margin Rise Time Settling Time Overshoot Peak Peak Time
0.0000110 55.63686539 0.049866934 0.275370023 17.8446615 1.17844661 0.110236789
0.0000115 56.81514635 0.04977393 0.26832882 17.0777684 1.17077768 0.110673799
0.0000120 57.97584502 0.049645058 0.253985535 16.3418869 1.16341887 0.108003898
0.0000125 59.11840066 0.04953573 0.190466855 15.6504075 1.15650407 0.108472918
0.0000130 60.24225043 0.049412373 0.190595298 14.9798061 1.14979806 0.108920349
0.0000135 61.34683298 0.049259064 0.190694123 14.3305216 1.14330522 0.10934765
0.0000140 62.43159243 0.049120386 0.190757483 13.7052111 1.13705211 0.106941889
0.0000145 63.49598266 0.048976535 0.190788499 13.1162471 1.13116247 0.107393383
0.0000150 64.54243955 0.048807204 0.190772647 12.5453879 1.12545388 0.107825848
0.0000155 65.56447085 0.048640656 0.190712209 11.9928444 1.11992844 0.108240463
0.0000160 66.56297591 0.048483461 0.190601351 11.4593815 1.11459381 0.106051682
0.0000165 67.53953469 0.048304232 0.1904231 10.9556547 1.10955655 0.106485025
0.0000170 68.49456475 0.048110147 0.190199325 10.4677049 1.10467705 0.106901524
0.0000175 69.42642632 0.047944844 0.189889717 9.99558469 1.09995585 0.107302142
0.0000180 70.33477756 0.047760211 0.189516502 9.53923585 1.09539236 0.107687771

Step 5: k pP =0.000013 is chosen, with the phase margin 60.24225043 and the peak 1.14979806 p.u.,
which satisfies the stability criterion as shown in fig. 8 and in the limits of our design considerations.

Page 11 of 27
Fig. 8: Bode diagram for k pP =0.000013
Step 6: The for loop for different values of k iQ was run to get the step response of the closed-loop
transfer function and phase margin of the open-loop transfer function.
 For a system to be unstable the gain and phase margin of the system should be negative. The
program was run to check the stability of the system.
 Initially the k iQ was varied from 0.01 to 5 with a step size of 0.5 , and it was observed that the
phase margin is not negative, and it does not cross -1800 as shown in fig. 9.
 The k iQ was reduced and varied from 0.00005 to 0.001 with a step size of 0.00005 , and it was
observed that the phase margin is still not negative, and it does not cross -1800 as shown in
fig. 10.
 The k pP was increased and varied from 5 to 100 with a step size of 5, and it was observed that
the phase margin is still not negative, and it does not cross -1800 as shown in fig. 11.
 Therefore, it was concluded that the system is stable.

Page 12 of 27
Fig. 9: Gain and phase margin when k iQ was varied from 0.01 to 5 with a step size of 0.5

Fig. 10: Gain and phase margin when k iQ was varied from 0.00005 to 0.001 with a step size of
0.00005

Page 13 of 27
Fig. 11: Gain and phase margin when k iQ was varied from 5 to 100 with a step size of 5
Step 7: The for loop for different values of k iQ was run to get the step response of the closed-loop
transfer function and phase margin of the open-loop transfer function.
Initially the k iQ was varied from 0.01 to 5 with a step size of 0.5 , and it was observed that the peak
overshoot is increasing from 0.978940976 to 1.043940263 as shown in fig. 12 and fig. 13. The Phase
margin was observed to be reducing from 91.23925386 to 86.39802943.

Fig. 12: Step response of the closed-loop transfer function with k iQ varied from 0.01 to 5 with a step
size of 0.5

Page 14 of 27
Fig. 13: Zoomed step response of the closed-loop transfer function with k iQ varied from 0.01 to 5
with a step size of 0.5

k iQ Phase margin Rise Time Settling Time Overshoot Peak Peak Time
0.01 91.23925386 0.004097333 0 0.978940976 0.052352001
0.51 90.69852514 0.003963787 0.008203349 0 0.990769373 0.05204434
1.01 90.15791076 0.003846301 0.007013057 0 0.997634609 0.018256512
1.51 89.61770973 0.003741516 0.006364464 0.479223705 1.004792237 0.011994539
2.01 89.07816489 0.003647087 0.005922662 1.265765896 1.012657659 0.013416068
2.51 88.53948933 0.003561749 0.005589838 1.953392685 1.019533927 0.012322952
3.01 88.00191252 0.003483171 0.021207009 2.605924049 1.02605924 0.011541676
3.51 87.46566233 0.003411078 0.024827034 3.227954255 1.032279543 0.010998056
4.01 86.93096206 0.003344461 0.026434287 3.823020664 1.038230207 0.010530034
4.51 86.39802943 0.00328226 0.027016599 4.394026265 1.043940263 0.010140076

Step 8: Optimal design consideration for k iQ


 A high (low) peak and overshoot in the step response of the closed-loop transfer function
denotes that the system is underdamped (overdamped)
 For the controller’s optimal design, considering the step response peak of the closed-loop
transfer function is less than 20% of the step response’s nominal amplitude. Thus the step
response’s peak is kept below 1.2.

For a stable system, the “phase margin” should be in the range of 450 to 700.
Step 9: The for loop for different values of k iQ was again run to get the step response of the closed-
loop transfer function and phase margin of the open-loop transfer function
The k iQ was varied from 21 to 45 with a step size of 1 and it was observed that the peak overshoot is

Page 15 of 27
reducing from 1.17844661 to 1.09539236 as shown in fig. 14 and fig. 15. The Phase margin was
observed to be increasing from 55.63686539 to 70.33477756.

Fig. 14: Step response of the closed-loop transfer function with k iQ varied from 21 to 45 with a step
size of 1

Fig. 15: Zoomed step response of the closed-loop transfer function with k iQ varied from 21 to 45 with
a step size of 1
k iQ Phase margin Rise Time Settling Time Overshoot Peak Peak Time
21 70.78999134 0.002278729 0.013977433 16.6812526 1.16681253 0.005946238
22 69.99888633 0.002246327 0.013576207 17.202532 1.17202532 0.005946238
23 69.22617159 0.002214889 0.013204929 17.7146113 1.17714611 0.005789758
24 68.47158787 0.002184357 0.012859618 18.2016898 1.1820169 0.005633278

Page 16 of 27
25 67.73483757 0.002155721 0.012538434 18.6887859 1.18688786 0.005633278
26 67.01559154 0.002129122 0.012239222 19.1510528 1.19151053 0.005476798
27 66.31349528 0.00210324 0.011959572 19.6122987 1.19612299 0.005476798
28 65.62817445 0.002078034 0.011696921 20.0490708 1.20049071 0.005320318
29 64.95923965 0.002053469 0.011450298 20.4905835 1.20490584 0.005320318
30 64.30629077 0.00202951 0.011218761 20.9042376 1.20904238 0.005320318
31 63.66892057 0.002006634 0.01100011 21.3260756 1.21326076 0.005163838
32 63.04671797 0.001985582 0.010792661 21.7275901 1.2172759 0.005163838
33 62.43927071 0.001965025 0.010598068 22.1182467 1.22118247 0.005007358
34 61.84616769 0.001944941 0.010413031 22.5122129 1.22512213 0.005007358
35 61.26700089 0.001925306 0.010237065 22.8829599 1.2288296 0.005007358
36 60.70136705 0.001906101 0.010069653 23.2540439 1.23254044 0.004850878
37 60.14886893 0.001887305 0.013726008 23.62305 1.2362305 0.004850878
38 59.60911644 0.0018689 0.013902596 23.9710076 1.23971008 0.004850878
39 59.08172748 0.001851388 0.013958528 24.3166748 1.24316675 0.004694398
40 58.56632866 0.001835085 0.013962385 24.6678623 1.24667862 0.004694398
41 58.06255575 0.001819112 0.013936303 24.9999308 1.24999931 0.004694398
42 57.57005411 0.001803456 0.013889862 25.3132153 1.25313215 0.004694398
43 57.0884789 0.001788104 0.01383013 25.6499548 1.25649955 0.004537918
44 56.6174953 0.001773044 0.01376091 25.9720928 1.25972093 0.004537918
45 56.15677849 0.001758264 0.013684356 26.2771243 1.26277124 0.004537918

Step 5: k iQ =36 is chosen with the phase margin 60.70136705 and the peak 1.23254044 p.u., which
satisfies the stability criterion as shown in fig. 16 and in the limits of our design considerations.

Fig. 16: Bode digram for k iQ =36

Page 17 of 27
Task 4: Small signal analysis

Exercise 1 – Small Signal Analysis

Does the data seem reasonable?


Yes, the data seems because connecting three different loads shows different power requirement and
increasing the load also increases the power consumption.

Fig. 17: Equilibrium point with Load 1 connected to the bus

Fig. 18: Equilibrium point with Load 2 connected to the bus

Page 18 of 27
Fig. 19: Equilibrium point with Load 1 and Load 2 connected in parallel to the bus

How about the operating frequency?


The operating frequency decreases with increase in the load as shown in fig. 17, 18 and 19.

Load Frequency
rad/sec Hz
Load1 (R = 100Ω, L = 5mH; Z1 = 100.636 Ω) 314.146 49.9978
Load2 (R = 20Ω, L = 2.5mH; Z2 = 21.2732 Ω) 314.093 49.9894
Load3 (Load1 and Load2 parallel – Equivalent Z = 17.5611Ω) 314.080 49.9873

Is it possible to operate in nominal frequency with this load? How?


Yes, it is possible to operate at the nominal frequency with this load by implementing secondary
level frequency deviation control and increasing the power injection to the grid by the generators,
e.g. using another PI controller to form secondary control and dynamically adjusting the initial
working point (or offset) in the droop line, so that the actual working point can be the nominal
frequency 50 Hz. The secondary voltage control is in the same way.

Page 19 of 27
Observing the root locus, what can we say about the system dynamics?
When the load 1 equilibrium point is shifted to load 2 equilibrium point then the system is stable as
all the poles of the system are in the left half plane as shown in fig 20. As the load is increased, the
system frequency decreases as shown in fig. 21. The secondary controller frequency droop
parameters of the inverters are responsible for fast response of inverter 3. Changing the droop gain
system parameters affects the response time of the inverters as shown in fig. 25. The droop
parameters of inverter 1, inverter 2 and inverter 3 makes the system underdamped or overdamped
and affects the response times of the controllers.

Fig. 20: Root locus plot when the load 1 Fig. 21: Frequency deviation when the load 1
equilibrium point is shifted to load 2 equilibrium point is shifted to load 2 equilibrium
equilibrium point point

Selecting the “ssa” files in the reverse order

Page 20 of 27
Fig. 22: Root locus plot when the load 2 Fig. 23: Frequency deviation when the load 2
equilibrium point is shifted to load 1 equilibrium point is shifted to load 1 equilibrium
equilibrium point point

Changing the droop gains in “Sys_Parameters.m”


The frequency droop parameters were changed to:
kp2=0.00025
kp3=0.0025

Fig. 24: Root locus plot when the load 2 Fig. 25: Frequency deviation when the load 2
equilibrium point is shifted to load 1 equilibrium point is shifted to load 1 equilibrium
equilibrium point point

Page 21 of 27
Exercise 2 – Microgrid Simulation (ideal VSI’s)

5000 314.16
P1 1

Angular Frequency (rad/s)


P2 314.14 2
4000
P3 3
Active Power (W)

314.12
3000
314.1
2000
314.08

1000
314.06

0 314.04
0 0.5 1 1.5 2 2.5 3 3.5 0 0.5 1 1.5 2 2.5 3 3.5
Time (s) Time (s)

Fig. 26: Active power sharing between the three Fig. 27: Frequency deviation in the three units
units when load 1 is connected when load 1 is connected

400
Q1
300 Q2
Reactive Power (var)

Q3
200

100

-100

-200
0 0.5 1 1.5 2 2.5 3 3.5
Time (s)

Fig. 28: Reactive power sharing between the three units when load 1 is connected

Why the units share the active power equitably. Why this do not happen for reactive power?
In an inductive transmission line, the active power (P) and reactive power (Q) is related to
frequency (ω) and voltage (V ) respectively in droop equation. The objective of the controller is to
maintain the frequency and voltage of the power grid which is critical for the stable operation of the
grid. The active power is shared among the units equitably because adjusting the system control
parameter “k p ” can maintain a constant grid frequency by sharing the active power among the units.
Unit 1 is unable to share power by changing the system control parameter “k p ” for the inverter 1 to
0.00025 but the frequency of the unit is maintained as shown in fig 29 and 30. Sharing of reactive
power among the unit 2 and 3 is also achieved as shown in fig 31. The present system control
parameter does not allow sharing of reactive power among the units by maintaining a constant grid
voltage. By adjusting the system control parameter, the reactive power can also be shared among the
units by maintaining a constant grid voltage.

Page 22 of 27
Fig. 29: Active power sharing between the three Fig. 30: Frequency deviation in the three units
units when load 1 is connected with k p 1 =0.00025 when load 1 is connected with k p 1 =0.00025

Fig. 31: Reactive power sharing between the three units when load 1 is connected with k p 1 =0.00025

Why the unit 3 increases the active power faster than the others during the load step?
The design of the system control parameters of the unit 3 allows a fast response during the step load
change. Changing and matching the control parameters according to the power line parameters in the
other units can also improve the dynamic response of the system.

Page 23 of 27
Exercise 3 – Small Signal Model Validation

Fig. 29: Comparison between the small-signal and simulation model for the transient of increasing
load1 to load2 at t = 1.5 sec.

Considering the comparison of the frequency curves, what about the accuracy of the model?
Considering the idealities of the inverter in both the simulation and small signal model, the model is
highly accurate and shows a similar change in angular frequency according to simulation. This result
validates the accuracy of the model.

Page 24 of 27
Lab IV

Task 1

The converter is integrated into the grid at t = 4s.


Voltage waveforms:

Voltage before synchronization:

Voltage after synchronization:

Synchronization error waveforms

Page 25 of 27
PQ waveforms:

Current waveforms:

Page 26 of 27

You might also like