# Permanent Magnet Synchronous Machine

Model the dynamics of a three-phase permanent magnet synchronous machine with sinusoidal or trapezoidal back electromotive force, or the dynamics of a five-phase permanent magnet synchronous machine with sinusoidal back electromotive force

## Library

Fundamental Blocks/Machines

## Description

The Permanent Magnet Synchronous Machine block operates in either generator or motor mode. The mode of operation is dictated by the sign of the mechanical torque (positive for motor mode, negative for generator mode). The electrical and mechanical parts of the machine are each represented by a second-order state-space model.

The sinusoidal model assumes that the flux established by the permanent magnets in the stator is sinusoidal, which implies that the electromotive forces are sinusoidal.

The trapezoidal model assumes that the winding distribution and flux established by the permanent magnets produce three trapezoidal back EMF waveforms.

The block implements the following equations.

### Three-Phase Sinusoidal Model Electrical System

These equations are expressed in the rotor reference frame (qd frame). All quantities in the rotor reference frame are referred to the stator.

`$\frac{d}{dt}{i}_{d}=\frac{1}{{L}_{d}}{v}_{d}-\frac{R}{{L}_{d}}{i}_{d}+\frac{{L}_{q}}{{L}_{d}}p{\omega }_{m}{i}_{q}$`

`$\frac{d}{dt}{i}_{q}=\frac{1}{{L}_{q}}{v}_{q}-\frac{R}{{L}_{q}}{i}_{q}-\frac{{L}_{d}}{{L}_{q}}p{\omega }_{m}{i}_{d}-\frac{\lambda p{\omega }_{m}}{{L}_{q}}$`

`${T}_{e}=1.5p\left[\lambda {i}_{q}+\left({L}_{d}-{L}_{q}\right){i}_{d}{i}_{q}\right]$`

 Lq, Ld q and d axis inductances R Resistance of the stator windings iq, id q and d axis currents vq, vd q and d axis voltages ωm Angular velocity of the rotor λ Amplitude of the flux induced by the permanent magnets of the rotor in the stator phases p Number of pole pairs Te Electromagnetic torque

The Lq and Ld inductances represent the relation between the phase inductance and the rotor position due to the saliency of the rotor. For example, the inductance measured between phase a and b (phase c is left open) is given by:

`${L}_{ab}={L}_{d}+{L}_{q}+\left({L}_{q}-{L}_{d}\right)\mathrm{cos}\left(2{\theta }_{e}+\frac{\pi }{3}\right)$`

Θe represents the electrical angle.

The next figure shows the variation of the phase to phase inductance in function of the electrical angle of the rotor.

• For a round rotor, there is no variation in the phase inductance.

`${L}_{d}={L}_{q}=\frac{{L}_{ab}}{2}$`

• For a salient round rotor, the dq inductances are given by:

`${L}_{d}=\frac{\mathrm{max}\left({L}_{ab}\right)}{2}$`

and

`${L}_{q}=\frac{\mathrm{min}\left({L}_{ab}\right)}{2}$`

### Five-Phase Sinusoidal Model Electrical System

These equations are expressed in the rotor reference frame using an extended Park transformation (q1d1 and q2d2 frame). All quantities in the rotor reference frame are referred to the stator.

`$\frac{d}{dt}{i}_{d1}=\frac{1}{L}{v}_{d1}-\frac{R}{L}{i}_{d1}+\frac{{L}_{q}}{L}p{\omega }_{m}{i}_{q1}$`

`$\frac{d}{dt}{i}_{q1}=\frac{1}{L}{v}_{q1}-\frac{R}{L}{i}_{q1}-\frac{{L}_{d}}{L}p{\omega }_{m}{i}_{d1}-\frac{\lambda p{\omega }_{m}}{L}$`

`$\frac{d}{dt}{i}_{d2}=\frac{1}{L}{v}_{d2}-\frac{R}{L}{i}_{d2}$`

`$\frac{d}{dt}{i}_{q2}=\frac{1}{L}{v}_{q2}-\frac{R}{L}{i}_{q2}$`

`${T}_{e}=2.5p\lambda {i}_{q1}$`

 L Armature inductance R Resistance of the stator windings iq1, id1 q1 and d1 axis currents vq1, vd1 q1 and d1 axis voltages iq2, id2 q2 and d2 axis currents vq2, vd2 q2 and d2 axis voltages ωm Angular velocity of the rotor λ Amplitude of the flux induced by the permanent magnets of the rotor in the stator phases p Number of pole pairs Te Electromagnetic torque

### Three-Phase Trapezoidal Model Electrical System

These equations are expressed in the phase reference frame (abc frame). Note that the phase inductance Ls is assumed constant and does not vary with the rotor position.

