A method and system for operating a power converter having an electrical
component and a switch coupled to a voltage source are provided. A signal
is received that is representative of a desired current flow through the
electrical component. A signal is generated that is representative of a
difference between the desired current flow and an actual current flow
through the electrical component. A duty cycle for the switch is
calculated based on the signal representative of the difference and a
voltage generated by the voltage source.