home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 June / 1991-06.d64 / inductor (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  134 lines

  1. 0 clr
  2. 5 rem copyright 1991 compute publications intl ltd - all rights reserved
  3. 100 rem * * initialize * * *
  4. 110 hd$="inductor   design[146]"
  5. 120 dimtn(40):fori=8to40:readtn(i):next
  6. 130 deffnpu(x)=3*val(cd$)*in+9*in*(x):deffnnn(x)=tn(ga)^2*.2*val(cd$)^2*x^2
  7. 140 poke53280,0:poke53281,0:poke646,7
  8. 150 rem * * menu page * * *
  9. 160 print"[147]"hd$
  10. 170 print"parameters for a single-layer,":
  11. 180 print"air-core inductor using enamel wire."
  12. 190 print"select: 1- inductance unknown";
  13. 195 print spc(59)"2-      "chr$(34)"     known"
  14. 200 input"choice:  1[157][157][157]";a$
  15. 210 ifa$<>"1"anda$<>"2"then200
  16. 220 ifa$="1"then260
  17. 230 print"enter the value of inductance"
  18. 240 input"(in microhenries)";in$
  19. 250 goto390
  20. 260 rem * * calculate inductance required*
  21. 270 print"[147]"hd$
  22. 280 print"determine inductance required:-"
  23. 290 print"select 1-inductance of an existing coil"
  24. 300 print"2-inductance of a tuned inductor"
  25. 310 input"choice  1[157][157][157]";b$:ifb$<>"1"andb$<>"2"then310
  26. 320 ifb$="1"then400
  27. 330 print"[147]"hd$
  28. 340 input"enter freq. in khzs";fr$
  29. 350 input"enter capacitance in mmfds";ca$
  30. 360 in$=str$(int(100*25330*10^6/(val(ca$)*val(fr$)^2)+.5)/100)
  31. 370 print"inductance reqired is:":print""in$" microhenries"
  32. 380 gosub1310
  33. 390 in=val(in$)
  34. 400 rem * * calculate inductor size * *
  35. 410 print"[147]"hd$:ifb$="2"ora$="2"then430
  36. 420 print"for an existing inductor enter all":print"parameters.":goto440
  37. 430 print"to determine an inductor size enter":print"any two parameters.
  38. 440 fl[178]0:co[178]5:ro[178]6:[141]1270:[153]"wire size   (awg 8-40):"
  39. 450 ro[178]8:[141]1270:[153]"coil diameter (inches):"
  40. 460 ro[178]10:[141]1270:[153]"coil length   (inches):"
  41. 470 co[178]30:ro[178]6:[141]1270:[133]ga$:ga[178][197](ga$):[139]ga$[178]""[167]fl[178]fl[170]1:[137]490
  42. 480 [139]ga[179]8[176]ga[177]40[167][141]1300:[137]440
  43. 490 ro[178]8:[141]1270:[133]cd$:[139]cd$[178]""[167]fl[178]fl[170]1
  44. 500 [139]in[177]0[175]fl[178]0[167]520
  45. 510 ro[178]10:[141]1270:[133]cl$:[139]cl$[178]""[167]fl[178]fl[170]1
  46. 520 [139]fl[175]in$[178]""[167][141]1280:[137]440
  47. 530 [139]fl[177]1[167][153]"require two parameters!":[137]440
  48. 540 [139]in$[178]""[167]580
  49. 550 [139]ga$[178]""[167]650
  50. 560 [139]cd$[178]""[167]720
  51. 570 [139]cl$[178]""[167]820
  52. 580 in[178][181](100[172].2[172][197](cd$)[174]2[172](tn(ga)[172][197](cl$))[174]2)
  53. 585 in[178][181](in[173]((3[172][197](cd$))[170](9[172][197](cl$)))[170].5)
  54. 590 in[178]in[173]100
  55. 600 [153]"a inductor with the above parameters"
  56. 610 [153]"will have an inductance of:":[153]""in"microhenries"
  57. 620 [153]"with close spacing of"tn(ga)[172][197](cl$)"turns."
  58. 630 [137]1040
  59. 640 [143] * * calculate awg# * * *
  60. 650 n[178][181](10[172][186]((3[172][197](cd$)[170]9[172][197](cl$))[172][197](in$)[173](.2[172][197](cd$)[174]2))[170].5)[173]10
  61. 660 [129]i[178]8[164]40:[139][180](tn(i)[179]n[173][197](cl$))[167][130]
  62. 670 [153]"an inductance of"in"microhenries"
  63. 680 [153]"will require"n"turns."
  64. 690 [153]"awg#"i"has"tn(i)"per inch, close spaced"
  65. 700 [153]"or use smaller awg, loosely spaced."
  66. 710 ga[178]i:[137]1060
  67. 720 [143] * * calculate diameter * * *
  68. 730 n1[178]tn(ga)[172][197](cl$)
  69. 740 mf[178]n1[174]2[172].2[173]in
  70. 750 cd[178][181](100[172](3[170][186](9[170]4[172]mf[172]9[172][197](cl$)))[173](2[172]mf)[170].5)[173]100:cd$[178][200]([196](cd),5)
  71. 760 [153]"for an inductance of "in$" microhenries"
  72. 770 [153]"and the above parameters, the diameter"
  73. 780 [153]"required is: "cd$" inches."
  74. 790 [153]"with"tn(ga)[172][197](cl$)"turns over "cl$" inch.":cl[178][197](cl$):[141]1240
  75. 800 [153]"tolerance "[181](1000[172](l[173][197](in$)[171]1)[170].5)[173]10"%"
  76. 810 [137]1060
  77. 820 [143] * * calculate length * *
  78. 830 ro[178]12:co[178]10:[141]1270:[153]"doing the calculation!":co[178]1:[141]1270
  79. 840 [139][165]nn(1)[177][165]pu(1)[167]940
  80. 850 [129]i[178]1[164]4[169].1
  81. 860 [139][180]([165]nn(i)[171][165]pu(i))[178][171]1[167]df[178][182]([165]nn(i)[171][165]pu(i)):[130]:[137]980
  82. 870 [139]df[179][182]([165]nn(i)[171][165]pu(i))[167]i[178]i[171].1
  83. 880 [153]"for an inductance of "in$" microhenries"
  84. 890 [153]"and the above parameters, coil length"
  85. 900 [153]"required is:"i" inches,":n1[178][181](10[172]tn(ga)[172]i[170].5)[173]10:cd[178][197](cd$):cl[178]i
  86. 910 [141]1240:[153]"with"n1"turns."
  87. 920 [153]"tolerance "[181](1000[172](l[173][197](in$)[171]1)[170].5)[173]10"%"
  88. 930 [153]"for better accuracy try custom design":[137]1060
  89. 940 [129]i[178]1[164].05[169][171].05
  90. 950 [139][180]([165]nn(i)[171][165]pu(i))[178]1[167]df[178][165]nn(i)[171][165]pu(i):[130]:[137]1010
  91. 960 [139]df[179][182]([165]nn(i)[171][165]pu(i))[167]i[178]i[170].05
  92. 970 i[178][181](100[172]i[170].5)[173]100:[137]880
  93. 980 [153]"for these parameters the length is":[153]" greater than 4 inches. ";
  94. 990 [153]"try a larger":[153]" diameter";
  95. 995 [139]ga[179]40[167][153]", and/or smaller ga."
  96. 1000 [141]1310:[137]400
  97. 1010 [153]"for these parameters the length is":[153]" less than .05 inches. ";
  98. 1020 [153]"try a smaller":[153]" diameter";
  99. 1025 [139]ga[177]8[167][153]", and/or larger ga."
  100. 1030 [141]1310:[137]400
  101. 1040 [143] * * custom * * *
  102. 1050 [153]"for loose spacing of fewer turns select":[153]"custom!"
  103. 1060 [153]"shiftwait to end. . . ctrlwait custom design"
  104. 1070 [145][194](653)[137]1260,1070,1070,1090
  105. 1080 [137]1070
  106. 1090 [153]"loadcustom   "hd$
  107. 1100 [153]"an inductor with:"
  108. 1110 [153]"# of turns of awg#"ga
  109. 1120 [153]"coil diameter of ":[153]"coil length of "
  110. 1130 co[178]25:ro[178]4:[141]1270:[133]n1:ro[178]ro[170]2:[141]1270:[133]cd
  111. 1140 ro[178]ro[170]2:[141]1270:[133]cl
  112. 1150 [139]tn(ga[170]gc)[172]cl[179]n1[167]gc[178]gc[170]1
  113. 1160 [139]tn(ga[170]gc[171]1)[172]cl[178][177]n1[167]gc[178]gc[171]1
  114. 1170 [139]n1[177]tn(ga)[172]cl[170].0001[167][153]"more turns/inch!wait - awg# now"ga[170]gc
  115. 1180 cd[178]cd[170][181](100[172]1[173]tn(ga)[170].5)[173]100:l[178][181](100[172].2[172]cd[174]2[172]n1[174]2[173](3[172]cd[170]9[172]cl)[170].5)[173]100
  116. 1190 [153]"inductance is"l"uh"
  117. 1200 [153]"change :";
  118. 1210 [153][181](1000[172](l[173]in[171]1)[170].5)[173]10"%"
  119. 1220 [137]1060
  120. 1230 [143] * calculate l * * *
  121. 1240 cd[178]cd[170][181](100[172]1[173]tn(ga)[170].5)[173]100:l[178][181](100[172].2[172]cd[174]2[172]n1[174]2[173](3[172]cd[170]9[172]cl)[170].5)[173]100
  122. 1250 [142]
  123. 1260 [128]
  124. 1270 [151]783,[194](783)[175]254:[151]782,co:[151]781,ro:[158]65520:[142]
  125. 1280 [153]"with inductance unknown all parameters  ":co[178]16:ro[178][194](214)
  126. 1290 [141]1270:[153]"onrequired!":[142]
  127. 1300 [153]"wire gauge is outside range! ":[142]
  128. 1310 [153]"shiftwait to continue!":[146]653,1:[142]
  129. 1320 [143] * * data statements * * *
  130. 1330 [131]7.6,8.6,9.6,10.7,12,13.5,15,16.8
  131. 1340 [131]18.9,21.2,23.6,26.4,29.4,33.1,37,41.3
  132. 1350 [131]46.3,51.7,58,64.9,72.7,81.6,90.5,101
  133. 1360 [131]113,127,143,158,175,198,224,248,282
  134.