`$\begin{array}{c}\frac{d}{dt}{i}_{a}=\frac{1}{3{L}_{s}}\left(2{v}_{ab}+{v}_{bc}-3{R}_{s}{i}_{a}+\lambda p{\omega }_{m}\left(-2{\Phi }_{a}^{\prime }+{\Phi }_{b}^{\prime }+{\Phi }_{c}^{\prime }\right)\right)\\ \frac{d}{dt}{i}_{b}=\frac{1}{3{L}_{s}}\left(-{v}_{ab}+{v}_{bc}-3{R}_{s}{i}_{b}+\lambda p{\omega }_{m}\left({\Phi }_{a}^{\prime }-2{\Phi }_{b}^{\prime }+{\Phi }_{c}^{\prime }\right)\right)\\ \frac{d}{dt}{i}_{c}=-\left(\frac{d}{dt}{i}_{a}+\frac{d}{dt}{i}_{b}\right)\\ {T}_{e}=p\lambda \left({\Phi }_{a}^{\prime }\cdot {i}_{a}+{\Phi }_{b}^{\prime }\cdot {i}_{b}+{\Phi }_{c}^{\prime }\cdot {i}_{c}\right),\end{array}$`

The electromotive force Φ' is represented by

and

 Ls Inductance of the stator windings R Resistance of the stator windings ia, ib, ic a, b and c phase currents Φa', Φb', Φc' a, b and c phase electromotive forces, in per-unit value to the amplitude of the flux λ. vab, vbc ab and bc phase to phase voltages ωm Angular velocity of the rotor λ Amplitude of the flux induced by the permanent magnets of the rotor in the stator phases p Number of pole pairs Te Electromagnetic torque

### Mechanical System (for all models)

`$\begin{array}{c}\frac{d}{dt}{\omega }_{r}=\frac{1}{J}\left({T}_{e}-{T}_{f}-F{\omega }_{m}-{T}_{m}\right)\\ \frac{d\theta }{dt}={\omega }_{m,}\end{array}$`

 J Combined inertia of rotor and load F Combined viscous friction of rotor and load θ Rotor angular position Tm Shaft mechanical torque Tf Shaft static friction torque ωm Angular velocity of the rotor (mechanical speed)

## Parameters

### Configuration Tab

Number of phases

Select between a three-phase machine model or a five-phase machine model. Default is `3`. This parameter is disabled when the Back EMF waveform parameter is set to `Trapezoidal`, or when the Rotor type parameter is set to `Salient-pole`.

Back EMF waveform

Select between the `Sinusoidal` (default) and the `Trapezoidal` electromotive force. This parameter is disabled when the Number of phases parameter is set to `5`.

Rotor type

Select between the `Salient-pole` and `Round`, the round (cylindrical) rotor. Default is `Round`. This parameter is disabled when the Number of phases parameter is set to `5` or when the Back EMF waveform parameter is set to `Trapezoidal`.

Mechanical input

Select the torque applied to the shaft, the rotor speed as a Simulink® input of the block, or to represent the machine shaft by a Simscape™ rotational mechanical port.

Select `Torque Tm` (default) to specify a torque input, in N.m., and change labeling of the block input to `Tm`. The machine speed is determined by the machine Inertia J and by the difference between the applied mechanical torque Tm and the internal electromagnetic torque Te. The sign convention for the mechanical torque is when the speed is positive, a positive torque signal indicates motor mode and a negative signal indicates generator mode.

Select `Speed w` to specify a speed input, in rad/s, and change labeling of the block input to `w`. The machine speed is imposed and the mechanical part of the model (Inertia J) is ignored. Using the speed as the mechanical input allows modeling a mechanical coupling between two machines.

The next figure indicates how to model a stiff shaft interconnection in a motor-generator set when friction torque is ignored in machine 2. The speed output of machine 1 (motor) is connected to the speed input of machine 2 (generator), while machine 2 electromagnetic torque output Te is applied to the mechanical torque input Tm of machine 1. The Kw factor takes into account speed units of both machines (pu or rad/s) and gear box ratio `w2/w1`. The KT factor takes into account torque units of both machines (pu or N.m) and machine ratings. Also, as the inertia J2 is ignored in machine 2, J2 referred to machine 1 speed must be added to machine 1 inertia J1.

Select `Mechanical rotational port` to add to the block a Simscape mechanical rotational port that allows connection of the machine shaft with other Simscape blocks with mechanical rotational ports. The Simulink input representing the mechanical torque `Tm` or the speed `w` of the machine is then removed from the block.

The next figure indicates how to connect an Ideal Torque Source block from the Simscape library to the machine shaft to represent the machine in motor mode, or in generator mode, when the rotor speed is positive.

Preset Model

Provides a set of predetermined electrical and mechanical parameters for various permanent magnet synchronous motor ratings of torque (N.m), DC bus voltage (V), rated speed (rpm), and continuous stall torque (N.m).

