This project design three-phase PV grid connected system using PLECS. In this README file, the process of design will be introdunce in detail.
The simulation content is listed as follows:
Part 1 – Boost converter for PV applications
- PV string characterization
- Design of a boost converter
- Modulation and open loop operation of the boost converter
- Implementation of a Maximum Power Point Tracker
Part 2 – Grid Synchronization
- Basic quadrature PLL (Phase Locked Loop) – principles
- Controller design
- Response to unbalanced voltages
- Response to harmonics
- Moving Average Filter PLL
Part 3 – Current and Power control of three-phase inverters
- Three phase modulation
- Dq modelling
- Current control for L filter
- LCL filter design
- Current control for LCL filter
- Dc bus capacitor design
- Dc bus voltage control
- Droop control
- Instantaneous power measurement
Part 4 – System Integration
- Integration of current control and synchronization
- Integration of the dc bus voltage control
- Integration of the boost converter
- Integration of the power control
- Tests under different grid conditions
The simulation is based on the software PLECS.
In this section, we are going to set a current ripple and calculate the inductance in the worst case, which is the max power point.
The average value of current through the inductor is:
In the equation above,
The ripple current can also be calculated in representation of voltage applied on it:
Combining the above equation with previous expressions, we get:
Therefore, we choose
In our design, the converter has to comply with the requirement that the maximum amplitude of the input voltage components above 150 kHz should be smaller than 5 mV.
Figure 1: Simplified model of circuit when analyzing capacitor
Simply modeling the PV string as a current source, we simplify the circuit as shown in Figure 1. The alternative part of the current is denoted as
Figure 2: Current through capacitor vs time
For the waveform of
At the maximum power point,
The impedance of the capacitor at the third harmonics is:
The third harmonics of the voltage is:
If we select
Therefore, the capacitance should be more than
In this part, we are going to design the controller for the boost converter. The control system of our design is shown in Figure below. There are two control loops: an outer loop for voltage control and an inner loop for current control.
The system can be modeled as:
In this section, we model the boost converter system using small signal analysis.
When
$$ \begin{aligned} L\dot{i_{i}} &= v_{b} - v_{pv} - i_{L}R_{L} \ C\dot{v}{pv} &= i_L + i{PV} \end{aligned} $$
The state-space form of the above equations is:
When
$$ \begin{aligned} L\dot{i_{i}} &= -v_{pv} - i_{L}R_{L} \ C\dot{v}{pv} &= i_L + i{PV} \end{aligned} $$
The state-space form of the above equations is: $$ \begin{aligned} \dot{\mathbf{x}} &= \mathbf{A_2} \mathbf{x} + \mathbf{B_2} \mathbf{u} \ \mathbf{A_2} &= \begin{bmatrix} -\frac{R_{L}}{L} &-\frac{1}{L} \ \frac{1}{C} & 0 \end{bmatrix}, \quad \mathbf{B_2} = \begin{bmatrix} 0 & 0 \ 0 & 0 \end{bmatrix} \end{aligned} $$ The system can be described as: $$ \begin{cases} \mathbf{\dot{x}} = \mathbf{A_{1}}\mathbf{x} + \mathbf{B_{1}}\mathbf{u}, & t \in [0, dT_s] \ \mathbf{\dot{x}} = \mathbf{A_{2}}\mathbf{x} + \mathbf{B_{2}}\mathbf{u}, & t \in [dT_{s}, T_{s}] \end{cases} $$ State-space averaging techniques are used to obtain a set of equations describing the system over one switching cycle. After applying the averaging technique, we obtain:
Thus, the state-space average model for the boost converter is:
Using standard linearization techniques and applying perturbations:
$$ \begin{cases} i_{L} = I_{L} + \tilde{i}{L} \ v{PV} = V_{PV} + \tilde{v}{PV} \ v{b} = V_{b} + \tilde{v}_{b} \ d = D + \tilde{d} \end{cases} $$
Finally, the linearized model of the system is:
$$ \begin{aligned} \begin{bmatrix} \dot{\tilde{i}}L \ \dot{\tilde{v}}{PV} \end{bmatrix} = \begin{bmatrix} -\frac{R_L}{L} & -\frac{1}{L} \ \frac{1}{C} & 0 \end{bmatrix} \begin{bmatrix} \tilde{i_L} \ \tilde{v}{\mathrm{pv}} \end{bmatrix} + \begin{bmatrix} \frac{V_b}{L} & \frac{D}{L} \ \frac{1}{C} & 0 \end{bmatrix} \begin{bmatrix} \tilde{d} \ \tilde{v}{\mathrm{b}} \end{bmatrix} \end{aligned} $$
In this section, we derive the transfer function of the system from the state-space model above.
Since the output of the system is
The transfer function is calculated using the following formula:
Therefore, the transfer function is:
\begin{bmatrix}
\frac{C,V_b ,s}{C,L,s^2 +C,R_L ,s+1} & \frac{C,D,s}{C,L,s^2 +C,R_L ,s+1}\
\frac{V_b }{C,L,s^2 +C,R_L ,s+1} & \frac{D}{C,L,s^2 +C,R_L ,s+1}
\end{bmatrix}
$$
After redrawing the control loop instead of using the state-space model, we obtain the block diagram shown in Figure below.
To design the current controller, we select the transfer function:
According to the previous sections, we have determined the device parameters:
Our PI controllers result in a phase margin of 50$^\circ $ and crossing frequencies of 1/10 of the switching frequency(7 kHz).
Aided by pidtool in Matlab, the parameters of PI controller are:
The voltage controller loop can be redrawn in series, which is show in Figure below.
Therefore, the dual closed loop system can be represented as:
The simplified system transfer function of inner loop can be written as:
We want a phase margin of $60^\circ $ and a crossing frequency of 1/4 of the crossing frequency of the inner loop(7kHz).
By the same method, we can get the parameters of the PI controller: $$ C_v(s)=0.091\left(1+\frac{6100}{s}\right) $$
The MPPT algorithm is designed to track the maximum power point of the PV module. The algorithm used in this design is the Perturb and Observe (P&O) method. The P&O method works by perturbing the duty cycle of the boost converter and observing the change in output power. If the power increases, the perturbation is continued in the same direction; if the power decreases, the perturbation is reversed.
The block diagram of the MPPT algorithm is shown in Figure below.
Based on the flowchart above, we can write the codes to update the reference voltage to track the MPP. The C script is shown below:
// PV voltage and current
double Vpv;
double Ipv;
// New and old power
static double power;
static double powerOld=0;
// New and old voltage reference
static double Vref=400;
static double VpvOld;
// Voltage variation
static double DeltaVref = 1.5;
// get voltage and current
Vpv = InputSignal(0,0);
Ipv = InputSignal(0,1);
power = Vpv*Ipv;
if(abs(power-powerOld)<1){
Vref=Vref;
}else if(power > powerOld) {
if (Vpv > VpvOld) {
Vref += DeltaVref;
} else {
Vref -= DeltaVref;
}
} else {
if (Vpv > VpvOld) {
Vref -= DeltaVref;
} else {
Vref += DeltaVref;
}
}
// Save old values for next iteration
powerOld = power;
VpvOld = Vpv;
if (Vref < 0) {
Vref = 0;
} else if (Vref > 700) {
Vref = 700;
}
// Save old values
powerOld = power;
VpvOld = Vpv;
// update Vref
OutputSignal(0,0) = Vref;
The Phase-Locked Loop (PLL) in a three-phase inverter is a control system used to synchronize the inverter's output with the grid or a reference signal. It plays a crucial role in ensuring the correct phase and frequency alignment for grid-tied applications and stable operation. In our project, we design and simulate a three-phase phase-lock loop; after that, we implement some methods to improve the performance of PLL.
The transformation from
Therefore, we can simply draw the SRF-PLL diagram based on the Park transform. The result is shown in Figure below.
As shown in Figure above, the actual phase angle of
The open-loop transfer function of the PLL can be expressed as: $$ G_{ol}(s) = \frac{V_\delta}{s} \left(K_p + \frac{K_i}{s}\right) $$
The closed-loop transfer function of the PLL can be expressed as:
$$
G_{cl}(s)=\frac{\hat{\theta}\left(s\right)}{\theta(s)}=\frac{V_\delta K_{p}s+V_\delta K_{i}}{s^{2}+V_\delta K_{p}s+V_\delta K_{i}}
$$
where
We are going to design a PI controller that results in an open-loop transfer function with a crossing frequency of 25 Hz and a margin phase of
The RMS value of line voltage in our system is 400V. The amplitude ( V_\delta ) can be calculated as:
The phase angle of the open loop system can be written as:
In our design, the phase margin is (60^\circ), thus,
Therefore,
The crossover gain at (\omega_c), ( \lvert G_{ol}(j\omega_c)\rvert = 1 ):
We can get the relationship of (K_p) and (K_i):
Combine Equation (1) and Equation (2), we can calculate the parameters of PI controller as: