A controller (102b; 102c; 102d) for operating a converter , comprising: a capacitance configured to be charged or discharged using a first current and a second current that is different than the first current; sourcing and sinking transistors configured to source or sink the first current for charging or discharging the capacitance; an operational transconductance amplifier configured to determine a level of the second current based on a level of current flowing through a resonant tank of the converter , and sink or source the second current for charging or discharging the capacitance; logic (184-188) configured to output a switching signal (Q) for operating the converter based on a voltage across the capacitance , wherein the logic is configured to: determine whether the voltage across the capacitance is below a first voltage threshold or exceeds a second voltage threshold; in response to determining that the voltage across the capacitance is below the first voltage threshold, assert the switching signal (Q); and in response to determining that the voltage across the capacitance exceeds the second voltage threshold, deassert the switching signal (Q); the controller further comprising a peak reference voltage generation stage configured to: generate a first voltage that is proportional to a duration of a switching cycle of the switching signal (Q) of the converter ; sum the first voltage and the first voltage threshold; and set the second voltage threshold to the sum of the first voltage and the first voltage threshold. a capacitance configured to be charged or discharged using a first current and a second current that is different than the first current; sourcing and sinking transistors configured to source or sink the first current for charging or discharging the capacitance; an operational transconductance amplifier configured to determine a level of the second current based on a level of current flowing through a resonant tank of the converter , and sink or source the second current for charging or discharging the capacitance; logic (184-188) configured to output a switching signal (Q) for operating the converter based on a voltage across the capacitance , wherein the logic is configured to: determine whether the voltage across the capacitance is below a first voltage threshold or exceeds a second voltage threshold; in response to determining that the voltage across the capacitance is below the first voltage threshold, assert the switching signal (Q); and in response to determining that the voltage across the capacitance exceeds the second voltage threshold, deassert the switching signal (Q); determine whether the voltage across the capacitance is below a first voltage threshold or exceeds a second voltage threshold; in response to determining that the voltage across the capacitance is below the first voltage threshold, assert the switching signal (Q); and in response to determining that the voltage across the capacitance exceeds the second voltage threshold, deassert the switching signal (Q); the controller further comprising a peak reference voltage generation stage configured to: generate a first voltage that is proportional to a duration of a switching cycle of the switching signal (Q) of the converter ; sum the first voltage and the first voltage threshold; and set the second voltage threshold to the sum of the first voltage and the first voltage threshold. generate a first voltage that is proportional to a duration of a switching cycle of the switching signal (Q) of the converter ; sum the first voltage and the first voltage threshold; and set the second voltage threshold to the sum of the first voltage and the first voltage threshold. <EOS>