Documentation Home Page Power Electronics Add-On for NI VeriStand Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

PMSM BLDC Section

The PMSM BLDC model implements three machine types which provide parametrization for different machines (Permanent Magnet Synchronous Machine and Brushless DC Motor) and allow for different levels of model fidelity (Constant or Variable parametrization): PMSM Constant Ld/Lq, PMSM Variable Ld/Lq, and BLDC Constant Ls. The PMSM Constant Ld/Lq and BLDC Constant Ls machine types simulate a machine with constant inductance and magnetic flux parameters. The PMSM Variable Ld/Lq machine type simulates a PMSM whose inductance and magnetic flux parameters are variable based on the operating state of the simulation (in this case, based on Id and Iq), which allows for greater model fidelity.

Page Content

Configuration Page

In the System Explorer window configuration tree, expand the Power Electronics Add-On custom device and select Circuit Model >> PMSM BLDC to display this page and configure the PMSM BLDC machine model. Parameters are configurable at edit-time only.

General Parameters

The following parameters are available for any selected Machine Type.

Machine Model Settings

Name

Specifies the name of the machine model.

Description

Specifies a description for the machine model.

Machine Configuration

Machine Type

Choose from one of the following types. Certain machine configuration parameters and channels automatically populate depending on the selected Machine Type.

  • PMSM Constant Ld/Lq

  • PMSM Variable Ld/Lq

  • BLDC Constant Ls

Input Mapping Configuration

Use the Input Mapping Configuration to route signals to the Voltage Phase A, Voltage Phase B, and Voltage Phase C inputs of the machine model. Available routing options may vary depending on the selected Hardware Configuration.

Group

Specifies the group that will be routed to the input voltages of the machine. The available routing options are defined by the selected Hardware Configuration, however it is typical to see the following options by default:

  • Measurements - eHS circuit model measurements

Element

Specifies the index of the measurement in the group that has been selected as the input voltage of the machine.

 

Machine-Specific Parameters

Certain parameters of the PMSM BLDC page are populated based on the selected Machine Type.

Machine Configuration

 

Symbol

Units

Default Value

Description

Direct Axis Inductance

Ld

H

0.002984

Direct-axis inductance of the machine.

Quadrature Axis Inductance

Lq

H

0.004576

Quadrature-axis inductance of the machine.

Back EMF Profile

 

 

Default

Sets the waveform shape of the back EMF:

  • Default - The back EMF is sinusoidal.

  • User Defined - The shape of the back EMF waveform is defined by the Back EMF File [JSON].

Preview

 

 

 

Displays a preview of the back EMF waveform shape defined in the Back EMF File. This button is displayed when Back EMF Profile is set to User Defined and the Back EMF File Path is specified.

Back EMF File Path

 

 

 

Specifies the path to the Back EMF File on disk. This control is displayed when Back EMF Profile is set to User Defined.

Initial Angle

θ0

deg

0°

Initial angle of the machine

This may be useful when simulating two separate 3-phase machines that require a phase shift between them.

Phase A Resistance

Ra

Ω

0.12

Phase A resistance of the machine.

Phase B Resistance

Rb

Ω

0.12

Phase B resistance of the machine.

Phase C Resistance

Rc

Ω

0.12

Phase C resistance of the machine.

Pole Pairs

pp

 

3

Number of pole pairs.

Direct Quadrature Transform Angle Offset

θoffset

 

Aligned

The angle offset applied to the Reference Frame Transformation.

  • Aligned - Indicates that the d-axis is aligned with Phase A at t = 0. In this case, θoffset = 0°. This is illustrated in Figure 2.

  • 90 Degrees behind Phase A - Indicates that the q-axis is aligned with Phase A at t = 0. In this case, θoffset = -90°.

Permanent Magnet Flux Linkage

ψM

Wb

0.25366

Peak permanent magnet flux linkage

Applied Solver Timestep

Ts

s

1.2E-7

The timestep at which the machine model executes.

New outputs are computed by the FPGA machine model at each timestep. If Optimize Solver Timesteps is enabled in the Circuit Model page, the Applied Solver Timestep is automatically set to an optimal value and cannot be modified.

