forked from WoodenJin/Motor-Optimization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalc_mass_props.m
46 lines (35 loc) · 1.2 KB
/
calc_mass_props.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function [mass, m_stator, m_rotor, j_rotor, r_phase] = calc_mass_props(g)
material_densities;
% fem_name = sprintf('test.fem');
% mi_saveas(fem_name);
% mi_analyze
% mi_loadsolution
%%% stator laminations %%%
mo_clearblock;
mo_groupselectblock(1);
v_s_steel = mo_blockintegral(10)*g.s.slots/g.n_s;
m_s_steel = v_s_steel*densities(g.s.material);
%%% windings %%%
mo_clearblock;
mo_groupselectblock(11);
v_s_windings = mo_blockintegral(10)*g.s.slots/g.n_s;
m_s_windings = v_s_windings*densities('Copper')*g.s.ff
% Still need to add in end-turn mass
%%% rotor steel %%%
mo_clearblock;
mo_groupselectblock(2);
v_r_steel = mo_blockintegral(10)*2*g.r.ppairs/g.n_p;
m_r_steel = v_r_steel*densities(g.r.backiron_material);
j_r_steel = mo_blockintegral(24)*densities(g.r.backiron_material)*2*g.r.ppairs/g.n_p;
%%% rotor magnets %%%
mo_clearblock;
mo_groupselectblock(12);
v_r_magnet = mo_blockintegral(10)*2*g.r.ppairs/g.n_p;
m_r_magnet = v_r_magnet*densities(g.r.magnet_type);
j_r_magnet = mo_blockintegral(24)*densities(g.r.magnet_type)*2*g.r.ppairs/g.n_p;
mo_clearblock;
m_stator = m_s_steel + m_s_windings;
m_rotor = m_r_steel + m_r_magnet
mass = m_stator + m_rotor;
j_rotor = j_r_steel + j_r_magnet;
end