Joint flexibility: model the twist between motor and load

Explore joint flexibility with two rotary inertias joined by a spring and damper. Calculate transmitted torque, loaded deflection, elastic oscillation, and energy loss, then compare motor and load motion.

By 14 min read

A motor encoder can reach its target while the load still moves. An elastic transmission lets the motor and load occupy different angles, storing energy in the twist between them. Releasing that energy can make both sides oscillate.

Joint flexibility adds those missing states to a rigid transmission model. This lesson uses two inertias and one spring-damper coupling to calculate the motion, delivered torque, and energy.

Let joint flexibility separate motor and load motion

Imagine turning a load through a springy shaft. The motor first twists the shaft, and the shaft's torque accelerates the load. If you suddenly remove motor torque, the shaft can keep transferring its stored energy.

A rigid transmission assumption suppresses that relative twist. An elastic joint model gives the motor and load separate coordinates and velocities. Ott and colleagues' flexible-joint model uses this distinction when studying robot control.

Elasticity can come from transmission components or an intentionally compliant element. The size and importance of the effect depend on the mechanism and task. Here the numbers are illustrative; they do not describe a particular commercial joint.

Put both coordinates on the joint side

Use an ideal gear upstream of the flexible coupling. Let φ be the physical rotor angle and N the positive gear ratio. Define the reflected motor coordinate θ = φ/N, measured on the joint side before the spring.

The load angle is q, measured after the spring. Both coordinates increase in the same chosen direction and share a zero reference. They remain separate variables: θ need not equal q.

The gear transformation gives:

θ = φ/N
Jₘ = N²J_rotor
u = Nτ_motor

These definitions preserve rotor kinetic energy and input power: J_rotor φ̇²/2 = Jₘ θ̇²/2 and τ_motor φ̇ = uθ̇. Modern Robotics, Section 8.9 explains the square-law reflected inertia.

The lab fixes Jₘ = 0.02 kg m² and Jₗ = 0.08 kg m². Its Reflected motor torque control changes u, in N m. To obtain physical rotor angle or torque for a chosen N, use φ = Nθ and τ_motor = u/N.

Both inertias rotate without gravity torque. The model has no bearing friction, backlash, distributed shaft modes, motor electrical dynamics, or motion limits. It treats u as an ideal supplied torque; the actuator dynamics lesson explains the current and voltage states behind a motor's torque.

Calculate the torque through the coupling

Define spring twist and relative speed:

δ = θ − q
δ̇ = θ̇ − q̇
τₛ = kδ + cδ̇

Here k is torsional stiffness in N m/rad, and c is coupling damping in N m s/rad. The spring and damper act in parallel across the same two coordinates. MathWorks' flexible-shaft documentation describes this lumped inertia, spring, and relative-speed damping structure.

A positive τₛ applies positive torque to the load and negative torque to the reflected motor inertia. Positive twist gives positive spring torque. Negative relative speed gives negative damper torque, which can reduce or reverse the total transmitted torque.

For k = 8, c = 0.2, δ = 0.05 rad, and δ̇ = −1 rad/s, the contributions are 0.4 N m from the spring and −0.2 N m from the damper. The load receives 0.2 N m.

The damping term responds to relative speed. A rigid common rotation with θ̇ = q̇ produces no coupling-damper torque, even when both speeds are large.

Write one equation for each inertia

Let the signed load parameter τₗ apply physical external torque −τₗ to the load. A positive τₗ therefore opposes positive load rotation and assists negative rotation. Its direction stays fixed through a reversal.

Newton's rotational equations are:

Jₘ θ̈ = u − τₛ
Jₗ q̈ = τₛ − τₗ

Every term has units N m. Together with θ̇ and q̇, these equations form a four-state model. A rigid robot dynamics model needs extra coordinates to represent this transmission deformation.

Start with θ = 0.1 rad, q = 0, and both speeds zero. With k = 8 and no external torques, the spring transmits 0.8 N m. Initial accelerations are θ̈ = −40 rad/s² and q̈ = 10 rad/s².

The two sides accelerate in opposite directions. Their inertias differ, so their acceleration magnitudes differ too. Setting θ = q throughout the calculation would erase this release experiment.

Hold a load with a twisted spring

At rest, both accelerations and velocities are zero. The equations require u = τₛ = τₗ and δ = τₗ/k. A nonzero static load needs a nonzero spring deflection.

