Adaptive Armature Resistance Control of Virtual Synchronous Generators to Improve Power System Transient Stability

: The growing number of renewable energy plants connected to the power system through static converters have been pushing the development of new strategies to ensure transient stability of these systems. The virtual synchronous generator (VSG) emerged as a way to contribute to the system stabilization by emulating the behavior of traditional synchronous machines in the power converters operation. This paper proposes a modiﬁcation in the VSG implementation to improve its contribution to the power system transient stability. The proposal is based on the virtualization of the resistive superconducting fault current limiters’ (SFCL) behavior through an adaptive control that performs the VSG armature resistance change in short-circuit situations. A theoretical analysis of the problem is done based on the equal-area criterion, simulation results are obtained using PSCAD, and experimental results are obtained in a Hardware-In-the-Loop (HIL) test bench to corroborate the proposal. Results show an increase in the system transient stability margin, with an increase in the fault critical clearing time (CCT) for all virtual resistance values added by the adaptive control to the VSG operation during the short-circuit. control for the of VSG-based model used in the the of resistive SFCL short-circuit that SFCL virtualization through the proposed adaptive control can the stability of power systems with connected VSGs. A theoretical analysis is carried out, and the results are verified real-time simulation in a Hardware-in-the-loop environment. results show an in the system CCT with the proposed adaptive control for all R SFCL values. the results show that the increase in the CCT accompanies the increase in the R SFCL values, showing a characteristic of direct proportionality. The C-HIL results with the result, CCTs relative The is to show that SFCL the proposed adaptive control can improve the transient stability of power systems with connected VSGs. A theoretical analysis is carried out, and the results are veriﬁed through real-time simulation in a Hardware-in-the-loop environment. The results show an increase in the system CCT with the proposed adaptive control for all R SFCL values. Additionally, the results show that the increase in the CCT accompanies the increase in the R SFCL values, showing a characteristic of direct proportionality. The C-HIL results show compliance with the theoretical result, with both CCTs showing similar values with limited relative errors and RMSE. The analysis based on the EAC is corroborated by the results of angular speed and rotor angle, that point to damping in the VSG acceleration during the fault. The VSG voltages show the di ﬀ erence between instability and stability scenarios. It is possible to conclude that the adaptive control can improve the voltage response of the VSG at the end of the fault, by increasing the system transient stability margin.


Introduction
The technology development involved in the power system to process the generated and transmitted energy, especially with the large-scale use of static power converters, leads to a more significant concern with the power system stability. Among the problems that arise, rotor angle stability, or transient stability, appears with particular emphasis. The transient stability is defined by the ability of the power system, and the generators that comprise it, to remain in synchronism when subjected to a severe disturbance, such as a short-circuit in the transmission system. The loss of synchronism due to such instability is characterized by an aperiodic drift of rotor angle and speed [1]. The transient stability is highly dependent on some system characteristics, such as the generator's loading, fault location, fault clearing time, generator parameters such as inertia and reactances, transmission lines impedance, and system voltages magnitudes [1]. Therefore, considering these characteristics on which transient stability relies, several control techniques and design methods for power systems have been developed in order to improve their stability.
The use of superconducting materials is one of the most promising technologies for this application. One of the fundamental properties of superconducting materials is to limit the electrical current flow transient stability should be a viable approach. However, it is a known fact in the power system stability literature that a growth in system inertia and damping eventually leads to diminishing returns in the system critical clearing time (CCT). A saturation effect appears from a certain value of inertia onwards, and a further increase in CCT with the increase of generator inertia becomes impractical [24]. The novelty of this work is to address the transient stability using an adaptive control for armature resistance of VSG. At this moment, there is no VSG adaptive control in the literature concerning the transient stability of power systems for large-scale non-inertial renewable energy plants. Moreover, no adaptive control that involves the adaptation of the machine electrical windings modelling parameters has been proposed to this day.
In this paper, an adaptive control for VSG-based power converters is proposed based on the performance of resistive SFCLs to improve the power system transient stability. The control is based on the alteration of the VSG armature resistance in the adopted synchronous machine model. The effectiveness of the proposed control on the transient stability of a single machine infinite bus (SMIB) system is verified at first through a theoretical analysis, to determine the evolution of the fault critical clearing angle (CCA) and CCT of the system. The equal-area criterion (EAC) is applied to evaluate the CCA while a numerical solution of the system swing equation is used to determine the CCT. Additionally, a Hardware-in-the-loop (HIL) test bench and a PSCAD simulation are proposed, to determine the consistency of the theoretical results and present additional results for the proposed SMIB system. The results show an increase in the power system CCT that is consistent with an increase in the VSG virtual resistance, which confirms the improvement in power system transient stability with the adoption of the adaptive control proposed.
The structure of this paper is as follows. Section 2 presents a theoretical approach to the problem. Section 3 presents the proposed adaptive control and HIL test-bench. Section 4 presents a discussion about the results obtained and, finally, Section 5 presents the conclusions.

