Debian Codegraph @

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

raw
1 .PS
2 # Tubediags.m4
3
4 cct_init
5 include(tubedefs.m4)
6
7 ifpostscript(,iflatex(`latexcommand({\sf)'))
8
9 Overall:[
10
11 # Some base diagrams
12 [ Loopover_(`xv',`
13 V_`'xv: m4xpand(B_`'xv) ifelse(m4Lx,1,,
14 `with .Base at last [].Base+(dimen_*3,0)')
15 "xv" at V_`'xv.Base.s+(0,-dimen_/3) below',
16 2AG,2D,4BB,9K) ]
17
18 # Test circuit
19 [
20 Ld: dot
21 battery(up dimen_,2)
22 line right_ dimen_
23 Pot1: potentiometer(down_ dimen_*2,5) with .Start at Here
24 line from Pot1.End left_ dimen_
25 battery(up_ to Ld,2)
26 Tg: dot(at Pot1.T1)
27 source(right_ dimen_ from Pot1.T1,"\scriptsize \si{\mu A}")
28 line right_ dimen_/3
29 Tr: triode with .G1.w at Here
30 line from Tr.K1.sw to (Tr.K1.sw,Pot1.End); dot
31 { line down dimen_/2
32 B: dot }
33 source(to (Tg,Here),"\scriptsize V"); corner; line to Tg
34 line from Tr.P1.c to (Tr.P1.c,Pot1.Start)
35 source(right_ elen_,"\scriptsize mA"); llabel(-,,+); rlabel(,I_b)
36 Tp: dot
37 { source(down_ to (Here,B),"\scriptsize V"); llabel(+,,-); rlabel(,E_b); dot}
38 line right_ dimen_/2 then down_ (Here.y-B.y)/2 then right_ dimen_/2
39 P2: potentiometer(down_ Tp.y-B.y,5,0.5,-dimen_/6) with .T1 at Here
40 dot(at P2.End)
41 line right_ dimen_ from P2.Start; corner
42 battery(down_ dimen_*3/4,2,R)
43 T: Here
44 battery(up_ dimen_*3/4 from (Here,B),2)
45 line dashed up_ to T "B" ljust
46 line from (T,B) left T.x-Ld.x+dimen_/2 then up Ld.y-B.y then to Ld
47 ] with .nw at last [].sw + (0,-dimen_/2)
48
49 # Circuit of 25 W amplifier (adapted from F. Langford-Smith, "Radiotron
50 # Designer's Handbook," fourth edition, Harrison, NJ, Radio Corporation
51 # of America, 1952)
52
53 define(`OutputXformer',`[ pushdef(`dimen_',dimen_*1.5)
54 S1: inductor(up_ dimen_*.4,L,3,M)
55 { line right_ dimen_/4 from last [].e; S2T: dot(,,1)
56 line from S1.end right_ S2T.x-S1.end.x; S21: dot(,,1)
57 line from S1.start right_ S2T.x-S1.end.x; S22: dot(,,1) }
58 move up_ dimen_/8
59 S2: inductor(up_ dimen_*.4,L,3,M)
60 { line right_ dimen_/4 from last [].e; S1T: dot(,,1)
61 line from S2.end right_ S2T.x-S2.end.x; S11: dot(,,1)
62 line from S2.start right_ S2T.x-S2.end.x; S12: dot(,,1) }
63 line down_ dimen_/8 from M4Core1.start
64 line down_ dimen_/8 from M4Core2.start
65 P: inductor(down_ dimen_*0.6 with .c at 0.5 between S1.end and S2.start \
66 -(dimen_*0.8,0),L,5,)
67 P1: P.start
68 P2: P.end
69 PT: last [].w
70 popdef(`dimen_')]')
71
72 define(`PowerXformer',`[ pushdef(`dimen_',dimen_*1.5)
73 S3: inductor(up_ dimen_*.2,L,1,M)
74 ST3: last [].e
75 { line up_ dimen_/10 from M4Core1.end; line up_ dimen_/10 from M4Core2.end }
76 S2: inductor(up_ dimen_*.2 from S3.end+(0,dimen_/10),L,1,M)
77 { line up_ dimen_/10 from M4Core1.end; line up_ dimen_/10 from M4Core2.end }
78 S1: inductor(up_ dimen_*.4 from S2.end+(0,dimen_/10),L,3,M)
79 ST1: last [].e
80 P: inductor(down_ dimen_*0.6 with .c at 0.5 between S1.end and S3.start \
81 -(dimen_*0.8,0),L,5,)
82 popdef(`dimen_')]')
83
84 [ Toprail: Here
85 #{"Toprail"}
86 resistor(down_ dimen_); rlabel(,\SI{100}{\kilo{}})
87 V1P: dot
88 #{"V1P" rjust}
89 line down_ dimen_*3/4
90 V1: triode(,W) with .P1 at Here
91 {"6SL7" at V1.nw above }
92 resistor(down_ dimen_*3/2 from V1.K1.sw); llabel(,2200)
93 Rail1: dot
94 #{"Rail1"}
95 ground
96 arrow left_ from V1.G1.w
97 RP: Here
98 arrow <- right from (Here,Rail1) to Rail1
99 dot(at last arrow)
100 resistor(up_ 2nd last arrow.y-Here.y); llabel(,\SI{22}{\kilo{}}); dot
101 { move left_ dimen_ }; "Pickup" at RP below
102 capacitor(right_ dimen_ from V1P,C,R); llabel(,\SI{0.05}{\micro{}})
103 resistor(down_ dimen_); rlabel(,\SI{470}{\kilo{}})
104 V1o: dot
105 #{ "V1o" at V1o rjust }
106 resistor(down_ (Here.y-Rail1.y)/2); rlabel(,\SI{22}{\kilo{}})
107 dot
108 { capacitor(down_ Here.y-Rail1.y,C); rlabel(,\SI{0.01}{\micro{}}); dot }
109 line right_ dimen_/2
110 R47: resistor(down_ to (Here,Rail1)); llabel(,,\SI{4.7}{\mega{}})
111 line to Rail1
112
113 Pot1: potentiometer(down_ dimen_,,0.5,dimen_*2/3) \
114 with .T1 at (V1o+(elen_+dimen_*2/3,0),V1.G1)
115 { line from Pot1.Start left_ (Pot1.Start.x-V1o.x)/2
116 continue to (Here,V1o) then to V1o }
117 line from Pot1.End down_ dimen_/3
118 Rail2: dot
119 ground
120 V2: triode(,E) with .G1.w at Pot1.T1; "6SL7" at V2.ne above
121 resistor(from Rail2 right_ V2.K1.e.x-Rail2.x); rlabel(,\SI{22}{\kilo{}}); dot
122 { capacitor(right_ dimen_,C,R); rlabel(,\SI{2}{\nano{}})
123 V2k: dot }
124 #{ "V2k" at V2k above }
125 { line down_ to (Here,Rail1)
126 variable(`resistor(right_ dimen_); rlabel(,\SI{1}{\mega{}});')
127 line up_ to V2k }
128 line to V2.K1.se
129
130 line from Toprail to (R47,Toprail); dot
131 { capacitor(down_ dimen_,C); rlabel(\SI{10}{\micro{}}); ground(,T) }
132 R51k: resistor(right_ dimen_); rlabel(,\SI{51}{\kilo{}}); dot
133 { capacitor(down_ dimen_,C); llabel(\SI{10}{\micro{}}); ground(,T) }
134 dot(at (V2.P1.c,Here))
135 resistor(down_ dimen_); llabel(,\SI{100}{\kilo{}})
136 V2p: dot
137 line to V2.P1
138
139 V3: triode(,W) with .G1.w at (V2k+(dimen_,0),V2.G1)
140 "$\;$6SL7" at V3.n below ljust
141 resistor(from V3.K1.sw to (V3.K1.sw,Rail1)); llabel(,\SI{1.5}{\kilo{}}); dot; ground
142 line left_ dimen_/2
143 resistor(up_ to (Here,V3.G1)); llabel(2.2); rlabel(\hbox{M}); dot
144 { line to V3.G1.w }
145 line to (Here,V2p); capacitor(left_ to V2p,C,R); rlabel(,\SI{3}{\nano{}})
146
147 dot(at (V3.P1.c,Toprail)); { line to R51k.end }
148 resistor(down_ dimen_); llabel(,\SI{51}{\kilo{}})
149 V3p: dot
150 #{"V3p"}
151 line down_ (Here.y-V3.n.y)/2
152 V3q: dot; { line to V3.P1.c }
153 capacitor(left_ dimen_*2/3,C); rlabel(,\SI{0.1}{\micro{}})
154 line to (V2k,Here)
155 resistor(down_ to V2k); rlabel(0.1); llabel(\si{\mega{}})
156 #{"V2k" at V2k}
157
158 V4: triode(,E) with .G1.w at (V3.G1.e+(dimen_*2,0),V3.G1)
159 "6SL7" at V4.n above rjust
160 resistor(from V4.K1.se to (V4.K1.se,Rail1)); rlabel(,,\SI{1.5}{\kilo{}})
161 V4k: dot
162 #{"V4k"}
163 line left dimen_*3/4
164 V4k1: dot
165 { resistor(up_ V4.G1.y-Here.y); llabel(,,\SI{2.2}{\mega{}})
166 V4G: dot }
167 line from V3p right_ dimen_
168 variable(`resistor(down_ to (Here,V4.G1)); llabel(\SI{100}{\kilo{}})')
169 V3o: dot
170 capacitor(right_ to V4G,C); llabel(,\SI{3}{\nano{}})
171 line to V4.G1.w
172 resistor(left_ from V4k1 to (V3o,V4k)); rlabel(,\SI{51}{\kilo{}}); dot
173 ground
174 capacitor(down_ from V3o to Here,C); llabel(,,\SI{500}{\pico{}})
175
176 line from V4.P1.c to (V4.P1.c,V3p);
177 resistor(up_ dimen_); llabel(,\SI{51}{\kilo{}}); dot
178 resistor(left_ to (V3p,Here)); llabel(,\SI{10}{\kilo{}})
179
180 V5: triode(,N) with .G1.w at V4.G1.e+(2.25*dimen_,0)
181 "6SL7" at V5.n above rjust
182 V6: triode(,SR) with .G1.w at V5.G1.w-(0,dimen_*2.5)
183 "6SL7" at (V6.w,V6.P1) below rjust
184
185 V4p: dot(at (V4.P1.c,V3p))
186 #{"V4p"}
187 line right_ dimen_*2/3; capacitor(right_ dimen_,C); llabel(,\SI{3}{\pico{}})
188 line down_ to (Here,V5.G1)
189 V5G: dot; { line to V5.G1.w }
190 #{"V5G"}
191 resistor(down_ dimen_); rlabel(,\num{2.2}); llabel(,\si{\mega{}}); dot
192 resistor(right_ to (V5.K1.sw,Here)); llabel(,\SI{1}{\kilo{}})
193 V5K: dot
194 #{"V5K"}
195 line to V5.K1.sw
196 line from V4k down_ V4k.y-V6.G1.y then right_ V5G.x-V4k.x - dimen_
197 capacitor(right_ dimen_,C); rlabel(,\SI{3}{\pico{}})
198 V6G: dot; { line to V6.G1.w }
199 #{"V6G"}
200 resistor(up_ dimen_); llabel(,2.2); rlabel(,\si{\mega{}}); dot
201 resistor(right_ to (V6.K1.nw,Here)); llabel(,\SI{1}{\kilo{}})
202 V6K: dot
203 #{"V6K"}
204 line to V6.K1.nw
205 resistor(left_ dimen_*2/3 from (V6G,V6K));rlabel(,\SI{1}{\kilo{}}) dot; ground
206 line to (Here,V5K); resistor(right_ dimen_*2/3); llabel(,\SI{1}{\kilo{}})
207
208 PV: dot(at (V4.e.x+dimen_/5,Toprail.y))
209 #{"PV"}
210 line from V6.P1.c down_ V4p.y-V4.P1.c.y
211 Rail2: dot
212 #{"Rail2" below}
213 line from PV to (PV,Rail2); corner
214 { resistor(right_ to Rail2); llabel(,\SI{220}{\kilo{}}) }
215 move up_ dimen_*2/3; dot; line left_ dimen_/2
216 V6sw: dot
217 #{"V6sw"}
218 capacitor(down_ dimen_*2/3,C); rlabel(,\SI{10}{\micro{}}); ground(,T)
219
220 V5P: dot(at (V6.P1.c,V4p)); { line to V5.P1.c }
221 #{"V5P"}
222 resistor(to (Here,Toprail)); rlabel(,\SI{220}{\kilo{}})
223 line to (V4p,Here)
224
225 V7: V_6L6G at (V3,Rail2+(0,-2*dimen_)); "6L6G" at V7.n above ljust
226 V8: V_6L6G(,R) at V7+(0,-2*dimen_); "6L6G" at V8.s below ljust
227 line right dimen_/4 from V7.G2.e; resistor(right_ dimen_); llabel(,100);
228 V9G: dot
229 #{"V9G"}
230 line right dimen_/4 from V8.G2.e; resistor(right_ dimen_); llabel(,100);
231 V9: V_6L6G(,,G2) with .G2.w at V9G+(dimen_/2,0); "6L6G" at V9.n above rjust
232 V10: V_6L6G(,R,G2) at V9+(0,-2*dimen_); "6L6G" at V10.s below rjust
233 line from V9G to V9.G2.w
234 line from V10.G2.w left_ dimen_/2
235 L910: line from V9G to (V9G,V10.G2); dot
236 line left_ dimen_/2 from V7.G1.w
237 V7G: dot
238 #{"V7G"}
239 resistor(down_ to 0.5 between Here and (Here,V10.G1))
240 rlabel(,\SI{220}{\kilo{}})
241 V7T: dot
242 #{"V7T"}
243 { line left_ dimen_/3; corner; ground }
244 line from V8.G1.w to (V7G,V8.G1); dot
245 resistor(up_ to V7T); llabel(,\SI{220}{\kilo{}})
246
247 line from V9.K1.sw to V10.K1.nw
248 line from V7.K1.sw to V8.K1.nw
249 V7K: dot(at last line.c+(0,dimen_/8))
250 #{"V7K"}
251 line left_ dimen_*2; dot
252 { capacitor(down_ dimen_/2,C); llabel(,\SI{50}{\micro{}}); ground(,T) }
253 PP: potentiometer(left_ dimen_,,0.5,dimen_/2) with .Start at Here
254 rlabel(,50\ \SI{10}{W})
255 corner(,at PP.T1); line left_ dimen_ then up_ dimen_/4
256 round(,tubethick)
257 line thick tubethick up tubeplatelen/3 left tubeplatelen*2/9
258 round(,tubethick)
259 line thick tubethick down tubeplatelen/3 left tubeplatelen*2/9
260 line down_ dimen_/4 then left_ dimen_ then up_ dimen_/4
261 round(,tubethick)
262 line thick tubethick up tubeplatelen/3 left tubeplatelen*2/9
263 round(,tubethick)
264 line thick tubethick down tubeplatelen/3 left tubeplatelen*2/9
265 line down_ dimen_/4; ground
266 "1st two 6SL7" at Here+(dimen_*3/4,dimen_/2) above
267
268 V9T: dot(at (L910,V7K)-(0,dimen_/4))
269 #{"V9T"}
270
271 line right_ dimen_/2 from V9.G1.e; continue to (Here,V9.P1)+(0,dimen_*2/3)
272 resistor(left_ to (V7G,Here)); llabel(,100)
273 V7nw: dot; { line to (Here,V7.G1) }
274 line right_ dimen_/2 from V10.G1.e; continue to (Here,V10.P1)-(0,dimen_*2/3)
275 resistor(left_ to (V7G,Here)); rlabel(,100)
276 V8sw: dot; { line to (Here,V8.G1) }
277
278 line from V9.P1.c up_ dimen_
279 V9P: dot
280 line from V10.P1.c down_ dimen_
281 V10P: dot
282 #{"V10P"}
283
284 line from V7.P1.c up_ V9P.y-V7.P1.y then to V9P
285 resistor(right_ to (V5.e+(dimen_/4,0),Here))
286 rlabel(,\shortstack{\SI{100}{\kilo{}}\\ \SI{2}{W}})
287 Rt1: Here
288 line to (Here,V6.e)+(0,dimen_/6); resistor(up_ dimen_)
289 llabel(,\shortstack{\SI{100}{\kilo{}}\\ \SI{2}{W}})
290 line to (Here,V5K) then to V5K
291 line from V8.P1.c down_ V8.P1.y-V10P.y then to V10P
292 resistor(right_ to (V6.e+(dimen_/2,0),Here))
293 llabel(,\shortstack{\SI{100}{\kilo{}}\\ \SI{2}{W}})
294 resistor(up_ dimen_*3/2)
295 llabel(,\shortstack{\SI{100}{\kilo{}}\\ \SI{2}{W}})
296 line to (Here,V6K) then to V6K
297
298 line from V9T to (V9.e+(dimen_*3/4,0),V9T)
299 Xout: OutputXformer with .PT at Here
300 line from Xout.P1 to (Xout.P1,V9P); dot
301 line from Xout.P2 to (Xout.P1,V10P); dot
302 line from Xout.PT left_ dimen_/4
303 XT: dot
304
305 resistor(from V6sw left_ dimen_); rlabel(,\SI{10}{\kilo{}})
306 XP: dot
307 { line down_ dimen_; continue to (XT,Here) then to XT }
308
309 capacitor(right_ dimen_*5/4 from V5P,C); llabel(,\SI{0.1}{\micro{}})
310 corner; line to (Here,Rail2)-(0,dimen_/2)
311 continue to (V7nw,Here) then to V7nw
312 line from V8sw down_ dimen_*5/8
313 continue to (Rail2,Here) then to (Rail2,V9.n)
314 capacitor(up_ dimen_/2,C,R); rlabel(,\SI{0.1}{\micro{}})
315 line to Rail2
316
317 line from XP left_ dimen_*2; dot
318 { dot(at Here+(dimen_,0))
319 { "290 V" at last [].n above }
320 R100: resistor(down_ dimen_*2/3)
321 llabel(,\shortstack{\SI{100}{\kilo{}}\\ \SI{2}{W}}); dot; ground }
322 { capacitor(down_ dimen_*2/3,C); llabel(,\SI{40}{\micro{}}); dot }
323 reversed(`inductor',left_ dimen_,L,,M); rlabel(,\SI{4}{H}\; \SI{300}{\mA})
324 Filt: dot
325 { capacitor(down_ dimen_*2/3,C); llabel(,\SI{40}{\micro{}})
326 line to R100.end }
327
328 Pwr: [
329 PXform: PowerXformer
330 line left_ dimen_/4 from PXform.P.start; fuse(left_ dimen_/2,D)
331 AC1: arrow left_ dimen_/2
332 AC2: arrow from PXform.P.end to (AC1.end,PXform.P.end)
333 "AC" at 0.5 between AC1.end and AC2.end ljust
334 dot(at PXform.ST3); line right_ dimen_/4; dot
335 dot(at PXform.ST1); line right_ dimen_/4 then down_ dimen_*3/2; ground(,T)
336 line from PXform.S2.end right_ dimen_*2.5 then up_ dimen_/4
337 Rect2: V_5U4G with .F1.sw at Here; "5U4G" at Rect2.n+(0,dimen_/2)
338 Rect1: V_5U4G with .e at Rect2.w-(dimen_/2,0); "5U4G" at Rect1.n+(0,dimen_/2)
339 move to Rect1.F1.sw; line to (Here,PXform.S2.end); dot
340 move to Rect1.F1.se; line to (Here,PXform.S2.start); dot
341 move to Rect2.F1.se; line to (Here,PXform.S2.start)
342 PO: dot
343 line from Rect1.P1 left_ dimen_/2; dot
344 { line to (Here,PXform.S1.start) then to PXform.S1.start }
345 line to (Here,Rect1.n)+(0,dimen_/8)
346 continue to (Rect1.P2+(dimen_/2,0),Here)
347 continue to (Here,Rect1.P2) then to Rect1.P2
348 line from Rect2.P1 left_ dimen_/2 then up_ Rect2.ht/2+dimen_/4; dot
349 { line to (Rect2.P2+(dimen_/2,0),Here)
350 continue to (Here,Rect2.P2) then to Rect2.P2 }
351 move to PXform.S1.end
352 line right_ dimen_/8 then up last [].y - Here.y then to last [].w
353 arrow from PXform.S3.start right_ dimen_
354 arrow from PXform.S3.end right_ dimen_
355 "\SI{5}{V}" at PXform.S2 + (dimen_*3/4,0)
356 "\SI{6.3}{V}" at 0.5 between last arrow.end and 2nd last arrow.end ljust
357 ] with .nw at (RP,Filt)+(0,dimen_/4)
358 line from Pwr.PXform.S2.start to Pwr.PO + (dimen_*3/4,0); corner
359 resistor(up_ to (Here,Filt)); rlabel(,\shortstack{V\\\hbox{adj}}); corner
360 line to Filt
361
362 ] with .nw at last [].sw+(0,-0.5)
363 #showbox_
364
365 ]
366 #showbox_
367 #print last [].wid,last [].ht
368
369 ifpostscript(,iflatex(latexcommand(})))
370 .PE