For a 0.5 N m load and k = 8 N m/rad, the required twist is 0.0625 rad, about 3.58°. Reflected motor torque must also be 0.5 N m. The Hold a loaded spring preset starts at this equilibrium.

Doubling stiffness to 16 reduces the required static twist to 0.03125 rad. The holding torque stays 0.5 N m. These statements compare two equilibria with different initial twists.

If you change stiffness while keeping an old initial twist, that initial state generally leaves equilibrium. The lab starts a new experiment with the controls you set. To watch the loaded response develop from zero twist, use Apply balanced torques and compare its dashed equilibrium reference across stiffness values.

Separate common motion from elastic oscillation

Two combinations of the angles make the motion easier to understand. The inertia-weighted mean angle is α = (Jₘθ + Jₗq)/(Jₘ + Jₗ). Adding the inertia equations gives:

α̈ = (u − τₗ)/(Jₘ + Jₗ)
μ = JₘJₗ/(Jₘ + Jₗ) = 0.016 kg m²
μδ̈ + cδ̇ + kδ = (Jₗu + Jₘτₗ)/(Jₘ + Jₗ)

The coupling cancels from the common-motion equation. With balanced external torques and zero initial speeds, α remains fixed. For the free release, α = 0.02 rad while the two sides move around it.

With no forcing or damping, the relative equation is a harmonic oscillator. Its angular natural frequency is ωₙ = √(k/μ). For k = 8, this gives 22.360680 rad/s, or 3.558813 Hz, with a period of about 0.281 s.

From initial twist δ₀ and zero relative speed, δ(t) = δ₀ cos(ωₙt). Reconstruct the two angles with θ = α + 0.8δ and q = α − 0.2δ. After half a free oscillation, δ = −0.1, θ = −0.06, and q = 0.04 rad.

For constant torques, the relative equilibrium is δ_eq = (Jₗu + Jₘτₗ)/[(Jₘ + Jₗ)k]. If u and τₗ differ, α still accelerates. With u = 0.5, τₗ = 0, and k = 8, the relative equilibrium is 0.05 rad while common acceleration is 5 rad/s².

Damp relative motion without grounding the joint

The relative mode has damping ratio ζ = c/(2√(kμ)). For k = 8 and c = 0.2, ζ = 0.279508. This is underdamped: the relative motion oscillates while its envelope decays.

  • c = 0: the ideal relative oscillation loses no energy.
  • 0 < ζ < 1: an exponentially decaying envelope surrounds the oscillation.
  • ζ = 1: the relative mode is critically damped.
  • ζ > 1: two decaying real modes describe the relative response.

The critical coefficient at k = 8 is about 0.715542 N m s/rad. The lab's exact solution handles all three damping regimes. Its fixed initial speeds are zero; general initial velocities would change the response coefficients.

Coupling damping cannot remove energy from pure common rotation. If the two sides already spin together with no net external torque, the model permits that shared speed to continue. In the lab's free release, the initial generalized momentum Jₘθ̇ + Jₗq̇ is zero, so positive damping brings both sides toward rest at the shared angle 0.02 rad.

Increasing k with a fixed nonzero initial twist makes the free oscillation faster and increases initial spring energy. It does not reduce that imposed twist amplitude. A rigid approximation needs a suitable motion time scale and initial condition; simply increasing stiffness in this release preset does not establish it.

Compare the flexible joint experiments

Follow the spring between motor and load

How much does the joint twist?

Release an initial twist or apply constant torques. Compare the motor and load motion, then inspect the torque that the coupling transmits.

8
0.0
0.1000
0.00
0.00
0.10

Reflected motor inertia: 0.02 kg m². Load inertia: 0.08 kg m². Both angles increase in the same direction. The load begins at angle zero, the motor coordinate begins at the selected twist, and both speeds begin at zero.

Twist between the two inertias

Twist between the two inertias over one secondBlue shows the motor coordinate minus load angle. The dashed orange reference is the relative-equilibrium twist. Time in seconds is horizontal and twist (rad) is vertical. The cursor selects 0.10 seconds.0.00.51.0-0.20.00.2Time (s)Twist (rad)
Blue: spring twist. Dashed orange: constant-input relative equilibrium. This reference does not require the whole joint to be at rest. The cursor selects the readouts. Each chart chooses its own vertical scale.

Motor coordinate and load angle

