Skip to main content
emobility.academy
PhDMotor drivesResearch About 14 weeksMATLAB & Simulink

MTPA and Flux-Weakening Lookup-Table Generation with Loss Minimisation

Generate id/iq current-reference lookup tables for an interior PMSM by numerical optimisation that minimises total loss, including iron loss and magnetic saturation, subject to current and voltage limits. Compare them with classical MTPA and field-weakening tables over a drive cycle.

Tools: MATLAB · Simulink · Optimization Toolbox

MTPA and Flux-Weakening Lookup-Table Generation with Loss Minimisation: Students handling a two-wheeler BLDC hub motor at DIYguru
Representative photo from DIYguru's EV lab, not of this specific project.

The problem

Classical MTPA tables minimise current, not loss, and assume constant inductances. Real traction motors saturate heavily, and at high speed iron loss matters as much as copper loss, so loss-minimising references can give better efficiency. Production inverters use lookup tables calibrated from such optimisations, and the method and its benefit are worth quantifying.

Objectives

  • Build a saturation-aware IPMSM model from flux-linkage maps.
  • Formulate loss-minimising current references as a constrained optimisation.
  • Generate tables over torque and speed, including field weakening and MTPV regions.
  • Compare with classical constant-inductance MTPA tables.
  • Validate in a drive simulation and over a drive cycle.

What you need

Tools and toolboxes

  • MATLAB — Loss model, optimisation loops, table generation and plotting.
  • Optimization Toolbox — fmincon with non-linear constraints for each torque–speed point.
  • Simulink — Drive simulation with lookup-table references and a vehicle model.
  • Simscape Electrical — FEM-Parameterized PMSM block or flux-map-based machine for validation.

Software

  • MATLAB R2023b or later
  • Optimization Toolbox
  • Simulink
  • Simscape Electrical

Extra parts and data

  • Flux-linkage maps ψd(id, iq), ψq(id, iq) and iron-loss data for an IPMSM — Saturation and loss modelling need machine data, from a published motor, a documented FEA study or a motor test bench.

Key concepts

Flux-linkage maps
Tables of d- and q-axis flux linkage against id and iq that capture saturation and cross-saturation; torque is Te = 1.5·p·(ψd·iq − ψq·id).
Loss-minimising control
Choosing id and iq to minimise copper plus iron loss for a given torque and speed, rather than minimising current magnitude alone.
Iron loss model
A model such as Bertotti's, with hysteresis, eddy-current and excess terms, applied to flux density derived from flux linkage and frequency; often represented by equivalent iron-loss resistances.
Constrained optimisation
fmincon minimises an objective subject to equality (torque) and inequality (current circle, voltage limit) constraints, and needs good initial guesses to converge reliably.

