-
Notifications
You must be signed in to change notification settings - Fork 16
Electric Machines #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
+ Coverage 5.41% 80.66% +75.25%
==========================================
Files 87 94 +7
Lines 14014 14266 +252
==========================================
+ Hits 759 11508 +10749
+ Misses 13255 2758 -10497 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/propsys/PMSM.jl
Outdated
shaft.Ri = (shaft.Ro^4 - torque / shaft.material.τmax * 2 * shaft.Ro / π)^0.25 | ||
else | ||
# shaft can be solid as well | ||
shaft.Ri = 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this case should return an error. The case when Ri = 0 is covered by the previous case as well.
Update unit_test_electric_machines.jl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good overall! Thanks for completing this.
Main thing to clean up is the motor/generator implementation as instances of base. The current approach introduces a bunch of code that will make maintenance harder in the future. I have some ideas of how to clean this up using a parametric type in PMS M and then the downstream functions should be straight forward. I'll try to add that in as suggestions in a while.
|
||
## Permanent-magnet synchronous machines | ||
|
||
Permanent-magnet synchronous machines (PMSMs), particularly motors and generators, can be modeled tp estimate their performance and weight. The function [`size_PMSM!()`](@ref propsys.ElectricMachine.size_PMSM!) can be used to find the thickness and lengths of the PMSM components, their masses, as well as to calculate the phase electrical resistance. Once a PMSM has been sized, its off-design performance can be computed using [`operate_PMSM!()`](@ref propsys.ElectricMachine.operate_PMSM!), which calculates power losses tp compute the input power (motor) or output power (generator). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permanent-magnet synchronous machines (PMSMs), particularly motors and generators, can be modeled tp estimate their performance and weight. The function [`size_PMSM!()`](@ref propsys.ElectricMachine.size_PMSM!) can be used to find the thickness and lengths of the PMSM components, their masses, as well as to calculate the phase electrical resistance. Once a PMSM has been sized, its off-design performance can be computed using [`operate_PMSM!()`](@ref propsys.ElectricMachine.operate_PMSM!), which calculates power losses tp compute the input power (motor) or output power (generator). | |
Permanent-magnet synchronous machines (PMSMs), particularly motors and generators, can be modeled to estimate their performance and weight. The function [`size_PMSM!()`](@ref propsys.ElectricMachine.size_PMSM!) can be used to find the thickness and lengths of the PMSM components, their masses, as well as to calculate the phase electrical resistance. Once a PMSM has been sized, its off-design performance can be computed using [`operate_PMSM!()`](@ref propsys.ElectricMachine.operate_PMSM!), which calculates power losses and computes the input electrical power required (motor) or output shaft power (generator). |
src/propsys/PMSM.jl
Outdated
base::PMSMBase = PMSMBase() | ||
|
||
"""Number of multi-phase inverters [-]""" | ||
N_inverters::Int = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there setups that need more than 1 inverter for a single machine? This motor structure seems unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that by using multiple inverters, you can reduce the required voltage as the power is divided among them. For example, the GTL group at MIT used thirty single-phase inverters.
src/propsys/PMSM.jl
Outdated
end # function Base.getproperty | ||
|
||
#List of computed fields that are not stored in the structure but are derived from other fields | ||
const BASE_COMPUTED_FIELDS = [:f, :torque, :N_slots, :N_slots_per_phase, :N_energized_slots, :λ, :B_gap] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declaring something as "BASE" to refer to some very specific variables just for convenience is going to be very confusing down the line! I see what you are trying to do here but I'm not sure this setup of having a "base" implementation is really needed just to define the Motor and Generator as two types of PMSM. This introduces a bunch of convenience functions that I think are just going to make it harder to read later.
The motor and generator could be implemented simply via a parametric type added to the PMSM sturct and then the sizing functions will know exactly what to do - what are inputs and what are outputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at the parametric type implementation in commit 25d7411. I agree it is a lot neater!
This PR adds models for electric machines, including motors, generators, inverters and cables. In general, sizing and off-design operation functions are created for each of these components.