The problem
EV traction motors must deliver constant power over a wide speed range, often three to four times base speed, from a fixed battery voltage. Above base speed the back-EMF exceeds what the inverter can apply, so negative d-axis current must be injected to weaken the effective flux. Doing this robustly, without losing current control or wasting current, is a core design problem in every traction inverter.
Objectives
- Model an interior PMSM with Ld < Lq and its current and voltage limits.
- Implement MTPA current references below base speed.
- Implement a voltage-feedback field-weakening loop above base speed.
- Measure the achieved torque–speed envelope and compare with theory.
- Study stability and transient behaviour at the voltage limit.
What you need
Tools and toolboxes
- Simulink — Controller structure, field-weakening loop, logging and test harness.
- Motor Control Blockset — Clarke, Park, Space Vector Generator and MTPA Control Reference blocks; reference blocks can be replaced by your own lookup tables.
- Simscape Electrical — Interior PMSM block and average or switching inverter model.
- Optimization Toolbox — Optional: fmincon to compute exact MTPA and voltage-limited references offline for comparison.
Software
- MATLAB R2023b or later
- Simulink
- Simscape Electrical
- Motor Control Blockset
Extra parts and data
None beyond the software above.
Key concepts
- Current and voltage limits
- The current vector must stay inside a circle of radius Imax; the voltage limit appears in the id–iq plane as an ellipse centred at (−ψm/Ld, 0) that shrinks as speed rises.
- MTPA
- Maximum torque per ampere: for an IPMSM, Te = 1.5·p·(ψm·iq + (Ld − Lq)·id·iq), so some negative id adds reluctance torque and gives more torque per ampere.
- Voltage-feedback field weakening
- A slow PI loop compares the commanded voltage magnitude with a limit slightly below Vdc/√3 and drives id more negative when the limit is approached.
- MTPV
- Maximum torque per volt: at very high speed the best operating point lies on the voltage ellipse rather than the current circle; it matters when the characteristic current ψm/Ld is inside the current limit.
Step-by-step guide
- 1
Specify the example IPMSM and targets
Choose a labelled example IPMSM for a small car: 350 V DC link, 4 pole pairs, Rs = 0.02 ohm, Ld = 0.15 mH, Lq = 0.4 mH, ψm = 0.07 Wb, Imax = 300 A peak, maximum speed 12000 rpm. Set targets: constant power from base speed to at least three times base speed, and current loops that stay in control at the voltage limit. Compute the characteristic current ψm/Ld and compare it with Imax.
Checkpoint: A parameter script printing base speed, characteristic current and whether MTPV is reachable.
- 2
Compute theoretical limits offline
In MATLAB, sweep id and iq inside the current circle and compute torque and required voltage at each speed. For each speed find the maximum torque that meets both limits, using a dense grid search or fmincon. Plot the theoretical torque and power envelope and the optimal id, iq trajectories in the id–iq plane overlaid with the current circle and voltage ellipses.
Checkpoint: Envelope plot shows constant torque, then near-constant power, and the optimal trajectory follows MTPA then the voltage ellipse.
- 3
Build the base FOC drive
Start from a working FOC drive with Simscape Electrical PMSM block set to the IPMSM parameters, current loops tuned by pole cancellation (Kp = L·ωc, Ki = R·ωc) separately for d and q because Ld and Lq differ, and decoupling feed-forward. Use an average inverter first and a 10 kHz controller rate. Hold the motor speed with an ideal velocity source so you can test any speed directly.
Checkpoint: At low speed id and iq steps settle at their designed bandwidths with small cross-coupling.
- 4
Add MTPA references
Generate the MTPA id–iq pair for each torque command, either from the closed-form MTPA equation for constant inductances, from the MTPA Control Reference block, or from a lookup table built in step 2. Apply torque steps at low speed and compare measured torque per ampere with id = 0 control. Plot the measured operating points on the id–iq plane over the MTPA curve from step 2 to confirm that the references sit on it.
Checkpoint: At rated current MTPA produces measurably more torque than id = 0, matching the offline calculation.
- 5
Add the field-weakening loop
Compute the voltage magnitude from the d and q controller outputs, compare it with a limit of about 0.95·Vdc/√3, and feed the error to a slow PI controller whose output adds negative id to the MTPA reference, saturated at the current limit. Limit iq so the current vector stays within Imax. Keep the field-weakening loop bandwidth well below the current loop bandwidth to avoid interaction.
Checkpoint: At twice base speed the voltage magnitude settles at the limit while id goes negative and the motor still produces torque.
- 6
Measure the achieved envelope
Script a speed sweep with sim(): at each speed command maximum torque, wait for steady state and log torque, id, iq and voltage magnitude. Plot the achieved envelope on the theoretical one from step 2. Investigate any gap, for example voltage margin, resistive drop or loop limits. Also plot the logged operating trajectory in the id–iq plane at each speed, which shows when the drive moves from the current circle onto the voltage ellipse.
Checkpoint: Achieved torque within a few per cent of the theoretical envelope across the speed range.
- 7
Study transients and robustness
Apply fast torque reversals and speed ramps at high speed with the switching inverter. Check for loss of current control, which shows as id and iq drifting away from references while voltage stays saturated. Vary Ld, Lq and ψm by ±20 per cent in the plant while keeping the controller unchanged, and record which cases fail and why. Repeat the worst case with a larger voltage margin to see whether margin alone recovers control.
Checkpoint: A table of robustness cases with pass or fail and the observed failure mode.
- 8
Compare with a feed-forward method
Implement a second approach where id is taken from a precomputed lookup table indexed by torque command and speed divided by DC voltage. Compare the two methods for envelope, transient response and sensitivity to parameter error. Discuss which a production inverter would use and why many use both. Keep the same plant, current controllers and test sequence for both methods so that only the field-weakening logic differs between runs.
Checkpoint: Side-by-side results for feedback and lookup-table methods across the same tests.
- 9
Write up and conclude
Present the limit analysis, controller design, envelope measurement, transient tests and comparison. State the model limits, such as constant inductances, no iron loss and no magnet temperature effects. Give clear recommendations on voltage margin and field-weakening loop bandwidth based on the results. Include the offline limit-analysis script so that readers can regenerate the theoretical envelope for a different motor, and keep all parameter values in one file.
Checkpoint: A report whose envelope, trajectory and robustness plots are regenerated by one script.
Testing & validation
- Offline torque–speed envelope from limit analysis.
- MTPA torque per ampere compared with id = 0 control.
- Voltage magnitude held at the limit above base speed.
- Achieved envelope compared with the theoretical one.
- Robustness to ±20 per cent parameter error documented.
Expected results
A wide-speed-range IPMSM drive model with MTPA and field weakening, a measured torque–speed envelope close to theoretical limits, and a quantified comparison of feedback and lookup-table field-weakening methods.
Research angle for your M.Tech thesis
Research questions: how do voltage-feedback and lookup-based field weakening compare in achievable torque, transient behaviour and sensitivity to inductance and flux errors, and how much voltage margin is really needed? Metrics: envelope shortfall versus theory, torque response time at high speed, current error during transients, and parameter sensitivity. Baselines: id = 0 control with no field weakening and a published voltage-feedback scheme. Validation strengthens with saturation-dependent motor data, for example from FEA, rather than constant inductances. A careful comparison with released models and a clear design rule for loop bandwidth and voltage margin could suit a conference paper.
Take it further
- Add MTPV operation and test at the highest speeds.
- Use saturation-dependent inductance maps instead of constants.
- Add DC-link voltage variation from a battery model and study its effect.
- Run the drive on a WLTP cycle with a vehicle model and log losses.
Viva and review questions
Why is negative id needed above base speed?
Back-EMF rises with speed and reaches the inverter's maximum voltage at base speed; negative id produces a voltage that opposes the magnet flux term, reducing the required voltage so current can still be controlled.
Why must the field-weakening loop be slower than the current loops?
It acts on the outputs of the current loops; if it were as fast, the two would interact and could oscillate.
What is the difference between MTPA and MTPV?
MTPA gives the most torque for a given current and applies when current is the limit; MTPV gives the most torque for a given voltage and applies at very high speed where voltage is the binding limit.
Learn it at DIYguru
These DIYguru courses and programmes teach what this project needs.
