When high-torque density brushless motors undergo continuous duty cycles, stator winding temperatures routinely swing from 25°C ambient to over 125°C. Copper exhibits a positive temperature coefficient of resistance of roughly +0.393% per Kelvin. Across a 100°C rise, phase resistance climbs by nearly 40%.
Most field-oriented control (FOC) implementations run on current loop proportional-integral (PI) gains calculated once during bench calibration. Motor control SDKs from Texas Instruments, STMicroelectronics, and NXP provide automated parameter extraction routines in their commissioning software, but those parameters are conventionally written to static configuration headers. When the motor reaches continuous thermal equilibrium under load, that static model breaks down.
The consequence is not just a steady-state measurement offset. Mismatched resistance corrupts the standard pole-zero cancellation used in PI current controller design, degrades closed-loop bandwidth, erodes phase margin, and introduces cross-axis coupling between the direct and quadrature axes. For robotics teams deploying legged platforms or precision direct-drive actuators, this shows up as uncommanded torque ripple, elevated acoustic noise, and unexplained limit cycles during high-load maneuvers.
The Mechanism of Current Loop Gain Degradation
Standard continuous-time field-oriented control models the electrical dynamics of a permanent magnet synchronous motor (PMSM) or brushless DC (BLDC) machine in the rotor-aligned reference frame:
$$v_d = R_s i_d + L_d \frac{d i_d}{dt} - \omega_e L_q i_q$$
$$v_q = R_s i_q + L_q \frac{d i_q}{dt} + \omega_e L_d i_d + \omega_e \lambda_{pm}$$
Here, $R_s$ represents the stator winding resistance per phase, $L_d$ and $L_q$ are the direct and quadrature inductances, $\omega_e$ is the electrical rotor velocity, and $\lambda_{pm}$ is the permanent magnet flux linkage.
When designing the inner current loops, engineers cancel the non-linear cross-coupling terms ($\omega_e L_q i_q$ and $\omega_e L_d i_d$) via feedforward compensation, reducing the plant along each axis to a first-order linear system:
$$G_{plant}(s) = \frac{1}{L s + R_s}$$
To achieve a target closed-loop bandwidth $\omega_{bw}$ (in rad/s), classical loop shaping places the controller zero directly over the open-loop plant pole at $s = -R_s / L$ using a PI controller of the form $C(s) = K_p + K_i / s$:
$$K_p = \omega_{bw} L$$
$$K_i = \omega_{bw} R_s$$
This pole-zero cancellation simplifies the open-loop transfer function $L(s) = C(s) G_{plant}(s)$ to a pure integrator $\omega_{bw} / s$, guaranteeing a theoretical 90-degree phase margin before considering inverter dead-time, PWM update delays, and anti-aliasing filters.
When the physical resistance rises from the nominal cold value $R_{s,0}$ to a hot value $R_{s,hot} = R_{s,0} + \Delta R_s$, the true plant pole shifts to $-(R_{s,0} + \Delta R_s)/L$. Because $K_i$ remains set to $\omega_{bw} R_{s,0}$, the zero at $-K_i/K_p = -R_{s,0}/L$ no longer matches the plant pole.
The mismatch introduces an uncancelled pole-zero dipole into the open-loop response:
$$L(s) = \left( \frac{\omega_{bw} L s + \omega_{bw} R_{s,0}}{s} \right) \left( \frac{1}{L s + R_{s,0} + \Delta R_s} \right) = \frac{\omega_{bw}}{s} \left( \frac{s + \frac{R_{s,0}}{L}}{s + \frac{R_{s,0} + \Delta R_s}{L}} \right)$$
Because the true pole sits further into the left-half plane than the controller zero, the plant introduces phase lag at frequencies below the crossover point. The loop behaves sluggishly at low frequencies, allowing current tracking errors to persist across dynamic torque steps. Simultaneously, feedforward decoupling networks that rely on accurate plant resistance leave residual cross-talk between the $d$ and $q$ channels. The voltage commands generate unintended $d$-axis current transients whenever $q$-axis current ramps up, wasting power as heat and producing noticeable high-frequency torque ripple.
Why Physical Temperature Sensors Fall Short
A common hardware workaround installs a negative temperature coefficient (NTC) or platinum RTD sensor inside the motor casing. While useful for gross thermal protection and shutdown limits, housing-mounted sensors fail to provide the fidelity needed for real-time control parameter adaptation for three fundamental reasons:
- Thermal Time Constants and Spatial Gradients: The thermal time constant between the active copper conductors in the stator slots and a casing-mounted sensor often exceeds 30 to 90 seconds. During heavy acceleration bursts, the copper temperature can jump by 40°C in under three seconds while the external casing thermistor registers barely a 2°C change.
- Mechanical and Reliability Penalties: Routing sensor lines through robotic joints, hollow shafts, or slip rings introduces wiring failure points. Sensor leads in high-current inverter environments are prone to capacitive and inductive switching noise from 20 kHz to 100 kHz PWM edges.
- Manufacturing Variations: Thermistor placement within stator potting compound varies from unit to unit on the production line, causing inconsistent thermal resistance paths that require per-unit thermal calibration curves.
Direct electrical identification using existing current shunts and inverter voltage commands eliminates these physical bottlenecks by extracting the real instantaneous copper resistance directly from the active electrical dynamics.
Online Resistance Identification Techniques
Online parameter identification methods for FOC run as background estimators on the microcontroller alongside the fast 10 kHz to 20 kHz current control loops. Three practical algorithms dominate industrial and robotics literature.
1. Recursive Least Squares (RLS) with Directional Forgetting
Recursive Least Squares reformulates the discrete direct-axis voltage equation into a standard linear regression model:
$$y[k] = \boldsymbol{\varphi}^T[k] \boldsymbol{\theta}[k] + e[k]$$
Where the parameter vector $\boldsymbol{\theta} = [R_s, L_d]^T$ is estimated from the regressor vector $\boldsymbol{\varphi}[k] = [i_d[k], (i_d[k] - i_d[k-1])/T_s]^T$ and the measured voltage $y[k] = v_d^*[k] + \omega_e L_q i_q[k]$.
Standard RLS updates the parameter estimate according to:
$$\mathbf{K}[k] = \frac{\mathbf{P}[k-1] \boldsymbol{\varphi}[k]}{\lambda + \boldsymbol{\varphi}^T[k] \mathbf{P}[k-1] \boldsymbol{\varphi}[k]}$$
$$\hat{\boldsymbol{\theta}}[k] = \hat{\boldsymbol{\theta}}[k-1] + \mathbf{K}[k] \left( y[k] - \boldsymbol{\varphi}^T[k] \hat{\boldsymbol{\theta}}[k-1] \right)$$
$$\mathbf{P}[k] = \frac{1}{\lambda} \left( \mathbf{I} - \mathbf{K}[k] \boldsymbol{\varphi}^T[k] \right) \mathbf{P}[k-1]$$
Under steady-state motor operation where $i_d$ is regulated to zero (non-salient PMSM control below base speed), the regressor vector lacks persistent excitation along the direct axis. A standard forgetting factor $\lambda < 1.0$ causes the covariance matrix $\mathbf{P}$ to grow exponentially, leading to covariance windup and sudden numerical instability.
To prevent windup, practical implementations use directional forgetting, where discounting applies only along directions in the parameter space where new information arrives via non-zero current transients, or periodic sub-milliampere d-axis dither pulses.
2. Model Reference Adaptive System (MRAS)
MRAS structures use the physical motor as the reference model and a discrete state-space formulation as the adjustable model. The error between the measured stator current vector and the predicted current vector drives an adaptation mechanism based on Popov's hyperstability criteria.
For stator resistance identification, the error signal between measured and estimated direct-axis currents generates a tuning law:
$$\epsilon_d = i_d - \hat{i}_d$$
$$\hat{R}s = K{p,mras} \epsilon_d + K_{i,mras} \int_0^t \epsilon_d (\tau) d\tau + R_{s,0}$$
MRAS requires fewer multiply-accumulate (MAC) cycles per update than RLS, making it well suited for 32-bit floating-point MCUs with tight execution budgets, such as ARM Cortex-M4 or TI C2000 devices. However, MRAS stability depends directly on inverter non-linearity compensation. If dead-time voltage drops and IGBT/MOSFET forward conduction drops are unmodeled, the MRAS observer interprets dead-time voltage distortion as an apparent change in winding resistance.
3. Low-Frequency Signal Injection
When a motor runs at zero or low speeds under sustained holding torque, back-EMF is absent, and steady-state voltage drops are dominated by inverter non-linearities. In this regime, injecting a small sinusoidal or square-wave d-axis current signal ($i_d^{inj} = I_{inj} \sin(\omega_{inj} t)$) at a frequency well below the current loop bandwidth (e.g., 50 Hz to 100 Hz) provides persistent excitation without generating net rotor torque.
By measuring the resulting direct-axis voltage command $v_d^*$ and extracting the in-phase component via synchronous demodulation (multiplying by $\sin(\omega_{inj} t)$ and passing through a second-order Butterworth low-pass filter), the resistance is extracted directly:
$$\hat{R}s = \frac{2}{I{inj} T_{window}} \int_{0}^{T_{window}} v_d^*(t) \sin(\omega_{inj} t) dt$$
This decouples thermal estimation from magnetic saturation and cross-coupling errors, providing a steady stream of resistance updates at 5 Hz to 20 Hz.
Experimental Receipts: Cold Calibration vs. Adaptive Tracking
To illustrate the control penalty imposed by thermal resistance drift, the following composite dataset reflects standard dynamometer validation metrics across an automotive-grade 48V, 1.5 kW permanent magnet synchronous actuator. The motor was subjected to a continuous 15 Nm torque profile while stator winding temperatures climbed from 25°C to 125°C over a 20-minute thermal soak.
===============================================================================
THERMAL RESISTANCE DRIFT BENCHMARK (COMPOSITE VALIDATION)
Plant: 48V 8-Pole PMSM | Ld = Lq = 120 uH | Rs(25°C) = 45 mOhm | Rs(125°C) = 63 mOhm
Inverter: 20 kHz PWM, 1.2 us Dead-Time Compensated | Current Loop BW Target: 1200 Hz
===============================================================================
Metric Static Gains (25°C) Adaptive Gain Schedule (RLS)
-------------------------------------------------------------------------------
Cold Phase Margin (25°C) 72.4 deg 72.4 deg
Hot Phase Margin (125°C) 51.8 deg 70.8 deg
Current Loop -3dB BW (Hot) 810 Hz 1180 Hz
Step Settling Time (0-10A) 1.22 ms 0.84 ms
Cross-Axis Current Crosstalk 1.84 A pk-pk 0.31 A pk-pk
Shaft Torque Ripple (Hot) 8.6% of base 2.1% of base
Core Computational Load Base FOC +4.8 microseconds per cycle
===============================================================================
Note: Data represents an illustrative composite derived from standard dynamometer thermal step responses on 48V low-inductance servomotors.
When gains remained frozen at the 25°C baseline, hot operation degraded the effective current loop bandwidth from 1200 Hz down to 810 Hz, while cross-axis coupling increased almost sixfold. By implementing online RLS resistance updates running at 100 Hz in a background task, the controller updated both $K_i$ and the decoupling feedforward matrix, recovering design bandwidth and reducing torque ripple by over 75%.
Discrete-Time Implementation Architecture
Deploying online parameter identification without disrupting the real-time execution of critical control loops requires a dual-rate execution model. Attempting to run covariance matrix updates at the full 20 kHz PWM rate wastes processor cycles and risks numerical underflow.
+-------------------------------------------------------------------------+
| High-Rate Current Loop (Fast Interrupt Service Routine: 10 kHz - 20 kHz)|
| |
| +-----------+ +------------+ +---------+ +---------+ |
| | Clarke / | ---> | Decoupling | ---> | PI Regs | ---> | Space | |
| | Park Xform| | Feedfwd | | (Kp, Ki)| | Vector | |
| +-----------+ +------------+ +---------+ +---------+ |
| ^ ^ ^ |
+---------|-------------------|-----------------|-------------------------+
| | |
| Decimated Signals | Online | Scheduled
| (id, iq, vd, vq) | Updates | Gains
v | |
+-----------------------------|-----------------|-------------------------+
| Low-Rate Estimation Task (Background Thread: 50 Hz - 200 Hz) |
| |
| +-----------------------+ +----------------------------------+ |
| | Dead-Time & Inverter | ---> | Parameter Estimator | |
| | Voltage Compensation | | (RLS / MRAS / Demodulation) | |
| +-----------------------+ +----------------------------------+ |
| | |
| v |
| +----------------------------------+ |
| | Gain Scheduler & Sanity Checks |
| | (Bounds: R_min <= R <= R_max) |
| +----------------------------------+ |
+-------------------------------------------------------------------------+
Step 1: Inverter Non-Linearity Compensation
Before feeding voltage commands into the identification engine, compensate for the non-linear voltage drop across the inverter bridge. Inverter dead-time $t_d$, turn-on delay $t_{on}$, and turn-off delay $t_{off}$ distort the average phase voltage applied to the motor:
$$v_{error} = \text{sign}(i_{phase}) \cdot \left( \frac{t_d + t_{on} - t_{off}}{T_{pwm}} V_{dc} + V_{drop} \right)$$
If this drop is omitted, the parameter identification loop misinterprets the non-linear device conduction voltage as additional stator resistance, skewing the estimate at lower current levels.
Step 2: Signal Filtering and Decimation
Downsample the measured currents $i_d, i_q$ and commanded voltages $v_d^, v_q^$ using a hardware-triggered direct memory access (DMA) buffer or an averaged circular buffer. Passing 20 kHz raw measurements directly into an RLS estimator exposes the identification to PWM-frequency switching ripple. Apply an anti-aliasing finite impulse response (FIR) or second-order IIR filter with a cutoff frequency around 500 Hz before decimation.
Step 3: Directional Updating and Parameter Clamping
Never permit an online estimator to write directly to active current loop gains without strict bounding checks. Define hard physical boundaries based on the known cold motor resistance $R_{s,0}$ and the insulation thermal rating (Class F = 155°C, Class H = 180°C):
$$R_{s,min} = 0.9 \cdot R_{s,0}$$
$$R_{s,max} = (1 + 0.00393 \cdot (T_{max} - 25)) \cdot R_{s,0}$$
If $\hat{R}_s$ falls outside these bounds due to a numerical transient or sensor glitch, clamp the output, flag a diagnostic condition, and revert to the last known valid state. Rate-limit the gain adjustments using a low-pass filter to prevent instantaneous step changes in $K_i$ that could destabilize the integrator state.
Engineering Decision Frame: Selecting an Estimation Method
Choosing the right online identification strategy depends on your application's operating profile, dynamic constraints, and processing headroom.
+-------------------------+----------------------+----------------------+----------------------+
| Criterion | Recursive Least Sq. | MRAS Observer | Signal Injection |
+-------------------------+----------------------+----------------------+----------------------+
| Compute Overhead | High (~500-800 FLOPs)| Low (~80-120 FLOPs) | Moderate (~200 FLOPs)|
| Sensitivity to Inverter | High | High | Low |
| Non-Linearities | | | |
| Dynamic Speed Tracking | Excellent | Good | Poor |
| Static / Holding Torque | Poor (Needs Dither) | Poor | Excellent |
| Parameter Convergence | Fast (5-10 cycles) | Moderate (50 cycles) | Deterministic (Fixed)|
| Memory Footprint | Moderate (Matrices) | Minimal (Scalars) | Minimal (Buffers) |
+-------------------------+----------------------+----------------------+----------------------+
- For high-speed robotic actuators and traction drives that operate across wide speed ranges with frequent torque steps, choose Recursive Least Squares with directional forgetting. The fast parameter convergence tracks thermal dynamics during severe duty cycles.
- For resource-constrained microcontrollers running tight multicopter or gimbal stabilization loops, choose MRAS. The computational footprint is low enough to fit within entry-level MCUs while maintaining current loop margins.
- For direct-drive gimbals, robotic joints holding static positions, and precision positioning stages, use Low-Frequency Signal Injection. It provides rock-solid resistance estimates even when the motor sits completely still under static load.
What this means for LabCD
Modern control engineering requires verifiable stability margins that hold up across the entire physical operating envelope, not just at nominal room temperature. System identification should not be treated as a one-time setup step performed on a cold motor at a workbench.
LabCD integrates dynamic thermal tracking into its plant identification and controller tuning pipelines. Instead of generating a single static PI or state-space gain matrix, the platform identifies the parameter sensitivity boundaries of your motor and power stage. It models how pole locations migrate across thermal transients and automatically synthesizes gain-scheduled and adaptive current controllers with proven gain and phase margins from 25°C to thermal limit.
By unifying parameter estimation, loop shaping, and robust discrete-time verification, control teams can deploy high-performance FOC loops with documented stability receipts across every thermal state.
Direct Answer: Identifying Thermal Resistance Online
To identify stator resistance drift online without external sensors, measure the commanded direct-axis voltage $v_d^*$ and stator currents in the rotor-aligned reference frame, correct for inverter dead-time voltage drops, and process the signals through a discrete estimator (such as Recursive Least Squares with directional forgetting or an MRAS observer) running in a 50 Hz to 200 Hz background thread. Use the estimated resistance $\hat{R}s$ to continuously update the current loop integral gain $K_i = \omega{bw} \hat{R}_s$ and the cross-axis decoupling feedforward matrix, preserving the design bandwidth and phase margin as copper temperatures climb.
Sources
- Texas Instruments: Sensorless Field Oriented Control of 3-Phase Permanent Magnet Synchronous Motors (SPRABY9) - https://www.ti.com/lit/pdf/spraby9
- Texas Instruments: InstaSPIN-FOC and InstaSPIN-MOTION User's Guide (SPRABQ5) - https://www.ti.com/lit/an/sprabq5/sprabq5.pdf
- NXP Semiconductors: MCUXpresso SDK Field-Oriented Control of 3-Phase PMSM (PMSMRT1040) - https://www.nxp.com/docs/en/user-guide/PMSMRT1040-rev0.pdf
- STMicroelectronics: Motor Control Application Solutions - https://www.st.com/en/applications/motor-control.html
- MathWorks: Implement Motor Speed Control by Using Field-Oriented Control - https://www.mathworks.com/help/mcb/gs/implement-motor-speed-control-by-using-field-oriented-control-foc.html