Measuring damping and friction
A pendulum left alone slows down. How fast it slows, and in what shape, tells you what kind of friction the hinge has and how much of it. This module turns a decaying swing into numbers you can put back into the model, and shows how to tell when those numbers are wrong.
11 formulas · 16/16 checks pass · 20 sources · fact-checked and reviewed
Key ideas
Viscous: the same fraction every cycle
With viscous friction the peaks lie on an exponential, (F8.03). Every cycle loses the same fraction of its amplitude, so against time is a straight line of slope , and (F8.05). For N·m·s/rad on the running example, = 0.0859 s⁻¹: the swing halves every 8.07 s, about 9.9 cycles.[1][3]
Dry friction: the same angle every half-swing
With Coulomb friction every half-swing loses the same angle, (F8.07), so the peaks fall on a straight line on ordinary axes. Motion stops at the first peak inside the dead band , and the pendulum rests there, off-centre. With N·m, each half-swing loses 0.166°, and a 5° release stops after 30 half-swings.[2]
The shape of the decay is the diagnosis
Plot against time. A straight line means viscous; a line that steepens as the swing dies means dry friction is present. Better, plot each half-swing peak against the one before (F8.08): it is a straight line whose slope gives and whose intercept gives , so one fit recovers both. Put another way, an apparent damping ratio that rises as the amplitude falls is dry friction's fingerprint (F8.09).[4][5]
Fit the wrong model and you get a confident wrong number
Plant and together and fit a pure exponential, and the fit reports a 3.96 times too large. The number alone gives no warning, and an of 0.92 can pass a casual glance; the residuals arch, which the plots in idea 04 show at once. The return map, on the same data, recovers to 0.07 % and to 0.3 %.[4]
A motor is a brake you may not have meant to fit
A turning motor generates a back emf in proportion to its speed. If the winding is shorted, that emf drives a current, the current makes a torque against the motion, and the result is viscous damping, (F8.11). Whether a "disabled" driver shorts the winding or leaves it open depends on the driver: one common part offers both, as brake and coast. Separately, cogging acts even with no current at all.[6][7][8][9]
Formulas
The same entries as the formula sheet. Open an entry's details for its symbols and the checks behind it.
Damped equation of motion, small angle
Symbols
Symbol Meaning Unit viscous damping coefficient N·m·s/rad gravity stiffness N·m/rad Decay rate, damping ratio, damped frequency
Symbols and checks
Symbol Meaning Unit envelope decay rate 1/s damping ratio dimensionless damped angular frequency rad/s - ✓ b recovered as 2 I sigma, b = 1e-3 plantedexpected 0.001 · got 9.99863×10⁻⁴ · relative error 1.4×10⁻⁴
- ✓ zeta from log decrement vs b / (2 sqrt(k I))expected 0.0111684 · got 0.0111684 · relative error 5.1×10⁻⁶
Peaks lie on an exponential envelope
Linear viscous damping, released from rest.
Symbols and checks
- ✓ b recovered as 2 I sigma, b = 1e-3 plantedexpected 0.001 · got 9.99863×10⁻⁴ · relative error 1.4×10⁻⁴
- ✓ b fitted with b = 0 planted (N m s/rad)expected 0 · got −3.78558×10⁻¹⁵ · absolute error 3.8×10⁻¹⁵the pipeline's own floor; planted values are 1e-3
Logarithmic decrement
n counts half-swing peaks, as in F8.03, so peaks n and n + 2 are one full cycle apart, on the same side.
Symbols and checks
Symbol Meaning Unit log decrement over one full cycle dimensionless damped period s - ✓ zeta from log decrement vs b / (2 sqrt(k I))expected 0.0111684 · got 0.0111684 · relative error 5.1×10⁻⁶
From the fit back to the coefficient
I is the inertia about the pivot, including any rotor that turns with the pendulum.
Symbols and checks
- ✓ b recovered as 2 I sigma, b = 1e-3 plantedexpected 0.001 · got 9.99863×10⁻⁴ · relative error 1.4×10⁻⁴
- ✓ b fitted with b = 0 planted (N m s/rad)expected 0 · got −3.78558×10⁻¹⁵ · absolute error 3.8×10⁻¹⁵the pipeline's own floor; planted values are 1e-3
- ✓ b fitted at h = 2 ms (Euler) vs 1 ms (RK4)expected 0.00100004 · got 9.99863×10⁻⁴ · relative error 1.7×10⁻⁴halving the step should not move the answer you report
- ✓ b from the return map, both plantedexpected 0.001 · got 9.99265×10⁻⁴ · relative error 7.4×10⁻⁴
Inertia from the same swing
Linear viscous model; needs k = m·g·d from a separate measurement.
Symbols and checks
- ✓ I from the same swing, k / (wd^2 + sigma^2)expected 0.0058208 · got 0.00582245 · relative error 2.8×10⁻⁴5 deg amplitude lengthens the period by ~0.05 %, so ~0.1 % on I
Coulomb friction, straight-line decay
Linear stiffness. Motion stops at the first turning point where k|A| is within the static friction, so inside ±Δ when static and kinetic friction are equal (as MuJoCo models them), or ±τ_s/k when static friction τ_s is larger. The pendulum then rests off-centre.
Symbols and checks
Symbol Meaning Unit friction torque magnitude N·m dead band half-width rad n-th peak amplitude rad - ✓ mean drop per half-swing vs 2 tau_c / kexpected 0.00290418 · got 0.00290032 · relative error 0.0013
- ✓ spread of the drops (std / mean)expected 0 · got 3.76085×10⁻⁴ · absolute error 3.8×10⁻⁴constant drop = straight line on linear axes
- ✓ tau_c = k Delta from the interceptexpected 5×10⁻⁴ · got 4.98736×10⁻⁴ · relative error 0.0025
- ✓ half-swings before the pendulum stopsexpected 30 · got 30 · absolute error 0motion stops at the first peak inside the dead band
Peak-to-peak return map (viscous and Coulomb together)
Linear model, half-swing peaks. Fit a straight line to A_{n+1} against A_n; the slope gives σ, the intercept gives Δ.
Symbols and checks
- ✓ viscous: slope vs exp(-sigma Td / 2)expected 0.96552 · got 0.965504 · relative error 1.6×10⁻⁵
- ✓ Coulomb: intercept vs -2 Delta (rad)expected −0.00290418 · got −0.00289417 · relative error 0.0034
- ✓ Coulomb: slope vs 1expected 1 · got 0.999911 · relative error 8.9×10⁻⁵
- ✓ b from the return map, both plantedexpected 0.001 · got 9.99265×10⁻⁴ · relative error 7.4×10⁻⁴
- ✓ tau_c = k Delta from the interceptexpected 5×10⁻⁴ · got 4.98736×10⁻⁴ · relative error 0.0025
Equivalent viscous damping of Coulomb friction
Energy balance over one cycle (4τ_cA = πbωA²). Rises as amplitude falls, which is the signature that gives Coulomb away.
Symbols and checks
- ✓ apparent zeta of Coulomb decay vs 2 tau_c / (pi k A)expected 0.0119878 · got 0.0119903 · relative error 2×10⁻⁴
Bias of MuJoCo's implicit joint damping
Semi-implicit Euler with implicit joint damping, linear oscillator. Relative bias ≈ −hσ = −hζω_n, negligible for light damping.
Symbols and checks
- ✓ MuJoCo Euler decay rate at zeta=0.2 vs ln(1+2h sigma)/(2h)expected 1.53354 · got 1.53354 · relative error 2.7×10⁻⁶true sigma 1.53825; predicted relative bias -3.06e-03
- ✓ b fitted at h = 2 ms (Euler) vs 1 ms (RK4)expected 0.00100004 · got 9.99863×10⁻⁴ · relative error 1.7×10⁻⁴halving the step should not move the answer you report
Braking from a shorted motor winding
One winding (the brushed DC model), shorted through R, with the electrical time constant L/R much shorter than the swing. K_t = K_e follows from power balance for an ideal motor. Open-circuit windings carry no current and add no braking.
Symbols and checks
Symbol Meaning Unit torque constant N·m/A back-emf constant V·s/rad total resistance around the shorted loop Ω - ✓ b fitted from the coupled model vs K^2/Rexpected 0.001 · got 0.00100005 · relative error 5.2×10⁻⁵illustrative K = 0.1 N m/A, R = 10 ohm, L = 1 mH
Worked example: plant a damping, then recover it
The plant-and-recover test. Put a known damping into MuJoCo, simulate a free decay the way the bench would record it, and check that the fitting code returns what went in. Running example, released from rest at 5°, MuJoCo's default Euler integrator at = 2 ms, 40 s of data. Every number is computed by tools/robotics/verify.py.
Find the turning points
A peak is where the velocity changes sign. Fit a parabola through the three samples around each sign change to place the peak between samples. Forty seconds gives 97 half-swing peaks, from 5° down to 0.17°.
Run the null test
Repeat with nothing planted. The pipeline reports = −3.8×10⁻¹⁵ N·m·s/rad against a planted : on clean data, the fitting code adds no damping of its own. That says nothing yet about noise or encoder steps on bench data; to test those, add them to the simulated angle and fit again.
Halve the step
Refit at 1 ms with Euler and with RK4. In units of N·m·s/rad, the fitted is 0.99986 at the default step, 0.99995 at 1 ms and 1.0000 with RK4: the default differs from RK4 by 0.017 %. At this damping the integrator is not part of the answer. If halving moves your number by more than your tolerance, it is.
Swap in dry friction
Plant N·m instead. Then = 0.0832°, so every half-swing should lose 0.166° and a 5° release should stop after 30 half-swings (F8.07). MuJoCo agrees. The first 11 drops vary by 0.04 % (standard deviation over mean), their mean differs from the prediction by −0.13 %, and the swing stops after the predicted number of half-swings, at 12.3 s against 12.25 s for that many half-periods. The last half-swing runs slow because MuJoCo's friction constraint is soft.
Both at once
Plant both and fit each half-swing peak against the one before (F8.08), using the 18 pairs well above the dead band. The slope gives and the intercept gives . Fit the same data with a pure exponential and you get the wrong answer, and only the residuals tell you so.
Recovered from the same 40 s of simulated decay Quantity Planted Exponential fit Return-map fit , N·m·s/rad 1 3.96 0.9993 , N·m 5 not modelled 4.987
Fit the model whose shape matches the data. Prove the fit on a simulation where you know the answer, prove it reports nothing when there is nothing, and check that the answer does not move when the timestep does. Then, and only then, fit the bench.
Best practice
Plant, then recover, before you fit anything real.
A pipeline that cannot return a value you put into a simulation will not return the truth from a bench. It costs one extra run.
Run the null test.
Fit a decay with nothing planted. Whatever comes back is the floor of your method on clean data; here it is −3.8×10⁻¹⁵ N·m·s/rad. Then add realistic noise and encoder steps and repeat.
Find peaks from velocity sign changes, refined with a parabola.
The sample nearest a peak can be up to half a sample period away from it. A parabola through the three samples around the sign change places the peak between them.
Look at the shape before you fit a number.
Plot against time, and each peak against the one before. Straight on the log plot is viscous; a return map with slope near 1 is dry friction; the return map handles a mixture.[4]
Halve the timestep and refit.
If the fitted value moves by more than your tolerance, the integrator is part of your answer. Here halving the step moved by 0.0086 %, and switching to RK4 by 0.017 %.[11]
Measure passive damping with the motor windings open, then in each electrical state you will run.
An open winding carries no current, so it adds no braking. A shorted one adds , which can be as large as the bearing friction you are trying to measure. Know which state your driver is in when it says "off".[6][8]
Use a long record, and stop fitting before the noise floor.
Light damping needs time: here the swing takes 8.07 s to halve. Drop peaks only a few sensor counts high; their logarithms are dominated by the sensor's resolution.
Questions
- Should I fit the energy or the peaks?
- The peaks. They are the turning points of the motion and need neither the inertia nor a velocity estimate. Energy needs , which on the bench means differentiating a measured angle and amplifying its noise.
- What does MuJoCo call these?
- Viscous damping is the joint's
damping; dry friction isfrictionloss. MuJoCo's documentation uses "Coulomb friction" for friction that scales with normal force, as in contacts, and calls load-independent joint friction "friction loss". It models friction loss as a constraint rather than a force law. One consequence: a joint that should have stuck can creep. In the dry friction run above, the stopped pendulum drifted from 0.010° at 20 s to 0.0029° at 40 s. That is the solver, not physics.[10][14][17] - How long a record do I need?
- Long enough for the swing to shrink by a factor you can measure well. With = 0.0112, the amplitude halves every 9.9 cycles; 40 s spans 5.0 halvings.[1]
- Is the log decrement the same thing as ?
- Nearly. is the drop in over one full cycle, so (F8.04). Prefer from a fit over many cycles to from two adjacent peaks: one ratio of two measured peaks carries the noise of both.[3]
- Why do I need the inertia to get ?
- Because the decay rate is : the swing reveals the ratio, not alone. A heavier pendulum on the same bearing decays more slowly. Measure from the period (F9.02), rotor included, and use that.[1]
- Could the integrator fake a decay?
- Some integrators can: one with numerical damping shrinks a swing that has nothing planted. That is what the null test is for. Module 07 explains which integrators do it and why.
Watch
- listed
Estimation of natural frequencies and damping ratios from measured response: the logarithmic decrement (opens in a new tab)[18]
J. Kim Vandiver · MIT OpenCourseWare, 2.003SC Engineering Dynamics, Fall 2011 (a chapter of Lecture 19)
Estimating natural frequency and damping ratio from a measured decay: the lecture-hall version of this page's worked example.
- listed
Lecture 20: Linear System Modeling a Single Degree of Freedom Oscillator (opens in a new tab)[19]
J. Kim Vandiver · MIT OpenCourseWare, 2.003SC Engineering Dynamics, Fall 2011
Damped free response, and the experimental determination of damping ratio.
- listed
Modern Robotics, Chapter 8.9: Actuation, Gearing, and Friction (opens in a new tab)[20]
Kevin M. Lynch · Northwestern University, Modern Robotics video series (YouTube)
Motors, gearing and friction models, from the book this guide follows.
Read
- read
University Physics Volume 1, §15.5 Damped Oscillations (opens in a new tab)[1]
William Moebs, Samuel J. Ling, Jeff Sanny · OpenStax, 2016. CC BY 4.0
Damped oscillations, including the under-, critically and over-damped cases.
- read
Free Vibration of Damped System (contd.), Module 4 Lecture 3 (lecture notes, PDF) (opens in a new tab)[2]
NPTEL (National Programme on Technology Enhanced Learning, India), course 101105022
Coulomb damping worked through, with the linear decay and the dead band.
- listed
Engineering Vibration, 4th edition (opens in a new tab)[12]
Daniel J. Inman · Pearson, 2014. ISBN 978-0-273-78521-7 (international edition)
A standard engineering-vibration textbook: free and damped response, Coulomb damping and the log decrement in full.
- read
MuJoCo Computation chapter, Numerical integration (3.17.0) (opens in a new tab)[14]
Google DeepMind
How MuJoCo integrates damping and models friction loss, from the people who wrote it.
Sources
Numbered in order of first use on this page. read: checked against the claim. listed: exists and covers the topic, wording not checked. derived: worked out here and checked numerically.
- [1]read
University Physics Volume 1, §15.5 Damped Oscillations (opens in a new tab)
William Moebs, Samuel J. Ling, Jeff Sanny · OpenStax, 2016. CC BY 4.0
Eq. 15.24 (underdamped solution, exponential envelope), Eq. 15.26 (damped frequency); under-, critically and over-damped conditions
Exponential envelope e^(−bt/2m), damped frequency, damping regimes. (Translational form; the rotational form swaps m→I, k→mgd.)
- [2]read
NPTEL (National Programme on Technology Enhanced Learning, India), course 101105022
Coulomb damping loses 2F/k per half cycle and 4F/k per cycle (linear decay). The notes take static friction as larger than kinetic.
- [3]read
Logarithmic decrement (opens in a new tab)
Wikipedia
Definition (natural log of the ratio of successive peaks, or of peaks n periods apart) and when it applies (underdamped; precision falls as ζ rises past about 0.5). The page's equations did not render when checked, so the ζ relations are derived here from OpenStax Eqs. 15.24 and 15.26.
- [4]derived
Half-swing return map with viscous and Coulomb damping (linear stiffness)
F8.08.
- [5]derived
Equivalent viscous damping of Coulomb friction from energy per cycle
F8.09.
- [6]read
University Physics Volume 2, §13.6 Electric Generators and Back Emf (opens in a new tab)
Samuel J. Ling, Jeff Sanny, William Moebs · OpenStax, 2016. CC BY 4.0
Back emf and Fig. 13.32
A turning motor generates a back emf that is zero at rest and rises in proportion to the motor's angular velocity.
- [7]read
University Physics Volume 2, §11.5 Force and Torque on a Current Loop (opens in a new tab)
Samuel J. Ling, Jeff Sanny, William Moebs · OpenStax, 2016. CC BY 4.0
Eqs. 11.19, 11.21 (μ = NIA) and 11.22 (τ = μ × B)
Torque on a coil in a magnetic field is proportional to the current through it.
- [8]read
DRV8833 Dual H-Bridge Motor Driver, data sheet (SLVSAR1E) (opens in a new tab)
Texas Instruments, 2011, revised 2015
§7.3.2 Bridge Control and Decay Modes, Table 1 (H-Bridge Logic); §7.3.5.3 Undervoltage Lockout
A driver’s two “off” states: coast (outputs high-impedance; in fast decay the recirculation current flows through the body diodes) and brake (both outputs low, which shorts the winding). Below the undervoltage threshold (VM < 2.5 V) all circuitry in the device is disabled.
- [9]read
Cogging torque (opens in a new tab)
Wikipedia
Cogging is the interaction between the rotor magnets and the stator slots; it is a detent (no-current) torque, especially prominent at low speed.
- [10]read
MuJoCo XML Reference (3.17.0) (opens in a new tab)
Google DeepMind
option-timestep (default 0.002 s; RK4 costs about four times per step); option-gravity (default 0 0 −9.81); option-integrator; option-flag-energy; option-flag-eulerdamp (implicit joint damping in Euler, on by default); body-joint-armature (reflected inertia, gear ratio squared; positive armature improves stability); actuator-general-armature (rotor inertia, scaled by gear squared); body-joint-damping (Euler treats joint damping implicitly); body-joint-frictionloss; compiler-inertiafromgeom; body-geom-density (default 1000 kg/m³, used only when mass is not given)
MuJoCo defaults, energy definitions, armature, damping and friction-loss behaviour. Read from the 3.17.0 source of the docs (doc/XMLreference.rst).
- [11]derived
Decay-rate bias of semi-implicit Euler with implicitly treated joint damping
F8.10. Matched MuJoCo 3.17 to 3×10⁻⁶ at ζ = 0.2.
- [12]listed
Engineering Vibration, 4th edition (opens in a new tab)
Daniel J. Inman · Pearson, 2014. ISBN 978-0-273-78521-7 (international edition)
Standard reference for viscous damping, logarithmic decrement and Coulomb damping. Listed for further reading; every formula that cites it also cites a source checked on this page.
- [13]derived
Where dry friction stops a swing (static moment balance at a turning point)
The dead band in F8.07, checked by counting half-swings in MuJoCo.
- [14]read
MuJoCo Computation chapter, Numerical integration (3.17.0) (opens in a new tab)
Google DeepMind
explicit, semi-implicit and implicit-in-velocity Euler; D matrix; implicitfast drops Coriolis and centripetal terms; discrete integrator; §Friction loss (dry friction modelled as a constraint whose effect is to drive the joint velocity to zero); §Reproducibility; §Numerical integration, RK4 and the tip “Choosing timestep and integrator”
The exact update equations of every MuJoCo integrator, and how friction loss is modelled. The docs recommend implicitfast for most models (similar cost to Euler, more stable), keep Euler for compatibility, and call RK4 best for energy-conserving or nearly conserving systems; they report RK4 qualitatively better than single-step methods on an energy-conserving example even at a quarter of the timestep, and single-step methods with implicit velocity-dependent forces significantly more stable than RK4 when those forces are large.
- [15]read
University Physics Volume 2, §9.4 Ohm's Law (opens in a new tab)
Samuel J. Ling, Jeff Sanny, William Moebs · OpenStax, 2016. CC BY 4.0
Eq. 9.11 (V = IR)
Ohm's law, used for the current a back-emf drives through a shorted winding.
- [16]derived
Braking from a shorted winding (back emf, Ohm’s law, torque proportional to current)
F8.11, checked against an independent simulation of the coupled pendulum and RL circuit.
- [17]read
MuJoCo Modeling chapter, solver parameters and friction (3.17.0) (opens in a new tab)
Google DeepMind
Solver parameters: solref default "0.02 1" (time constant, damping ratio 1: critically damped); timeconst at least twice the timestep (enforced unless refsafe is off); Restitution (zero damping in the direct format); friction loss is first-order, purely damped, no exact stick (slow slippage)
Constraints are soft mass-spring-dampers, critically damped by default; restitution needs the direct format with zero damping, and even then energy only fluctuates around its initial value. Why simulated friction loss creeps instead of sticking.
- [18]listed
J. Kim Vandiver · MIT OpenCourseWare, 2.003SC Engineering Dynamics, Fall 2011 (a chapter of Lecture 19)
Lecture chapter on estimating natural frequency and damping ratio from a measured free decay.
- [19]listed
Lecture 20: Linear System Modeling a Single Degree of Freedom Oscillator (opens in a new tab)
J. Kim Vandiver · MIT OpenCourseWare, 2.003SC Engineering Dynamics, Fall 2011
Lecture video on damped free response and on determining the damping ratio by experiment (topics confirmed from the lecture page's description).
- [20]listed
Modern Robotics, Chapter 8.9: Actuation, Gearing, and Friction (opens in a new tab)
Kevin M. Lynch · Northwestern University, Modern Robotics video series (YouTube)
The book’s own video for §8.9: motors, gearing, apparent (reflected) inertia and friction models. Linked from the book site’s chapter 8 video list.