I have designed a circuit that we use in practice, and it works correctly in real life. we connect J2 to microcontroller to monitor the current in primary side. it is working so good in practice. I wanted to simulate this to just optimize it but it is not working in simulation actually.
The current range I need is from 0 to 3 A, so I varied R6 from 100 Ω to 3000 Ω and noted both the current through R6 and the voltage across R1. For resistances between 100 Ω and 1000 Ω the results were approximately correct, but immediately after 1000 Ω (even at 1001 Ω) the voltage waveform across R1 became very noisy. The reason seems to be that the voltage dropped to extremely small values, in the order of picovolts.
The issue is that in reality this circuit works fine, and when measured with a voltmeter the voltage across R1 is much higher than what LTSpice shows. So the simulation results differ significantly from the real measurements.
Do you think this problem comes from LTSpice itself, or is it possible that we missed something in the schematic and did not include it in the simulation?
For reference:
- The number of turns for L1 is about 1.5–1.7, and for L2 it is 200.
- The applied voltage is mains AC.
- The second schematic is the same as our real circuit, except that in LTSpice we replaced the input/output terminals with a sinusoidal voltage source and a very large resistor connected to ground.
- The Zener diode was removed in the simulation because its only role is to block voltages above 3 Av.
- We also varied the Stop time from 1 s to 50 s to check whether it changes the results, but it did not.
