Practical Coilgun Design

FEMM - Hollow Cylinder Projectile

What shape of projectile works best? Let's use FEMM to analyze some possibilities. What about various sizes of a hollow cylinder? The Lua scripting feature in FEMM 3.2 makes this easier!

This web page studies a hollow cylinder, explains how the FEM model works, and tries to draw some conclusions. The FEM files are provided, so you can see how it's done and try other variations.

Note: These programming files are written for FEMM v3.2, and they are not compatible with FEMM v4 and beyond.

FEMM Model of Hollow Cylinder

Dimensions of iron entering coilA few weeks ago, some trial runs seemed to suggest that a hollow cylinder works better than solid. The Lua scripting example provided by Dr. Meeker is an excellent tutorial, but it uses a spherical projectile. I adapted his model to the new purpose.

Let's use Lua scripting to try a range of sizes.

For a starting point, I'll use a 1 mm thick cylinder wall, and vary the inside radius to see what happens. The coil dimensions match my FEMM model on my previous page, just to be consistent.

Assumptions

This modelling is a good starting point, but it is still very simplified:

  • frequency is d.c. (no eddy currents)
  • velocity is zero (every point is simulated at steady-state with no motion)
  • linear BH curve (no saturation effects)
  • steady coil current (not a capacitive-discharge system)
  • no losses due to friction (don't we wish!)

How to Run Lua Script in FEM

Here is a step-by-step procedure to reproduce my results.

  • Preparing to run FEMM
  • Running FEMM
    • Open FEMM 3.2
    • File.. Open "hollow_cylinder.fem"
    • File.. Open Lua script "hollow_cylinder_pre.lua" (note: this will call "hollow_cylinder_post.lua" as a subroutine)
    • This script uses nested loops to try 6 different sizes of a 10mm-long hollow cylinder with 1mm walls
    • For each hollow cylinder it finds the force at 25 different positions
    • This script runs for 30 minutes on a Pentium-4 at 1.4 GHz
    • The results are written to a text file
  • Looking at results
    • Find "hollow_cylinder_results.txt" that it created, and open it with Notepad (or view my copy here)
    • Copy and paste this file into an Excel spreadsheet (or see "hollow cylinder.xls")
    • Graph and compare the results
    • Note that each cylinder has a different volume, and of course the total force depends on how much iron there is to pull upon. So we find the "force per volume" before drawing a graph. 

Pre-processor Lua Program

This program moves the projectile and runs the numerical analysis of the problem. Then it calls the post-processor to extract the particular results we want to see.

hollow_cylinder_pre.lua (download)
-------------------------------------------------
-- Main program
-------------------------------------------------
project = "hollow_cylinder"
outfile = project .. "_results.txt"
start_time = date()

-- Amount the projectile radius grows
increment = 0.3

handle = openfile(outfile, "w")		-- overwrite old results file!
write(handle, "\nInvestigating radius of hollow cylinder projectile \n")
write(handle, "Start time: ", start_time, "\n" )
write(handle, "Coil is 20mm long\n" )
write(handle, "    3mm inside radius\n" )
write(handle, "    6mm outside radius\n" )
write(handle, "Projectile is 10mm long\n" )
write(handle, "    0.1 inside radius (initial)\n" )
write(handle, "    1.1 outside radius (initial)\n")
closefile(handle)

-- Save model under new name, so it can't affect your carefully prepared
-- starting model. The new name also prevents losing your work if you get
-- a runaway solution that you have to kill in the Task Manager.
save_femm_file("temp.fem")

-- Prepare for selecting and moving the group of points in the projectile.
seteditmode("group")

-- Loop through the sizes of projectile; each one is 'increment' larger
for i=0,5 do
	inside_radius = 0.1 + (i * increment)

	handle = openfile(outfile,"a")
	write(handle, "\nInside radius ", inside_radius, ", iteration ", i, "\n")
	closefile(handle)

	-- Loop through all the projectile positions along firing tube
	for n=1,25 do
		-- Save current position for post-processor
		handle = openfile("tempfile","w")
		pos = n-25
		write(handle, pos)
		closefile(handle)

		-- Solve and save results
		showmesh()
		analyse()
		run_post(project .. "_post.lua")

		-- Nudge projectile downward by 1mm
		selectgroup(1)
		move_translate(0,-1)	
	end

	-- Move projectile back to starting position, and
	-- increase radii by 'increment'
	selectgroup(1)
	move_translate(increment, 25)
end

-----------------------------------------------
-- Document the total run time and finish up --
-----------------------------------------------
handle = openfile(outfile, "a")
end_time = date()
write(handle, "\nEnd time: ", end_time )
closefile(handle)

messagebox("All done!\n\nStarted " .. start_time .. "\nFinished " .. end_time)

        

Post-processor Lua Program

This program drives the post-processor of FEM and records the force on the projectile in a file.

hollow_cylinder_post.lua (download)
outfile = "hollow_cylinder_results.txt"

-- read projectile's position at its centerpoint
handle = openfile("tempfile", "r")
position = read(handle, "*n")
closefile(handle)

-- Select the solenoid coil, to prepare for integration
groupselectblock(2)

-- Option 10 tells you the volume.
-- Option 12 computes mechanical force. 
-- Read the manual; it can compute lots of other things!
force = blockintegral(12)

-- Output volume and force to results file
handle = openfile(outfile,"a")
write(handle, position, "\t", force, "\n")
closefile(handle)

exitpost()

        

Conclusion

Graph of force and positionThe graphs for seven different projectiles are practically on top of one another. Therefore, the force per unit of mass does not depend on the inside radius of a hollow cylinder of iron. (Click on the this picture at right for a full-size view.)

This was a surprise! I expected that a larger diameter cylinder would work better, because it would be closer to the coil's windings, and therefore have a smaller air gap. But that's not how it turned out!

I believe this is explained by the fact that the magnetic field is quite uniform inside a solenoid. That means the mechanical force is essentially independent of the projectile's shape -- the magnetism acts upon the iron it can 'reach' regardless of its distance from the coil's windings.

  < Previous Page 3 of 8 Next >