# PMSM Torque Estimator

Estimate electromechanical torque and power

Since R2020a

• Libraries:
Motor Control Blockset / Controls / Control Reference

## Description

The PMSM Torque Estimator block generates electromechanical torque and power estimates to enable field-oriented control of a permanent magnet synchronous motor (PMSM). The block outputs mathematically computed electromechanical torque for the given motor parameters. To measure the torque value accurately, consider using a physical sensor.

The block accepts feedback values of d- and q-axis currents and mechanical speed as inputs.

The block generates these estimates from motor parameters specified using one of these methods.

• Lumped parameters with d-axis and q-axis stator winding inductances and permanent magnet flux linkage.

• Nonlinear model with d-axis and q-axis flux linkage lookup tables.

• Nonlinear model with d-axis and q-axis stator winding inductances and permanent magnet flux linkage lookup tables.

• d-axis and q-axis stator winding inductances and permanent magnet flux linkage values provided using separate input ports.

### Equations

If you select `Per-Unit (PU)` in the Input units parameter, the block scales down the internal parameters to match the per-unit scale by default. You can also configure the block to convert the inputs to SI units before performing any computation and convert them back to per unit values after calculating the output.

These equations describe the computation of electromechanical torque and power estimates by the block.

`${T}_{e}=\frac{3}{2}p\left\{{\psi }_{m}{I}_{q}+\left({L}_{d}-{L}_{q}\right){I}_{d}{I}_{q}\right\}$`

or

`${T}_{e}=\frac{3}{2}p\left({\psi }_{d}{i}_{q}-{\psi }_{q}{i}_{d}\right)$`
`${P}_{\text{e}}={T}_{e}\cdot {\omega }_{\text{m}}$`

where:

• ${L}_{\text{d}}$ and ${L}_{\text{q}}$ are the d-axis and q-axis stator winding inductances (henry).

• ${I}_{\text{d}}$ and ${I}_{\text{q}}$ are the d-axis and q-axis current (amperes).

• ψm is the permanent magnet flux linkage (weber).

• ψd and ψqare the magnetic fluxes along the d- and q-axes (weber).

• $p$ is the number of pole pairs available in the motor.

• ${\omega }_{m}$ is the mechanical speed of the rotor (rad/s).

For a detailed set of equations and assumptions that Motor Control Blockset™ uses for a PMSM, see Mathematical Model of PMSM.

## Ports

### Input

expand all

Current along the d-axis of the rotating dq reference frame.

Data Types: `single` | `double` | `fixed point`

Current along the q-axis of the rotating dq reference frame.

Data Types: `single` | `double` | `fixed point`

Mechanical speed of the rotor.

Data Types: `single` | `double` | `fixed point`

D-axis winding inductance (in henry).

#### Dependencies

To enable this input port, set Motor parameter input method to `Input port based Ld, Lq and FluxPM`.

Data Types: `single` | `double` | `fixed point`

Q-axis winding inductance (in henry).

#### Dependencies

To enable this input port, set Motor parameter input method to `Input port based Ld, Lq and FluxPM`.

Data Types: `single` | `double` | `fixed point`

Peak permanent magnet flux linkage (in weber).

#### Dependencies

To enable this input port, set Motor parameter input method to `Input port based Ld, Lq and FluxPM`.

Data Types: `single` | `double` | `fixed point`

### Output

expand all

Mechanical torque output of the motor.

Data Types: `single` | `double` | `fixed point`

Power output of the motor.

Data Types: `single` | `double` | `fixed point`

## Parameters

expand all

Motor parameters

Number of pole pairs available in the motor.

Motor parameters that the block uses to generate torque and power estimates.

• `Linear model with lumped parameters` — Generate estimates using lumped-circuit values for motor parameters Ld, Lq, and FluxPM.

• `Non-linear model with D,Q-flux linkage LUTs` — Generate estimates using d-axis flux linkage FluxD and q-axis flux linkage FluxQ lookup tables (LUTs).

• `Non-linear model with Ld,Lq and FluxPM LUTs` — Generate estimates using Ld, Lq, and FluxPM LUTs, specified as block parameters.

• `Input port based Ld,Lq and FluxPM` — Generate estimates using Ld, Lq, and FluxPM LUTs, specified as block inputs.

