Using FEMM to simulate coilguns

TheMerovingian, Mon Feb 12 2007, 09:58AM

Since my simple simulator seems to have a poor accuracy I started to mess with the lua scripting interface to simulate the coilgun armature-coil interaction with more accuracy. The electrical part simulation is the same of my simulation software (various topologies, various swithches, specification of external resistance). The main drawback is of course long calculation times (1 - 1.5 h with 10us timestep) and the impossibility to estimate eddy losses, simply neglecting them. I will post soon some graphs and animation of the field lines (need a suitable bmp to avi/agif converter). I will be glad to hear some impressions, suggestions and costructive criticism. cheesey
Re: Using FEMM to simulate coilguns
TheMerovingian, Mon Feb 12 2007, 11:28AM

THese are the results:

Simulation endtime=4 mSeconds
Simulation timestep=10 uSeconds
Simulation current off time=0.75 mSeconds
Simulation current off on-axys position=5 cm
Number of Steps=400
Simulation start=02/12/07 10:32:57
Initial Voltage=330 Volts
Initial Current=0 Amperes
External Resistance=200 mOhms
Bank capacitance=640 uFarads
Topology= Turn Off
Switch= IGBT
On-state voltage drop=1400 mV
Flywheel diode voltage drop=800 mV
Projectile Mass=4 grams
Projectile on-axys starting position=-1.5 cm
Projectile initial speed=0 m/s
Projectile lenght=2 cm
Projectile diameter=5.5 mm
Projectile material=Pure Iron
Coil resistance=898.9909949361248 mOhms
Open Coil inductance=274.4087468357108 uHenries
Current switched off @ 760 us
****************************
Output:
Simulation end=02/12/07 11:20:42
Projectile Final Speed=13.68039878183639 m/s
Projectile kinetic energy=0.3743066246066238 Joules
Overall efficiency=1.274023411412692 %
Peak force=72.0871155330796 N
Peak speed=13.70709987673577 m/s
Peak electrical power=48.85636145745686 KiloWatts
Peak mechanical power=630.9904073286771 Watts
Peak current=209.4293577349096 Amperes
Peak inductance=668.3639743882482 uHenries
I = 0 time =3980 us
Final voltage =130.7205312360377 Volts
Turn off time =760 us
Bank Voltage @ off time =133.3307995309736 Volts
Coil current @ off time =169.0861461852455 Volts
Coil magnetic energy @ off time =4.265452569920918 J


ps: the attached xls file is lost....
Re: Using FEMM to simulate coilguns
OZZY, Tue Feb 13 2007, 01:27PM

Hi everyone, this is my first post but I have been reading the Forum for about 6 months. I have just started using FEMM and found the results quite surprising. I decided to start by creating a magnetostatic model of my own coilgun to investigate the relationship between current and force and to try out different configurations of external iron. The first step was to model the coil without external iron and with the projectile halfway into the coil, this would provide a baseline against which to compare other geometries.
Coilgun specs are:
Coil ID= 7.2mm
Coil length= 25mm
Wire= 20SWG, 125 turns
Projectile OD= 5.6mm
Projectile length= 25mm

I started at very low current, 1A then 5A and 10A, at each current I recorded;
total flux
inductance of the coil
Power disipated due to I^2*R
Force on Projectile
Max Field intensity H
Max flux density B

At low currents the model behaved in a linear way, force is proportional to I^2 and inductance is constant, however at 30A the projectile starts to saturate, the inductance starts to drop and from this point on the force is proportional to current. By the time the coil current reaches 60A the projectile is off the end of the B/H curve for the material. suprised To put this into context I have estimated the peak current in my coilgun at 800A from spice simulation of the LCR circuit.
Additional info: Force was calculated using block intergral (force via weighted stress tenser), the material was 1010steel from the FEMM materials library.
If my results are correct then they have profound implications for coilguns.
1. Virtually all amateur coilguns will be operating with the projectile fully saturated.
2. In order to get accurate results from FEMM it will be necessary to add more points to the B/H curve to extend it into the region where coilguns operate, ie very high values of field intensity H.
3. Hysteresis losses in the projectile will be a significant loss mechanism. In a scenario with low velocity and high acceleration such as a single stage coilgun, hysteresis losses will be far higher than eddy current losses.
I would be grateful if people would comment on this or even better construct a similar FEMM model and try it for themselves.
Re: Using FEMM to simulate coilguns
TheMerovingian, Tue Feb 13 2007, 07:36PM

