Permanent Magnet Synchronous Machine with Salient Rotor

Description of the three-phase permanent magnet synchronous machine (PMSM) with salient rotor component in Schematic Editor

The Schematic Editor library block from the Machine section, shown in Table 1, models the dynamics of a three-phase permanent magnet synchronous machine in real-time. This modeling approach can be used for describing the dynamics of a permanent magnet synchronous machine with a salient or a cylindrical rotor.

Table 1. Permanent magnet synchronous machine component in HIL Toolbox
component component dialog window component parameters
  • Property tabs:
    • Electrical
    • Mechanical
    • Load
    • Feedback
    • Advanced
    • Snubber

In the above block, terminals A, B, and C are stator winding terminals, consisting of three identical, sinusoidally distributed phase windings, displaced by 120 degrees. The stator winding arrangement (connection) can be selected by the block parameter star_delta. The model assumes that the stator flux linkage established by the permanent magnets is sinusoidal, which implies that the electromotive forces are sinusoidal.

Electrical sub-system model

The electrical part of the machine is represented by a second-order state-space model in a synchronously rotating dq reference frame, invariant to the electrical variable amplitudes, as described in [3]. The dq reference frame is attached to the rotor, and the d-axis is aligned with the rotor magnets. The modeled dynamics can be represented with following equations:

d d t λ d s λ q s = - R s L d ω r - ω r - R s L q λ d s λ q s + 1 0 R s L d 0 1 0 ν d s ν q s λ P M i d s i q s = 1 L d 0 0 1 L q λ d s λ q s + 0 0 - 1 L d 0 0 0 ν d s ν q s λ P M
Table 2. The permanent magnet synchronous machine electrical subsystem model variables
symbol description
λ d s direct axis component of stator flux
λ q s quadrature axis component of stator flux
λ P M flux amplitude established in stator phases by rotor permanent magnets
i d s direct axis component of stator current
i q s quadrature axis component of stator current
v d s direct axis component of stator voltage
v q s quadrature axis component of stator voltage
R s stator phase resistance
L d direct axis inductance
L q quadrature axis inductance
ω r rotor electrical speed

Starting with 2018.2 version of Typhoon HIL Software, a nonlinear model of permanent magnet synchronous machine is supported. If the chosen model type is nonlinear, the electrical subsystem is based on the same equations, the only difference being that fluxes λ d s and λ q s , and inductances L d and L q are dependent on the stator currents i d s and i q s .

Mechanical sub-system model

The mechanical part of the machine is represented by a second-order state-space model:

ω m ̇ = 1 J m ( T e - T L ) θ m ̇ = ω m T e = 3 2 p ( λ d s i q s - λ q s i d s )
Table 3. The permanent magnet synchronous machine mechanical subsystem model variables
symbol description
ω m rotor mechanical speed
θ m rotor mechanical angle (between as and ar axis)
T e machine developed electromagnetic torque
T L shaft mechanical load torque
J m combined rotor and load moment of inertia
p machine number of pole pairs
λ d s direct axis component of stator flux
λ q s quadrature axis component of stator flux
i d s direct axis component of stator current
i q s quadrature axis component of stator current

Block dialogue box and parameters

The permanent magnet synchronous machine block dialogue box consists of four tabs for specifying machine model parameters and one general input for specifying the machine label in the circuit schematic.

Tab: "Electrical"

In this block tab, all electrical parameters of the model can be specified. Its layout is shown here:

Figure 1: Permanent magnet synchronous machine electrical properties

The permanent magnet synchronous machine electrical parameters

symbol description
R s stator phase resistance [Ω]
L d direct axis inductance [H]
L q quadrature axis inductance [H]
P s i _ p m flux amplitude established in stator phases by rotor permanent magnets [Wb]
i d v e c t o r list of d-axis current values
i q v e c t o r list of q-axis current values
p s i d t a b l e d-axis flux linkage lookup table
p s i q t a b l e q-axis flux linkage lookup table
L d t a b l e d-axis inductance lookup table
L q t a b l e q-axis inductance lookup table

The permanent magnet synchronous machine model can include magnetic saturation effects. In that case, fluxes or inductances are defined as functions of stator currents i d s and i q s . These functions are represented in the form of lookup tables. The lookup tables use linear interpolation and linear extrapolation.

