主要内容

Nonlinear PMSM Control Workflow for EV Applications

R2026b
Since R2026b

In high-performance EV traction motors, the permanent magnet synchronous motor (PMSM) magnetic core saturates at high load and high speed. Saturation causes the d-axis and q-axis inductances (Ld, Lq) to vary significantly with operating current. A controller designed for fixed, lumped parameters loses accuracy across the operating envelope. To obtain realistic behavior, represent the motor parameters as 2D lookup tables (LUTs) that give flux linkage or inductance as a function of id and iq.

This workflow shows how to characterize a nonlinear PMSM, generate optimal reference current and gain-scheduled proportional-integral (PI) controller tables, and verify the complete field-oriented control (FOC) system through simulation. The workflow uses the same nonlinear PMSM motor data across all steps. If you have your own motor, run step 1 with your data and transfer the generated tables into step 2.

This workflow does not cover code generation and embedded deployment, hardware-in-the-loop (HIL) verification, thermal derating, or sensorless observer design.

The workflow consists of two steps:

  1. Motor Characterization and Control Parameter Generation: Obtain flux linkage maps from dynamometer tests (physical or virtual), compute optimal reference current LUTs for MTPA, field weakening, and MTPV operation, and derive gain-scheduled PI controller parameters from incremental inductances.

  2. Closed-Loop Nonlinear PMSM Control Simulation: Deploy the reference current LUTs and gain-scheduled controllers into a FOC simulation model and verify 4-quadrant speed-torque operation.

Step 1a: Motor Characterization and Reference Current Generation

This step obtains flux linkage maps (λd(id, iq), λq(id, iq)) and computes optimal reference current LUTs that minimize copper loss across the full speed-torque envelope. The LUTs encode three operating strategies: Maximum Torque Per Ampere (MTPA) below base speed, field weakening to extend the speed range beyond base speed, and Maximum Torque Per Volt (MTPV) in the deep field-weakening region.

You can acquire characterization data by two paths. If you have a motor model from a finite element analysis (FEA) tool but no physical prototype, use the virtual dynamometer path. If you have a motor and test bench available, use the physical dynamometer path.

For more information, see Determine Nonlinear Behavior of PMSM Using Characterization Test Data

Virtual Dynamometer Path (FEA Data)

Use this path if you have flux linkage tables from a finite element analysis tool but no physical motor prototype. Provide the λd and λq tables as functions of id and iq from your FEA tool, then run the virtual dyno simulation. You can also select a plant model variant, a nonlinear PMSM with 2D LUTs or an FEM-parameterized PMSM, to match the fidelity of your FEA source.

The virtual dyno sweeps the id–iq operating plane numerically and records the simulated terminal voltages and currents at each point. The example then processes this data into smooth flux linkage surface maps and computes the optimal reference current LUTs.

Physical Dynamometer Path (Measured Data)

Use this path if you have a physical motor and a test bench. Two dynamometer configurations are supported:

  • Active dynamometer (speed-controlled): The dynamometer drive motor regulates mechanical speed. Inject id, iq reference current pairs and sweep the id–iq operating plane at each speed setpoint.

  • Passive dynamometer (load-only): The dynamometer applies known load torques. Coordinate the id–iq sweeps along constant-torque loci within the voltage limit ellipse and current limit circle.

For both configurations, record terminal voltages, phase currents, rotor position, and mechanical speed at each operating point. After data acquisition, the example processes the measurements into smooth flux linkage surface maps and computes the optimal reference current LUTs.

Step 1b: Current Controller Gain Scheduling

Fixed PI gains tuned at a single operating point perform poorly as motor inductance changes with current. This step derives PI gains (Kp, Ki) at every operating point in the id–iq plane and stores them in a lookup table indexed by speed and torque demand.

Gain computation uses the incremental (differential) inductance, defined as the slope of the flux-current curve at the operating point, rather than the apparent (static) inductance. Incremental inductance captures the local magnetic behavior at saturation and is the correct quantity for the modulus optimum design criterion. At each (id, iq) point, the incremental inductances Ld,inc and Lq,inc feed the modulus optimum calculation to produce the scheduled Kp and Ki values.

The example model includes a toggle to compare fixed gains against scheduled gains. It also provides interactive step response and Bode plots at selectable operating points, with d-axis or q-axis current loop selection.

For more information, see Demonstration of Gain Scheduling with a Non-Linear Permanent Magnet Synchronous Motor (PMSM).

Step 2: Closed-Loop Nonlinear PMSM Control Simulation

This step verifies the complete FOC system using the reference current LUTs and gain-scheduled PI controllers from step 1. Open the example, transfer the LUTs generated in step 1 into the LUT based PMSM Control Reference block, and update the plant model parameterization with the motor flux linkage data.

A toggle switch selects between two operating modes in the example model. In predefined profile mode, speed and torque demand follow pre-programmed time-series patterns for automated, reproducible testing. In interactive mode, on-screen dials enable real-time adjustment of speed reference (−4000 to +4000 RPM) and load torque (−1.1 to +1.1 Nm) during simulation.

Run the simulation to observe speed tracking response, current waveforms following the LUT-generated references, and the operating trajectory in the id–iq plane as the system transitions among MTPA, field weakening, and MTPV regions. A quadrant indicator display confirms correct operation across all four speed-torque quadrants.

For more information, see Field-Weakening Control (with MTPA) of Nonlinear PMSM Using Lookup Table.

Use Custom Motor Data

The default examples use a built-in nonlinear PMSM data set. To run the workflow with your own motor, provide the following data.

ParameterUnitDescription

Flux linkage maps λd(id, iq) and λq(id, iq)

Wb

2D tables as functions of id and iq, from an FEA tool or processed dynamometer measurements

Stator resistance Rs

Ω

Scalar value or temperature-dependent value, from measurement or datasheet

Pole pairs p

—

Integer value from motor specification

DC bus voltage Vdc

V

Nominal operating voltage of the system

Maximum current Imax

A

Continuous and peak ratings from motor and inverter specifications

To substitute your motor data into the workflow, use this procedure:

  1. Run step 1a with your motor data. Replace the default flux tables with your own λd(id, iq) and λq(id, iq) maps.

  2. The example computes optimal reference current tables (id*, iq*) specific to the motor saturation characteristics.

  3. Run step 1b with the same flux data to generate gain-scheduled PI parameters for your motor.

  4. Transfer the outputs to step 2. Copy the generated id* and iq* lookup tables into the LUT based PMSM Control Reference block parameters, and update the plant model parameterization to use the motor flux linkage data.

  5. Run the closed-loop simulation to verify correct operation with your motor.

The reference current tables generated in step 1 are motor-specific. If you replace the default motor data, ensure that the LUT data in step 2 matches the tables generated in step 1. Inconsistent tables between the reference generation and control simulation steps produce incorrect results.

Summary

This table summarizes the workflow steps, the associated examples, and the key outputs from each step.

StepActivityExampleKey Outputs

1a

Motor characterization, flux map extraction, and reference current generation

Determine Nonlinear Behavior of PMSM Using Characterization Test Data

λd, λq tables; id*, iq* LUTs

1b

Current controller gain scheduling using incremental inductance

Demonstration of Gain Scheduling with a Non-Linear Permanent Magnet Synchronous Motor (PMSM)

Scheduled Kp, Ki for d/q current loops

2

Closed-loop control simulation with 4-quadrant operation

Field-Weakening Control (with MTPA) of Nonlinear PMSM Using Lookup Table

Verified 4-quadrant speed-torque operation

See Also

|