OZZY wrote ...


At low currents the model behaved in a linear way, force is proportional to I^2 and inductance is constant, however at 30A the projectile starts to saturate, the inductance starts to drop and from this point on the force is proportional to current. By the time the coil current reaches 60A the projectile is off the end of the B/H curve for the material. suprised To put this into context I have estimated the peak current in my coilgun at 800A from spice simulation of the LCR circuit.



In normal high-voltage coilguns the force is lineary proportional to current because they always operate in saturation (at low currents the force is very small). My script includes full RCL simulation getting the parameters from femm analisys (inductance, back EMF due to inductance variation). It is more than 600 lines of code and needs approx 1.5 h of time to do the simulation at 5us timestep at che current mesh size (0.1 mm air, 0.025 projectile and coil). Anyway here is another simulation , this time with halfbridge turning off the current on position, rather than time (-5mm from the coil centre).

Simulation endtime=4 mSeconds
Simulation timestep=5 uSeconds
Simulation current off time=4 mSeconds
Simulation current off on-axys position=-0.5 cm
Number of Steps=800
Simulation start=02/13/07 21:12:54
Initial Voltage=330 Volts
Initial Current=0 Amperes
External Resistance=200 mOhms
Bank capacitance=1000 uFarads
Topology= HalfBridge
Switch= IGBT
On-state voltage drop=1400 mV
Flywheel diode voltage drop=800 mV
Projectile Mass=3.6 grams
Projectile on-axys starting position=-1.5 cm
Projectile initial speed=0 m/s
Projectile lenght=2 cm
Projectile diameter=5.5 mm
Projectile material=Pure Iron
Coil resistance=608.1409671626708 mOhms
Open Coil inductance=164.3629563159443 uHenries
Current switched off @ 905.0000000000001 us
****************************
Output:
Basic information:
Simulation end=02/13/07 22:26:20
Projectile Final Speed=25.03304318616738 m/s
Projectile kinetic energy=1.127975852088912 Joules
Used energy=45.83530100336205 Joules
Overall efficiency=2.460932572486434 %
Advanced information:
Peak force=125.4279389404258 N
Peak speed=25.03304346783233 m/s
Peak electrical power=73.61682397622234 KiloWatts
Peak mechanical power=1964.424678542787 Watts
Electrical information:
Peak current=297.6966812533561 Amperes
Peak inductance=671.9981511938833 uHenries
I = 0 time =1090 us
Final voltage =131.2608014346854 Volts
Turn off time =905.0000000000001 us
Bank Voltage @ off time =119.2318922659203 Volts
Coil current @ off time =188.8016563210368 Volts
Coil magnetic energy @ off time =3.588447471765252 J
Halfbridge recovered energy =1.506576929981942 J
Halfbridge recovery efficiency =41.98408759877478 %



I'll repeat the simulation with the simple model to see how much error it gives.

EDIT: simulation done with my simple program

Simulation endtime=4 mSeconds
Simulation timestep=5 uSeconds

Simulation current off on-axys position=-0.5 cm


Initial Voltage=330 Volts
Initial Current=0 Amperes
External Resistance=200 mOhms
Bank capacitance=1000 uFarads
Topology= HalfBridge
Switch= IGBT
On-state voltage drop=1400 mV
Flywheel diode voltage drop=800 mV
Projectile Mass=3.6 grams
Projectile on-axys starting position=-1.5 cm
Projectile initial speed=0 m/s
Projectile lenght=2 cm
Projectile diameter=5.5 mm
Projectile Saturation Field=2.3Tesla
Projectile Initial permeability = 5000
Projectile magnetization model = Polinomial
Coil resistance= 638.2 mOhms
Open Coil inductance=164.02 uHenries
Current switched off @ 910 us
****************************
Output:
Basic information:

Projectile Final Speed=24.69 m/s
Projectile kinetic energy=1.09 Joules
Used energy= 39.75 Joules
Overall efficiency=2.76 %
Advanced information:
Peak force=125.3 N
Peak speed=25.99 m/s

