Main Content

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

R2026b
Since R2026b

This example shows the gain scheduling implementation of a non-linear PMSM.

The non-linear behavior of impedance maps results in different operating points (speed and torque) behaving differently because perceived inductance values change. That is, their settling and rise times vary and the stability margins also change.

Scheduled gains that are computed dynamically from the live impedance values produce predictable behavior of the motor system at all operating points.

Workflow Context: This example is part of the electric vehicle (EV) motor control workflow for non-linear PMSMs. Execute this after generating flux tables and reference current LUTs (see DetermineRefCurrentsPMSMUsingTestDataExample).

Why Gain Scheduling Is Necessary

The current control loop plant for the d-axis and q-axis has the form:

Gd(s)=1Rs+s⋅Ld(id,iq),Gq(s)=1Rs+s⋅Lq(id,iq)

In a non-linear PMSM, Ld and Lq are functions of the operating currents because of magnetic saturation. A proportional-integral (PI) controller tuned at one operating point can produce:

  • Excessive overshoot where inductance is lower than the tuning point (plant gain is higher)

  • Sluggish response where inductance is higher than the tuning point (plant gain is lower)

Gain scheduling addresses this by recomputing PI gains at each operating point in the torque-speed envelope so that the closed-loop dynamics remain uniform.

Current Loop PI Gains

Based on the implementation of the simulation model, the id and iq loops use gains from either dynamically computed values or fixed precomputed gain values. You can observe the differences in the responses with differing torque values for fixed gains. However, scheduled gains produce the same response.

The function mcb.calcFOCGains computes the PI controller gains using the modulus optimum tuning criterion internally. For gain scheduling, substitute the local inductance values and evaluate this function at each operating point:

% Example: computing gains at a specific operating point
% motor_local = pmsm;
% motor_local.Ld = Ld_inc(id_op, iq_op);  % incremental inductance at (id, iq)
% motor_local.Lq = Lq_inc(id_op, iq_op);
% PI_local = mcb.calcFOCGains(motor_local, Ts_pwm, Ts_speed);

The resulting Kp and Ki values form 2-D lookup tables indexed by the operating currents ($i_d^,i_q^$), which correspond to the commanded torque and speed.

Cross-Coupling and Settling Behavior

The d-axis voltage equation is:

vd=Rs⋅id+Lddiddt-ωe⋅Lq⋅iq

When you use the modulus optimum method to compute the PI controller gains, the id loop shows longer settling times because iq⋅ω⋅Lq appears as the disturbance term in the id equation. To improve convergence, deviate from the modulus optimum and increase Ki to accelerate tracking of the reference currents.

Apparent vs. Incremental Inductance

For a motor that has flux linkage maps, two inductance definitions are relevant:

  • Apparent inductance — Lapp=λ/i. Used in steady-state models and for maximum torque per ampere (MTPA) and field-weakening control (FWC) computation.

  • Incremental inductance — Linc=∂λ/∂i. Used for dynamic response to small-signal changes and PI gain computation.

Incremental inductance maps are the derivative of flux linkage with respect to the current. These maps indicate the motor dynamic response to small-signal changes and are best suited for computing PI controller gains. Apparent inductance is the ratio of flux linkage and current, primarily used in steady-state models for MTPA and FWC.

The interactive figure in this example overlays both inductance types so you can observe how they diverge under saturation and compare the resulting controller performance.

Open and Run the Simulation Model

Load the example data and open the Simulink model:

