OpAmp Gain Calculation
hkesoglu opened this issue · 1 comments
Hi!
It's really nice to see such a design. I am designing a circuit that will work with simplefoc and I am thinking of using bluepill. However, since I want it to operate at lower voltages and currents, there are too many unnecessary things in your design for my situation. I want to use the opamp part of your design. But I don't understand how you choose the resistor values.
When I examine the datasheet of cos724, I understand that you are using a Differential Amplifier. When I calculate it according to the calculations I found on the internet, your gain ratio is very low. I couldn't understand how it worked.
In my case, I need to set it to see 20A max. I calculate that when I choose 2mR it drops 20 * 0.002 = 40mV. Considering the ADC max voltage to be 3V (300mV for safety), I thought I should set it to something like 3000/40=75 gain ratio. What should I change the resistor values in your circuit to get a ratio like 75? Is it possible?
I'm also wondering why the R18 100kOhm resistor is connected to 3.3V? Is it to provide offset?
Or does it make a differential so that it does not exceed 3.3v?
Thanks.
Hi.
in very short - R18 provides offset, yes.
offset * gain ~1.6 V (the middle of 0 and 3.3. this is so we can have full sine wave without negative voltage source on opamp. zero amps thus is 1.6V
gain is about 22 - full current range that can be read is almost 450A.
if you only want 20A max, you can use a bigger shunt, and size the opamp so the max current you can read is somewhere in 30-40 range.