Fluxbased permanent magnet synchronous motor
Powertrain Blockset / Propulsion / Electric Motors
The FluxBased PMSM block implements a fluxbased threephase permanent magnet synchronous motor (PMSM) with a tabularbased electromotive force. The block uses the threephase input voltages to regulate the individual phase currents, allowing control of the motor torque or speed.
Fluxbased motor models take into account magnetic saturation and iron losses. To calculate the magnetic saturation and iron loss, the FluxBased PMSM block uses the inverse of the flux linkages. To obtain the block parameters, you can use finiteelement analysis (FEA) or measure phase voltages using a dynamometer.
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 fixedstep double and
singleprecision targets, considering setting the parameter to
Discrete
. Then specify a Sample Time, Ts
parameter.
To enable power loss calculations suitable for code generation targets that limit memory, select Enable memory optimized 2D LUT.
The block implements equations that are expressed in a stationary rotor reference (dq) frame. The daxis aligns with the aaxis. All quantities in the rotor reference frame are referred to the stator.
The block uses these equations.
Calculation  Equation 

q and daxis voltage  $$\begin{array}{l}{v}_{d}=\frac{d{\psi}_{d}}{dt}+{R}_{s}{i}_{d}{\omega}_{e}{\psi}_{q}\\ {v}_{q}=\frac{d{\psi}_{q}}{dt}+{R}_{s}{i}_{q}+{\omega}_{e}{\psi}_{d}\end{array}$$ 
q and daxis current  $$\begin{array}{l}{i}_{d}=f({\psi}_{d},{\psi}_{q})\\ {i}_{q}=g({\psi}_{d},{\psi}_{q})\end{array}$$ 
Electromechanical torque  $${T}_{e}=1.5P[{\psi}_{d}{i}_{q}{\psi}_{q}{i}_{d}]$$ 
The equations use these variables.
ω_{m} 
Rotor mechanical speed 
ω_{e}  Rotor electrical speed 
Θ_{da} 
dq stator electrical angle with respect to the rotor aaxis 
R_{s}, R_{r} 
Resistance of the stator and rotor windings, respectively 
i_{q}, i_{d} 
q and daxis current, respectively 
v_{q}, v_{d} 
q and daxis voltage, respectively 
Ψ_{q}, Ψ_{d} 
q and daxis magnet flux, respectively 
P 
Number of pole pairs 
T_{e} 
Electromagnetic torque 
To calculate the voltages and currents in balanced threephase (a, b) quantities, quadrature twophase (α, β) quantities, and rotating (d, q) reference frames, the block uses the Clarke and Park Transforms.
In the transform equations.
$\begin{array}{l}{\omega}_{e}=P{\omega}_{m}\\ \frac{d{\theta}_{e}}{dt}={\omega}_{e}\end{array}$
Transform  Description  Equations 

Clarke 
Converts balanced threephase quantities (a, b) into balanced twophase quadrature quantities (α, β).  $\begin{array}{l}{x}_{\alpha}=\frac{2}{3}{x}_{a}\frac{1}{3}{x}_{b}\frac{1}{3}{x}_{c}\\ {x}_{\beta}=\frac{\sqrt{3}}{2}{x}_{b}\frac{\sqrt{3}}{2}{x}_{c}\end{array}$ 
Park 
Converts balanced twophase orthogonal stationary quantities (α, β) into an orthogonal rotating reference frame (d, q).  $\begin{array}{l}{x}_{d}={x}_{\alpha}\mathrm{cos}{\theta}_{e}+{x}_{\beta}\mathrm{sin}{\theta}_{e}\\ {x}_{q}={x}_{\alpha}\mathrm{sin}{\theta}_{e}+{x}_{\beta}\mathrm{cos}{\theta}_{e}\end{array}$ 
Inverse Clarke 
Converts balanced twophase quadrature quantities (α, β) into balanced threephase quantities (a, b).  $\begin{array}{l}{x}_{a}={x}_{a}\\ {x}_{b}=\frac{1}{2}{x}_{\alpha}+\frac{\sqrt{3}}{2}{x}_{\beta}\\ {x}_{c}=\frac{1}{2}{x}_{\alpha}\frac{\sqrt{3}}{2}{x}_{\beta}\end{array}$ 
Inverse Park 
Converts an orthogonal rotating reference frame (d, q) into balanced twophase orthogonal stationary quantities (α, β).  $\begin{array}{l}{x}_{\alpha}={x}_{d}\mathrm{cos}{\theta}_{e}{x}_{q}\mathrm{sin}{\theta}_{e}\\ {x}_{\beta}={x}_{d}\mathrm{sin}{\theta}_{e}+{x}_{q}\mathrm{cos}{\theta}_{e}\end{array}$ 
The transforms use these variables.
ω_{m} 
Rotor mechanical speed 
P 
Motor pole pairs 
ω_{e} 
Rotor electrical speed 
Θ_{e} 
Rotor electrical angle 
x 
Phase current or voltage 
The rotor angular velocity is given by:
$$\begin{array}{c}\frac{d}{dt}{\omega}_{m}=\frac{1}{J}\left({T}_{e}{T}_{f}F{\omega}_{m}{T}_{m}\right)\\ \frac{d{\theta}_{m}}{dt}={\omega}_{m}\end{array}$$
The equations use these variables.
J 
Combined inertia of rotor and load 
F 
Combined viscous friction of rotor and load 
θ_{m} 
Rotor mechanical angular position 
T_{m} 
Rotor shaft torque 
T_{e} 
Electromagnetic torque 
T_{f} 
Combined rotor and load friction torque 
ω_{m} 
Rotor mechanical speed 
For the power accounting, the block implements these equations.
Bus Signal  Description  Variable  Equations  



 Mechanical power  P_{mot}  ${P}_{mot}={\omega}_{m}{T}_{e}$ 