Motor coordinate and load angle over one secondBlue shows the motor coordinate reflected to the joint side; orange shows the load angle. Both angles use the same sign and zero reference. Time in seconds is horizontal and angle (rad) is vertical. The cursor selects 0.10 seconds.0.00.51.0-0.20.00.2Time (s)Angle (rad)
Blue: motor coordinate on the joint side. Orange: load angle. The motor and load can move separately; their angles are unwrapped. The cursor selects the readouts. Each chart chooses its own vertical scale.
Motor coordinate (rad, joint side)
-0.029382
Load angle (rad)
0.032345
Twist (rad)
-0.061727
Transmitted torque (N m)
-0.493818
Spring torque (N m)
-0.493818
Damper torque (N m)
0.000000
Relative equilibrium twist (rad)
0.000000
Common acceleration (rad/s²)
0.000000
Natural frequency (Hz)
3.558813
Damping ratio
0.000000
Stored energy (J)
0.040000
Damper loss (J)
0.000000
Energy balance residual (J)
0.000000

Undamped relative motion. The balanced external torques leave the inertia-weighted mean angle fixed for these zero initial speeds.

Inspect stored energy and external work
Energy and work at 0.10 s (J)
Kinetic energy0.024759
Spring energy0.015241
Initial energy0.040000
Motor input work0.000000
Signed load work0.000000

Motor work minus signed load work equals the rise in stored energy plus damper loss. Negative load work means the external load supplies energy.

Positive signed load torque applies a constant negative torque to the load. Damping opposes relative motion between the inertias. It does not brake their common rotation against a stationary frame.

The state uses the exact constant-parameter solution. A separate Simpson quadrature estimates damper loss with 0.002 s intervals; the energy residual reflects that quadrature and floating-point rounding. Parameter changes start a new experiment.

Controls become available when the experiment finishes loading. The default curves and readouts remain visible without JavaScript.

The default shows Free elastic oscillation at 0.10 s. Motor coordinate is −0.029382 rad, load angle is 0.032345 rad, and twist is −0.061727 rad. The transmitted torque is −0.493818 N m.

  • Damped elastic oscillation sets c = 0.2. At 0.10 s, twist is −0.016094 rad and transmitted torque is −0.337821 N m. The spring and damper both contribute negative torque at this instant.
  • Apply balanced torques starts untwisted with u = τₗ = 0.5. The relative motion overshoots its 0.0625 rad equilibrium while the mean angle stays fixed.
  • Hold a loaded spring starts with the required 0.0625 rad twist. Both angles stay fixed and the coupling transmits 0.5 N m.
  • Accelerate both inertias applies u = 0.5 with no external load. At one second, the motor coordinate is 2.540056 rad and the load angle is 2.489986 rad; their mean motion keeps accelerating.

Presets keep the selected replay time. Reset restores the free release at 0.10 s. The plots show the full one-second response, and the cursor selects the readouts; no animation runs automatically.

The model keeps stiffness and damping constant during each response. It represents one elastic mode and permits unwrapped rotation. Real joints can require nonlinear stiffness, hysteresis, backlash, bearing friction, or additional structural modes; model uncertainty explains why checking those assumptions matters.

Track spring energy and external work

The model stores energy in both inertias and the spring:

E = ½Jₘθ̇² + ½Jₗq̇² + ½kδ²
dE/dt = uθ̇ − τₗq̇ − cδ̇²

Spring power moves energy between storage and motion. The damper removes energy at the nonnegative rate cδ̇², measured in watts. For fixed parameters and constant external torques, integrating gives:

E(t) − E(0) = u[θ(t) − θ(0)] − τₗ[q(t) − q(0)] − ∫₀ᵗ cδ̇² dt

Motor work uses the reflected motor coordinate, which preserves the physical motor's power. Signed load work can be negative: if a positive τₗ drives the load backward, the external load supplies energy.

The free release begins with ½ × 8 × 0.1² = 0.04 J and keeps that total. With c = 0.2, stored energy at 0.10 s falls to 0.009778 J, while damper loss reaches 0.030222 J.

The browser evaluates the state analytically. It separately integrates damper power using Simpson quadrature over 0.002 s intervals, then checks the energy balance. This independent loss calculation leaves a small quadrature residual; reducing the interval provides a useful numerical check.

Energy accounting checks signs and consistency, but it does not prove a real mechanism follows this model. A feedback controller still needs measurements that reveal the motion relevant to its task. An instantaneous motor-angle reading does not determine load angle when the twist is unknown.

