## 2 Implementation of VI-Based Inverters
### Synchrotron
\(\widetilde{\cos\theta}\) and \(\widetilde{\sin\theta}\) are vectors defined as the three-phase angle difference with equal spacing of \(120^{\circ}\) or \(2\pi/3\) in radian. \[T_{e}=M_{f}i_{f}\textless i,\widetilde{\sin\theta}> \tag{3}\]  
\[\mathrm{e}=\dot{\theta}M_{f}i_{f}\widetilde{\sin\theta} \tag{4}\]  
\[P=\dot{\theta}M_{f}i_{f}\textless i,\widetilde{\sin\theta}> \tag{5}\]  
\[Q=-\dot{\theta}M_{f}i_{f}\textless i,\widetilde{\cos\theta}> \tag{6}\]\[v=\left[ \begin{array}{c}v_{a}\\ v_{b}\\ v_{c}\end{array} \right]\! ;\;i=\left[ \begin{array}{c}i_{a}\\ i_{b}\\ i_{c}\end{array} \right]\! ;\;\;\widetilde{\cos\theta}=\left[ \begin{array}{c} \cos\theta\\ \cos\left(\theta-\frac{4\pi}{3}\right)\\ \cos\left(\theta-\frac{4\pi}{3}\right)\end{array} \right]\! ;\;\;\widetilde{\sin \theta}=\left[ \begin{array}{c}\sin\theta\\ \sin\left(\theta-\frac{4\pi}{3}\right)\\ \sin\left(\theta-\frac{4\pi}{3}\right)\end{array} \right] \tag{7}\]  
Equations (3), (4) and (6) are discretized and solved in each control cycle in a digital controller, including microcontroller unit (MCU) and digital signal processor (DSP) to generate the gating PWM signals. The inverter output current (i) and grid voltage (v) are the feedback signals to solve the differential equations within the controller. The parameters, including the moment of inertia (J) and damping factor (D), are tunable for desire condition. The selection of these parameters is important for the stability of the system. A PLL, also known as a sinusoid-locked loop, is a control system that maintains the synchronism of inverter with the terminal voltage. The early stage of synchronverter requires PLL for initial synchronization with the power grid. Once the converter is synchronized with the grid, the PLL is no longer required. However, the use of PLL causes instabilities and negative impact on the control performance in a weak grid. In addition, PLL exhibits higher computational complexity, the larger code size of the controller and longer TET. The phase detector or phase comparator is a key element of the PLL to an output voltage signal, which represents the difference in phase between two signal inputs. As illustrated in Figure 12, the general control scheme of a synchronverter is based on the APL and RPL which are derived from the swing equations of a SM. Equations (8) and (9) define the frequency droop and voltage droop, respectively. The mechanical torque (\(T_{m}\)) is a control input while the electromagnetic torque (\(T_{e}\)) depends on the \(i\) and \(\theta\). Hence, the state variables of the synchronverter are the following: \(i\) (the inductor currents), \(v\) (the capacitor voltages), \(\theta\) (virtual angle), and \(\theta\) (a virtual angular speed). The moment of inertia is denoted by \(J\), \(1/\)s is the integrator, \(D_{p}\) is the damping factor for active power loop, \(D_{q}\) is the damping factor for reactive power loop, \(K\) is the regulator coefficient of reactive power, \(Q_{SET}\) is the set point of reactive power, \(\partial_{r}\) is the reference angular velocity, \(\dot{\theta}_{m}\) is the measured feedback angular velocity, \(V_{r}\) is the reference r.m.s voltage, and \(V_{m}\) is the measured feedback grid voltage. \[\dot{\theta} =\frac{1}{Js}\left[T_{m}-T_{e}+D_{p}\;(\dot{\theta}_{r}-\dot{ \theta}_{m})\right] \tag{8}\]  
\[M_{f}\dot{r}_{f}=\frac{1}{K_{S}}\left[Q_{SET}-Q+D_{q}\;(V_{r}-V_{m})\right] \tag{9}\]  
In case of the absence of a neutral line, only two of the three currents in vector \(i\) are independent. Thus, the control inputs of the synchronverter are \(T_{m}\) and \(M_{f}\dot{r}_{i}\). To operate the synchronverter, the  
Figure 12: The general synchronverter control mechanism. controller is designated to generate the control signals \(T_{m}\) and \(M_{\textit{rf}}\) in a way that system stability is maintained and the desired values of real and reactive power are obeyed. The synchronverter is controlled by two (dual) channels, similar to the synchronous generator. The two channels are real power and reactive power.