Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/dpv/TubediagsDPV.m4

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