Reproduce the response in Python

This standard-library Python program integrates the two original inertia equations with RK4. It provides an independent numerical check of the browser's analytic state solution. It reports stored energy but does not reproduce the browser's separate damper-loss quadrature.

from math import sqrt, pi

JM, JL = 0.02, 0.08


def simulate(k=8, c=0, twist=0.1, motor=0, load=0, duration=0.1):
    # Motor angle, load angle, motor speed, load speed; all on the joint side.
    state = [twist, 0.0, 0.0, 0.0]
    h = 0.0001
    steps = round(duration / h)
    assert abs(steps*h-duration) < 1e-12

    def rates(s):
        torque = k*(s[0]-s[1]) + c*(s[2]-s[3])
        return [s[2], s[3], (motor-torque)/JM, (torque-load)/JL]

    def offset(s, rate, scale):
        return [x+scale*v for x, v in zip(s, rate)]

    for _ in range(steps):
        a = rates(state)
        b = rates(offset(state, a, h/2))
        c_stage = rates(offset(state, b, h/2))
        d = rates(offset(state, c_stage, h))
        state = [state[j]+h*(a[j]+2*b[j]+2*c_stage[j]+d[j])/6
                 for j in range(4)]
    theta, q, wm, wl = state
    delta = theta-q
    transmitted = k*delta+c*(wm-wl)
    energy = (JM*wm*wm+JL*wl*wl+k*delta*delta)/2
    return delta, transmitted, energy


cases = [
    ("free", {}),
    ("damped", {"c": 0.2}),
    ("balanced", {"c": 0.2, "twist": 0, "motor": 0.5, "load": 0.5}),
    ("held", {"c": 0.2, "twist": 0.0625, "motor": 0.5, "load": 0.5}),
    ("accelerating at 1 s", {"c": 0.2, "twist": 0, "motor": 0.5, "duration": 1}),
]
for name, settings in cases:
    delta, torque, energy = simulate(**settings)
    print(f"{name}: twist={delta:.6f}, torque={torque:.6f}, energy={energy:.6f}")
mu = JM*JL/(JM+JL)
print(f"Natural frequency: {sqrt(8/mu)/(2*pi):.6f} Hz")
print(f"Static twist at 0.5 N m: {0.5/8:.6f} rad")

Expected output, with twist in radians, torque in N m, and energy in joules:

free: twist=-0.061727, torque=-0.493818, energy=0.040000
damped: twist=-0.016094, torque=-0.337821, energy=0.009778
balanced: twist=0.072559, torque=0.711138, energy=0.024474
held: twist=0.062500, torque=0.500000, energy=0.015625
accelerating at 1 s: twist=0.050070, torque=0.400781, energy=1.260028
Natural frequency: 3.558813 Hz
Static twist at 0.5 N m: 0.062500 rad

The first four cases use 0.10 s. The final motion case uses one second. The numerical integration lesson explains the four-stage method and time-step checks.

Try it yourself

Exercise 1. Hold a load. The external load parameter is τₗ = 0.5 N m. Find the reflected motor torque, spring twist, and stored spring energy for a stationary hold at k = 8. Repeat the twist and energy calculation for k = 16.

Check the static deflection

Both cases require u = 0.5 N m. At k = 8, twist is 0.0625 rad and spring energy is ½ × 8 × 0.0625² = 0.015625 J.

At k = 16, twist is 0.03125 rad and spring energy is 0.0078125 J. For this fixed load, doubling stiffness halves equilibrium twist and energy. Holding initial twist fixed would describe a different comparison.

Exercise 2. Release the spring. Start with the default inertias, k = 8, no damping or external torques, θ = 0.1 rad, q = 0, and both speeds zero. Find the initial accelerations, total energy, and the two angles after half an elastic period.

Check the free oscillation

Initial transmitted torque is 0.8 N m, giving θ̈ = −40 rad/s² and q̈ = 10 rad/s². Stored energy is 0.04 J, which remains constant in this undamped model.

The weighted mean stays 0.02 rad. Half a period reverses twist to −0.1 rad, so θ = 0.02 + 0.8(−0.1) = −0.06 rad and q = 0.02 − 0.2(−0.1) = 0.04 rad. Both speeds return to zero at that instant.

Sources and further study

Continue with model uncertainty to distinguish uncertain parameters from missing physics and derive conditional prediction bounds. Then use feedback control to connect those predictions to measured motion.