A power harmonics correction circuit comprising a first node; a second node; a first current path extending from the first node to the second node, wherein the first current path is electrically connected to a load that is external to the power harmonics correction circuit; a second current path extending from the first node to ground; a third current path extending from the first node to the second node; a sense resistor (220, R38) electrically connected to the second node and to ground, wherein the voltage across the sense resistor has a waveform whose shape and phase represent the shape and phase of the waveform of a total current on the first and third current paths; a differential circuit (222, U9) comprising a first input, a second input, and an output, wherein the first input of the differential circuit (222, U9) is electrically connected to the second current path and the second input of the differential circuit is electrically connected to the sense resistor (220, R38); a transistor (216, Q8) configured to provide feedback to the second input of the differential circuit (222, U9), the transistor (216, Q8) comprising a gate that is electrically connected to the output of the differential circuit (222, U9), a drain that is electrically connected to the third current path, and a source that is electrically connected along the third current path; wherein, during operation of the power harmonics correction circuit, when a waveform of a voltage driving the external load changes, the change is reflected as a voltage change at the first input of the differential circuit (222, U9); the differential circuit (222, U9) drives the transistor (216, Q8) so as to equalize the voltage at the first and second inputs, resulting in a current waveform whose phase and shape are matched to that of the voltage waveform; the power harmonics correction circuit further comprising: a potentiometer electrically connected to the first input of the differential circuit (222, U9); logic circuitry that controls the resistance of the potentiometer; wherein the voltage at the first input of the differential circuit (222, U9) scales up or down based on the change in the resistance of the potentiometer. a first node; a second node; a first current path extending from the first node to the second node, wherein the first current path is electrically connected to a load that is external to the power harmonics correction circuit; a second current path extending from the first node to ground; a third current path extending from the first node to the second node; a sense resistor (220, R38) electrically connected to the second node and to ground, wherein the voltage across the sense resistor has a waveform whose shape and phase represent the shape and phase of the waveform of a total current on the first and third current paths; a differential circuit (222, U9) comprising a first input, a second input, and an output, wherein the first input of the differential circuit (222, U9) is electrically connected to the second current path and the second input of the differential circuit is electrically connected to the sense resistor (220, R38); a transistor (216, Q8) configured to provide feedback to the second input of the differential circuit (222, U9), the transistor (216, Q8) comprising a gate that is electrically connected to the output of the differential circuit (222, U9), a drain that is electrically connected to the third current path, and a source that is electrically connected along the third current path; wherein, during operation of the power harmonics correction circuit, when a waveform of a voltage driving the external load changes, the change is reflected as a voltage change at the first input of the differential circuit (222, U9); the differential circuit (222, U9) drives the transistor (216, Q8) so as to equalize the voltage at the first and second inputs, resulting in a current waveform whose phase and shape are matched to that of the voltage waveform; when a waveform of a voltage driving the external load changes, the change is reflected as a voltage change at the first input of the differential circuit (222, U9); the differential circuit (222, U9) drives the transistor (216, Q8) so as to equalize the voltage at the first and second inputs, resulting in a current waveform whose phase and shape are matched to that of the voltage waveform; the power harmonics correction circuit further comprising: a potentiometer electrically connected to the first input of the differential circuit (222, U9); logic circuitry that controls the resistance of the potentiometer; wherein the voltage at the first input of the differential circuit (222, U9) scales up or down based on the change in the resistance of the potentiometer. a potentiometer electrically connected to the first input of the differential circuit (222, U9); logic circuitry that controls the resistance of the potentiometer; wherein the voltage at the first input of the differential circuit (222, U9) scales up or down based on the change in the resistance of the potentiometer.