# Optimal Design and Control of MMC STATCOM for Improving Power Quality Indicators
## 7 Results and Discussion
### Nonlinear Load Case Study  
For the simulation purpose, a dedicated software program for the optimal estimation of the capacitor value, \(K_{\text{P}}\) and \(K_{\text{i}}\), is developed in MATLAB/Simulink. The results of the proposed methods are compared with those of the conventional particle swarm optimization (PSO) [37; 38; 39]. The design parameters and the limits of the optimized variables are identical for the all optimization techniques proposed in this paper. The end value of iterations has been adjusted at 10 iterations and the search agents are proposed to be 10 agents. The convergence curves of the optimization algorithms are shown in Figure 13. The detailed results of the optimization process for ASO, HHO and PSO are summarized in Table 3. As shown from Figure 13, the HHO algorithm reached the optimum values of the capacitors and coefficients for the PI controllers within two iterations, and ASO reached the best value of the fitness function after four iterations. While the conventional PSO algorithm is the slowest among them, moreover, its finding of the best value of the fitness function (\(F\)) is achieved after eight iterations, and it is worse than that with the HHO and ASO. Both of the proposed algorithms were able to obtain convergent results and satisfactory results to improve the voltage and reduce the THD of the current in the studied network, but HHO reached the optimum solution in less time. The optimal values for the capacitors of MMC and PI controller constants obtained using HHO and ASO have been applied to the network under study. The profile of the MMC DC voltage for both algorithms is shown in Figure 14, where it can be noticed that stability of the DC voltage is achieved in both cases. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Algorithm**} & \multirow{2}{*}{**C**} & **Ki\_VDC** & **Kp\_VDC** & **Ki\_VDC** & **Kp\_VDC** & **Kp\_VDC** \\  & & **Regulator** & **Regulator** & **Regulator Phase** & **Regulator Phase** & **Regulator Phase** \\  & & & & **Balancing** & **Balancing** & **Balancing** \\ \hline HHO & 0.0084 & 800 & 10 & 5 & 0.5 & 0.60 \\ ASO & 0.0047 & 775 & 10 & 5 & 0.5 & 1.21 \\ PSO & 0.0128 & 773 & 8.21 & 3.24 & 0.455 & 2.48 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Optimization parameters of the proposed optimization methods. Figure 13: The curves of ASO, HHO, and particle swarm optimization (PSO). The THD of the current in the original state before optimization was 10.93% in the moment of the connecting MMC STATCOM, as shown in Figure 15, while the THD analysis of the grid current is shown in the Figure 16a, where the value of the THD is decreased to 0.60% with the optimal values of the capacitor converters and the optimal values of the PI controllers as determined using HHO. Moreover, the THD of the current with the optimal values of the capacitor converters and the optimal values of the PI controllers as determined using the ASO algorithm decreased to 1.21%, as shown in Figure 16b. Additionally, Figure 16c shows a comparison between the THD analysis of the current grid with different methods (HHO, ASO and PSO). Figure 14: The DC voltage of the MMC using HHO and ASO. Figure 15: Total harmonic distortion (THD) analysis of the grid current in the original case. Figure 16: **(a)** The THD analysis of the current grid using HHO; **(b)** The THD analysis of the current grid using ASO; **(c)** Comparison between the THD analysis of the current grid with different methods. The improvement of the voltage profile by compensating the reactive power is one of the main prospective results of MMC STATCOM. In order to examine the operation of the MMC STATCOM with the reactive power command, Qref is changed from (-5 MVAr); in this case the STATCOM operates in the inductive mode, to (+10 MVAr), where the STATCOM operates in the capacitive mode.