Transient Stability in SMIB System with Proposed Control-Theoretical Analysis
The SMIB system illustrated in Figure 1 is used to evaluate the effect of the proposed control on a power system in terms of transient stability.
Energies 2020, 13, x FOR PEER REVIEW 3 of 17 to improve transient stability should be a viable approach. However, it is a known fact in the power system stability literature that a growth in system inertia and damping eventually leads to diminishing returns in the system critical clearing time (CCT). A saturation effect appears from a certain value of inertia onwards, and a further increase in CCT with the increase of generator inertia becomes impractical [24]. The novelty of this work is to address the transient stability using an adaptive control for armature resistance of VSG. At this moment, there is no VSG adaptive control in the literature concerning the transient stability of power systems for large-scale non-inertial renewable energy plants. Moreover, no adaptive control that involves the adaptation of the machine electrical windings modelling parameters has been proposed to this day. In this paper, an adaptive control for VSG-based power converters is proposed based on the performance of resistive SFCLs to improve the power system transient stability. The control is based on the alteration of the VSG armature resistance in the adopted synchronous machine model. The effectiveness of the proposed control on the transient stability of a single machine infinite bus (SMIB) system is verified at first through a theoretical analysis, to determine the evolution of the fault critical clearing angle (CCA) and CCT of the system. The equal-area criterion (EAC) is applied to evaluate the CCA while a numerical solution of the system swing equation is used to determine the CCT. Additionally, a Hardware-in-the-loop (HIL) test bench and a PSCAD simulation are proposed, to determine the consistency of the theoretical results and present additional results for the proposed SMIB system. The results show an increase in the power system CCT that is consistent with an increase in the VSG virtual resistance, which confirms the improvement in power system transient stability with the adoption of the adaptive control proposed.
The structure of this paper is as follows. Section 2 presents a theoretical approach to the problem. Section 3 presents the proposed adaptive control and HIL test-bench. Section 4 presents a discussion about the results obtained and, finally, Section 5 presents the conclusions.

Transient Stability in SMIB System with Proposed Control -Theoretical Analysis
The SMIB system illustrated in Figure 1 is used to evaluate the effect of the proposed control on a power system in terms of transient stability. The system parameters are given in Table 1. In this system, the synchronous generator power is delivered to the infinite bus via two transmission lines whose impedance is ZL. The generator is  The system parameters are given in Table 1. In this system, the synchronous generator power is delivered to the infinite bus via two transmission lines whose impedance is Z L . The generator is connected to the transmission system via a transformer whose impedance is Z T . The impedance (Z G ) represents the generator transient impedance used in the transient stability analysis. E and V are the generator internal voltage and the infinite bus voltage, respectively. Table 1. System parameters for theoretical analysis.

Parameter Value
Line Impedance (Z L ) The system is subjected to a three-phase ground fault on the transformer bus. The system transient stability without the extra resistance is evaluated using the EAC. For this, the swing equation is given in Equation (1), and the system power-angle relation in Equation (2) [1]: where P e is the electrical power transmitted between bus 1 and 2, P m is the mechanical power in the generator shaft, δ is the generator rotor angle, ω is the angular speed, H is the inertia constant, D is the damping coefficient, Y is the system admittance matrix, Y 11 is the first-row and first-column complex term of matrix Y, Y 12 is the first-row and second-column complex term of matrix Y, and ϕ 12 is the angle of the complex term Y 12 . The admittance matrix for the pre-fault and post-fault system Y pre/post is calculated using Equation (3), and is used in conjunction with Equation (2) to plot the power-angle curve for the pre-fault system in the EAC analysis: During the fault, the generator electrical power becomes zero due to fault position and characteristic. After the fault clearing, the system topology is not altered and, therefore, the post-fault power-angle curve is the same for the pre-fault system. For this system configuration, the initial δ angle is equal to 0.6467 rad, while the CCA found using EAC is equal to 1.255 rad.
The proposed adaptation for the armature resistance works by adding an extra resistance in the virtual armature circuit of the VSG, as indicated in Figure 1b. In this scenario, for the pre-fault and post-fault systems, there is no extra resistance added. Therefore, the system admittance matrix is the same as in Equation (3). In contrast, during the fault occurrence, the extra resistance cannot be neglected and is considered in the calculation of the admittance matrix. The power-angle equation for the system during the fault is given by Equation (4) when considering this extra resistance [4]: where x G e x T are the imaginary parts of the generator and transformer impedances. Due to the presence of a three-phase fault in the transformer bus, the admittance between buses 1 and 2 (Y 12 ) is nulled, and the second term of Equation (2) is zero. Consequently, the power-angle equation is dependent only on the real part of Y 11 , which in turn can no longer be neglected due to the presence of the SFCL resistance. Figure 2 shows the modification of the power-angle curves for different values of SFCL resistance.
Energies 2020, 13, x FOR PEER REVIEW 5 of 17 the presence of the SFCL resistance. Figure 2 shows the modification of the power-angle curves for different values of SFCL resistance. The acceleration areas for CCT in Figure 2 are defined by the areas between points ADGF (for = 0.03 p.u.), ACJI (for = 0.06 p.u.), and ABML (for = 0.10 p.u.). The deceleration areas are defined by the areas between points FEN (for = 0.03 p.u.), IHN (for = 0.06 p.u.), and LKN (for = 0.10 p.u.). In Figure 2, it is possible to observe that, with an increase in the resistance added during the fault, there is a gradual decrease in the acceleration area as the machine shaft acceleration is dampened. The added resistance is responsible for partially absorbing the extra energy injected in the generator shaft during the fault. Consequently, the machine rotor acceleration is dampened, and an increase in the CCA occurs. With the increase in CCA, the system remains in synchronism for a longer time, increasing its stability margin. Figure   The acceleration areas for CCT in Figure 2 are defined by the areas between points ADGF (for R SFCL = 0.03 p.u.), ACJI (for R SFCL = 0.06 p.u.), and ABML (for R SFCL = 0.10 p.u.). The deceleration areas are defined by the areas between points FEN (for R SFCL = 0.03 p.u.), IHN (for R SFCL = 0.06 p.u.), and LKN (for R SFCL = 0.10 p.u.). In Figure 2, it is possible to observe that, with an increase in the resistance added during the fault, there is a gradual decrease in the acceleration area as the machine shaft acceleration is dampened. The added resistance is responsible for partially absorbing the extra energy injected in the generator shaft during the fault. Consequently, the machine rotor acceleration is dampened, and an increase in the CCA occurs. With the increase in CCA, the system remains in synchronism for a longer time, increasing its stability margin.  the presence of the SFCL resistance. Figure 2 shows the modification of the power-angle curves for different values of SFCL resistance. The acceleration areas for CCT in Figure 2 are defined by the areas between points ADGF (for = 0.03 p.u.), ACJI (for = 0.06 p.u.), and ABML (for = 0.10 p.u.). The deceleration areas are defined by the areas between points FEN (for = 0.03 p.u.), IHN (for = 0.06 p.u.), and LKN (for = 0.10 p.u.). In Figure 2, it is possible to observe that, with an increase in the resistance added during the fault, there is a gradual decrease in the acceleration area as the machine shaft acceleration is dampened. The added resistance is responsible for partially absorbing the extra energy injected in the generator shaft during the fault. Consequently, the machine rotor acceleration is dampened, and an increase in the CCA occurs. With the increase in CCA, the system remains in synchronism for a longer time, increasing its stability margin.    The value of 0.16 p.u. is adopted as a limit because, at this point, the acceleration area A 1 in the equal-area criterion is null, and CCA value equals the maximum angle for stability at 2.538 rad. The CCT is determined using the numerical solution of Equation (1), applying the fourth-order Runge-Kutta method. Figure 3 also shows the growth of CCT with the increasing SFCL resistance. It is possible to observe an improvement in system stability margin with the increase in R SFCL , as observed for the CCA. For example, through the graph shown in Figure 3, the potential for increasing the CCT can be observed, since for an SFCL impedance of 0.1 p.u., a 100% increase in CCT is verified.

