resistance-inductance-estimation.md
April 9, 2026 · View on GitHub
| Field | Value |
|---|---|
| Title | Electrical Parameters Identification — R and L |
| Type | theory |
| Status | approved |
| Version | 1.0.0 |
| Component | service-electrical-ident |
| Date | 2025-01-01 |
Overview
FOC performance depends directly on accurate stator resistance and inductance . These parameters are used to:
- Design the PI current controller gains (, ).
- Implement feed-forward decoupling of the dq cross-coupling terms.
- Estimate motor temperature from measured (since ).
This identification procedure applies a DC voltage step to the motor aligned on the d-axis and measures the current transient. Alignment to the d-axis suppresses the back-EMF (which only appears on the q-axis), yielding a clean RL circuit step response. Resistance is derived from the DC steady-state, and inductance from the measured time constant.
Prerequisites
| Symbol | Meaning | Unit |
|---|---|---|
| Stator resistance per phase | Ω | |
| Stator inductance (d-axis, ) | H | |
| Electrical time constant = | s | |
| Applied step voltage (d-axis) | V | |
| Steady-state current = | A | |
| Current at time : | A | |
| Sampling frequency | Hz | |
| Sampling period = $1/f_s$ | s | |
| Moving average filter length | samples | |
| Total sample buffer size | samples |
Mathematical Foundation
1. d-Axis Alignment and Back-EMF Suppression
Before applying the voltage step, the motor is aligned to (rotor d-axis aligned with stator -axis). In this condition:
- The back-EMF is .
- The q-axis current is forced to zero: .
- Only the d-axis RL circuit is excited.
The stator d-axis circuit model reduces to:
This is a first-order linear system driven by a unit step of amplitude .
2. RL Step Response
For a step input with zero initial conditions ():
Key properties of this response:
- At :
- At : (essentially settled)
- Slope at :
See: documentation/theory/images/rl_step_response.svg (generated by documentation/tools/generate_plots.gp)
3. Resistance Estimation
Once the current has fully settled to steady state (after $5\tau$):
where is measured from the mean of the last 10% of the sample buffer (to average out noise).
Noise considerations: estimation is straightforward but requires:
- Accurate current sensor calibration (ADC offset error directly biases ).
- Stable (DC bus voltage variation during measurement corrupts the result).
- Sufficient settling time in the buffer ( samples).
4. Inductance Estimation — Time-Constant Method
The time constant is found by identifying the sample index where the current first reaches the 63.2% threshold:
The time constant is then:
and the inductance:
Moving Average Filter Correction
A causal moving average filter of length is applied to the raw current samples before threshold detection:
This FIR filter introduces a lag of samples. The threshold index is corrected:
Without this correction, is overestimated by the filter group delay, leading to an overestimate of .
Filter trade-off: larger reduces noise variance but increases the index correction and requires a corresponding increase in buffer size .
5. Pole Pair Estimation
The number of electrical cycles per mechanical revolution equals the number of pole pairs . During the multi-step alignment sweep, the motor is driven through exactly 12 electrical steps over one full electrical revolution ($2\piC_{mech}N_{steps} = 12C_{rev}$ gives:
or equivalently, the total electrical angle traversed over the full 12-step sweep spans exactly $2\pi electrical = \2\pi/p$ mechanical, so:
where is the measured total mechanical rotation during the sweep.
6. Complete Identification Sequence
1. Drive alignment: rotate field through N_steps to θ_e = 0.
Record encoder offset θ_offset (see alignment theory).
2. Apply step voltage V_step on d-axis (i_q* = 0, v_d = V_step).
3. Sample i_d at f_s = 10 kHz for N_buf samples.
4. Apply moving average filter (length N_avg = 5) to samples.
5. Find steady-state current I_ss from mean of last 10% of buffer.
6. Compute R_s = V_step / I_ss.
7. Find first index n_τ where i_d[n] ≥ 0.6321 · I_ss.
8. Correct for filter delay: n_τ_corr = n_τ − ⌊(N_avg−1)/2⌋ − 1.
9. Compute τ = n_τ_corr · T_s, L_s = R_s · τ [H].
Express L_s in mH: L_s_mH = R_s · n_τ_corr / f_s · 1000.
Block Diagrams
Electrical Identification Signal Flow
graph TD
A[Set θ_e = 0\nAlign rotor to d-axis] --> B[Apply V_step\non d-axis\ni_q* = 0]
B --> C[Sample i_d\nf_s = 10 kHz\nN_buf samples]
C --> D[Moving Average\nFilter\nN_avg = 5]
D --> E[Find I_ss\nmean of last 10%]
D --> F[Find n_τ\nfirst sample ≥ 63.2% I_ss]
E --> G[R_s = V_step / I_ss]
F --> H[n_τ_corr = n_τ − delay]
G --> I[L_s = R_s · n_τ_corr · T_s]
H --> I
RL Step Response — ASCII Approximation
i_d (normalised: I_ss = 1.0)
│
1.0├───────────────────────────────── I_ss = V/R (steady state)
│ ──────────
0.86├──────────────────────/
│ /
0.63├────────────────────/ ← i(τ) = 0.632·I_ss
│ /
│ /
0.39├─────────────────/
│ /
│ /
│ /
0.0├───────────
└───────────────────────────────── samples (n·T_s)
0 τ/T_s 2τ/T_s 5τ/T_s
↑
n_τ (63.2% crossing) — filter delay correction applied
Numerical Properties
| Property | Value / Condition |
|---|---|
| Sampling rate | , |
| Filter length | samples |
| Filter group delay | samples = $200\ \mu\text{s}$ |
| Threshold | $0.6321 \cdot I_{ss} (i.e. \1 - e^{-1}$) |
| range | Nominally $0.1\ \Omega to \50\ \Omega$ (ADC current range) |
| resolution | (one sample step) = depends on |
| min detectable | Approx. (due to filter delay correction) |
| Trigger voltage | must be small enough to avoid magnetic saturation |
Sensitivity Analysis
| Source of Error | Effect on | Effect on |
|---|---|---|
| ADC current offset | Directly biases | Indirect via error |
| variation | Biases | Indirect via error |
| Thermal drift in | Measurement valid at only | — |
| Filter delay not corrected | — | overestimated by steps |
| Insufficient buffer | underestimated | underestimated |
| Magnetic saturation | underestimated | underestimated (nonlinear) |
Worked Example
Motor: , , , , .
Expected results:
At the 63.2% threshold:
The raw crossing occurs at . Filter delay correction: .
The example shows that a very short (5 samples) combined with a 5-tap filter and a 2-sample delay correction can yield significant estimation error. In practice should be at least 15–20 samples for accurate identification.
Limitations & Assumptions
- Assumes: The rotor is aligned to the d-axis (, ). Any rotor motion during identification overlays a back-EMF on the d-axis current.
- Assumes: (surface-mounted PMSM). For interior PMSM, the step must be repeated on both axes if the design requires both and .
- Assumes: Magnetic linearity (no saturation). The identification current must be kept below the saturation current.
- Does not handle: Temperature-dependent variation during operation.
- Does not handle: Identification at running speed where back-EMF cannot be zeroed by alignment alone.
References
- Rauf, A. et al. — "Online Identification of PMSM Parameters Based on Extended Kalman Filter", IEEE Transactions on Industrial Electronics, 2019.
- Underwood, S.J. & Husain, I. — "Online Parameter Estimation and Adaptive Control of PMSM", IEEE Transactions on Industrial Electronics, 2010.
- Texas Instruments Application Report SPRABV5 — Motor Control in Embedded Applications, 2018.