Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 34
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
05/11 ramses (16)
05/11 Arcstarter (31)
05/11 Zak (15)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Electromagnetic Projectile Accelerators
« Previous topic | Next topic »   

magnetic field equations

1 2 
Move Thread LAN_403
capacitortree
Sun Jan 08 2012, 06:00PM Print
capacitortree Registered Member #4321 Joined: Sun Jan 08 2012, 05:10PM
Location: Illinois
Posts: 5
I am trying to write a program to optimize coil parameters to get the greatest magnetic field density. I looked up the equations for magnetic field density, and found B = u0 * NI/L for the b field density. But this equation says that the field strength is dependent on the # of turns per meter (N/L) and current. This would seem to imply that the best coil would always be the one with the shortest possible length, 1 turn per layer, and multiple layers, because it would have the highest current. Having more turns on each layer wouldn't affect the magnetic field density, it would only negatively impact the amount of current available because of the increased resistance. I always thought field strength was proportional to the total # of turns and current. Am I interpreting the equation incorrectly, or is the best coil really one with the shortest length?
Back to top
Turkey9
Sun Jan 08 2012, 08:24PM
Turkey9 Registered Member #1451 Joined: Wed Apr 23 2008, 03:48AM
Location: Boulder, Co
Posts: 661
To maximize the field density, you want to maximize turns per meter, not just turns. The best coil will be one with the highest number of turns per unit length, not the shortest.
Back to top
capacitortree
Sun Jan 08 2012, 10:26PM
capacitortree Registered Member #4321 Joined: Sun Jan 08 2012, 05:10PM
Location: Illinois
Posts: 5
But resistance goes up if you increase the length and add more turns per layer, so current goes down, and since the total number of turns has no effect on field density, I would still think that a shorter coil is better, at least up to some practical limit.
Back to top
Turkey9
Mon Jan 09 2012, 06:59AM
Turkey9 Registered Member #1451 Joined: Wed Apr 23 2008, 03:48AM
Location: Boulder, Co
Posts: 661
That equation assumes ideal wires, so I'm not completely sure what the best configuration would be. The resistance would not go up enough adding two or three turns per layer to negate the advantage of more turns. But isn't this what your program is going to find out? I'd start by fixing the number of layers however, too many variables isn't always a good thing.
Back to top
klugesmith
Mon Jan 09 2012, 07:38AM
klugesmith Registered Member #2099 Joined: Wed Apr 29 2009, 12:22AM
Location: Los Altos, California
Posts: 1714
Welcome to 4hv, CT.

You are using a very simple formula, which is strictly valid only for an infinite, straight solenoid. Might give a reasonably accurate value near the center of a finite solenoid with large length/diameter ratio. For stubby coils, flat ones, ones with finite thickness, or ones with ferromagnetic material nearby, you need other formulas, or numerical field solvers.

Here's a reference I like. Link2 Check out the closed-form formula for "On-axis fields due to round, finite, air core solenoids". See if it matches your formula in the limit, as the length becomes very large and the place of interest is well inside the coil.

[edit] Also please note:
1) the magnetic attraction of a small iron particle depends on the -gradient- or space derivative of the magnetic flux density. That's why there is no force within an infinite solenoid, or in the center of a finite one.

2) as you add turns, you could increase the wire thickness to keep the resistance constant. You will find that the current in any efficient coilgun coil is limited by inductance more than by resistance. A more accurate way to model the attractive force on a magnetic core is from the derivative of inductance with respect to core position.
Back to top
Tetris
Mon Jan 09 2012, 10:11PM
Tetris Registered Member #4016 Joined: Thu Jul 21 2011, 01:52AM
Location: Gainesville, FL
Posts: 660
You're such a gauss. (boss) :D

