*Scenario 3*

This scenario is identical to scenario 2; however, the modified sorting and tracking algorithm is used to mitigate the THD which is observed in scenario 2. The index of the sub-module to be modulated and the duty ratio "*d*" is shown in Figure 12 for 10 ms duration. The index and the duty ratio is modified every switching period so that the average value of the arm voltage is equal to the desired arm voltage.

Figure 13 shows the residual voltage as a result of using modified sorting and a tracking algorithm. The average value of the residual voltage is now zero, and the instantaneous magnitude of the residual voltage over a switching period is lower than the value seen in scenario 2.

**Figure 12.** The duty ratio for Pulse Width Modulators (PWM) and the index of the sub-module to be modulated.

**Figure 13.** The residual voltage as defined in (6) for the phase "a" upper arm of the MMC with modified ST algorithm.

The frequency spectrum of the output phase currents is shown in Figure 14. the THD is calculated to be 3.68%, 3.75%, and 3.56% for phase a, b, and c currents, respectively. The THD is decreased by 30% bringing it well within the permitted level as per IEEE 519 standard.

(**a**) THD = 3.68%, *isa*1 = 44.71A (**b**) THD = 3.75%, *isb*1 = 44.88A (**c**) THD = 3.56%, *isc*1 = 44.74A **Figure 14.** Frequency spectrum of the output phase currents in % with respect to the 50 Hz fundamental current, *isy*1 ∀ y = a, b, c.
