1. Introduction
Growing concerns about environmental pollution, the depletion of fossil fuels, and global warming all serve as powerful motivators for a rapid transition away from conventional energy supplies toward renewable energy resources, which play a crucial role in promoting sustainability [
1]. As the passive distribution system is being activated, the migration process necessitates reconstructing the existing grid infrastructure. In the traditional grid, the power flow is central and unidirectional. Scatteredly installed distributed generators (DG) in the grid change these two grid characteristics. In recent years, the idea of a microgrid has become increasingly prevalent in power systems. The U.S. Department of Energy defines the microgrid as a collection of interconnected loads and distributed energy resources operating within properly specified electrical limits as a single controllable entity with respect to the grid and capable to operate in both grid-connected and island modes [
2]. Dispersed generation throughout the grid reduces losses and improves reliability.
While active distribution systems provide numerous solutions, they also bring some difficulties that researchers and the industry must overcome. The significant challenge is in comprehending the system dynamics through system modeling. The focus of this research is on inverter-based resources (IBRs), which are extensively employed in active distribution systems. An AC microgrid’s power inverter connections can be categorized as either grid-following or grid-forming, depending on which role the inverters are designed to perform [
3,
4].
Grid-following power inverters are mostly constructed to supply power to a grid that is already energized. They can be modeled as a high-impedance, parallel current source connected to the grid. In this application, it is important to note that this current source should be precisely synchronized with the ac voltage at the connection point so that the active and reactive power exchanged with the grid can be controlled accurately. Due to this, the grid-following technique is incapable of operating autonomously in Island Mode. The control configuration of this connection is applied to the active and reactive power. The grid-forming technique is analogous to an ideal ac voltage source with a low output impedance. Each of the integrated inverters of such a connection is considered an independent source of power. Furthermore, the connected inverter is accountable for determining the voltage and frequency of the local supplied area. Therefore, the grid-forming scheme has the ability to operate independently in an Island Mode. The system voltage and frequency are used to govern the configuration of this connection.
Inverters must be synchronized with the grid for all types of DERs. Grid synchronization, in fact, consists in the real-time monitoring of system variables. Due to the fact that system states may change owing to failures, disturbances, resonances, or even load changes, instantaneous system monitoring is needed [
5,
6,
7,
8]. Furthermore, both inverter connection and disconnection must be performed while monitoring the grid states at the point of common coupling to ensure that the system is operating in accordance with the grid requirement codes [
9].
The phase-locked loop, or PLL, is the predominant mechanism for synchronizing converters. Two methods are used for integrating the PLL with the grid: open-loop and closed-loop [
10]. While the open-loop connection has many applications, the closed-loop connection has gained popularity due to its greater precision. For applications requiring a three-phase grid-connected converter, the synchronous reference frame PLL (SRF-PLL) is the most prevalent type of PLL [
11]. The PLL device can estimate from the connection point the voltage magnitude, frequency, and phase angle. The SRF-PLL’s mechanism proceeds as follows [
12]: the PLL transforms the three-phase grid voltage
into the
-frame voltage
, which is based on the rotating frame and appears as DC. The PI controller suppresses the
to zero and aligns the grid voltage to the d-axis. The output of the PI controller and the integrator eventually provides the grid voltage phase angle, which is likewise sent back to the Park transformation utilized in the process.
The SRF-PLL operates effectively while operating in a balanced state, but fails to perform well when operating in an abnormal or imbalanced state. Reference [
13] proposes a decoupled double synchronous reference frame PLL for power converters control. In their work, the authors enable the PLL to extract the grid voltage’s fundamental component during the inclusion of the distortion components. Other researchers in the field have proposed improved versions of, or whole new replacements for, the standard PLL [
14,
15,
16,
17,
18,
19,
20]. This paper implements the SRF-PLL and develops its controller to accommodate unbalanced components.
Similar to synchronous machines, inverters can be modeled via ordinary differential equations (ODEs). The majority of the controllers can be modeled with ODEs if time-dependent delays are approximated with lags or simply disregarded [
21]. Power system dynamics are generally driven by two types of state variables: slow and fast. The slow-state variables involve big-time constants, whereas the fast-state variables involve small-time constants. The dynamical variation of the slow-state variables is small and significant, and can therefore be overlooked. The dynamics of the fast-state variables, on the other hand, are serious and must be considered in system modeling. Due to the mixture of such variables, the studied model is composed of a set of nonlinear differential-algebraic equations (DAEs).
Modeling the dynamics of a wide variety of power system applications is a function that can be performed with the DAE system. The numerical solution of the DAE system can be approached using either explicit or implicit integration schemes, depending on the element of the system being analyzed. The explicit integration scheme is renowned for its ease of use and applicability to a wide range of applications. The implicit scheme can achieve the same result as the explicit scheme, but it necessitates the inclusion of two matrices that pertain to the system under consideration.
The state–space modeling of a grid-connected inverter is introduced in [
22]. Expanding on this existing work, our research substantially contributes to the field by detailing the derivation process of the state–space representation. Furthermore, we have incorporated a comprehensive methodology for numerically solving the state–space equations. The advanced understanding and tools provided through this research are expected to aid in the design, analysis, and optimization of grid-connected inverter systems. The following summarizes this paper’s contribution:
Model an inverter-based resource coupled to a grid-following scheme using differential-algebraic equations.
Introduce a versatile synchronous reference frame phase-locked loop (SRF-PLL) that is designed to be able to operate in the existence of the imbalanced component.
Demonstrate how to convert the transfer functions of the system into state–space form. The procedure, albeit implemented with the IBR model, is generic and can be employed with other dynamical applications.
Integrate and simulate the proposed model using the Forward Euler Method (FEM), the Backward Euler Method (BEM), and the Implicit Trapezoidal Method (ITM).
2. Grid-Following Frequency Inverter System
Inverters facilitate the transformation of electrical energy from DC to AC. On the DC side, the inverter is typically linked to a DC source, or alternatively, another power electronic system. These can be effectively modeled as a combination of a DC source, a capacitor, and a current source. The latter is a representation of the power loss attributed to the converter. The losses incurred when the inverter is in an operational state manifest as resistors on the AC side of the system.
In the context of this research, we delve into the dynamics of a three-phase inverter that is engaged in the supply of a stiff, balanced grid operating at a constant frequency. On the AC side, each phase of the inverter is interfaced with an ideal voltage source via a series RL branch, a configuration that creates an inductive–resistive pathway. The point at which these phases are collectively coupled with the grid is known as the Point of Common Coupling (PCC), and the system is illustrated in
Figure 1.
The role of the grid-following inverter is to "follow" the grid’s behavior by adjusting its output voltage and frequency to align with those of the AC microgrid. This is achieved through a mechanism known as the Phase-Locked Loop (PLL), which enables synchronization between the inverter’s voltage and frequency and those of the grid. The PLL plays a crucial role in maintaining grid stability and ensuring the efficient operation of the inverter with the grid.
2.1. dq-Frame
To control the grid-following converter-interfaced system, it is more practical to reduce the system’s structure and convert the actual three-phase frame to either
-frame or
-frame. For large-scale systems, the latter is more convenient as its control is DC and it does not require a large bandwidth. The following equation converts the three-phase frame to
-frame
where
can represent the voltage and the current.
is the PCC voltage angle that allows for the frame conversion and is achieved from PLL. The
-frame can be retrieved as follows:
2.2. Grid Modeling
This research considers an inverter that is connected to a stiff grid; the voltage is assumed to be balanced with constant frequency. The three-phase voltages are expressed as follows:
where
is the peak value of the line-to-neutral voltage,
is the grid angular frequency, and
is the initial phase angle. The grid is modeled in
-frame as follows:
Using (
1), the grid can be expressed in
-frame as follows:
For this system, the control inputs
,
, and
determine the dynamics of the state variables
,
, and
. It can be noticed that the system includes nonlinear components that are
,
,
,
. With the help of the Phase-Locked Loop (PLL), the system phase angle can be accurately detected.
represents the detected angle from PLL. With
, the complexity of the nonlinearity disappeared
where
and
. In the current form, the system is linear and it is exited by
. With
and
as DC, the state variables
and
are also DC. The conversion angle
is ensured to have the value of
by the PLL mechanism, which is covered by the following subsection. The active and reactive powers supplied to the PCC node are
As stated earlier, PLL guarantees that, at steady state,
. Thus, the active and reactive power will be
Accordingly,
and
can simply be controlled by
and
, respectively. The reference-controlled signals of the active and reactive power can be set as follows:
With efficient control, the system variables track the reference settings.
2.3. Current-Mode Control
Two modes of control are applied to the inverter: voltage and current. The latter has the advantage of protecting the inverter from overcurrent issues that could deteriorate the inverter. Equation (
6) describes the dynamics of the whole system and it includes the inverter voltage terminals. Since dq-frame is implemented, the terminal voltage
is converted to
and
with the help of the PLL. The applied control on the inverter utilizes the relationship between the terminal voltage and the control modulation signals, as follows:
The inverter current-control mode that is expressed by Equation (
6) has state variables
and
, control variables
and
, and disturbance inputs
and
. Its control block diagram is shown in
Figure 2.
For this system, a controller is applied to make the inverter’s currents, both
d and
q components, follow the change of the reference signals. The difference between the current state and the reference signal is the error
e. The controller
compensates for the error and generates the signal
u, which is scaled by the division by the value of the DC source and sets the inverter modulation signal
m. Next, the inverter processes the modulation signal
m to produce the terminal voltage
, as in Equation (
10). As the model structure is DC, the PI controller is sufficient to track the signal reference. The designed controller suits both
d and
q loops.
where proportional and integral gains, respectively, are denoted by
and
. As a result, the system open-loop gain
Due to the fact that the system plant pole is inherently close to the origin, the magnitude and phase gains of the decline are found at low frequencies. Since the plant pole is on the left side, stability concerns are not posed. The plant pole can be canceled by setting the controller zero
equal to the plant pole. The loop gain will be
. Consequently, the closed-loop transfer function of the system evolves to be
where
represents the time constant of the closed-loop system. The value of
should be both large enough to have a wide bandwidth and small enough to have a fast response.
represents the feed-forward filter, a crucial component employed to predict variations in the load or system conditions, thereby facilitating the necessary adjustments to the inverter’s output. The integration of feed-forward filters into inverter control systems offers several advantages, such as accelerated response times, reduced distortion, and improved efficiency. The inverter is equipped with the capability to modify its output proactively in anticipation of fluctuations in the load or system parameters.
2.4. Phase-Locked Loop (PLL)
The PLL synchronizes the inverter with the grid. It provides the grid angle, denoted as
, that gives the ability to convert the three-phase components into
-components. The grid
-components are
As stated before,
results in
and
. This is achieved by the following steps. By incorporating feedback on the state variable
in Equation (
5), the PLL can be expressed as
where
is the transfer function of the PLL’s compensator and
p is a differentiation operator. The PLL equation is capable to set
to
. However, the frequency has to be properly initialized and constrained. The nonlinearity caused by the trigonometric function can be eliminated if the approximation
is considered as
x approaches zero. Accordingly, the PLL equation is
The difference between the input,
, and the output,
, is transmitted through the transfer function,
, to perform the management of this feedback system. The detailed scheme of PLL operation is shown in
Figure 3. At the PLL’s termination, a voltage-controlled oscillator (VCO) is set up to reset the measured angle once it hits
.
The dynamical performance of the PLL is mostly determined by the design of the compensator
that is defined as follows:
where
handles the system requirements and
considers the stability requirements. The PLL has a single integrator at the origin, which is from the VCO. For that, the constant component of the input signal,
, can simply be tracked. However, since the input signal has a ramp component that is
, another integrator is required to guarantee that the steady-state error approaches zero. The compensator part
may include this pole among the other system’s design requirements.
To prevent malfunctioning in the control process, the PLL should also take care of the distortion, e.g., harmonics, that are embedded in the grid voltage. Otherwise, the distortion in the grid will be reflected in the converted frame,
. The double harmonic component is a significant cause for concern since it has an inherent large magnitude and a frequency that is the closest to the fundamental frequency. The imbalanced component can also lead to stability problems in the grid. We must consider the imbalanced component in designing the PLL mechanism to avoid the PLL malfunctioning. The effect of the double component distortion can be removed from the PLL when one pair of complex-conjugate zeros located at
is added to the compensator. As a result, the loop gain increases. In order to reduce the loop gain magnitude beyond the frequency of
, a double real pole is added at
. To date, the compensator taking into account the nominal value of the grid voltage
and the gain
h becomes
The additional specifications pertaining to operational and stability requirements can be seamlessly integrated into the system’s transfer function, represented by . In the context of this specific case study, we opt to conceptualize as a lead compensator, a vital control component that possesses the ability to inject additional phase margin into the plant system. The choice of design is strategic, as the lead compensator modifies the phase-frequency characteristics of the system to ensure a greater phase margin, which in turn guarantees a more stable and reliable system performance. The integration of a lead compensator into thus contributes to fortifying the overall stability of the system. By implementing this configuration, we ensure that the system maintains an ample stability margin in relation to the gain crossover.
This is of paramount importance as it aids in averting system instability that could stem from an increase in gain at the crossover frequency. Thus, this design ensures that the system is capable of operating under varying conditions while preserving its stability, thereby resulting in a more robust and dependable control system. With
representing the added phase margin, the lead compensator
is constructed as follows:
where
By considering the grid and stability requirements, the compensator becomes
4. Numerical Integration Methods
Dynamical systems that are characterized by differential-algebraic equations can be resolved and simulated through three prominent numerical integration methods: the Forward Euler Method (FEM), the Backward Euler Method (BEM), and the Implicit Trapezoidal Method (ITM). Each of these methods possesses its unique set of advantages and limitations; hence, the choice of an appropriate method should be tailored to align with the specific attributes and requirements of the application at hand. The standard form of the explicit ordinary differential equation is
where
x and
u denote the state and the input of the system, respectively. FEM is a first-order technique, and the process of its integration is straightforward. The state step is mainly based on the preceding state step. FEM is generally formulated as follows:
where
is available from the prior step and
is the time step. Despite its reputation for simplicity and stability, FEM is the least precise method.
BEM is an implicit method and is known for its high stability. BEM integrates the previous state with the current state, which is attained by numerical approaches, such as the Newton method if the system contains nonlinear components. The BEM standard form is
As previously mentioned, BEM is particularly useful when the system is nonlinear, which is a fundamental property of models of power systems. The following is the implementation of the Newton technique on the BEM. The standard form is set as
which is equivalent to
The
k-th iteration of the Newton solving process is
where
The initial value of the state iteration is
.
The implicit Trapezoidal Method (ITM) combines the BEM and the FEM to provide excellent stability and precision in the calculation. The ITM is attained by combining the FEM and BEM as follows:
and
The ITM is one of the most trustworthy and efficient techniques. In fact, it is the solver of preference for commercial and noncommercial power system software products. The ITM standard form is
5. Case Study
5.1. Robust PLL Performance under Voltage Imbalance Conditions
In the design of modern power systems, an essential consideration is the ability to maintain a stable operation in the presence of voltage imbalances. This case study presents a thorough evaluation of the proposed PLL model (
26), demonstrating its robust performance under various conditions, including the presence of voltage imbalances. The PLL model, grounded in the natural behavior of the operating system, is specifically designed to address the challenges posed by imbalanced components, a common occurrence in distribution systems. A comprehensive simulation is conducted, assessing the model’s response to three distinct scenarios, as illustrated in
Figure 7.
Initially, the PLL operates under ideal conditions, with pure voltage composed solely of the fundamental component. This baseline evaluation serves to validate the model’s performance when no imbalances are present. Following this, at t = 0.02 s, an imbalance is introduced to the system to assess the PLL’s ability to adapt and maintain accurate and stable operation. The simulation results show that the PLL continues to function effectively, with the distortion caused by the imbalance manifesting primarily in the direct- and quadrature-axis voltage components, and . This observation confirms the model’s ability to handle voltage imbalances while producing minimal distortion in the output voltages. Finally, at t = 0.08 s, the imbalance is removed from the system, allowing for the evaluation of the PLL’s response to the restoration of balanced conditions. The simulation demonstrates that the PLL promptly returns to smooth operation, reaffirming its adaptability and resilience in the face of varying operating conditions.
The case study under consideration was also subjected to tests involving the ordinary Phase-Locked Loop (PLL) to evaluate its performance and effectiveness under circumstances of imbalanced operational conditions. This meticulous examination was orchestrated to assess the resilience of the PLL when it encounters conditions that veer from the balanced state, thus testing the robustness of its design. The outcomes of the simulation are visually represented in
Figure 8. The graphic illustration provides a clear representation of the system’s behavior during and after the intrusion of the imbalanced component. A careful inspection of the figure reveals that the performance of the PLL begins to exhibit signs of deterioration immediately following the onset of the imbalanced component. This indicates that the system’s stability and efficiency are adversely affected by such disruptions.
In the specific context of operations under the influence of the imbalanced component, it is noteworthy that the PLL encounters difficulty in accurately detecting the fundamental frequency of the grid. This is a significant observation as it highlights the limitations of the PLL under non-ideal conditions. Furthermore, it is observed that, once the imbalanced component is eliminated from the system, the PLL is unable to revert to its normal operation. This suggests a lack of adaptive recovery mechanisms in the PLL to restore balance and resume normal functioning after the system experiences instability. This inability to self-correct and re-establish normal operating parameters underscores the need for further improvements in the design and control strategy of the PLL to enhance its resilience to imbalances and other operational anomalies.
5.2. Grid-Following Inverter
In this study, a grid-following Inverter-Based Resource (IBR) is employed to evaluate the effectiveness of the proposed approach. To establish a reliable comparison, parameters from [
23] are adopted, as presented in
Table 1. The system simulation is implemented using the Implicit Trapezoidal Method, a numerical integration technique discussed in a previous section. The Python-coded simulation results are illustrated in
Figure 9.
Figure 9 comprises several subplots, each representing various aspects of the inverter’s performance. The first subplot highlights the voltage at the AC side of the inverter, specifically at the Point of Common Coupling (PCC), which connects the inverter to the grid. As expected, during normal operation, the three-phase grid voltage remains balanced. The second subplot depicts the
-frame voltage corresponding to the three-phase grid voltage. The Phase-Locked Loop (PLL) accurately transforms the
-frame to the
-frame, as evidenced by the plot. The simulation of this part is modeled using Equation (
25).
The third subplot illustrates the grid angular frequency measured by the PLL. In the state–space model, the angular frequency is denoted by . The grid angle, represented by , is computed by integrating the limited angular frequency. While regular integrators can perform this integration, resettable integrators are necessary to restrict the angle range between 0 and .
The fifth subplot demonstrates the inverter current aligned to the d-axis and its reference. The active power, as explained in Equation (
8), is related to this current and can be primarily regulated using it. To assess the effectiveness of the control applied to
, the reference current,
, starts with a value of 0 and is changed to 1000 at t = 0.1 s. As observed in the plot, the response of
adequately follows its reference.
Similarly, the sixth subplot shows the inverter current that is aligned to the q-axis and its reference. The reactive power is associated with it,
, as in Equation (
8). Furthermore, its response is tested to validate the system control. The reference current,
, starts with a value of 0, and is then changed at t = 0.2 s to 2000. As displayed, the response appropriately changes and matches its reference.
5.3. Grid-Following Inverter under Grid Voltage and Frequency Variations
To evaluate the robustness of the system under investigation, we subjected it to a series of stress tests designed to mimic abnormal conditions which may realistically occur in an actual power system. This approach was undertaken with the intent of assessing how well the system could maintain its operational integrity under unexpected circumstances, a critical aspect of real-world system resilience. Among the various adverse conditions considered, we focused on two key events that frequently transpire in power grids: drops in voltage and frequency. These scenarios were carefully incorporated into our case study, the results of which are visually represented in
Figure 10.
In the conducted simulation, the inverter initially operates under normal conditions. However, at t = 0.08 s, we introduced a disruption by reducing the grid voltage to 85% of its nominal value. This sudden drop persisted until 0.2 s, at which point we allowed the grid to recover to its nominal voltage. The response of the designed PLL to this sudden change was prompt and effective. The PLL swiftly tracked the alteration in grid voltage and mirrored it in its DC values, thereby demonstrating its ability to respond to voltage variations. As depicted in
Figure 10, the PLL was also capable of restoring normal operation in sync with the grid recovery, further illustrating its adaptability and resilience.
Next, at t = 0.3 s, we implemented another disruption by altering the grid frequency from its standard 60 Hz to 59.95 Hz. This frequency variation lasted for a brief duration of 0.01 s. The impact of this frequency change was observable in the PLL output, primarily affecting the component. Despite these disturbances, the PLL demonstrated its robustness by swiftly regaining its normal state after a recovery period of 0.2 s. This rapid recovery underscores the PLL’s ability to maintain system stability and performance even under challenging conditions, thus confirming its efficacy and robustness in the face of real-world grid disturbances.