EDIT:
3568d471b87a
Back to top
Pinkamena
Wed Jan 11 2012, 11:29PM
Pinkamena Registered Member #4237 Joined: Tue Nov 29 2011, 02:49PM
Location:
Posts: 117
I have written such a program in Wolfram Mathematica. You can alter every coil and cap bank parameter (length, inner diam., outer diam., wire thickness, wire resistance, capacitance, voltage, etc), and it'll give you various graphs, showing all you need to know about the firing of your coil.
I'll post the code here, but if you don't have wolfram mathematica, you can't use it for much... Unless someone re-writes it into flash or something. If anyone want to this, I'll be more than happy to explain the code in detail.
Here are screengrabs of an earlier version of the code, showing a function depending on time and coil thickness (ignore "70ms").Linkylink
And here are a screengrab of how the code I posted looks. It's depending only on time, you edit the other parameters in real-time using the sliders.More links


EDIT: How the hay do I spoiler text?

This version of the code calculates the length of the coil based on inner coil diameter and a set weight for the projectile. The smaller the diameter is, the longer the coil will be. It can easily be changed to allow for manual editing of the coil length.
"Outer radius:" Slider[Dynamic[r0], {minr0, maxr0}, 
  ContinuousAction -> False] {Dynamic[r0*10^2]}
"inner radius:" Slider[Dynamic[ri], {0.0055, maxri}, 
  ContinuousAction -> False] {Dynamic[ri*10^2]}

diam := 0.002 (*diameter wire*)
rw := 0.01954 (*ohm/meter*)
convert := 39.37
time := t
(*Activate this line of code if you want time-dependant functions \
that are dependant on another variable*)
(*Slider[Dynamic[time], {0,0.3}]*)
d := 7870 (*mass per m3*)
v0 := 300 (*cap voltage*)
c := 92.8*10^-3 (*cap capacitance*)
w := 0.400 (*weight projectile*)
magconst := 1.25663706*10^-6 (*magnetic constant*)

L := 0.5 w/(d*(ri^2)*Pi) (*lenght*)
maxL := 0.2
minri := Sqrt[0.5 w/(d*Pi*maxL)]
maxri := 0.02
minr0 := 0.0076(*ri+diam*)
maxr0 := 0.08
turnsPrLayer := Floor[L/diam]
wireLength := turnsPrLayer*2 Pi*(Sum[(ri + i*diam), {i, 0, maxLayers}])
turns := maxLayers*turnsPrLayer
beta := L/2 ri
alpha := r0/ri
maxLayers := Floor[If[(r0 - ri)/diam < 1, 0, (r0 - ri)/diam]]

(*Inductance formula*)
res := wireLength*rw 
induc := ((31.6*turns^2*ri^2)/(6 ri + 9 L + 10 (r0 - ri)))*10^-6

(*Currentformula*)
betaI := Sqrt[(1/(induc*c)) - (res^2/(4*(induc^2)))]
alphaI := res/(2*induc)
curr := (v0/(betaI*induc))*Exp[-alphaI*time]*Sin[betaI*time]

(*Voltage in caps Formula*)
v := v0 - {1/c}*
   NIntegrate[(v0/(betaI*induc))*Exp[-alphaI*tid]*
     Sin[betaI*tid], {tid, 0, time}, PrecisionGoal -> 3]
(*Energy in caps formula*)
eCap := 0.5*c*(N[v]^2)

(*F (a, b) formula*)
F := beta (ArcSinh[alpha/beta] - ArcSinh[1/beta])

(*H0 equation*)
H0 := (turns*curr*F)/(2*beta*ri*(alpha - 1))*10^-3
oersted := 4*Pi*H0/1000
jPrOe := 4000 - eCap

"Length of coil:" Dynamic[L]
"turns per layer:" Dynamic[turnsPrLayer]
"Resistance coil:" Dynamic[res]
"Length of wire:" Dynamic[wireLength]
(*"current:"Dynamic[curr]
"magnetic field:"Dynamic[H0]*)


Dynamic[Plot[oersted, {t, 0, 0.05}, PlotRange -> {0, 150}, 
  AxesLabel -> {seconds, "Oerstedts"}, Filling -> Bottom]]
Dynamic[Plot[eCap, {t, 0, 0.05}, PlotRange -> {0, 4400}, 
  AxesLabel -> {seconds, "energy left in coils, J"}, 
  Filling -> Bottom]]