Proposed Adaptive Control and System Description
In this section, a modification in the VSG control loops to include the adaptive armature resistance characteristic will be discussed. The synchronous machine model used in the VSG will be presented along with the power converter used. Then, this section will present the system used to validate the theoretical stability analysis discussed in the previous section. For this purpose, a HIL test-bench, with the VSG control embedded on a microcontroller platform, is used.

Machine Model Used in the VSG Control
Several VSG implementations can be found in the literature with different names and features, but the emulation of the inertial electromechanical characteristic of synchronous machines is common to every implementation. Therefore, the development of a VSG control naturally implicates the use of the machine's swing equation, Equation (1), in the active power control loop of the converter. Moreover, for the emulation of the machine windings electromagnetic behavior, a proper model must be adopted. In this paper, a two-axis model with transient and sub transient dynamics will be used [24]. Equations (5)-(8) are used to model the flux behavior in the machine windings: Then, the transient voltages E are used to calculate the reference VSG voltages in Equations (9) and (10): The output electrical power P e needed in the swing Equation in (1) is determined by Equation (11): In Equations (5)-(11), X d and X q are the synchronous reactances, X d and X q are the transient reactances, Additional control loops are used to adjust the VSG response during start-up and synchronization before the fault occurs to keep it running in steady-state. A loop to regulate the virtual machine excitation and its voltage is used, while a second loop performs angular speed and frequency regulation. Equation (12) is adopted to serve as the speed governor loop in this paper [25]: where P Re f is the VSG active power setpoint, f n is the system nominal frequency in Hz, ω represents the VSG angular speed in p.u., and D p is the frequency droop gain. The automatic voltage regulator (AVR) used is based on the DC1A excitation system defined in [26]. However, a simplified version is used by neglecting the over-excitation and under-excitation protections along with the exciter saturation effects. As a result, the system is comprised of a voltage regulator loop, a stabilization feedback loop, and the exciter model. The AVR used is shown in Figure 4, where T A and K A are the voltage regulator time constant and gain, V Rmax and V Rmin are the voltage regulator saturation limits, V re f is the VSG voltage setpoint, V t is the VSG measured terminal voltage, and T F and K F are the feedback loop time constant and gain. The exciter is represented by a first-order loop, where T E and K E represents its time constant and gain. When the fault is applied to the system, these regulation loops are removed, so that the CCT found is dependent only on the machine's inertia constant and the adaptive control applied.
Energies 2020, 13, x FOR PEER REVIEW 7 of 17 virtual machine excitation and its voltage is used, while a second loop performs angular speed and frequency regulation. Equation (12) is adopted to serve as the speed governor loop in this paper [25]: where is the VSG active power setpoint, is the system nominal frequency in Hz, represents the VSG angular speed in p.u., and is the frequency droop gain. The automatic voltage regulator (AVR) used is based on the DC1A excitation system defined in [26]. However, a simplified version is used by neglecting the over-excitation and under-excitation protections along with the exciter saturation effects. As a result, the system is comprised of a voltage regulator loop, a stabilization feedback loop, and the exciter model. The AVR used is shown in Figure  4, where and are the voltage regulator time constant and gain, á and are the voltage regulator saturation limits, is the VSG voltage setpoint, is the VSG measured terminal voltage, and and are the feedback loop time constant and gain. The exciter is represented by a first-order loop, where and represents its time constant and gain. When the fault is applied to the system, these regulation loops are removed, so that the CCT found is dependent only on the machine's inertia constant and the adaptive control applied.

