## 3 Off-board Charger Control
### VSM Control
#### 3.1.2 Behaviors of the Inertia and Damping  
Another core objective of the VSM is to enable the rectifier externally exhibit the inertia and damping of the SM, which is generally indicated by a simplified classic second-order model of an SM. The VSM rotor equation of motion can be described by the equation below.  
\[\left\{\begin{array}{l}J\frac{{\rm d}(\omega-\omega^{*})}{{\rm d}t}=\frac{P_ {\rm e}-P_{\rm m}}{\omega}-D(\omega-\omega_{\rm g})\\ \frac{{\rm d}\theta}{{\rm d}t}=\omega\end{array}\right. \tag{8}\]  
where: the inertia is given by \(J\); \(D\) represents the damping coefficient; \(P_{\rm e}\) is the electromagnetic power; \(P_{\rm m}\) is mechanical power; \(\omega\) is electrical angular velocity of the VSM; \(\omega^{*}\) is the rated angular frequency; \(\omega_{\rm g}\) is the grid angular frequency; \(\theta\) is the power angle.  
In order to connect the inertia and damping of the VSM (Equation (8)) with \(P_{\rm bat}\)-\(\omega\) droop control (Equation (7)) to comprise a power-frequency controller, there are two setting forms depending on whether losses are considered. If the efficiency of the conversion circuit is extremely high, the losses can be ignored. The relations are defined by Equation (9).  
\[\left\{\begin{array}{l}P_{\rm m}={I_{\rm bat}}^{*}\times U_{\rm bat}-(\omega^ {*}-\omega_{\rm g})/D_{\rm p}\\ P_{\rm e}=P_{\rm bat}\end{array}\right. \tag{9}\]  
If the efficiency is not neglected, assuming that we continue to use Equation (9), which will make the actual charging current slightly less than the set value, i.e., \({I_{\rm bat}}<{I_{\rm bat}}^{*}\). Thus, to strictly let \({I_{\rm bat}}={I_{\rm bat}}^{*}\), Equation (9) is amended as follows.  
\[\left\{\begin{array}{l}P_{\rm m}=\frac{1}{\eta}\times({I_{\rm bat}}^{*} \times U_{\rm bat}-(\omega^{*}-\omega_{\rm g})/D_{\rm p})\\ P_{\rm e}=P_{\rm bat}\end{array}\right. \tag{10}\]  
In the Equation (10), \(\eta\) is the efficiency coefficient which varies with power, whose expression is \(\eta=P_{\rm bat}/P\). \(P\) is not only the rectifier power but also the input power of the off-board charger. \(P_{\rm bat}\) represents the charging power of the power battery as well as the output power of the off-board charger.  
Equations (9) and (10) signify that the mechanical power \(P_{\rm m}\) is represented by the \(P_{\rm bat}\)-\(\omega\) droop control, and the electromagnetic power \(P_{\rm e}\) is denoted by real-time charging power \(P_{\rm bat}\) of the power battery.  
In addition to the power-frequency controller, Figure 3 also includes the excitation regulator and the stator voltage equation. The excitation regulator contains a closed-loop control between the \(Q\)-\(U\) droop (Equation (4)) and the AC voltage amplitude \(U_{\text{m}}\) of the rectifier. Electrical angle \(\theta\) of the power controller and \(E\) of the excitation regulator synthesize the three-phase excitation electromotive force \(e_{\text{abc}}\) through Equation (11).  
\[e_{\text{abc}}=\left[\begin{array}{c}E\sin\theta\\ E\sin(\theta-2\pi/3)\\ E\sin(\theta+2\pi/3)\end{array}\right] \tag{11}\]  
To enhance the stability and waveform quality of the VSM-based control system, the power outer-loop composed of the power-frequency controller and the excitation regulator requires to be combined with the inner-loop current controller by the stator voltage equation, which is illustrated by  
\[u_{\text{abc}}=e_{\text{abc}}+Ri_{\text{abc}}+L\frac{di_{\text{abc}}}{dt} \tag{12}\]  
The inductor \(L\) and resistance \(R\) in the LC filter are invoked as the synchronous reactance and armature resistance of the stator electrical equation. The inner-loop current controller provides the modulation index for SPVWM which generates the pulse signals of the rectifier switching transistor. Thus, the studied VSM can support the virtual inertia and damping for the grid during transient operation.