Dynamic[Plot[curr, {t, 0, 0.05}, PlotRange -> {0, 800}, 
  AxesLabel -> {seconds, "current, A"}, Filling -> Bottom]]

(*These lines of code are for time-fixed simulations *)
(*Dynamic[Plot[res, {z,minr0,maxr0}, PlotRange->{-2,10}, \
AxesLabel->{coil thickness, resistance},Filling->Bottom]]
Dynamic[Plot[wireLength, {t,0,0.1}, PlotRange->{0,1000}, \
AxesLabel->{seconds,wirelength}]]
Dynamic[Plot[induc, {z,minr0,maxr0}, PlotRange->{0,0.04}, \
AxesLabel->{coil thickness,inductance (H)}]]
Dynamic[Plot[L, {z,minr0,maxr0}, PlotRange->{0,0.5}, AxesLabel->{coil \
thickness,coil length}]]
Dynamic[Plot[F, {z,minr0,maxr0}, PlotRange->{0,0.001}, \
AxesLabel->{coil thickness, function}]]*) 

(*WARNING: Extremely time-consuming to simulate*)
(*Style[Dynamic[Plot3D[H0, {z,0.00206,maxr0},{y,minri,0.015}, \
PlotRange->{0,100},AxesLabel->{coil thickness, \
coilgap}]],DynamicEvaluationTimeout->100]*)
(*Style[Dynamic[DensityPlot[curr, {z,0.00206,maxr0},{y,minri,0.015}, \
PlotRange->{-100,1000},AxesLabel->{coil thickness, \
coilgap}]],DynamicEvaluationTimeout->100]*)
(*Dynamic[ContourPlot[maxLayers, {x,0.00206,maxr0},{y,minri,0.015}, \
PlotRange->{0,30}, AxesLabel->{coil thickness,layers}]]*)
Back to top
capacitortree
Thu Jan 12 2012, 02:41AM
capacitortree Registered Member #4321 Joined: Sun Jan 08 2012, 05:10PM
Location: Illinois
Posts: 5
@kludgesmith
Thanks for the link. It's much nicer than reading through wikipedia.

1) the magnetic attraction of a small iron particle depends on the -gradient- or space derivative of the magnetic flux density. That's why there is no force within an infinite solenoid, or in the center of a finite one.

I guess this is why the position of the projectile in the coil matters so much, and the strongest magnetic attraction is not when the projectile is almost completely in the coil.
But I think the field max field strength would still give you a good idea of the total impulse the projectile will get from the coil.

Pinkamena, I like the graphs that your program produces. I've been having a hard time getting my python3 program to graph points directly, although I can still graph easily by copy and pasting into excel. But why did you choose to calculate the H field of the coil? I thought B fields were more accurate for solenoid coils.

I'll upload my program when I've finished it. It doesn't account for capacitor discharge but it allows you to put in a range of values to radius and length and it determines the best combo.
Back to top
Pinkamena
Sun Jan 15 2012, 12:07AM
Pinkamena Registered Member #4237 Joined: Tue Nov 29 2011, 02:49PM
Location:
Posts: 117
capacitortree wrote ...

Pinkamena, I like the graphs that your program produces. I've been having a hard time getting my python3 program to graph points directly, although I can still graph easily by copy and pasting into excel. But why did you choose to calculate the H field of the coil? I thought B fields were more accurate for solenoid coils.

Logic
Back to top
capacitortree
Mon Jan 23 2012, 06:14AM
capacitortree Registered Member #4321 Joined: Sun Jan 08 2012, 05:10PM
Location: Illinois
Posts: 5
Well I finally finished the program. You can input a range of lengths, outer radii, and gauges, and it gives you the best values and some nice graphs.
It requires python3.2 and gnuplot.
It automatically outputs graphs on linux, I think it should run on windows if you comment out some code at the bottom and run gnuplot separately (there is a note about it in the program).

I think I got rid of all the bugs, but its always possible there are still some.
]coilgun7.py.zip[/file]
Back to top
1 2 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.