Author Topic: Help with LTspice simulation opamp AC analysis  (Read 801 times)

0 Members and 1 Guest are viewing this topic.

Offline ikcalBTopic starter

  • Contributor
  • Posts: 16
Help with LTspice simulation opamp AC analysis
« on: April 30, 2026, 11:59:08 am »
I'm trying to simulate filters for a current shunt amplifier.

Please tell me what I'm doing wrong:
1. When R5 is connected, transient an AC analysis behave as expected:
    connecting / changing values for C2 and C3 also change the corner frequency as well as filter roll off

2. When R5 is DISconnected however, AC analysis does not seem to reflect corner frequency change any longer
2806851-0

I might be mistaken, but with R5 disconnected, the circuit should act as a regular difference amplifier?
(AFAIK R5 should only offset the output voltage from GND)

Any help would be appreciated!

BR,
Florian* opamp-sense.asc (3.13 kB - downloaded 26 times.)
 

Online mtwieg

  • Super Contributor
  • ***
  • Posts: 1820
  • Country: us
Re: Help with LTspice simulation opamp AC analysis
« Reply #1 on: April 30, 2026, 12:36:52 pm »
If you disconnect R5, then the value of R4 should be decreased to 15K (same as R1) to maintain CMRR.

However even if you do that, the output of the opamp will be biased at 0V. Since the opamp is single-supply, it won't work properly in this condition. So you need to bias the output above GND (like with R5) or use a dual supply for the opamp.
 

Offline ikcalBTopic starter

  • Contributor
  • Posts: 16
Re: Help with LTspice simulation opamp AC analysis
« Reply #2 on: April 30, 2026, 12:51:34 pm »
If you disconnect R5, then the value of R4 should be decreased to 15K (same as R1) to maintain CMRR.

However even if you do that, the output of the opamp will be biased at 0V. Since the opamp is single-supply, it won't work properly in this condition. So you need to bias the output above GND (like with R5) or use a dual supply for the opamp.

Thanks for reaching out!

 |O looks like I fell into a trap for young players...
CMRR is what bit me in the simulation.

A single supply opamp is all i have in this case (by design).
For this application (current shunt, only positive currents)  I'm trying to maximize dynamic range.
[I don't really care about negative current much, that's only due to my approximation of the ripple current for simulation purposes.]

Assuming for the lowest currents I need to measure the opamp can follow with it's [minimum] output swing, would you still bias OP+ input to lift the output signal from GND thus sacrificing dynamic range?
(i.e. R5 = 300k, R4 = R2 = 30k )

EDIT: I've not been able to calculate the CMRR when using the difference amp topology with bias.
If anyone can point me in the right direction or link to some example calculations, that'd be great!
« Last Edit: April 30, 2026, 02:26:01 pm by ikcalB »
 

Offline MariuszD

  • Frequent Contributor
  • **
  • Posts: 703
  • Country: pl
Re: Help with LTspice simulation opamp AC analysis
« Reply #3 on: April 30, 2026, 02:39:10 pm »
2. When R5 is DISconnected however, AC analysis does not seem to reflect corner frequency change any longer
The AC analysis is done only when the circuit works correctly in the transient analysis.

How do you detect in an AC analysis that the circuit is not working? An amplifier that has an output of -140dB, meaning it attenuates 10,000,000 times, is a good indication that the amplifier is not working.
 

Online mtwieg

  • Super Contributor
  • ***
  • Posts: 1820
  • Country: us
Re: Help with LTspice simulation opamp AC analysis
« Reply #4 on: April 30, 2026, 02:48:50 pm »

Assuming for the lowest currents I need to measure the opamp can follow with it's [minimum] output swing, would you still bias OP+ input to lift the output signal from GND thus sacrificing dynamic range?
This might work in theory, depending on the specific opamp. Keep in mind that the inputs and output of the opamp have their own operating ranges, you need to satisfy both to get proper operation.

Personally I would want the circuit to behave linearly down to zero input.
 

Offline r6502

  • Regular Contributor
  • *
  • Posts: 159
  • Country: de
Re: Help with LTspice simulation opamp AC analysis
« Reply #5 on: May 07, 2026, 09:00:42 pm »
hi ikcalB,

is it really necessary, to use a differential amplifier in this application? May be you can also use just a single ended amplifier referenced to GND?  The in-and output schould rail to rail of course.

Something like this:


Guido
« Last Edit: May 07, 2026, 09:02:13 pm by r6502 »
Science can amuse and fascinate us all, but it is engineering that changes the world - - Isaac Asimov
 

Offline ikcalBTopic starter

  • Contributor
  • Posts: 16
Re: Help with LTspice simulation opamp AC analysis
« Reply #6 on: May 07, 2026, 09:08:16 pm »
hi ikcalB,

is it really necessary, to use a differential amplifier in this application? May be you can also use just a single ended amplifier referenced to GND?  The in-and output schould rail to rail of course.

Hi Guido,

I'm not sure.
This is a prototype, to test exactly that (among other things).

The calculated ~40dB CMRR could help clean up the current measurement, also the differential signal should be less prone to pick up switching noise?

Anyway, the opamp is not a discrete part, it's the internal one from an ST32G4.
Should single ended be enough, we can get rid of most external resistors and use the internal PGA stage - this is actually preferred.

Br, Florian
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->