The Preset Model parameter is enabled only when the Back EMF waveform parameter is set to `Sinusoidal`, and the Rotor type parameter is set to `Round`.

Select one of the preset models to load the corresponding electrical and mechanical parameters in the entries of the dialog box. Select `No` (default) if you do not want to use a preset model, or if you want to modify some of the parameters of a preset model.

When you select a preset model, the electrical and mechanical parameters in the Parameters tab of the dialog box become nonmodifiable (unavailable). To start from a given preset model and then modify machine parameters:

1. Select the preset model that you want to initialize the parameters.

2. Change the Preset model parameter value to `No`. This does not change the machine parameters. It just breaks the connection with the particular preset model.

3. Modify the machine parameters as you want, then click .

Use signal names to identify bus labels

When this check box is selected, the measurement output uses the signal names to identify the bus labels. Select this option for applications that require bus signal labels to have only alphanumeric characters. Default is cleared.

When this check box is cleared, the measurement output uses the signal definition to identify the bus labels. The labels contain nonalphanumeric characters that are incompatible with some Simulink applications.

### Parameters Tab

Stator phase resistance

The stator phase resistance Rs (Ω). Default is `0.0485`.

Armature inductance (H)

The armature inductance of the sinusoidal model with round rotor (Ld is equal to Lq). This parameter is available only when the Back EMF waveform parameter is set to `Sinusoidal`, and the Rotor type parameter set to `Round`. Default is `0.000395`.

Inductances [Ld(H) Lq(H)]

The phase to neutral Ld (H) and Lq (H) inductances in the d-axis and q-axis of the sinusoidal model with salient-pole rotor. This parameter is available only when the Back EMF waveform parameter is set to `Sinusoidal`, and the Rotor type parameter set to `Salient-pole`. Default is `[8.5e-3,8.5e-3]`.

Stator phase inductance Ls (H)

The stator-phase-to-neutral inductance Ls (H) of the trapezoidal model. This parameter is available only when the Back EMF waveform parameter is set to `Trapezoidal`. Default is `8.5e-3`.

Specify

Lets you select the machine constant that you want to specify for block parameterization:

• `Flux linkage established by magnets` (default)

• `Voltage Constant`

• `Torque Constant`

Once you select a constant, you can enter its value in the appropriate parameter field, while the other two parameters become inaccessible.

The constant flux λ (Wb) per pole pairs induced in the stator windings by the magnets. Default is `0.1194`. This parameter is available only when the Specify parameter is set to `Flux linkage established by magnets`.

Voltage constant

The peak line to line voltage per 1000 rpm. This voltage represents the peak open circuit voltage when the machine is driven as a generator at 1000 rpm. Default is `86.6271`. This parameter is available only when the Specify parameter is set to `Voltage Constant`.

Torque constant

The torque per ampere constant. Default is `0.7164`. This parameter is available only when the Specify parameter is set to `Torque Constant`. This constant assumes that the machine is driven by an inverter which provides a perfect synchronization between the current and the Back-EMF.

• Sinusoidal model: A sine wave current is assumed (for more information, see `ac6_example_simplified`).

• Trapezoidal model: A square ware current is assumed (for more information, see `ac7_example_simplified`).

Pole pairs p ()

The number of pole pairs p. Default is `4`. This parameter is available only when the Mechanical input parameter is set to `Speed w`.

Back EMF flat area

The width of the flat top for a half period of the electromotive force Φ' (degrees) (only for trapezoidal machine). This parameter is available only when the Back EMF waveform parameter is set to `Trapezoidal`. Default is `120`.

Inertia, viscous damping, pole pairs, static friction

The combined machine and load inertia coefficient J (kg.m2), combined viscous friction coefficient F (N.m.s), pole pairs p, and shaft static friction Tf (N.m).

If the static friction parameter value is omitted or not specified, the block considers this value to be 0. Default is `[0.0027 0.0004924 4 0]`.

Initial conditions

Specifies the mechanical speed (rad/s), mechanical angle Θm (degrees), and instantaneous stator current (A):

Three-phase machine [wm, Θm, ia, ib]

Five-phase machine [wm, Θm, ia, ib, ic, id]

Because the stator is wye-connected and the neutral point is isolated, the current ic in the three-phase machine is given by ic = -ia-ib, and the current ie in the five-phase machine is given by ie = -ia -ib -ic -id. Default is `[0,0, 0,0]`.

Sample time (−1 for inherited)

Specifies the sample time used by the block. To inherit the sample time specified in the Powergui block, set this parameter to `−1` (default).

Rotor flux position when theta = 0

Lets you select the reference position of the rotor flux relative to the phase A axis.