Electrical information:
Peak current=283.5 Amperes
Peak inductance=671.9981511938833 uHenries

Final voltage =174.22 Volts
Turn off time =910 us
Bank Voltage @ off time =127.3 Volts
Coil current @ off time =202.37 Volts


I used the saturation magnetization got from the B-H curve of Pure Iron got from FEMM. As you can see the simulations give similar results. Both cannot estimate the eddy current losses. The simple graphical interface program is faster in calculations, but less rigorous then FEMM, also it cannot simulate coilguns with external core. The FEMM script is slower but can simulate virtually any type of coilgun.

Give me some parameters and I will simulate with both programs the system and give you the results

PS: I love halfbridge topology, it ramps down the current so fast cheesey
Re: Using FEMM to simulate coilguns
OZZY, Wed Feb 14 2007, 06:45PM

Hi Merovingian. I am very interested in your coilgun simulations, the best simulation I have seen so far is the one produced by Bill Slade but I have no idea how it works, his mathematical skill is beyond my understanding. Your FEMM based program looks like it should give very useful results. As you say it can not model eddy currents but if the coilgun is designed to minimize eddy currents then the error should be small. You also mention a simple program, could you give us some more information on how both systems work.
Looking at the data you have provided I can see you have very long run times, this may be inevitable with an FEA run 800 times. However there are things you can do to reduce the processing involved. A timestep of 5us or 10us seems sensible but your mesh size is very small, a small mesh will give better accuracy but how much accuracy do you need? How large is your boundry and what is the no of nodes? Have you tried different mesh sizes to evaluate the error? My simple model used a mesh size of 0.2mm for iron and copper, 1mm for air close to the coil and 5mm out to the boundry at r=100mm, no of nodes= 7941. I will do some tests with finer and coarser meshes and let you know the results. Bear in mind that you only need a fine mesh in areas with a high gradient of flux density.
Question. How should I extend the B/H curve to higher values of field intensity? The best idea I have is to continue the curve as a straght line with gradient= mu0, will this work?
I would be very grateful if you would simulate my coilgun, I will put together a more detailed description of my system and include it in a later post. I am currently using full external iron as I have found that it gives a useful gain in efficiency.
Re: Using FEMM to simulate coilguns
TheMerovingian, Wed Feb 14 2007, 07:58PM

OZZY wrote ...

Hi Merovingian. I am very interested in your coilgun simulations, the best simulation I have seen so far is the one produced by Bill Slade but I have no idea how it works, his mathematical skill is beyond my understanding. Your FEMM based program looks like it should give very useful results. As you say it can not model eddy currents but if the coilgun is designed to minimize eddy currents then the error should be small. You also mention a simple program, could you give us some more information on how both systems work.
Looking at the data you have provided I can see you have very long run times, this may be inevitable with an FEA run 800 times. However there are things you can do to reduce the processing involved. A timestep of 5us or 10us seems sensible but your mesh size is very small, a small mesh will give better accuracy but how much accuracy do you need? How large is your boundry and what is the no of nodes? Have you tried different mesh sizes to evaluate the error? My simple model used a mesh size of 0.2mm for iron and copper, 1mm for air close to the coil and 5mm out to the boundry at r=100mm, no of nodes= 7941. I will do some tests with finer and coarser meshes and let you know the results. Bear in mind that you only need a fine mesh in areas with a high gradient of flux density.
Question. How should I extend the B/H curve to higher values of field intensity? The best idea I have is to continue the curve as a straght line with gradient= mu0, will this work?
I would be very grateful if you would simulate my coilgun, I will put together a more detailed description of my system and include it in a later post. I am currently using full external iron as I have found that it gives a useful gain in efficiency.

Yeah. Bill's simulator is the most advanced and accurate on this forum.

My boundary limits ar a sphere of 14mm diameter (7 radius)

Extending the B-h curve is very simple (in the region of saturated projectile, since it behaves linearly), but i think that femm extrapolates it by itself
Re: Using FEMM to simulate coilguns
Evgenij, Sun Feb 18 2007, 03:29AM

Hi, Mero!
This FEMM-script will some help to you, I hope.
]1171769384_200_FT20565_simul103.zip[/file]
Re: Using FEMM to simulate coilguns
OZZY, Sun Feb 18 2007, 10:38AM