Minimum Solver Timestep

Tsm

s

1.0E-7

The minimum achievable timestep at which the machine model can execute.

Machine Configuration

 

Symbol

Units

Default Value

Description

Model File

 

*.json

*.ejson

 

Specifies the path to the JSON or encrypted JSON Machine Model file on disk. Refer to PMSM Machine Model File [JSON] for details regarding the file format.

For information about JSON encryption, contact OPAL-RT Support.

Enable Advanced Channels

 

 

False

Allows certain parameters to be exposed as tunable VeriStand Channels. See the PMSM Variable Ld/Lq Channels section below for more details.

This parameter is enabled after a Model File has been specified.

Back EMF Profile

 

 

Default

Sets the waveform shape of the back EMF:

  • Default - The back EMF is sinusoidal.

  • User Defined - The shape of the back EMF waveform is defined by the Back EMF File [JSON].

Preview

 

 

 

Displays a preview of the back EMF waveform shape defined in the Back EMF File. This button is displayed when Back EMF Profile is set to User Defined and the Back EMF File Path is specified.

Back EMF File Path

 

 

 

Specifies the path to the Back EMF File on disk. This control is displayed when Back EMF Profile is set to User Defined.

Initial Angle

θ0

deg

0

Initial angle of the machine

This may be useful when simulating two separate 3-phase machines that require a phase shift between them.

Applied Solver Timestep

Ts

s

1.2E-7

The timestep at which the machine model executes.

New outputs are computed by the FPGA machine model at each timestep. If Optimize Solver Timesteps is enabled in the Circuit Model page, the Applied Solver Timestep is automatically set to an optimal value and cannot be modified.

Minimum Solver Timestep

Tsm

s

1.0E-7

The minimum achievable timestep at which the machine model can execute.

Machine Configuration

 

Symbol

Units

Default Value

Description

Stator Inductance

Ls

H

0.002984

Stator inductance of the machine

Back EMF Profile

 

 

Default

Sets the waveform shape of the back EMF:

  • Default - The back EMF is trapezoidal.

  • User Defined - The shape of the back EMF waveform is defined by the Back EMF File [JSON].

Preview

 

 

 

Displays a preview of the back EMF waveform shape defined in the Back EMF File. This button is displayed when Back EMF Profile is set to User Defined and the Back EMF File Path is specified.

Back EMF File Path

 

 

 

Specifies the path to the Back EMF File on disk. This control is displayed when Back EMF Profile is set to User Defined.

Back EMF Flat Area

H

deg

0

Describes the length of the flat area of the trapezoidal back-EMF waveform, in degrees.  This control is displayed when Back EMF Profile is set to Default.

Please see Trapezoidal Back-EMF Characteristics for a description of the waveform.

Initial Angle

θ0

deg

0°

Initial angle of the machine

This may be useful when simulating two separate 3-phase machines that require a phase shift between them.

Permanent Magnet Flux Linkage

ψM

Wb

0.25366

Peak permanent magnet flux linkage.

Phase A Resistance

Ra

Ω

0.12

Phase A resistance of the machine.

Phase B Resistance

Rb

Ω

0.12

Phase B resistance of the machine.

Phase C Resistance

Rc

Ω

0.12

Phase C resistance of the machine.

Pole Pairs

pp

 

3

Number of pole pairs.

Direct Quadrature Transform Angle Offset

θoffset

 

Aligned

The angle offset applied to the Reference Frame Transformation.

  • Aligned - Indicates that the d-axis is aligned with Phase A at t = 0. In this case, θoffset = 0°. This is illustrated in Figure 2.

  • 90 Degrees behind Phase A - Indicates that the q-axis is aligned with Phase A at t = 0. In this case, θoffset = -90°.

Applied Solver Timestep

Ts

s

1.2E-7

The timestep at which the machine model executes.

New outputs are computed by the FPGA machine model at each timestep. If Optimize Solver Timesteps is enabled in the Circuit Model Section, the Applied Solver Timestep is automatically set to an optimal value and cannot be modified.

Minimum Solver Timestep

Tsm

