A method of controlling a high voltage power supply for an electrostatic precipitator, said high voltage power supply comprising: • a transformer-rectifier set comprising a high voltage transformer, a primary side of which is connectable to an AC industrial mains net having a line frequency, and a high voltage bridge rectifier connected to a secondary side of said high voltage transformer and configured to supply a rectified high voltage to said electrostatic precipitator; • a semiconductor switch controller arranged at the primary side of said high voltage transformer and configured to control an output power level of the high voltage power supply; • firing circuitry configured to provide firing pulses to said semiconductor switch controller; and • a control unit configured to determine a firing angle of said firing pulses and to control said firing circuitry accordingly, wherein the method comprises the steps of: • measuring during normal operation of said electrostatic precipitator a peak voltage value over said electrostatic precipitator in each half period of said line frequency; • storing said measured peak voltage value; • detecting the occurrence of an electrical breakdown in said electrostatic precipitator; • measuring, when a breakdown is detected, a residual voltage ( U r) over the electrostatic precipitator; • determining a firing angle ( α 1) of a firing pulse to be provided to said semiconductor switch controller in the first half period after the occurrence of said breakdown, wherein said firing angle is determined from the latest stored measured peak voltage value ( U bef) and the measured residual voltage ( U r) based on a predetermined relationship between said firing angle ( α 1) and the latest stored measured peak voltage value ( U bef) and the measured residual voltage (Ur), wherein the firing angle is advanced for higher values of the residual voltage; and • providing (106, 107) a firing pulse with the determined firing angle ( α 1) to said semiconductor switch controller; • approximating said predetermined relationship by a set of linear functions (29, 30, 31, 32), wherein each linear function defines an approximated relationship between an aimed peak voltage value ( U set) and said firing angle ( α 1) for a value of measured residual voltage ( U r). • a transformer-rectifier set comprising a high voltage transformer, a primary side of which is connectable to an AC industrial mains net having a line frequency, and a high voltage bridge rectifier connected to a secondary side of said high voltage transformer and configured to supply a rectified high voltage to said electrostatic precipitator; • a semiconductor switch controller arranged at the primary side of said high voltage transformer and configured to control an output power level of the high voltage power supply; • firing circuitry configured to provide firing pulses to said semiconductor switch controller; and • a control unit configured to determine a firing angle of said firing pulses and to control said firing circuitry accordingly, • measuring during normal operation of said electrostatic precipitator a peak voltage value over said electrostatic precipitator in each half period of said line frequency; • storing said measured peak voltage value; • detecting the occurrence of an electrical breakdown in said electrostatic precipitator; • measuring, when a breakdown is detected, a residual voltage ( U r) over the electrostatic precipitator; • determining a firing angle ( α 1) of a firing pulse to be provided to said semiconductor switch controller in the first half period after the occurrence of said breakdown, wherein said firing angle is determined from the latest stored measured peak voltage value ( U bef) and the measured residual voltage ( U r) based on a predetermined relationship between said firing angle ( α 1) and the latest stored measured peak voltage value ( U bef) and the measured residual voltage (Ur), wherein the firing angle is advanced for higher values of the residual voltage; and • providing (106, 107) a firing pulse with the determined firing angle ( α 1) to said semiconductor switch controller; • approximating said predetermined relationship by a set of linear functions (29, 30, 31, 32), wherein each linear function defines an approximated relationship between an aimed peak voltage value ( U set) and said firing angle ( α 1) for a value of measured residual voltage ( U r).