I was looking at a simulation of a current regulator circuit to figure out why the voltage on a current sense resistor is not a nice sine wave-ish lik e the applied voltage to the circuit. I expected a bit of distortion aroun d the zero crossing points but otherwise a rectified sine wave.
After mucking with the circuit thinking it had to do with transistor curren ts I realized the issue was MUCH more fundamental. The current through the resistor is as expected, pretty much a rectified sine wave with a bit of d istortion near the zero crossing points... but the voltage is terribly dist orted. What finally sunk in was that these were the measurements directly on the resistor as if the resistance was varying!!!
Plotting Vr/Ir in LTspice sure enough gave a rather ragged waveform for res istance much like the voltage waveform. The measured values are not weird extremes that might be from parasitic effects, ~3 volts, ~13 mA, 121 ohms. I even tried using a specific resistor part number to make sure the resist or didn't have some weird default parasitic value on it.
WTF???!!!
How can a resistance not model as a proper resistance in a circuit simulato r? The calculated resistance value over the cycle not near the zero crossi ngs ranges from 120 ohms to 240 ohms.