0

I went back to Latex a few days ago: my memories are a little rusty. For a simple circuit, I manage to find my bearings but I am stuck in a few more complex situations.

I try to reproduce this pattern schema

but I am stuck to place the various components connected to the V- terminal: I imagine that it is necessary to use the relative positions but I do not see how to code it.

Thanks for your help.

Rmano
  • 40,848
  • 3
  • 64
  • 125
Nicolas
  • 1,023
  • On page 183 of the manual you have a full example of a Sallen-Key cell --- why don't you try to start from there and post a minimal working example (MWE)? – Rmano Dec 23 '20 at 09:58
  • BTW, are you sure about the circuit? That positive feedback with a fixed input is... well... suspicious – Rmano Dec 23 '20 at 10:00
  • I read the documentation: in the example of the Sallen-Key cell, the op amp is positioned at (5, .5) How are these values evaluated? The value 0.5 corresponds to the height from the "low" point of the op amp? In my case, I use the European model (in amp): are the dimensions (and therefore the position of the + and - inputs) of the op amp defined? Thank you PS : the diagram is just an example, not corresponding to any real assembly – Nicolas Dec 23 '20 at 15:39
  • The op amp is positioned by its center anchor, but you can change that using [anchor=-] (for example). The anchors for each component are shown in the manual (page 97). – John Kormylo Dec 23 '20 at 16:57
  • I tried to reproduce the Sallen-Key cell with the European operational amplifier but the placement of the resistor Rd is never at the input level (by placing the resistor as in the documentation: (0,0) node [left] {$ U_e $} to [R, l = $ R_d $, o- *] (2,0)): if (5,0) node [in amp] (opamp) {}: resistance too high if (5,0.25) node [in amp] (opamp) {}: resistance too high if (5,0.5) node [in amp] (opamp) {}: resistance too low – – Nicolas Dec 23 '20 at 17:06
  • @Nicolas, you need to read the TikZ manual and understand the concept of coordinates, nodes and anchors before using circuitikz. Once the node (in this case the op amp) is positioned and named, the various points have names like (opamp.-), (opamp.+) etc. Anyway, post what you have and we will try to help – Rmano Dec 23 '20 at 19:49
  • I try step by step : \draw (0,0) node[en amp] (opamp){} (opamp.+) to[short, -*] ++(-0.5,0) node (RdCd2) {} to[C] ++(0,-2) node[ground](gnd){} ++(0,-1) (RdCd2) to [R, l=$R_d$] ++(-2,0) node (RdRd){} ; the node RdCd2 and the resistor Rd are not connected : where is the problem ? – Nicolas Dec 24 '20 at 16:47
  • You should not use a node for a coordinate --- anyway, please, next time edit your question with the code... see https://tex.stackexchange.com/a/113532/38080 (BTW, if you don't ping me with @Rmano I will not get notified...) – Rmano Dec 28 '20 at 14:57
  • @Nicolas please have alook at the answer below if it meets the requirement – js bibra Dec 28 '20 at 15:09

2 Answers2

2

One possible example of a solution (again, check the circuit --- it has little sense as it is now!)

\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}[european]
\draw (0,0) node[en amp] (opamp){}
    (opamp.+) -- ++(0,-1) -| (opamp.out)
    to[R=\SI{10}{\ohm}, *-] ++(3,0) node[right]{$v_{\mathit{out}}$}
    (opamp.-) to[R, l_=\SI{9.87}{\kohm}, *-] ++(0,3) node[cground, rotate=180]{}
    (opamp.-) to[short,-*] ++(-1,0) coordinate(divid);
\draw (divid) to[R, l=\SI{988}{\ohm}] ++(0,2) -- ++(-2,0)
    to[battery, l_=\SI{5}{V}, invert] ++(0,-4) node[cground](GND){};
\draw (divid) to[R, l_=\SI{364.1}{\ohm}] (divid|-GND) node[cground]{};
\end{circuitikz}
\end{document}

enter image description here

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • +1, however, why for example to [R, l_=\SI{9.87}{\kohm}, *-] and not to [R, l_=9.87<\kohm>, *-]? – Zarko Dec 28 '20 at 15:22
  • @Zarko, you are right --- this is personal preference. I do not like the extra syntax with <>, and I use the \SI{}{} one everywhere for coherence (with the text, captions, etc.). I shouldn't use the option either, but I am lazy, so I avoid loading siunitx by hand ;-) – Rmano Dec 28 '20 at 15:26
  • :-) , but documentation for circuitikz suggest to use it ;-) – Zarko Dec 28 '20 at 15:27
  • Yep, that was previous to my maintenance --- in the manual, it is stated it's experimental, though. – Rmano Dec 28 '20 at 15:28
1

enter image description here

\documentclass[margin=3mm]{standalone}
\usepackage{siunitx}

\usepackage[european, straightvoltages]{circuitikz} \usetikzlibrary{positioning} \ctikzset{ amplifiers/fill=cyan, resistors/fill=violet, } \begin{document} \begin{circuitikz}[ line width = 0.8pt, ]

    \node[op amp] (A1) {\texttt{}};
    \draw(A1.out) to [R,l^=10\si{\ohm},*-]++(4,0)node[right]{$v_{out}$};
    \draw(A1.out) to++(0,-2)-|(A1.+);
    \draw(A1.-)to [R,l_=987k\si{\ohm},*-]++(0,2)to node[cground, rotate=180]{}++(0,1);
    \draw(A1.-)to [short,-*]++(-1,0)to [R,l_=3641\si{\ohm}]++(0,-2)to node[cground](cgnd){}++(0,-1);
    \draw(A1.-)to [short,-*]++(-1,0)to [R,l^=988\si{\ohm}]++(0,2) to [short]++(-2,0)coordinate(tmp) to [battery, l_=15V] (tmp |-cgnd) node[cground]{};

\end{circuitikz}

\end{document}

js bibra
  • 21,280
  • 1
    nice and colorful, +1. Better to use \SI{val}{unit} to have correct spacing between the value and the unit (half space) – Rmano Dec 28 '20 at 15:16