friction-inertia-estimation.md
April 9, 2026 · View on GitHub
| Field | Value |
|---|---|
| Title | Mechanical Parameters Identification — Friction and Inertia |
| Type | theory |
| Status | approved |
| Version | 1.0.0 |
| Component | service-mechanical-ident |
| Date | 2025-01-01 |
Overview
Accurate knowledge of the mechanical plant parameters — rotor moment of inertia , viscous friction coefficient , and Coulomb (static) friction torque — is required to design an optimal speed or position loop, to implement feed-forward compensation, and to estimate system health over time.
This identification procedure uses Recursive Least Squares (RLS) to fit the parameters of Newton's rotational equation of motion to real-time measurements of torque (estimated from ) and speed/ acceleration (derived from the encoder). RLS operates online in every control cycle, converging to the true parameters as the motor is excited with varying speed profiles.
Prerequisites
| Symbol | Meaning | Unit |
|---|---|---|
| Rotor moment of inertia | kg·m² | |
| Viscous friction coefficient | N·m·s/rad | |
| Coulomb friction (static offset) | N·m | |
| Electrical (motor) torque = | N·m | |
| External load torque (treated as disturbance) | N·m | |
| Rotor mechanical angular velocity | rad/s | |
| Rotor angular acceleration = | rad/s² | |
| Parameter vector | mixed | |
| Regressor vector | mixed | |
| RLS forgetting factor | — | |
| Error covariance matrix (3×3) | — | |
| Kalman gain vector (3×1) | — |
Mathematical Foundation
1. Mechanical Equation of Motion
The PMSM rotor dynamics are described by Newton's second law for rotation. Assuming viscous friction and a constant Coulomb friction offset:
Ignoring unmeasured load torque (treated as noise by the estimator), this becomes a linear regression:
where:
The regression form makes the parameter vector directly estimable from measured input-output data using least squares.
2. Batch Least Squares (Background)
If measurements are collected:
where is the torque sequence, is the regressor matrix, and is noise. The ordinary least-squares solution is:
This requires storing all measurements and inverting a 3×3 matrix. RLS computes the same result recursively, processing one sample at a time with cost where is the number of parameters.
3. Recursive Least Squares — Derivation
Define the weighted least-squares cost with exponential forgetting factor :
The exponential weight discounts older measurements, giving the estimator a finite effective memory window of samples.
Applying the matrix inversion lemma (Woodbury identity) to the recursive update of yields:
The scalar is called the innovation (prediction error). The gain weights how much to move the estimate in response to the innovation.
Forgetting Factor
For (no forgetting) the RLS is equivalent to batch LS over the entire history. For older data is exponentially discounted. The effective memory window is:
With : samples. This allows the estimator to track slow parameter variations (e.g. bearing wear increasing ) without diverging from the current plant.
Trade-off: smaller → faster tracking, higher noise sensitivity. At and 1 kHz update rate, the effective window is 500 ms — appropriate for slowly varying mechanical parameters.
4. Torque and Kinematics Estimation
Torque: The motor torque is estimated from the q-axis current:
The torque constant must be known from the electrical identification stage or from the motor datasheet.
Speed: Measured directly from the encoder as:
Acceleration: Estimated by finite difference of speed:
The double finite difference amplifies measurement noise. A low-pass filter (e.g. moving average) on before differentiation reduces this effect at the cost of bandwidth.
5. Convergence Criteria
The algorithm has converged to reliable estimates when:
-
Innovation is small:
This indicates the model fits the data well (low residual error).
-
Gain trace is small:
This indicates the covariance has collapsed (the estimator is no longer updating significantly), i.e. the estimate has stabilised.
The two thresholds in use: and .
The gain trace criterion is a proxy for shrinking, which proves that has converged to a minimum-variance estimate given the data.
6. Observability Requirement
RLS identifies , , and simultaneously only if the regressor matrix is persistently exciting of order 3 — i.e. the columns are linearly independent over the observation window. In practice this requires:
- : the motor must accelerate and decelerate (constant-speed operation cannot identify ).
- must vary over a sufficient range to separate from .
- Both positive and negative torques should appear if possible (else is poorly identified).
A typical identification profile: triangular speed reference — ramp up, hold briefly, ramp down — repeated times.
Block Diagrams
RLS Signal Flow
graph TD
ENC[Encoder θ_m] --> SPD[Speed ω\nfinite difference]
SPD --> ACC[Acceleration α\nfinite difference]
IQ[Current i_q] --> TRQ[Torque τ_e\n= K_T · i_q]
ACC --> REG[Regressor φ\n= [α, ω, 1]]
SPD --> REG
REG --> KG[Gain K\n= P·φ / λ + φᵀPφ]
TRQ --> INN[Innovation e\n= τ_e − φᵀθ̂]
KG --> UPD[θ̂ update\nθ̂ += K·e]
INN --> UPD
REG --> COV[P update\nP = 1/λ·I−Kφᵀ·P]
KG --> COV
UPD --> OUT_J[Ĵ = θ̂[1]]
UPD --> OUT_B[B̂ = θ̂[2]]
UPD --> OUT_T[τ̂₀ = θ̂[3]]
COV --> CONV{Convergence\ncheck}
UPD --> CONV
CONV -->|tr K < ε_K\nAND |e| < ε_e| DONE[Converged]
Effective Memory Window (Forgetting Factor)
Sample weight w[k] = λ^(N-k)
w │
1.0│ ●
│ ●
│ ●
0.5│ ●
│ ●
│ ●
│ ●
0.0└─────────────────────────────→ k (samples into past)
N N-50 N-100 N-200 N-500
↑
N_eff = 500 samples at λ=0.998
(data older than ~500 samples has weight < 0.37)
Numerical Properties
| Property | Value / Condition |
|---|---|
| Parameter vector size | 3: |
| Covariance matrix | $3\times 3$ symmetric positive definite |
| Forgetting factor | |
| Effective window | samples |
| Convergence check | $10^{-4}$ (innovation threshold) |
| Convergence check | $10^{-2}$ (gain trace threshold) |
| RLS per-step cost | — 9 multiply-add ops for |
| Numerical stability | can become indefinite; use regularisation if for long runs |
| Initialisation | , |
Sensitivity Analysis
| Source of Error | Effect |
|---|---|
| error | All parameters scaled proportionally ( is biased) |
| Encoder quantisation | Noise on ; use long averaging window |
| Constant-speed operation | unidentifiable ( makes regressor rank-deficient) |
| Very short identification time | not collapsed; noisy estimates |
| too large | Slow convergence to parameter changes |
| too small | Noisy, unstable estimates at steady state |
Worked Example
Motor: , , , , .
Regressor at one sample with , , :
True output:
The difference 0.6 − 0.07 = 0.53 N·m is the load torque , which becomes the innovation residual from the estimator perspective — it will be treated as noise and averaged out over samples.
Limitations & Assumptions
- Assumes: is zero mean over the effective window (i.e. no sustained external load that would be attributed to or ).
- Assumes: Motor torque constant is known a priori (from electrical identification).
- Assumes: The mechanical system is linear in , , — nonlinear effects (e.g. position-dependent cogging, Stribeck friction) are not modelled.
- Does not handle: Rapidly varying (e.g. moving load). The sample window means changes faster than 500 ms update time are tracked with lag.
- Does not handle: Identification in the presence of external vibration or impact loads.
References
- Ljung, L. — System Identification: Theory for the User, 2nd ed., Prentice Hall, 1999.
- Åström, K.J. & Wittenmark, B. — Adaptive Control, 2nd ed., Addison-Wesley, 1995.
- Kim, J.-H. et al. — "Online Parameter Identification of PMSM Using Recursive Least-Squares Algorithm", IEEE International Electric Machines and Drives Conference, 2007.