← Foundations of Low-Level Robot Control

Torque Control

Part 2 · Foundations of Low-Level Robot Control

Inverse kinematics produces joint-position or joint-velocity commands and assumes that a low-level servo will track them. Torque control works below this motion-servo abstraction: the controller commands joint torques directly and uses the arm's dynamics to shape the end-effector's motion and mechanical response in task space.

Why torque control?

Part 1 covered inverse-kinematics controllers: batch IK produces a joint target $q_d$, and differential IK produces a joint velocity $\dot q_d$. Both pass those commands to an inner joint servo. The servo — not the IK controller — drives the joints, rejects disturbances, and compensates for gravity. The IK layer itself is purely kinematic: it never uses the mass matrix $M(q)$, Coriolis/centrifugal terms $C(q,\dot q)\dot q$, or gravity $g(q)$.

That abstraction works well for free-space motion in structured factory cells. Its limitations become apparent when dynamics play a significant role:

These concerns motivate commanding joint torques instead of positions or velocities. The question becomes: how can a task-space objective be translated into joint torques?

Limits of IK + joint-space PD for Cartesian stiffness

One way to build a torque controller is to solve IK for a joint target $q_d$ and run joint-space PD with gravity compensation:

$$\tau = -K_p^{(q)}(q - q_d) - K_d^{(q)}\dot q + g(q)$$

This works for many point-to-point moves, but it does not give direct control over the Cartesian behavior of the end-effector.

Why fixed joint-space gains do not produce uniform Cartesian stiffness

For small static displacements, using the position Jacobian $J_p$, the Cartesian stiffness is

$$K_x = \bigl(J_p\,(K_p^{(q)})^{-1}\,J_p^\top\bigr)^{-1}$$

That mapping depends on configuration and direction. Even if the joint gain is isotropic, $K_p^{(q)} = kI$, the Cartesian stiffness is generally anisotropic. A fixed joint-space gain matrix generally cannot produce the same isotropic Cartesian stiffness throughout the workspace.

Where does $\bigl(J_p\,K_p^{-1}\,J_p^\top\bigr)^{-1}$ come from?

A Cartesian force maps to joint torque through $\tau = J_p^\top F_\text{ext}$. At static equilibrium, balancing this external torque with the PD restoring torque gives

$$K_p\,\Delta q = J_p^\top F_\text{ext}.$$

Therefore, $\Delta q = K_p^{-1}J_p^\top F_\text{ext}$.

Linearising the kinematics gives $\Delta x = J_p\,\Delta q$, so

$$\Delta x = \underbrace{J_p\,K_p^{-1}\,J_p^\top}_{C_x}\,F_\text{ext}.$$

That maps force to displacement, so $C_x$ is the Cartesian compliance and stiffness is its inverse, $K_x = \bigl(J_p K_p^{-1} J_p^\top\bigr)^{-1}$. For isotropic $K_p = k_p I$ this is $k_p (J_p J_p^\top)^{-1}$ — the factor $(J_p J_p^\top)^{-1}$ is configuration-dependent and anisotropic.

Cartesian stiffness for a fixed joint gain $K_p^{(q)} = 200\,I$

The red ellipsoid shows the effective Cartesian stiffness produced by the same isotropic joint gain at every pose. Its shape still changes with the robot's configuration. A task-space impedance gain $K_p^{(x)}=kI$, by contrast, defines the same spherical stiffness ellipsoid at every pose.

This limitation arises because the controller acts on $q-q_d$, while the desired stiffness is specified in $x$. Task-space torque controllers instead write the feedback law directly in task space.

Two strategies

Task-space torque controllers address this limitation in two broad ways:

Both approaches can track trajectories and yield under external forces. The key difference is which relationship becomes configuration-independent: the free-space motion response or the force–displacement response.

The dynamics

The joint-space dynamics of a robot arm are

$$M(q)\,\ddot q \;+ C(q,\dot q)\,\dot q \;+ g(q) \;=\; \tau \;+ J^\top(q)\,F_\text{ext},$$

