Main Content

Interior PMSM

Three-phase interior permanent magnet synchronous motor with sinusoidal back electromotive force

  • Interior PMSM block

Libraries:
Powertrain Blockset / Propulsion / Electric Motors and Inverters
Motor Control Blockset / Electrical Systems / Motors

Description

The Interior PMSM block implements a three-phase interior permanent magnet synchronous motor (PMSM) with sinusoidal back electromotive force. The block uses the three-phase input voltages to regulate the individual phase currents, allowing control of the motor torque or speed.

By default, the block sets the Simulation type parameter to Continuous to use a continuous sample time during simulation. If you want to generate code for fixed-step double- and single-precision targets, considering setting the parameter to Discrete. Then specify a Sample Time, Ts parameter.

On the Parameters tab, if you select Back-emf constant (Ke), the block implements this equation to calculate the permanent flux linkage constant.

λpm=13Ke1000P602π

Motor Construction

This figure shows the motor construction with a single pole pair on the rotor.

PMSM interior motor with a two-pole rotor

The motor magnetic field due to the permanent magnets creates a sinusoidal rate of change of flux with motor angle.

For the axes convention, the a-phase and permanent magnet fluxes are aligned when motor angle θr is zero.

Three-Phase Sinusoidal Model Electrical System

The block implements these equations, expressed in the motor flux reference frame (dq frame). All quantities in the motor reference frame are referred to the stator.

ωe=Pωmddtid=1LdvdRLdid+LqLdPωmiq

ddtiq=1LqvqRLqiqLdLqPωmidλpmPωmLq

Te=1.5P[λpmiq+(LdLq)idiq]

The Lq and Ld inductances represent the relation between the phase inductance and the motor position due to the saliency of the motor.

The equations use these variables.

Lq, Ld

q- and d-axis inductances (H)

R

Resistance of the stator windings (ohm)

iq, id

q- and d-axis currents (A)

vq, vd

q- and d-axis voltages (V)

ωm

Angular mechanical velocity of the motor (rad/s)

ωe

Angular electrical velocity of the motor (rad/s)

λpm

Permanent flux linkage constant (Wb)

Ke

Back electromotive force (EMF) (Vpk_LL/krpm, where Vpk_LL is the peak voltage line-to-line measurement)

P

Number of pole pairs

Te

Electromagnetic torque (Nm)

Θe

Electrical angle (rad)

Mechanical System

The motor angular velocity is given by:

ddtωm=1J(TeTfFωmTm)dθmdt=ωm

The equations use these variables.

J

Combined inertia of motor and load (kgm^2)

F

Combined viscous friction of motor and load (N·m/(rad/s))

θm

Motor mechanical angular position (rad)

Tm

Motor shaft torque (Nm)

Te

Electromagnetic torque (Nm)

Tf

Motor shaft static friction torque (Nm)

ωm

Angular mechanical velocity of the motor (rad/s)

Power Accounting

For the power accounting, the block implements these equations.

Bus Signal DescriptionVariableEquations

PwrInfo

PwrTrnsfrd — Power transferred between blocks

  • Positive signals indicate flow into block

  • Negative signals indicate flow out of block

PwrMtr

Mechanical power

Pmot

Pmot= ωmTe
PwrBus

Electrical power

Pbus

Pbus= vania+ vbnib+vcnic

PwrNotTrnsfrd — Power crossing the block boundary, but not transferred

  • Positive signals indicate an input

  • Negative signals indicate a loss

PwrElecLoss

Resistive power loss

Pelec

Pelec= 32(Rsisd2+Rsisq2)
PwrMechLoss

Mechanical power loss

Pmech

When Mechanical input configuration is set to Torque:

Pmech= (ωm2F+ |ωm|Tf)

When Mechanical input configuration is set to Speed:

Pmech= 0 

PwrStored — Stored energy rate of change

  • Positive signals indicate an increase

  • Negative signals indicate a decrease

PwrMtrStored

Stored motor power

Pstr

Pstr= Pbus+ Pmot+ Pelec + Pmech

The equations use these variables.

Rs

Stator resistance (ohm)

ia, ib, ic

Stator phase a, b, and c current (A)

isq, isd

Stator q- and d-axis currents (A)

van, vbn, vcn

Stator phase a, b, and c voltage (V)

ωm

Angular mechanical velocity of the rotor (rad/s)

F

Combined motor and load viscous damping (N·m/(rad/s))

Te

Electromagnetic torque (Nm)

Tf

Combined motor and load friction torque (Nm)

Amplitude Invariant dq Transformation

The block uses these equations to implement the amplitude invariant dq transformation to ensure that the dq and three phase amplitudes are equal.

[vsdvsq]= 23 [cos(Θda)cos(Θda2π3)cos(Θda+2π3)sin(Θda)sin(Θda2π3)sin(Θda+2π3)][vavbvc]

