Modular multilevel converter: theoretical analysis and capacitor voltage ripple effects