LT SPICE and FEMM

Hi,

I have simulated a magnetic core inductor in FEMM. I want to simulate it in LTSPICE as a component. Can anyone guide me how to borrow this FEMM file to LTSPICE? I have generated the .dxf file for the design.

erica

0 SECTION 2 HEADER 9 $INSBASE 10 0.0000 20 0.0000 9 $EXTMIN 10

-32.121320 20

-32.121320 9 $EXTMAX 10

32.121320 20 32.121320 9 $LIMMIN 10

-32.121320 20

-32.121320 9 $LIMMAX 10

32.121320 20 32.121320 9 $TEXTSTYLE 7 STANDARD 9 $CLAYER 8 default 0 ENDSEC 0 SECTION 2 TABLES 0 TABLE 2 LTYPE 70 4948253 0 LTYPE 2 CONTINUOUS 70 64 3 Solid line 72 65 73 0 40 0.0 0 ENDTAB 0 TABLE 2 LAYER 70 5 0 LAYER 2 default 70 64 62 7 6 CONTINUOUS 0 ENDTAB 0 TABLE 2 STYLE 70 1 0 STYLE 2 STANDARD 70 0 40 0.0 41 1.0 50 0.0 71 0 42 0.2 3 txt 4 0 ENDTAB 0 TABLE 2 VIEW 70 0 0 ENDTAB 0 ENDSEC 0 SECTION 2 BLOCKS 0 ENDSEC 0 SECTION 2 ENTITIES 0 LINE 8 default 10 4.950000 20 5.000000 30 0.0 11

-5.050000 21

5.000000 31 0.0 0 LINE 8 default 10

-5.050000 20

5.000000 30 0.0 11

-5.050000 21

3.000000 31 0.0 0 LINE 8 default 10

-5.050000 20

-5.000000 30

0.0 11 4.950000 21

-5.000000 31

0.0 0 LINE 8 default 10

-4.050000 20

4.000000 30 0.0 11 4.950000 21 4.000000 31 0.0 0 LINE 8 default 10

-4.050000 20

-4.000000 30

0.0 11 4.950000 21

-4.000000 31

0.0 0 LINE 8 default 10 4.950000 20 5.000000 30 0.0 11 4.950000 21 4.000000 31 0.0 0 LINE 8 default 10 4.950000 20

-4.000000 30

0.0 11 4.950000 21

-5.000000 31

0.0 0 LINE 8 default 10 5.050000 20 5.000000 30 0.0 11 5.050000 21

-5.000000 31

0.0 0 LINE 8 default 10 5.050000 20

-5.000000 30

0.0 11 6.050000 21

-5.000000 31

0.0 0 LINE 8 default 10 6.050000 20

-5.000000 30

0.0 11 6.050000 21 5.000000 31 0.0 0 LINE 8 default 10 6.050000 20 5.000000 30 0.0 11 5.050000 21 5.000000 31 0.0 0 LINE 8 default 10

-4.050000 20

4.000000 30 0.0 11

-4.050000 21

3.000000 31 0.0 0 LINE 8 default 10

-4.050000 20

3.000000 30 0.0 11

-4.050000 21

-3.000000 31

0.0 0 LINE 8 default 10

-4.050000 20

-3.000000 30

0.0 11

-4.050000 21

-4.000000 31

0.0 0 LINE 8 default 10

-4.050000 20

3.000000 30 0.0 11

-3.050000 21

3.000000 31 0.0 0 LINE 8 default 10

-3.050000 20

3.000000 30 0.0 11

-3.050000 21

-3.000000 31

0.0 0 LINE 8 default 10

-3.050000 20

-3.000000 30

0.0 11

-4.050000 21

-3.000000 31

0.0 0 LINE 8 default 10

-5.050000 20

3.000000 30 0.0 11

-5.050000 21

-3.000000 31

0.0 0 LINE 8 default 10

-5.050000 20

-3.000000 30

0.0 11

-5.050000 21

-5.000000 31

0.0 0 LINE 8 default 10

-6.050000 20

3.000000 30 0.0 11

-5.050000 21

3.000000 31 0.0 0 LINE 8 default 10

-6.050000 20

3.000000 30 0.0 11

-6.050000 21

-3.000000 31

0.0 0 LINE 8 default 10

-6.050000 20

-3.000000 30

0.0 11

-5.050000 21

-3.000000 31

