A mass spectrometer, comprising: an ion source configured to ionize a sample to produce ions; a mass analyzer configured to separate the ions based on their mass-to-charge ratio; a detector configured to detect ions; an ion optics component configured to direct ions along at least part of the path from the ion source to the mass analyzer to the detector; and a controller configured to switch the source at a first time from a first polarity source voltage to a second polarity source voltage; switch the detector at a second time from a first voltage to a second voltage, the second time being offset from the first time, the first voltage being the first polarity detector voltage and the second voltage being the second polarity detector voltage, the second time being offset from the first time by at least an ion flight time from the source to the detector; and switch the mass analyzer at a third time from a first polarity analyzer voltage to a second polarity analyzer voltage, the third time being offset from the first time by at least an ion flight time from the source to the mass analyzer, characterized in that the controller is further configured to switch the source voltage, mass analyzer voltage or detector voltage by changing from a first voltage to an overdrive voltage and changing to the second voltage when the voltage output reaches the second voltage, the first voltage being the first polarity source voltage, the first polarity analyzer voltage or the first polarity detector voltage and the second voltage being the second polarity source voltage, the second polarity analyzer voltage or the second polarity detector voltage, the magnitude of the difference between the first voltage and the overdrive voltage being greater than the magnitude of the difference between the first voltage and the second voltage. an ion source configured to ionize a sample to produce ions; a mass analyzer configured to separate the ions based on their mass-to-charge ratio; a detector configured to detect ions; an ion optics component configured to direct ions along at least part of the path from the ion source to the mass analyzer to the detector; and a controller configured to switch the source at a first time from a first polarity source voltage to a second polarity source voltage; switch the detector at a second time from a first voltage to a second voltage, the second time being offset from the first time, the first voltage being the first polarity detector voltage and the second voltage being the second polarity detector voltage, the second time being offset from the first time by at least an ion flight time from the source to the detector; and switch the mass analyzer at a third time from a first polarity analyzer voltage to a second polarity analyzer voltage, the third time being offset from the first time by at least an ion flight time from the source to the mass analyzer, characterized in that switch the detector at a second time from a first voltage to a second voltage, the second time being offset from the first time, the first voltage being the first polarity detector voltage and the second voltage being the second polarity detector voltage, the second time being offset from the first time by at least an ion flight time from the source to the detector; and switch the mass analyzer at a third time from a first polarity analyzer voltage to a second polarity analyzer voltage, the third time being offset from the first time by at least an ion flight time from the source to the mass analyzer, characterized in that the controller is further configured to switch the source voltage, mass analyzer voltage or detector voltage by changing from a first voltage to an overdrive voltage and changing to the second voltage when the voltage output reaches the second voltage, the first voltage being the first polarity source voltage, the first polarity analyzer voltage or the first polarity detector voltage and the second voltage being the second polarity source voltage, the second polarity analyzer voltage or the second polarity detector voltage, the magnitude of the difference between the first voltage and the overdrive voltage being greater than the magnitude of the difference between the first voltage and the second voltage.