top: SCREEN 0 COLOR 0, 7 CLS PRINT "" PRINT "" PRINT " REEDCOIL.EXE" PRINT "" PRINT " (C) 2005 Austin Instruments, Inc." VIEW PRINT 8 TO 40 PRINT " Need help? /N" hloop: a$ = INKEY$ IF a$ = "Y" OR a$ = "y" OR a$ = CHR$(13) THEN GOTO help IF a$ = "" THEN GOTO hloop init: CLS PRINT "" INPUT " Enter maximum coil length (inside length of bobbin) in inches: ", lcoil INPUT " Enter outside diameter of bobbin shaft in inches: ", bdia INPUT " Enter wire size in AWG: ", awg INPUT " Enter switch sensitivity in Ampere-Turns : ", sens INPUT " Enter minimum coil voltage in volts: ", vcoil INPUT " Enter desired coil current in milliamperes: ", icoil IF awg = 20 THEN wdia = .0334: wres = 10.13 IF awg = 21 THEN wdia = .0298: wres = 12.77 IF awg = 22 THEN wdia = .0266: wres = 16.2 IF awg = 23 THEN wdia = .0239: wres = 20.31 IF awg = 24 THEN wdia = .0213: wres = 25.67 IF awg = 25 THEN wdia = .019: wres = 32.37 IF awg = 26 THEN wdia = .017: wres = 41.02 IF awg = 27 THEN wdia = .0153: wres = 51.43 IF awg = 28 THEN wdia = .0137: wres = 65.33 IF awg = 29 THEN wdia = .0123: wres = 81.22 IF awg = 30 THEN wdia = .0109: wres = 103.7 IF awg = 31 THEN wdia = .0097: wres = 130.9 IF awg = 32 THEN wdia = .0088: wres = 162 IF awg = 33 THEN wdia = .0078: wres = 205.7 IF awg = 34 THEN wdia = .007: wres = 261.3 IF awg = 35 THEN wdia = .0062: wres = 330.7 IF awg = 36 THEN wdia = .0056: wres = 414.8 IF awg = 37 THEN wdia = .005: wres = 512.1 IF awg = 38 THEN wdia = .0045: wres = 648.2 IF awg = 39 THEN wdia = .0039: wres = 846.6 IF awg = 40 THEN wdia = .0035: wres = 1079 IF awg = 41 THEN wdia = .0028: wres = 1323 IF awg = 42 THEN wdia = .0025: wres = 1659 IF awg = 43 THEN wdia = .0022: wres = 2143 IF awg = 44 THEN wdia = .002: wres = 2593 IF awg < 20 THEN GOTO err1 'out of range error IF awg > 44 THEN GOTO err1 'out of range error layer = 0 'initialize layer counter ires = 0 'initialize incremental resistance ilen = 0 'initialize incremental length n = 0 'initialize number of turns dia = bdia + (2 * wdia) 'shaft diameter + 2 wire dia pi = 3.14159 'duh... wdia = 1.2 * wdia 'add some slop for winding wres = wres / 12000 'convert ohms/kft to ohms/inch rcoil = INT(1000 * (vcoil / icoil)) 'calc target coil resistance ncoil = INT(sens / (icoil * .001)) 'calc total turns on coil tper = INT(.95 * (lcoil / wdia)) 'calc initial turns per layer loop1: layer = layer + 1 'increment layer counter lturn = pi * dia 'calc length of turn rturn = wres * lturn 'calc resistance per turn loop2: n = n + 1 'increment number of turns IF n = ncoil THEN GOTO loop3 'branch if turns = target turns ilen = ilen + lturn 'else increment length of wire ires = ires + rturn 'increment resistance tper = tper - 1 'decrement turns counter IF tper > 0 THEN GOTO loop2 'loop if turns left is >0 dia = dia + (2 * wdia) 'else calc new coil diameter tper = INT(.95 * (lcoil / wdia)) 'reset initial turns per layer GOTO loop1 'loop for next layer loop3: IF ires / rcoil > .95 AND ires / rcoil < 1.05 THEN GOTO loop4 lcoil = lcoil - .03125 'else shorten the bobbin shaft IF lcoil = 0 AND ires > rcoil THEN GOTO err2 IF lcoil = 0 AND ires < rcoil THEN GOTO err3 dia = bdia + (2 * wdia) 'else reset starting diameter tper = INT(.95 * (lcoil / wdia)) 'set new nturns per layer counter n = 0 'reset turns counter layer = 0 'reset layer counter ilen = 0 'reset wire length ires = 0 'reset resistance GOTO loop1 'loop for next try loop4: dia$ = LEFT$(STR$(dia), 4) lcoil$ = LEFT$(STR$(lcoil), 4) 'CLS PRINT "" PRINT "" PRINT " Target coil resistance ="; rcoil; "ohms" PRINT " Wire size = #"; awg; "AWG" PRINT " Length of wire ="; INT(ilen / 12); "feet" PRINT " Length of coil =" + lcoil$ + " inch" PRINT " Outside diameter of coil =" + dia$ + " inch" PRINT " Resistance of coil ="; INT(ires); "ohms" PRINT " Number of turns ="; INT(n) PRINT " Number of layers = "; layer PRINT "" PRINT " Another run? /N" GOTO loopa err1: CLS PRINT "" PRINT "" PRINT " Sorry, that wire size is out of range." PRINT " Choose from 20 to 44 AWG." PRINT " Want to try again? /N" GOTO loopa err2: 'CLS PRINT "" PRINT "" PRINT " Sorry, the coil's resistance is too high. " PRINT " Use larger diameter wire (lower AWG)." PRINT " Want to try again? /N" GOTO loopa err3: 'CLS PRINT "" PRINT "" PRINT " Sorry, the coils' resistance is too low." PRINT " Use smaller diameter (higher AWG) wire." PRINT " Want to try again? /N" loopa: a$ = INKEY$ IF a$ = "Y" THEN GOTO init IF a$ = "y" THEN GOTO init IF a$ = CHR$(13) THEN GOTO init IF a$ = "" THEN GOTO loopa END help: CLS PRINT "" PRINT " After you enter the electrical and mechanical characteristics of the coil" PRINT " requested by the program, it will try to wind a coil based on the switch" PRINT " sensitivity and the wire size and current chosen by adjusting the length of" PRINT " the bobbin shaft. If the resistance of the coil becomes higher than the target" PRINT " resistance before the required number of turns has been wound on the bobbin" PRINT " or, if the length of the bobbin decreases to zero before the required number" PRINT " of turns has been wound, error messages will be displayed which will suggest" PRINT " means of eliminating the errors." PRINT "" PRINT " Press any key to exit help." loopb: a$ = INKEY$ IF a$ = "" THEN GOTO loopb GOTO init