PMSMGainSchedulingExampleData;
    2.9410    0.0020
    6.2742    0.0020
   45.4105    7.1829

          p: 6
         Rs: 0.0020
    I_rated: 283
       V_dc: 500
          J: 0.1730
          B: 1.0000e-03
         Ld: 1.5000e-04
         Lq: 3.2000e-04
     FluxPM: 0.0811
    PMSMLUT: [1×1 struct]
     N_base: 4910
      N_max: 20020
    T_rated: 220.2319

         V_dc: 500
    ISenseMax: 566
      R_board: 0

    V_base: 288.6751
    I_base: 566
    N_base: 4910
    P_base: 2.4509e+05
    T_base: 413.1234

              Ti_i: 0.1600
              Kp_i: 6.2742
              Ki_i: 39.2136
             Ti_id: 0.0750
             Kp_id: 2.9410
             Ki_id: 39.2136
          Ti_speed: 0.0095
          Kp_speed: 45.4105
          Ki_speed: 4.7886e+03
    delay_Currents: 1
    delay_Position: 1
open_system('PMSMGainSchedulingModel');

The model contains:

  • Control System → Torque Control → Current_Controllers: PI controllers for d-axis and q-axis, each with a SelectKp variant subsystem that switches between fixed and scheduled gains

  • computePIgains subsystem: Computes scheduled Kp, Ki from the current feedback (id, iq) using incremental inductance lookup tables

  • Fixed gains / Scheduled gains toggle: Click Fixed gains or Scheduled gains to compare performance

  • Signal Editor: Provides predefined speed-torque loading patterns

Running with Fixed Gains

  1. Click Fixed gains.

  2. Run the simulation. Observe that the current transient response varies with the torque operating point. At some points, the response is well-damped; at others, it overshoots.

Running with Scheduled Gains

  1. Click Scheduled gains.

  2. Run the simulation. Observe that the transient response is now consistent across operating points — the computePIgains subsystem adjusts Kp and Ki based on the actual id, iq feedback.

Using the Interactive Inspection Tool

To compare the id and iq settling behaviors when fixed and scheduled gains are used, run the script file to generate the interactive figure:

GainSchedulingInspectionPlot;
Computing the drive characteristics.
Done.
Precomputing gain schedules...
Done precomputing gains.

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 is empty. Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 4 objects of type patch, line. One or more of the lines displays its values using only markers

The tool opens a figure window with two tabs: Interactive Plot and Help.

Controls

  • Click envelope (left panel, gray region) — Select an operating point (torque, speed).

  • "Select the axis" (bottom-center radio buttons) — Switch between d-axis and q-axis current loop.

  • "Pick the plot type" (bottom-center radio buttons) — Switch between Step Response and Bode plot.

  • "Apparent Inductance" (bottom-right check box) — Show or hide traces computed with Lapp=λ/i.

  • "Incremental Inductance" (bottom-right check box) — Show or hide traces computed with Linc=∂λ/∂i.

How to Use

  1. Click in the gray torque-speed envelope on the left panel. A red cross-hair marks the selected operating point. The right panel updates with the controller response at that point.

  1. Start at a low-torque point (for example, 20 N·m, 1000 rpm). Note the step response. Next, click a high-torque point (for example, 120 N·m, 1000 rpm). Compare how the fixed-gain response degrades while the scheduled-gain response remains consistent.

  1. Move across the field-weakening region (high speed). Observe that inductance drops further due to saturation, amplifying the gain mismatch for fixed controllers.

  1. Toggle between d-axis and q-axis to see how each axis is affected differently by saturation and cross-coupling.

  1. Switch to Bode plot to examine open-loop gain and phase margin. Observe how bandwidth and phase margin shift with operating point under fixed gains but remain stable under scheduled gains.

Interpreting the Results

Step Response

The right panel shows the closed-loop step response of the current loop (normalized: i/i*). The following four traces can appear:

  • Red (solid) — Fixed gains, apparent inductance plant.

  • Cyan (solid) — Scheduled gains, apparent inductance plant.

  • Green (dashed) — Fixed gains, incremental inductance plant.

  • Magenta (dashed) — Scheduled gains, incremental inductance plant.

The legend shows the overshoot percentage for each trace. The figures from 0 N·m to 140 N·m compare the id settling behavior at different torque loads.

