DXF File generation for IPMSM machine #709
Unanswered
TangiPilabz
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Hello, Regarding the slot types, they were renamed. Try SlotM10 for rectangular and SlotM11 for polar (schematics in the GUI). By the way these magnets are for SPMSM machines. For IPMSM you should be looking for "Hole" objects. I recommend using the GUI to define your machine to find the proper objects/schematics. Direct export to DXF is not possible in pyleecan. You can use the automated coupling with FEMM to draw your machine, open the resulting .fem file in FEMM and then FEMM provides a feature to export to .dxf Best regards, |
Beta Was this translation helpful? Give feedback.
1 reply
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I am new to pyleecan, I prompted ChatGPT to write code using pyleecan to generate a DXF file for an IPMSM machine with 12 slots and 8 poles with default geometry. But it used some classes which are not found in pyleecan - SlotMPolar, SlotMFlat - for the Rotor slot for Magnets. Here is the code generated by ChatGPT to create the DXF file:
from pyleecan.Classes.MachineIPMSM import MachineIPMSM
from pyleecan.Classes.Shaft import Shaft
from pyleecan.Classes.LamSlotMag import LamSlotMag
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.WindingUD import WindingUD
from pyleecan.Classes.SlotW12 import SlotW12 # Stator slot type
from pyleecan.Classes.SlotMFlat import SlotMFlat # Rotor slot for magnets
from pyleecan.Functions.GMSH.export import export_geometry
Define the stator with 12 slots
stator = LamSlotWind(
Rint=0.1, # Stator inner radius
Rext=0.2, # Stator outer radius
is_internal=False, # Stator is external
is_stator=True, # It's the stator
L1=0.1, # Stack length (axial length)
Nrvd=0, # No radial ventilation ducts
Winding=WindingUD(qs=3), # Define a 3-phase winding
)
Define stator slots (12 slots using SlotW12)
stator.slot = SlotW12(
Zs=12, # Number of stator slots
H0=0.01, # Slot opening height
H1=0.02, # Slot height below the opening
H2=0.03, # Slot total height
W0=0.01, # Slot opening width
W1=0.015, # Slot width at base
W2=0.025 # Slot width at bottom
)
Define the rotor with 8 poles (using SlotMFlat for magnets)
rotor = LamSlotMag(
Rint=0, # Rotor inner radius
Rext=0.1, # Rotor outer radius
is_internal=True, # Rotor is internal
is_stator=False, # It's the rotor
L1=0.1, # Stack length (axial length)
Nrvd=0, # No radial ventilation ducts
)
Define rotor slots for magnets (8 poles using SlotMFlat)
rotor.slot = SlotMFlat(
Zs=8, # Number of rotor poles
W0=0.02, # Width of magnet at its base
H0=0.03, # Magnet height
Wmag=0.02, # Magnet width
Hmag=0.03 # Magnet height
)
Define the machine with stator and rotor
ipmsm_machine = MachineIPMSM(
stator=stator,
rotor=rotor,
shaft=Shaft(Drsh=0.02), # Shaft diameter
name="IPMSM_12slots_8poles"
)
Export geometry to DXF
output_dir = "./dxf_output/"
stator_dxf_filename = output_dir + "stator_12slots.dxf"
rotor_dxf_filename = output_dir + "rotor_8poles.dxf"
Export the stator geometry to DXF
export_geometry(lam=stator, file_path=stator_dxf_filename)
print(f"Stator DXF saved to {stator_dxf_filename}")
Export the rotor geometry to DXF
export_geometry(lam=rotor, file_path=rotor_dxf_filename)
print(f"Rotor DXF saved to {rotor_dxf_filename}")
Appreciate if this code can be corrected to generate the DXF file for an IPMSM or any type of motor.
Thanks and regards
TangiPilabz
Beta Was this translation helpful? Give feedback.
All reactions