0.0 0 ARC 8 default 10 0.000000 20 0.000000 30 0.000000 40 30.000000 50 180.000000 51 0.000000 0 ARC 8 default 10 0.000000 20 0.000000 30 0.000000 40 30.000000 50 0.000000 51 180.000000 0 ENDSEC 0 EOF
Reply to
erica.cross1989
Loading thread data ...

I routinely bounce back and forth between femm and LTspice AND octave [some people use Excel]

I have NO idea of the value of the .dxf file for LTspice, though. The femm results, yes. but the structure? no.

You need to decide how complex you want your 'core' model to be, ...over what frequency range.

THEN you can use LUA script to step through all the frequency values and create files and files of how your core performs, including all the eddy current losses in your core and windings. From that you can use octave [free Matlab clone] to massage that set of data into useable terms for LTspice.

Apologize for being vague, but you don't give a lot to go on here.

post the MODEL.fem file as you did the .dxf file

Reply to
RobertMacy

hi,

Can you list the steps that I need to follow?

here is the .fem file

[Format] = 4.0 [Frequency] = 0 [Precision] = 1e-008 [MinAngle] = 30 [Depth] = 1 [LengthUnits] = centimeters [ProblemType] = planar [Coordinates] = cartesian [ACSolver] = 0 [Comment] = "Add comments here." [PointProps] = 0 [BdryProps] = 1 = " Boundary condition" = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 [BlockProps] = 3 = "Air" = 1 = 1 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 1 = 0 = 0 = 0 = "10 AWG" = 1 = 1 = 0 = 0 = 0 = 0 = 58 = 0 = 0 = 0 = 0 = 3 = 1 = 1 = 2.5887801724742099 = 0 = "M-50" = 1 = 1 = 0 = 0 = 0 = 0 = 5.5099999999999998 = 0 = 0 = 0 = 0 = 0 = 1 = 0 = 0 = 33 0 0 0.17091100000000001 138.36666700000001 0.17724899999999999 139.80333300000001 0.20487 145.686667 0.212115 147.19666699999999 0.25377699999999997 156.58666700000001 0.27551300000000001 161.503333 0.28275499999999998 163.17666700000001 0.32894099999999998 173.58000000000001 0.40590900000000002 190.41999999999999 0.42492400000000002 194.376667 0.77168899999999996 269.936667 0.858155 293.03333300000003 1.2092039999999999 480.52666699999997 1.334382 622.15333299999998 1.3588990000000001 661.98333300000002 1.513684 1207.2666670000001 1.6090880000000001 2006.5666670000001 1.644169 2494.9333329999999 1.665521 2855.0666670000001 1.6915690000000001 3370.5333329999999 1.7385759999999999 4649.1333329999998 1.7957209999999999 6753.9333329999999 1.82437 8225.6000000000004 1.9398409999999999 17725.666667000001 1.9928980000000001 25224.666667000001 2.0000529999999999 26568 2.0181140000000002 30091.666667000001 2.0716130000000001 43725 2.08962 50043.666666999998 2.2033480000000001 104603.333333 2.3063250000000002 177690 2.4898319999999998 321280 [CircuitProps] = 1 = "coil circuit" = 50 = 0 = 1 [NumPoints] = 22

-5.0499999999999998 -5 0 0

4.9500000000000002 -5 0 0

-5.0499999999999998 5 0 0

4.9500000000000002 5 0 0 4.9500000000000002 4 0 0

-4.0499999999999998 4 0 0

-4.0499999999999998 -4 0 0

4.9500000000000002 -4 0 0 5.0499999999999998 5 0 0 6.0499999999999998 5 0 0 5.0499999999999998 -5 0 0 6.0499999999999998 -5 0 0

-4.0499999999999998 3 0 0

-3.0499999999999998 3 0 0

-3.0499999999999998 -3 0 0

-4.0499999999999998 -3 0 0

-5.0499999999999998 3 0 0

-6.0499999999999998 3 0 0

-6.0499999999999998 -3 0 0

-5.0499999999999998 -3 0 0

30 0 0 0

-30 0 0 0 [NumSegments] = 22

3 2 -1 0 0 0 2 16 -1 0 0 0 0 1 -1 0 0 0 5 4 -1 0 0 0 6 7 -1 0 0 0 3 4 -1 0 0 0 7 1 -1 0 0 0 8 10 -1 0 0 0 10 11 -1 0 0 0 11 9 -1 0 0 0 9 8 -1 0 0 0 5 12 -1 0 0 0 12 15 -1 0 0 0 15 6 -1 0 0 0 12 13 -1 0 0 0 13 14 -1 0 0 0 14 15 -1 0 0 0 16 19 -1 0 0 0 19 0 -1 0 0 0 17 16 -1 0 0 0 17 18 -1 0 0 0 18 19 -1 0 0 0 [NumArcSegments] = 2 21 20 180 1 1 0 0 20 21 180 1 1 0 0 [NumHoles] = 0 [NumBlockLabels] = 5