What to look for:

  • Consistent overshoot (~4%) across operating points → Gain scheduling is working correctly

  • Overshoot increasing at high torque → Fixed gains are too aggressive (inductance dropped)

  • Sluggish response at low torque → Fixed gains are too conservative (inductance is higher)

  • Magenta and cyan diverging → apparent and incremental inductances differ significantly; incremental inductance is more representative of actual dynamics

Bode Plot

Switch to "Bode" to see the open-loop frequency response (magnitude and phase):

  • 0 dB crossover frequency → Controller bandwidth. Remains consistent with scheduled gains.

  • Phase at crossover → Phase margin. Values below 30° indicate marginal stability.

  • Fixed gains at different operating points → Crossover frequency and phase margin shift. This is the problem that gain scheduling solves.

Worked Examples: Interpreting Specific Operating Points

The following code generates step responses at representative operating points to show the gain scheduling behavior. Examine each figure and the accompanying analysis.

Case 1: Low Torque, Low Speed (T=20 N·m, 2000 rpm) — d-axis

% Click at low torque operating point
hFig = findobj('Name','Current Control Gain Scheduling Inspector');
cd_i = hFig.UserData;
ax_map = cd_i.ax_map;
cbk = get(ax_map, 'ButtonDownFcn');
% Ensure d-axis and step response are selected
set(cd_i.hRadioD, 'Value', 1); set(cd_i.hRadioQ, 'Value', 0);
set(cd_i.hRadioStep, 'Value', 1); set(cd_i.hRadioBode, 'Value', 0);
cd_i.hBtnGrp.SelectionChangedFcn([], []);
evt.IntersectionPoint = [2000, 20, 0];
cbk(ax_map, evt); drawnow;

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — d-axis @ T=20.0 N·m, w=2000 RPM, xlabel Time [ms], ylabel i_d/i_d^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(0.3%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.3%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure 1: Closed-loop d-axis current step response at T=20 N·m, 2000 rpm. The left panel shows the selected operating point (red cross-hair) in the motor torque-speed envelope. The right panel shows normalized step response (id/id*) comparing fixed-gain (red, green) and scheduled-gain (cyan, magenta) controllers using apparent and incremental inductance models.

Inference: At this light-load operating point ($i_d^ = -1.90A,i_q^ = 27.05$ A), the motor core is minimally saturated. Observe that:

  • The fixed-gain traces (red, green) show ~0.3% overshoot — essentially overdamped. A prior tuning step set these gains at a nominal operating point with lower inductance, so here (where inductance is relatively high) the controller is conservative and slow to respond.

  • The scheduled-gain traces (cyan, magenta) show ~4.3% overshoot — the target response for modulus optimum tuning. The scheduler increases the gains to match the higher local inductance, yielding faster rise time.

  • All four traces converge to a similar settling time (~0.8 ms), but the scheduled gains achieve faster rise time (reaching 90% in ~0.25 ms vs. ~0.5 ms for fixed).

  • Apparent and incremental inductances are nearly identical at this light-load point (red ≈ green, cyan ≈ magenta), because saturation is minimal. This confirms that at low saturation, the choice of inductance type has negligible effect.

Case 2: High Torque, Low Speed (T=140 N·m, 2000 rpm) — d-axis

evt.IntersectionPoint = [2000, 140, 0];
cbk(cd_i.ax_map, evt); drawnow;

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — d-axis @ T=140.0 N·m, w=2000 RPM, xlabel Time [ms], ylabel i_d/i_d^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(1.8%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.3%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure 2: Closed-loop d-axis current step response at T=140 N·m, 2000 rpm. The operating point is near rated torque where significant magnetic saturation occurs. The divergence between solid (apparent) and dashed (incremental) traces reveals the effect of inductance definition on predicted dynamics.

Inference: At rated torque ($i_d^ = -46.58A,i_q^ = 176.28$ A), the motor core is heavily saturated. Observe that:

  • The fixed-gain (apparent) trace (red) shows 1.9% overshoot — the response has become faster than in the low-torque case (Figure 1) because saturation reduced apparent inductance, effectively increasing the plant gain seen by the controller.

  • The fixed-gain (incremental) trace (green) is noticeably slower (~0.3% overshoot) — incremental inductance at this operating point is higher than apparent inductance, revealing that the small-signal plant is slower than the apparent model suggests. This is a critical insight: the apparent model overestimates how fast the plant responds.

  • The scheduled-gain traces (cyan, magenta) maintain consistent 4.3% overshoot regardless of operating point — the controller has adapted to local conditions.

  • The divergence between red and green (and between cyan and magenta) indicates that apparent and incremental inductances differ significantly at this high-saturation point. This is the operating region where selecting the correct inductance type matters most for accurate controller design.

Case 3: Field-Weakening Region (T=80 N·m, 8000 rpm) — d-axis

evt.IntersectionPoint = [8000, 80, 0];
cbk(cd_i.ax_map, evt); drawnow;

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — d-axis @ T=80.0 N·m, w=8000 RPM, xlabel Time [ms], ylabel i_d/i_d^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(0.3%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.3%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure 3: Closed-loop d-axis current step response at T=80 N·m, 8000 rpm (field-weakening region). The operating point requires large negative id injection (id*=-148 A) to reduce flux linkage and satisfy the voltage constraint at high speed. All four traces nearly overlap at this point.

Inference: In the field-weakening region ($i_d^ = -148.00A,i_q^ = 93.93A),thecontrollerinjectsalargenegativei_d$ to reduce flux. Observe that:

  • All traces show similar behavior — the fixed-gain response (red) is barely distinguishable from scheduled (cyan). This occurs because a prior tuning step set the fixed gains near this high-current region where the nominal inductance was computed.

  • The apparent and incremental traces nearly overlap (red ≈ green, cyan ≈ magenta), suggesting that at this particular id, iq combination, both inductance measures converge. The saturation characteristic along this trajectory happens to produce similar apparent and incremental values.

  • The key takeaway: gain scheduling provides insurance — even if the response is acceptable at this particular field-weakening point with fixed gains, other points in the envelope (as seen in Figures 1 and 2) might not be. The gain schedule enables uniform performance everywhere without requiring the engineer to verify each operating point manually.

Case 4: High Torque, Low Speed — q-axis

% Switch to q-axis
set(cd_i.hRadioQ, 'Value', 1); set(cd_i.hRadioD, 'Value', 0);

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — d-axis @ T=80.0 N·m, w=8000 RPM, xlabel Time [ms], ylabel i_d/i_d^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(0.3%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.3%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

cd_i.hBtnGrp.SelectionChangedFcn([], []);
evt.IntersectionPoint = [2000, 140, 0];
cbk(cd_i.ax_map, evt); drawnow;

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — q-axis @ T=80.0 N·m, w=8000 RPM, xlabel Time [ms], ylabel i_q/i_q^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(1.5%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.6%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — q-axis @ T=140.0 N·m, w=2000 RPM, xlabel Time [ms], ylabel i_q/i_q^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(2.2%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(1.3%), Sched/L_{incremental}(4.1%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure 4: Closed-loop q-axis current step response at T=140 N·m, 2000 rpm. To observe the difference in cross-coupling susceptibility between the two axes, compare this figure with Figure 2 (same operating point, d-axis).

Inference: Examining the q-axis at high torque (iq*=176.28 A):

  • The fixed-gain (apparent) trace (red) shows 2.2% overshoot — the q-axis response has changed relative to the tuning point because of Lq reduction under saturation.

  • The fixed-gain (incremental) trace (green) shows 1.3% — the incremental Lq is larger here, making the fixed controller even more conservative from the small-signal perspective.

  • The scheduled traces (cyan, magenta) consistently produce 4.3% overshoot, confirming that the gain schedule is correctly adapting for the q-axis as well.

  • Compared with the d-axis at the same operating point (Figure 2), the q-axis exhibits less dramatic variation between fixed and scheduled gains. The q-axis does not suffer from the ωe⋅Ld⋅id disturbance in the same manner — the q-axis equation contains +ωe⋅λd, which the permanent magnet flux dominates and which varies less with operating point.

Case 4a: Low Torque, Low Speed — q-axis

% Switch to q-axis
set(cd_i.hRadioQ, 'Value', 1); set(cd_i.hRadioD, 'Value', 0);
cd_i.hBtnGrp.SelectionChangedFcn([], []);
evt.IntersectionPoint = [2000, 20, 0];
cbk(cd_i.ax_map, evt); drawnow;

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — q-axis @ T=140.0 N·m, w=2000 RPM, xlabel Time [ms], ylabel i_q/i_q^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(2.2%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(1.3%), Sched/L_{incremental}(4.1%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — q-axis @ T=20.0 N·m, w=2000 RPM, xlabel Time [ms], ylabel i_q/i_q^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(0.3%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.3%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure 4a: Closed-loop q-axis current step response at T=20 N·m, 2000 rpm. At this light-load point, all four traces nearly overlap, indicating minimal effect of inductance variation and gain scheduling on q-axis dynamics.

Inference: At low torque on the q-axis (iq*=27.05 A):

  • All four traces (fixed/scheduled, apparent/incremental) produce nearly identical step responses with ~4.3% overshoot and ~0.5 ms settling time.

  • The fixed gains happen to match the scheduled gains at this point because the nominal tuning inductance is close to the actual local inductance under minimal saturation.

  • Comparing with Figure 4b (same axis, high torque), the performance degradation of fixed gains becomes evident only when saturation increases — the q-axis inductance drops, causing the fixed controller to undershoot the design bandwidth.

  • This figure serves as the baseline: when saturation is absent, gain scheduling is unnecessary. The value of scheduling emerges when you move to greater saturation points (Figures 2, 4b).

Case 5: Bode Plot — Field-Weakening Region (T=80 N·m, 8000 rpm)

% Switch back to d-axis and Bode
set(cd_i.hRadioD, 'Value', 1); set(cd_i.hRadioQ, 'Value', 0);
set(cd_i.hRadioBode, 'Value', 1); set(cd_i.hRadioStep, 'Value', 0);

Figure Current Control Gain Scheduling Inspector contains 2 axes objects and another object of type uitabgroup. Axes object 1 with title CL Step — q-axis @ T=20.0 N·m, w=2000 RPM, xlabel Time [ms], ylabel i_q/i_q^* contains 4 objects of type line. These objects represent Fixed/L_{apparent}(0.3%), Sched/L_{apparent}(4.3%), Fixed/L_{incremental}(0.3%), Sched/L_{incremental}(4.3%). Axes object 2 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

cd_i.hBtnGrp.SelectionChangedFcn([], []);
cd_i.hBtnPlot.SelectionChangedFcn([], []);

Figure Current Control Gain Scheduling Inspector contains 3 axes objects and another object of type uitabgroup. Axes object 1 with title OL Bode — d-axis @ T=20.0 N·m, w=2000 RPM, ylabel |G_{OL}| [dB] contains 4 objects of type line. These objects represent Fixed (L_{apparent}), Scheduled (L_{apparent}), Fixed (L_{incremental}), Scheduled (L_{incremental}). Axes object 2 with xlabel \omega [rad/s], ylabel Phase [deg] contains 4 objects of type line. These objects represent Fixed (L_{apparent}), Scheduled (L_{apparent}), Fixed (L_{incremental}), Scheduled (L_{incremental}). Axes object 3 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

evt.IntersectionPoint = [8000, 80, 0];
cbk(cd_i.ax_map, evt); drawnow;

Figure Current Control Gain Scheduling Inspector contains 3 axes objects and another object of type uitabgroup. Axes object 1 with title OL Bode — d-axis @ T=20.0 N·m, w=2000 RPM, ylabel |G_{OL}| [dB] contains 4 objects of type line. These objects represent Fixed (L_{apparent}), Scheduled (L_{apparent}), Fixed (L_{incremental}), Scheduled (L_{incremental}). Axes object 2 with xlabel \omega [rad/s], ylabel Phase [deg] contains 4 objects of type line. These objects represent Fixed (L_{apparent}), Scheduled (L_{apparent}), Fixed (L_{incremental}), Scheduled (L_{incremental}). Axes object 3 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure Current Control Gain Scheduling Inspector contains 3 axes objects and another object of type uitabgroup. Axes object 1 with title OL Bode — d-axis @ T=80.0 N·m, w=8000 RPM, ylabel |G_{OL}| [dB] contains 4 objects of type line. These objects represent Fixed (L_{apparent}), Scheduled (L_{apparent}), Fixed (L_{incremental}), Scheduled (L_{incremental}). Axes object 2 with xlabel \omega [rad/s], ylabel Phase [deg] contains 4 objects of type line. These objects represent Fixed (L_{apparent}), Scheduled (L_{apparent}), Fixed (L_{incremental}), Scheduled (L_{incremental}). Axes object 3 with title Click within envelope to inspect operating point., xlabel Speed [RPM], ylabel Torque [N·m] contains 5 objects of type patch, line, text. One or more of the lines displays its values using only markers

Figure 5: Open-loop Bode plot of the d-axis current control loop at T=80 N·m, 8000 rpm (field-weakening region). The top panel shows magnitude |GOL| (OL denotes open-loop) in dB; the bottom panel shows phase in degrees. The 0 dB crossover frequency indicates controller bandwidth, and the phase at crossover determines stability margin.

Inference: The Bode plot shows the open-loop frequency response GOL(jω) of the current loop:

  • Magnitude plot (top): All four traces cross 0 dB near 104 rad/s, indicating a bandwidth of approximately 1.5 kHz. The scheduled gains produce a slightly higher crossover frequency, which corresponds to the faster step response observed in Figure 3.

  • Phase plot (bottom): All traces show phase margin between 60°–70° at crossover (phase is approximately −110° to −120° at 0 dB crossing, that is, 60°–70° above −180°). This confirms adequate stability margins for all configurations at this operating point.

  • The key Bode plot insight emerges when you compare this point against a low-torque point — at low torque, the fixed-gain crossover shifts lower (reduced bandwidth, sluggish response as seen in Figure 1), whereas the scheduled-gain crossover remains at the design target. Use the interactive tool to verify this by clicking at T=20 N·m and switching to Bode view.

Key Observations

After exploring multiple operating points with the interactive tool:

  • Fixed gains produce variable transient quality — The step response character (overshoot, settling time) changes across the torque-speed envelope.

  • Scheduled gains maintain uniform performance — The controller adapts to local plant dynamics, providing consistent bandwidth and damping at all operating points.

  • Incremental inductance gives more accurate predictions — The step response computed with Linc better represents actual simulation behavior because the controller operates on small perturbations around the reference.

  • High-saturation regions show the largest discrepancy — At high torque (large iq), apparent and incremental inductances diverge most. This is where gain scheduling provides the most benefit.

  • d-axis is more susceptible to cross-coupling — The ωe⋅Lq⋅iq disturbance affects d-axis settling, especially at high speed and high torque.

Connection to the EV Motor Control Workflow

This example falls in step 1 of the non-linear PMSM workflow:

  • Before this example: Generate flux tables (λd, λq) and optimal reference current LUTs ($i_d^,i_q^$) by using openExample('mcb/DetermineRefCurrentsPMSMUsingTestDataExample').

  • This example: Understand how inductance variation affects controller performance. Use the interactive tool to build intuition about gain scheduling requirements for your motor.

  • After this example: Go to closed-loop simulation with openExample('mcb/FWCWithMTPAOfNonLinearPMSMUsingLUTExample') to verify 4-quadrant operation with the reference current LUTs.

The gain scheduling methodology demonstrated here provides the engineering understanding and tools for incorporating operating-point-dependent gain tuning into your own control implementation.