s

1.0E-7

The minimum achievable timestep at which the machine model can execute.

Section Channels

The list of available channels in the PMSM BLDC section depends on the selected Machine Type. Channels listed under the General Channels header below are available for all machine types, while certain advanced channels are available for the PMSM Variable Ld/Lq only. Channel values can be modified dynamically at execution time.

Channel Name

Symbol

Type

Units

Description

Channel Name

Symbol

Type

Units

Description

Current Phase A

Ia

Output

A

Phase A current measured at the stator

Current Phase B

Ib

Output

A

Phase B current measured at the stator

Current Phase C

Ic

Output

A

Phase C current measured at the stator

Average Voltage A

Va,avg

Output

V

Averaged Phase A voltage measured at the stator. The voltage is processed through a low-pass filter with a cutoff frequency of 159 Hz.

Average Voltage B

Vb,avg

Output

V

Averaged Phase B voltage measured at the stator. The voltage is processed through a low-pass filter with a cutoff frequency of 159Hz.

Average Voltage C

Vc,avg

Output

V

Averaged Phase C voltage measured at the stator. The voltage is processed through a low-pass filter with a cutoff frequency of 159Hz.

Three-Phase Active Power

P

Output

W

Three-phase instantaneous active electrical power.

See the Power section for more information on how this value is calculated.

Three-Phase Reactive Power

Q

Output

VAR

Three-phase instantaneous reactive electrical power.

See the Power section for more information on how this value is calculated.

Direct Axis Stator Current

Id

Output

A

Direct-axis stator current in the dq reference frame.

For a description of the abc to dq transform used to compute this value, see Reference Frame Transformation.

Quadrature Axis Stator Current

Iq

Output

A

Quadrature-axis stator current in the dq reference frame.

For a description of the abc to dq transform used to compute this value, see Reference Frame Transformation.

Back-EMF Phase A

Vbemf,a

Output

V

Phase A to neutral voltage induced by the electromotive force.

Back-EMF Phase B

Vbemf,b

Output

V

Phase B to neutral voltage induced by the electromotive force.

Back-EMF Phase C

Vbemf,c

Output

V

Phase C to neutral voltage induced by the electromotive force.

Permanent Magnet Flux Linkage

ψM

Output

Wb

Latest-value measurement of the Permanent Magnet Flux Linkage used at the input of the electrical model.

For the PMSM Constant Ld/Lq and BLDC Constant Ls machine types, this channel returns the constant value defined by the user in the Machine Configuration section.

For the PMSM Variable Ld/Lq machine type, this channel returns the value obtained from the Fm table in the Machine Model File.

Direct Axis Inductance

Ld

Output

H

Latest-value measurement of the Direct Axis Inductance used at the input of the electrical model.

For the PMSM Constant Ld/Lq and BLDC Constant Ls machine types, this channel returns the constant value defined by the user in the Machine Configuration section.

For the PMSM Variable Ld/Lq machine type, this channel returns the value obtained from the Ld table in the Machine Model File.

Quadrature Axis Inductance

Lq

Output

H

Latest-value measurement of the Quadrature Axis Inductance used at the input of the electrical model.

For the PMSM Constant Ld/Lq and BLDC Constant Ls machine types, this channel returns the constant value defined by the user in the Machine Configuration section.

For the PMSM Variable Ld/Lq machine type, this channel returns the value obtained from the Lq table in the Machine Model File.

Direct Axis Stator Voltage

Vd

Output

V

Direct-axis stator voltage in the dq reference frame.

For a description of the abc to dq transform used to compute this value, see Reference Frame Transformation.

Quadrature Axis Stator Voltage

Vq

Output

V

Quadrature-axis stator voltage in the dq reference frame.

For a description of the abc to dq transform used to compute this value, see Reference Frame Transformation.

Electrical Angle

θe

Output

deg

Position of the rotating magnetic field, as defined by the Electrical Angle Equation.

If this signal is routed to a Waveform Channel or an Analog Output Channel, its value is expressed in Turns. The signal ranges in value from 0 to 1, with 1 representing a full rotation.

Electromagnetic Torque

