Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/Csource.m4

raw
1 .PS
2 # Csource.m4
3 cct_init
4
5 # Set small text size
6 iflatex(`textoffset = 1bp__; ifpsfrag(`textht = 9bp__',
7 `latexcommand({\scriptsize)')')
8
9 linewid = 0.4 # Reduce element sizes
10
11 define(`npair',`[define(`m4lr',ifelse(`$1',,ljust,rjust))
12 J: mosfet(down_ dimen_,ifelse(`$1',,R,L),uHSDF,E)
13 "$Q_{$2}$" ljust "`2N5464'" ljust at J.nw+(-4pt__,9pt__)
14 G: J.G
15 line ifelse(`$1',,right,left) dimen_/4 from J.D
16 Q: bi_tr(up_ dimen_,ifelse(`$1',,L,R),,E) with .B at Here
17 ifelse(`$1',,r,l)label(,"$Q_{`$3'}$" m4lr "2N4239")
18 E: Q.E
19 S: dot(at (Q.C,J.S))
20 line from J.S to S then to Q.C ]')
21
22 define(`ppair',`[define(`m4lr',ifelse(`$1',,ljust,rjust))
23 J: mosfet(down_ dimen_,ifelse(`$1',,R,L),dHSDF,E)
24 "$Q_{$2}$" ljust "`2N3819'" ljust at J.sw+(0,-8pt__)
25 G: J.G
26 line ifelse(`$1',,right,left) dimen_/4 from J.S
27 Q: bi_tr(down_ dimen_,ifelse(`$1',,R,L),P,E) with .B at Here
28 ifelse(`$1',,l,r)label(,"$Q_{`$3'}$" m4lr "2N4236")
29 E: Q.E
30 S: dot(at (Q.C,J.D))
31 line from J.D to S then to Q.C ]')
32
33 R2: resistor(down_ dimen_)
34 llabel(,"$R_2$" ljust "\num{150}")
35 dot
36 Q13: bi_tr(down_ dimen_,,P,E) with .E at Here
37 rlabel(,"$Q_{13}$" rjust "2N4236")
38 line down 3.1*elen_ from Q13.C
39 Q14: bi_tr(up_ dimen_,R,,E) with .C at Here
40 llabel(,"$Q_{14}$" rjust "2N4239")
41 dot(at Q14.E)
42 { line left_ dimen_*1.3 then up_ dimen_
43 R1: potentiometer(up_ dimen_) with .Start at Here
44 rlabel(,"$R_1$" ljust "\SI{20}{\kilo{}}")
45 { ground(at R1.T1) }
46 line from R1.End to (R1.End,Q13.E) then to Q13.E }
47 { dot(at Q13.C+(0,-elen_))
48 line to (R1.R,Here)+(-dimen_/2,0)
49 { arrowline(right_ dimen_/2); llabel(,i_1) }
50 V1: gap(down_ dimen_,1); rlabel(+,V_1,-)
51 line down_ dimen_/4 chop dotrad_ chop 0; ground(,T) }
52 R3: resistor(down_ dimen_)
53 llabel(,"$R_3$" ljust "\num{150}")
54 dot(at Q13.C+(0,-2*elen_))
55 line right_ dimen_/2
56 A1: opamp with .In2 at Here; "A$_1$" at A1.C
57 "Nexus" ljust "`SQ-10A'" ljust at A1.sw+(0,-10pt__) below
58 line left_ dimen_/4 from A1.In1 then up_ dimen_/2 then right dimen_
59 dot
60 { resistor(up_ elen_)
61 llabel(,"$R_{14}$" rjust "\SI{19}{\kilo{}}")
62 line to (Here,Q13.E) then to Q13.E }
63 line to (A1.Out,Here)
64 dot
65 { line to A1.Out
66 dot
67 resistor(down_ to (Here,Q14.E))
68 llabel(,"$R_{13}$" ljust "\SI{91}{\kilo{}}")
69 line to Q14.E }
70 R6: resistor(right_ dimen_)
71 clabel(,"$R_6$" "\vphantom{x}" "\SI{15}{\kilo{}}")
72 dot
73 line to (Here,A1.In1) then right_ dimen_/4
74 A2: opamp with .In1 at Here; "A$_2$" at A2.C
75 "Nexus" ljust "`SQ-10A'" ljust at A2.sw+(0,-10pt__) below
76 line left_ dimen_/4 from A2.In2
77 ground
78
79 dot(at A2.Out)
80 DP1: npair(,3,4) with .E at (A2.Out,Q14.B)+(elen_*1.25,0)
81 line from A2.Out to (A2.Out,DP1.G) then to DP1.G
82 line from DP1.E to (DP1.E,R3.bottom); dot
83 D4: reversed(`diode',up_ dimen_/2 from DP1.S)
84 D3: reversed(`diode',up_ dimen_/2 from Here+(0,-dimen_/7))
85 llabel(,"`OMC-V'" rjust "$D_3$" rjust "$D_4$")
86 DP2: ppair(,1,2) with .E at (DP1.E,Q13.B)
87 D1: diode(down_ dimen_/2 from DP2.S)
88 D2: diode(down_ dimen_/2 from Here+(0,dimen_/6))
89 { "$D_1$" rjust "$D_2$" rjust "`OMC-V'" rjust at last [].nw }
90 dot(at (Here,A2))
91 line to D2.bottom
92 line from DP2.G to (A2.Out,DP2.G) then to A2.Out
93 line from DP2.E to (DP2.E,R2.top); dot
94
95 T: dot(at (DP1.E,A2)+(dimen_,0))
96 DP3: npair(,7,8) with .G at (Here,DP1.G)+(dimen_/4,0)
97 dot(at DP3.E)
98 line to Q14.B
99 DP4: ppair(,5,6) with .G at (DP3.G,DP2.G)
100 dot(at DP4.E)
101 line to Q13.B
102 line from DP3.G to (T,DP3.G) then to (T,DP4.G) then to DP4.G
103 R11: resistor(down_ dimen_ from DP4.S)
104 rlabel(,"$R_{11}$" rjust "\num{20}")
105 D5: diode(up_ from DP3.S to (DP3.S,A2),Z)
106 llabel(,"$D_5$" rjust "1N4729$_{\strut}$")
107 line to R11.end
108 C4: capacitor(right_ dimen_*1.3 from DP3.S,C)
109 llabel(,C_4); rlabel(,\SI{0.68}{\micro\farad})
110 C3: capacitor(right_ dimen_*1.3 from DP4.S,C)
111 llabel(,C_3); rlabel(,\SI{0.68}{\micro\farad})
112 dot
113 dot(at (Here,R6))
114 C2: reversed(`capacitor',left_ dimen_*1.3,C)
115 rlabel(,C_2); llabel(,\SI{0.1}{\micro\farad})
116 line to R6.end
117
118 R5: resistor(up_ from R6.end to (R6.end,Q13.B))
119 rlabel(,"$R_5$" ljust "\SI{100}{\kilo{}}")
120 dot(at R5.top-(0,dimen_/2))
121 line left_ dimen_/2
122 capacitor(down_ dimen_,C)
123 rlabel(,"$C_1$" rjust "\SI{1}{\micro\farad}")
124 ground(,T)
125
126 line from DP4.E to (DP4.E,R2.bottom)
127 resistor(up_ to (Here,R2.top))
128 rlabel(,"$R_9$" ljust "\num{910}")
129 dot
130 resistor(down_ from DP3.E to (DP3.E,R3.bottom))
131 llabel(,"$R_{10}$" ljust "\num{910}")
132 dot
133
134 line from R5.top to (R5,Q13.E)
135 resistor(right_ elen_)
136 clabel(,"$R_4$" "\vphantom{x}" "\SI{100}{\kilo{}}")
137 line to (C4.end,Here) then to C4.end
138
139 DP5: npair(L,11,10) with .E at (C4.end,DP1.E)+(elen_*0.8,0)
140 line from DP5.E to (DP5.E,R3.bottom); dot
141 line from R3.bottom to Here+(dimen_/2,0)
142 dot(,,1)
143 `"$-E_{CC}$"' ljust at last [].e
144 D6: diode(up_ from DP5.S to (DP5.S,A2),Z)
145 llabel(,"$D_6$" rjust "1N4728")
146 DP6: ppair(L,12,9) with .E at (DP5.E,DP2.E)
147 line from DP6.E to (DP6.E,R2.top); dot
148 line from R2.top to Here+(dimen_/2,0)
149 dot(,,1)
150 `"$+E_{CC}$"' ljust at last [].e
151 resistor(down_ from DP6.S to (DP6.S,C2))
152 rlabel(,"$R_{12}$" rjust "\num{20}")
153 dot
154 { line to C2.e }
155 line to D6.end
156
157 Vr: dot(at (DP6.G,V1.top)+(dimen_/4,0))
158 line from DP6.G to (Vr,DP6.G) then to (Vr,DP5.G) then to DP5.G
159 reversed(`arrowline',right_ dimen_/2 from Vr); llabel(,i_2)
160 V2: gap(down_ dimen_,1); llabel(+,V_2,-)
161 line down_ dimen_/4 chop dotrad_ chop 0; ground(,T)
162
163 dot(at (Vr,T))
164 resistor(left_ to (DP6.E,Here))
165 clabel("$R_{15}$" "" "\num{200}" ljust)
166 line to (DP1.E,Here)
167 dot
168
169 iflatex(ifpsfrag(,`latexcommand(})'))
170 .PE