Torque 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:
- Contact-rich tasks. When the end-effector contacts the environment, the inner servo treats the resulting deflection as tracking error and resists it. Lowering the joint gains makes the robot softer, but the resulting compliance remains defined in joint space and changes with configuration. Direct torque control can impose a Cartesian compliance without measuring the external wrench. Regulating a specific contact force — or using admittance control — requires a measurement or estimate of that wrench.
- Fast motion and varying payloads. During rapid motion, the inertial term $M(q)\ddot q$ and the Coriolis and centrifugal term $C(q,\dot q)\dot q$ can require substantial joint torque. If the outer controller ignores these dynamics, the inner servo must compensate for them, and tracking error generally grows with speed and acceleration.
- Apparent inertia and stiffness as design variables. A specification such as the end-effector should respond as a 1 kg mass connected to a 500 N/m spring defines the desired closed-loop dynamics rather than a position target.
- Safety around people. A stiff position-controlled arm treats unexpected contact as tracking error and increases its corrective effort until motion or safety limits intervene. A compliant torque controller can instead allow controlled deflection and reduce the peak contact force. Compliance does not eliminate the kinetic energy of a heavy, fast-moving arm, so compliant control alone does not make human–robot interaction safe.
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$
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:
- Motion-first (Operational Space Control). The end-effector should follow a prescribed Cartesian trajectory with predictable, decoupled error dynamics.
- Interaction-first (Impedance and Stiffness Control). The end-effector should exhibit a prescribed force–displacement response when external forces displace it.
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 quantity | Task-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
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.
- In stiffness and impedance control, the static force–displacement relationship is $F_\text{ext}=K\Delta x$, whereas the free-space acceleration depends on $\Lambda^{-1}(q)$.
- In OSC, the free-space response is configuration-independent: $\ddot x = \ddot x_d - K_v\delta\dot x - K_p\delta x$, whereas the static interaction balance becomes $F_\text{ext}=\Lambda(q)K_p\Delta x$.
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
Tradeoffs
- Pick OSC when motion is the priority. The Cartesian error response can be tuned as if each axis were an independent second-order system.
- Pick impedance control when contact response is the priority. What matters is what the environment feels at the end-effector. A defined, isotropic, configuration-independent stiffness supports stable contact and a predictable feel. A clean Cartesian stiffness is usually more important than a perfectly straight free-space return.
- Cartesian impedance is often more tolerant of inertia-model error. OSC premultiplies its feedback acceleration by $\Lambda$, so errors in the inertia model directly distort the feedback torque. Cartesian impedance does not premultiply its feedback gains by $\Lambda$, although dynamic feed-forward and gravity or Coriolis compensation may still depend on the model.
- Direct Cartesian impedance avoids an explicit task-space inertia inverse. Near a singularity, OSC must regularize $(JM^{-1}J^\top)^{-1}$. The impedance mapping $J^\top F_\text{cmd}$ remains finite, although the robot loses control authority in singular task directions.