Saturation can be parametrized in the following ways:
  1. fluxes vs stator currents
  2. absolute inductances vs stator currents
  3. incremental inductances vs stator currents
In each of these cases the d-axis and q-axis flux or inductance can depend on both stator currents or only on the corresponding stator current. When fluxes or inductances are functions of both d-axis and q-axis currents, it is important to define the lookup tables as nested Python lists where the number of inner lists must be equal to the number of elements in the current id vector and the number of elements of each inner list must be equal to the number of elements in the current iq vector. Examples of parametrization using the Model Initialization script are given below.

Figure 2: Fluxes as functions of stator currents









Figure 3: Inductances as functions of stator currents









Besides the saturation, the permanent magnet synchronous machine model can include flux and torque spatial harmonics. The spatial effects are parametrized using lookup tables. Either the d- and q- axis currents tables, or the d- and q- axis fluxes can be provided. In addition a torque table can be used if available.

In case the current tables are used, the corresponding mechanical angle vector and d- and q- axis flux vectors should be provided. The current tables should be provided in the form of a nested Python lists, as shown in Figure 4.

Figure 4: Current Lookup Tables

Similarly, if flux tables are used, the corresponding mechanical angle vector and d- and q- axis current vectors should be provided. The flux tables should be provided in the form of a nested Python lists, as shown in Figure 5.

Figure 5: Flux Lookup Tables

If the torque table is used, the corresponding mechanical angle vector and d- and q- axis current vectors should be provided. The torque table should be provided in the form of a nested Python list, as shown in Figure 6.

Figure 6: Torque Lookup Table

In all cases the mechanical angle vector must be given as a list ranging from 0 to 360/pole_pairs. The number of points available for all lookup tables used is 16000. If the total number of points provided in the lookup tables exceeds this number, the tables will be rescaled to work with fewer points. The resulting tables may have lower resolution than the original ones.

Figure 7: Iron Losses

If iron losses are included, corresponding d- and q- axis iron loss currents are calculated as follows:

v d s =   - ω r λ q s

v q s = ω r λ d s

R F e = 3 ω r 2 λ d s 2 + λ q s 2 2 P F e

i d , F e = v d s R F e

i q , F e = v q s R F e

Direct and quadrature axis components of iron loss currents are added to the corresponding components of stator currents, which provide the machine's electromagnetic torque:

i d s = i d m + i d , F e

i q s = i q m + i q , F e

Table 4. The permanent magnet synchronous machine iron losses variables
symbol description
λ d s direct axis component of stator flux
λ q s quadrature axis component of stator flux
v d s direct axis component of stator voltage
v q s quadrature axis component of stator voltage
i ds direct axis component of stator current
i qs quadrature axis component of stator current
i d, Fe direct axis component of iron loss current
i q, Fe quadrature axis component of iron loss current
i dm direct axis component of stator current which determines torque production
i qm quadrature axis component of stator current which determines torque production
R Fe iron loss resistance
P Fe total iron losses
ω r rotor electrical speed
Note: The iron losses option is available only if nonlinear - spatial harmonic is chosen as model type.

An example of a PMSM model including iron losses can be found in the pmsm iron losses.tse example in our Examples Explorer, in the [examples\models\electrical drives\pmsm iron losses].

Tab: "Mechanical"

In this block tab, all mechanical parameters of the model can be specified. Its layout is shown here:

Figure 8: Permanent magnet synchronous machine mechanical properties

Permanent magnet synchronous machine mechanical parameters

symbol description
p m s machine number of pole pairs
s t a r _ d e l t a stator winding connection (star or delta)
J m combined rotor and load moment of inertia [kgm2]
F r i c t i o n   c o e f f i c i e n t machine viscous friction coefficient [Nms]

Tab: "Load"

In this block tab, the external load settings can be specified. Its layout is shown here:

Figure 9: Permanent magnet synchronous machine mechanical properties

Permanent magnet synchronous machine mechanical parameters

symbol description
E x t e r n a l   l o a d   t y p e External load type: torque or speed
L o a d   a i   p i n HIL analog input address for external torque command
L o a d   a i   o f f s e t assigned offset value to the input signal representing external torque command
L o a d   a i   g a i n assigned gain value to the input signal representing external torque command

