an embodiment of a power - supply controller comprises a switching - control circuit , an error amplifier , and a signal generator . the switching - control circuit is operable to control a switch coupled to a primary winding of a transformer , and the error amplifier has a first input node operable to receive a feedback signal , a second input node operable to receive a comparison signal , and an output node operable to provide a control signal to the switching - control circuit . the signal generator is operable to generate either the feedback signal or the comparison signal in response to a compensation signal that is isolated from a secondary winding of the transformer and that is proportional to a load current through a conductor disposed between the secondary winding and a load .