Help getting the transfer function of a circuit

I have been trying to get the transfer function of the circuit below for some days now and I eventually get to an expression but I don't believe I am geting the correct expression and here's why (the words "Circuito" translate directly to "circuit"):

Ignore the dotted lines, those are meant to guide the analysis. I have tried to get an expression by using the superposition of the two circuits that the dotted lines enclose. So I would have:

$$V_{outA}=\bigg(1+\frac{R_{5}}{R_{4}}\bigg)V_{in}$$ Since its just a mere non inverting configuration of the OpAmp. For the circuit B I would have: $$V_{outB}=\bigg(1+\frac{R_{5}}{R_{4}}\bigg)\bigg(\frac{R_{2}}{R_{2}+R_{3}}V_{+5}\bigg)$$

and the total response at the opamp would then be: $$V_{out}=V_{outA}+V_{outB}=\bigg(V_{in}+\frac{R_{2}}{R_{2}+R_{3}}V_{+5}\bigg)\bigg(1+\frac{R_{5}}{R_{4}}\bigg)$$

Finnaly at the passage through the RC filter it would be:

$$V_{out}=\bigg(V_{in}+\frac{R_{2}}{R_{2}+R_{3}}V_{+5}\bigg)\bigg(1+\frac{R_{5}}{R_{4}}\bigg)\frac{1}{1+j\omega R_{6}C_{3}}$$

when left in complex form. To get something to work with I wrote:

$$|V_{out}|=\bigg|\bigg(V_{in}+\frac{R_{2}}{R_{2}+R_{3}}V_{+5}\bigg)\bigg(1+\frac{R_{5}}{R_{4}}\bigg)\bigg|\frac{1}{\sqrt{1+(2\pi fR_{6}C_{3})^{2}}}$$

$$\phi=-\arctan(2\pi fR_{6}C_{3})$$

However, when I use this expressions, and I fix the values of R1,R2,R4 o 1kOhm, R6 to 12kOhm, C1=1uF, C2=100uF and C3=150nF The values I get for a resistance in the places of the potentiometer are R3=5100Ohm and R5=2500Ohm when Vin is a 0.8V sinusoidal signal and Vout will be a 2.5V sinusoidal signal with a 2.5V offset. But in practice I had to use a 20k potentiometer in R5 and a 10k for R3 so My intuition is that my expression is wrong, and the simulations in multisim also point in that direction. Where is my mistake?

PS: This circuit as appeared in two other questions here in the stack but I am a bit desperate to get a correct answer and its killing me not knowing where my mistake is. • What is V1, in your circuit? Dec 22 '19 at 12:22
• Its nothing. It was just something to help explainging the analysis. Just a label. I forgot to get it out Dec 22 '19 at 12:22

Because of the fact that $$\R_3\$$ is a potentiometer. It is much more complicated than you think. And to simplify the equations, you should pick $$\R_3 << R_2\$$. Or add a voltage follower between POT wiper and $$\R_2\$$

Then we can write the equation for the voltage at the non-inverting input:

$$V_{NI} = V_1\frac{R_1}{R_1+R_2}+ V_{IN}\frac{R_2}{R_1+R_2}$$

Or if we include the POT in the equation:

$$V_{NI} = \alpha V_{+5}\frac{R_1}{R_1+(1 -\alpha)\alpha R_3+R_2}+ V_{IN}\frac{(1 -\alpha)\alpha R_3+R_2}{R_1+(1 -\alpha)\alpha R_3+R_2}$$

Where: $$\\alpha =\$$ POT wiper position from 0 to 1.

And since $$\R_3\$$ POT is supplied from a DC voltage it will create a DC offset at the op-amp output.

Equal to $$V_{offset} = \alpha V_{+5}\frac{R_1}{R_1+(1 -\alpha)\alpha R_3+R_2} \left( 1 + \frac{\alpha_5 R_5}{R_4}\right)$$

Where $$\\alpha_5 =\$$ is a $$\R_5\$$ POT wiper position from 0 to 1.

All this means that if for example, the DC offset at the op-amp output is set by $$\R_3\$$ to $$\2.5V\$$.

Then the op-amp output voltage will be:

$$V_O = 2.5V + V_{IN} \left( 1 + \frac{\alpha_5 R_5}{R_4}\right)$$

So, now you got all the information needed to solve your problem.

