Grid-Forming Inverter with Inductive Droop Control and Integrator in the Reactive Power - Voltage Loop:
![]() |
![]() |
The real power and reactive power , delivered from the voltage source to the grid through the reactance , are:
where is the power angle. The active and reactive power are usually filtered, here this filter is implemented as:
where defines the low-pass filter cutoff frequency.
The Droop Law is:
where is the input of the integrator of channel and , and corresponds to the Droop coefficients. Therefore, these equations can be rewritten as:
By assuming that , , and are constant, it can be considered that:
and by rearanging the above equations, it is possible to obtain:
Note that is the Droop control variable that by integration will define the angular position of the voltage sinthesized by the inverter, that is:
Since we are consider the operation in sinusoidal steady state, the is given by:
therefore:
where:
The nonlinear dynamic equations that govern the grid connected converter with droop are described by:
In order to simplify the notation let us define some constants, that are:
then:
Let us start by computing the equilibrium point of the nonlinear dynamic equations:
From and we have:
or:
The load angle can be found as:
and the inverter reference frequency:
pi = 3.14159265359
V = 220. # Grid Voltage
wr = 2.*pi*60. # Grid Frequency
L = 1.e-3 # Inductance
XL = wr*L # Inductive Reactance
a = 2.*pi*30. # Low-pass filters
Zb = V**2/33000. # Based Impedance
m = 2.*pi*3./33.33e3 # Droop coefficient m
kv = 20. # Droop coefficient kv
kq = kv*n # Droop coefficient kq
print (" XL = ", format(XL, ".2f") , " \u03A9")
print (" XL = ", format(XL/Zb, ".2f"), " pu ")
The reference voltages and frequency will be expressed as a function of the ative and reative power to be dispached to the grid:
Qo = 33e3 * 0.
Eo = V
Po = 33e3 * 1.
wo = wr
print (" Eo = ", format(Eo, ".2f"), " V")
print (" wo = ", format(wo, ".2f"), " rad/s" )
print (" Po = ", format(Po, ".2f"), " W" )
print (" Qo = ", format(Qo, ".2f"), " VAr" )
a21 = - a
a22 = - (a*m*V)/XL
a32 = - (a*kq*V)/XL
b11 = - wr
b21 = a*(wo + m*Po)
b31 = a*kq*Qo + (kq*a*V**2)/XL + a*kv*(Eo - V)
print (" a21 = ", format(a21, ".2f"))
print (" a22 = ", format(a22, ".2f"))
print (" a32 = ", format(a32, ".2f"))
print (" b11 = ", format(b11, ".2f"))
print (" b21 = ", format(b21, ".2f"))
print (" b31 = ", format(b31, ".2f"))
e = (((-b21 + a21*b11)/a22)**2 + (-b31/a32)**2)**(1/2)
print (" e = ", format(e, ".2f"), " V")
import math
delt = math.atan2( (-b21 + a21*b11)/a22 , -b31/a32)
Delt = delt*180./pi
print (" Delt = ", format(Delt, ".2f"), "\u00b0")
p = (V/XL)*e*math.sin(delt)
q = (V/XL)*e*math.cos(delt) - (V**2)/XL
print (" p = ", format(p/1000, ".2f") , "kW")
print (" q = ", format(q/1000, ".2f") , " kVAr")
The Jacobian matrix is given by:
import numpy as np
from scipy import sqrt, exp, cos, matrix, vstack, hstack, zeros
np.set_printoptions(precision=2)
J = matrix([[0, 1, 0, 0], [(a22*e*math.cos(delt)), a21, 0, (a22*math.sin(delt))], [(-a32*e*math.sin(delt)), 0, a21, a32*math.cos(delt)], [0, 0, 1, 0]])
print (" J = \n", J)
import scipy.linalg as la
evals, evecs = la.eig(J)
Eig_V_J = evals
print (" [ \u03BB\u2081 \u03BB\u2082 \u03BB\u2083 \u03BB\u2084]'= ", np.array2string(Eig_V_J.reshape((-1, 1)), prefix=' [ \u03BB\u2081 \u03BB\u2082 \u03BB\u2083 \u03BB\u2084] = ') )
In order to characterizes the interaction between modes and state variables, let us compute the participation factors:
evals, evecs = la.eig(J)
T = evals.real
R = evecs # Matrix whose columns are the Right eigenvectors of J
L = np.linalg.inv(R) # Matrix whose rows are the left eigenvecotors of J
print (" R = \n", R)
print (" \n L = \n", L)
print ("\n\n Participation Factors: ")
print (" \n \u03BB\u2081 \u03BB\u2082 \u03BB\u2083 \u03BB\u2084 \n ")
print("|L(0,0)*R(0,0)|=", format(np.abs(L[0][0]*R[0][0]), ".2f"), " |L(1,0)*R(0,1)|=", format(np.abs(L[1][0]*R[0][1]), ".2f"), " |L(2,0)*R(0,2)|=", format(np.abs(L[2][0]*R[0][2]), ".2f"), " |L(3,0)*R(0,3)|=", format(np.abs(L[3][0]*R[0][3]), ".2f"), " \u03B4")
print("|L(0,1)*R(1,0)|=", format(np.abs(L[0][1]*R[1][0]), ".2f"), " |L(1,1)*R(1,1)|=", format(np.abs(L[1][1]*R[1][1]), ".2f"), " |L(2,1)*R(1,2)|=", format(np.abs(L[2][1]*R[1][2]), ".2f"), " |L(3,1)*R(1,3)|=", format(np.abs(L[3][1]*R[1][3]), ".2f"), " \u03C9")
print("|L(0,2)*R(2,0)|=", format(np.abs(L[0][2]*R[2][0]), ".2f"), " |L(1,2)*R(2,1)|=", format(np.abs(L[1][2]*R[2][1]), ".2f"), " |L(2,2)*R(2,2)|=", format(np.abs(L[2][2]*R[2][2]), ".2f"), " |L(3,2)*R(2,3)|=", format(np.abs(L[3][2]*R[2][3]), ".2f"), " ed" )
print("|L(0,3)*R(3,0)|=", format(np.abs(L[0][3]*R[3][0]), ".2f"), " |L(1,3)*R(3,1)|=", format(np.abs(L[1][3]*R[3][1]), ".2f"), " |L(2,3)*R(3,2)|=", format(np.abs(L[2][3]*R[3][2]), ".2f"), " |L(3,3)*R(3,3)|=", format(np.abs(L[3][3]*R[3][3]), ".2f"), " e" )
PN = 100
j = np.arange(start=1, stop=101, step=1)
DV= 22.
Vj= 220 - DV + j*(2*DV)/PN
wr = 2.*pi*60.
L = .5e-3
XL = wr*L
n = 22./(33.33e3)
m = (2.*pi*3.)/(33.33e3)
a = 2.*pi*12.
wo = wr
Eo = 220.
Po = 0.
Qo = 0.
kv = 1.
kq = n*kv
b11 = -wr
a21 = -a
b21 = a*(wo + m*Po)
a22j = - a*m*Vj/XL
b31j = a*kq*Qo + kq*(Vj**2)*a/XL + a*kv*(Eo - Vj)
a32j = - kq*Vj*a/XL
ej = sqrt(((-b21 + a21*b11)/a22j)**2 + (-b31j/a32j)**2)
deltj = np.arctan2( (-b21 + a21*b11)/a22j , -b31j/a32j)
qj = (Vj/XL)*ej*np.cos(deltj) - (Vj**2)/XL
pj = (Vj/XL)*ej*np.sin(deltj)
import matplotlib.pyplot as plt
plt.figure(figsize=(12, 4
))
plt.subplot(121)
plt.plot(Vj, qj/33000)
plt.xlim([198, 242])
plt.xticks([198, 209, 220, 231, 242],
["0.9", "0.95", "1", "1.05", "1.1"])
plt.ylim([-1.1, 1.1])
plt.yticks([-1,-0.5, 0, 0.5, 1],
["-1", "-0.5", "0.", "0.5", "1"])
plt.grid(True)
plt.ylabel('$\dfrac{qj}{33000}$', rotation=0)
plt.xlabel('$\dfrac{Vj}{220}$')
plt.subplot(122)
plt.plot(Vj, pj/33000)
plt.xlim([198, 242])
plt.xticks([198, 209, 220, 231, 242],
["0.9", "0.95", "1", "1.05", "1.1"])
plt.ylim([-1.1, 1.1])
plt.yticks([-1,-0.5, 0, 0.5, 1],
["-1", "-0.5", "0.", "0.5", "1"])
plt.grid(True)
plt.ylabel('$\dfrac{pj}{33000}$', rotation=0)
plt.xlabel('$\dfrac{Vj}{220}$')
plt.subplots_adjust(left=0.125,
bottom=0.1,
right=0.9,
top=0.9,
wspace=0.4,
hspace=0.35)
PN = 100
j = np.arange(start=1, stop=101, step=1)
DW = 2.*pi*3.
V = 220
wrj= 2.*pi*(60. - 3.) + (j/PN)*2.*DW
L = 1.e-3
XLj = wrj*L
n = 22./(33.33e3)
m = (2.*pi*3.)/(33.33e3)
a = 2.*pi*12.
wo = 2.*pi*60.
Eo = 220.
Po = 0.
Qo = 0.
kv = 1.
kq = n*kv
b11j = -wrj
a21 = -a
b21 = a*(wo + m*Po)
a22j = - a*m*V/XLj
b31j = a*kq*Qo + kq*(V**2)*a/XLj + a*kv*(Eo - V)
a32j = - kq*V*a/XLj
ej = sqrt(((-b21 + a21*b11j)/a22j)**2 + (-b31j/a32j)**2)
deltj = np.arctan2( (-b21 + a21*b11j)/a22j , -b31j/a32j)
qj = (V/XLj)*ej*np.cos(deltj) - (V**2)/XLj
pj = (V/XLj)*ej*np.sin(deltj)
import matplotlib.pyplot as plt
plt.figure(figsize=(12, 4
))
plt.subplot(121)
plt.plot(wrj/(2*pi*60), qj/33000)
plt.xlim([0.95, 1.05])
plt.xticks([0.95, 0.975, 1, 1.025, 1.05],
["0.95", "0.975", "1", "1.025", "1.05"])
plt.ylim([-1.1, 1.1])
plt.yticks([-1,-0.5, 0, 0.5, 1],
["-1", "-0.5", "0.", "0.5", "1"])
plt.grid(True)
plt.ylabel('$\dfrac{qj}{33000}$', rotation=0)
plt.xlabel('$\dfrac{\u03C9 rj}{2 \u03C0 60}$')
plt.subplot(122)
plt.plot(wrj/(2*pi*60), pj/33000)
plt.xlim([0.95, 1.05])
plt.xticks([0.95, 0.975, 1, 1.025, 1.05],
["0.95", "0.975", "1", "1.025", "1.05"])
plt.ylim([-1.1, 1.1])
plt.yticks([-1,-0.5, 0, 0.5, 1],
["-1", "-0.5", "0.", "0.5", "1"])
plt.grid(True)
plt.ylabel('$\dfrac{pj}{33000}$', rotation=0)
plt.xlabel('$\dfrac{\u03C9 rj}{2 \u03C0 60}$')
plt.subplots_adjust(left=0.125,
bottom=0.1,
right=0.9,
top=0.9,
wspace=0.4,
hspace=0.35)