Te

Output

Nm

Torque generated through power at the stator. Refer to the Torque section for more information.

The following VeriStand channels are displayed under the Advanced section when the Enable Advanced Channels option is enabled on the PMSM Variable Ld/Lq configuration page.

Channel Name

Symbol

Type

Units

Default Value

Description

Channel Name

Symbol

Type

Units

Default Value

Description

Direct Axis Inductance Override

Ld

Input

H

0.002984

Direct-axis inductance of the machine

When Enable Inductance Override is True, this value overrides the direct axis inductance value defined in the Machine Model File [JSON] table. When Enable Inductance Override is False, this channel is not used.

This value can be modified while the simulation is running.

Enable Permanent Magnet Flux Linkage Override

 

Input

 

False

Enables the Flux Linkage Override channel, allowing the user to modify the permanent magnet flux linkage of the machine while the simulation is running.

When True, the flux linkage of the machine is read from the Flux Linkage Override channel.

When False, the flux linkage is read from the table in the Machine Model File [JSON].

Enable Inductance Override

 

Input

 

False

Enables the Direct Inductance Override and Quadrature Inductance Override channels, allowing the user to modify the inductances of the machine while the simulation is running.

When True, the inductances of the machine are read from the  Direct Inductance Override and Quadrature Inductance Override channels.

When False, the direct axis and quadrature axis inductances are read from the table in the Machine Model File [JSON].

Enable Resistance Override

 

Input

 

False

Enables the Resistance Phase A Override, Resistance Phase B Override, and Resistance Phase C Override channels, allowing the user to modify the phase resistances of the machine while the simulation is running.

When True, the phase resistances of the machine are read from the Resistance Phase A Override, Resistance Phase B Override, and Resistance Phase C Override channels.

When False, the phase resistances are read from the table in the Machine Model File [JSON].

Permanent Magnet Flux Linkage Override

ψM

Input

Wb

0.25366

Permanent magnet flux linkage of the machine

When the Enable Flux Linkage Override channel is set to True, instead of reading the Flux Linkage from the 2D ψM lookup table defined in the Model File, the machine model will use the following scalar channel value as an input.

When Enable Flux Linkage Override is True, this value overrides the flux linkage value defined in the Machine Model File [JSON] table. When Enable Flux Linkage Override is False, this channel is not used.

This channel value can be modified while the simulation is running.

Quadrature Axis Inductance Override

Lq

Input

H

0.004576

Quadrature-axis inductance of the machine

When Enable Inductance Override is True, this value overrides the direct axis inductance value defined in the Machine Model File [JSON] table. When Enable Inductance Override is False, this channel is not used.

This value can be modified while the simulation is running.

Resistance Phase A Override

Ra

Input

Ω

Read from JSON Model File when Advanced Channels are enabled

Phase A resistance of the machine

When Enable Resistance Override is True, this value overrides the Phase A resistance value defined in the Machine Model File [JSON]. When Enable Resistance Override is False, this channel is not used.

This channel value can be modified while the simulation is running.

Resistance Phase B Override

Rb

Input

Ω

Read from JSON Model File when Advanced Channels are enabled

Phase B resistance of the machine

When Enable Resistance Override is True, this value overrides the Phase B resistance value defined in the Machine Model File [JSON]. When Enable Resistance Override is False, this channel is not used.

This channel value can be modified while the simulation is running.

Resistance Phase C Override

Rc

Input

Ω

Read from JSON Model File when Advanced Channels are enabled

Phase C resistance of the machine

When Enable Resistance Override is True, this value overrides the Phase C resistance value defined in the Machine Model File [JSON]. When Enable Resistance Override is False, this channel is not used.

This channel value can be modified while the simulation is running.

Model Description

Permanent Magnet Synchronous Machines are common electrical machines in the the automotive and transportation industry. The PMSM is usually chosen because of its excellent power density (produced power over size or weight) or its capability to reach higher speed than other machine types. However, controlling a PMSM is usually more challenging when compared to other machine types. Since it is a synchronous machine, the controller must be aware of the rotor position at all times in order to properly control the torque. In addition, there is a chance of de-fluxing the magnet if the control is not stable, which would lead to a modification of the machine properties. 

