Skip to content

Commit

Permalink
update hysteresis and eddy losses
Browse files Browse the repository at this point in the history
  • Loading branch information
askprash committed Oct 1, 2024
1 parent 6951d54 commit 3004e78
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions src/propsys/PMSM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const μ₀ = 1.25663706127e-6 #N⋅A⁻² https://physics.nist.gov/cgi-bin/cuu/
P_design::Float64 = 1e6
"""Angular velocity [rad/s]"""
Ω::Float64 = 10e3
"""Frequency [Hz]"""
f::Float64 = 12e3
"""Slots per pole [-]"""
Nsp::Int = 3
"""Phases [-]"""
Expand All @@ -38,11 +40,6 @@ const μ₀ = 1.25663706127e-6 #N⋅A⁻² https://physics.nist.gov/cgi-bin/cuu/
airgap_thickness::Float64 = 2e-3
"""Pole pairs [-]"""
p::Int = 8
"""Eddy current loss coefficient [W/lbm/Hz²/T²]"""
kₑ::Float64 = 32.183e-6 #https://arc.aiaa.org/doi/10.2514/6.2018-5026
"""Hysteresis loss coefficient [W/lbm/Hz]"""
kₕ::Float64 = 10.664e-3 #https://arc.aiaa.org/doi/10.2514/6.2018-5026

"""Mass of machine [kg]"""
mass::Float64 = 0.0
end
Expand Down Expand Up @@ -85,7 +82,7 @@ end
"""Flux density [Wb/m² = T]"""
B::Float64 = 1.0
"""Material"""
material::AbstractMaterial
material::ElectricSteel = ElectricSteel("M19")
"""Mass [kg]"""
mass::Float64 = 0.0
end
Expand All @@ -100,7 +97,7 @@ end
"""Flux density [Wb/m² = T]"""
B::Float64 = 1.0
"""Material"""
material::AbstractMaterial
material::ElectricSteel = ElectricSteel("M19")
"""Mass [kg]"""
mass::Float64 = 0.0
end
Expand All @@ -115,7 +112,7 @@ end
"""Flux density [Wb/m² = T]"""
B::Float64 = 1.0
"""Material"""
material::AbstractMaterial
material::ElectricSteel = ElectricSteel("M19")
"""Mass [kg]"""
mass::Float64 = 0.0
end
Expand Down Expand Up @@ -169,11 +166,11 @@ function size_PMSM!(motor::Motor, shaft_speed::AbstractFloat, design_power::Abst
windings = motor.windings
shaft = motor.shaft

Check warning on line 167 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L161-L167

Added lines #L161 - L167 were not covered by tests

Ω = shaft_speed * (2 * π / 60)
f = motor.N_pole_pairs * shaft_speed / 60
motor.Ω = shaft_speed * (2 * π / 60)
motor.f = motor.N_pole_pairs * shaft_speed / 60

Check warning on line 170 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L169-L170

Added lines #L169 - L170 were not covered by tests

#Outer radius of the magnet - subject to the highest rotational speeds
radius_gap = motor.U_max / Ω
radius_gap = motor.U_max / motor.Ω

Check warning on line 173 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L173

Added line #L173 was not covered by tests

# Calculate maximum flux through the stator and rotor back iron
# Really, this needs to be a constraint Bsbi ≤ Bsat (at the top level) rather
Expand Down Expand Up @@ -210,7 +207,7 @@ function size_PMSM!(motor::Motor, shaft_speed::AbstractFloat, design_power::Abst
@warn "Flux density in teeth exceeds saturation flux density"

Check warning on line 207 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L205-L207

Added lines #L205 - L207 were not covered by tests
end

torque = design_power / Ω
torque = design_power / motor.Ω
slot_current = J_max * windings.kpf * A_slot #Update to be peak current
windings.N_turns = floor(windings.kpf * A_slot / windings.A_wire)

Check warning on line 212 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L210-L212

Added lines #L210 - L212 were not covered by tests

Expand Down Expand Up @@ -269,12 +266,22 @@ end # function ohmic_loss
"""
"""
function hysteresis_loss(motor::Motor)
return hysteresis_loss(motor.stator) + hysteresis_loss(motor.teeth)
return hysteresis_loss(motor.stator, motor.f) + hysteresis_loss(motor.teeth, motor.f)

Check warning on line 269 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L268-L269

Added lines #L268 - L269 were not covered by tests
end # function hysteresis_loss

function hysteresis_loss(stator, f)
stator.mass * stator.material.kₕ * f *stator.B^rotor.material.α
function hysteresis_loss(steel, f)
return steel.mass * steel.material.kₕ * f * steel.B^steel.material.α

Check warning on line 273 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L272-L273

Added lines #L272 - L273 were not covered by tests
end

"""
"""
function eddy_loss(motor::Motor)
return eddy_loss(motor.stator, motor.f) + eddy_loss(motor.teeth, motor.f)

Check warning on line 279 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L278-L279

Added lines #L278 - L279 were not covered by tests
end #function eddy_loss

function eddy_loss(steel, f)
return steel.mass * steel.material.kₑ * f^2 * steel.B^2

Check warning on line 283 in src/propsys/PMSM.jl

View check run for this annotation

Codecov / codecov/patch

src/propsys/PMSM.jl#L282-L283

Added lines #L282 - L283 were not covered by tests
end # function eddy_loss

"""
"""
Expand Down

0 comments on commit 3004e78

Please sign in to comment.