1. A control circuit, comprising: an oscillator configured to generate a reference signal; and a processor coupled to said oscillator and configured to: receive a first output current sample, a second output current sample, and a third output current sample, wherein the first, second, and third samples are samples of an output current, compute a time-derivative of the output current based on the samples, and compute a command variable based on the reference signal, a time-derivative of the reference signal, the output current, and the time-derivative of the output current.