Gain limiter circuit in LTspice - current flowing in wrong direction

In summary: Once you get the hang of it, simulations can be a powerful tool for understanding circuits.In summary, LTspice appears to be behaving strangely when I try to simulate the gain limiter network in the video. I need to find the error in the simulation so that I can fix it.
  • #1
Wrichik Basu
Science Advisor
Insights Author
Gold Member
2,138
2,713
This is one more thread in my quest to learn simulations in LTspice. I am trying to simulate the gain limiter network shown in this video. A snapshot of the video is available for quick reference:

1623312950591.png

My schematic in LTspice is shown below:

1623313011515.png

For the simulation, I am using DC sweep on voltage source V3, starting from -10 V to 10 V, incrementing by 0.01 V. Regarding the diode, I have picked the first one available in the library of LTspice. I am plotting the current through V3 vs the voltage of V3, and the ratio V3/I(V3) vs V3. The results are shown below:

1623313052678.png

As you can see, my graphs are almost identical to those in the video, except that they are flipped. Actually, the current in my circuit is flowing in the opposite direction to what has been shown in the video.

What is the error that I am making?

The LTspice files are attached; please remove the .txt extension before loading them in the software.
 

Attachments

  • Gain_limiter.plt.txt
    559 bytes · Views: 140
  • Gain_limiter.asc.txt
    2 KB · Views: 168
Engineering news on Phys.org
  • #2
The positive current direction in the first picture is in the opposite of the positive current direction in the LTSpice simulation. In order to see the direction of positive current in the simulation, hover the mouse over V3 and you will see a symbol with an arrow, which points down (at least when I run your .asc file).

jason
 
  • #3
jasonRF said:
The positive current direction in the first picture is in the opposite of the positive current direction in the LTSpice simulation. In order to see the direction of positive current in the simulation, hover the mouse over V3 and you will see a symbol with an arrow, which points down
Yes, I know, and that's what I wrote — in my simulation, the current is flowing in the opposite direction to what is shown in the video. I can easily plot the negative of the current and dV/dI and get the required plot, but that is not what has been done in the video. I need to find the error in the simulation.
 
  • #4
The spice current direction and polarity of voltage sources makes it difficult sometimes. The easiest way here is to use a current sense resistor, then plot "V3/I(Rsense)". If you need to reverse the sign of the current then "end for end" Rsense on the schematic. Alternatively insert a unary - in the plot equation; -V3/I(V3); to invert the plot.
 

Attachments

  • Gain_limiter_2.asc.txt
    2.1 KB · Views: 160
  • Gain_limiter_2.plt.txt
    559 bytes · Views: 154
  • Informative
Likes Wrichik Basu
  • #5
Baluncore said:
The spice current direction and polarity of voltage sources makes it difficult sometimes. The easiest way here is to use a current sense resistor, then plot "V3/I(Rsense)". If you need to reverse the sign of the current then "end for end" Rsense on the schematic. Alternatively insert a unary - in the plot equation; -V3/I(V3); to invert the plot.
Thanks a lot; sensing the current through Rsense instead of V3 solves all the problems. But this was a bit weird.
 
  • #6
@Baluncore I found something more weird: If I disconnect the Rsense in your file, rotate it by 180°, and reconnect it, the direction of current changes! How is this possible?
 
  • #7
Baluncore said:
If you need to reverse the sign of the current then "end for end" Rsense on the schematic.
Wrichik Basu said:
If I disconnect the Rsense in your file, rotate it by 180°, and reconnect it, the direction of current changes! How is this possible?
There is a spice convention that current always flows into "pin one" of a component. That current in the component will be reversed if you turn the component around, but the current actually flows the same way in the circuit wires between the nodes. LTspice can't measure the current in a wire, only the current in a terminal. You can always edit the plot equation with a unary minus to fix the sign.
 
  • Informative
Likes Wrichik Basu
  • #8
Wrichik Basu said:
But this was a bit weird.
My experience with simulations has been that there are a lot of trivial problems that are often easier to fix than to understand. I think it is important to have a basic understanding of what the result should look like, as you did. I've done lots of simulations with 1μΩ or 1GΩ resistors and such added to get the result I need.
 
  • Like
Likes Wrichik Basu

FAQ: Gain limiter circuit in LTspice - current flowing in wrong direction

What is a gain limiter circuit?

A gain limiter circuit is a type of electronic circuit that is used to limit the amount of gain (amplification) in a signal. It is often used in audio and radio frequency applications to prevent distortion or damage to components.

How does a gain limiter circuit work?

A gain limiter circuit typically uses a diode or transistor to limit the amount of current flowing through the circuit. When the input signal reaches a certain level, the diode or transistor will start to conduct, effectively limiting the amount of gain in the circuit.

What is LTspice?

LTspice is a free, open-source circuit simulation software developed by Linear Technology. It allows users to simulate and analyze electronic circuits using a graphical user interface.

Why is the current flowing in the wrong direction in my LTspice gain limiter circuit?

This could be due to a number of reasons, such as incorrect component values or incorrect circuit connections. It is important to check all components and connections in the circuit to ensure they are correct and properly placed.

How can I troubleshoot issues with my LTspice gain limiter circuit?

One way to troubleshoot issues with an LTspice gain limiter circuit is to use the built-in simulation tools, such as the DC operating point analysis or transient analysis, to check the voltage and current values at different points in the circuit. This can help identify any potential issues or errors in the circuit design.

Similar threads

Replies
4
Views
3K
Replies
14
Views
1K
Replies
19
Views
35K
Replies
10
Views
2K
Replies
1
Views
1K
Replies
6
Views
3K
Replies
4
Views
1K
Back
Top