This paper shows an algorithm to control the DC bus voltage of a Shunt Active Power Filter (SAPF), based on the performance of the Proportional Integral (PI) controller. The power converter topology corresponds to a four-wire three-leg Voltage Source Inverter (VSI) with split capacitor. The algorithm is focused on the voltage control for each capacitor, such that the dc-voltages follow a reference level in order to guarantee both the active filter controllability and the balance in the distribution of the DC bus voltage. The algorithm performance is evaluated through some simulations in ATP. Finally, the algorithm effectiveness is shown when it is used to control a SAPF that compensates distorted and unbalanced currents.