# LUT based PMSM Control Reference

Generate lookup-table-based control reference currents for field oriented control of permanent magnet synchronous motor

• Library:
• Motor Control Blockset / Controls / Control Reference

## Description

The LUT based PMSM Control Reference block generates the d-axis and q-axis reference currents for field-oriented control and field-weakening control of a permanent magnet synchronous motor (PMSM). The block accepts reference torque and feedback mechanical speed and outputs the corresponding reference current values.

The block uses id(T,ω) and iq(T,ω) lookup tables (LUTs) to generate reference current values. Depending on the input method you use to specify the motor parameters, the block can either generate LUTs or use the data you provide.

You can specify the motor parameters using one of these methods.

• Lumped parameters with Ld, Lq, and FluxPM

This method uses the lumped parameters to compute the id and iq LUTs. The block obtains id and iq for the given ω and T inputs by solving the equations associated with the following curves.

Maximum torque per ampere (MTPA) line (IPMSM),

`${i}_{d}^{2}+\frac{{i}_{d}{\psi }_{m}}{\left({L}_{d}-{L}_{q}\right)}={i}_{q}^{2}.$`

MTPA line (SPMSM), id = 0.

Constant torque trajectory

`${i}_{q}=\frac{T}{1.5{P}_{p}\left({\psi }_{m}+\left({L}_{d}-{L}_{q}\right){i}_{d}\right)}.$`

Current limit curve

`${i}_{d}^{2}+{i}_{q}^{2}={i}_{\mathrm{max}}^{2}.$`

Voltage limit curve

`${\left(\frac{{V}_{DC}}{\sqrt{3}}\right)}^{2}={\left({i}_{d}{R}_{s}-{\omega }_{e}{L}_{q}{i}_{q}\right)}^{2}+{\left({i}_{q}{R}_{s}+{\omega }_{e}{L}_{d}{i}_{d}+{\omega }_{e}{\psi }_{m}\right)}^{2}.$`
• When the motor is operating within the voltage constraints, the block solves for the intersection of MTPA line and constant torque trajectory.

• When the motor is operating beyond the voltage constraints, the block solves for the intersection of voltage constraint curve and the constant torque trajectory.

After computing the id and iq tables from a grid of ω and T values, the block uses interpolation to find idref and iqref for any ω and T inputs that lie within the range of table values. The table values are clipped for ω and T values beyond the boundaries.

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

This method uses an approach similar to the previous method, except that the block updates the values for Ld(id,iq), Lq(id,iq), and FluxPM(id,iq) with every iteration it computes id and iq. The block iterates these computations until the id and iq values converge.

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

Use this option when you want to manually provide the id(T,ω) and iq(T,ω) tables. Typically, you obtain these tables through simulations or dyno tests. You can also generate these tables using the `mcbGenerateTables` function provided with the Motor Control Blockset™ software.

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

Reference torque input value (in Nm) for which the block computes the reference current.

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

Reference mechanical speed value (in rpm) for which the block computes the reference current.

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

### Output

expand all

Reference d-axis phase current (in Amperes).

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

Reference q-axis phase current (in Amperes).

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

## Parameters

expand all

Type of PMSM based on the placement of the permanent magnets.

Type of field weakening control, specified as one of these:

• `CVCP` — Constant voltage constant power (CVCP) control method.

• `CCCP` — Constant current constant power (CCCP) control method.

• `VCLMT` — Voltage and current limited maximum torque (VCLMT) control method.

You can configure this parameter only in surface PMSMs with the motor parameters specified as linear lumped parameters. For all other configurations, the block uses the VCLMT control method.

#### Dependencies

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

Number of pole pairs available in the motor.

Resistance of the stator phase winding (ohms).

Motor parameters that the block uses to generate the control reference currents.

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

• ```Non-linear model with Ld,Lq and FluxPM LUTs``` — Generate current reference using Ld, Lq, and FluxPM lookup tables.

• `Non-linear model with id and iq LUTs` — Generate current reference using id and iq lookup tables.

Linear Model with Lumped Parameters

Stator winding inductance (in henries) 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 (in henries) along the quadrature-axis of the rotating dq reference frame.

#### Dependencies

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

Peak permanent magnet flux linkage (in weber).

#### Dependencies

To enable this parameter, select the ```Linear model with lumped parameters``` option in the Motor parameter input method parameter.

Nonlinear Model with Ld, Lq, and FluxPM Lookup Tables

D-axis current vector used in the Ld, Lq, and FluxPM lookup tables.

#### Dependencies

To enable this parameter, select the ```Non-linear model with Ld, Lq and FluxPM LUTs``` option in the Motor parameter input method parameter.

Q-axis current vector used in the Ld, Lq, and FluxPM lookup tables.

#### Dependencies

To enable this parameter, select the ```Non-linear model with Ld, Lq and FluxPM LUTs``` option in the Motor parameter input method parameter.

D-axis inductance lookup table data.

#### Dependencies

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

Q-axis inductance lookup table data.

#### Dependencies

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

Permanent magnet flux linkage lookup table data.

#### Dependencies

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

Nonlinear Model with id and iq Lookup Tables

Torque reference lookup vector used in id and iq lookup tables (in Nm).

#### Dependencies

To enable this parameter, set Motor parameter input method to ```Non-linear model with id and iq LUTs```.

Rotor speed lookup vector used in id and iq lookup tables (in rpm).

#### Dependencies

To enable this parameter, set Motor parameter input method to ```Non-linear model with id and iq LUTs```.

D-axis current reference lookup table data.

#### Dependencies

To enable this parameter, set Motor parameter input method to ```Non-linear model with id and iq LUTs```.

Q-axis current reference lookup table data.

#### Dependencies

To enable this parameter, set Motor parameter input method to ```Non-linear model with id and iq LUTs```.

Motor Configuration

Viscous damping coefficient Bv of the motor in N·m/(rad/s).

DC bus voltage (volts).

Maximum phase current limit for the motor (amperes).

Unit of the block 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)`.

Torque corresponding to 1 per-unit. See Per-Unit System page for more details.

You cannot configure this parameter. Its value is internally computed using the other parameters.

#### Dependencies

To enable 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 Motor parameter input method to `Non-linear model with id and iq LUTs` and Input units to ```Per-Unit (PU)```.

## Version History

Introduced in R2022b