-1.6899999999999999 4.5600000000000005 2 -1 1 0 0 500 0

-3.71 0.21999999999999975 2 -1 1 0 0 -500 0

-5.5299999999999994 0.44000000000000039 2 -1 1 0 0 -500 0

1.3999999999999999 1.8 1 -1 0 0 0 1 0 5.5099999999999998 0.59999999999999998 3 -1 0 0 0 1 0
Reply to
erica.cross1989

in LTSPICE as a component. Can anyone guide me how to borrow this FEMM file to LTSPICE? I have generated the .dxf file for the design.

Hello,

I have been using femm.info a while ago in order to characterize a magnetic core for an open loop hall effect sensor. Don't know if it will succeeded to to inject parameters Bsat, Breman, Hcoerc, ... Lm... etc to a Spice mode l but it will be a very interresting topic ! No time for me at the moment . .. :-(

Good luck, Habib.

Reply to
habib.bouaziz

On Sun, 14 Dec 2014 12:07:50 -0700, wrote:

Got it!

Need a bit of time to go through the model. Your current drive looks incorrect. Doesn't a coil wrapped have + on one side and - one the other? You have used A=0 as boundary which can [with open cores] greatly change the calculated inductance. I prefer to use a boundary condition set to infinity. Check your mesh. For examples, there is MORE detail near the boundary than near the core?! I prefer to set the mesh to be highly concentrated at a boundary [where everything is going on]. That can also make it easier to set the mesh for showing eddy current effects. Also, the mesh in your gap is a single layer, rule of thumb is to have at least three nodes inside there. More importantly this is at DC where there is absolutely NO interest whatsoever and far worse this is a PLANAR model which by its very nature does NOT represent reality very closely. For example, you'' have to slightly reduce the inductance to reflect the fact that a planar model is assumed to go off to infinity into and out of the page, which greatly 'supports' the calculateed inductance. Reduce something like 30%. AND the wire resistance only extends about 1 cm on each side, does NOT show the wire going across the front, or back so you need to increase resistance by at leas 2X. And that's not really accurate due to the four curvey bends as the winding goes around your square cross section core. M-50 steel suggests AC mains type at 50/60. I don't believe ANY inductor there uses a solid core and not use laminations.

But using what you've got, you can simply click on the 'squiggly' and get: Total current = 50 Amps Voltage Drop = 2.45671 Volts Flux Linkage = 0.119311 Webers Flux/Current = 0.00238622 Henries Voltage/Current = 0.0491341 Ohms Power = 122.835 Watts

you have 2500 amps flowing back through the core material?! note the maximum density is 0.4T, so you can greatly speed up the calculations by approximating the non-linear core with a linear core, then just check to make certain all is still ok.

Now make one side + the other - you have zero current flowing back through the core now, which seems more correct. Total current = 50 Amps Voltage Drop = 2.45671 Volts Flux Linkage = 0.0649799 Webers Flux/Current = 0.0012996 Henries Voltage/Current = 0.0491341 Ohms Power = 122.835 Watts

get 0.48T, still very linear region

strand diameter is = 2.58878017247421 mm cross section of core area = 0.0006 meter^2

checkamount of wire in area of winding: stacking factor is 50*pi*(stranddiameterinmeters/2)^2/0.0006 = 0.4 which is believable.

Lraw=1.3mH and Rraw=50milliohms adjusting from planar to axi, makes that more likely to L=1mH and R=0.2 ohms

but with 50Amps you are dissipating around 500 watts, run pretty hot.

Now, within the accuracy of your original model you have the terms to make your LTspice model for this inductor operating near DC.

probably within +/- 20% accuracy.

Reply to
RobertMacy

Hi,

Can you list the steps that I need to make the component using this FEMM data?

erica

Reply to
erica.cross1989

Yes, I can, and will, but NOT on his model. It's pure conjecture crap.

Why? I just noticed you have two -500 Turn 10Awg windings [which won't even FIT into the space allocated [1 cm by 6cm, where you can only fit about 68 Turns, not 500! If you want to fit that many 10Awg turns, you'll have to make that winding window better than 6cm by 7.3cm, which nicely fills what looks like the area inside the core.] and instead of a core M-50 out to the gaps and another piece of M-50 you have that block labeled as a coil of +500T. So that means you have 2500Amps returning from infinity through the core! All pure garbage.

