Algorithmcore
Admittance control
Also called position-based impedance control.
Measures the contact force and turns it into a motion through a virtual mass-spring-damper, for stiff position-controlled robots.
- Time
- O(n) per_step
- Space
- O(n) extra
- Where
- n = the dimension of the task space; the bounds are for one control period and exclude the inner position loop
- Model
- Real RAM
- Properties
- deterministicnot exactonline
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Neville Hogan, 1985
Admittance control is the form of impedance control for robots that accept only position or velocity commands. A force sensor at the wrist measures the contact force. The controller feeds this force into a virtual mass-spring-damper, integrates it once per control period, and sends the resulting position to the robot's own stiff position loop. The robot then moves as the virtual system would: it gives way to a push and returns to its goal when the push stops. It works well in free space and against soft surfaces. Against stiff surfaces it can chatter or bounce, which is the opposite of impedance control with torque commands.
In plain words
Most industrial robots are built to hold a position very stiffly. You cannot tell them "be soft"; you can only tell them where to go. Admittance control adds softness on top. A sensor feels the force on the tool. The controller asks: if the tool were a weight on a spring and a shock absorber, and this force pushed on it, where would it be a moment later? It sends that point to the robot as the next position.
When nothing touches the tool, the spring pulls the point back to the goal. When a person pushes the tool, the point moves along with the push. When the tool presses on a table, the point settles where the spring force equals the contact force.
The problem
The robot has a position loop that makes its task position follow a command closely. A force sensor measures the force that the environment applies to the tool. A goal motion and target matrices , , (symmetric positive definite, usually diagonal) are given. The task is to compute at each control period so that
and so that when the position loop is good. The version below takes , which is the usual case of a fixed or slowly moving goal.
The algorithm
The controller keeps the commanded position and speed as its state, with equal to the measured position and at the start.
ADMITTANCE-STEP(x_c, v_c, x_0, x_0', F, M_a, D_a, K_a, Δt)- 1
a_c ← M_a⁻¹ (F - D_a (v_c - x_0') - K_a (x_c - x_0)) - 2
v_c ← v_c + Δt a_c - 3
x_c ← x_c + Δt v_c ▷ semi-implicit Euler: uses the new v_c - 4
return x_c, v_c ▷ x_c goes to the position loop
Line L3 uses the speed from line L2, which is the semi-implicit (symplectic) Euler method. It is more stable for the lightly damped spring than the explicit Euler step. A velocity-controlled robot takes instead of . In a robot with joint position control, goes through inverse kinematics first.
Example
Take a one-axis Cartesian robot: a mass of 5 kg with a position loop of stiffness N/m and critical damping N s/m. A wall at m acts as a spring of stiffness . The robot starts at rest at 0.98 m, the goal is m, 2 cm inside the wall, and the targets are kg and N/m. The control period is 1 ms, and the plant is simulated with RK4.
In the first period, and , so line L1 gives m/s, line L2 gives m/s, and line L3 gives m.
| case | (N s/m) | (N/m) | first contact (s) | peak force (N) | final behavior |
|---|---|---|---|---|---|
| A | 1000 | 0.707 | 20.49 | rest at 19.608 N | |
| B | 100 | 0.087 | 38.3 | rest at 18.018 N | |
| C | 100 | 0.087 | 155.1 | bounces, force between 0 and 150 N |
At rest, three springs are in series: the environment, the position loop and the virtual spring. The rest force is
which gives 19.608 N for case A and 18.018 N for case B. Case C shows the weak point of admittance control: with the same virtual mass and spring that work on the softer wall in case B, the stiff wall makes the tool bounce for ever. More virtual damping, as in case A, cures it here at the cost of a slow approach.
Correctness
The claim has two parts. First, with an exact force measurement, lines L1 to L3 are one step of a consistent and first-order accurate integrator of the target equation, so as the command converges to the exact solution on every bounded time interval. Second, at a rest point of the whole loop, , and if the position loop is a spring and the environment is a spring , the force is the series formula above. Stability of the loop is not claimed in general: it depends on the inner loop, the period and the environment, and case C shows a failure. The proof file gives the full argument, and also the exact condition under which the discrete virtual dynamics alone are stable in one axis: .
Proof: Admittance control integrates the target dynamics and gives the series rest forcefull
We treat one axis; with diagonal targets the axes are independent, and the same arguments apply to each. Write , , , all positive, and . The goal is fixed in Parts 1 and 3 and has a bounded speed in Part 2.
Part 1 (rest relation). Let and be constant, with . A pair is a fixed point of ADMITTANCE-STEP if and only if and .
Proof. If the pair is fixed, line L3 gives where is the new speed, so , and since the speed is also fixed, . Line L2 then gives , so , and line L1 gives . The converse follows by putting and into lines L1 to L3.
Theorem 1 (rest force against a spring wall). Let the position loop act on the tool as a spring of stiffness toward , and let the wall push with for and otherwise, with . At a rest point of the whole loop, and the force on the wall is
Proof. At rest, the tool is in equilibrium: . The controller is at a fixed point, so by Part 1. If , then , so and , which is a contradiction. So , and with , the force on the wall,
Solving for gives the formula.
Part 2 (first-order accuracy). Let and be Lipschitz functions and their integral, and let solve , , with , . Let be the values after steps, where step uses , and . Then for each there are constants and with for all and .
Proof. Write and with . The function is Lipschitz in with some constant , and the exact solution has a Lipschitz derivative, so with for a constant on . The step of lines L1 to L3 is and , where is the second component of . So it equals the explicit Euler step plus the term in the first component. Let in the sum norm. Subtracting,
As long as , stays in a bounded set, where for a constant . Then , and with the discrete Gronwall bound gives for . Choose so that this bound is at most 1 for . Then, by induction on , the assumption holds at every step, and works.
Theorem 2 (discrete stability of the virtual dynamics). With and a fixed goal , the iteration of lines L1 to L3 tends to from every start if and only if .
Proof. Let and . One step maps to and . This is the linear map with matrix
with trace and determinant . The iteration tends to zero from every start if and only if both roots of have modulus less than 1. By the Jury (Schur-Cohn) test for a real monic quadratic , this holds if and only if , and . Here always holds. is the condition . Given this, , so lies in . So the three conditions together are equivalent to .
The theorem is about the virtual dynamics alone. The whole loop, with the force feedback through the environment and the position loop, has further conditions that depend on , and the loop delay, and it can fail even when this condition holds.
Complexity
In the real-RAM model, with diagonal targets, one control period takes operations and memory, where is the task dimension (at most 6 for a rigid tool). With full target matrices, line L1 solves a linear system with , which takes once if the factorization is stored, and then per period. The force sensor reading, the inverse kinematics and the inner position loop are not counted.
Properties
- Works on position-controlled robots. No torque interface and no dynamic model of the robot are needed. The inner loop hides friction and the robot's own inertia, so the virtual dynamics are reproduced well in free space.
- Good in free space, weak on stiff contact. A light virtual mass makes the robot easy to guide by hand, but against a stiff surface the loop of sensor, virtual dynamics, position loop and environment can become unstable. Impedance control with torque commands has the opposite strengths.
- Bounded rest force. At rest, the force is at most times the depth of the goal inside the surface, as for impedance control.
- Discrete dynamics matter. The virtual system runs in discrete time. Each axis needs , or the integration diverges even without contact. A light virtual mass with large damping breaks this first.
Variants and improvements
- Velocity form. Send to a velocity loop instead of to a position loop.
- Rotations. For the orientation of the tool, integrate the virtual dynamics on the rotation group, with an orientation spring based on the axis-angle error, instead of on Euler angles.
- Admittance in joint space. The same law in joint coordinates, with joint torque sensors, gives a compliant joint behavior on a position-controlled robot.
- Switching or blending with impedance control. Since admittance control is good for soft environments and impedance control for stiff ones, some controllers blend the two forms.
- Direct force tracking. Setting and putting the force error in place of turns the law into an integral force controller along that axis, which is one way to realize the force directions of hybrid position/force control on a position-controlled robot.
When to use it
Use it on industrial arms with stiff joint position servos and a wrist force sensor: hand guiding, contact following on surfaces of moderate stiffness, and assembly with a compliant tool or fixture. If the robot accepts torque commands and the contact is stiff, use impedance control instead. If a precise contact force must be held on a stiff surface, add a low virtual mass only along that axis with a high damping, and check the stability with the real loop rates.
Pitfalls
- Stiff environments. The force feedback loop includes the environment stiffness. Against a stiff surface, a light virtual mass and low damping lead to bouncing, as in case C. Raise the damping or the mass, or add compliance to the tool.
- Delay and filtering. Force sensors are noisy and are often filtered. The filter delay adds to the loop delay and lowers the stability margin.
- Sensor offset and tool weight. The sensor measures the weight of the tool and its inertial forces too. Subtract them, or the robot drifts in free space.
- Large virtual damping slows free motion. The damping that makes contact stable also makes the robot slow to follow a push or to return to the goal.
- Explicit Euler. Updating with the old speed instead of the new one makes the lightly damped virtual spring gain energy at each step.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/admittance-control/. The authors are listed in prov/373QBF.jsonl.
"""Admittance control: a measured force drives a virtual mass-spring-damper.
At each control period the controller integrates the virtual dynamics
Ma xc'' + Da (xc' - x0') + Ka (xc - x0) = F_meas
by one semi-implicit Euler step and sends xc to a stiff position loop.
The test robot is a Cartesian robot: a point mass per axis with a PD
position loop, in contact with a spring wall. Vectors are lists, and the
gains are lists of diagonal entries. Only the standard library.
"""
def admittance_step(xc, vc, x0, x0d, f_meas, ma, da, ka, dt):
"""One control period. Return the new commanded position and speed."""
n = len(xc)
ac = [(f_meas[i] - da[i] * (vc[i] - x0d[i]) - ka[i] * (xc[i] - x0[i])) / ma[i] for i in range(n)] # @line L1
vc = [vc[i] + dt * ac[i] for i in range(n)] # @line L2
xc = [xc[i] + dt * vc[i] for i in range(n)] # @line L3
return xc, vc # @line L4
class CartesianRobot:
"""A point mass m per axis with the position loop u = Kp (xc - x) - Kv x'."""
def __init__(self, mass=5.0, kp=1e5, kv=None):
self.mass = mass
self.kp = kp
self.kv = kv if kv is not None else 2.0 * (kp * mass) ** 0.5
def accel(self, x, xd, xc, f_ext):
return [(self.kp * (xc[i] - x[i]) - self.kv * xd[i] + f_ext[i]) / self.mass for i in range(len(x))]
def wall(x_wall, k_env):
"""A frictionless wall x[0] <= x_wall with stiffness k_env."""
def force(x):
pen = x[0] - x_wall
f = [0.0] * len(x)
if pen > 0.0:
f[0] = -k_env * pen
return f
return force
def free_space(x):
return [0.0] * len(x)
def rk4_step(f, x, dt):
"""One classical Runge-Kutta step for the autonomous system x' = f(x)."""
k1 = f(x)
k2 = f([x[i] + dt / 2 * k1[i] for i in range(len(x))])
k3 = f([x[i] + dt / 2 * k2[i] for i in range(len(x))])
k4 = f([x[i] + dt * k3[i] for i in range(len(x))])
return [x[i] + dt / 6 * (k1[i] + 2 * k2[i] + 2 * k3[i] + k4[i]) for i in range(len(x))]
def simulate(robot, env, goal, x_start, ma, da, ka, dt, periods, substeps=1):
"""Run the controller for a number of periods of length dt.
goal(t) returns (x0, x0'). The sensor reads the wall force at the start
of each period, and xc is held over the period. The plant is integrated
by RK4 with the given number of substeps. Return a list of
(t, x, xc, f_meas) at the start of each period and after the last one.
"""
n = len(x_start)
x, xd = list(x_start), [0.0] * n
xc, vc = list(x_start), [0.0] * n
out = []
h = dt / substeps
for k in range(periods):
t = k * dt
f_meas = env(x)
out.append((t, x, xc, f_meas))
x0, x0d = goal(t)
xc, vc = admittance_step(xc, vc, x0, x0d, f_meas, ma, da, ka, dt)
hold = list(xc)
def plant(s):
p, v = s[:n], s[n:]
return v + robot.accel(p, v, hold, env(p))
s = x + xd
for _ in range(substeps):
s = rk4_step(plant, s, h)
x, xd = s[:n], s[n:]
out.append((periods * dt, x, xc, env(x)))
return out
test_admittance_control.py 88 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/admittance-control/. The authors are listed in prov/373QBF.jsonl.
import math
from admittance_control import CartesianRobot, admittance_step, free_space, simulate, wall
def hold(x0):
return lambda t: ([x0], [0.0])
def series_force(depth, k_env, kp, ka):
return depth / (1.0 / k_env + 1.0 / kp + 1.0 / ka)
def virtual_error(dt, steps):
# Critically damped virtual dynamics under a constant force, against the exact solution.
ma, ka, f = 1.0, 100.0, 5.0
w = math.sqrt(ka / ma)
da = 2.0 * w * ma
xc, vc = [0.0], [0.0]
worst = 0.0
for k in range(steps):
xc, vc = admittance_step(xc, vc, [0.0], [0.0], [f], [ma], [da], [ka], dt)
t = (k + 1) * dt
exact = f / ka * (1.0 - (1.0 + w * t) * math.exp(-w * t))
worst = max(worst, abs(xc[0] - exact))
return worst, xc[0]
def test_virtual_dynamics_first_order_accurate():
e1, end1 = virtual_error(2e-3, 1000)
e2, _ = virtual_error(1e-3, 2000)
assert abs(end1 - 0.05) < 1e-6
assert e1 < 1e-3
assert 1.7 < e1 / e2 < 2.3
def test_free_space_tracks_the_goal():
robot = CartesianRobot()
da = 2.0 * math.sqrt(1000.0) # critical damping of the virtual dynamics
out = simulate(robot, free_space, hold(0.9), [0.8], [1.0], [da], [1000.0], 1e-3, 1000)
_, x, xc, f = out[-1]
assert f[0] == 0.0
assert abs(xc[0] - 0.9) < 1e-3
assert abs(x[0] - xc[0]) < 1e-5
def test_contact_force_is_three_springs_in_series():
robot = CartesianRobot(mass=5.0, kp=1e5)
for k_env in (1e4, 1e5):
out = simulate(robot, wall(1.0, k_env), hold(1.02), [0.98], [1.0], [1000.0], [1000.0], 1e-3, 3000)
force = -out[-1][3][0]
assert abs(force - series_force(0.02, k_env, 1e5, 1000.0)) < 1e-6
def test_light_damping_chatters_on_a_stiff_wall():
robot = CartesianRobot(mass=5.0, kp=1e5)
ranges = []
for k_env in (1e4, 1e5):
out = simulate(robot, wall(1.0, k_env), hold(1.02), [0.98], [1.0], [100.0], [1000.0], 1e-3, 3000)
tail = [-o[3][0] for o in out[-300:]]
ranges.append(max(tail) - min(tail))
if k_env == 1e4:
assert abs(tail[-1] - series_force(0.02, k_env, 1e5, 1000.0)) < 1e-6
assert ranges[0] < 1e-6
assert ranges[1] > 10.0
def test_light_virtual_mass_breaks_the_discrete_integration():
# Semi-implicit Euler needs 2 Da dt + Ka dt^2 < 4 Ma; here the left side is 2.001 > 0.4.
xc, vc = [0.0], [0.0]
for _ in range(200):
xc, vc = admittance_step(xc, vc, [0.0], [0.0], [1.0], [0.1], [1000.0], [1000.0], 1e-3)
assert abs(xc[0]) > 1e6
def test_discrete_stability_boundary():
# Ma = 1, Ka = 1000, dt = 1 ms: the bound 2 Da dt + Ka dt^2 < 4 Ma gives Da < 1999.5.
ends = []
for da in (1990.0, 2010.0):
xc, vc = [1.0], [0.0]
for _ in range(3000):
xc, vc = admittance_step(xc, vc, [0.0], [0.0], [0.0], [1.0], [da], [1000.0], 1e-3)
ends.append(abs(xc[0]) + abs(vc[0]))
assert ends[0] < 0.5 # the slow overdamped mode decays like exp(-t / 2)
assert ends[1] > 1e3
History
Hogan's 1985 papers on impedance control described the impedance and the admittance as the two causal forms of the same interaction law and argued that the robot should be the impedance. Robots with stiff position servos cannot take a torque command, so the admittance form, with an outer force loop around the position loop, became the usual way to give them compliant behavior. Textbooks such as Siciliano et al. present it as impedance control with an inner position loop, and Lynch and Park give it as the admittance-control algorithm.
References
- Kevin M. Lynch and Frank C. Park, Modern Robotics, Mechanics, Planning, and Control, Cambridge University Press, 2017, Chapter 11, Section 11.7.2 (admittance-control algorithm)
- Neville Hogan, Impedance control: an approach to manipulation: Part I, Theory, Journal of Dynamic Systems, Measurement, and Control 107(1), 1985, pages 1 to 7
- Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani and Giuseppe Oriolo, Robotics, Modelling, Planning and Control, Springer, 2009, Chapter 9 (force control, impedance control with an inner position loop)
- Bruno Siciliano and Oussama Khatib (editors), Springer Handbook of Robotics, second edition, Springer, 2016, Chapter 9 (Force Control, by Luigi Villani and Joris De Schutter)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 373QBF Edit this page History Report an error Markdown