Lecture08 PDF
Lecture08 PDF
A Design Example -
An Electromagnet
Objective
Use a genetic algorithm to solve an engineering
design example
2
The Problem
Design an electromagnet to lift a mass.
i
rb
vb
Battery
f
M 3
Specifications
Mass
10 kG
10 cm by 10 cm area
Magnetic material should not overlap mass
Must lift from distance of 5 mm
Gravity is on surface of Earth (G=9.8 m/s2)
Battery
vb = 12 V
rb = 0.5 Ω
Current should not exceed 6 A 4
Specifications (Continued)
Winding
Shouldnot exceed packing factor of 0.7
May use Aluminum (Al) or Copper (Cu)
Aluminum
Density (ρw) = 2701 Kg/m3
Conductivity (σw) = 35.4 1 1/(μmΩ)
Current Density (jmax) = 6.14 MA/m2
Copper
Density (ρw) = 8900 Kg/m3
Conductivity (σw) = 58.0 1/(μmΩ)
Current Density (jmax) = 7.62 MA/m2
5
Specifications (Continued)
Magnetic Material
Microsil
Bsat = 1.4 T, μ = 15000 μ0 , ρm = 7064 Kg/m3
Superperm 80
Bsat = 0.7 T, μ = 6000 μ0 , ρm = 8069 Kg/m3
Superperm 49
Bsat = 1.2 T, μ = 3500 μ0 , ρm = 7892 Kg/m3
6
Specifications (Continued Again)
Size (Mass)
Total mass of electromagnet should be as small as
possible
7
Electromagnet Dimensions
ww
wb
Depth into
page = d
dw ds
wi
we ws we 8
Design Variables
Wire
Material Type mw
1=Cu, 2=A)
ConductorCross Section ac
Number of Turns N
Magnetic Material
Material Type mm
1=Microsil, 2=Superperm 80, 3=Superperm 49)
9
Design Variables (Continued)
Core
Slot width ws
Wire window width ww
Slot depth ds
Wire window depth dw
End width we
I-core width wi
Back width wb
Depth d
10
Parameter Vector
⎡ mw ⎤
⎢a ⎥
⎢ w⎥
⎢N ⎥
⎢ ⎥ ww = rww ws
⎢ mm ⎥
⎢ ws ⎥
⎢ ⎥ d w = rdw d s
⎢rww ⎥
θ =⎢ ⎥
d
⎢ s⎥ wi = rwi we
⎢ rdw ⎥
⎢ ⎥
⎢ we ⎥ wb = rwb we
⎢ rwi ⎥
⎢ ⎥
⎢ rwb ⎥
⎢ d ⎥
⎣ ⎦ 11
Data Vector
⎡ M ⎤
⎢ G ⎥
⎢ ⎥
⎢ g ⎥
⎢ ⎥
⎢ w ⎥ρ
⎢ ρm ⎥
⎢ ⎥
Ψ = ⎢ σw ⎥
⎢ B ⎥
⎢ sat ⎥
⎢ imax ⎥
⎢ ⎥
J
⎢ max ⎥
⎢ l max ⎥
⎢ ⎥
⎢⎣ p f ,max ⎥⎦ 12
Electrical Analysis
Goal
⎡pf ⎤
⎢ j ⎥ = F (θ, Ψ)
⎢ ⎥ elec
⎢⎣ i ⎥⎦
13
Electrical Analysis
Packing factor
ac N
pf =
ww d w
Winding volume (conductor)
(
v w = p f ww d w (2d + 2 wb ) + πd w2 ww )
Winding length
vw
lw =
ac
14
Electrical Analysis (Cont.)
Winding resistance
lw
rw =
a cσ w
Current vb
i=
rb + rw
Current Density
i
j=
ac
15
Magnetic Analysis
Goal
⎡ B0,1 ⎤
⎢B ⎥
⎢ 1, 2 ⎥
⎢ B2,3 ⎥ = Fmag (θ, i, Ψ )
⎢ ⎥
⎢ B 4,5 ⎥
⎢ fe ⎥
⎣ ⎦
Matlab m-file: Magnetic_Analysis.m
16
Magnetic Equivalent Circuit
ww
N0 N1
wb
dw ds
N7 N2
N6 N3 g
N5 N4
wi
17
we ws we
Magnetic Equivalent Circuit (Cont)
Pe
Pvl
Ni
Φ 0 ,1
N0 N1
P0 ,1 Φ1,2
P0 ,7 P1, 2
N2
N7
Phl Φ 2 ,3
P6 ,7 P2, 3
N3
N6
P6, 3
P5, 6 P3 ,4
N5 P4 ,5 Φ 4 ,5 N4
18
Review: Magnetic Equivalent Circuits
19
Magnetic Material Permeances
wb dμ
ww
P0,1 =
ws + we
2 we dμ
P1, 2 = P0,7 =
N0 N1
wb
wb + d w
we dμ
dw ds
N7 N2
P2,3 = P6,7 =
ds − dw / 2 N6 N3 g
wi dμ
N5 N4
wi
P4,5 =
ws + we we ws we
20
Air Gap Permeances ww
(d s − d w )dμ 0 2 μ 0 (d s − d w ) ⎛ πwe ⎞
P6,3 = + ln⎜⎜1 + ⎟⎟
ws π ⎝ ws ⎠
N0 N1
wb
we dμ 0 μ 0 d ⎛ πwi ⎞
P3, 4 = P5,6 = + ln⎜⎜1 + ⎟⎟ +
π
123 144⎝2443⎠
g g dw ds
N7 N2
main face outer face
2μ 0 d⎛ π min(ws , d s ) ⎞ 2μ 0 we ⎛ πwi ⎞
ln⎜⎜1 + ⎟⎟ + ln⎜⎜1 + ⎟⎟ N6 N3 g
π ⎝4 π
3⎠ 14442 3⎠
⎝ 44g4
4g
1444 4244444 N5 N4
wi
inner face front / back faces
we ws we
21
Hor. And Vert. Leakage Permeances ww
1 μ 0 d w d 2 μ 0 d w ⎛ πwe ⎞
Phl = + ln⎜⎜1 + ⎟⎟
3 ws 3π ⎝ ws ⎠ N0 N1
wb
1 μ 0 dww
Pvl =
6 ds + g
dw ds
N7 N2
N6 N3 g
N5 N4
wi
we ws we
22
End Leakage Permeance ww
wt = d s − d w
μ 0 wt wb (d + 2we ) 1
Pe1 =
wt + wb (2d w + wt + wb ) wt wb
ww +
wt + wb N0 N1
k1 = d w − 2 ww wb
⎧ 2 ww d w > 2 ww
⎪ dw ds
k2 = ⎨ d w N7 N2
⎪ 2 d w ≤ 2 ww
⎩
⎡ 4 1 2 2 ⎤ N6 N3 g
⎢ 2k + 2 k k
1 2
3
+ k1 k 2 ⎥
μ 0 (d + 2we ) ⎢ 4
⎥
N5 N4
Pe 2 =
wi
8ww2 d w2 ⎢− 2 k 3 k + k1 ln⎛⎜1 + 2 2 k 2 ⎞⎥
4
⎢ ⎟⎥
16 ⎜⎝ ⎟
1 2
⎢⎣ 8 k1 ⎠⎥⎦ we ws we
23
Pe = Pe1 + Pe 2
Nodal Equations
Pe
P1, 2
N3
24
Nodal Equations (Cont)
⎡ P0,1 + Pe + P1, 2 − P1, 2 0 0 0 0 0 ⎤
⎢ − P1, 2 P1, 2 + Phl + P2,3 − P2,3 0 0 0 − Phl ⎥
⎢ ⎥
⎢ 0 − P2,3 P6,3 + P3, 4 + P2,3 − P3, 4 0 − P6,3 0 ⎥
⎢ ⎥
P=⎢ 0 0 − P3, 4 P3, 4 + P4,5 − P4,5 0 0 ⎥
⎢ 0 0 0 − P4,5 P4,5 + P5,6 − P5,6 0 ⎥
⎢ ⎥
⎢ 0 0 − P6,3 0 − P5,6 P6,7 + P5,6 + P6,3 − P6,7 ⎥
⎢ 0 − Phl 0 0 0 − P6,7 P0,7 + Phl + P6,7 ⎥⎦
⎣
F = NiP0,1 P −1
1st column
[F1 F2 F3 F4 F5 F6 F7 ] = F T
25
Fluxes
Pe
Φ1, 2 = ( F1 − F2 ) P1, 2 Ni
Φ 0 ,1 N
N0 1
Φ 5,6 = ( F5 − F6 ) P5,6 N6
N3
P6, 3
Φ 0,7 = F7 P0,7 N5 P4 ,5 Φ 4 ,5 N4
26
Flux Densities ww
Φ 0,1
B0,1 =
wb d N0 N1
wb
Φ1, 2
B1, 2 =
we d
dw ds
Φ 2, 3 N7 N2
B2,3 =
we d
N6 N3
Φ 4,5 g
B4,5 = N5 N4
wi d wi
we ws we
27
Force
Using co-energy techniques and assuming
magnetic linearity it can be shown
∂Pvl 1 μ 0 dww
=−
∂g 6 (d s + g )2
28
Force (Cont.)
⎡0 0 0 0 0 0 0⎤
⎢0 0 0 0 0 0 0⎥⎥
⎢ ∂P3, 4 ∂P3, 4
⎢0 0 − 0 0 0⎥
⎢ ∂g ∂g ⎥
⎢ ∂P3, 4 ∂P3, 4 ⎥
∂P ⎢0 0 − 0 0 0⎥
=⎢ ∂g ∂g ⎥
∂g ⎢ ∂P5,6 ∂P5,6 ⎥
⎢0 0 0 0 − 0⎥
⎢ ∂g ∂g ⎥
⎢ ∂P5,6 ∂P5,6 ⎥
⎢0 0 0 0 − 0⎥
⎢ ∂g ∂g ⎥
⎢⎣0 0 0 0 0 0 0⎥⎦
29
Force (Continued)
∂L
∂g
[ ]
= N 2 P012 P −1
1st row ∂g
[ ]
∂P −1
P
1st column
+N
2 ∂Pvl
∂g
1 ∂L 2
fe = − i
2 ∂g
30
Setting Up Constraints
Less than function
⎧ 1 x ≤ xmax
⎪⎪ 1
ltne( x, xmax , Δx) = ⎨ x > xmax
x −x
⎪1 + max
⎪⎩ Δx
31
Setting Up Constraints
Greater than function
⎧ 1 x ≥ x min
⎪⎪ 1
gtne( x, x min , Δx) = ⎨ x < x min
x −x
⎪1 + min
⎪⎩ Δx
32
Geometrical Constraints
Recall, magnetic material should not overlap
mass
33
Electrical Constraints
Packing Factor c3 = ltne( p f , p f ,max ,0.1 p f ,max )
34
Flux Density Constraints
Back of U-Core c6 = ltne( B0,1 , Bsat ,0.01Bsat )
35
Force Constraints
We must lift mass (and I-core)
f req = ( M + wi d ( ws + 2we ) ρ m )G
36
Performance Metrics ww
Total mass
m1 =
(2d s we d + ( ws + 2we )( wb + wi )d )ρ m + wb
p f (ww d w (2d + 2 wb ) + πd w2 ww )ρ w
Depth into
page = d
dw ds
wi
we ws we
37
Fitness Function
Combined constraint
c = min(c1 , c2 ,L c10 )
Fitness Function
⎧ 1
⎪⎪ m + ε c =1
f = ⎨ 10 1
⎪ ∑ ci − 10 c < 1
⎪⎩c =1
38
Code Organization
Design Codes
Electromagnet_Design.m
GOSET
Electromagnet_Fitness.m
Electrical_Analysis.m
Magnetic_Analysis.m
39
Code Organization (Cont)
Supporting Routines
Electromagnet_Drawing1
Electromagnet_Drawing2
Electromagnet_Design_Review
Electromagnet_Design_Multirun
Electromagnet_Design_Multrun_Review
40
Electromagnet_Design.m (1/3)
% Electromagnet Design
%
% Written by:
% Ricky Chan for S.D. Sudhoff
% School of Electrical and Computer Engineering
% 1285 Electrical Engineering Building
% West Lafayette, IN 47907-1285
% E-mail: [email protected]
% Set Up Population
GAP = gapdefault;
GAP.fp_ngen = 2500;
GAP.fp_ipop = 500;
GAP.fp_npop = 500;
GAP.mc_alg = 4.0;
GAP.dt_alg = 3;
% Set Up Migrations
GAP.mg_nreg=5; % number of regions
GAP.mg_tmig=100; % mean time between migrations
GAP.mg_pmig=0.05; % probability of a individual migrating
% Units
mm=1.0e-3;
cm=1.0e-2;
41
Electromagnet_Design.m (2/3)
% Problem Requirement Data
Psi.M = 10; % Mass of object (Kg)
Psi.G = 9.8; % Gravity (m/s2)
Psi.g = 0.5*cm; % Gap Width (m)
Psi.rhow = [ 8900; 2701]; % Wire - Kg/m3
Psi.sigmaw = [ 58.0; 35.4]*1e6; % Wire - A/Ohm
Psi.jmaxw = [ 7.62; 6.14]*1e6; % Wire - A/m2
Psi.descw = ['Copper '; 'Aluminum']; % Wire - Description
Psi.bmaxm = [ 1.4; 0.7; 1.2]; % Steel - Bsat, T
Psi.rhom = [7064.1; 8069.4; 7892.1]; % Steel - Density Kg/m3
Psi.myum = [ 15000; 6000; 3500]; % Steel - Perm., (relative)
Psi.descm = ['Microsil '; ...
'Superperm 80'; ...
'Superperm 49']; % Steel - Description
Psi.imax = 6; % Maximum current, A
Psi.lmax = 10e-2; % Maximum length
Psi.pfmax = 0.7; % Maximum packing factor
Psi.vb = 12; % Battery Voltage
Psi.rb = 0.5; % Battery Resistance
42
Electromagnet_Design.m (3/3)
% Genetic Mapping
% mw ac N mm ws rww ds rdw we rwi rwb d
GAP.gd_min = [ 1 1e-8 10 1 1*cm 0.1 1*mm 0.1 1*mm 0.2 0.2 1*mm];
GAP.gd_max = [ 2 1e-4 1e3 3 10*cm 1.0 20*cm 1.0 5*cm 2.0 2.0 10*cm];
GAP.gd_type = [ 1 3 3 1 3 3 3 3 3 3 3 3 ];
GAP.gd_cid = [ 1 1 1 1 1 1 1 1 1 1 1 1 ];
% Solve Problem
[fP,GAS]= gaoptimize(@Electromagnet_Fitness,GAP,Psi,[],[],[]);
% Save run
s=input('Type 1 to Save Run ');
if (s==1)
save samplerun
end
43
Electromagnet_Fitness.m (1/7)
function fitness = Electromagnet_Fitness(param,Psi,figNum)
% ELECTROMAGNET_FITNESS
%
% fitness = Electromagnet_Fitness(param,Psi,x)
%
% Inputs:
% param = design parameters
% Psi = data vectors
% x = optional input to print out extra information
%
% Outputs:
% fitness = fitness value
%
% Written by:
% Ricky Chan for S.D. Sudhoff
% School of Electrical and Computer Engineering
% 1285 Electrical Engineering Building
% West Lafayette, IN 47907-1285
% E-mail: [email protected]
44
Electromagnet_Fitness.m (2/7)
% Map to nicer variable names
mw = param(1);
ac = param(2);
N = round(param(3));
mm = param(4);
ws = param(5);
rww = param(6);
ds = param(7);
rdw = param(8);
we = param(9);
rwi = param(10);
rwb = param(11);
d = param(12);
45
Electromagnet_Fitness.m (3/7)
% Computing the width of winding (ww), depth of winding (dw), width of the
% I core (wi), and the width of the back of the U core (wb)
ww = rww*ws;
dw = rdw*ds;
wi = rwi*we;
wb = rwb*we;
% Magnetic Analysis
[B01, B12, B23, B45, fe] = Magnetic_Analysis(param,Psi,i);
% Constraints
lmax = Psi.lmax;
pfmax = Psi.pfmax;
jmaxw = Psi.jmaxw(mw);
imax = Psi.imax;
bmax = Psi.bmaxm(mm);
rhom = Psi.rhom(mm);
rhow = Psi.rhow(mw);
46
Electromagnet_Fitness.m (4/7)
c1 = ltne(ws+2*we,lmax,0.1*lmax);
c2 = ltne(d,lmax,0.1*lmax);
c3 = ltne(pf,pfmax,0.1*pfmax);
c4 = ltne(j,jmaxw,0.1*jmaxw);
c5 = ltne(i,imax,0.1*imax);
c6 = ltne(B01,bmax,0.01*bmax);
c7 = ltne(B12,bmax,0.01*bmax);
c8 = ltne(B23,bmax,0.01*bmax);
c9 = ltne(B45,bmax,0.01*bmax);
f_req = (Psi.M + wi*d*(ws+2*we)*rhom)*Psi.G;
c10 = gtne(fe,f_req,0.01*f_req);
% design objective
m1 = (2*ds*we*d + (ws+2*we)*(wb+wi)*d)*rhom + ...
pf*(ww*dw*(2*d+2*wb)+pi*dw^2*ww)*rhow;
47
Electromagnet_Fitness.m (5/7)
% if more than 3 arguments, plot the result
% and write a report
if nargin >= 3
format short g
disp('Parameters');
disp(['Parameter 1: Wire type ',Psi.descw(mw,:)]);
disp(['Parameter 2: Wire cross section is ', num2str(ac), ' m^2']);
disp(['Parameter 3: Number of turns is ', num2str(N)]);
disp(['Parameter 4: Magnetic material is ', Psi.descm(mm,:)]);
disp(['Parameter 5: Slot width is ',num2str(ws*100),' cm']);
disp(['Parameter 6: Winding width is ',num2str(rww*100),'% slot width']);
disp(['Parameter 7: Slot depth is ',num2str(ds*100),' cm']);
disp(['Parameter 8: Winding depth is ',num2str(rdw*100),'% slot depth']);
disp(['Parameter 9: End width is ',num2str(we*100),' cm']);
disp(['Parameter 10: I width is ',num2str(rwi*100),'% end width']);
disp(['Parameter 11: Base width is ',num2str(rwb*100),'% end width']);
disp(['Parameter 12: Depth is ',num2str(d*100),' cm']);
disp(' ');
48
Electromagnet_Fitness.m (6/7)
disp('Constraints');
disp(['Overall width is ',num2str(100*(ws+2*we)/lmax),'% allowed']);
disp(['Overall depth is ',num2str(100*d/lmax),'% allowed']);
disp(['Packing factors is ',num2str(100*pf/pfmax),'% allowed']);
disp(['Current density is ',num2str(100*j/jmaxw),'% allowed']);
disp(['Current is ',num2str(100*i/imax),'% allowed']);
disp(['Back core flux density is ',num2str(100*B01/bmax),'% allowed']);
disp(['Back end core flux density is ',num2str(100*B12/bmax),'% allowed']);
disp(['Front end core flux density is ',num2str(100*B23/bmax),'% allowed']);
disp(['I core flux density is ',num2str(100*B45/bmax),'% allowed']);
disp(['Force required is ',num2str(f_req),' N']);
disp(['Force produced is ',num2str(100*fe/f_req), '% required']);
disp(' ');
disp('Metrics');
disp(['Mass is ',num2str(m1),' Kg']);
figure(figNum);
clf;
Electromagnet_Drawing1(param,Psi);
figure(figNum+1)
Electromagnet_Drawing2(param,Psi);
end
49
Electromagnet_Fitness.m (7/7)
function p = ltne(x,xmax,delta)
if x <= xmax
p = 1;
else
p = 1./(1+abs((xmax-x)./delta));
end
function p = gtne(x,xmin,delta)
if x >= xmin
p = 1;
else
p = 1./(1+abs((xmin-x)./delta));
end
50
Sample Evolution
1
Normalized Value
0.5
0
1 2 3 4 5 6 7 8 9 10 11 12
Parameter Number
2
f:B(b) Md(g) Mn(r)
-2
-4
-6
500 1000 1500 2000 2500
Generation 51
Evolution – Best Fit Individual
(Matlab Demo)
52
Parameters
Parameter 1: Wire type Copper
Parameter 2: Wire cross section is 7.8519e-007 m^2
Parameter 3: Number of turns is 585
Parameter 4: Magnetic material is Microsil
Parameter 5: Slot width is 7.1906 cm
Parameter 6: Winding width is 97.7656% slot width
Parameter 7: Slot depth is 0.96031 cm
Parameter 8: Winding depth is 97.8117% slot depth
Parameter 9: End width is 1.2104 cm
Parameter 10: I width is 49.2545% end width
Parameter 11: Base width is 52.2008% end width
Parameter 12: Depth is 3.7947 cm 53
Constraints
Overall width is 96.1141% allowed
Overall depth is 37.9474% allowed
Packing factors is 99.3753% allowed
Current density is 99.4713% allowed
Current is 99.1917% allowed
Back core flux density is 99.442% allowed
Back end core flux density is 50.9116% allowed
Front end core flux density is 49.215% allowed
I core flux density is 99.6887% allowed
Force required is 99.5053 N
Force produced is 100.3524% required
54
Metrics
Mass is 0.86127 Kg
55
0.15 Profile View 0.15
0.1 0.1
0.05 0.05
0 0
-0.05 -0.05
-0.1 -0.1
-0.15 -0.15
0.015
0.01
0.005
-0.005
-0.01
-0.015
0.02
0 -0.05
0
-0.02 0.05
57
Design Repeatability
Repeat design 25 times:
Parameter Min/Mn Max/Mn Std/Mn
mw 100.00 100.00 0
mn 100.00 100.00 0
58
Design Repeatability
Parameter Min/Mn Max/Mn Std/Mn
ws 88.44 110.01 5.06
rww 97.93 100.72 0.57
ds 92.18 105.86 4.07
rdw 96.46 101.94 1.46
59
Design Repeatability
60