A unified SPICE compatible average model of PWM converters