Select ```90 degrees behind phase A axis (modified Park)``` (default) to choose the reference position of the rotor represented by:

The modified Park transformation [4] is more convenient for vector control because the maximum phase induction occurs at theta = 0.

Select `Aligned with phase A axis (original Park)` to choose the reference position of the rotor represented by:

## Inputs and Outputs

`Tm`

The Simulink input is the mechanical torque at the machine shaft. This input is normally positive because the Permanent Magnet Synchronous Machine block is usually used as a motor. If you choose to use the block in generator mode, you can apply a negative torque input.

`w`

The alternative block input (depending on the value of the Mechanical input parameter) is the machine speed, in rad/s.

m

The Simulink output of the block is a vector containing measurement signals. The available signals depend on the model you selected. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.

Name

Definition

Units

Model

ias

Stator current is_a

A

all

ibs

Stator current is_b

A

all

ics

Stator current is_c

A

all

ids

Stator current is_d

A

5-Phase Sinusoidal

ies

Stator current is_e

A

5-Phase Sinusoidal

iqs

Stator current is_q

A

3-Phase Sinusoidal

ids

Stator current is_d

A

3-Phase Sinusoidal

iqs1

Stator current is_q1

A

5-Phase Sinusoidal

ids1

Stator current is_d1

A

5-Phase Sinusoidal

iqs2

Stator current is_q2

A

5-Phase Sinusoidal

ids2

Stator current is_d2

A

5-Phase Sinusoidal

vqs

Stator voltage Vs_q

V

3-Phase Sinusoidal

vds

Stator voltage Vs_d

V

3-Phase Sinusoidal

vqs1

Stator voltage Vs_q1

V

5-Phase Sinusoidal

vds1

Stator voltage Vs_d1

V

5-Phase Sinusoidal

vqs2

Stator voltage Vs_q2

V

5-Phase Sinusoidal

vds2

Stator voltage Vs_d2

V

5-Phase Sinusoidal

ea

Phase back EMF e_a

V

3-Phase Trapezoidal

eb

Phase back EMF e_b

V

3-Phase Trapezoidal

ec

Phase back EMF e_c

V

3-Phase Trapezoidal

ha

Hall effect signal h_a*

logic 0-1

3-Phase, Sinusoidal and Trapezoidal

hb

Hall effect signal h_b*

logic 0-1

3-Phase, Sinusoidal and Trapezoidal

hc

Hall effect signal h_c*

logic 0-1

3-Phase, Sinusoidal and Trapezoidal

w

Rotor speed wm

all

theta

Rotor angle thetam

all

Te

Electromagnetic torque Te

N.m

all

The Hall effect signal provides a logical indication of the back EMF positioning. This signal is very useful to directly control the power switches. There is a change of state at each zero crossing of the phase to phase voltage. These signals must be decoded before being applied to the switches.

## Assumption

The Permanent Magnet Synchronous Machine block assumes a linear magnetic circuit with no saturation of the stator and rotor iron. This assumption can be made because of the large air gap usually found in permanent magnet synchronous machines.

## Limitations

When you use Permanent Magnet Synchronous Machine blocks in discrete systems, you might have to use a small parasitic resistive load, connected at the machine terminals, to avoid numerical oscillations. Large sample times require larger loads. The minimum resistive load is proportional to the sample time. Remember that with a 25 μs time step on a 60 Hz system, the minimum load is approximately 2.5% of the machine nominal power. For example, a 200 MVA PM synchronous machine in a power system discretized with a 50 μs sample time requires approximately 5% of resistive load or 10 MW. If the sample time is reduced to 20 μs, a resistive load of 4 MW is sufficient.

## Examples

The `power_brushlessDCmotor` example illustrates the use of the Permanent Magnet Synchronous Machine block.

## References

[1] Grenier, D., L.-A. Dessaint, O. Akhrif, Y. Bonnassieux, and B. LePioufle. “Experimental Nonlinear Torque Control of a Permanent Magnet Synchronous Motor Using Saliency.” IEEE® Transactions on Industrial Electronics, Vol. 44, No. 5, October 1997, pp. 680-687.

[2] Toliyat, H.A. “Analysis and Simulation of Multi-Phase Variable Speed Induction Motor Drives Under Asymmetrical Connections.” Applied Power Electronics Conference and Exposition, Vol. 2, March 1996, pp. 586-592.

[3] Beaudart, F., F. Labrique, E. Matagne, D. Telteux, and P. Alexandre. “Control under normal and fault tolerant operation of multiphase SMPM synchronous machines with mechanically and magnetically decoupled phases.” International Conference on Power Engineering, Energy and Electrical Drives, March 2009, pp. 461-466.

[4] Krause, P.C., O. Wasynczuk, and S.D. Sudhoff. Analysis of Electric Machinery and Drive Systems. IEEE Press, 2002.