Proposed Adaptive Control Strategy
As seen in the previous section, this resistance added in series with the stator of synchronous generators can increase the system transient stability margin. Therefore, the armature resistance used to calculate the VSG terminal voltages in Equations (9) and (10) will follow Equation (13): where is the original steady-state VSG armature resistance, and is the virtual SFCL resistance added when a fault occurs.
In the moments before and after a fault in the system, will be small to maintain the VSG operating in steady-state. The resistance value is raised to ( + ) during the occurrence of the fault. A fault detection algorithm is derived to allow the adaptive control to know the correct time to perform the resistance change. For this purpose, a simple scheme is proposed, in which the voltage dip during the fault is used as a pattern for detection. A voltage threshold is used so that when the fault is applied and the voltage magnitude drops below this value, the adaptive control changes the virtual resistance in the VSG adaptative resistance control. The resistance returns to its normal operation value when the voltage magnitude rises above this threshold. Figure 5 shows the complete adopted VSG diagram, with the speed and AVR regulators combined with the machine model with the proposed adaptive control.
In Figure 5, represents the VSG output phase currents, and represents the VSG output voltages measured after the LCL filter. These measurements are transformed using the Park transformation, with the internal machine angle as the angular reference. The output of the calculated terminal voltages and are fed into a proportional-integral control loop (PI) to adjust the VSG output voltage. A positive feedback is implemented after the PI control loop using

Proposed Adaptive Control Strategy
As seen in the previous section, this resistance added in series with the stator of synchronous generators can increase the system transient stability margin. Therefore, the armature resistance used to calculate the VSG terminal voltages in Equations (9) and (10) will follow Equation (13): where R 0 is the original steady-state VSG armature resistance, and R SFCL is the virtual SFCL resistance added when a fault occurs.
In the moments before and after a fault in the system, R a will be small to maintain the VSG operating in steady-state. The resistance value is raised to (R 0 + R SFCL ) during the occurrence of the fault. A fault detection algorithm is derived to allow the adaptive control to know the correct time to perform the resistance change. For this purpose, a simple scheme is proposed, in which the voltage dip during the fault is used as a pattern for detection. A voltage threshold is used so that when the fault is applied and the voltage magnitude drops below this value, the adaptive control changes the virtual resistance in the VSG adaptative resistance control. The resistance returns to its normal operation value when the voltage magnitude rises above this threshold. Figure 5 shows the complete adopted VSG diagram, with the speed and AVR regulators combined with the machine model with the proposed adaptive control.
In Figure 5, i abc represents the VSG output phase currents, and v abc represents the VSG output voltages measured after the LCL filter. These measurements are transformed using the Park transformation, with the internal machine angle δ as the angular reference. The output of the calculated terminal voltages V tq and V td are fed into a proportional-integral control loop (PI) to adjust the VSG

System Description for HIL Validation
In order to validate the theoretical analysis previously presented, a real-time simulation testbench is proposed in a HIL environment. This technique involves simulating part of the system in real-time while another part remains an original part of the system. The VSG power electronics converter and the SMIB power system are simulated in real time in the Typhoon HIL environment, while the converter controller is implemented in the dSPACE microcontroller, the same way as in a real application. This type of HIL implementation is usually called control Hardware-in-the-loop (C-HIL) [27]. In this paper, the power system is simulated in real-time by the HIL module, as indicated in the red box in Figure 6. In the meantime, the VSG control strategy, including the proposed adaptation, will be embedded on a micro-controlled platform, indicated by the blue box in Figure 6. The parameters used in the simulations are the same already defined in Table 1, with the addition of parameters shown in Table 2. The power system consists of a two-level, three-phase inverter with an LCL output filter, along with a transmission system consisting of a transformer, transmission lines and an infinite bus. The switching technique used to generate the converter gate signals is the Sinusoidal Pulse Width Modulated (SPWM).

System Description for HIL Validation
In order to validate the theoretical analysis previously presented, a real-time simulation test-bench is proposed in a HIL environment. This technique involves simulating part of the system in real-time while another part remains an original part of the system. The VSG power electronics converter and the SMIB power system are simulated in real time in the Typhoon HIL environment, while the converter controller is implemented in the dSPACE microcontroller, the same way as in a real application. This type of HIL implementation is usually called control Hardware-in-the-loop (C-HIL) [27]. In this paper, the power system is simulated in real-time by the HIL module, as indicated in the red box in Figure 6. In the meantime, the VSG control strategy, including the proposed adaptation, will be embedded on a micro-controlled platform, indicated by the blue box in Figure 6.

