Flexible synchronous PWM control of cascaded inverters for photovoltaic generation