where $q\in\mathbb{R}^n$ are the joint angles, $M(q)$ is the joint-space inertia matrix, $C(q,\dot q)\dot q$ collects Coriolis and centrifugal terms, $g(q)$ is gravity, $\tau$ is the commanded joint torque, $J(q)=\partial f/\partial q$ is the task Jacobian, and $F_\text{ext}$ is an external Cartesian wrench applied at the end-effector.

The same dynamics can be written in task space as

$$\Lambda(q)\,\ddot x \;+ \mu(q,\dot q) \;+ p(q) \;=\; F_\text{cmd} \;+ F_\text{ext},$$

where $x$ is the task coordinate, $\Lambda(q)$ is the task-space inertia matrix, $\mu$ and $p$ are the task-space Coriolis/centrifugal and gravity terms, and $F_\text{cmd}$ is the Cartesian wrench produced by the controller.

How are the task-space and joint-space forms related?

Start with the kinematic acceleration relation

$$\ddot x = J\,\ddot q + \dot J\,\dot q.$$

Step 1 — solve the joint-space equation for $\ddot q$:

$$\ddot q = M^{-1}\bigl[\tau + J^\top F_\text{ext} - C\dot q - g\bigr].$$

Step 2 — substitute into $\ddot x$ and use $J\ddot q = \ddot x - \dot J\dot q$.

Step 3 — multiply by

$$\Lambda(q) \;\triangleq\; \bigl(J(q)\,M^{-1}(q)\,J^\top(q)\bigr)^{-1}.$$

This definition normalizes the external-wrench term: after multiplying by $\Lambda$, the coefficient on $F_\text{ext}$ becomes the identity. Collecting terms gives

Joint-space quantityTask-space quantity
$M(q)\,\ddot q$$\Lambda(q)\,\ddot x$
$C(q,\dot q)\,\dot q$$\mu = \Lambda J M^{-1}C\dot q - \Lambda\dot J\dot q$
$g(q)$$p = \Lambda J M^{-1}g$
$\tau$$F_\text{cmd} = \Lambda J M^{-1}\tau$
$J^\top F_\text{ext}$$F_\text{ext}$

$\Lambda$ is well-defined when $J$ has full row rank. Near a singularity, $JM^{-1}J^\top$ loses rank, one task-space direction becomes effectively infinitely heavy, and $\Lambda$ blows up — the dynamics version of the same singularity that troubled differential IK.

The task-space inertia matrix $\Lambda$

After the other task-space forces have been compensated, $\Lambda(q)$ relates a Cartesian wrench at the end-effector to the resulting Cartesian acceleration:

$$\ddot x = \Lambda^{-1}(q)\,F_\text{ext}$$

From the end-effector's perspective, the entire mechanism behaves like a direction-dependent inertia described by $\Lambda(q)$. This matrix is symmetric positive-definite away from singularities, anisotropic, and configuration-dependent — it changes as the arm moves, and is generally non-diagonal, so a force in one direction produces acceleration with components in others.

$\Lambda(q)$ — task-space inertia at the end-effector

The blue ellipsoid is $\Lambda(q)$ — its long axis is the direction the end-effector is heavy, and its short axis is the direction it is light. Both shape and orientation change as the arm reconfigures, even though the individual link masses and inertias remain constant.

Stiffness, impedance, and OSC

$\Lambda$ is the central object in everything that follows. Every controller below has to deal with the arm's task-space inertia being anisotropic and configuration-dependent — and they differ in where $\Lambda$ ends up in the closed-loop equation.

We will compare three task-space torque-control strategies: Stiffness Control, Impedance Control, and Operational Space Control (OSC). All three start from

$$\Lambda(q)\,\ddot x + \mu + p = F_\text{cmd} + F_\text{ext}, \qquad \delta x = x - x_d,\quad \delta\dot x = \dot x - \dot x_d,$$

and map the commanded Cartesian wrench to joint torque with

$$\tau = J^\top F_\text{cmd}$$

Commanded wrench and robot dynamics

