pyleecan.Classes.EEC_PMSM module

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/EEC_PMSM

class EEC_PMSM(Ld=None, Lq=None, Phid=None, Phiq=None, Phid_mag=None, Phiq_mag=None, type_skin_effect=1, OP=None, Tsta=20, Trot=20, Xkr_skinS=1, Xke_skinS=1, Xkr_skinR=1, Xke_skinR=1, R1=None, fluxlink=None, init_dict=None, init_str=None)[source]

Bases: EEC

Electrical Equivalent Circuit of Permanent Magnet Synchronous Machines

VERSION = 1
clear_parameters()

Clear all the parameters of an EEC_PMSM

Parameters:

self (EEC_PMSM) – An EEC_PMSM object

comp_BEMF_harmonics(Phi_B, Phi_C, delta, time)

Compute the back electromotive force harmonics from magnet fluxes (PMSM)

Parameters:
  • Phi_A (Magnetic flux of phase A) –

  • Phi_B (Magnetic flux of phase B) –

  • Phi_C (Magnetic flux of phase C) –

  • delta (Rotor angular position) –

  • time (time vector) –

comp_joule_losses(out_dict, machine)

Compute the electrical Joule losses

Parameters:
  • self (EEC_PMSM) – an EEC_PMSM object

  • out_dict (dict) – Dict containing all magnetic quantities that have been calculated in comp_parameters of EEC

  • machine (Machine) – a Machine object

Returns:

out_dict – Dict containing all magnetic quantities that have been calculated in EEC

Return type:

dict

comp_Ld()

Compute and set the stator winding inductance along d-axis for the EEC

Parameters:

self (EEC_PMSM) – an EEC_PMSM object

comp_Lq()

Compute and set the stator winding inductance along q-axis for the EEC

Parameters:

self (EEC_PMSM) – an EEC_PMSM object

comp_parameters()

Compute and set the parameter attributes of the EEC that are not set: resistance, skin effect factors, inductance, fluxlinkage and back emf

Parameters:

self (EEC_PMSM) – an EEC_PMSM object

comp_Phidq()

Compute and set the stator winding flux for the equivalent electrical circuit

Parameters:

self (EEC_PMSM) – an EEC_PMSM object

comp_Phidq_mag()

Compute and set the stator winding flux in open-circuit for the EEC

Parameters:

self (EEC_PMSM) – an EEC_PMSM object

comp_torque_sync_rel()

Calculate synchronous and reluctant torque

Parameters:
  • self (EEC_PMSM) – an EEC_PMSM object

  • qs (int) – Number of stator winding phase

  • p (int) – Number of pole pairs

Returns:

  • Tem_sync (float or ndarray) – Synchronous torque [N.m]

  • Tem_rel (float or ndarray) – Reluctant torque [N.m]

solve()

Compute the parameters dict for the equivalent electrical circuit cf “Advanced Electrical Drives, analysis, modeling, control” Rik de doncker, Duco W.J. Pulle, Andre Veltman, Springer edition

<— —>

—–R—–wsLqIq—- —–R—–wsLdId—-

| | |
| | BEMF
| | | ———Id———- ———Iq———-
—> —>

Ud Uq

Parameters:

self (EEC_PMSM) – an EEC_PMSM object

Returns:

out_dict – Dict containing all magnetic quantities that have been calculated in EEC

Return type:

dict

solve_PWM(output, is_dqh_freq=False, is_skin_effect_inductance=False)

Get stator current harmonics due to PWM harmonics TODO: validation with transient FEA simulation

Parameters:
  • self (EEC_PMSM) – an EEC_PMSM object

  • output (Output) – An Output object

  • is_dqh_freq (bool) – True to consider frequencies in dqh frame (generate resonances in current)

  • is_skin_effect_inductance (bool) – True to include skin effect on inductance

Returns:

Is_PWM – Stator current harmonics as DataFreq

Return type:

DataFreq

update_from_ref(LUT_ref)

Compute and set the parameter attributes of the EEC from a reference LUT: resistance, skin effect factors, inductance, fluxlinkage and back emf

Parameters:
  • self (EEC_PMSM) – an EEC_PMSM object

  • LUT_ref (LUTdq) – a LUTdq object

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.

copy()[source]

Creates a deepcopy of the object

property Ld

Stator winding inductance along d-axis

Type:

float

property Lq

Stator winding inductance along q-axis

Type:

float

property Phid

Stator winding flux along d-axis

Type:

float

property Phiq

Stator winding flux along q-axis

Type:

float

property Phid_mag

Stator winding flux along d-axis in open-circuit (rotor flux linkage)

Type:

float

property Phiq_mag

Stator winding flux along q-axis in open-circuit (rotor flux linkage)

Type:

float