[iaibic]=   [cos(Θda)sin(Θda)cos(Θda2π3)cos(Θda+2π3)sin(Θda2π3)sin(Θda+2π3)][isdisq]

The equations use these variables.

Θda

dq stator electrical angle with respect to the rotor a-axis (rad)

vsq, vsd

Stator q- and d-axis voltages (V)

isq, isd

Stator q- and d-axis currents (A)

va, vb, vc

Stator voltage phases a, b, c (V)

ia, ib, ic

Stator currents phases a, b, c (A)

Ports

Input

expand all

Load torque on the motor shaft, Tm, in N·m.

Dependencies

To create this port, select Torque for the Mechanical input configuration parameter.

Angular velocity of the motor, ωm, in rad/s.

Dependencies

To create this port, select Speed for the Mechanical input configuration parameter.

Stator terminal voltages, Va, Vb, and Vc, in V.

Dependencies

To create this port, select Speed or Torque for the Mechanical input configuration parameter.

Output

expand all

The bus signal contains these block calculations.

Signal DescriptionVariableUnits

IaStator

Stator phase current A

ia

A

IbStator

Stator phase current B

ib

A

IcStator

Stator phase current C

ic

A

IdSync

Direct axis current

id

A

IqSync

Quadrature axis current

iq

A

VdSync

Direct axis voltage

vd

V

VqSync

Quadrature axis voltage

vq

V

MtrSpd

Angular mechanical velocity of the motor

ωm

rad/s

MtrPos

Motor mechanical angular position

θm

rad

MtrTrq

Electromagnetic torque

Te

N·m

PwrInfo

PwrTrnsfrd

PwrMtr

Mechanical power

Pmot

W
PwrBus

Electrical power

Pbus

W

PwrNotTrnsfrd

PwrElecLoss

Resistive power loss

Pelec

W
PwrMechLoss

Mechanical power loss

Pmech

W

PwrStored

PwrMtrStored

Stored motor power

Pstr

W

Phase a, b, c current, ia, ib, and ic, in A.

Motor torque, Tmtr, in N·m.

Dependencies

To create this port, select Speed for the Mechanical input configuration parameter.

Angular speed of the motor, ωmtr, in rad/s.

Dependencies

To create this port, select Torque for the Mechanical input configuration parameter.

Parameters

expand all

Block Options

This table summarizes the port configurations.

Port ConfigurationCreates Input PortCreates Output Port

Torque

LdTrq

MtrSpd

Speed

Spd

MtrTrq

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: port_config
Values: Torque (default) | Speed
Data Types: character vector

By default, the block uses a continuous sample time during simulation. If you want to generate code for single-precision targets, considering setting the parameter to Discrete.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: sim_type
Values: Continuous (default) | Discrete
Data Types: character vector

Dependencies

Setting Simulation type to Discrete creates the Sample Time, Ts parameter.

Integration sample time for discrete simulation, in s.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: Ts
Values: 0.001 (default) | scalar
Data Types: double

Dependencies

Setting Simulation type to Discrete creates the Sample Time, Ts parameter.

Parameters

Motor pole pairs, P.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: P
Values: 4 (default) | scalar
Data Types: double

Stator phase resistance per phase, Rs, in ohm.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: Rs
Values: .2 (default) | scalar
Data Types: double

Stator d-axis and q-axis inductance, Ld, Lq, in H.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: Ldq
Values: 0.001 (default) | scalar
Data Types: double

Permanent flux linkage constant, λpm, in Wb.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: lambda_pm
Values: 0.1194 (default) | scalar
Data Types: double

Back electromotive force, EMF, Ke, in Vpk_LL/krpm. Vpk_LL is the peak voltage line-to-line measurement.

To calculate the permanent flux linkage constant, the block implements this equation.

λpm=13Ke1000P602π

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: Ke
Values: 0.001 (default) | scalar
Data Types: double

Mechanical properties of the motor:

  • Inertia, J, in kg.m^2

  • Viscous damping, F, in N·m/(rad/s)

  • Static friction, Tf, in N·m

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: mechanical
Values: [0.002700,4.924e-4,0] (default) | vector
Data Types: double

Dependencies

To enable this parameter, set the Mechanical input configuration parameter to Torque.

Initial Values

Initial q- and d-axis currents, iq, id, in A.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: idq0
Values: [0 0] (default) | vector
Data Types: double

Initial motor angular position, θm0, in rad.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: theta_init
Values: 0 (default) | scalar
Data Types: double

Initial angular velocity of the motor, ωm0, in rad/s.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: omega_init
Values: 0 (default) | scalar
Data Types: double

Dependencies

To enable this parameter, set the Mechanical input configuration parameter to Torque.

References

[1] Kundur, P. Power System Stability and Control. New York, NY: McGraw Hill, 1993.

[2] Anderson, P. M. Analysis of Faulted Power Systems. Hoboken, NJ: Wiley-IEEE Press, 1995.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2017a