Step-by-step guide

  1. 1

    Assemble machine data

    Obtain flux-linkage maps and iron-loss data for an IPMSM from a published machine, FEA or test data. Choose a DC-link voltage, current limit and maximum speed consistent with the machine, labelled as example values. Fit or interpolate the maps with griddedInterpolant so ψd, ψq and their derivatives can be evaluated anywhere in the current range. Record the source and any licence terms for the data.

    Checkpoint: Interpolated maps reproduce source points exactly and are smooth between them, with torque from the maps matching source torque data.

  2. 2

    Build the loss model

    Write functions for copper loss 1.5·Rs·(id² + iq²) with temperature-dependent Rs, and iron loss as a function of frequency and flux linkage using fitted coefficients. Add mechanical loss as a speed polynomial. Check each component against any published loss data for the machine. Note which effects the model leaves out, such as PWM harmonic loss and magnet eddy-current loss, so later comparisons are interpreted correctly, and keep all coefficients in one parameter file.

    Checkpoint: Loss components at sample points match published or FEA values within a stated tolerance.

  3. 3

    Formulate the optimisation

    For each torque and speed point, minimise total loss over id and iq subject to: torque equals the demand, √(id² + iq²) ≤ Imax, and the steady-state voltage including resistive drop is at most a margin below Vdc/√3. Write the objective and constraints as functions and supply analytic gradients where possible for speed and reliability. Scale the variables so that fmincon sees values of similar size.

    Checkpoint: Optimisation converges at a set of test points with constraints satisfied to tolerance.

  4. 4

    Generate the tables

    Sweep a torque–speed grid, using the solution at the neighbouring point as the initial guess to avoid jumping between local minima. Mark infeasible points. Repeat for two or three DC-link voltages, or normalise speed by voltage. Plot id and iq tables and check for smoothness, since discontinuities cause torque disturbances in the drive. Save the solver exit flags with the tables so that failed points can be found later.

    Checkpoint: Smooth id and iq surfaces over the feasible region, with the infeasible boundary matching the expected envelope.

  5. 5

    Generate classical baseline tables

    Compute classical MTPA and voltage-limited references using constant inductances fitted at rated current, as many textbook designs do. Also compute current-minimising references with the full flux maps to separate the effect of saturation from the effect of including iron loss. Use the same torque–speed grid and constraints for all three sets so that any difference comes only from the method, not from the grid or limits, and store each set in the same file format.

    Checkpoint: Three table sets ready: constant-inductance MTPA, saturation-aware minimum current, and loss-minimising.

  6. 6

    Compare offline

    Evaluate actual torque and loss for each table set using the full flux maps and loss model. Plot loss difference maps over torque–speed, and torque error maps for the constant-inductance tables, which may not deliver the commanded torque on a saturated machine. Report the average and maximum saving, and also the saving weighted by the time a drive cycle spends in each region, because a large saving in a rarely used region matters little for range.

    Checkpoint: Maps of loss saving and torque error, with the regions of largest benefit identified.

  7. 7

    Validate in a drive simulation

    Implement the tables in a Simulink FOC drive using 2-D Lookup Table blocks feeding current controllers, with the plant from the Simscape Electrical FEM-Parameterized PMSM block or a flux-map motor model. Command torque steps at several speeds and verify delivered torque, current and voltage stay within limits. Check transitions between table cells during fast torque ramps, because interpolation between distant solutions can produce brief torque or voltage errors that a steady-state check would miss.

    Checkpoint: Delivered torque matches demand within a stated tolerance and voltage never exceeds the limit.

  8. 8

    Drive-cycle evaluation

    Connect the drive to a vehicle model and run WLTP and MIDC with each table set. Log motor loss energy and total energy per kilometre. Use parsim or a sim() loop to run all combinations, and report the energy saving with a breakdown of copper and iron loss. Keep the vehicle model, motor plant and controller gains the same for every run so that only the reference tables change between the compared cases.

    Checkpoint: Energy and loss breakdown for every table set and cycle in one table.

  9. 9

    Sensitivity and robustness

    Vary magnet temperature (scaling the permanent-magnet flux), winding temperature and DC-link voltage, and check how the tables perform when they were generated for nominal conditions. Show whether temperature-compensated tables are needed and how much benefit is lost without them. Generate a second table set at a hot condition and test interpolation between the two to show whether two sets are enough, and report the remaining torque error and loss penalty.

    Checkpoint: Sensitivity results showing how loss saving and torque accuracy change with temperature and voltage.

  10. 10

    Publishable write-up

    Document data sources, models, optimisation formulation, table generation method, offline comparison, drive validation, cycle results and sensitivity. Release scripts and, where licences allow, data. Be clear about which gains come from saturation modelling and which from including iron loss. Present the main saving with its uncertainty, compare it with published results for similar machines, and describe how the method could be calibrated on a dynamometer for a real motor.

    Checkpoint: A chapter or paper draft with reproducible results and a separated attribution of the benefits.

Testing & validation

  • Interpolated maps reproduce source data.
  • Optimisation converges with constraints satisfied.
  • Table smoothness checked over the feasible region.
  • Delivered torque and voltage limits verified in drive simulation.
  • Drive-cycle energy comparison and sensitivity study.

Expected results

Loss-minimising current-reference tables for a saturated IPMSM, with a quantified comparison against classical MTPA tables in torque accuracy, loss maps and drive-cycle energy, plus a sensitivity analysis.

Research angle for your PhD

Research questions: how much drive-cycle energy does loss-minimising control save over current-minimising MTPA on a saturated IPMSM, how much of that saving comes from saturation modelling versus iron-loss inclusion, and how robust is it to temperature? Metrics: loss maps, torque error, cycle energy, and sensitivity. Baselines: constant-inductance MTPA and saturation-aware minimum-current references. Machine data from a published motor or documented FEA is essential. A careful, reproducible attribution of savings with temperature sensitivity is a credible journal or conference contribution.

Take it further

  • Add inverter losses to the objective to minimise system loss.
  • Generate temperature-indexed tables and test online interpolation.
  • Include PWM harmonic iron loss in the objective.
  • Replace fmincon with a faster method suitable for online use.

Viva and review questions

Why does minimising current not minimise loss?

Iron loss depends on flux and frequency, and at high speed adding negative id reduces flux and iron loss even though it increases current and copper loss slightly.

Why use the previous solution as the initial guess?

The problem can have several local minima; continuation from a neighbouring point keeps the solution on one smooth branch and gives smooth tables.

Why might constant-inductance tables deliver the wrong torque?

Saturation reduces the real inductance and changes the flux linkage, so the actual torque for a given id and iq differs from the value predicted with constant inductances.

Learn it at DIYguru

These DIYguru courses and programmes teach what this project needs.

Related EV projects

All 100 MATLAB & Simulink EV projects