5

I would like to reproduce this diagram including 3 operational amplifiers : enter image description here

I have a problem for the connection of the 3rd operational amplifier: even by adjusting the heights of the wires for the connections of R1 and R'1, I cannot make the connection.

enter image description here

Could you help me get there?

Thank you

\documentclass[border=1mm]{standalone}
\usepackage[european, straightvoltages]{circuitikz}

\begin{document}
\begin{circuitikz}
\draw (0,0) node[en amp](aop2){AO2};
\draw (aop2.+) to[short] ++(-0.5,0) to[open, v<=$v_2$] ++(0,-1) node[ground]{};
\draw (aop2.out) --++(0.5,0) coordinate (out2) to[R=$R$] ++(0,2) coordinate (RP) to [pR, wiper pos=0.3, mirror, n=curseur, l=$P$] ++(0,2) coordinate (PR) to[R=$R$] ++(0,2) coordinate (out1) --++(-0.5,0) node[en amp, noinv input up, anchor=out](aop1){};
\draw (aop2.-) --(aop2.- |- RP) to[short] (RP);
\draw (RP) -| (curseur.wiper) to[short] (curseur.wiper);
\draw (PR) -| (aop1.-);
\draw (aop1.+) --++(-1,0) to[open, v<=$v_1$] ++(0,-1) node[ground]{};
\draw (out2) --++(1,0) to[short] ++(0,2.7) to[R, l_=$R'_1$] ++(2,0) coordinate (in+3) --++(0.5,0)  node[en amp, anchor=+](aop3){AO3};
\draw (in+3) to[R, l_=$R'_2$] ++(0,-2) node[ground]{};
\draw (out1) --++(1,0) to[short] ++(0,-2.6) to[R=$R_1$] ++(2,0) coordinate (in-3) --++(0.5,0);
\draw (in-3) --++(0,1) coordinate (R) to[R=$R_2$] (R-|aop3.out) to[short] (aop3.out) --++(0.5,0) to[open, v<=$v_s$] ++(0,-1) node[ground]{};
    \end{circuitikz}
\end{document}
5
  • Not related to circuitikz but: <electronics teacher hat on> if this is meant to be a variable-gain instrumentation amplifier, you are missing a connection dot where you have the two-wires crossing between P and R. <electronics teacher hat off> – Rmano Jan 31 at 22:07
  • @Rmano : I don't understand what is missing: wouldn't it be more to tell me that there must not be a connection between the wire coming from AO2.- and the wire between R (from the bottom) and P ? In this case, I will remove the mirror as suggested – Nicolas Feb 1 at 8:56
  • Nicolas: obviusly depends on the circuit, but if it is what I think, yes there must be a connection. The problem is that if you do not draw a dot, the standard interpretation of the circuit is that there is no connection (when you cross wires, it is no connection unless you put a dot). So the circuit is ok but you need to add the dot. – Rmano Feb 1 at 11:53
  • As an aside, using the potentiomer is, in my opinion, an implementation detail --- you just need a variable resistance there. – Rmano Feb 1 at 11:54
6

It is better to compute the coordinate (0,-2.6) instead of guessing the correct value. For this, I label the corner at resistor R_1' by (in+3'). Then (0,-2.6) can be replaced by (in+3'|-aop3.-).enter image description here

\documentclass[border=1mm]{standalone}
\usepackage[european, straightvoltages]{circuitikz}

\begin{document}
\begin{circuitikz}
  \draw (0,0) node[en amp](aop2){AO2};
  \draw (aop2.+)
    to[short] ++(-0.5,0)
    to[open, v<=$v_2$] ++(0,-1) node[ground]{};
  \draw (aop2.out)
    -- ++(0.5,0) coordinate (out2)
    to [R=$R$] ++(0,2) coordinate (RP)
    to [pR, wiper pos=0.3, mirror, n=curseur, l=$P$] ++(0,2) coordinate (PR)
    to [R=$R$] ++(0,2) coordinate (out1)
    -- ++(-0.5,0) node[en amp, noinv input up, anchor=out](aop1){};
  \draw (aop2.-)
    --(aop2.- |- RP)
    to[short] (RP);
  \draw (RP)
    -| (curseur.wiper)
    to[short] (curseur.wiper);
  \draw (PR) -| (aop1.-);
  \draw (aop1.+)
    -- ++(-1,0)
    to[open, v<=$v_1$] ++(0,-1) node[ground]{};
  \draw (out2)
    -- ++(1,0)
    to[short] ++(0,2.7) coordinate (in+3') % <<< defined here
    to[R, l_=$R'_1$] ++(2,0) coordinate (in+3)
    -- ++(0.5,0)  node[en amp, anchor=+](aop3){AO3};
  \draw (in+3)
    to[R, l_=$R'_2$] ++(0,-2) node[ground]{};
  \draw (out1)
    -- ++(1,0) to[short] (in+3'|-aop3.-)   % <<< used here
    to[R=$R_1$] ++(2,0) coordinate (in-3)
    -- ++(0.5,0);
  \draw (in-3)
    --++(0,1.4) coordinate (R)
    to[R=$R_2$] (R-|aop3.out)
    to[short] (aop3.out)
    -- ++(0.5,0)
    to[open, v<=$v_s$] ++(0,-1) node[ground]{};
  \end{circuitikz}
\end{document}
4
  • :I understand the principle. The value (0,2.6) was obtained by trial and error. There is perhaps a cleaner solution allowing to place the opamp3 in the middle of the opamp1 and 2 then to add the connection elements between the ampop ? – Nicolas Feb 1 at 8:57
  • @Nicolas I think that the present solution is clean in the sense that the drawing contains no trial-and-error values but only those needed to fix the degrees of freedom. Yes, it is possible to place aop3 in the middle of the other two and to get rid of 2.7. Later today I will try to come up with a solution. It's more complicated than fixing a single coordinate. – gernot Feb 1 at 11:47
  • To arrive at the value of 2.7, it took me several tries to find the cleanest one. Thank you for your help. – Nicolas Feb 1 at 11:50
  • 1
    @gernot You can position the third amplifier, for example, by putting it at the left of the input totem pole, centered. Like \path ($(aop2.center)!0.5!(aop1.center)$) ++(5,0) node[en amp](aop3){} and then connect from there. – Rmano Feb 1 at 11:59
5

I have no time to redraw it now how I did it (but look below) (I think that the position of the potentiometer is unfortunate; just mirror it to avoid the cross). I commented how to match the last two connections, but probably @gernot solution is much better than mine.

Explanation in the comments

\documentclass[border=1mm]{standalone}
\usepackage[european, straightvoltages]{circuitikz}

\begin{document}
\begin{circuitikz}
\draw (0,0) node[en amp](aop2){AO2};
\draw (aop2.+) to[short] ++(-0.5,0) to[open, v<=$v_2$] ++(0,-1) node[ground]{};
\draw (aop2.out) --++(0.5,0) coordinate (out2) to[R=$R$] ++(0,2) coordinate (RP) to [pR, wiper pos=0.3, mirror, n=curseur, l=$P$] ++(0,2) coordinate (PR) to[R=$R$] ++(0,2) coordinate (out1) --++(-0.5,0) node[en amp, noinv input up, anchor=out](aop1){};
\draw (aop2.-) --(aop2.- |- RP) to[short] (RP);
\draw (RP) -| (curseur.wiper) to[short] (curseur.wiper);
\draw (PR) -| (aop1.-);
\draw (aop1.+) --++(-1,0) to[open, v<=$v_1$] ++(0,-1) node[ground]{};
% let's mark where we go up here, exiting from out2
\draw (out2) --++(1,0) coordinate(go up) to[short] ++(0,2.7) to[R, l_=$R'_1$] 
      ++(2,0) coordinate (in+3) --++(0.5,0)  node[en amp, anchor=+](aop3){AO3};
\draw (in+3) to[R, l_=$R'_2$] ++(0,-2) node[ground]{};
% now we need to connect (out1) to the (-) of the amplifier via R_1. 
% It seems you want a (0.5,0) space before, to align to the resistor below; 
% so let's start from aop3.- ; use (go up) to make the "turn"
\draw (aop3.-) -- ++(-0.5,0) coordinate (in-3) to[R, l_=$R_1$] (in-3-|go up) |- (out1);
% build the feedback loop a bit taller
\draw (in-3) --++(0,1.5) coordinate (R) to[R=$R_2$] (R-|aop3.out) to[short] (aop3.out) --++(0.5,0) to[open, v<=$v_s$] ++(0,-1) node[ground]{};
    \end{circuitikz}
\end{document}

By the way, I will now copy how I drew it in my notes for electronic instrumentation. I use American symbols (because they are symbols, and you do not have to read text to understand what is what, which in my opinion makes the circuits so much more visible at a glance), and I tried to avoid a) unnecessary corners and b) crossings (this one sometimes is impossible).

enter image description here

\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\ctikzsetstyle{romano}
\begin{document}
\begin{circuitikz}[scale=0.7, transform shape]
    % totem pole
    \draw (0,0) node[op amp, noinv input up](A1){\texttt{A1}}
    (A1.+) to[short, -o] ++(-1,0) coordinate(ainst-) node[left]{$v^-$}
    (A1.-) to [short, -o] ++(0,-1) coordinate (ra-up);
    \draw (ra-up) to[vR, l_=$R_A$, name=RA0, o-o] ++(0,-2) coordinate (ra-down);
    \draw (ra-down) to [short, o-] ++(0,-1) node[op amp, anchor=-](A2){\texttt{A2}}
    (A2.+) to[short, -o] (A2.+ -| ainst-) coordinate(ainst+) node[left]{$v^+$}
    (ra-up) to[R, l_=$R_B$, name=RB1, o-] (ra-up -| A1.out) coordinate(vup) -- (A1.out)
    (ra-down) to[R=$R_B$, name=RB2] (ra-down -| A2.out) coordinate(vdn) -- (A2.out)
    ;
    % differential amplifier : position to avoid bends
    \draw (vdn) to[R=$R$, name=R1] ++(2,0) node[op amp, anchor=+](A3){\texttt{A3}}
    (A3.+) to[R=$R$, -o, name=R2] ++(0,-2)
    to[battery2, l_=$V_\mathrm{ref}$, invert, o-] ++(0,-1) node[ground]{}
    (vup) to[R=$R$, name=R3] (A3.- |- vup) coordinate(a3fb) --(A3.-)
    (a3fb) to [R=$R$, name=R4] (A3.out |- a3fb) -- (A3.out)
    to [short, -o] ++(.5,0) node[above]{$v_o$}
    ;
\end{circuitikz}
\end{document}
1

With your recommendations, I come to this:

\documentclass[border=1mm]{standalone}
\usepackage[european, straightvoltages]{circuitikz}

\begin{document}
\begin{circuitikz}
  \draw (0,0) node[en amp](aop2){AO2};
  \draw (aop2.+)
    to[short] ++(-0.5,0)
    to[open, v<=$v_2$] ++(0,-1) node[ground]{};
  \draw (aop2.out)
    -- ++(0.5,0) coordinate (out2)
    to [R=$R$] ++(0,2) coordinate (RP)
    to [vR, l=$P$] ++(0,2) coordinate (PR)
    to [R=$R$] ++(0,2) coordinate (out1)
    -- ++(-0.5,0) node[en amp, noinv input up, anchor=out](aop1){};
  \draw (aop2.-)
    --(aop2.- |- RP)
    to[short] (RP);
  \draw (PR) -| (aop1.-);
  \draw (aop1.+)
    -- ++(-1,0)
    to[open, v<=$v_1$] ++(0,-1) node[ground]{};
  \path ($(aop2.center)!0.5!(aop1.center)$) ++(6,0) node[en amp](aop3){};
  \draw (out2)
    -- ++(1,0) coordinate (out2)
    to[short] (out2|-aop3.+) 
    to[R, l_=$R'_1$] ++(2,0) coordinate (in+3)
    to[short] (aop3.+);
  \draw (in+3)
    to[R, l_=$R'_2$] ++(0,-2) node[ground]{};
  \draw (out1)
    -- ++(1,0) coordinate (out1)
    to[short] (out1|-aop3.-) 
    to[R, l=$R_1$] ++(2,0) coordinate (in-3)
    to[short] (aop3.-);
  \draw (in-3)
    --++(0,1.4) coordinate (R)
    to[R=$R_2$] (R-|aop3.out)
    to[short] (aop3.out)
    -- ++(0.5,0)
    to[open, v<=$v_s$] ++(0,-1) node[ground]{};
\end{circuitikz}
\end{document}

It seems correct : enter image description here

4
  • Yes, it's correct, and it's quite nice (even with the European symbols... 😉) – Rmano Feb 1 at 14:18
  • rectangles are much prettier than triangles and zig zag @Rmano ;) – Nicolas Feb 1 at 14:23
  • In Spanish they say "por gustos los colores", that is, everyone is entitled to their tastes... ;-) – Rmano Feb 1 at 14:24
  • it is with this kind of circuits that the power of latex / circuitikz shows all its beauty! – Nicolas Feb 1 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.