-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.m
80 lines (69 loc) · 2.49 KB
/
test.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
% TEST
% Free Fluid Flux-Barriers Rotor for Synchronous Reluctance Motor Drawing
%
% Bacco, Giacomo 2018
clear all; close all; clc;
addpath(genpath('./'))
global deb
deb = 0;
tic
if ~exist('test','dir')
mkdir('test')
end
%% DATA
%try
openfemm(1)
mm = 1e-3; % millimeters
rotor.De = 200*mm; % [m], rotor outer diameter
rotor.wrib_t = 1*mm; % [m], tangential iron rib width
%rotor.barrier_end = 'rect'; % choose 'rect' or comment
for p = [1:50] % number of pole pairs
rotor.p = p;
for Nb = [1:5] % number of flux-barriers
rotor.Nb = Nb;
rotor.wrib = zeros(1,Nb);
% manual input
% rotor.tb = sqrt(2)/sqrt(rotor.p)*[4 8 15]*mm; % flux-barrier widths
% rotor.wc = sqrt(2)/sqrt(rotor.p)*[3 7 12 10]*mm; % flux-carrier widths
% rotor.Nstep = 2*[2, 4, 6]; % number of steps to draw the flux-barrier side
% rotor.barrier_angles_el = [14,26,38]*2; % [deg], electrical flux-barrier angles
%
if Nb == 1
rotor.tb = sqrt(2)/sqrt(rotor.p)*[30]*mm; % flux-barrier widths
rotor.wc = sqrt(2)/sqrt(rotor.p)*[10 22]*mm; % flux-carrier widths
rotor.Nstep = 2*[6]; % number of steps to draw the flux-barrier side
elseif Nb == 2
rotor.tb = sqrt(2)/sqrt(rotor.p)*[10 19]*mm; % flux-barrier widths
rotor.wc = sqrt(2)/sqrt(rotor.p)*[5 10 18]*mm; % flux-carrier widths
rotor.Nstep = 2*[3, 5]; % number of steps to draw the flux-barrier side
elseif Nb == 3
rotor.tb = sqrt(2)/sqrt(rotor.p)*[4 8 15]*mm; % flux-barrier widths
rotor.wc = sqrt(2)/sqrt(rotor.p)*[3 7 12 10]*mm; % flux-carrier widths
rotor.Nstep = 2*[2, 4, 6]; % number of steps to draw the flux-barrier side
elseif Nb == 4
rotor.tb = sqrt(2)/sqrt(rotor.p)*[3 6 9 12]*mm; % flux-barrier widths
rotor.wc = sqrt(2)/sqrt(rotor.p)*[2 4 6 8 10]*mm; % flux-carrier widths
rotor.Nstep = 2*[3, 4, 6, 8]; % number of steps to draw the flux-barrier side
elseif Nb == 5
rotor.tb = sqrt(2)/sqrt(rotor.p)*[2 3 5 6 7]*mm; % flux-barrier widths
rotor.wc = sqrt(2)/sqrt(rotor.p)*[2 3 4 5 7 8]*mm; % flux-carrier widths
rotor.Nstep = 2*[3, 4, 6, 8, 10]; % number of steps to draw the flux-barrier side
end
try
%% barrier points computation
barrier = calc_fluid_barrier(rotor);
%% FEMM drawing
newdocument(0);
try
draw_fluid_barrier(barrier)
mi_saveas(['test/Nb_',num2str(Nb),'_p_',num2str(p),'.fem']);
end
mi_close;
end
end
end
closefemm;
%catch
% disp('FEMM not available.');
%end
toc