I redid the whole mess with what looks like was intended from your description. And put in a better mesh. Then got some really small inductance and fairly large resistance.

with new mesh and still planar model: Total current = 50 Amps Voltage Drop = 1.6378 Volts Flux Linkage = 0.15368 Webers Flux/Current = 0.0030736 Henries Voltage/Current = 0.0327561 Ohms Power = 81.8902 Watts

LTpice model becomes L=2.36mH, R=0.131 ohms

Simply click on the 'squiggly' icon and the above table shows up solving for the one circuit you have. Then READ those valuse and adjust them to convert from planar to more realistic values and place those calculated vlaues into LTspice DONE. works near DC only. within the accuracy of the original femm model.

As a sanity check, I modeled in axi which very accurately determines the resistance, but still is NOT correct for inductance. Notice the 1kW?! Why is that value correct for rsistance? Because it includes the full wrap around the core for the winding. Why is it incorrect for inductance? Because the cross section gets VERY twitchy trying to convert your model. The technique I used is to 'thin' the area so that the cross section of the core stays at 1 square cm. But that makes the height of the axi core go from something like 0.35cm down to 0.06cm that then due to fringing makes your gap shrink to below your originally intended gap [increasing inductance]. To adjust the gap to be somewhat equivalent requires some noodling and adjusting to make the gap to be wider so that the axi gap WITH fringing is equivalent to your intended original gap of 1 square cm area. THEN you get a bit closer to the real result. NOTE closer to the value, still not very accurate.

Results with enlarged coil winding space and single coil and replace coil where core should be with M-50 core material go to AXI modeling: A: WITHOUT adjusting for cross section and air gap fringing. Total current = 50 Amps Voltage Drop = 21.0958 Volts Flux Linkage = 0.753095 Webers Flux/Current = 0.0150619 Henries Voltage/Current = 0.421916 Ohms Power = 1054.79 Watts

B: with adjustment for cross section and NO adjustment for air gap fringing Total current = 50 Amps Voltage Drop = 21.0958 Volts Flux Linkage = 0.582962 Webers Flux/Current = 0.0116592 Henries Voltage/Current = 0.421916 Ohms Power = 1054.79 Watts

Notice how inductance is dropping? BUT the inductance is still too high because the gap is still to 'good' ?

Would you PLEASE review your model? Right now it's pure crap.

Steps to obtain LTspice model values: As stated above, within the accuracy of your mdoel, simply clck on the 'squiggly' and let femm give you that table of values. Then convert those values from planar to better fit reality, calculate new values of L and R, place into LTspice and DONE.

However, in this case the exercise is NOT very enlightening, nor of much value.

I didn't even begin to discuss the effects of that much power into the winding, how the temp will rise and copper's thermal coefficient of 0.3%/C [probably rise more than 100C in almost no time at all] will increase the temp even more etc. that thermal coefficient means your resistance value you try to stick into LTspice is already off by more than 30% anyway.

The only good news is that at 50A and 500T, the resulting maximum B-Field inside the core stays below the maximum value listed in femm's table. So femm is interpolating, not extrapolating the permeability.

Reply to
RobertMacy

Is it required to hack both FEMM and SPICE to work together?

I'm looking on this packages available in source code:

xfemm:

formatting link
I checked it yesterday, solvers can be built and run on Linux from source

ngspice:

formatting link

The way I think is hacking both to go this algorithm:

  1. run SPICE transient analysis with special custom FEMM models bound to br idge interface
  2. SPICE stops simulation on every nest tick, dump model state and push mom entum currents via FEMM models to bridge
  3. bridge sends current into sustained FEMM model of every FEMM component ( one xfemm solver process per one FEMM model in SPICE)
  4. XFEMM processes do one tick simulation using given momentum currents (co rrect currents in coils, and potentials in case of electrostatic computatio n)
  5. XFEMM recalculates momentum electrical parameters of coils (inductance, back EMF effects)
  6. bridge pushes back updates into SPICE model, and repeat simulation from saved state till next tick
Reply to
qershin

It looks like this FEMM/SPICE couple method lets _simulate any electromechanical elements in dynamics_, but the problem is how fast FEMM can run in this mode interrupted in every sim tick, and how to describe bridged models.

Reply to
qershin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.