Author Topic: Funny Magnetostatics problem  (Read 1137 times)

0 Members and 1 Guest are viewing this topic.

Offline EteslaTopic starter

  • Regular Contributor
  • *
  • Posts: 154
  • Country: us
Funny Magnetostatics problem
« on: December 13, 2019, 05:07:31 am »
Hi folks, I'm trying to find a mathematical model for an electromagnet used in a solenoid valve. The end goal is to be able to predict the holding strength of the electromagnet given different currents, core materials, sizes ect. The equation you can find easily online does not account for core reluctance, so they show the force between the electromagnet and it's target shooting to infinity as the distance between the objects goes to zero, which is obviously not the case. Accounting for core reluctance, I got the equation that's boxed at the bottom of the handwritten page.
Plugging that equation into matlab and plotting across very small air gap lengths, I get something interesting. The peak positive force is on the order of magnitude of what I witnessed in real life for the real solenoid, but it looks like as the gap length goes to zero, the force goes negative and actually repels the electromagnet from the target.... I'm fairly certain that my equation is alright, as its results line up with the simpler version of the equation that does not account for core reluctance as the gap length L gets larger. I also plotted the magnetic field density to make sure my assumption that the material which is some kind of cobalt iron for the original solenoid wouldn't saturate (B < .5 ish). My question is as follows: Why does the force appear to go negative when the gap distance is very small? Is this just a fluke in the math, or is this a known and real phenomenon? Any help is appreciated.

In case it helps, here's the matlab code, it should probably work in octave as well:

clear;
close all;

A = 1.3e-5; %cross sectional area of U shaped electromagnet in meters squared
ur = 2000; %relative permeability of core material
uo = (4e-7)*pi;
N = 16; %number of turns on electromagnet
Ld = .01; %average distance of a 'loop' that goes through the U core, through the air, and through the thing that's being attracted
I = .04; %current running in the electromagnet

L = 0:.000000001:.00002; %an array of air gap sizes (lengths) to iterate over

delta = .0000000000001; %the difference in gap lengths used to calculate the force

Force = zeros(1,length(L)); %initialize Force array

B = zeros(1,length(L));

ForceIgnoreCore = zeros(1,length(L)); %initialize Force array that will use the math ignoreing core reluctance

L1 = 0; %temp variables to hold L1 and L2, which are two very similar lengths with difference delta
L2 = 0;

for i = 1:length(L)
    L1 = L(i);
    L2 = L1 - delta;
   Force(i) = -(uo*L1*A*(N*I/(2*L1 + Ld/ur))^2 - uo*L2*A*(N*I/(2*L2+Ld/ur))^2)/(L1-L2);
   B(i) = N*I*uo/(2*L1+Ld/ur);
   ForceIgnoreCore(i) = uo*A*(N*I)^2/(4*L2^2);
end

%plot(L,Force,L, ForceIgnoreCore);
plot(L,Force);
title('Force vs distance of solenoid valve');
ylabel('Force (Newtons)');
yyaxis right;
plot(L,B);
ylabel('B (Tesla)');
xlabel('Gap Distance (Meters)');
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15154
  • Country: de
Re: Funny Magnetostatics problem
« Reply #1 on: December 13, 2019, 07:59:58 am »
The principle way of calculating the force looks good. However I think you missed that with changing distance the flied in the core will also change and thus an additional contribution.

Instead of the formula with 2 distances close by one should use the derivative as the limiting case of the 2 L very close.
 

Offline ChunkyPastaSauce

  • Supporter
  • ****
  • Posts: 539
  • Country: 00
Re: Funny Magnetostatics problem
« Reply #2 on: December 13, 2019, 08:08:39 am »
force equation is different than what's on paper
« Last Edit: December 13, 2019, 08:12:54 am by ChunkyPastaSauce »
 

Offline TurboTom

  • Super Contributor
  • ***
  • Posts: 1471
  • Country: de
Re: Funny Magnetostatics problem
« Reply #3 on: December 13, 2019, 08:31:10 pm »
Just a general hint: When I'm faced with electromagnetic problems like this, I found FEMM to be a very useful, free program. It's by far not as complex and "heavy-weight" as a full blown electromagnetic CFD (i.e. Ansys) but provides good reliability for two-dimensional problems. U/I is soemthing you've got to get used to, though  ::)



P.S. See example "Force on a Taper Plunger Magnet"
« Last Edit: December 14, 2019, 09:33:10 pm by TurboTom »
 
The following users thanked this post: SiliconWizard

Offline Conrad Hoffman

  • Super Contributor
  • ***
  • Posts: 2077
  • Country: us
    • The Messy Basement
Re: Funny Magnetostatics problem
« Reply #4 on: December 20, 2019, 08:23:48 pm »
+1 on FEMM. This site is also useful for some formulas- https://nbviewer.jupyter.org/github/tiggerntatie/emagnet-py/blob/master/index.ipynb
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Funny Magnetostatics problem
« Reply #5 on: December 20, 2019, 08:47:03 pm »
Hm, I wonder how close to saturation a typical solenoid operates.  It may be below saturation when open (partial air path), but into saturation when closed (path predominantly through core material).

In that case you need to account for the increase in reluctance as a function of flux density, and you need a function that fits the B-H curve.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline duak

  • Super Contributor
  • ***
  • Posts: 1048
  • Country: ca
Re: Funny Magnetostatics problem
« Reply #6 on: December 20, 2019, 09:31:02 pm »
I would think a simple DC solenoid operates way up on the B-H curve close to saturation.  It's a tradeoff of wasting possible core flux vs wasting power.  AC solenoids are another thing.  I've got a few somewhere so maybe I should try it. 
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Funny Magnetostatics problem
« Reply #7 on: December 20, 2019, 10:23:52 pm »
Regarding the math -- where did L1 and L2 come from?  Are those adjacent elements of the incremental array, thus calculating the forward difference, with L1 = L and L2 = L + dL?

Also, why not take the symbolic derivative?  The expression has the form aL / (L + b)^2, with derivative a(b - L) / (L + b)^3 and which has a local minima L = 2b (which I think you've got the negative of, reflecting positive attractive force, so a local maxima in your case).

I'm not sure how to explain it, if the force does in fact reduce for gaps this small (mind, it might not be easy to measure this in practice, due to the high mu_r of real materials (obviously, that one can be defeated by intentionally using a lower mu material), and the uneven surfaces of real parts), or if the expression for work is wrong, or what.  It looks right at a glance.

I will note that the total work should include the core length term (LA --> (L + Ld/mu_r)A), so that it can be equated to the electrical work done -- this simply reflects that a closed solenoid still has large (but finite) inductance, and so stores some energy when flux is given to it.  But this is a constant term in the work equation, which goes away in the force equation (d/dL(term) = 0), so isn't related to the result in question.

Wait no, duh, the Ld term is still over (L + Ld/mu_r) so it doesn't go away.  Or actually, together it's the same as one denominator factor, so we can cancel it: the square goes away, there's no L on top and it's simply of the form a/(L+b) with derivative -a/(L+b)^2 which has no local minima or other interesting behavior around L ~ b, and saturates smoothly to -a/b^2 as L --> 0, as we expect.

Cheers!

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf