Opamp gain calculation

Thread Starter

andrew74

Joined Jul 25, 2022
224
Hi everyone, this is the amplifier stage of the X-NUCLEONUCLEO-IHM08M1.

1780652442283.png



I’ve done some calculations to work out the profit, but I’m not sure what resistance value to put in the blue question marks:
SmartSelect_20260605_113554_Samsung Notes.jpg

Point 1) corresponds to the effect of Vshunt1, while point 2) corresponds to 3.3V .. in the end, I should add them up

I’d also like to ask what you think is the point of placing those 3.3V pull-up resistors on the non-inverting input… perhaps because the resistor (between + and -) is connected to the source of the MOSFETs for phase current measurement.
1780652612413.png
 

ericgibbs

Joined Jan 29, 2010
21,442
I’ve done some calculations to work out the profit, but I’m not sure what resistance value to put in the blue question marks:
Hi Andrew,
For an Inverting OPA, which two resistors set the basic Gain value for the OPA.?
Post the equation you need to use.
E
 

WBahn

Joined Mar 31, 2012
32,852
Hi everyone, this is the amplifier stage of the X-NUCLEONUCLEO-IHM08M1.

View attachment 368041



I’ve done some calculations to work out the profit, but I’m not sure what resistance value to put in the blue question marks:
View attachment 368042

Point 1) corresponds to the effect of Vshunt1, while point 2) corresponds to 3.3V .. in the end, I should add them up

I’d also like to ask what you think is the point of placing those 3.3V pull-up resistors on the non-inverting input… perhaps because the resistor (between + and -) is connected to the source of the MOSFETs for phase current measurement.
View attachment 368043
Why are you completely ignoring the effect of R4?

Instead of trying to throw memorized or looked up equations at it, just analyze the circuit.

1780674635837.png

Assuming an ideal opamp Vp = Vn.

At sufficiently low frequencies, C3 and C4 have sufficiently high impedance to be ignored. So, within that frequency realm:

Looking at the non-inverting input:

ip = (Vcc - Vs) / (R1+R2)

where Vcc = 3.3 V and Vs = Vshunt_1

Vp = Vs + ip*R2

Vp = Vs + ( (Vcc - Vs) / (R1+R2) )·R2

Vp = Vs (1 - (R2/(R1+R2))) + Vcc·(R2/(R1+R2))

Vp = Vs (R1/(R1+R2)) + Vcc·(R2/(R1+R2))

Turning to the inverting input, we have:

Vn = Vo · (R4/(R4+R5)

Now just set them equal and solve for Vo:

Vp = Vn

Vs (R1/(R1+R2)) + Vcc·(R2/(R1+R2)) = Vo · (R4/(R4+R5)

Vo = [ Vs (R1/(R1+R2)) + Vcc·(R2/(R1+R2)) ] / [(R4/(R4+R5)]

Vo = [ Vs (R1/(R1+R2)) + Vcc·(R2/(R1+R2)) ] · [1 + (R5/R4)]

We can massage this to put it in terms of ratios pretty easily:

Vo = Vs · [ (1 + (R5/R4)) ] / [ (1 + (R2/R1)) ] + Vcc · [ (1 + (R5/R4)) ] / [ (1 + (R1/R2)) ]

As a sanity check (since I'm doing all of the manipulation as I type, which history has shown is somewhat prone to making mistakes), let's see if this limits correctly.

If R1 and R4 are removed (made infinite), we have the classic non-inverting amplifier which should have a gain of (1 + (R5/R4)):

Vo = Vs · [ (1 + (R5/R4)) ] / [ (1 + (R2/∞)) ] + Vcc · [ (1 + (R5/R4)) ] / [ (1 + (∞/R2)) ]

Vo = Vs · [ (1 + (R5/R4)) ] / [ (1 + 0) ] + Vcc · [ (1 + (R5/R4) )) ] / [ (1 + ∞) ]

Vo = Vs · [ (1 + (R5/R4)) / 1 ] + Vcc · [ (1 + (R5/R4)) / ∞ ]

Vo = Vs · [ (1 + (R5/R4)) ] + Vcc · [ 0 ]

Vo = Vs · (1 + (R5/R4))

So it passes this check, which is probably good enough.

As you can see, you can't just ignore R4, as the ratio R5/R4 is what sets the gain.

In this case, the output becomes

Vo = Vs · [ (1 + (4.7 kΩ / 1 kΩ)) ] / [ (1 + (680 Ω / 6.8 kΩ)) ] + 3.3 V · [ 1 + (4.7 kΩ / 1 kΩ)) ] / [ (1 + (6.8 kΩ / 680 Ω)) ]

Vo = Vs · [ (1 + 4.7) ] / [ (1 + 0.1) ] + 3.3 V · [ (1 + 4.7) ] / [ (1 + 10) ]

Vo = Vs · ( 5.7 / 1.1 ) + 3.3 V · (5.7 / 11)

Vo = 5.18·Vs + 1.71 V

The next question is what constitutes a low enough frequency for the DC gain to be applicable to the signal.

You have two cutoff frequencies, one associated with each of the capacitors C3 and C4. To a good approximation, the one with C3 is due to the RC time constant of C3 and the parallel combination of R1 and R2, which is roughly just R2. The one with C4 is the RC time constant of C4 and the sum of R4 and R5. If I did it right, these are therefore at about 16 kHz and 280 kHz, respectively. So if you are looking only at frequencies well below 16 kHz, the DC gain should apply pretty closely.

As for the pullup resistors, I can only guess. It would seem that they might be there to provide a DC bias to the output, perhaps because the next block in the processing can't handle voltages that are too close to the rails. That's only a guess.

Your shunt resistors are 10 mΩ rated at 1 W. That means the max current is 10 A, making the max input signal just 0.1 V, which would make the output barely 0.5 V without the pullup.

in your second diagram, why are you calling those pull "up" resistors?
 
Top