PwrBus  Electrical power  P_{bus}  ${P}_{bus}={v}_{an}{i}_{a}+{v}_{bn}{i}_{b}+{v}_{cn}{i}_{c}$  
 PwrElecLoss  Resistive power loss  P_{elec}  ${P}_{elec}=\frac{3}{2}({R}_{s}{i}_{sd}^{2}+{R}_{s}{i}_{sq}^{2})$  
PwrMechLoss  Mechanical power loss  P_{mech}  When Port Configuration is set to
${P}_{mech}=\left({\omega}_{m}^{2}F+\left{\omega}_{m}\right{T}_{f}\right)$ When Port
Configuration is set to
${P}_{mech}=0$  
 PwrMtrStored  Stored motor power  P_{str}  ${P}_{str}={P}_{bus}+{P}_{mot}+{P}_{elec}+{P}_{mech}$ 
The equations use these variables.
R_{s}  Stator resistance 
i_{a}, i_{b}, i_{c}  Stator phase a, b, and c current 
i_{sq}, i_{sd}  Stator q and daxis currents 
v_{an}, v_{bn}, v_{cn}  Stator phase a, b, and c voltage 
ω_{m}  Angular mechanical velocity of the rotor 
F  Combined motor and load viscous damping 
T_{e}  Electromagnetic torque 
T_{f}  Combined motor and load friction torque 
The data for the Corresponding daxis current, id and Corresponding qaxis current, iq lookup tables are functions of the d and qaxis flux.
To enable current calculations suitable for code generation targets that limit memory, select Enable memory optimized 2D LUT. The block uses linear interpolation to optimize the current lookup table values for code generation. This table summarizes the optimization implementation.
Use Case  Implementation  

d and qaxis flux aligns with the lookup table breakpoint values.  Memoryoptimized current is current lookup table value at intersection of flux values.  
d and qaxis flux does not align with the lookup table breakpoint values, but is within range.  Memoryoptimized current is linear interpolation between corresponding flux values.  
d and qaxis flux does not align with the lookup table breakpoint values, and is out of range.  Cannot compute an memoryoptimized current. Block uses extrapolated data. 
The lookup tables optimized for code generation do not support extrapolation for data that is out of range. However, you can include precalculated extrapolation values in the power loss lookup table by selecting Specify Extrapolation.
The block uses the endpoint parameters to resize the table data.
User Input  Extrapolation 

[1] Hu, Dakai, Yazan Alsmadi, and Longya Xu. “High fidelity nonlinear IPM modeling based on measured stator winding flux linkage.” IEEE^{®} Transactions on Industry Applications, Vol. 51, No. 4, July/August 2015.
[2] Chen, Xiao, Jiabin Wang, Bhaskar Sen, Panagiotis Lasari, Tianfu Sun. “A HighFidelity and Computationally Efficient Model for Interior PermanentMagnet Machines Considering the Magnetic Saturation, Spatial Harmonics, and Iron Loss Effect.” IEEE Transactions on Industrial Electronics, Vol. 62, No. 7, July 2015.
[3] Ottosson, J., M. Alakula. “A compact field weakening controller implementation.” International Symposium on Power Electronics, Electrical Drives, Automation and Motion, July, 2006.
FluxBased PM Controller  Induction Motor  Interior PMSM  Mapped Motor  Surface Mount PMSM