System Description for HIL Validation
In order to validate the theoretical analysis previously presented, a real-time simulation testbench is proposed in a HIL environment. This technique involves simulating part of the system in real-time while another part remains an original part of the system. The VSG power electronics converter and the SMIB power system are simulated in real time in the Typhoon HIL environment, while the converter controller is implemented in the dSPACE microcontroller, the same way as in a real application. This type of HIL implementation is usually called control Hardware-in-the-loop (C-HIL) [27]. In this paper, the power system is simulated in real-time by the HIL module, as indicated in the red box in Figure 6. In the meantime, the VSG control strategy, including the proposed adaptation, will be embedded on a micro-controlled platform, indicated by the blue box in Figure 6. The parameters used in the simulations are the same already defined in Table 1, with the addition of parameters shown in Table 2. The power system consists of a two-level, three-phase inverter with an LCL output filter, along with a transmission system consisting of a transformer, transmission lines and an infinite bus. The switching technique used to generate the converter gate signals is the Sinusoidal Pulse Width Modulated (SPWM). The parameters used in the simulations are the same already defined in Table 1, with the addition of parameters shown in Table 2. The power system consists of a two-level, three-phase inverter with an LCL output filter, along with a transmission system consisting of a transformer, transmission lines and an infinite bus. The switching technique used to generate the converter gate signals is the Sinusoidal Pulse Width Modulated (SPWM). A Typhoon HIL 402 module is responsible for the real-time simulation of the power system part of the test-bench. Meanwhile, VSG control is calculated on a dSPACE DS1104 R&D controller. The power system variables, such as voltages and currents at the VSG point of connection, are extracted and sent to the dSPACE controller, through the analog outputs of the HIL 402, to the ADC inputs of DS1104. The DS1104 platform calculates the VSG model, and the pulse width modulation (PWM) signals are sent to the digital inputs of the HIL 402. The signals interface between HIL402 and DS1104 controller is accomplished by a breakout board, which distributes the HIL402 input and output signals into snap-in connectors for easy access. Figure 7 illustrates the connection diagram between the DS1104 and the HIL 402. Figure 8 shows the test-bench used.  A Typhoon HIL 402 module is responsible for the real-time simulation of the power system part of the test-bench. Meanwhile, VSG control is calculated on a dSPACE DS1104 R&D controller. The power system variables, such as voltages and currents at the VSG point of connection, are extracted and sent to the dSPACE controller, through the analog outputs of the HIL 402, to the ADC inputs of DS1104. The DS1104 platform calculates the VSG model, and the pulse width modulation (PWM) signals are sent to the digital inputs of the HIL 402. The signals interface between HIL402 and DS1104 controller is accomplished by a breakout board, which distributes the HIL402 input and output signals into snap-in connectors for easy access. Figure 7 illustrates the connection diagram between the DS1104 and the HIL 402. Figure 8 shows the test-bench used.   The test-bench supervision and the results acquisition are done through the supervisory control and data acquisition (SCADA) platform provided by both HIL402 and DS1104 software packages. A trigger signal is generated in the real-time simulator environment to synchronize the data logging of system variables, for future analysis and use in the manuscript results section. After the data acquisition, the results were plotted in graphs using the MATLAB software. Finally, oscilloscope curves were obtained from the power part, simulated in real time through the BNC connectors present in the HIL breakout board.

Results and Discussion
The system proposed in the previous section was simulated in a HIL environment, in order to verify the results found in the theoretical analysis made in Section 2. Thus, the HIL test-bench goal is to check if an increase in simulated CCT follows the adoption of the proposed adaptive control, thus proving its contribution to enhancing the system transient stability. Ergo, as proposed in the theoretical analysis, the CCT of the HIL test bench is checked for different values. The system is simulated for values ranging from 0.0 p.u. to 0.16 p.u., with a step of 0.01 p.u. For each value simulated, the CCT is found through repeated simulations in HIL, adjusting the fault time until the maximum fault time in which the system maintains synchronism. In order to shorten the process of finding the CCT, the theoretical CCT found is used as a starting point, and the bisection method is adopted with an accuracy of 1 ms. Altogether, 10 real-time simulations were performed on average to find the CCT in each scenario, which represents an average of 170 simulations performed for all scenarios. Simulation results were obtained using PSCAD software, to validate the theoretical analysis and to compare with the C-HIL results. The PSCAD simulates both power electronics and the proposed control strategy, while C-HIL has the control embedded in a microcontroller platform. By using an external digital controller, the C-HIL presents a gain in fidelity in relation to the purely simulated approach. The results for the system CCT with the adaptive VSG control is shown in Figure  9. The test-bench supervision and the results acquisition are done through the supervisory control and data acquisition (SCADA) platform provided by both HIL402 and DS1104 software packages. A trigger signal is generated in the real-time simulator environment to synchronize the data logging of system variables, for future analysis and use in the manuscript results Section 4. After the data acquisition, the results were plotted in graphs using the MATLAB software. Finally, oscilloscope curves were obtained from the power part, simulated in real time through the BNC connectors present in the HIL breakout board.

