Keyboard Shortcuts
Likes
Search
Virtual ground issue in LTspice
Dear, ?am a beginner? in LTSpice. I have an issue with Virtual ground and amplifying a signal. I am amplifying a 10mV signal that wors well.? When i replace the power suppliers by a DC circuit, a splitter and a virtual ground, this is not working anymore.? ?? ? I guiess it is probably related to a virtual ground issue with LTspice but cannot fing online any solution. Many thanks for help. Bertrand? |
开云体育
On 2024-05-30 10:25, saulquinbertrand
via groups.io wrote:
--
OOO - Own Opinions Only Best wishes John Woodgate, Rayleigh, Essex UK Keep trying |
开云体育What do you mean by "not working any more"? Le 30/05/2024 à 11:25, saulquinbertrand
via groups.io a écrit?:
|
The circuit "issue_with_Vground.asc" has almost no connections to SPICE Ground.? The only connection to Ground is the input source, V2.
As you may or may not know already, SPICE (not just LTspice but all SPICE programs) requires a DC path from every circuit node to Ground.? From your "Vp" node, where is that path?? If it doesn't have one, either SPICE complains mightily, or LTspice tries to "fix" it for you by adding its own resistors to Ground, or it fails.? In your case, I guess it fails, with Singular Matrix errors and such.? ("Singular Matrix" means that the circuit matrix that holds the current or voltage values is singular and can not be inverted, but inverting that matrix is necessary throughout the simulation.) If you change "tran 1m" to ".tran 1m UIC", the simulation can "run", and SOME of the simulated voltages are actually close to correct.? But nothing is really right.? Lots of complaints from the simulation in the error log. Andy |
Bertrand,
In your circuit that doesn't work right, if you get it to run (which is challenging because LTspice strains and groans and sometimes it aborts), the output may not look right, but it is actually correct.? That's because the input signal at node IN is essentially zero.? You drove the input with a ground-referenced voltage source, not one that was referenced to your virtual ground net Vref.? Consequently, Vref and everything else in the circuit wobbles up and down because of V2, but the signal input voltage V(IN,Vref) that is seen by your amplifier is nothing.? So it produces nothing at the output V(OUT0,vref).? There is just a weak oscillation at about 0.5 MHz. Why did you choose to ground the bottom end of V2, when everything else is referenced to Vref? The simulation won't run (at least it won't for me, so far) if you change V2 so that it is referenced to the virtual ground.? I think it is just too much for it to handle, having none of the required paths to Ground. Andy |
I had some success simulating it with V2 referenced to node Vref instead of Ground, and using the Alternate Solver.? I also got rid of the parasitic resistor and capacitor in V2 because they only complicate things and mess up the signals.
It runs, but it struggles and is very slow. The output has an oscillation at about 15 MHz.? Indeed, EVERYTHING has that oscillation going on.? Vref itself is swinging wildly with the huge (55 V) oscillation, and it is drifting towards large negative voltages, and everything in the circuit is being dragged along with it. The simulation struggles and runs very slowly.? I think that's because the oscillation/oscillations forces it to make the timestep smaller, trying to keep up with it, making it run slowly.? LOTS of "Heightened Def Con" warnings. It is what I would call "unhinged".? It needs something to tie it down.? Adding a stiff (small valued) resistor from Vref to Ground might help. Andy |
Thanks Andy, following your comments i "fixed" issues util OUT0 in the circuit.
Nevertheless adding the end of the circuit introduces issues. I tried to add resistances + connection to GND in different places in the circuit without success. As i told i am a newbee in LTspice, i try to understand why it fails at execution . Thanks for potential help /g/LTspice/files/Temp/issue_with_Vground2.asc |
Bertrand, I don't know if this helps.
Let's say you had a complicated circuit that was fully battery-powered, so that it has no physical connection to earth ground.? In the real world, that's OK, the circuit works.? (No antennas or anything fancy like that.? And no Safety Officers looking over your shoulder, telling you that you can't do this or that.) But if I told you that you MUST call one of the circuit's nodes "ground", could you do it? Calling a node "ground" does not change the circuit.? No matter which point you choose to call "ground" it still works the same, right?? As long as only one of the nodes was changed to "ground", of course. Now there can sometimes be problems in actual simulations, but for the moment, let's start with this.? Many op-amp models do strange and unusual things when you mess with the grounds.? It's as if the op-amp has an invisible connection from inside the IC to ground - which many of their SPICE models do have.? But let's ignore it for now. Andy |
Andy,
the circuit on the left allows to get +-12 V and a vref from a battery (needed later for amplification) I tried to connect directly vref to GND but it did not work.? The need is led since the begining from the +-12V rails needed for circuit 2 (middle)? and 3 (right) but perhaps i missed something. Best |
开云体育Hi Bertrand,I've had success with this kind of single-supply circuit with a virtual ground in LTspice, so it can be done, don't worry! If I were you, I'd replace Vn with the LTspice ground signal. Then you have a genuine 24V DC supply voltage. From that, you generate your 12V Vref. The Op-amps will also need to be supplied from Vp and GND. Finally, once you'Ve done that, you either need to capacitively-couple your input to the +ve input of the op-amp (which I would recommend), or you need to bias it with the 12V. This is a circuit design issue (op-amp DC conditions and biasing) not an LTspice problem.? The problems are (in the first instance) a confusion about single-supply power and bipolar power. HTH, Tom ? ================== ? ? ? ?Electric Druid Synth & Stompbox DIY ==================
|
Le 30/05/2024 à 14:54, Andy I a écrit?:
The circuit "issue_with_Vground.asc" has almost no connections to SPICE Ground.? The only connection to Ground is the input source, V2.And it is enough to run perfectly for me. U2's non-inverting input is perfectly referenced to ground, which in turn results in U1 being referenced via the Vref node. That's why I asked the OP what issue he has, because his .asc runs good with me. |
Of course, the circuit has 0dB gain because the Vref node is a high-Z one.
toggle quoted message
Show quoted text
But the simulation works (for me). Le 30/05/2024 à 16:48, Jerry Lee Marcel a écrit?:
|
Jerry Lee Marcel wrote, "That's why I asked the OP what issue he has, because his .asc runs good with me."
I think you are in the minority.? Did you have the Alternate Solver enabled?? If not that, then can you tell us what LTspice settings you used, that make it run for you but not us? With the Normal Solver, the unaltered circuit runs and runs, until it eventually aborts several minutes later, with no DC convergence and a fatal "time step too small" error.? It might be coming from the Pseudo-Tran algorithm trying to find the DC operating point (so "time" does not mean real time). With the Alternate Solver, the unaltered circuit seems to run OK.? But wait - one has to be careful how to probe the signals in this circuit. re: "U2's non-inverting input is perfectly referenced to ground ..." And that is part of the problem.? Nothing else in the circuit is referenced to ground.? The rest of the circuit does not know what or where Ground is.? It is a foreign node with an unknown voltage seen by the rest of the circuit. re: "Of course, the circuit has 0dB gain because the Vref node is a high-Z one." Neither of those is right. The circuit has significant voltage gain from IN to OUT0. The Vref node is in a feedback loop so it is low-Z, not high-Z.? U1 drives Vref to the same voltage as the junction of R1 & R2. However, what's happening is that the sine wave voltage source V2 drives the ENTIRE circuit up and down by a sine wave.? Every node in the circuit, except for the Ground node, has (almost exactly) the same 10 kHz, 10 mV sine wave signal on it.? That's not the same thing as having no gain; it's a positive gain acting on no signal.? The circuit is happily ignorant that V2 is a sine wave, relative to a ground that it doesn't know and can't see. Andy |
Bertrand wrote, "I tried to connect directly vref to GND but it did not work.?"
I don't know what you mean by "it did not work."? Did the simulation abort?? Did it run but the voltages looked wrong? With your 2-stage circuit in "issue_with_Vground2.asc", after changing Vref to Ground, I simulated it with this change:
The "Startup" option frequently helps when LTspice has trouble solving the initial operating point.? You can tell when that happens because it aborts before there is any plot window on the screen.? The options "Startup" and "UIC" have some similarities for helping get past that DC operating point, but "Startup" is usually much better than "UIC". Adding the Alternate Solver sometimes helps too.? But in this case, with "Startup", the Normal Solver works better. Andy |
Jerry Lee Marcel wrote, "... because the Vref node is a high-Z one."
I want to add a little more on that.? I think I see what you are driving at. The Vref node is a low-Z node, relative to almost all of this circuit.? However, all of the circuit had essentially no connection to SPICE Ground.? Therefore, everything in this circuit effectively had a high impedance relative to Ground.? It's not just the Vref node, it was every node in this circuit except for the IN node in the original circuit.? In the second version (issue_with_Vground2.asc), V2 was referred to Vref instead of GND, and that makes the IN node also at a high impedance relative to ground.? In that circuit, resistor R12 establishes the impedance between every node and the GND node. Andy |
开云体育Andy, The circuit as shown is incompletely converted to single-supply. In order to do that properly, the Vn points should all be removed and connected to LTspice GND. The existing connections to Vref then start to make sense as a midpoint bias voltage. The opamps connected to Vp and Vn should also be connected to Vp and GND (convert Vn to GND there too). After this is done, the circuit has at least a chance of working. Then we come to the input...which needs to be AC coupled, but first let's get the power sorted out. HTH, Tom
|