Spulenflussverkettung über Drehwinkel¶
Das Beispiel zeigt die Verwendung der Routinen calc_field_single, rotate und flux_winding_wk zur Berechnung der Spulenflussverkettung über dem Drehwinkel. Die Werte werde für jede Drehstellung in eine Textdatei geschrieben.
Skript-Datei
--------------------------------------------------------------------------------
-- Allgemeine Einstellungen ----------------------------------------------------
--------------------------------------------------------------------------------
exit_on_error = false -- Verhalten nach Fehler
exit_on_end = true -- Verhalten nach Skriptausführung
verbosity = 2 -- Grad der Bildschirmmeldungen
-------------------------------------------------------------------------------
-- Parameterdefinition --------------------------------------------------------
-------------------------------------------------------------------------------
Q = 12 -- Nutzahl
P = 8 -- Polzahl
Da = 100 -- Statoraußendurchmesser
Di = 55 -- Statorinnendurchmesser
s = 3 -- Nutschlitzbreite
ag = 1 -- Luftspaltweite
bz = 7 -- Zahnbreite
h1 = 1.5 -- Zahnkopfhöhe 1
h2 = 2 -- Zahnkopfhöhe 2
hj = 8 -- Jochhöhe
hrs = 6 -- Rückschlusshöhe
hm = 5 -- Magnethöhe
ls = 150 -- Paketlänge
Qm = Q/4 -- Nutzahl Modell
Pm = P/4 -- Polzahl Modell
urs = 1000 -- Permeabilität Stator
urr = 1000 -- Permeabilität PM-Rückschluss
Br = 1.2 -- Remanenz PM
urm = 1.05 -- Rel. Permeabilität PM
Nc = 100 -- Spulenwindungszahl
--------------------------------------------------------------------------------
-- Modellerstellung ------------------------------------------------------------
--------------------------------------------------------------------------------
new_model_force("example","PMSM IL OM, parametrische Definition")
global_unit('mm') -- Globale Einheit (m, cm, mm)
pickdist(0.001) -- Abstand Schnappen auf Knotenpunkt
blow_up_wind(0,0,55,55) -- Fenstergröße anpassen
cosys('cartes')
------------------------------
----- Stator -----------------
------------------------------
-- Berechnung der Koordinaten
x = {}
y = {}
for i=1, 15 do
x[i]=0
y[i]=0
end
x[1],y[1] = pd2c(Da/2,0)
x[2],y[2] = pd2c(Da/2,180/Q)
x[3] = Di/2*math.cos(math.asin(s/Di))
y[3] = s/2
x[4] = x[3]+h1
y[4] = s/2
x[5],y[5] = pd2c(Di/2,180/Q)
x[6] = Di/2+h1+h2;
y[6] = y[5]/x[5]*x[6]-bz/2/math.cos(pi/Di)
x[7] = Da/2-hj;
y[7] = y[5]/x[5]*x[7]-bz/2/math.cos(pi/Di)
x[8] = x[7]
x[9],y[9] = pd2c(vlen(x[4],y[4]),180/Q)
x[10] = (y[6]+x[5]/y[5]*x[6])/(y[5]/x[5]+x[5]/y[5])
y[10] = y[5]/x[5]*x[10]
x[11] = (y[7]+x[5]/y[5]*x[7])/(y[5]/x[5]+x[5]/y[5])
y[11] = y[5]/x[5]*x[11]
x[12] = Di/2
x[13] = x[4]
x[14] = Di/2-ag/3
x[15],y[15] = pd2c(Di/2-ag/3,180/Q)
-- Knotenkettenerstellung
agnp = 1 -- Knotenteilung im Luftspalt
ndt(ag*2/3)
nc_circle(x[14],y[14],x[15],y[15],360/Q/2/agnp+1)
nc_circle(x[1],y[1],x[2],y[2],0)
nc_circle(x[13],y[13],x[4],y[4],0)
nc_circle(x[3],y[3],x[5],y[5],0)
nc_line(x[3],y[3],x[4],y[4],0)
nc_line_cont(x[6],y[6],0)
nc_line_cont(x[7],y[7],0)
nc_line_cont(x[8],y[8],0)
nc_line(x[12],y[12],x[13],y[13],0)
nc_line_cont(x[8],y[8],0)
nc_line_cont(x[1],y[1],0)
nc_line(x[14],y[14],x[12],y[12],0)
nc_line(x[15],y[15],x[5],y[5],0)
nc_line_cont(x[9],y[9],0)
nc_line_cont(x[10],y[10],0)
nc_line_cont(x[11],y[11],0)
nc_line_cont(x[2],y[2],0)
-- Vernetzung
create_mesh_se(Da/2-hj/2,0+hj/2)
create_mesh_se((Da+Di)/4,s/4)
create_mesh_se(Di/2+h1/2,s/4)
-- Definition Subregionen
def_new_subreg(Da/2-hj/2,0+hj/2,"Stator",11)
-- Spiegeln und Kopieren
mirror_nodechains(x[2],y[2],x[15],y[15])
x0,y0 = pd2c(Di/2-ag/3,0)
x1,y1 = pd2c(Da/2,0)
x2,y2 = pd2c(Da/2,360/Q)
x3,y3 = pd2c(Di/2-ag/3,360/Q)
rotate_copy_nodechains(x0,y0,x1,y1,x2,y2,x3,y3,Qm-1)
------------------------------
----- Rotor ------------------
------------------------------
-- Berechnung der Koordinaten
x[1],y[1] = pd2c(Di/2-ag*2/3,0)
x[2],y[2] = pd2c(Di/2-ag*2/3,360/P)
x[3],y[3] = pd2c(Di/2-ag,0)
x[4],y[4] = pd2c(Di/2-ag,360/P)
x[5],y[5] = pd2c(Di/2-ag-hm,0)
x[6],y[6] = pd2c(Di/2-ag-hm,360/P)
x[7],y[7] = pd2c(Di/2-ag-hm-hrs,0)
x[8],y[8] = pd2c(Di/2-ag-hm-hrs,360/P)
-- Knotenketten
nc_circle(x[1],y[1],x[2],y[2],360/P/agnp+1)
nc_circle(x[3],y[3],x[4],y[4],0)
nc_circle(x[5],y[5],x[6],y[6],0)
nc_circle(x[7],y[7],x[8],y[8],0)
nc_line(x[7],y[7],x[5],y[5],0)
nc_line_cont(x[3],y[3],0)
nc_line_cont(x[1],y[1],0)
nc_line(x[8],y[8],x[6],y[6],0)
nc_line_cont(x[4],y[4],0)
nc_line_cont(x[2],y[2],0)
-- Vernetzung
create_mesh_se(Di/2-ag*5/6,ag/3)
create_mesh_se(Di/2-ag-hm/2,ag)
create_mesh_se(Di/2-ag-hm-hrs/2,ag)
-- Definition Subregionen
def_new_subreg(Di/2-ag-hm-hrs/2,ag,"Rückschluss",11)
-- Spiegeln und Kopieren
rotate_copy_nodechains(x[7],y[7],x[1],y[1],x[2],y[2],x[8],y[8],Pm-1)
-- Luftspalt
x0,y0 = pd2c(Di/2-ag*2/3,0)
x1,y1 = pd2c(Di/2-ag/3,0)
nc_line(x0,y0,x1,y1,0)
x0,y0 = pd2c(Di/2-ag*2/3,360*Pm/P)
x1,y1 = pd2c(Di/2-ag/3,360*Pm/P)
nc_line(x0,y0,x1,y1,0)
create_mesh_se(Di/2-ag/2,ag)
-------------------------------
----- Randbedingungen ---------
-------------------------------
x0,y0 = pd2c(Di/2-ag-hm-hrs,0)
x1,y1 = pd2c(Da/2,0)
x2,y2 = pd2c(Di/2-ag-hm-hrs,360.0*Pm/P)
x3,y3 = pd2c(Da/2,360*Pm/P)
def_bcond_vpo(x1,y1,x3,y3,0)
def_bcond_vpo(x2,y2,x0,y0,0)
def_bcond(x3,y3,x2,y2,x0,y0,x1,y1,4)
-------------------------------
------ Wicklungen -------------
-------------------------------
tauq = 360/Q -- Nutteilungswinkel
Rq = (Di/2+Da/2-hj)/2 -- mittlerer Nutradius
x,y = pd2c(Rq,tauq/4)
wkey = def_new_wdg(x,y,"cyan","Strang 1",Nc,0.0,wo)
x,y = pd2c(Rq,tauq-tauq/4)
add_to_wdg(x,y,wsamekey,wi,wser)
x,y = pd2c(Rq,2*tauq+tauq/4)
def_new_wdg(x,y,"yellow","Strang 2",Nc,0.0,wi)
x,y = pd2c(Rq,3*tauq-tauq/4)
add_to_wdg(x,y,wsamekey,wo,wser)
x,y = pd2c(Rq,tauq+tauq/4)
def_new_wdg(x,y,"magenta","Strang 3",Nc,0.0,wi)
x,y = pd2c(Rq,2*tauq-tauq/4)
add_to_wdg(x,y,wsamekey,wo,wser)
-------------------------------
---- Materialeigenschaften ----
-------------------------------
-- Stator und PM-Rückschluss
def_mat_fm(Da/2-hj/2,ag,urs,100)
def_mat_fm(Di/2-ag-hm-hrs/2,ag,urr,100)
-- Permanentmagnete
for i=0, (Pm/2-1) do
x,y = pd2c(Di/2-ag-hm/2,360.0/P*(2*i+1)-180.0/P)
def_mat_pm(x,y,"red",Br,urm,0,m.radial,100)
end
for i=1, Pm/2 do
x,y = pd2c(Di/2-ag-hm/2,360.0/P*2*i-180.0/P)
def_mat_pm(x,y,"green",Br,urm,180,m.radial,100)
end
-----------------------------------------------------------
-- Definition Grunddaten der Maschine ---------------------
-----------------------------------------------------------
m.num_slots = Q -- Number of Slots Q
m.num_poles = P -- Number of Poles 2p (>= 2)
m.npols_gen = Pm -- Number of Poles simulated (>= 1)
pre_models("basic_modpar");
--------------------------------------------------------------------------------
----- Berechnung ---------------------------------------------------------------
--------------------------------------------------------------------------------
-- Drehung, Fluss- und Drehmomentberechung in Skript (modular)
cosys('polar')
agr = 0.5*(Di-ag) -- Luftspaltradius
phi = 0.0 -- Anfangswinkel
dphi = 1.0 -- Winkelinkrement
NRot = 720.0/P/dphi+1 -- Anzahl Drehschritte
outputfile=io.open("example.txt","w+")
outputfile:write("# phi [°] Psi_wk1 [Vs] T [Nm]\n");
for i=1,NRot do
calc_field_single(1,"actual",0.01) -- Feldberechnung
Psi = flux_winding_wk(wkey)*ls*P/Pm -- Flussberechnung
m.coord_x1, m.coord_y1 = pd2c(agr,0.0) -- Drehmomentberechnung
m.coord_x2, m.coord_y2 = pd2c(agr,359.5)
m.arm_length = ls
post_models("force_torque","F_M")
T = F_M[3]
-- Ausgabe in Logdatein und Ergebnisdatei
printf(" > phi = %g deg, Psi = %g Vs, M = %g Nm",phi,Psi,T)
outputfile:write(string.format("%7.3f %9.6f %9.6f\n",phi,Psi,T));
phi=dphi*i -- Drehung des Rotors
if (phi==360.0*Pm/P) then
rotate(agr,dphi-phi,"inside","increment") -- Drehung über Modellgrenzen hinaus
else
rotate(agr,dphi,"inside","increment") -- Drehung innerhalb der Modellgrenzen
end
end
io.close(outputfile)
rotate(0,0,0,"reset") -- Rücksetzen auf Anfangszustand
save_model('close')