Stiffness Impedance OSC
${F_\text{cmd} = {\color{#9d4f4f}-D\,\delta\dot x - K\,\delta x} + \mu + p}$
Command a Cartesian spring–damper wrench directly.
${F_\text{cmd} = {\color{#4a6fa5}\Lambda\ddot x_d - D_d\,\delta\dot x - K_d\,\delta x} + \mu + p}$
Adds a feed-forward $\Lambda\ddot x_d$ that supplies the inertial force, so the spring–damper only corrects errors.
${F_\text{cmd} = {\color{#5a8a5a}\Lambda(\ddot x_d - K_v\,\delta\dot x - K_p\,\delta x)} + \mu + p}$
Choose a desired acceleration, then multiply the whole feedback law by the actual task-space inertia. $K_p$ and $K_v$ set the nominal closed-loop natural frequency and damping; the physical Cartesian stiffness is $\Lambda(q)K_p$.

Substituting each controller's $F_\text{cmd}$ into $\Lambda(q)\ddot x+\mu+p=F_\text{cmd}+F_\text{ext}$ cancels the common $\mu+p$ terms and gives the corresponding closed-loop dynamics:

Stiffness Impedance OSC
${\Lambda\ddot x = {\color{#9d4f4f}-D\,\delta\dot x - K\,\delta x} + F_\text{ext}}$ ${\Lambda\ddot x = {\color{#4a6fa5}\Lambda\ddot x_d - D_d\,\delta\dot x - K_d\,\delta x} + F_\text{ext}}$ ${\Lambda\ddot x = {\color{#5a8a5a}\Lambda(\ddot x_d - K_v\,\delta\dot x - K_p\,\delta x)} + F_\text{ext}}$

Static contact ($\ddot x = \delta\dot x = 0$)

Stiffness Impedance OSC
${F_\text{ext} = \color{#9d4f4f}{K\,\delta x}}$
A clean spring law.
${F_\text{ext} = \color{#4a6fa5}{K_d\,\delta x}}$
The same prescribed spring law.
${F_\text{ext} = \color{#5a8a5a}{\Lambda(q)\,K_p\,\delta x}}$
Even with isotropic $K_p = k\,I$, the apparent stiffness is $k\,\Lambda(q)$ — anisotropic and pose-varying. Pushing in $+\hat x$ can produce reaction in $\hat y,\hat z$; the "spring" feels different at different poses.

Free-space response ($F_\text{ext}=0$)

Stiffness Impedance OSC
${\ddot x = {\color{#9d4f4f}-\Lambda^{-1}D\,\delta\dot x - \Lambda^{-1}K\,\delta x}}$
Solving for $\ddot x$ leaves $\Lambda^{-1}$ on every gain: frequency and damping shift as the arm moves, and the return path curves.
${\ddot x = \ddot x_d {\color{#4a6fa5}-\Lambda^{-1}D_d\,\delta\dot x - \Lambda^{-1}K_d\,\delta x}}$
The feedback gains remain premultiplied by $\Lambda^{-1}$, so the response changes as the arm moves.
${\ddot x = \ddot x_d {\color{#5a8a5a}-K_v\,\delta\dot x - K_p\,\delta x}}$
Because the spring–damper terms are premultiplied by $\Lambda$, $\Lambda$ cancels when solving for $\ddot x$. With isotropic gains, the free-space error dynamics are linear and decoupled, and the end-effector returns along a straight line in any configuration.

The tradeoff: where $\Lambda$ appears

The task-space inertia $\Lambda$ is a physical property of the arm. The control law determines whether it remains in the free-space error dynamics or in the force–displacement relationship, but it cannot remove $\Lambda$ from both without external-force feedback.

Impedance control makes the force–displacement relationship configuration-independent, while OSC makes the free-space error dynamics configuration-independent. The relationship that is not explicitly shaped retains its dependence on $\Lambda(q)$.

Stiffness / impedance control

Operational space control

Both simulations use the same robot model, initial configuration, Cartesian target (red box), and zero initial velocity. The top-down view shows the end-effector trajectories. Left: the trajectory curves because the arm's anisotropic $\Lambda$ multiplies $\ddot x$ in the closed-loop dynamics. Right: the trajectory is straight because $\Lambda$ has been cancelled from the free-space error dynamics.

Tradeoffs