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 (176, 182) 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 configured to output a switching signal 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; and in response to determining that the voltage across the capacitance exceeds the second voltage threshold, deassert the switching signal; 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 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 (176, 182) 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 configured to output a switching signal 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; and in response to determining that the voltage across the capacitance exceeds the second voltage threshold, deassert the switching signal; 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; and in response to determining that the voltage across the capacitance exceeds the second voltage threshold, deassert the switching signal; 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 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 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.