• That is much more complicated than I thought, and definitely helps. Just got confused on something, you considered V1 to be just a label and not an external source, right? And what is the V_NI? Dec 22 '19 at 13:58
• @Bidon V1 is just a label included on your schematic (output voltage from R3 pot). And V_NI = Voltage at Non-Inverting input.
– G36
Dec 22 '19 at 14:05
• R3 and R5 are the maximum resistance of the potentiometer. And alpha is a wiper position to get "equivalent" resistance. When the wiper is in the upper position alpha=1. In the middle alpha = 0.5 and on the bottom alpha = 0.
– G36
Dec 22 '19 at 14:36
• Do you mean this equation ? $$V_{NI} = V_1\frac{R_1}{R_1+R_2}+ V_{IN}\frac{R_2}{R_1+R_2}$$
– G36
Dec 22 '19 at 18:13
• As for C2 capacitor. I treated C2 as a bypass capacitor (capacitor that shorts any AC signals at V1 point to the ground).
– G36
Dec 22 '19 at 18:15

Well, first of all we can exclude $$\\text{C}1\$$ and $$\\text{C}2\$$ from our calculation because the're used for filtering etc.

The circuit we are dealing with is given by: simulate this circuit – Schematic created using CircuitLab

In order to solve for $$\\text{V}_+\$$ we get:

$$\begin{cases} \text{I}_{\text{R}_2}+\text{I}_{\text{R}_3}=\text{I}_{\text{R}_4}\\ \\ \text{I}_{\text{R}_1}=\text{I}_{\text{R}_2}\\ \\ \text{I}_{\text{R}_1}=\frac{\text{V}_1-\text{V}_+}{\text{R}_1}\\ \\ \text{I}_{\text{R}_2}=\frac{\text{V}_+-\text{V}_3}{\text{R}_2}\\ \\ \text{I}_{\text{R}_3}=\frac{\text{V}_2-\text{V}_3}{\text{R}_3}\\ \\ \text{I}_{\text{R}_4}=\frac{\text{V}_3}{\text{R}_4} \end{cases}\space\Longleftrightarrow\space\text{V}_+=\frac{\text{R}_2(\text{R}_3+\text{R}_4)\text{V}_1+\text{R}_4(\text{R}_3\text{V}_1+\text{R}_1\text{V}_2)}{\text{R}_3(\text{R}_1+\text{R}_2)+\text{R}_4(\text{R}_1+\text{R}_2+\text{R}_3)}\tag1$$

Now, we also know that:

$$\text{V}_-=\frac{\text{R}_5}{\text{R}_5+\text{R}_6}\cdot\text{V}_\text{opamp}\tag2$$

And:

$$\frac{\text{V}_\text{out}}{\text{V}_\text{opamp}}=\frac{\frac{1}{\text{sC}}}{\frac{1}{\text{sC}}+\text{R}_7}=\frac{1}{1+\text{sCR}_7}\tag3$$

Using the fact that in an ideal opamp circuit we have $$\\text{V}_+=\text{V}_-\$$. So we get:

$$\frac{\text{R}_5}{\text{R}_5+\text{R}_6}\cdot\left(1+\text{sCR}_7\right)\text{V}_\text{out}=\frac{\text{R}_2(\text{R}_3+\text{R}_4)\text{V}_1+\text{R}_4(\text{R}_3\text{V}_1+\text{R}_1\text{V}_2)}{\text{R}_3(\text{R}_1+\text{R}_2)+\text{R}_4(\text{R}_1+\text{R}_2+\text{R}_3)}\tag4$$

• $$\text{C}=150\cdot10^{-9}\space\text{F}\tag5$$
• $$\text{R}_1=\text{R}_2=\text{R}_5=1000\space\Omega\tag6$$
• $$\text{R}_6=2500\space\Omega\tag7$$
• $$\text{R}_7=12000\space\Omega\tag8$$
• $$\text{V}_2=\frac{5}{\text{s}}\tag9$$
• $$\text{V}_1=\mathcal{L}_t\left[\frac{4}{5}\cdot\sin\left(\omega t\right)\right]_{\left(\text{s}\right)}=\frac{4}{5}\cdot\frac{\omega}{\text{s}^2+\omega^2}\tag{10}$$

Let's assume that $$\\text{R}_3=\text{R}_4=10000\space\Omega\$$ and $$\\omega=1\space\text{rad/sec}\$$. The output voltage is given by:

$$\text{V}_\text{out}\left(\text{s}\right)=\frac{250\left(25\text{s}^2+48\text{s}+25\right)}{\text{s}\left(5000+9\text{s}\right)\left(\text{s}^2+1\right)}\tag{11}$$

Using inverse Laplace transform we get:

$$\text{v}_\text{out}\left(t\right)=250\left(\frac{1}{200}-\frac{24913681\exp\left(-\frac{5000t}{9}\right)}{5000016200}-\frac{48\left(9\cos\left(t\right)-5000\sin\left(t\right)\right)}{25000081}\right)\tag{12}$$

I checked my solution using LTspice and my result is indeed correct.