Linear Model with Lumped Parameters

Stator winding inductance (henry) along the direct-axis of the rotating dq reference frame.

#### Dependencies

To enable this parameter, set Motor parameter input method to `Linear model with lumped parameters`.

Stator winding inductance (henry) along the quadrature-axis of the rotating dq reference frame.

#### Dependencies

To enable this parameter, set Motor parameter input method to `Linear model with lumped parameters`.

Peak permanent magnet flux linkage (weber).

#### Dependencies

To enable this parameter, set Motor parameter input method to `Linear model with lumped parameters`.

Nonlinear Model with FluxD and FluxQ Lookup Tables

D-axis current vector used in the following lookup tables, depending on the method used to specify the motor parameters.

• FluxD(id,iq) and FluxQ(id,iq) for the `Non-linear model with D,Q-flux linkage LUTs` method.

• Ld(id,iq), Lq(id,iq), and FluxPM(id,iq) for the `Non-linear model with Ld,Lq and FluxPM LUTs` method.

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with D,Q-flux linkage LUTs` or `Non-linear model with Ld,Lq and FluxPM LUTs`.

Q-axis current vector used in the following lookup tables, depending on the method used to specify the motor parameters.

• FluxD(id,iq) and FluxQ(id,iq) for the `Non-linear model with D,Q-flux linkage LUTs` method.

• Ld(id,iq), Lq(id,iq), and FluxPM(id,iq) for the `Non-linear model with Ld,Lq and FluxPM LUTs` method.

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with D,Q-flux linkage LUTs` or `Non-linear model with Ld,Lq and FluxPM LUTs`.

D-axis flux linkage FluxD(id,iq) lookup table data (in weber).

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with D,Q-flux linkage LUTs`.

Q-axis flux linkage FluxQ(id,iq) lookup table data (in weber).

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with D,Q-flux linkage LUTs`.

Nonlinear Model with Ld, Lq, and FluxPM Lookup Tables

D-axis inductance Ld(id,iq) lookup table data (in henry).

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with Ld,Lq and FluxPM LUTs`.

Q-axis inductance Lq(id,iq) lookup table data (in henry).

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with Ld,Lq and FluxPM LUTs`.

Permanent magnet flux linkage FluxPM(id,iq) lookup table data (in weber).

#### Dependencies

To enable this parameter, set Motor parameter input method to `Non-linear model with Ld,Lq and FluxPM LUTs`.

Input units

Unit of the input values.

Base voltage (in volts) for per-unit system.

#### Dependencies

To enable this parameter, set Input units to `Per-Unit (PU)`.

Base current (in amperes) for per-unit system.

#### Dependencies

To enable this parameter, set Input units to `Per-Unit (PU)`.

Base speed (in rpm) for per-unit system.

#### Dependencies

To enable this parameter, set Input units to `Per-Unit (PU)`.

Base torque (in Nm) for per-unit system. See Per-Unit System page for more details.

You cannot configure this parameter when you set Motor parameter input method to `Linear model with lumped parameters` or `Non-linear model with Ld,Lq and FluxPM LUTs`. The block computes its value using the other parameters.

#### Dependencies

To display this parameter, set Input units to `Per-Unit (PU)`.

Base power (in W) for per-unit system. See Per-Unit System page for more details.

You cannot configure this parameter when you set Motor parameter input method to `Linear model with lumped parameters` or `Non-linear model with Ld,Lq and FluxPM LUTs`. The block computes its value using the other parameters.

#### Dependencies

To display this parameter, set Input units to `Per-Unit (PU)`.

Option to scale down internal parameters to match per-unit scale when generating code.

• When you enable this option, the block scales down the internal constants and coefficients to match the per-unit scale. This allows for higher precision when you use the fixed-point data type. If you use this option with the single or double data type, some precision loss can occur depending on the number of bits allotted to the integer portion.

• When you disable this option, the block converts all the constants and coefficients used for internal calculations to SI units and then converts them back to the PU scale. This allows you to update the lookup table values in the generated code, typically, for applications such as controller tuning or end-of-line operations. You can also update the values manually for debugging or reusing previously generated code.

#### Dependencies

To enable this parameter, set Input units to `Per-Unit (PU)`.

## Version History

Introduced in R2020a