def test_type_wind_CW2LT(self): """Test Winding matrix plot for type_winding CW2LT""" plt.close("all") test_obj = LamSlotWind(Rint=0.5, Rext=0.9, is_internal=False) test_obj.slot = SlotW22(Zs=6, H0=20e-3, H2=0.2, W0=pi / 10, W2=pi / 6) test_obj.winding = WindingCW2LT(p=2, qs=3) test_obj.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Wind_CW2LT_lam.png")) test_obj.plot_winding() fig = plt.gcf() fig.savefig(join(save_path, "test_Wind_CW2LT_wind.png")) test_obj.slot = SlotW22(Zs=12, H0=20e-3, H2=0.2, W0=pi / 12, W2=pi / 8) test_obj.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Wind_CW2LT_lam_ms=0,25.png")) test_obj.winding.p = 4 test_obj.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Wind_CW2LT_lam_p=4.png"))
def test_Lam_Wind_28_wind_rad_tan(self): """Test machine plot with Slot 28 and winding rad=1, tan=2 and rad=2 and tan=1 """ print("\nTest plot Slot 28") plt.close("all") test_obj = Machine() test_obj.rotor = LamSlotWind( Rint=35e-3, Rext=84e-3, is_internal=True, is_stator=False, L1=0.9, Nrvd=2, Wrvd=0.05, ) test_obj.rotor.axial_vent = [ VentilationCirc(Zh=6, Alpha0=pi / 6, D0=15e-3, H0=0.045) ] test_obj.rotor.slot = SlotW28( Zs=42, W0=3.5e-3, H0=0.45e-3, R1=3.5e-3, H3=14e-3, W3=5e-3 ) test_obj.rotor.winding = WindingCW2LT(qs=3, p=3) test_obj.rotor.mat_type.magnetics = MatLamination(Wlam=0.5e-3) test_obj.shaft = Shaft(Drsh=test_obj.rotor.Rint * 2, Lshaft=1) test_obj.stator = LamSlotWind( Rint=85e-3, Rext=0.2, is_internal=False, is_stator=True, L1=0.9, Nrvd=2, Wrvd=0.05, ) test_obj.stator.slot = SlotW28( Zs=18, W0=7e-3, R1=10e-3, H0=5e-3, H3=30e-3, W3=5e-3 ) test_obj.stator.winding = WindingDW2L(qs=3, p=3, Lewout=60e-3) test_obj.stator.mat_type.magnetics = MatLamination(Wlam=0.5e-3) test_obj.frame = Frame(Rint=0.2, Rext=0.25, Lfra=1) test_obj.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s28_1-Machine.png")) # Rotor + stator + 2 for frame + 1 for Shaft self.assertEqual(len(fig.axes[0].patches), 133) test_obj.rotor.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s28_2-Rotor.png")) # 2 for lam + Zs*2 for wind + 6 vent self.assertEqual(len(fig.axes[0].patches), 92) test_obj.stator.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s28_3-Stator.png")) # 2 for lam, 2*Zs for wind self.assertEqual(len(fig.axes[0].patches), 38)
def test_Lam_Wind_16_wind_tan(self): """Test machine plot with Slot 16 and winding rad=1, tan=2 """ self.test_obj.winding = WindingCW2LT(qs=3, p=3, Lewout=60e-3) self.test_obj.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s16_2-tan-wind.png")) # 2 for lam + Zs*2 for wind self.assertEqual(len(fig.axes[0].patches), 14)
def test_Lam_Wind_61(self): """Test machine plot with Slot 61 """ print("\nTest plot Slot 61") plt.close("all") test_obj = Machine() test_obj.rotor = LamSlotWind(Rint=0, Rext=0.1325, is_internal=True, is_stator=False, L1=0.9) test_obj.rotor.slot = SlotW61( Zs=12, W0=15e-3, W1=35e-3, W2=12.5e-3, H0=15e-3, H1=20e-3, H2=25e-3, H3=1e-3, H4=2e-3, W3=3e-3, ) test_obj.rotor.winding = WindingCW2LT(qs=3, p=3, Lewout=60e-3) plt.close("all") test_obj.rotor.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s61_1-Rotor.png")) # 1 for Lam, Zs*2 for wind self.assertEqual(len(fig.axes[0].patches), 25) test_obj.rotor.slot.W3 = 0 test_obj.rotor.slot.H3 = 0 test_obj.rotor.slot.H4 = 0 test_obj.rotor.plot() fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s61_2-Rotor Wind.png")) # 1 for Lam, Zs*2 for wind self.assertEqual(len(fig.axes[0].patches), 25) tooth = test_obj.rotor.slot.get_surface_tooth() tooth.plot(color="r") fig = plt.gcf() fig.savefig(join(save_path, "test_Lam_Wind_s61_Tooth_in.png"))
is_internal=True, is_stator=True) stator.slot = SlotW23( Zs=27, H0=0.0015, H1=0.002, H2=0.015, W0=0.006, W3=0.005, H1_is_rad=False, is_cstt_tooth=True, ) stator.winding = WindingCW2LT(qs=3, Lewout=15e-3, p=9, Ntcoil=57, Npcpp=3, Nslot_shift_wind=0) stator.winding.conductor = CondType12(Nwppc=1, Wwire=0.0007, Wins_wire=1e-6, Kwoh=0.5) # Rotor setup rotor = LamSlotMag( Rext=0.085, Rint=0.082, L1=0.035, Kf1=0.95, is_internal=False, is_stator=False,
machine8 = MachineIPMSM() machine8.stator = LamSlotWind() machine8.stator.winding = WindingDW2L() machine8.rotor = LamHole() machine8.rotor.hole = list() machine8.rotor.hole.append(HoleM50()) machine8._set_None() # Empty machine machine8.type_machine = 8 machine8.stator.is_stator = True machine8.rotor.is_stator = False machine9 = MachineWRSM() machine9.stator = LamSlotWind() machine9.stator.winding = WindingDW2L() machine9.rotor = LamSlotWind() machine9.rotor.winding = WindingCW2LT() machine9._set_None() # Empty machine machine9.type_machine = 9 machine9.stator.is_stator = True machine9.rotor.is_stator = False machine10 = MachineSRM() machine10.stator = LamSlotWind() machine10.stator.winding = WindingDW2L() machine10.rotor = LamSlot() machine10._set_None() # Empty machine machine10.type_machine = 10 machine10.stator.is_stator = True machine10.rotor.is_stator = False # Dictionnary with all the information to set a SCIM
def __init__(self, machine, matlib=[], is_stator=False): """Initialize the GUI according to machine Parameters ---------- self : SWindPat A SWindPat widget machine : Machine current machine to edit matlib : list List of available Material is_stator : bool To adapt the GUI to set either the stator or the rotor """ # Build the interface according to the .ui file QWidget.__init__(self) self.setupUi(self) # Set Help URL self.b_help.url = "https://eomys.com/produits/manatee/howtos/article/" self.b_help.url += "how-to-set-up-the-winding" # Saving arguments self.machine = machine self.matlib = matlib self.is_stator = is_stator # Fill the fields with the machine values (if they're filled) if self.is_stator: self.obj = machine.stator else: self.obj = machine.rotor if machine.type_machine == 9 and not self.is_stator: # Enforce tooth winding for WRSM rotor self.obj.winding = WindingCW2LT( init_dict=self.obj.winding.as_dict()) self.obj.winding.qs = 1 self.b_preview.setEnabled(False) self.si_qs.setEnabled(False) self.c_wind_type.setEnabled(False) self.c_wind_type.setCurrentIndex(0) self.c_wind_type.setItemText(0, "DC wound winding for salient pole") else: self.b_preview.setEnabled(True) self.si_qs.setEnabled(True) self.c_wind_type.setEnabled(True) self.c_wind_type.setItemText( 0, "Double Layer Concentrated Orthoradial") # Set the current Winding pattern if self.obj.winding is None or type(self.obj.winding) is Winding: # The default type_winding is WindingCW2LT self.obj.winding = WindingCW2LT( init_dict=self.obj.winding.as_dict()) self.c_wind_type.setCurrentIndex(0) else: self.c_wind_type.setCurrentIndex( TYPE_INDEX.index(type(self.obj.winding))) self.update_image() if type(self.obj.winding) is WindingDW2L: if self.obj.winding.coil_pitch is None: self.obj.winding.coil_pitch = 0 self.si_coil_pitch.setValue(self.obj.winding.coil_pitch) if self.obj.winding.Nslot_shift_wind is not None: self.si_Nslot.setValue(self.obj.winding.Nslot_shift_wind) else: self.si_Nslot.setValue(0) self.obj.winding.Nslot_shift_wind = 0 if self.obj.winding.qs is None: # default value self.obj.winding.qs = 3 self.si_qs.setValue(self.obj.winding.qs) if self.obj.winding.Ntcoil is None: self.obj.winding.Ntcoil = 1 # Default value for preview if self.obj.winding.is_reverse_wind is not None: if self.obj.winding.is_reverse_wind: self.is_reverse.setCheckState(Qt.Checked) else: self.is_reverse.setCheckState(Qt.Unchecked) else: self.obj.winding.is_reverse_wind = False # Display shape of wind_mat self.set_output() self.hide_coil_pitch() # Connect the signal/slot self.c_wind_type.currentIndexChanged.connect(self.set_type) self.si_qs.editingFinished.connect(self.set_qs) self.si_coil_pitch.editingFinished.connect(self.set_coil_pitch) self.si_Nslot.editingFinished.connect(self.set_Nslot) self.is_reverse.stateChanged.connect(self.set_is_reverse_wind) self.b_preview.clicked.connect(self.s_plot)