Debian Codegraph @

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

raw
1 .PS
2 # Heathkit.m4
3 cct_init
4 # Landscape
5 maxpswid = 11
6 maxpsht = 8.5
7
8 # Set small text size: tikz-pgf changes
9 # text offset for globally-defined tiny font
10 # so we define tsf() to set size locally
11 iflatex(`ifpsfrag(`define(`tsf',"`$1'") dnl
12 textht = 7.5bp__; textoffset = 0.5bp__',
13 `define(`tsf',`"\tiny\sf `$1'"')')',
14 `define(`tsf',"`$1'")')
15
16 # Grid parameters
17 picwid = 8.5
18 picht = 6
19 g = 1/12
20
21 # Element scaling
22 linewid = 8*g
23 define(`dimen_',dimen_*4/5)
24 # Default sizes
25 boxwid = 2*g
26 boxht = 2*g
27 arrowht = arrowht*2/3
28
29 # Grid
30 box invis fill_(1) wid picwid ht picht with .sw at (0,0)
31 ifdpic(`linethick_(0.4)',`linethick_(0)')
32 for i=0 to picwid/g do { line color "lightgray" up picht from (i*g,0) }
33 for i=0 to picwid/g by 10 do { sprintf(tsf(%g),i) at (i*g,0) below }
34 for i=0 to picht/g do { line color "lightgray" right picwid from (0,i*g) }
35 for i=0 to picht/g by 10 do { sprintf(tsf(%g),i) at (0, i*g) rjust }
36 linethick_(0.8)
37
38 ifdpic(`
39 spline outlined "white" shaded "white" \
40 from (0,picht+g) down g then down picht/5 then right picwid/5
41 for i=1 to 4 do { contline down picht/5 then right picwid/5 }
42 contline right 2*g then up 2*g
43 contline up picht-2*g then up g then left g ')
44
45 # Place the bottom inductor on the grid
46 L1: inductor(down_ 13*g from (80*g,22*g),,13,,g)
47 L2: inductor(down_ 10*g from L1.start+(0,21*g),,10,,g)
48 L3: inductor(down_ 10*g from L2.start+(0,12*g),,10,M,g)
49 line from M4Core1.end to (M4Core1,L1.end)
50 line from M4Core2.end to (M4Core2,L1.end)
51 Scrn: 2 between M4Core1.start and M4Core2.start
52 line dashed from Scrn to (Scrn,L1.end)
53 ground
54 L4: inductor(up_ 5*g from (Scrn.x+M4Core1.x-L2.c.x,L2.start.y-2*g),,5,,g)
55 L5: inductor(up_ 5*g from (L4,L2.end+(0,g)),,5,,g)
56
57 # Circuit board
58 Board: box dashed thick 2 wid 58*g ht 55*g with .se at L1.end+(-7*g,-2*g)
59 P: box invis wid 12*g ht 4*g with .s at Board.sw+(26*g,0)
60 { tsf(POWER SUPPLY) ljust tsf(CIRCUIT BOARD) ljust at P.w+(g,0) }
61 line dashed thick 2 from P.sw to P.nw; line dashed thick 2 to P.ne
62 line dashed thick 2 to P.se
63
64 define Pad { P`$1': box fill_(1) tsf($1) }
65 # Board connections on the right
66 Pad(1) at (Board.e,L1.end)
67 line from P1.e to L1.end tsf(RED) above
68 Pad(2) at (Board.e,L1.start)
69 line from P2.e to L1.start tsf(RED) above
70 Pad(3) at (Board.e,L2.end)
71 GRN1: line left 4*g from L2.start tsf(GRN) above ; ground
72 GRN2: line from P3.e to L2.end tsf(GRN) above
73 spline <-> from GRN2.end+(-g,0) up 2.5*g right 0.5*g then up 5*g left g \
74 then up 2.5*g right 0.5*g
75 box invis fill_(1) wid 3*g ht g tsf(6 VAC) at L2.c-(2*g,0)
76 Pad(4) at P3-(0,3*g)
77 line right_ 3*g from P4.e tsf(BRN) above
78 arrow down_ 2*g ht arrowht*2/3
79 tsf(TO DIAL) tsf(LAMPS) at Here+(0,-g)below
80 Pad(5) at (Board.e,L3.end)
81 line from P5.e to L3.end tsf(BLU) above
82 Pad(7) at (Board.e,L3.start)
83 line from P7.e to L3.start tsf(BLU) above
84 Pad(6) at 0.5 between P5 and P7
85 line from P6.e to L3.c tsf(BLU-YEL) above
86
87 # Power wiring, plug, switch
88 define(`socket',`[
89 Outer: box wid dimen_*2/3 ht dimen_/2*3/4
90 L: box wid dimen_/16 ht dimen_/4 at Outer-(dimen_/6,0)
91 R: box wid dimen_/16 ht dimen_/4 at Outer+(dimen_/6,0)
92 line from Outer.w to L.w
93 line from Outer.e to R.e
94 ] ')
95
96 BLK: line from L4.end to (int(L4.end.x/g+8)*g,L4.end.y) tsf(BLK) below ; dot
97 b = lin_leng(BLK)
98 BLKYEL: line from L4.start right_ b tsf(BLK-YEL) above ; dot
99 BLKGRN: line from L5.end right_ b tsf(BLK-GRN) below ; dot
100 BLKRED: line from L5.start right_ b tsf(BLK-RED) above ; dot
101 line right_ g; PL: dot
102 line from BLKYEL.end right g then to Here+(0,-g)
103 fuse(down_ 3*g,D)
104 rlabel(,tsf(3 A FUSE) rjust tsf(SLOW BLOW))
105 line to (Here.x,int(Here.y/g)*g-g); dot
106 Sckt1: socket at Here+(5*g,0)
107 line from Sckt1.w to (PL,Sckt1); A: dot; tsf(A) at last [].w rjust
108 line from Sckt1.e right_ lin_leng(last line); B: dot
109 tsf(B) at last [].e ljust
110 Sckt2: socket at (Sckt1,P1+(0,6*g))
111 line from Sckt2.w to (A,Sckt2); dot
112 line from Sckt2.e to (B,Sckt2); dot
113 Sckt3: socket at (Sckt1,P1+(0,2*g))
114 line from Sckt3.w to (A,Sckt3); dot
115 line from Sckt3.e to (B,Sckt3); dot
116
117 define(`plug',`[ w = dimen_*2/3; q = 0.25*w
118 F: line right_ w
119 arc cw from F.start to F.end with .c at F.c
120 T1: F.c+(-q,w/2+g/2)
121 T2: F.c+( q,w/2+g/2)
122 line from T1 to (T1,F.c)-(0,2*g)
123 line from T2 to (T2,F.c)-(0,2*g) ]')
124
125 PP: plug with .F.c at Sckt3+(0,-8*g)
126 tsf(120 VAC) ljust tsf(50/60 Hz) ljust at PP.e
127
128 define(`pwrswitch',`[ right; circlerad = 1.75*g/2
129 C1: circle tsf(1)
130 C4: circle tsf(4)
131 C2: circle tsf(2) with .n at C1.s+(0,-C1.rad)
132 C5: circle tsf(5)
133 C3: circle tsf(3) with .n at C2.s+(0,-C1.rad)
134 C6: circle tsf(6)
135 hatchbox(wid g ht C2.n.y-C3.s.y,0.05) with .w at 0.5 between C5.e and C6.e
136 ]')
137
138 Psw: pwrswitch with .C4.e at Sckt1+(0,-4*g)
139 tsf(POWER) at Psw.w+(-2*g,0) rjust
140 arrow up Psw.ht/2 at Psw.e+(1.5*g,0)
141 tsf(ON) above; tsf(OFF) at last arrow.start below
142 line from Psw.C1.w to (A,Psw.C1) then to A
143 line from Psw.C2.w to (A,Psw.C2); contline to (Here,PP.T1) then to PP.T1
144 line from PP.T2 to (B,PP.T2) then to (B,L4.end) then to L4.end
145 line from BLKGRN.end to (B,BLKGRN); dot
146
147 # Bottom connections
148 Pad(25) at Board.se+(-3*g,0)
149 R516: resistor(down_ 6*g from P25.s); rlabel(,tsf(R516) rjust tsf(22)); ground(,T)
150 dot(at P25.s+(0,-g)); line right_ 5*g
151 reversed(`source',down_ 4*g,B); llabel(,tsf(No 49) ljust tsf(HI) ljust tsf(TEMP))
152 line to (P25,Here); dot
153 t = linethick; linethick_(0.4)
154 arrow <- from P25.s+(0,-g/2) right_ 2*g up_ g/4; tsf(BRN) ljust; linethick_(t)
155
156 Pad(24) at P25+(-4*g,0)
157 line from P24.s to (P24,R516.end); ground(,T)
158 Pad(23) at Board.sw+(12*g,0)
159 line from P23.s to (P23,R516.end); ground(,T)
160
161 Pad(22) at Board.sw+(0,3*g)
162 R514: resistor(right_ 8*g from P22.e); llabel(,tsf(R514))
163 rlabel(,tsf(680 k))
164 dot; { ground }
165 line to (P23,Here) then to P23.n
166
167 # Diode bridge
168 BE: dot(at (P24,L1.c))
169 d1h = lin_leng(L1)/2
170 diode(left_ d1h up_ d1h); rlabel(,,tsf(D508))
171 BN: dot
172 diode(left_ d1h down_ d1h); rlabel(tsf(D506))
173 BW: dot
174 diode(from BE left_ d1h down_ d1h); llabel(,,tsf(D509))
175 BS: dot
176 diode(left_ d1h up_ d1h); llabel(tsf(D507))
177 capacitor(down_ from BN to BS,C); llabel(tsf(C507),,tsf(.22))
178 line from BE to P24.n
179 line from BN to P2.w
180 line from BS to P1.w
181 spline <-> from (BE.x+2*g,BS.y) \
182 up d1h/2 right g/2 then up d1h left g then up d1h/2 right g/2
183 box invis fill_(1) ht 2*g wid 2*g tsf(57) tsf(VAC) at last spline.c
184
185 # Left board connections
186 Pad(21) at (Board.w,BW); line from P21.e to BW
187 Pad(19) at P21+(0,-3*g)
188 Pad(20) at P21+(0, 3*g)
189
190 # Transistor with circles
191 define(`hbi_tr',`[ linewid = linewid*4/4.16
192 Q: bi_tr(`$1',`$2',`$3',E)
193 E: circle rad m4_xyU at 5/4 between Q.A1 and Q.E tsf(E)
194 B: circle rad m4_xyU at 5/4 between Q.A1 and Q.B tsf(B)
195 C: circle rad m4_xyU at 5/4 between Q.A1 and Q.C tsf(C)
196 ]')
197
198 # Interior circuits
199 line from P6.w left 2*g; ground
200 line from P5.w left 4*g; dot
201 { C504: capacitor(down_ 4*g,C); llabel(tsf(C504),,tsf(.22)); ground(,T) }
202 D504: diode(left_ 5*g); rlabel(,tsf(D504)); dot
203 { C505: capacitor(down_ to (Here,C504.end),C+L)
204 rlabel(tsf(C505),tsf(100),tsf(75 V)); ground(,T) }
205 line right_ to (Here,P7); dot
206 { D503: reversed(`diode',to (D504.start,Here)); llabel(,tsf(D503))
207 line to P7.w }
208 d3 = lin_leng(L3)
209 spline <-> from C504.start+(g/2,0) \
210 up d3/4 right g/4 then up d3*2/4 left g/2 then up d3/4 right g/4
211 box invis fill_(1) ht g wid 4*g tsf(100 VAC) at last spline.c+(-g,0)
212
213 down_
214 Q503: hbi_tr(,R,P) with .E at (C505,P3)
215 line from Q503.C.e to (P25,Q503.C) then to P25.n
216 line from Q503.B.s to (Q503.B.x,Q503.E.y-4*g)
217 R513: resistor(down_ 5*g); llabel(,tsf(R513) ljust tsf(1500)); ground(,T)
218 line from P19.e to (BW-(2*g,0),P19) then up Q503.E.y-P19.y+2*g
219 R511: resistor(right_ 5*g); llabel(,tsf(R511)); rlabel(,tsf(470));
220 line to (Q503.E,Here) then to Q503.E.n
221 line from P20.e to (BW,P20) then up R513.end.y-P20.y
222 resistor(up_ lin_leng(R513))
223 rlabel(,tsf(R512) ljust tsf(5600) ljust tsf(1 W))
224 line to (Here,Q503.B) then to Q503.B.w
225 tsf(Q503) tsf(S2091 HI TEMP) tsf(CONTROL) at Q503.E+(1.5*g,4*g)
226 D505: reversed(`diode',right_ from Q503.E.e to (C504,Q503.E)); llabel(,tsf(D505))
227 line to P3.w
228
229 line from P4.w left_ 2*g then up P3.y-P4.y; dot
230 line from D503.end to (R513,D503); dot
231 { Pad(8) at (Here,Board.n) }
232 { line to P8.s }
233 R505: resistor(down_ to (Here,P6))
234 llabel(,tsf(R505) ljust tsf(12 k)); dot
235 { C503: capacitor(down_ to (Here,C505.end),C+L)
236 rlabel(,tsf(C503) rjust tsf(100) rjust tsf(70 V))
237 ground(,T) }
238 right_
239 Q502: hbi_tr(,R) with .B at (R511.start,Here)
240 line from Q502.C.e to R505.start
241 line from Q502.B.e to R505.end
242 R504: resistor(down_ from Q502.B.s to (Q502.B,C505.end))
243 rlabel(,tsf(R504) rjust tsf(51 k)); ground(,T)
244 tsf(Q502) tsf(TA7311) tsf(REGULATOR) tsf(CONTROL) at Q502.C+(-1*g,3.5*g)
245
246 Pad(9) at (Q502.E,Board.n)
247 line from Q502.E.n to P9.s
248 Pad(10) at (Q502.B-(9*g,0),Board.n)
249 R502: resistor(left_ from Q502.E.w to (P10,Q502.E))
250 rlabel(,tsf(R502)); llabel(,tsf(150)); dot
251
252 Pad(11) at (Board.w,Q502.E)
253 Pad(14) at P11+(0,2.5*g)
254 Pad(12) at P11+(0,-2.5*g)
255 Pad(13) at P12+(0,-2.5*g)
256 line right 2*g from P13.e then up P11.y-P13.y; dot
257 line from P12.e to (Here,P12); dot
258 Pad(15) at P13+(0,-3*g)
259
260 right_
261 Q501: hbi_tr(,R) with .B at P9.n+(0,2*g)
262 line from Q501.B.s to P9.n
263 line from Q501.C.e to (P8,Q501.C) then to P8.n
264 line from Q501.E.w to (P10,Q501.E) then to P10.n
265 tsf(Q501) tsf(2N3055) tsf(REGULATOR) at Q501.n+(0,2*g)
266 line from P14.e to (P10,P14); dot
267
268 Pad(17) at (Board.w,R511)
269 Pad(16) at P17+(0,3*g)
270 Pad(18) at P17+(0,-3*g)
271 line right 2*g from P18.e then up P17.y-P18.y; dot
272
273 right_
274 Q504: hbi_tr(,R) with .C at (P10,P17)
275 line from P17.e to Q504.E.w
276 line from Q504.B.s to (Q504.B,R513.start)
277 R508:resistor(down_ to (Here,R513.end))
278 llabel(,tsf(R508) ljust tsf(680)); ground(,T)
279 dot(at (P10,P15))
280 { line to P10.s }
281 { resistor(down_ 5*g)
282 llabel(,
283 tsf(R510) ljust tsf(225) ljust tsf(10 W) ljust tsf(5 \%))
284 line to Q504.C.n }
285 R503:resistor(left_ 10*g); rlabel(,tsf(R503))
286 { tsf(290) tsf(10 W 5 \%) at last [].s+(0,-1.3*g) }
287 dot
288 line to (Here,Q504.B)
289 resistor(right_ to Q504.B.w); llabel(,tsf(R507)); rlabel(,tsf(100))
290 line from P15.e to R503.end
291 tsf(Q504) tsf(40409) tsf(REGULATOR) at Q504.n+(-2*g,3*g)
292 resistor(left_ from R502.end to (R503.end,P11)); rlabel(,tsf(R501))
293 {tsf(390) tsf(5 W 5 \%) at last [].s+(0,-1.3*g)}
294 line to P11.e
295
296 resistor(right_ from P16.e to (R514.end,P16)); llabel(,tsf(R506))
297 rlabel(,tsf(82))
298 line down P16.y-P17.y; dot
299
300 dot(at (R514.end,P11))
301 C501: capacitor(down_ 6*g,C+); llabel(tsf(C501))
302 {tsf(100) ljust tsf(30 V) ljust at last [].s+(0,-g) below }
303 ground(,T)
304 dot(at (Here.x+4*g,P11.y))
305 ZD501: reversed(`diode',down_ lin_leng(C501),Z); llabel(tsf(ZD501)); ground(,T)
306
307 dot(at (R514.end,P15))
308 C502: capacitor(down_ 6*g,C+); llabel(tsf(C502))
309 {tsf(100) ljust tsf(30 V) ljust at last [].s+(0,-g) below }
310 ground(,T)
311 dot(at (Here.x+4*g,P15.y))
312 ZD502: reversed(`diode',down_ lin_leng(C502),Z); llabel(tsf(ZD502)); ground(,T)
313
314 line from (C502,P17) to (C502,R508.start+(0,g))
315 C506: capacitor(down_ to (Here,R508.end),C+); llabel(tsf(C506))
316 {tsf(100) ljust tsf(30 V) ljust at last [].s+(0,-g) below }
317 ground(,T)
318
319 # Left-side boxes
320 boxwid = 10*g
321 boxht = 5*g
322 line left 3*g from P22.w tsf(GRY) above
323 line left 3*g from P19.w tsf(VIOL) above
324 box with .e at (Here,0.5 between P19 and P22) \
325 tsf(\shortstack[l]{TO SIGNAL\\ METER\\ CIRCUIT})
326
327 line left 8*g from P21.w tsf(RED TO C508) above
328 line left 8*g from P20.w tsf(VIOL) above
329
330 line left 3*g from P17.w tsf(RED) above
331 line left 3*g from P18.w tsf(WHT-) tsf(RED) above
332 box with .e at (Here,0.5 between P17 and P18) \
333 tsf(\shortstack[l]{12.7 V SOURCE\\ TO MULTIPLEX})
334
335 line left 3*g from P16.w tsf(WHT) above
336 box with .se at Here+(0,-g) \
337 tsf(\shortstack[l]{12 V SOURCE\\ TO FM TUNER\\ SOURCE SWITCH})
338
339 line left 3*g from P15.w tsf(ORG) above
340 box ht 3*g with .e at Here \
341 tsf(\shortstack[l]{15 V SOURCE\\ TO FM TUNER})
342
343 line left 3*g from P13.w tsf(BLU) above
344 line left 3*g from P12.w tsf( WHT-) tsf(RED)
345 line left 3*g from P11.w tsf(RED) above
346 box ht 6*g with .e at (Here,P12) \
347 tsf(\shortstack[l]{27 V SOURCE\\ TO CONTROL\\ PREAMP AND\\ PWR\
348 AMPLIFIER})
349
350 line left 3*g from P14.w
351 { tsf(WHT-) tsf(GRY-) tsf(GRN) at last line.c+(0,2*g) }
352 box with .se at Here+(0,-g) \
353 tsf(\shortstack[l]{50 V SOURCE\\ TO PHONO\\ PREAMP})
354
355 .PE