(* * LANGUAGE : ANS Forth * PROJECT : Forth Environments * DESCRIPTION : Compute the parasitic capacitor of an INDUCTOR * CATEGORY : Utility * AUTHOR : Marcel Hendrix * LAST CHANGE : November 13, 2000, Marcel Hendrix *) NEEDS -miscutil NEEDS -fsl_util NEEDS -nrc REVISION -cap "ÄÄÄ Parasitic capacitor Version 0.01 ÄÄÄ" PRIVATES DOC (* See: 'Numerical Recipes in C, The Art of Scientific Computing, 2nd Ed.', Chapter 4, Integration of Functions, William H. Press, Brian P. Flannery, Saul A. Teukolsky and William T. Vetterling. 1992; Cambridge University Press, Cambridge, ISBN 0-521-43108-5 See: 'Berechnung der Kapazitaet von Spulen, insbesondere in Schalenkernen', Valvo Berichte 14 (1968), Heft 3, S. 99-119, J. Koch See: Laborbericht Nr. 1119/95, 'The Design of Magnetic Components in Switched Mode Power Supplies Part 2', Manfred Albach. Note: The fact that the length of a turn increases towards the outer edge of the inductor is neglected. The error should be very small for realistic inductors. *) ENDDOC \ Returns the integral of the function func between a and b, by ten-point Gauss-Legendre \ integration: the function is evaluated exactly ten times at interior points in the range of \ integration. : qgaus ( 'func -- ) ( F: a b -- r ) FSWAP FPUSHD FPUSHD 5 LIB: qgaus FFOREIGN ;P -- -- Wire and layer characteristics of wire (here .3 wire on ETD34) --- -- 0.351e-3 FVALUE d_out -- outer diameter, includes isolation 0.300e-3 FVALUE d_nom -- copper diameter 42.1e-3 FVALUE MLT -- mean length of turn in two successive layers #61 VALUE z -- turns/layer ( for ETD34 ) #610 VALUE turns -- number of turns -- --------------------------------------------------------------------- -- : .HOW? ( -- ) CR ." The inductor is wound as follows:" CR CR ." number of turns = " turns DEC. CR ." mean length of turn = " MLT F.N1 ." m" CR ." turns/layer = " z DEC. CR ." wire d_out = " d_out F.N1 ." m" CR ." wire d_nom = " d_nom F.N1 ." m" ; 8.85e-12 8e F* 3e F/ FCONSTANT 8*epsilon0/3 PRIVATE : lw12 ( F: -- r ) MLT ;P \ this is of course not true when there are many layers : delta ( F: -- r ) d_out d_nom F- F2/ ;P -- Experimentally fitted, thickness of wire influences capacitance slightly. : epsilonD ( F: -- r ) d_nom 1e3 F* FSQRT 0.7e FSWAP F/ 2.5e F+ ;P -- Function ML :NONAME ( dfloat:p -- ) ( F: -- r ) FPOPD FCOS FLOCAL cosphi cosphi FSQR FDUP 0.75e F- FSQRT cosphi F* F- 0.5e F- F2/ cosphi FSQR 0.75e F- FSQRT 0.5e F+ 1e delta epsilonD d_out F* F/ F- F* cosphi FSWAP F- FSQR F/ 0 ( error ) ; 2 FCALLBACK iML PRIVATE -- Function MD :NONAME ( dfloat:p -- ) ( F: -- r ) FPOPD FSINCOS FLOCALS| cosphi sinphi | sinphi FSQR cosphi FSQR 0.75e F- FSQRT cosphi F* F+ F2/ cosphi FSQR 0.75e F- FSQRT 0.5e F+ 1e delta epsilonD d_out F* F/ F- F* cosphi FSWAP F- FSQR F/ 0 ( error ) ; 2 FCALLBACK iMD PRIVATE : ML iML 0e PI 6e F/ qgaus ;P : MD iMD 0e PI 6e F/ qgaus ;P \ : .ML CR ." Integral ML computed with QGAUS (10 points)" ML #14 +E.R ; \ : .MD CR ." Integral MD computed with QGAUS (10 points)" MD #14 +E.R ; -- The capacitance between the first two (whole) layers, z turns/layer. : CL1 ( F: -- r ) d_out delta F2/ F- MD F* d_out FSQR epsilonD F* delta FSWAP F/ F* ML F+ 8*epsilon0/3 z S>F F* lw12 F* F* ;P -- Capacitance for n whole layers of z turns/layer : CL1,Cn ( n -- ) ( F: -- CL1 Cn ) CL1 4e DUP S>F FSQR F/ S>F F1- F* FOVER F* ;P -- Assuming lwn,n+1 is equal to MLT. -- I think it's useless to compute lwn,n+1 exactly... : Cp ( F: -- capacitance ) turns z / DUP 0= IF DROP 0e EXIT ENDIF DUP CL1,Cn S>F turns z MOD S>F z S>F F/ FLOCALS| ksi n Cn CL1 | ksi FSQR ksi F* 4e F* n ksi F+ FSQR F/ CL1 F* n FDUP ksi F+ F/ FSQR Cn F* F+ ; -- For plotting. Default: 0e 610e SKETCH Ctest produces Figure 10 in CONV manual part 2. : Ctest ( F: n -- c ) turns F>S TO turns Cp TO turns ; :ABOUT CR ." **** Parasitic capacitance of inductor wound with solid round wire ****" CR CR ." Try: Cp ( F: -- r ) -- Capacitance; n complete + 1 incomplete layer." CR ." .HOW? -- Construction details of the inductor" CR ." TO turns -- (integer) number of turns" CR ." TO MLT -- (float) mean length of turn [m]" CR ." TO z -- (integer) turns per layer" CR ." TO d_out -- (float) outer diameter of [round] wire [m]" CR ." TO d_nom -- (float) nominal diameter of [round] wire [m]" CR CR ." The fact that MLT varies with the number of layers is neglected." ; DEPRIVE .ABOUT -cap CR (* End of Source *)