TheMerovingian wrote ...


My boundary limits ar a sphere of 14mm diameter (7 radius)

Extending the B-h curve is very simple (in the region of saturated projectile, since it behaves linearly), but i think that femm extrapolates it by itself

If your boundary is 14mm diameter and your projectile is 20mm long how does the coilgun fit inside the sphere?

I have done some tests to evaluate different mesh sizes. In order to get an accurate force calculation you only need a fine mesh in the projectile and the air very close to it. I found the best mesh size for my geometry was 0.2mm, I estimate the error at better than 0.2%. The rest of the model uses a mesh of 2mm so that the flux lines look reasonably smooth. I have reduced the boundary from 100mm radius to 50mm.

FEMM does extrapolate the B-H curve but David Meeker warns that extrapolation can be less accurate than interpolation. To test this I ran my model at high currents (50A to 800A) and then extended the B-H curve with gradient = mu0. The difference in force between the two curves is small but gets larger as field intensity increases. At I=200A the diference 0.5% at I=800A its 2.6% with a flux density of 6.3T suprised . I`m not sure how these results compare with real steel but it`s turned out a lot closer than I thought.
Re: Using FEMM to simulate coilguns
TheMerovingian, Mon Feb 19 2007, 10:13PM

140 mm, 14cm excuse me^^

Hy evgenij. I'm very interested in your simulator. If you want you can try mine (FEMM or EXE) to compare the resutls.

Very interesting code. The lua scripts builds the preprocessor document itself (while mine builds only the projectile).

The code seems lighter (464 lines contra 667), but the real time-consuming thing is the femm calculation itself.

I will implement also the automatic document creation soon.

Current characteristics:

- Simulation timestepwise
- Simulation endtime by batch value or projectile reaching boundary limits
- Frame recording (BMP)
- Simulation of 1-Simple free running topology, 2-turn-off topologies (including diode-resistor), 3-half bridge topology
- Simulation of power dissipation of 1-ideal switch 2-mosfet 3-scr 4-igbt
- Possibility to turn off the circuit by time or by position
- Calculation of switch voltage for safety to prevent breakdown

Characteristics to implement:

-Possibility of editing b-h curve
-Automatic preprocessor document creation



Re: Using FEMM to simulate coilguns
Evgenij, Wed Feb 21 2007, 01:50AM

The data-table about magnetization of soft iron in this script are the most valuable part. Try to apply them in the your calculations. All coilguns work deeply in a zone of saturation and FEMM-extrapolation will bring essential mistakes. It is true. The curve needs to be prolonged to strong fields area. I do not see sense to compare results of different programs. It is necessary to compare each program and results of experiment. That is to compare first of all the shape of a current of the present coilgun and the shape of a current from a simulator. It is all to do laziness. But it is necessary to do it.

Therefore the greatest interest submit data experiments in the tables. These data should be written down with high accuracy (initial data, speed, and the shape of a current). If to have it is a lot of good experimental data then will creation an exact simulator easily.
Re: Using FEMM to simulate coilguns
TheMerovingian, Wed Feb 21 2007, 10:06AM

Evgenij wrote ...

The data-table about magnetization of soft iron in this script are the most valuable part. Try to apply them in the your calculations. All coilguns work deeply in a zone of saturation and FEMM-extrapolation will bring essential mistakes. It is true. The curve needs to be prolonged to strong fields area. I do not see sense to compare results of different programs. It is necessary to compare each program and results of experiment. That is to compare first of all the shape of a current of the present coilgun and the shape of a current from a simulator. It is all to do laziness. But it is necessary to do it.

Therefore the greatest interest submit data experiments in the tables. These data should be written down with high accuracy (initial data, speed, and the shape of a current). If to have it is a lot of good experimental data then will creation an exact simulator easily.


I have modified the b-h curve of "Pure Iron" in FEMM, prolonging it up to 11Tesla (using menten-magnetization curve, fitted to the previous b-h curve with least squares method).

An "exact simulator" is impossibile, a 5-10% error must be accounted due to the error of initial measurements.

My simple simulator also was extented to the use of a external b-h curve, modifiable from the GUI