Results and Discussion
The system proposed in the previous section was simulated in a HIL environment, in order to verify the results found in the theoretical analysis made in Section 2. Thus, the HIL test-bench goal is to check if an increase in simulated CCT follows the adoption of the proposed adaptive control, thus proving its contribution to enhancing the system transient stability. Ergo, as proposed in the theoretical analysis, the CCT of the HIL test bench is checked for different R SFCL values. The system is simulated for R SFCL values ranging from 0.0 p.u. to 0.16 p.u., with a step of 0.01 p.u. For each R SFCL value simulated, the CCT is found through repeated simulations in HIL, adjusting the fault time until the maximum fault time in which the system maintains synchronism. In order to shorten the process of finding the CCT, the theoretical CCT found is used as a starting point, and the bisection method is adopted with an accuracy of 1 ms. Altogether, 10 real-time simulations were performed on average to find the CCT in each scenario, which represents an average of 170 simulations performed for all scenarios. Simulation results were obtained using PSCAD software, to validate the theoretical analysis and to compare with the C-HIL results. The PSCAD simulates both power electronics and the proposed control strategy, while C-HIL has the control embedded in a microcontroller platform. By using an external digital controller, the C-HIL presents a gain in fidelity in relation to the purely simulated approach. The results for the system CCT with the adaptive VSG control is shown in Figure 9. A detailed comparison between C-HIL and theoretical CCT is presented in Table 3, showing the CCT relative error for individual scenarios and the root mean square error (RMSE) considering all scenarios.  A detailed comparison between C-HIL and theoretical CCT is presented in Table 3, showing the CCT relative error for individual R SFCL scenarios and the root mean square error (RMSE) considering all scenarios. The results revealed an increase in CCT when increasing the virtual resistance added. In particular, it is possible to observe an increase of 470 ms between the CCT for the highest value of R SFCL , in real time C-HIL and the VSG, without changing the armature resistance in its model. This event represents a 346% increase in CCT and, therefore, in the power system stability margin. So, the results obtained through the real-time C-HIL corroborate the theoretical and PSCAD simulations analysis carried out, showing a consistent increase in the CCT with the increase in R SFCL . The curves shown in Figure 9 reveal the same shape across the entire range of R SFCL . A deviation between theoretical and simulated results (C-HIL and PSCAD) is observed, beginning at R SFCL = 0.10 p.u. This could be explained mainly by the fact that, in the theoretical analysis, a simplified model of the machine is used to numerically determine the critical clearing angle and time. The machine model used in the VSG implementation is a high order model that includes both the swing equation and the machine winding modelling. The ack of fidelity in the model used in the theoretical analysis becomes noticeable when near the system stability boundary. However, the relative errors shown in Table 3 indicate a bounded error along the entire range of R SFCL values, reaching a maximum of 16% at the R SFCL limit. Further, the small RMSE calculated confirms the proximity between theoretical, PSCAD simulation and HIL CCT curves. Hence, the present results demonstrate that, although a real SFCL is not present in the system, its virtualized behavior in the VSG causes the contribution to the transient stability enhancement to be included in the system operation.
Similar results concerning the increase of CCT could be obtained for an adaptation of the inertia constant. Using the CCT as a figure of merit (FOM), a comparison between both parameter adaptation methods can be presented. Figure 10 shows the theoretical CCT for an inertia constant H variation between 1.0 p.u. and 20.0 p.u., while not adding any extra resistance in the VSG armature circuit. The CCA does not change, because the inertia variation does not affect the system power-angle curves. Nonetheless, the change in inertia implicates in the swing equation resolution, leading to slower dynamics and a reduced machine acceleration during a fault, therefore increasing CCT. However, as discussed in the Introduction Section 1, the relation of CCT and inertia has a saturation characteristic, which eventually leads to diminishing returns in CCT with the rise in the inertia constant H value. This saturation characteristics is shown in Figure 10, beginning at around H = 10.0 p.u. From this point, an increase in inertia leads to diminishing returns in CCT, which leads to a maximum practical CCT between 300 ms and 400 ms. Meanwhile, the maximum theoretical CCT achieved by the proposed resistance adaptive control is 787 ms. Therefore, this result shows an advantage of the control strategy proposed in this paper due to its wider range of CCT.
Similar results concerning the increase of CCT could be obtained for an adaptation of the inertia constant. Using the CCT as a figure of merit (FOM), a comparison between both parameter adaptation methods can be presented. Figure 10 shows the theoretical CCT for an inertia constant variation between 1.0 p.u. and 20.0 p.u., while not adding any extra resistance in the VSG armature circuit. The CCA does not change, because the inertia variation does not affect the system power-angle curves. Nonetheless, the change in inertia implicates in the swing equation resolution, leading to slower dynamics and a reduced machine acceleration during a fault, therefore increasing CCT. However, as discussed in the Introduction section, the relation of CCT and inertia has a saturation characteristic, which eventually leads to diminishing returns in CCT with the rise in the inertia constant value. This saturation characteristics is shown in Figure 10, beginning at around = 10.0 p.u. From this point, an increase in inertia leads to diminishing returns in CCT, which leads to a maximum practical CCT between 300 ms and 400 ms. Meanwhile, the maximum theoretical CCT achieved by the proposed resistance adaptive control is 787 ms. Therefore, this result shows an advantage of the control strategy proposed in this paper due to its wider range of CCT. The VSG behavior for angular speed and rotor angle can be analyzed to confirm the improvement in stability. For this analysis, the fault clearing time is kept constant at 250 ms, and the system is simulated in real-time for different values. Figure 11 shows the rotor angular speed for the VSG in this situation, while Figure 12 shows the behavior of the rotor angle. The fault is applied in 0.5 s and extinguished at 0.75 s. The VSG behavior for angular speed and rotor angle can be analyzed to confirm the improvement in stability. For this analysis, the fault clearing time is kept constant at 250 ms, and the system is simulated in real-time for different R SFCL values. Figure 11 shows the rotor angular speed for the VSG in this situation, while Figure 12 shows the behavior of the rotor angle. The fault is applied in 0.5 s and extinguished at 0.75 s.     From the curve in Figure 11, it is possible to observe that the higher the resistance added into the VSG model during the fault, the lower the maximum speed reached by the machine at the fault clearing time. The acceleration of the VSG virtual rotor is not as steep in scenarios where adaptive control acts by increasing the resistance parameter. In other words, the extra energy injected into the machine's rotor in the short-circuit is reduced. This result serves to corroborate the increase in CCT shown in Figure 9, proving the contribution of the proposed control to the system transient stability enhancement. Figure 11 demonstrates the increment of CCA with the increase of found through the EAC. The rotor acceleration is reduced, and the angular displacement is lower at the end of the fault. As a result, the system can reach higher levels of angular separation without hitting the critical energy absorption point. Figure 12 also shows that, for a higher resistance added by the adaptive control, more restrained are the angular oscillations, which is reflected in a dampened active power response after the fault clearance. This drives the system to lower settling times for the postfault VSG dynamic response. It is worth noting that the base for the angular speed, represented in Figure 11, is defined by the system nominal frequency in radians per second, in this case 376.99 rad/s. The initial value of rotor angle, shown in Figure 12, is related to the initial machine angle for steady state, calculated in Section 2 by the EAC as 0.6467 rad.
Additionally, the phase plane shown in Figure 13 can be used to condense the results exhibited in Figures 11 and 12. A phase plane is a graphical tool that allows visualization of the system trajectory in fault situations. In cases where the system remains stable after the fault is cleared, it is possible to observe in Figure 13 that the system trajectory remains bounded and moves towards a new equilibrium point. The trajectory is more restrained at both speed and angle axis for higher values of resistance. However, when the system loses synchronism after the fault ( = 0.05 p.u., From the curve in Figure 11, it is possible to observe that the higher the resistance added into the VSG model during the fault, the lower the maximum speed reached by the machine at the fault clearing time. The acceleration of the VSG virtual rotor is not as steep in scenarios where adaptive control acts by increasing the resistance parameter. In other words, the extra energy injected into the machine's rotor in the short-circuit is reduced. This result serves to corroborate the increase in CCT shown in Figure 9, proving the contribution of the proposed control to the system transient stability enhancement. Figure 11 demonstrates the increment of CCA with the increase of R SFCL found through the EAC. The rotor acceleration is reduced, and the angular displacement is lower at the end of the fault. As a result, the system can reach higher levels of angular separation without hitting the critical energy absorption point. Figure 12 also shows that, for a higher resistance added by the adaptive control, more restrained are the angular oscillations, which is reflected in a dampened active power response after the fault clearance. This drives the system to lower settling times for the post-fault VSG dynamic response. It is worth noting that the base for the angular speed, represented in Figure 11, is defined by the system nominal frequency in radians per second, in this case 376.99 rad/s. The initial value of rotor angle, shown in Figure 12, is related to the initial machine angle δ for steady state, calculated in Section 2 by the EAC as 0.6467 rad. Additionally, the phase plane shown in Figure 13 can be used to condense the results exhibited in Figures 11 and 12. A phase plane is a graphical tool that allows visualization of the system trajectory in fault situations. In cases where the system remains stable after the fault is cleared, it is possible to observe in Figure 13 that the system trajectory remains bounded and moves towards a new equilibrium point. The trajectory is more restrained at both speed and angle axis for higher values of resistance. However, when the system loses synchronism after the fault (R SFCL = 0.05 p.u., for example), the trajectory of the system exits the stability region on an infinite movement. The phase plane is commonly compared to a sphere inside a bowl problem [1]. An injection of energy in the ball starts its movement towards the bowl edge. When the energy injected is sufficient to make the sphere drop out of the bowl, the system is called unstable.
The parallel could be made to the power system stability by defining the sphere as the generator or the VSG, and the bowl is represented in a two-dimensional system by the rotor speed and angle, like the phase plane. When sufficient energy is added to the generator axis, the system is not able to absorb it, and the generator trajectory represented in the phase plane escapes from the bounded stability region. In the case regarding the adaptive control proposed, the extra virtual resistance is capable of absorbing part of the energy injected in the VSG virtual rotor, restricting its movement inside the stability region.
The parallel could be made to the power system stability by defining the sphere as the generator or the VSG, and the bowl is represented in a two-dimensional system by the rotor speed and angle, like the phase plane. When sufficient energy is added to the generator axis, the system is not able to absorb it, and the generator trajectory represented in the phase plane escapes from the bounded stability region. In the case regarding the adaptive control proposed, the extra virtual resistance is capable of absorbing part of the energy injected in the VSG virtual rotor, restricting its movement inside the stability region.  Figure 14 shows the system line voltage for a 250 ms fault and = 0.0 p.u. Figure 15 shows two scenarios for non-zero values. Figure 15 (a) presents a scenario in which the system remains stable for = 0.06 p.u., while Figure  15 (b) shows the stable system for = 0.1 p.u. It can be observed in Figure 14 that the voltage collapses shortly after the end of the fault, indicating the system instability for these conditions. For the C-HIL scenario shown in Figure 14, where = 0.0 p.u., the CCT defining the stability limit is 191 ms, as presented in Table 3. In contrast, Figure 15 (a) and (b) show a disposition for the VSG voltage to return to nominal values. In particular, for the situation in Figure 15 (b) where = 0.1 p.u., the VSG voltage after the fault has a faster settling time, and returns more quickly to a steady-state level. Moreover, the maximum voltage overshoot reached at the time of fault clearance for = 0.1 p.u. is lower compared to the VSG with = 0.06 p.u. In the first case, the voltage reaches 504 V when the fault is cleared, while for the second scenario the voltage reaches a maximum of 440 V. Both C-HIL scenarios in Figure 15 presented post-fault stability, due to their higher CCTs provided by the adaptive control. For the scenario in Figure 15 (a), the stability boundary is defined by a CCT of 261 ms. Meanwhile, the scenario shown by Figure 15 (b) has a stability boundary defined by a CCT of 355 ms. Both results are shown in Table 3.  Figure 14 shows the system line voltage for a 250 ms fault and R SFCL = 0.0 p.u. Figure 15 shows two scenarios for non-zero R SFCL values. Figure 15a presents a scenario in which the system remains stable for R SFCL = 0.06 p.u., while Figure 15b shows the stable system for R SFCL = 0.1 p.u. Eventually, if a control strategy such as the one proposed in this paper is implemented in a real power system, its interaction with the system protection devices must be carefully addressed. For example, the actuation time of overcurrent relays used to remove a faulted line, which usually consider the CCT for their coordination, must now be aware of the proposed control dynamics. The Eventually, if a control strategy such as the one proposed in this paper is implemented in a real power system, its interaction with the system protection devices must be carefully addressed. For example, the actuation time of overcurrent relays used to remove a faulted line, which usually consider the CCT for their coordination, must now be aware of the proposed control dynamics. The It can be observed in Figure 14 that the voltage collapses shortly after the end of the fault, indicating the system instability for these conditions. For the C-HIL scenario shown in Figure 14, where R SFCL = 0.0 p.u., the CCT defining the stability limit is 191 ms, as presented in Table 3. In contrast, Figure 15a,b show a disposition for the VSG voltage to return to nominal values. In particular, for the situation in Figure 15b where R SFCL = 0.1 p.u., the VSG voltage after the fault has a faster settling time, and returns more quickly to a steady-state level. Moreover, the maximum voltage overshoot reached at the time of fault clearance for R SFCL = 0.1 p.u. is lower compared to the VSG with R SFCL = 0.06 p.u. In the first case, the voltage reaches 504 V when the fault is cleared, while for the second scenario the voltage reaches a maximum of 440 V. Both C-HIL scenarios in Figure 15 presented post-fault stability, due to their higher CCTs provided by the adaptive control. For the scenario in Figure 15a, the stability boundary is defined by a CCT of 261 ms. Meanwhile, the scenario shown by Figure 15b has a stability boundary defined by a CCT of 355 ms. Both results are shown in Table 3.
Eventually, if a control strategy such as the one proposed in this paper is implemented in a real power system, its interaction with the system protection devices must be carefully addressed. For example, the actuation time of overcurrent relays used to remove a faulted line, which usually consider the CCT for their coordination, must now be aware of the proposed control dynamics. The operation of out-of-step protection functions and distance relays are also of special importance when dealing with transient improving control strategies. On the other hand, an adaptive control that improves CCT in a power system could be used in a preventive scheme, to maintain the fault critical time in a fixed value for different generator loading levels, and system topology during the day.

Conclusions
This paper presents a new adaptive control strategy for the control of VSG-based power converters. An alteration in the synchronous machine model used in the VSG implementation is made in order to incorporate the behavior of resistive SFCL in short-circuit situations. With this, the VSG's armature resistance parameter is modified to virtualize the SFCL dynamics. The objective is to show that SFCL virtualization through the proposed adaptive control can improve the transient stability of power systems with connected VSGs. A theoretical analysis is carried out, and the results are verified through real-time simulation in a Hardware-in-the-loop environment.
The results show an increase in the system CCT with the proposed adaptive control for all R SFCL values. Additionally, the results show that the increase in the CCT accompanies the increase in the R SFCL values, showing a characteristic of direct proportionality. The C-HIL results show compliance with the theoretical result, with both CCTs showing similar values with limited relative errors and RMSE. The analysis based on the EAC is corroborated by the results of angular speed and rotor angle, that point to damping in the VSG acceleration during the fault. The VSG voltages show the difference between instability and stability scenarios. It is possible to conclude that the adaptive control can improve the voltage response of the VSG at the end of the fault, by increasing the system transient stability margin.
The increase in CCT demonstrates the improvement in the system transient stability margin and, since this is achieved by virtualizing the behavior of a physical device, the proposed adaptive control shows that it can contribute to improving the stability of the system without the need to change its topology.