External load enables use of an analog input signal from a HIL analog channel with the address ai_pin_addr as an external torque/speed load. It also allows for assigning an offset to the input signal and gain (Nm/V) according to the formula:

T L = g a i n ( A I ( a i _ p i n _ a d d r ) + o f f s e t )

Tab: "Feedback"

In this block tab, all parameters relevant to machine model feedback signals can be specified. Its layout is shown here:

Figure 10: Permanent magnet synchronous machine feedback properties

Permanent magnet synchronous machine feedback properties

symbol description
E n c   p p r incremental encoder number of pulses per revolution
R e s o l v e r   p o l e   p a i r s resolver number of pole pairs
R e s o l v e r   c a r r   s o u r c e resolver carrier signal source selection (internal or external)
R e s o l v e r   c a r r i e r   f r e q u e n c y resolver carrier signal frequency (internal carrier)
R e s o l v e r   a i   p i n resolver carrier input channel address
R e s o l v e r   a i   o f f s e t resolver carrier input channel offset
R e s o l v e r   a i   g a i n resolver carrier input channel gain
Note: This part does not specify model output variables like machine voltages, currents and fluxes.
Note: While the machine speed is positive, the encoder channel B signal leads the encoder channel A signal.

Tab: "Advanced"

In this block tab, some advanced features of the machine model can be specified. Its layout is shown here:

Figure 11: Permanent magnet synchronous machine advanced properties

Theta_ab specifies the position of the stationary αβ reference frame with regards to the stator phase a axis. In this way, machine model output variables (currents, voltages, and fluxes) can be monitored in a more familiar stationary reference frame. Also, in this way, the initial position of the dq reference frame is specified, having in mind that the d-axis of a dq reference frame is displaced by an initial rotor position θ r 0 with regards to the α-axis of a stationary reference frame. There are usually two machine modeling approaches: the first is where the alpha axis of the stationary reference frame lags by 90 degrees with regards to the stator phase a-axis (used by default, and indicated in a) Figure 12). The second one is where the alpha axis is aligned with the stator phase a-axis (indicated in b) Figure 12). Either of these two situations can be selected.

Figure 12: Selection of a stationary reference frame position: a) theta_ab= -pi/2; b) theta_ab= 0

Tab: "Output"

This block tab enables a single, vectorized signal output from the machine. The output vector contains selected machine mechanical and/or electrical variables in the same order as listed in this tab. Its layout is shown here:

Figure 13: Permanent magnet synchronous machine output properties

Table 5. Permanent magnet synchronous machine output parameters
symbol description
E x e c u t i o n   r a t e signal processing output execution rate
E l e c t r i c a l   t o r q u e machine electrical torque
M e c h a n i c a l   s p e e d machine mechanical angular speed
M e c h a n i c a l   a n g l e machine mechanical angle
S t a t o r   a l p h a   a x i s   c u r r e n t alpha component of stator current
S t a t o r   b e t a   a x i s   c u r r e n t beta component of stator current
S t a t o r   d - a x i s   c u r r e n t direct axis component of stator current
S t a t o r   q - a x i s   c u r r e n t quadrature axis component of stator current
S t a t o r   a l p h a   a x i s   f l u x alpha component of stator flux
S t a t o r   b e t a   a x i s   f l u x beta component of stator flux
S t a t o r   d - a x i s   f l u x direct axis component of stator flux
S t a t o r   q - a x i s   f l u x quadrature axis component of stator flux

Model outputs

Table 6. Variables for permanent magnet synchronous machine model
symbol analog output variable name description
λ α s psi_als alpha component of stator flux
λ β s psi_bes beta component of stator flux
λ d s psi_ds direct axis component of stator flux
λ q s psi_qs quadrature axis component of stator flux
i α s i_als alpha component of stator current
i β s i_bes beta component of stator current
i d s i_ds direct axis component of stator flux
i q s i_qs quadrature axis component of stator current
i a s i_a phase a current
i b s i_b phase b current
i c s i_c phase c current
v a b s v_ab line voltage between terminals A and B
v b c s v_bc line voltage between terminals B and C
T e machine electrical torque machine electrical torque
T L machine load torque machine load torque
ω m machine mechanical speed machine mechanical angular speed
θ m machine mechanical angle machine mechanical angle
  machine sine encoder A sinusoidal encoder channel A output
  machine sine encoder B sinusoidal encoder channel B output
  machine resolver A resolver channel A output
  machine resolver B resolver channel B output

