## 4 Control Units of the DSTATCOM  
The control strategy of a DSTATCOM typically involves multiple control loops to regulate voltage and improve power quality in distribution systems, as shown in Figure 7. The outer voltage control loop is responsible for maintaining the DC link voltage (\(V_{S}^{dc}\)) at a reference value (\(V_{S}^{dc*}\)), ensuring sufficient energy storage for reactive power compensation. This loop generates the reference current for the inner current control loop (\(i_{S}^{ds}\)). The error between the measured DC link voltage and its reference is processed through controller \(C_{1}\), yielding the required reference current, as shown in (22). \[i_{S}^{ds*}=C_{1}\left(V_{S}^{dc*}-V_{S}^{dC}\right) \tag{22}\]  
The second outer control loop is employed to enhance the voltage profile at the load bus, as illustrated in Figure 7. The output of this loop serves as the reference signal for the q-axis component (\(i_{S}^{qs*}\)), which can be determined using (23) or (24). \[i_{S}^{qs*}=\frac{-2\ Q_{B2}}{3\ V_{B2}^{d}} \tag{23}\]  
\[i_{S}^{qs*}=C_{2}\left(V_{S}^{mag*}-V_{S}^{mag}\right) \tag{24}\]  
The inner current control loop regulates the DSTATCOM's output currents along the \(d\)-axis (\(i_{S}^{d}\)) and \(q\)-axis components (\(i_{S}^{d}\)). The control objective is to track the reference currents  
Figure 7: Control unit the DSTATCOM. (\(i_{S}^{d*}\) and \(i_{S}^{q*}\)), which are derived from the outer loop and reactive power requirements. The \(C_{3}\) and \(C_{4}\) controllers in the inner loop generate the control voltages \(V_{S}^{d*}\) and \(V_{S2}^{q*}\) as follows:  
\[V_{S}^{d*}=C_{3}\ \left(i_{S}^{d*}-i_{S}^{d}\right)-\omega\ L_{S}^{S}\ i_{S}^{d}+V_{ B2}^{d} \tag{25}\]  
\[V_{S}^{q*}=C_{4}\ \left(i_{S}^{q*}-i_{S}^{q}\right)+\omega\ L_{S}^{S}\ i_{S}^{d}+V_{ B2}^{q} \tag{26}\]  
In this work, two cascading controllers, namely PI-PI and FOPI-FOPI, are employed to replace \(C_{1}\), \(C_{2}\), \(C_{3}\), and \(C_{4}\). Adopting cascading controllers offers several advantages over the traditional configuration, including improved dynamic response, enhanced stability, and greater flexibility in tuning for specific performance criteria. These benefits make cascading controllers particularly effective in complex control systems where precise regulation is essential. The transfer function of the cascading PI-PI controller is presented in (27), illustrating its mathematical formulation and how it governs the system's behavior. Similarly, the transfer function of the FOPI-FOPI controller is provided in (28), which highlights the distinct characteristics of Fractional-Order Controllers and their ability to offer superior control by accommodating a wider range of system dynamics. The choice between these two controllers depends on the application's specific requirements, with each offering unique advantages in terms of performance and robustness. \[C^{PI-PI}=\left(k_{p,1}^{n}+\frac{k_{i,1}^{n}}{S}\right)\left(k_{p,2}^{n}+\frac {k_{i,n}^{n}}{S}\right) \tag{27}\]  
\[C^{FOPI-FOPI}=\left(k_{p,1}^{n}+\frac{k_{i,1}^{n}}{S^{\frac{\alpha}{\alpha}}} \right)\ \left(k_{p,2}^{n}+\frac{k_{i,n}^{n}}{S^{\frac{\alpha}{\alpha}}}\right) \tag{28}\]  
Tuning the control unit's parameters is a crucial aspect of control system design. This process is commonly treated as an optimization problem, with meta-heuristic algorithms frequently used to determine the optimal parameter settings. * Fitness function formulation  
The optimization may involve one or more objectives, subject to a defined set of constraints. The formulation of the objective function is pivotal, as it guides the optimization process towards achieving the desired control performance. In this study, the integral of time-weighted square error (ITSE) is employed as the objective function, denoted as 'OF', to evaluate system performance, as given in (29). The upper limit of the integral, represented by \(T_{max}\), is typically set to a value greater than the system's settling time, ensuring that the integral converges to a steady-state value.