t 3 the comparator 428 enables the valley signal s 7 thereby triggering the valley signal valley by the or gate 418 and assuming that the blanking signal blank is high at this time the flip flop 422 is triggered to enable the driving signal driver to turn on the power switch sw alternatively if the blanking signal blank is low when the valley signal s 7 from the timer 414 is active for example at time t 4 shown in fig8 the valley signal s 7 will be blanked and so cannot trigger the flip flop 422 so that the sinusoidal waveform of the voltage across the power switch sw will remain when the detection voltage zcd rises up from the valley point to zero point at time t 5 the comparison signal s 2 changes from low to high thereby triggering the flip flop 444 to enable the current source 430 in the second timer 416 starting to charge the capacitor c 6 when the detection voltage zcd becomes lower than zero again at time t 6 the comparison signal s 2 changes to low thereby resetting the flip flop 444 so as to stop the current source 430 to provide the charging current i 3.