Model details

Figure 14 shows some implementation details relevant for the permanent magnet synchronous machine (dq model) block. For this machine block, the stator circuit is substituted with controlled current sources. Voltage measurement blocks in the stator substitute circuit provide inputs for the machine model solver. Stator line voltages (v_abs and v_bcs) are transformed to phase voltages (v_asf, v_bsf and v_csf) using the block parameter star_delta. In astar-winding configuration phase voltages are not equal to line voltages to which the motor is actually connected (to the inverter, for example). The following equations relate stator line voltages v_abs, v_bcs and v_cas to phase voltages v_asf, v_bsf and v_csf (a balanced, symmetrical set of three-phase voltages is assumed):

Figure 14: dq PSMS machine model implementation details



v a s f v b s f v c s f = 2 3 1 3 - 1 3 1 3 - 1 3 - 2 3 v a b s v b c s

For a delta stator winding configuration, line (terminal) voltages v_abs, v_bcs and v_cas are equal to phase (winding) voltages v_asf, v_bsf, and v_csf, so the following equation is valid:

v a s f v b s f v c s f = 1 0 0 1 - 1 - 1 v a b s v b c s

In the next step, stator phase voltages are transformed to stationary αβ- reference frame components, v_als and v_bes, using the block parameter theta_ab and the following equation:

v α s v β s = 2 3 c o s θ a b c o s 2 π 3 - θ a b c o s 2 π 3 + θ a b - s i n θ a b s i n π 3 + θ a b - s i n π 3 - θ a b v a s f v b s f v c s f

In order to have a change of variables which formulates an amplitude invariant transformation, a multiplier 2/3 is introduced in an abc/αβ-transformation. In such a reference frame, all variables have the same amplitude as in the original phase domain. theta_ab determines the position of the used stationary reference frame in regard to the stator phase winding a.

The model is described in a rotating dq reference frame attached to the rotor, and αβ- voltages (v_als and v_bes) are transformed to dq-components (v_ds nad v_qs) using the well-known Park's transformation matrix in following form:

v d s v q s = c o s θ r s i n θ r - s i n θ r c o s θ r v α s v β s

The rotor angle θ r is an input for the electrical subsystem model, which comes from the machine mechanical subsystem. In that way, the inputs for the electrical subsystem model equations given in Electrical sub-system model are formed, and state- and output-variables are calculated. State variables are machine stator fluxes on the d- and q-axis (psi_ds and psi_qs) and output variables are stator current dq-components (i_ds and i_qs). Electrical subsystem equations also use machine mechanical speed ω r from the mechanical subsystem model and the stator flux amplitude value established by the permanent magnet from the user input block parameter Psi_pm.

Output stator current dq-components are transformed back to the stationary reference frame αβ-components, i_als and i_bes, using an inverse Park transformation in the following form:

i α s i β s = c o s θ r - s i n θ r s i n θ r c o s θ r i d s i q s

Stator current αβ-components, i_als and i_bes, are transformed to phase values using an inverse Clarke's transformation:

i a s f i b s f i c s f = c o s θ a b - s i n θ a b - c o s π 3 + θ a b s i n π 3 + θ a b - c o s π 3 - θ a b - s i n π 3 - θ a b i α s i β s

Finally, stator phase currents, i_asf, i_bsf, and i_csf, are transformed to line values based on the user input block parameter star_delta. For the stator winding star-connection, the most usual configuration, line (terminal) currents i_as, i_bs and i_cs are equal top hase currents i_asf, i_bsf, and i_csf, and the following equation is valid:

i a s i b s i c s = 1 0 0 0 1 0 0 0 1 i a s f i b s f i c s f

For the stator winding delta-connection, line currents are calculated based on phase currents using the following equations:

i a s i b s = 2 1 - 1 1 i a s f i b s f i c s = - 1 - 1 i a s i b s

Calculated line currents i_as and i_bs determine the value of controlled current sources in the substitute stator circuit shown in Figure 14.