pyleecan.Classes.Winding module¶
Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Machine/Winding
- class Winding(is_reverse_wind=False, Nslot_shift_wind=0, qs=3, Ntcoil=7, Npcp=2, type_connection=0, p=3, Lewout=0.015, conductor=- 1, coil_pitch=1, wind_mat=None, Nlayer=1, per_a=None, is_aper_a=None, end_winding=- 1, is_reverse_layer=False, is_change_layer=False, is_permute_B_C=False, dual_tri_phase_shift=None, is_wye=True, init_dict=None, init_str=None)[source]¶
Bases:
FrozenClass
Winding class generating connection matrix using Star of slots method (coupling with SWAT-EM)
- VERSION = 1¶
- NAME = 'Star of slots'¶
- comp_connection_mat(Zs=None, p=None)¶
Compute the Winding Matrix for
- Parameters:
self (Winding) – A: Winding object
Zs (int) – Number of Slot (Integer >0)
p (int) – Number of pole pairs (Integer >0)
- Returns:
wind_mat – Winding Matrix (1, 1, Zs, qs)
- Return type:
numpy.ndarray
- Raises:
WindingT2DefNtError – Zs/qs/2 must be an integer
- comp_length_endwinding()¶
Compute the Winding overhang length on one side for a half-turn[m]
- Parameters:
self (Winding) – A Winding object
- Returns:
Lewout – End-winding length on one side for a half-turn [m].
- Return type:
float
- comp_Ncspc(Zs=None)¶
Compute the number of coils in series per parallel circuit
- Parameters:
self (Winding) – A Winding object
Zs (int) – number of slot
- Returns:
Ncspc – Number of coils in series per parallel circuit
- Return type:
float
- comp_Ntsp(Zs=None)¶
Compute the number of turns in series per phase
- Parameters:
self (Winding) – A Winding object
Zs (int) – Number of slot
- Returns:
Ntspc – Number of turns in series per phase
- Return type:
float
- comp_periodicity(wind_mat=None)¶
Computes the winding matrix (anti-)periodicity
- Parameters:
self (Winding) – A Winding object
wind_mat (ndarray) – Winding connection matrix
- Returns:
per_a (int) – Number of spatial periods of the winding
is_aper_a (bool) – True if the winding is anti-periodic over space
- comp_phasor_angle(Zs=None)¶
Compute the phasor angle of the winding phases related to the first slot
- Parameters:
self (Winding) – A: Winding object
Zs (int) – Number of Slot (Integer >0)
- Returns:
angle_vec – Phasor Angle Vector (qs)
- Return type:
numpy.ndarray
- comp_winding_factor(Harmonics=[1])¶
Compute the winding factor of phase 1 (asuming symmetry)
- Parameters:
self (Winding) – A: Winding object
Harmonics (list of floats) – list of harmonics to calculate the winding factor
- Returns:
xi – winding factor
- Return type:
numpy.ndarray
- get_connection_mat(Zs=None, p=None)¶
Get the Winding Matrix
- Parameters:
self (Winding) – A: Winding object
Zs (int) – Number of Slot (Integer >0)
p (int) – Number of pole pairs (Integer >0)
- Returns:
wind_mat – Winding Matrix (1, 1, Zs, qs)
- Return type:
numpy.ndarray
- get_dim_wind()¶
Get the two first dimension of the winding matrix
- Parameters:
self (Winding) – A Winding object
- Returns:
(Nrad, Ntan) – Number of layer in radial and tangential direction
- Return type:
tuple
- get_periodicity()¶
Computes the winding matrix (anti-)periodicity
- Parameters:
self (Winding) – A Winding object
- Returns:
per_a (int) – Number of spatial periods of the winding
is_aper_a (bool) – True if the winding is anti-periodic over space
- export_to_csv(file_path=None, is_add_header=True, is_skip_empty=False)¶
Export the winding matrix to a csv file. One matrix for each phase Column Slot id, Ntcoil, Rad id, Tan id
- Parameters:
self (Winding) – A: Winding object
file_path (str) – Path to the file to save
is_add_header (bool) – True to add first line and first column
is_skip_empty (bool) – True to remove the lines with Ntcoil=0
- clean()¶
Clean the internal properties (wind_mat and periodicity)
- Parameters:
self (Winding) – A Winding object
- plot_radial(is_show_fig=True)¶
Plots the winding radial pattern
- Parameters:
self (Winding) – A Winding object
is_show_fig (bool) – True to call fig.show
- plot_linear(fig=None, ax=None, is_max_sym=True, is_show_fig=True, save_path=None, win_title=None, is_legend=True)¶
Plots the winding linear pattern. Method based on plot_overhang method of swat-em module
- Parameters:
self (Winding) – A Winding object
fig (Matplotlib.figure.Figure) – existing figure to use if None create a new one
ax (Matplotlib.axes.Axes object) – Axis on which to plot the data
sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)
is_max_sym (bool) – To only plot the linear pattern on the maximum symetry of the machine
is_show_fig (bool) – To call show at the end of the method
save_path (str) – full path including folder, name and extension of the file to save if save_path is not None
win_title (str) – Title for the window
is_legend (bool) – True to add the legend
- comp_Ncps()¶
Compute the number of conductors per slot
- Parameters:
self (Winding) – A Winding object
- Returns:
Ncps – Number of conductors per slot
- Return type:
float
- save(save_path='', is_folder=False, type_handle_old=2, type_compression=0)¶
Save the object to the save_path
- Parameters:
self – A pyleecan object
save_path (str) – path to the folder to save the object
is_folder (bool) – to split the object in different files: separate simulation machine and materials (json only)
type_handle_old (int) – How to handle old file in folder mode (0:Nothing, 1:Delete, 2:Move to “Backup” folder)
type_compression (int) – Available only for json, 0: no compression, 1: gzip
- get_logger()¶
Get the object logger or its parent’s one
- Parameters:
obj – A pyleecan object
- Returns:
logger – Pyleecan object dedicated logger
- Return type:
logging.Logger
- compare(other, name='self', ignore_list=None, is_add_value=False)[source]¶
Compare two objects and return list of differences
- as_dict(type_handle_ndarray=0, keep_function=False, **kwargs)[source]¶
Convert this object in a json serializable dict (can be use in __init__). type_handle_ndarray: int
How to handle ndarray (0: tolist, 1: copy, 2: nothing)
- keep_functionbool
True to keep the function object, else return str
Optional keyword input parameter is for internal use only and may prevent json serializability.
- property is_reverse_wind¶
1 to reverse the default winding algorithm along the airgap (c, b, a instead of a, b, c along the trigonometric direction)
- Type:
bool
- property Nslot_shift_wind¶
Number of slots to shift the coils obtained with pyleecan winding algorithm (a, b, c becomes b, c, a with Nslot_shift_wind=1)
- Type:
int
- property qs¶
number of phases
- Type:
int
- Min:
0
- property Ntcoil¶
number of turns per coil
- Type:
int
- Min:
1
- property Npcp¶
number of parallel circuits per phase
- Type:
int
- Min:
1
- property type_connection¶
0 star (Y), 1 triangle (delta), -1 no connection
- Type:
int
- Min:
-1
- Max:
1
- Type:
Winding connection
- property p¶
pole pairs number
- Type:
int
- Min:
1
- property Lewout¶
straight length of the conductors outside the lamination before the curved part of winding overhang [m] - can be negative to tune the average turn length (only used in voltage driven simulations)
- Type:
float
- Min:
0
- property conductor¶
Winding’s conductor
- Type:
Conductor
- property coil_pitch¶
Distance (in slot) between a conductor of a certain phase and the corresponding return conductor
- Type:
int
- property wind_mat¶
Winding matrix calculated with Star of slots (from SWAT_EM package)
- Type:
ndarray
- property Nlayer¶
Number of different coils in a slot
- Type:
int
- Min:
1
- property per_a¶
Number of spatial periods of the winding
- Type:
int
- Min:
1
- property is_aper_a¶
True if the winding is anti-periodic over space
- Type:
bool
- property end_winding¶
End Winding’s definition
- Type:
EndWinding
- property is_reverse_layer¶
1 to reverse the layers (rad from 0 to Nrad-1 => Nrad-1 to 0)
- Type:
bool
- property is_change_layer¶
1 to change the layer from radial to tangential or tangential to radial
- Type:
bool
- property is_permute_B_C¶
True to permute phase B and phase C
- Type:
bool
- property dual_tri_phase_shift¶
Phase shift between both tri-phase systems in dual-tri-phase case
- Type:
float
- property is_wye¶
True if the alimentation is wye (else delta)
- Type:
bool