The following figures illustrate the equivalent circuits of the PMSM machine model in the abc frame and in the dq frame.

Figure 1. Electrical model for the PMSM in the three-phase domain (left) and in the dq reference frame (right)

General Equation

The equation of the PMSM model can be expressed as follows:

(1)

where Labc is the time-varying inductance matrix (global inductance for Constant Ld/Lq and Variable Ld/Lq models), Iabc is the stator current inside the winding, Rabc are the stator resistances and Vabc is the voltage across the stator windings. ψabc defines the magnet flux linked into the stator windings.

Electrical Angle

The electrical angle is expressed as follows:

(2)

Reference Frame Transformation

A Park-Clarke transformation, described below, is applied to the three-phase (abc) signals to obtain a direct-quadrature (dq) rotating reference frame locked to the Electrical Angle, θe. An offset may be applied to the transform angle using the DQ Transform Angle Offset parameter, θoffset.

(3)

The transformation reduces sinusoidal varying quantities of inductances, flux, current, and voltage to constant values in the dq frame, thus greatly facilitating the analysis and control of the device under study.
It is important to note that there are many different types of transforms and this often leads to confusion when interpreting the machine states in the dq frame. The one used here, which is typically standard in Japan, presents the advantage of being orthonormal (notice the  factor). This particular orthonormal transform is power-invariant, meaning that the power computed in the dq frame by performing a dot product of currents and voltages is equivalent to the one computed in the three-phase domain, namely:

The principle of the reference frame transformation is illustrated in Figure 2. Consider a fixed, three-phase reference frame abc with all machine quantities rotating at the electric frequency ω. If we observe these quantities in a dq frame rotating at the same speed, the quantities will remain constant. In this figure, the angle θ represents the angular position of the rotating frame, whose d-axis is aligned with Phase A at t = 0. This indicates that the DQ Transform Angle Offset is 0°. The back-EMF voltage Vbemf directly follows the q-axis because the magnet flux is aligned with the d-axis by definition. The machine current I leads Vbemf  and the q-axis by an angle called β.

 

Figure 2: abc to dq reference frame transformation

Torque

For the transform described in and , the Electromagnetic Torque can be expressed by , where pp is the number of Pole Pairs and  is the partial derivative of the instantaneous permanent magnet flux.

If the back EMF of the machine is sinusoidal, as is the default case for PMSM machines, the torque can be further simplified into

Because this model uses the orthonormal abc to dq transform, and do not contain the factor typically present in other PMSM torque equations.

Power

The instantaneous active and reactive power, P and Q, are calculated in the model as follows:

where Va, Vb, and Vc are the instantaneous stator voltages.

The results are processed through low-pass filters before being written to the Three-Phase Active Power and Three-Phase Reactive Power channels. The cutoff frequency of the filters is calculated as follows, where Ts is the machine timestep. If the machine timestep is 120ns, for instance, the cutoff frequency is 133Hz.

DQ Voltage

Because the Reference Frame Transformation is power invariant, the values of P and Q calculated in the phase domain are equivalent to those calculated in the dq frame, as summarized in equation . As a result, we can use the set of equations below to approximate the Direct Axis Stator Voltage and Quadrature Axis Stator Voltage. Unlike the other machine quantities, which are computed as part of the machine model on the FPGA, the calculations for Vd and Vq are performed on the Real Time CPU.

Back-EMF Characteristics

The default shape of the back EMF voltage of the machine is dependent upon the selected Machine Type. Both the PMSM Constant Ld/Lq and the PMSM Variable Ld/Lq generate a sinusoidal back EMF by default, while the BLDC Constant Ls generates a trapezoidal signal. The back EMF profile shape of all three machine types can also be customized by setting Back EMF Profile to User-Defined and specifying a Back EMF File [JSON] file.

In the case of the BLDC Constant Ls, the default trapezoidal back EMF shape is constructed from a cosine table as described in the equation below, where λm is the Permanent Magnet Flux Linkage and H is the Back EMF Flat Area in degrees.

 

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter