Part IV · 第 13 章 反馈控制 · 13.5Part IV · Ch. 13 Feedback Control · 13.5

阻抗与导纳控制Impedance & Admittance Control

机器人一旦接触世界,单纯控制位置或单纯控制力都会出问题:位置差 1 毫米压在钢板上就是上千牛的力,力控制在空中没有东西可推就会一路加速。阻抗控制换一个问题来问:不规定位置,也不规定力,而是规定两者之间的关系,让手爪表现得像一个"质量–弹簧–阻尼"。这一节先看这个目标行为,再看它的两种实现:力矩控制的机器人用阻抗控制(测运动、出力),位置控制的机器人配力传感器用导纳控制(测力、出运动);然后看它们碰到软泡沫和硬钢板时谁会失稳、为什么,用无源性(能量)把稳定性讲清楚,最后在两连杆臂上做笛卡尔阻抗,并和力/位混合控制对比。 Once a robot touches the world, controlling only position or only force goes wrong: a 1 mm position error against a steel plate means over a thousand newtons, and a force controller with nothing to push against just accelerates away. Impedance control asks a different question: prescribe neither position nor force, but the relation between them, so that the gripper behaves like a mass–spring–damper. This lesson first looks at that target behaviour, then at its two implementations: impedance control on torque-controlled robots (measure motion, command force) and admittance control on position-controlled robots with a force sensor (measure force, command motion). Then it asks which of them goes unstable against soft foam and hard steel and why, explains stability with passivity (energy), and finally runs Cartesian impedance on a two-link arm and compares it with hybrid force/position control.

约 40 分钟~40 min 前置:7.6 静力学与 wrench · 8.3 质量矩阵与科氏力 · 8.4 接触与摩擦 · 9.4 执行器与传感器 · 13.1 PID 控制 · 13.2 状态空间与稳定性Prereqs: 7.6 Statics & wrenches · 8.3 Mass matrix & Coriolis terms · 8.4 Contact & friction · 9.4 Actuators & sensors · 13.1 PID control · 13.2 State space & stability 6 个交互6 interactives

    1为什么机器人需要它Why robots need this

    13.1–13.4 节的控制器都在回答"怎样让机器人到达指定的位置(或状态)"。只要机器人在空中运动,这就是对的问题。可是擦桌子、插销钉、开门、拧螺丝、和人握手、腿落地,这些动作的本质是接触,而接触时位置和力被环境绑在了一起:

    • 纯位置控制太硬。环境的位置只知道到毫米级,而环境常常比机器人还硬。钢板的接触刚度约 \(2\times10^6\) N/m(8.4 节的惩罚接触模型),位置指令差 1 mm,伺服就会把接触力推到上千牛,直到电机饱和或者什么东西坏掉。
    • 纯力控制太软。"一直用 10 N 向下压"在接触时很好,可一旦表面不在预想的位置(或者滑出了桌边),力控制方向上没有任何位置参考,手爪会一路加速,直到撞上东西。

    Hogan(1985)的回答是:既不控制位置,也不控制力,而是控制两者之间的关系,也就是机器人在接触点表现出来的动态行为,即机械阻抗。最常用的目标是"让手爪像一个挂在弹簧和阻尼器上的质量块,弹簧的另一端固定在 \(\mathbf x_0\)":在空中,它回到 \(\mathbf x_0\);碰到东西,它以约 \(K(\mathbf x_0-\mathbf x)\) 的力去推;被撞一下,它退让后再回来;人推它,它像一个弹簧一样顺从。这类行为在机器人里随处可见:

    • 接触作业:打磨、抛光、装配、插孔,要求法向柔顺、切向精确。
    • 人机协作:协作臂的手拖示教、碰撞后退让,都要求机器人"软"。
    • 腿式机器人:把腿当作一根虚拟弹簧,落地冲击由控制器"吸收"。
    • 力觉遥操作与触觉设备:渲染一面虚拟墙,就是渲染一个很硬的阻抗。
    • 机器人学习:很多接触任务的策略直接输出阻抗控制器的目标点和刚度,而不是关节力矩。

    同一个目标行为有两种实现方式,取决于手里的硬件。阻抗控制测量运动、输出力:适合力矩控制、可反向驱动的机器人(9.4 节)。导纳控制测量力、输出运动:适合减速比大、只能精确跟踪位置的工业机器人,外加一个腕部力/力矩传感器(7.6 节)。本节先用一维的"手爪 + 墙"把这两种实现和它们的稳定性讲清楚,再回到 8.3 节的两连杆臂。

    The controllers of Lessons 13.1–13.4 answer "how do I bring the robot to a given position (or state)?" As long as the robot moves through free space, that is the right question. But wiping a table, inserting a peg, opening a door, driving a screw, shaking a hand or landing a foot are all about contact, and in contact the environment ties position and force together:

    • Pure position control is too stiff. The environment's position is known to a millimetre at best, and the environment is often stiffer than the robot. A steel plate has a contact stiffness of about \(2\times10^6\) N/m (the penalty contact model of Lesson 8.4), so a 1 mm error in the position command makes the servo push the contact force to over a thousand newtons, until a motor saturates or something breaks.
    • Pure force control is too soft. "Always press down with 10 N" is fine in contact, but if the surface is not where it was expected (or the tool slides off the edge of the table), the force-controlled direction has no position reference at all and the gripper accelerates until it hits something.

    Hogan's answer (1985): control neither position nor force, but the relation between them, the dynamic behaviour the robot presents at the contact point, its mechanical impedance. The most common target is "make the gripper behave like a mass hung on a spring and a damper whose other end is anchored at \(\mathbf x_0\)". In free space it returns to \(\mathbf x_0\); against an obstacle it pushes with about \(K(\mathbf x_0-\mathbf x)\); bumped, it yields and comes back; pushed by a person, it gives way like a spring. Such behaviour is everywhere in robotics:

    • Contact tasks: grinding, polishing, assembly and peg-in-hole need compliance along the surface normal and precision along the surface.
    • Human–robot collaboration: hand-guiding a cobot and yielding after a collision both need a "soft" robot.
    • Legged robots: a leg treated as a virtual spring lets the controller "absorb" the landing impact.
    • Haptics and force-feedback teleoperation: rendering a virtual wall means rendering a very stiff impedance.
    • Robot learning: many contact-rich policies output the set point and stiffness of an impedance controller instead of joint torques.

    The same target behaviour has two implementations, depending on the hardware. Impedance control measures motion and commands force: it suits torque-controlled, backdrivable robots (Lesson 9.4). Admittance control measures force and commands motion: it suits industrial robots with large gear ratios that can only track positions precisely, plus a wrist force/torque sensor (Lesson 7.6). The lesson first uses a one-dimensional "tool + wall" to make both implementations and their stability clear, then returns to the two-link arm of Lesson 8.3.

    2直觉:手爪应该"像什么"Intuition: what should the gripper feel like?

    先忘掉机器人,只看我们希望手爪表现出的行为。沿一个方向,手爪位置是 \(x\),外界(人手、墙)施加的力是 \(f_{\mathrm{ext}}\)。我们希望它满足

    Forget the robot for a moment and look only at the behaviour we want the gripper to show. Along one direction let the gripper position be \(x\) and the force from the outside (a hand, a wall) be \(f_{\mathrm{ext}}\). We want

    $$ \hl{md}{m_d}\,\ddot x\;+\;\hl{dd}{d}\,\dot x\;+\;\hl{kd}{k}\,(x-x_0)\;=\;\hl{fext}{f_{\mathrm{ext}}} . $$

    三个参数各管一件事。刚度 \(k\)(N/m):推开 1 m 要多大的力,静止时的变形是 \(f_{\mathrm{ext}}/k\)。阻尼 \(d\)(N·s/m):抵抗速度,决定被推开后回来时晃不晃。目标质量 \(m_d\)(kg):抵抗加速度,决定推起来"有多沉"。这正是 2.5 节的二阶常微分方程:自然频率 \(\omega_n=\sqrt{k/m_d}\),阻尼比 \(\zeta=d/(2\sqrt{k\,m_d})\)。\(\zeta<1\) 时被敲一下会振荡,\(\zeta=1\) 时最快且不超调地回到 \(x_0\),\(\zeta>1\) 时慢吞吞地爬回去。

    下图里,滑块是一个"理想的"目标系统(还没有机器人)。拖动方块就是用手推它,松手后看它怎么回来;"敲一下"给它 1 N·s 的冲量;"持续推 20 N"施加一个恒力。上方是方块和弹簧、阻尼器,下方是位移随时间的曲线。

    Each parameter has one job. The stiffness \(k\) (N/m): how much force it takes to push it 1 m away; at rest the deflection is \(f_{\mathrm{ext}}/k\). The damping \(d\) (N·s/m): resists velocity and decides whether it rings when it comes back. The target mass \(m_d\) (kg): resists acceleration and decides how "heavy" it feels to push. This is the second-order ODE of Lesson 2.5, with natural frequency \(\omega_n=\sqrt{k/m_d}\) and damping ratio \(\zeta=d/(2\sqrt{k\,m_d})\). With \(\zeta<1\) a tap makes it oscillate, with \(\zeta=1\) it returns to \(x_0\) as fast as possible without overshoot, and with \(\zeta>1\) it creeps back slowly.

    In the figure the slider is an "ideal" target system (no robot yet). Dragging the block is pushing it by hand; let go and watch it return. "Tap" gives it an impulse of 1 N·s, "Hold 20 N" applies a constant force. The top shows the block with its spring and damper, the bottom its displacement over time.

    FIG 1目标阻抗:一个可以推的质量–弹簧–阻尼The target impedance: a mass–spring–damper you can push
    拖动方块 = 用手推DRAG THE BLOCK = PUSH BY HAND
    x − x₀ (cm) vs 时间 (s)x − x₀ (cm) vs. TIME (s)
    上:绿色锯齿是弹簧 \(k\),紫色活塞是阻尼器 \(d\),它们的左端固定在虚线 \(x_0\) 左边 0.3 m 处;方块越大,目标质量 \(m_d\) 越大;琥珀色箭头是手的力 \(f_{\mathrm{ext}}\)。下:琥珀色曲线是 \(x-x_0\),持续推力打开时青色虚线标出静态变形 \(f_{\mathrm{ext}}/k\)。仿真步长 1 ms(固定步长,与帧率无关),行程两端 ±45 cm 有机械限位。 Top: the green zigzag is the spring \(k\) and the purple piston the damper \(d\); their left ends are anchored 0.3 m to the left of the dashed line \(x_0\). A bigger block means a larger target mass \(m_d\); the amber arrow is the hand force \(f_{\mathrm{ext}}\). Bottom: the amber curve is \(x-x_0\); while the constant push is on, the cyan dashed line marks the static deflection \(f_{\mathrm{ext}}/k\). The simulation uses a fixed 1 ms step (independent of frame rate), with end stops at ±45 cm.
    试一试Try this
    • 调节阻尼 \(d\),让阻尼比 \(\zeta\) 落在 0.9 到 1.1 之间,然后"敲一下"或者拖开方块再松手:它回来时不再振荡。对默认的 \(m_d=2\) kg、\(k=250\) N/m,需要多大的 \(d\)?Adjust the damping \(d\) until the damping ratio \(\zeta\) is between 0.9 and 1.1, then "Tap" or drag the block away and let go: it comes back without ringing. For the default \(m_d=2\) kg and \(k=250\) N/m, what \(d\) does that take?
    • 打开"持续推 20 N",调节刚度,让方块静止时的变形正好是 5 cm(误差 ±5 mm,等它停稳)。你选的 \(k\) 是多少?\(m_d\) 和 \(d\) 对这个变形有影响吗?Switch on "Hold 20 N" and adjust the stiffness so that the block settles at a deflection of exactly 5 cm (within ±5 mm, wait until it stops). Which \(k\) did you pick? Do \(m_d\) and \(d\) affect this deflection?
    核心洞见Key insight

    阻抗控制器既不固定 \(x\),也不固定 \(f\),而是固定它们之间的一条关系。机器人最终停在哪、用多大的力推,由环境决定:在空中 \(f_{\mathrm{ext}}=0\),于是 \(x=x_0\);顶在墙上,\(x\) 被墙挡住,于是 \(f=k(x_0-x)\)。设计者通过 \(x_0\) 和 \(k\) 同时表达了"大致想去哪"和"愿意用多大的力去争取"。

    An impedance controller fixes neither \(x\) nor \(f\); it fixes a relation between them. Where the robot ends up and how hard it pushes are decided by the environment: in free space \(f_{\mathrm{ext}}=0\), so \(x=x_0\); against a wall, the wall holds \(x\) back, so \(f=k(x_0-x)\). Through \(x_0\) and \(k\) the designer states both "roughly where I want to go" and "how hard I am willing to fight for it".

    3动手玩:同一个目标,两种实现Play: one target, two implementations

    FIG 1 里的方块是理想的。真实的手爪背后是一台机器人,控制器只能通过电机让它产生这个行为。根据"测什么、发什么指令",有两条路:

    • 阻抗控制(测运动,出力)。每个控制周期读出位置和速度,按目标方程算出该出的力 \(u=k(x_0-x)-d\,\dot x\),直接发给力矩控制的电机。机器人的物理质量就是目标质量(不另做"惯量整形")。前提是电机力矩能如实到达手爪:低减速比、低摩擦、可反向驱动(9.4 节),否则摩擦会吃掉一部分力。
    • 导纳控制(测力,出运动)。腕部力/力矩传感器测出外力 \(f\),把它输入一个"虚拟的"质量–弹簧–阻尼 \(m_a\ddot x_c+d_a\dot x_c+k(x_c-x_0)=f\),积分出参考位置 \(x_c\),再交给机器人原有的高增益位置伺服去跟踪。减速比大、摩擦大的工业机器人也能用:伺服本身就能压住摩擦,虚拟质量 \(m_a\) 也可以随意选。

    下图是一维的版本:手爪沿导轨运动,右边 \(x_w=30\) cm 处有一面墙,琥珀色手柄是设定点 \(x_0\)。把 \(x_0\) 拖进墙里,手爪就会顶着墙出力。阻抗模式下的机器人是 3 kg 的可反向驱动手爪;导纳模式下是一台大减速比的工业机器人,反射到手爪的质量为 40 kg(9.4 节的 \(N^2J_m\)),位置伺服带宽 15 Hz。两种模式都以 1 kHz 运行控制器、带 1 ms 计算延迟,都用同一个刚度 \(k\) 和阻尼比 0.7。

    FIG 1's block is ideal. A real gripper has a robot behind it, and the controller can only produce this behaviour through motors. Depending on "what is measured and what is commanded" there are two routes:

    • Impedance control (measure motion, command force). Every control period, read the position and velocity, compute the force the target equation asks for, \(u=k(x_0-x)-d\,\dot x\), and send it straight to torque-controlled motors. The robot's physical mass is the target mass (no "inertia shaping"). The premise is that motor torque actually reaches the gripper: a low gear ratio, little friction, a backdrivable joint (Lesson 9.4); otherwise friction eats part of the force.
    • Admittance control (measure force, command motion). A wrist force/torque sensor measures the external force \(f\), which drives a "virtual" mass–spring–damper \(m_a\ddot x_c+d_a\dot x_c+k(x_c-x_0)=f\); integrating it gives a reference position \(x_c\), which the robot's existing high-gain position servo tracks. This works on industrial robots with large gear ratios and lots of friction: the servo itself overpowers the friction, and the virtual mass \(m_a\) can be chosen freely.

    The figure is the one-dimensional version: the gripper slides on a rail, a wall stands at \(x_w=30\) cm on the right, and the amber handle is the set point \(x_0\). Drag \(x_0\) into the wall and the gripper pushes against it. In impedance mode the robot is a 3 kg backdrivable gripper; in admittance mode it is an industrial robot with a large gear ratio, a reflected mass of 40 kg at the gripper (the \(N^2J_m\) of Lesson 9.4) and a 15 Hz position servo. Both modes run the controller at 1 kHz with 1 ms of computation delay, and both use the same stiffness \(k\) and damping ratio 0.7.

    FIG 2阻抗 vs 导纳:顶着墙会发生什么Impedance vs. admittance: pushing against a wall
    拖动琥珀色手柄 x₀DRAG THE AMBER HANDLE x₀
    上:灰色方块是手爪,带斜线的区域是墙(悬停公式里的 \(k_e\) 会高亮它),蓝色箭头是墙对手爪的接触力,紫色空心框是导纳模式下的参考位置 \(x_c\)。下:过去 3 秒的位置 \(x\)(琥珀色,cm,虚线是墙面)和接触力(蓝色,N,纵轴自动缩放)。四种表面的接触刚度分别是 \(2\times10^3\)、\(2\times10^4\)、\(2\times10^5\)、\(2\times10^6\) N/m,带少量阻尼;接触是单向的(只能推不能拉)。阻抗模式电机力上限 150 N,导纳模式 2000 N;关节摩擦是库仑摩擦(带静摩擦)。右侧的 \(\rho\) 是把接触当作线性弹簧、去掉摩擦后,闭环每 1 ms 的谱半径:\(\rho<1\) 稳定,\(\rho>1\) 发散。 Top: the grey block is the gripper, the hatched region the wall (hovering \(k_e\) in the formulas highlights it), the blue arrow the contact force of the wall on the gripper, and the hollow purple frame the reference position \(x_c\) in admittance mode. Bottom: the last 3 seconds of position \(x\) (amber, cm; the dashed line is the wall face) and contact force (blue, N, auto-scaled). The four surfaces have contact stiffnesses \(2\times10^3\), \(2\times10^4\), \(2\times10^5\) and \(2\times10^6\) N/m with a little damping; contact is unilateral (it can push, not pull). Motor force is limited to 150 N in impedance mode and 2000 N in admittance mode; joint friction is Coulomb friction (with stiction). The \(\rho\) on the right is the spectral radius per 1 ms of the closed loop with the contact treated as a linear spring and friction removed: \(\rho<1\) is stable, \(\rho>1\) diverges.
    试一试Try this
    • 阻抗模式,表面选"钢",把 \(x_0\) 拖进墙里至少 3 cm:接触力平稳下来(最近 0.5 s 的峰峰值小于 1 N),并且等于 \(k(x_0-x_w)\),误差不超过摩擦力 \(f_c\) 加 1 N。墙比控制器硬一千倍,为什么没有问题?Impedance mode, surface "steel", drag \(x_0\) at least 3 cm into the wall: the contact force settles (peak-to-peak below 1 N over the last 0.5 s) at \(k(x_0-x_w)\), within the friction force \(f_c\) plus 1 N. The wall is a thousand times stiffer than the controller; why is that no problem?
    • 切换到导纳模式,保持钢墙(或木头),让手爪顶在墙上:它开始剧烈"打颤"(最近 0.5 s 接触力峰峰值超过 100 N)。再换成泡沫试试。Switch to admittance mode, keep the steel (or wood) wall and push the gripper against it: it starts to "chatter" violently (contact force peak-to-peak above 100 N over the last 0.5 s). Then try foam.
    • 把摩擦 \(f_c\) 调到 15 N 以上、刚度 \(k\le600\) N/m,在空中(不碰墙)把 \(x_0\) 拖动几厘米以上,等手爪停稳,分别在两种模式下看位置误差 \(|x-x_0|\):阻抗模式超过 1 cm,导纳模式小于 1 mm。Set the friction \(f_c\) above 15 N and the stiffness \(k\le600\) N/m, move \(x_0\) by more than a few centimetres in free space (away from the wall), let the gripper stop, and compare the position error \(|x-x_0|\) in the two modes: above 1 cm in impedance mode, below 1 mm in admittance mode.
    核心洞见Key insight

    两种实现是对偶的,各有一个软肋。阻抗控制在硬接触里很稳(墙越硬,它越像一个顶在硬物上的弹簧),但在空中的精度取决于硬件:摩擦 \(f_c\) 会留下最大 \(f_c/k\) 的位置误差(15 N、500 N/m 时实测约 2–3 cm,取决于 \(x_0\) 移动了多远)。导纳控制靠高增益伺服压住摩擦,空中精度很高(同样条件下约 0.04 mm),但它把位置伺服和环境串进了同一个回路:环境越硬、虚拟质量越轻,这个回路的增益越高,最终失稳。选哪一种,首先看你手里的是力矩控制的机器人还是位置控制的机器人。

    The two implementations are duals, each with one weak spot. Impedance control is very calm in stiff contact (the stiffer the wall, the more it looks like a spring pressed against a rigid object), but its free-space accuracy depends on the hardware: friction \(f_c\) leaves a position error of up to \(f_c/k\) (measured at about 2–3 cm with 15 N and 500 N/m, depending on how far \(x_0\) moved). Admittance control overpowers friction with its high-gain servo and is very precise in free space (about 0.04 mm under the same conditions), but it puts the position servo and the environment into one loop: the stiffer the environment and the lighter the virtual mass, the higher that loop's gain, until it goes unstable. Which one to use depends first on whether your robot is torque-controlled or position-controlled.

    4第二、第三视角:接触稳定性与能量Second and third views: contact stability and energy

    稳定性地图:谁在什么环境里会失稳A stability map: who goes unstable against what

    FIG 2 的打颤不是偶然。把接触当作线性弹簧 \(k_e\)、去掉摩擦,整个系统(机器人 + 控制器 + 1 ms 延迟 + 墙)就是一个线性离散系统 \(\mathbf z_{k+1}=A\,\mathbf z_k\)。13.2 节说过,它稳定当且仅当 \(A\) 的所有特征值都在单位圆内,也就是谱半径 \(\hl{rho}{\rho(A)}<1\)。下图对每一组参数算出 \(\rho\),画成地图:横轴是环境刚度 \(k_e\)(对数),纵轴是导纳控制的虚拟质量 \(m_a\),或者阻抗控制要渲染的刚度 \(k\)。青色越深,扰动衰减得越快;红色越深,发散得越快;实线是 \(\rho=1\) 的稳定边界。

    拖动琥珀色标记,右侧是该点的非线性仿真:手爪从刚好接触墙面开始,设定点在墙内 4 cm,画出 1.5 秒的接触力。

    FIG 2's chatter is no accident. Treat the contact as a linear spring \(k_e\) and drop friction, and the whole system (robot + controller + 1 ms delay + wall) is a linear discrete-time system \(\mathbf z_{k+1}=A\,\mathbf z_k\). As Lesson 13.2 showed, it is stable exactly when every eigenvalue of \(A\) lies inside the unit circle, i.e. when the spectral radius \(\hl{rho}{\rho(A)}<1\). The figure computes \(\rho\) for every parameter pair and paints it as a map: the horizontal axis is the environment stiffness \(k_e\) (log scale), the vertical axis is the admittance controller's virtual mass \(m_a\), or the stiffness \(k\) the impedance controller tries to render. More cyan means disturbances die out faster; more red means they grow faster; the solid line is the stability boundary \(\rho=1\).

    Drag the amber marker; the panel on the right is a nonlinear simulation at that point: the gripper starts just touching the wall with its set point 4 cm inside, and the plot shows 1.5 seconds of contact force.

    FIG 3接触稳定性地图Contact stability map
    接触力 (N),1.5 sCONTACT FORCE (N), 1.5 s
    机器人和控制器与 FIG 2 相同:导纳地图用 40 kg、15 Hz 伺服的工业机器人(\(k=500\) N/m),阻抗地图用 3 kg 的手爪;阻尼比都是 0.7。竖直虚线是 FIG 2 的四种表面。"延迟"是控制器从测量到输出的额外延迟(1–5 个周期)。每个格子的 \(\rho\) 由线性化系统矩阵 \(A\) 反复平方求得(\(\rho=\lim\|A^n\|^{1/n}\),\(n=2^{16}\))。 Robots and controllers are those of FIG 2: the admittance map uses the 40 kg industrial robot with its 15 Hz servo (\(k=500\) N/m), the impedance map the 3 kg gripper; both use damping ratio 0.7. The dashed vertical lines are FIG 2's four surfaces. "Delay" is the extra delay from measurement to output (1–5 control periods). Each cell's \(\rho\) comes from repeatedly squaring the linearized system matrix \(A\) (\(\rho=\lim\|A^n\|^{1/n}\), \(n=2^{16}\)).
    试一试Try this
    • 导纳地图:把标记放到钢附近(\(k_e\ge10^6\) N/m),找出能让它稳定的最小虚拟质量(标记必须在稳定区,且 \(m_a\le60\) kg)。这么重的虚拟质量,在空中被人推的时候会是什么感觉?Admittance map: put the marker near steel (\(k_e\ge10^6\) N/m) and find the smallest virtual mass that is stable there (the marker must be in the stable region with \(m_a\le60\) kg). How would such a heavy virtual mass feel when a person pushes it in free space?
    • 阻抗地图:把延迟调到 3 ms 或更多,在软环境(\(k_e\le10^4\) N/m)里找一个不稳定的点,要求渲染刚度 \(k\le3\times10^5\) N/m。阻抗控制的稳定边界主要取决于哪个轴?Impedance map: set the delay to 3 ms or more and find an unstable point in a soft environment (\(k_e\le10^4\) N/m) with rendered stiffness \(k\le3\times10^5\) N/m. Which axis mainly decides impedance control's stability boundary?

    两张地图的形状完全不同。导纳控制的不稳定区在右边:环境越硬越危险,提高虚拟质量才能把边界往右推。经验法则是:导纳回路的穿越频率约为 \(\omega_c\approx\sqrt{k_{\mathrm{eff}}/m_a}\),其中 \(k_{\mathrm{eff}}=k_ek_s/(k_e+k_s)\) 是环境和伺服刚度 \(k_s=m\omega_s^2\approx3.6\times10^5\) N/m 串联后的刚度;它必须低于伺服带宽 \(\omega_s=94\) rad/s。在这个实验里,延迟 1 ms 时,从 \(k_e=10^4\) 到 \(2\times10^6\) N/m,稳定边界上的 \(\omega_c/\omega_s\) 在 0.53 到 0.95 之间。钢上需要约 38 kg 的虚拟质量,木头约 36 kg,而泡沫在图中最轻的 0.3 kg 时仍然稳定。阻抗控制的不稳定区在上边:主要由要渲染的刚度和延迟决定,与环境关系不大。软环境里,延迟 1 ms 时上限约 \(7.3\times10^5\) N/m,3 ms 时降到约 \(1.3\times10^5\) N/m,5 ms 时约 \(5.4\times10^4\) N/m,量级是 \(m/T_d^2\)(\(T_d\) 为总延迟);只有在最硬的表面附近,接触共振才会把上限再压低一些(1 ms 延迟、钢上约 \(3.4\times10^5\) N/m)。

    The two maps have completely different shapes. For admittance control the unstable region is on the right: the stiffer the environment the more dangerous, and only a larger virtual mass pushes the boundary to the right. A rule of thumb: the admittance loop crosses over near \(\omega_c\approx\sqrt{k_{\mathrm{eff}}/m_a}\), where \(k_{\mathrm{eff}}=k_ek_s/(k_e+k_s)\) is the environment in series with the servo stiffness \(k_s=m\omega_s^2\approx3.6\times10^5\) N/m, and it must stay below the servo bandwidth \(\omega_s=94\) rad/s. In this lab, with 1 ms of delay and \(k_e\) from \(10^4\) to \(2\times10^6\) N/m, the ratio \(\omega_c/\omega_s\) on the stability boundary lies between 0.53 and 0.95. Steel needs about 38 kg of virtual mass, wood about 36 kg, while foam is still stable at the map's lightest 0.3 kg. For impedance control the unstable region is at the top: it is set mainly by the stiffness to be rendered and by the delay, and depends little on the environment. In soft environments the limit is about \(7.3\times10^5\) N/m with 1 ms of delay, about \(1.3\times10^5\) N/m with 3 ms and about \(5.4\times10^4\) N/m with 5 ms, of the order of \(m/T_d^2\) (\(T_d\) the total delay); only near the stiffest surfaces does the contact resonance lower it somewhat (about \(3.4\times10^5\) N/m on steel with 1 ms of delay).

    能量视角:无源性,以及为什么"变刚度"会出事The energy view: passivity, and why "varying the stiffness" can go wrong

    为什么阻抗控制几乎不怕硬墙?用能量看最清楚。一个弹簧–阻尼–质量在外力作用下,储存的能量 \(H=\tfrac12m\dot x^2+\tfrac12k(x-x_0)^2\) 满足 \(\dot H=-d\,\dot x^2+f_{\mathrm{ext}}\dot x\):它只会耗散能量,或者把外界给它的能量存起来再还回去,自己不产生能量。这种系统叫无源的。墙(弹簧加阻尼)也是无源的。两个无源系统连在一起,总能量只减不增,所以不会发散,无论墙有多硬。这就是 Colgate 与 Hogan(1988)的耦合稳定性结论:只要机器人在接触点表现为无源,它和任何无源环境接触都是稳定的。FIG 3 里的不稳定,全部来自让控制器"不无源"的因素:延迟、采样、导纳回路里伺服的相位滞后。

    无源性还揭示了一个不那么显然的陷阱:在线改变刚度。变阻抗控制很有用(插孔时先软后硬、人走近时变软、学习出来的策略每一步输出刚度),但 \(H\) 的变化里多了一项:

    Why is impedance control nearly immune to stiff walls? Energy makes it clearest. A spring–damper–mass under an external force stores the energy \(H=\tfrac12m\dot x^2+\tfrac12k(x-x_0)^2\), which obeys \(\dot H=-d\,\dot x^2+f_{\mathrm{ext}}\dot x\): it can only dissipate energy, or store energy given to it and hand it back; it never creates energy. Such a system is called passive. The wall (spring plus damper) is passive too. Connect two passive systems and their total energy can only decrease, so nothing diverges, however stiff the wall. That is the coupled-stability result of Colgate and Hogan (1988): if the robot behaves passively at the contact point, contact with any passive environment is stable. Every instability in FIG 3 comes from something that makes the controller non-passive: delay, sampling, the servo's phase lag inside the admittance loop.

    Passivity also exposes a less obvious trap: changing the stiffness online. Variable impedance is useful (soft then stiff during insertion, softer when a person approaches, a learned policy that outputs a stiffness every step), but the change of \(H\) gains a term:

    $$ \dot H \;=\; -\,d\,\dot x^2 \;+\; f_{\mathrm{ext}}\,\dot x \;+\; \hl{Kdot}{\tfrac12\,\dot k\,(x-x_0)^2} . $$

    弹簧被拉长时把它变硬,等于凭空往系统里注入能量。如果刚度按 \(k(t)=\bar k\,(1+a\sin\Omega t)\) 周期变化,而 \(\Omega\approx2\omega_n\),每个周期都在"弹簧最长时变硬、最短时变软",就像荡秋千时在最低点站起来:这是参数共振(Mathieu 方程)。线性分析给出近似阈值 \(a>4\zeta\):调制深度超过阻尼比的四倍,振幅就指数增长。

    补救的办法之一是能量罐(Ferraguti 等,2013):给控制器配一个虚拟的"能量账户" \(T\)。阻尼耗散掉的能量存进罐子;刚度变化要注入能量 \(\tfrac12\dot k(x-x_0)^2>0\) 时,从罐子里扣;罐子快空时就暂停刚度变化。这样 \(H+T\) 永远不增加,系统保持无源。下图的质量 1 kg、平均刚度 100 N/m(\(\omega_n=10\) rad/s),从 \(x=10\) cm 静止释放。

    Stiffening a spring while it is stretched pumps energy into the system out of nowhere. If the stiffness varies periodically, \(k(t)=\bar k\,(1+a\sin\Omega t)\), with \(\Omega\approx2\omega_n\), every cycle stiffens the spring when it is longest and softens it when it is shortest, like standing up at the bottom of a swing: this is parametric resonance (the Mathieu equation). Linear analysis gives the approximate threshold \(a>4\zeta\): if the modulation depth exceeds four times the damping ratio, the amplitude grows exponentially.

    One remedy is an energy tank (Ferraguti et al., 2013): give the controller a virtual "energy account" \(T\). Energy dissipated by the damper is deposited in the tank; when a stiffness change would inject energy, \(\tfrac12\dot k(x-x_0)^2>0\), it is withdrawn from the tank; when the tank is nearly empty, the stiffness change is paused. Then \(H+T\) never increases and the system stays passive. In the figure the mass is 1 kg with average stiffness 100 N/m (\(\omega_n=10\) rad/s), released from rest at \(x=10\) cm.

    FIG 4变刚度、参数共振与能量罐Variable stiffness, parametric resonance and an energy tank
    弹簧粗细 ∝ 当前刚度 k(t)SPRING WIDTH ∝ CURRENT STIFFNESS k(t)
    左:方块在弹簧上振动,右侧竖条是能量罐 \(T\)(上限 1 J,初值 0.5 J)。右上:过去 10 秒的系统能量 \(H\)(琥珀色)和罐中能量 \(T\)(青色),纵轴是对数刻度,\(10^{-3}\) 到 \(10^{3}\) J。右下:实际刚度 \(k/\bar k\)(绿色)与刚度变化注入的功率 \(\tfrac12\dot k(x-x_0)^2\)(紫色,正值 = 注入)。能量超过 \(10^3\) J 时仿真停止并标为"发散"。步长 1 ms。 Left: the block oscillates on its spring; the bar on the right is the energy tank \(T\) (capacity 1 J, starting at 0.5 J). Top right: the last 10 seconds of system energy \(H\) (amber) and tank energy \(T\) (cyan), on a log scale from \(10^{-3}\) to \(10^{3}\) J. Bottom right: the actual stiffness \(k/\bar k\) (green) and the power injected by the stiffness change, \(\tfrac12\dot k(x-x_0)^2\) (purple, positive = injected). Once the energy exceeds \(10^3\) J the simulation stops and is marked "diverged". Step 1 ms.
    试一试Try this
    • 关掉能量罐,调节调制频率 \(\Omega/\omega_n\)(保持 \(a=0.5\)、\(\zeta=0.05\)),让系统能量增长到初始值 0.5 J 的 10 倍以上。哪个频率比最危险?\(\Omega=\omega_n\) 时会怎样?With the tank off, adjust the modulation frequency \(\Omega/\omega_n\) (keep \(a=0.5\), \(\zeta=0.05\)) until the system energy grows to more than 10 times its initial 0.5 J. Which frequency ratio is the most dangerous? What happens at \(\Omega=\omega_n\)?
    • 保持危险的调制(\(a\ge0.4\),\(\Omega/\omega_n\) 在 1.8 到 2.2 之间),打开能量罐并按"复位",让它运行 10 秒以上:系统能量始终不超过 1.05 J。刚度曲线发生了什么变化?Keep a dangerous modulation (\(a\ge0.4\), \(\Omega/\omega_n\) between 1.8 and 2.2), switch the tank on, press "Reset" and let it run for more than 10 seconds: the system energy never exceeds 1.05 J. What happened to the stiffness curve?
    一个概念,三个视角One idea, three views

    力学视角:阻抗控制器是一个看不见的弹簧–阻尼–质量,挂在 \(\mathbf x_0\) 和手爪之间。频域视角:机械阻抗 \(Z(s)=F(s)/V(s)=m_ds+d+k/s\)(力比速度),低频时由 \(k/s\) 主导(像弹簧),中频由 \(d\) 主导(像阻尼器),高频由 \(m_ds\) 主导(像质量);导纳 \(Y=1/Z\) 则是"力进、速度出"。能量视角:阻抗是一个"能量端口",功率 \(f_{\mathrm{ext}}\dot x\) 流进流出;只要控制器不凭空造能量(无源),和任何无源环境接触都稳定,FIG 3 和 FIG 4 里的每一次发散都是某种"造能量"的机制。

    Mechanical view: the impedance controller is an invisible spring–damper–mass hung between \(\mathbf x_0\) and the gripper. Frequency view: the mechanical impedance \(Z(s)=F(s)/V(s)=m_ds+d+k/s\) (force over velocity) is dominated by \(k/s\) at low frequency (spring-like), by \(d\) in between (damper-like) and by \(m_ds\) at high frequency (mass-like); the admittance \(Y=1/Z\) is "force in, velocity out". Energy view: an impedance is an energy port through which the power \(f_{\mathrm{ext}}\dot x\) flows in and out; as long as the controller creates no energy (it is passive), contact with any passive environment is stable, and every divergence in FIG 3 and FIG 4 is some mechanism that creates energy.

    5再看数学The math

    提示:把鼠标悬停在公式中带底色的符号上,对应的图元素会被高亮:\(m_d,d,k,f_{\mathrm{ext}}\) 对应 FIG 1 的方块、阻尼器、弹簧和手的力箭头;\(k_e\) 对应 FIG 2 的墙,\(x_c\) 对应 FIG 2 的参考位置空心框;\(\rho\) 对应 FIG 3 的稳定边界;\(\dot k\) 项对应 FIG 4 的紫色功率曲线,\(T\) 对应能量罐;\(K\) 对应 FIG 5 的变形椭圆,\(J^\top\) 对应 FIG 5 关节处的力矩弧;\(S\) 对应 FIG 6 的选择坐标轴。Tip: hover the highlighted symbols in the formulas and the matching figure element lights up: \(m_d,d,k,f_{\mathrm{ext}}\) are FIG 1's block, damper, spring and hand-force arrow; \(k_e\) is FIG 2's wall and \(x_c\) its hollow reference frame; \(\rho\) is FIG 3's stability boundary; the \(\dot k\) term is FIG 4's purple power curve and \(T\) its energy tank; \(K\) is FIG 5's deflection ellipse and \(J^\top\) the torque arcs at its joints; \(S\) is FIG 6's selection axes.

    目标阻抗与因果关系The target impedance and causality

    在 \(n\) 维任务空间里(平面位置 \(n=2\),空间位姿 \(n=6\)),目标行为写成

    In an \(n\)-dimensional task space (\(n=2\) for planar position, \(n=6\) for a spatial pose) the target behaviour is

    $$ M_d\,\ddot{\tilde{\mathbf x}}+D\,\dot{\tilde{\mathbf x}}+\hl{K}{K}\,\tilde{\mathbf x}=\mathbf F_{\mathrm{ext}},\qquad \tilde{\mathbf x}=\mathbf x-\mathbf x_0,\qquad Z(s)=M_ds+D+\frac{K}{s},\qquad Y(s)=Z(s)^{-1}, $$

    其中 \(M_d,D,K\) 是对称正定矩阵,\(\mathbf F_{\mathrm{ext}}\) 是外界作用在手爪上的力(7.6 节的力旋量去掉力矩部分)。\(Z(s)\) 是从速度到力的传递函数(\(\mathbf F=Z\mathbf V\),\(\mathbf V=s\tilde{\mathbf X}\))。Hogan 的论点是关于因果的:环境(比如一面墙)本身往往是一个导纳(给它力,它决定位置变化很小),两个"导纳"不能串在一起,所以机器人应该表现为阻抗,"你动我,我给力"。阻抗控制和导纳控制的区别不在目标,而在实现的因果方向:

    where \(M_d,D,K\) are symmetric positive definite and \(\mathbf F_{\mathrm{ext}}\) is the force the outside world applies to the gripper (the wrench of Lesson 7.6 without its moment). \(Z(s)\) is the transfer function from velocity to force (\(\mathbf F=Z\mathbf V\), \(\mathbf V=s\tilde{\mathbf X}\)). Hogan's argument is about causality: the environment (a wall, say) is often itself an admittance (push it and it decides how little it moves), and two "admittances" cannot be connected in series, so the robot should present an impedance, "you move me, I give force". Impedance and admittance control differ not in the target but in the causal direction of the implementation:

    阻抗控制Impedance control导纳控制Admittance control
    测量Measures位置、速度(编码器)position, velocity (encoders)力(力/力矩传感器)force (F/T sensor)
    输出Commands力 / 关节力矩force / joint torque参考位置 \(\mathbf x_c\)reference position \(\mathbf x_c\)
    硬件Hardware力矩控制、可反向驱动torque-controlled, backdrivable高刚度位置伺服stiff position servo
    擅长Good at低刚度、硬接触low stiffness, stiff contact高刚度、空中精度、任意虚拟质量high stiffness, free-space accuracy, any virtual mass
    软肋Weak at摩擦、未建模动力学、渲染高刚度friction, unmodelled dynamics, rendering high stiffness硬接触、轻虚拟质量stiff contact, light virtual mass

    机械臂上的阻抗控制Impedance control on an arm

    对力矩控制的机械臂 \(M(\mathbf q)\ddot{\mathbf q}+C(\mathbf q,\dot{\mathbf q})\dot{\mathbf q}+\mathbf g(\mathbf q)=\boldsymbol\tau+J^\top\mathbf F_{\mathrm{ext}}\)(8.3 节;外力经 7.6 节的 \(J^\top\) 变成关节力矩),最常用的笛卡尔阻抗控制律是

    For a torque-controlled arm \(M(\mathbf q)\ddot{\mathbf q}+C(\mathbf q,\dot{\mathbf q})\dot{\mathbf q}+\mathbf g(\mathbf q)=\boldsymbol\tau+J^\top\mathbf F_{\mathrm{ext}}\) (Lesson 8.3; the external force enters through the \(J^\top\) of Lesson 7.6), the most common Cartesian impedance law is

    $$ \boldsymbol\tau=\mathbf g(\mathbf q)+\hl{JT}{J(\mathbf q)^{\top}}\Big[\hl{K}{K}\,(\mathbf x_0-\mathbf x)-D\,\dot{\mathbf x}\Big] . $$

    它只用到正运动学、雅可比和重力模型,不需要力传感器。代入动力学并利用 8.3 节的操作空间形式(\(J\) 可逆时),闭环是

    It needs only forward kinematics, the Jacobian and a gravity model, and no force sensor. Substituting into the dynamics and using the operational-space form of Lesson 8.3 (for invertible \(J\)), the closed loop is

    $$ \Lambda(\mathbf q)\,\ddot{\mathbf x}+\boldsymbol\mu(\mathbf q,\dot{\mathbf q})+D\,\dot{\mathbf x}+K\,(\mathbf x-\mathbf x_0)=\mathbf F_{\mathrm{ext}},\qquad \Lambda=(JM^{-1}J^{\top})^{-1} . $$

    刚度和阻尼正是我们想要的,但质量是手臂自己的等效质量 \(\Lambda(\mathbf q)\)(8.3 节 FIG 3 的椭圆),随姿态变化,还多了速度项 \(\boldsymbol\mu\)。要把质量也改成任意的 \(M_d\)("惯量整形"),控制律里必须出现 \(\Lambda M_d^{-1}\mathbf F_{\mathrm{ext}}\),也就是必须测量外力,并用 \(\Lambda\) 和 \(\boldsymbol\mu\) 做补偿:这正是 13.6 节操作空间控制的内容。实践中大多数力矩控制臂选择保留 \(\Lambda\):不用力传感器,鲁棒,而且下面的能量论证完全成立。

    The stiffness and damping are what we asked for, but the mass is the arm's own apparent mass \(\Lambda(\mathbf q)\) (the ellipse of Lesson 8.3's FIG 3), which changes with posture, plus a velocity term \(\boldsymbol\mu\). Changing the mass to an arbitrary \(M_d\) as well ("inertia shaping") requires a term \(\Lambda M_d^{-1}\mathbf F_{\mathrm{ext}}\) in the control law, i.e. the external force must be measured, and \(\Lambda\) and \(\boldsymbol\mu\) must be compensated: that is the operational-space control of Lesson 13.6. In practice most torque-controlled arms keep \(\Lambda\): no force sensor, robust, and the energy argument below holds exactly.

    关节空间版本。8.3 节的"PD + 重力补偿" \(\boldsymbol\tau=\mathbf g+K_q(\mathbf q_0-\mathbf q)-D_q\dot{\mathbf q}\) 就是一个关节阻抗控制器。对小位移 \(\delta\mathbf x=J\delta\mathbf q\),笛卡尔刚度 \(K\) 对应的关节刚度是 \(K_q=J^\top KJ\)(外力不为零时还要加上 \(\partial J^\top/\partial\mathbf q\) 与力的乘积项)。反过来,同样的关节刚度在不同姿态下对应不同的笛卡尔刚度,这就是为什么要在任务空间里规定 \(K\)。

    Joint-space version. Lesson 8.3's "PD + gravity compensation", \(\boldsymbol\tau=\mathbf g+K_q(\mathbf q_0-\mathbf q)-D_q\dot{\mathbf q}\), is a joint impedance controller. For small displacements \(\delta\mathbf x=J\delta\mathbf q\), a Cartesian stiffness \(K\) corresponds to the joint stiffness \(K_q=J^\top KJ\) (with a non-zero external force, add a term with \(\partial J^\top/\partial\mathbf q\) times that force). Conversely, the same joint stiffness means a different Cartesian stiffness in every posture, which is why \(K\) is specified in task space.

    能量函数与无源性The energy function and passivity

    取 \(W=\tfrac12\dot{\mathbf q}^\top M\dot{\mathbf q}+\tfrac12\tilde{\mathbf x}^\top K\tilde{\mathbf x}\)(动能加虚拟弹簧的势能)。8.3 节的功率平衡(\(\dot M-2C\) 斜对称)给出 \(\tfrac{d}{dt}\tfrac12\dot{\mathbf q}^\top M\dot{\mathbf q}=\dot{\mathbf q}^\top(\boldsymbol\tau+J^\top\mathbf F_{\mathrm{ext}}-\mathbf g)\)。代入控制律,用 \(\dot{\mathbf x}=J\dot{\mathbf q}\):

    Take \(W=\tfrac12\dot{\mathbf q}^\top M\dot{\mathbf q}+\tfrac12\tilde{\mathbf x}^\top K\tilde{\mathbf x}\) (kinetic energy plus the virtual spring's potential energy). Lesson 8.3's power balance (\(\dot M-2C\) skew-symmetric) gives \(\tfrac{d}{dt}\tfrac12\dot{\mathbf q}^\top M\dot{\mathbf q}=\dot{\mathbf q}^\top(\boldsymbol\tau+J^\top\mathbf F_{\mathrm{ext}}-\mathbf g)\). Substitute the control law and use \(\dot{\mathbf x}=J\dot{\mathbf q}\):

    $$ \dot W=\dot{\mathbf x}^{\top}\big(-K\tilde{\mathbf x}-D\dot{\mathbf x}+\mathbf F_{\mathrm{ext}}\big)+\tilde{\mathbf x}^{\top}K\dot{\mathbf x}=-\,\dot{\mathbf x}^{\top}D\,\dot{\mathbf x}+\dot{\mathbf x}^{\top}\mathbf F_{\mathrm{ext}} . $$

    两个结论。(1) 空中(\(\mathbf F_{\mathrm{ext}}=0\)):\(\dot W=-\dot{\mathbf x}^\top D\dot{\mathbf x}\le0\),\(W\) 是 13.2 节意义下的 Lyapunov 函数;\(\dot W=0\) 要求 \(\dot{\mathbf x}=0\),再由 LaSalle 原理得 \(\mathbf x\to\mathbf x_0\)(\(J\) 非奇异时)。(2) 对任意外力,积分得 \(\int_0^t\dot{\mathbf x}^\top\mathbf F_{\mathrm{ext}}\,dt\ge W(t)-W(0)\ge-W(0)\):外界从机器人那里最多能取走它初始储存的能量,这就是无源性的定义。墙、弹簧、阻尼器、人手的被动部分都是无源的;两个无源系统的反馈连接仍然无源,总能量有界,所以接触稳定(Colgate 与 Hogan 1988 的耦合稳定性)。

    Two conclusions. (1) In free space (\(\mathbf F_{\mathrm{ext}}=0\)): \(\dot W=-\dot{\mathbf x}^\top D\dot{\mathbf x}\le0\), so \(W\) is a Lyapunov function in the sense of Lesson 13.2; \(\dot W=0\) forces \(\dot{\mathbf x}=0\), and LaSalle's principle gives \(\mathbf x\to\mathbf x_0\) (for non-singular \(J\)). (2) For any external force, integrating gives \(\int_0^t\dot{\mathbf x}^\top\mathbf F_{\mathrm{ext}}\,dt\ge W(t)-W(0)\ge-W(0)\): the outside world can extract at most the energy initially stored in the robot, which is the definition of passivity. Walls, springs, dampers and the passive part of a human hand are passive; a feedback connection of two passive systems is passive again, the total energy stays bounded, and the contact is stable (the coupled stability of Colgate and Hogan, 1988).

    这个证明隐含了两个理想化:控制律是连续时间的,电机力矩如实到达关节。采样和延迟会让虚拟弹簧"晚一步"出力,相当于一个负阻尼。对触觉设备,Colgate 与 Schenkel(1997)给出了采样渲染的无源性条件 \(b>\tfrac{KT}{2}+|B|\):要以采样周期 \(T\) 渲染刚度 \(K\) 和虚拟阻尼 \(B\),设备本身必须有足够的物理阻尼 \(b\)。这就是 FIG 3 阻抗地图上方的不稳定区。

    The proof hides two idealizations: the control law is continuous-time, and the motor torque arrives at the joint exactly. Sampling and delay make the virtual spring push "one step late", which acts like negative damping. For haptic devices, Colgate and Schenkel (1997) derived the passivity condition of sampled rendering, \(b>\tfrac{KT}{2}+|B|\): to render a stiffness \(K\) and virtual damping \(B\) at sampling period \(T\), the device itself needs enough physical damping \(b\). That is the unstable region at the top of FIG 3's impedance map.

    导纳控制与它的环路增益Admittance control and its loop gain

    导纳控制器在每个周期 \(T\)(1 ms)里用测得的力 \(\mathbf f\) 积分一次虚拟动力学(半隐式欧拉,2.5 节),把结果交给位置伺服:

    Every period \(T\) (1 ms) the admittance controller integrates the virtual dynamics once with the measured force \(\mathbf f\) (semi-implicit Euler, Lesson 2.5) and hands the result to the position servo:

    $$ \dot{\mathbf x}_c\leftarrow\dot{\mathbf x}_c+T\,M_a^{-1}\big(\mathbf f-D_a\dot{\mathbf x}_c-K(\hl{xc}{\mathbf x_c}-\mathbf x_0)\big),\qquad \hl{xc}{\mathbf x_c}\leftarrow\mathbf x_c+T\,\dot{\mathbf x}_c, $$ $$ \mathbf u=K_s(\mathbf x_c-\mathbf x)+D_s(\dot{\mathbf x}_c-\dot{\mathbf x}) . $$

    在一维里,环境是刚度 \(\hl{ke}{k_e}\) 的弹簧,伺服把参考 \(x_c\) 变成实际位置 \(x\) 的传递函数记为 \(G_s(s)\)(带宽 \(\omega_s\))。力 \(f=-k_e(x-x_w)\) 又回到导纳模型,形成一个闭环,其环路增益为

    In one dimension the environment is a spring of stiffness \(\hl{ke}{k_e}\), and the servo turns the reference \(x_c\) into the actual position \(x\) through a transfer function \(G_s(s)\) (bandwidth \(\omega_s\)). The force \(f=-k_e(x-x_w)\) feeds back into the admittance model, closing a loop with loop gain

    $$ L(s)=\frac{\hl{ke}{k_e}\,G_s(s)}{m_as^2+d_as+k},\qquad \big|L(j\omega)\big|\approx\frac{k_{\mathrm{eff}}}{m_a\,\omega^2}\quad\big(\omega\gg\sqrt{k/m_a}\big),\qquad k_{\mathrm{eff}}=\frac{k_e\,k_s}{k_e+k_s} . $$

    (\(k_e\) 远大于伺服刚度 \(k_s\) 时,墙把机器人挡住,\(x\) 几乎不随 \(x_c\) 动,于是有效增益饱和为 \(k_s\),即串联刚度 \(k_{\mathrm{eff}}\)。)(近似式里忽略了伺服 \(G_s\) 的相位。)增益在 \(\omega_c\approx\sqrt{k_{\mathrm{eff}}/m_a}\) 处降到 1。虚拟质量–弹簧本身已经贡献了接近 \(-180^\circ\) 的相位,只要伺服和延迟在 \(\omega_c\) 处再滞后一点,相位裕度就没了:所以 \(\omega_c\) 必须明显低于 \(\omega_s\)。这给出三条补救:加大 \(m_a\)(代价是空中推起来很沉),加大 \(d_a\)(代价是很黏),或者降低伺服刚度(代价是空中精度)。没有免费的午餐:导纳控制在硬接触里稳定,本质上就是让机器人在那里变得又重又慢。

    (When \(k_e\) far exceeds the servo stiffness \(k_s\), the wall holds the robot back and \(x\) hardly follows \(x_c\), so the effective gain saturates at \(k_s\): the series stiffness \(k_{\mathrm{eff}}\).) (The approximation ignores the phase of the servo \(G_s\).) The gain falls to 1 near \(\omega_c\approx\sqrt{k_{\mathrm{eff}}/m_a}\). The virtual mass–spring already contributes close to \(-180^\circ\) of phase, so a little extra lag from the servo and the delay at \(\omega_c\) wipes out the phase margin: \(\omega_c\) must stay clearly below \(\omega_s\). That gives three remedies: raise \(m_a\) (it then feels heavy to push in free space), raise \(d_a\) (it feels sticky), or lower the servo stiffness (it loses free-space accuracy). There is no free lunch: making admittance control stable in stiff contact essentially means making the robot heavy and slow there.

    阻抗与导纳的对偶可以说得更精确:阻抗控制在渲染低刚度、接触硬环境时好;导纳控制在渲染高刚度、接触软环境(或在空中)时好。Ott、Mukherjee 与 Nakamura(2010)提出把两者按比例混合,在两种情形之间切换或插值。

    The duality can be stated more precisely: impedance control is good at rendering low stiffness against stiff environments; admittance control is good at rendering high stiffness against soft environments (or in free space). Ott, Mukherjee and Nakamura (2010) proposed blending the two in proportion, switching or interpolating between the two regimes.

    怎样选 \(K\) 和 \(D\)Choosing \(K\) and \(D\)

    刚度按任务和不确定性选。在需要精度的方向上硬,在位置不确定、需要接触的方向上软。外力 \(\mathbf F\) 下的静态变形是 \(\Delta\mathbf x=K^{-1}\mathbf F\):如果表面高度的不确定性是 \(\pm\delta\),想把接触力的波动压在 \(\pm\Delta f\) 以内,法向刚度就要 \(k_n\lesssim\Delta f/\delta\)。刚度矩阵不必是对角的:\(K=R\,\mathrm{diag}(k_1,k_2)R^\top\),主轴可以对准表面法向。注意:除非力恰好沿着 \(K\) 的主轴,变形方向和力的方向不一致(FIG 5)。

    Pick the stiffness from the task and the uncertainty. Stiff in directions that need accuracy, soft in directions where the position is uncertain and contact is expected. The static deflection under a force \(\mathbf F\) is \(\Delta\mathbf x=K^{-1}\mathbf F\): if the surface height is uncertain by \(\pm\delta\) and the contact force must vary by at most \(\pm\Delta f\), the normal stiffness must satisfy \(k_n\lesssim\Delta f/\delta\). The stiffness matrix need not be diagonal: \(K=R\,\mathrm{diag}(k_1,k_2)R^\top\) can align its principal axes with the surface normal. Note that unless the force lies exactly along a principal axis of \(K\), the deflection points in a different direction than the force (FIG 5).

    阻尼按质量选。一维时 \(d=2\zeta\sqrt{k\,m}\),\(m\) 是实际的质量(阻抗控制里是 \(\Lambda\))。如果固定 \(d\) 而改变 \(k\) 或姿态,阻尼比就会跟着漂。多维时一个常用的做法是"双对角化"(Albu-Schäffer 等,2003):

    Pick the damping from the mass. In 1D, \(d=2\zeta\sqrt{k\,m}\) with \(m\) the actual mass (\(\Lambda\) under impedance control). Keep \(d\) fixed while \(k\) or the posture changes and the damping ratio drifts. In several dimensions a common recipe is "double diagonalization" (Albu-Schäffer et al., 2003):

    $$ D=\Lambda^{1/2}\,\Big(2\zeta\,\big(\Lambda^{-1/2}K\Lambda^{-1/2}\big)^{1/2}\Big)\,\Lambda^{1/2} , $$

    它让 \(\Lambda\ddot{\mathbf x}+D\dot{\mathbf x}+K\mathbf x=0\) 的每一个模态都有阻尼比 \(\zeta\)(把 \(\mathbf y=\Lambda^{1/2}\mathbf x\) 代入即可验证)。FIG 5 就用这个公式,每 1 ms 按当前姿态重算一次。转动部分的刚度单位是 N·m/rad,作用在姿态误差 \(\Log(R_0^\top R)\)(5.6 节)上;平移和转动的刚度不能直接比较,6 维 \(K\) 通常写成分块对角。

    It gives every mode of \(\Lambda\ddot{\mathbf x}+D\dot{\mathbf x}+K\mathbf x=0\) the damping ratio \(\zeta\) (substitute \(\mathbf y=\Lambda^{1/2}\mathbf x\) to check). FIG 5 uses exactly this formula, recomputed from the current posture every 1 ms. The rotational stiffness has units N·m/rad and acts on the orientation error \(\Log(R_0^\top R)\) (Lesson 5.6); translational and rotational stiffnesses cannot be compared directly, so a 6D \(K\) is usually block-diagonal.

    变阻抗与能量罐Variable impedance and the energy tank

    让 \(K\) 随时间变,重复上面的推导,\(\tfrac{d}{dt}\tfrac12\tilde{\mathbf x}^\top K\tilde{\mathbf x}\) 多出 \(\tfrac12\tilde{\mathbf x}^\top\dot K\tilde{\mathbf x}\):

    Let \(K\) vary with time and repeat the derivation above: \(\tfrac{d}{dt}\tfrac12\tilde{\mathbf x}^\top K\tilde{\mathbf x}\) gains \(\tfrac12\tilde{\mathbf x}^\top\dot K\tilde{\mathbf x}\):

    $$ \dot W=-\,\dot{\mathbf x}^{\top}D\dot{\mathbf x}+\dot{\mathbf x}^{\top}\mathbf F_{\mathrm{ext}}+\hl{Kdot}{\tfrac12\,\tilde{\mathbf x}^{\top}\dot K\,\tilde{\mathbf x}},\qquad \dot{\hl{tank}{T}}=\dot{\mathbf x}^{\top}D\dot{\mathbf x}-\hl{Kdot}{\tfrac12\,\tilde{\mathbf x}^{\top}\dot K\,\tilde{\mathbf x}} . $$

    罐子里的能量 \(T\) 低于下限 \(T_{\min}\) 时,会注入能量的刚度变化被暂停(\(\dot K\) 置零)。没有罐子时,\(\dot K\) 项可以是正的,无源性就丢了;FIG 4 里 \(a=0.5\)、\(\Omega=2\omega_n\) 时,能量在 10 秒内从 0.5 J 涨到约 \(10^6\) J。有罐子时 \(\tfrac{d}{dt}(W+T)=\dot{\mathbf x}^\top\mathbf F_{\mathrm{ext}}\),与固定刚度时一样无源:罐子只允许把以前耗散掉的能量"借回来"改变刚度。(FIG 4 还给罐子设了 1 J 的上限,防止长期积攒的能量一次性释放。)

    When the tank energy \(T\) falls below a floor \(T_{\min}\), stiffness changes that would inject energy are paused (\(\dot K\) set to zero). Without a tank the \(\dot K\) term can be positive and passivity is lost: in FIG 4 with \(a=0.5\) and \(\Omega=2\omega_n\) the energy grows from 0.5 J to about \(10^6\) J in 10 seconds. With the tank, \(\tfrac{d}{dt}(W+T)=\dot{\mathbf x}^\top\mathbf F_{\mathrm{ext}}\), just as passive as with constant stiffness: the tank only lets the controller "borrow back" energy that was dissipated earlier to change the stiffness. (FIG 4 also caps the tank at 1 J so that energy saved up over a long time cannot be released all at once.)

    力/位混合控制(简述)Hybrid force/position control (briefly)

    另一条思路来自 Mason(1981):接触几何把任务空间分成两组方向。沿表面法向,环境决定了位置(自然约束:不能穿过去),我们只能规定力;沿表面切向,环境决定了力(无摩擦时为零),我们只能规定位置。Raibert 与 Craig(1981)据此用一个对角的选择矩阵 \(S\)(1 = 位置控制,0 = 力控制)在任务坐标系里把两个控制器拼起来:

    Another line of thought comes from Mason (1981): the contact geometry splits task space into two sets of directions. Along the surface normal the environment determines the position (a natural constraint: you cannot go through), so we can only prescribe force; along the surface the environment determines the force (zero without friction), so we can only prescribe position. Raibert and Craig (1981) used a diagonal selection matrix \(S\) (1 = position-controlled, 0 = force-controlled) in the task frame to combine two controllers:

    $$ \mathbf F_{\mathrm{cmd}}=\hl{S}{S}\,\big[K_p(\mathbf x_d-\mathbf x)+K_v(\dot{\mathbf x}_d-\dot{\mathbf x})\big]+(I-\hl{S}{S})\Big[\mathbf f_d+K_I\!\int(\mathbf f_d-\mathbf f)\,dt-D_f\dot{\mathbf x}\Big], $$ $$ \boldsymbol\tau=\mathbf g+J^{\top}\mathbf F_{\mathrm{cmd}} . $$

    它能把力精确调到 \(\mathbf f_d\),与表面在哪无关;阻抗控制只能间接地通过 \(K(\mathbf x_0-\mathbf x)\) 得到力,表面高度差 \(\delta\) 就带来 \(k_n\delta\) 的力误差(FIG 6)。代价是:\(S\) 要求事先知道约束方向;力控制方向上没有位置参考,一旦失去接触就会加速;在接触刚度很高时,力回路的增益必须很小才能稳定(又是 FIG 3 的环路增益问题)。所以在工业里常见的是两者结合:用阻抗控制兜底的稳定性,在法向加一个慢的力积分环。

    It regulates the force exactly to \(\mathbf f_d\), wherever the surface is; impedance control only obtains force indirectly through \(K(\mathbf x_0-\mathbf x)\), so a surface height error \(\delta\) becomes a force error \(k_n\delta\) (FIG 6). The price: \(S\) requires knowing the constraint directions in advance; the force-controlled direction has no position reference and accelerates once contact is lost; and against high contact stiffness the force loop's gain must be small to stay stable (FIG 3's loop-gain problem again). That is why industry often combines the two: impedance control for baseline stability, plus a slow force integrator along the normal.

    6机器人中的它:笛卡尔阻抗与擦桌子In robotics: Cartesian impedance and wiping a table

    回到 8.3 节的两连杆臂(\(l_1=1\) m,\(l_2=0.8\) m,\(m_1=2\) kg,\(m_2=1.5\) kg,竖直平面,重力沿 \(-y\)),用第 5 节的控制律 \(\boldsymbol\tau=\mathbf g+J^\top[K(\mathbf x_0-\mathbf x)-D\dot{\mathbf x}]\) 让手爪表现为一个二维弹簧。刚度矩阵 \(K=R(\varphi)\,\mathrm{diag}(k_1,k_2)\,R(\varphi)^\top\) 由两个主刚度和主轴角 \(\varphi\) 决定,阻尼用双对角化公式按当前的 \(\Lambda(\mathbf q)\) 算出。

    拖动琥珀色手柄移动设定点 \(\mathbf x_0\);左上角的"力摇杆"给手爪施加一个外力 \(\mathbf F\)(紫色箭头)。手爪停下时偏离 \(\mathbf x_0\) 的量就是 \(K^{-1}\mathbf F\);琥珀色椭圆画出所有方向上 20 N 推力造成的变形(放大 5 倍画出),长轴就是"软"的方向。打开"波浪桌面"(高度起伏 ±0.6 cm,控制器不知道),把 \(\mathbf x_0\) 放到桌面以下,再按"擦拭"让设定点左右往返(±25 cm,周期 6 s)。

    Back to the two-link arm of Lesson 8.3 (\(l_1=1\) m, \(l_2=0.8\) m, \(m_1=2\) kg, \(m_2=1.5\) kg, vertical plane, gravity along \(-y\)), now running Section 5's law \(\boldsymbol\tau=\mathbf g+J^\top[K(\mathbf x_0-\mathbf x)-D\dot{\mathbf x}]\) so that the gripper behaves like a 2D spring. The stiffness matrix \(K=R(\varphi)\,\mathrm{diag}(k_1,k_2)\,R(\varphi)^\top\) is set by two principal stiffnesses and the principal-axis angle \(\varphi\); the damping comes from the double-diagonalization formula with the current \(\Lambda(\mathbf q)\).

    Drag the amber handle to move the set point \(\mathbf x_0\); the "force joystick" in the upper left applies an external force \(\mathbf F\) to the gripper (purple arrow). When the gripper comes to rest, its offset from \(\mathbf x_0\) is \(K^{-1}\mathbf F\); the amber ellipse shows the deflection caused by a 20 N push in every direction (drawn 5× enlarged), and its long axis is the "soft" direction. Switch on the "wavy table" (height varies by ±0.6 cm, unknown to the controller), put \(\mathbf x_0\) below the table top, and press "Wipe" to sweep the set point back and forth (±25 cm, period 6 s).

    FIG 5两连杆臂上的笛卡尔阻抗Cartesian impedance on a two-link arm
    琥珀色手柄 = 设定点 \(\mathbf x_0\),琥珀色椭圆 = 20 N 推力下的变形集合 \(\{K^{-1}\mathbf F:\|\mathbf F\|=20\}\)(\(\mathbf F\) 以 N 计,放大 5 倍画出;悬停 \(K\) 高亮)。紫色箭头 = 外力 \(\mathbf F\)(1 N ↔ 1 cm),蓝色箭头 = 桌面的接触力。从 \(\mathbf x_0\) 出发的两条射线只表示方向:紫色是力的方向,绿色是实际变形 \(\mathbf x-\mathbf x_0\) 的方向。关节处的红、绿圆弧是阻抗项产生的关节力矩 \(J^\top[\cdots]\)(悬停 \(J^\top\) 高亮),重力补偿 \(\mathbf g(\mathbf q)\) 不画。控制器 1 kHz,动力学子步长 0.125 ms。桌面接触刚度 \(2\times10^4\) N/m,无摩擦。 Amber handle = set point \(\mathbf x_0\); amber ellipse = the set of deflections under a 20 N push, \(\{K^{-1}\mathbf F:\|\mathbf F\|=20\}\) (\(\mathbf F\) in N, drawn 5× enlarged; hover \(K\) to highlight). Purple arrow = external force \(\mathbf F\) (1 N ↔ 1 cm); blue arrow = the table's contact force. The two rays from \(\mathbf x_0\) show directions only: purple is the force direction, green the direction of the actual deflection \(\mathbf x-\mathbf x_0\). The red and green arcs at the joints are the joint torques \(J^\top[\cdots]\) produced by the impedance term (hover \(J^\top\) to highlight); the gravity compensation \(\mathbf g(\mathbf q)\) is not drawn. Controller at 1 kHz, dynamics sub-step 0.125 ms. Table contact stiffness \(2\times10^4\) N/m, frictionless.
    试一试Try this
    • 把刚度调成各向异性(\(k_1/k_2\ge4\) 或 \(k_2/k_1\ge4\)),用摇杆施加至少 10 N 的力,让手爪停稳后,变形方向与力的方向相差超过 25°。什么方向的力不会产生这种偏差?Make the stiffness anisotropic (\(k_1/k_2\ge4\) or \(k_2/k_1\ge4\)), apply at least 10 N with the joystick, and once the gripper is at rest, get the deflection to point more than 25° away from the force. Which force directions produce no such deviation?
    • 打开波浪桌面和"擦拭",调节竖直方向的刚度和 \(\mathbf x_0\) 的高度,让一个完整的往返(6 s)里接触力始终在 4 N 到 16 N 之间。为什么法向刚度要低?试试把它调到 1000 N/m 以上。Switch on the wavy table and "Wipe", then tune the vertical stiffness and the height of \(\mathbf x_0\) so that the contact force stays between 4 N and 16 N for a whole back-and-forth stroke (6 s). Why must the normal stiffness be low? Try raising it above 1000 N/m.

    擦的时候你会发现,即使桌面是平的,接触力也会随擦拭方向上下摆几牛,比桌面起伏所能解释的(\(K_{yy}\times0.6\) cm)大。原因在阻尼:\(\Lambda(\mathbf q)\) 在 \(x\)–\(y\) 坐标里不是对角的,双对角化得到的 \(D\) 也就有非对角元(在这片工作区里 \(D_{yx}\approx-12\) N·s/m),切向速度(最高约 0.26 m/s)经 \(D_{yx}\dot x\) 变成约 ±3 N 的法向力:往一个方向擦时压得轻,往回擦时压得重。例如 \(k_2=300\) N/m、设定点在桌面下 3.3 cm 时,平桌面上的接触力在 6.6–13.0 N 之间;如果只保留 \(D\) 的对角元,就只在 9.6–10.1 N 之间。所以接触任务常把阻尼直接在任务坐标系(表面法向和切向)里设成对角的,例如 franka_ros 的示例取 \(D=2\sqrt K\),代价是各模态的阻尼比不再都等于 \(\zeta\)。

    While wiping you will notice that even on a flat table the contact force swings by a few newtons with the stroke direction, more than the table's waviness explains (\(K_{yy}\times0.6\) cm). The cause is the damping: \(\Lambda(\mathbf q)\) is not diagonal in \(x\)–\(y\) coordinates, so the double-diagonalized \(D\) has off-diagonal entries too (\(D_{yx}\approx-12\) N·s/m in this part of the workspace), and the tangential velocity (up to about 0.26 m/s) becomes a normal force of about ±3 N through \(D_{yx}\dot x\): the tool presses lighter on one stroke and harder on the way back. With \(k_2=300\) N/m and the set point 3.3 cm below the table top, for example, the contact force on a flat table ranges over 6.6–13.0 N; keeping only the diagonal entries of \(D\) narrows that to 9.6–10.1 N. That is why contact tasks often set the damping diagonal directly in the task frame (surface normal and tangent), as franka_ros's example does with \(D=2\sqrt K\), at the price of no longer giving every mode the damping ratio \(\zeta\).

    擦桌子时我们用"法向软弹簧"间接地得到压力。如果更在意压力本身,就用第 5 节的力/位混合控制:切向位置控制,法向直接把力调到 10 N。下图在同一段 ±30 cm、周期 4 s 的往返上并排跑两个控制器:混合控制(紫色,切向 PD 位置控制,法向力前馈 + 积分 + 阻尼)和阻抗控制(琥珀色,切向刚度 3000 N/m,法向刚度 300 N/m,设定点在"以为的"表面下方 \(10/300\) m)。控制器都以为表面是 \(y=0\) 的水平面;你可以让真实表面高出 \(\Delta h\)、倾斜 \(\delta\)。两者都由 3 kg 的点质量手爪实现,接触刚度 \(5\times10^4\) N/m。

    When wiping we obtained the pressing force indirectly through a soft normal spring. If the force itself matters most, use Section 5's hybrid force/position control: position control along the surface, and the normal force regulated directly to 10 N. The figure runs two controllers side by side on the same ±30 cm stroke with a 4 s period: hybrid control (purple: PD position control along the surface; force feedforward + integral + damping along the normal) and impedance control (amber: tangential stiffness 3000 N/m, normal stiffness 300 N/m, set point \(10/300\) m below the "believed" surface). Both controllers believe the surface is the horizontal line \(y=0\); you can raise the real surface by \(\Delta h\) and tilt it by \(\delta\). Both act through a 3 kg point-mass gripper, and the contact stiffness is \(5\times10^4\) N/m.

    FIG 6力/位混合控制 vs 阻抗控制Hybrid force/position vs. impedance control
    竖直方向放大VERTICAL SCALE EXAGGERATED
    法向接触力 (N) vs 时间 (s)NORMAL CONTACT FORCE (N) vs. TIME (s)
    左:实线是真实表面,虚线是控制器以为的表面 \(y=0\);实心紫点是混合控制的手爪,空心琥珀圈是阻抗控制的手爪。混合控制手爪上的两根短轴是选择矩阵 \(S\) 的坐标系(悬停 \(S\) 高亮):沿切向的是位置控制轴,沿法向的是力控制轴。右:过去 8 秒的法向接触力,虚线是目标 10 N。读数里的最小、最大、平均值统计的是最近一个完整往返(4 s)。 Left: the solid line is the real surface, the dashed line the surface the controllers believe in, \(y=0\); the filled purple dot is the hybrid gripper, the hollow amber ring the impedance gripper. The two short axes on the hybrid gripper are the frame of the selection matrix \(S\) (hover \(S\) to highlight): the one along the surface is the position-controlled axis, the one along the normal the force-controlled axis. Right: the last 8 seconds of normal contact force; the dashed line is the 10 N target. The minimum, maximum and mean in the readout are taken over the most recent complete stroke (4 s).
    试一试Try this
    • 保持倾斜 \(|\delta|\le1^\circ\),把表面抬高 \(\Delta h\ge1.5\) cm,等一个完整往返:混合控制的力始终在 \(10\pm0.5\) N 以内,而阻抗控制的平均力偏离 10 N 超过 4 N。再把倾斜调到 10°,两者各自怎样?Keep the tilt \(|\delta|\le1^\circ\), raise the surface by \(\Delta h\ge1.5\) cm and wait for a full stroke: the hybrid force stays within \(10\pm0.5\) N, while the impedance controller's mean force is off from 10 N by more than 4 N. Then tilt the surface by 10°: how does each one fare?

    表面抬高 2 cm 时,阻抗控制的力变成 \(10+300\times0.02\approx16\) N(实测 15.9 N),混合控制仍是 10.0 N。倾斜 10° 时,混合控制的力在约 9.2–11.2 N 之间(力回路要一边跟上倾斜的表面一边调力),阻抗控制则在 0(短暂离开表面)到约 26 N 之间。这正是混合控制的长处。但请记住它的前提:选择矩阵假设我们知道哪个方向受约束;如果表面突然消失,力控制轴会把手爪一直往下推。阻抗控制的力不准,但在任何情况下都只是一根弹簧。

    With the surface 2 cm higher, the impedance controller's force becomes \(10+300\times0.02\approx16\) N (measured 15.9 N) while the hybrid controller stays at 10.0 N. Tilted by 10°, the hybrid force varies between about 9.2 and 11.2 N (the force loop has to follow the slanted surface while regulating force), and the impedance force between 0 (briefly leaving the surface) and about 26 N. That is hybrid control's strength. But remember its premise: the selection matrix assumes we know which directions are constrained; if the surface suddenly vanished, the force-controlled axis would keep pushing the gripper down. The impedance controller's force is not exact, but in every situation it is just a spring.

    真实系统里In real systems

    力矩控制的协作臂:DLR 轻型臂(LWR III)上的笛卡尔阻抗控制(Albu-Schäffer 等,2003)后来进入了 KUKA LBR iiwa,其 Sunrise 软件提供 CartesianImpedanceControlMode,平移刚度上限 5000 N/m、转动刚度上限 300 N·m/rad。Franka Emika Panda 的 libfranka 自带 cartesian_impedance_control 示例,franka_ros 里有 cartesian_impedance_example_controller,都以 1 kHz 发送 \(\boldsymbol\tau=J^\top[K(\mathbf x_0-\mathbf x)-D\dot{\mathbf x}]+\dots\)(重力由机器人自己补偿)。位置控制的工业臂:ABB、FANUC、KUKA KR 系列在腕部装 ATI 等六维力传感器,做打磨、去毛刺、装配和手拖示教时用的就是导纳控制;ROS 2 的 ros2_controllers 里有现成的 admittance_controller。Universal Robots 的 force_mode 用一个"选择向量"指定哪些轴做力控制,是力/位混合思想的工业实现。腿式机器人:MIT Cheetah 用本体感觉的阻抗控制让腿像弹簧一样着地(Hyun 等,2014),Mini Cheetah 的腿控制器同时接收前馈力矩与关节、笛卡尔 PD 增益。触觉与康复:触觉设备能稳定渲染的阻抗范围叫"Z-width"(Colgate 与 Brown,1994);MIT-MANUS 等上肢康复机器人用阻抗控制和病人安全地交互。学习:把末端阻抗控制器的设定点和刚度作为强化学习的动作空间,在接触任务上比直接输出关节力矩更好学(Martín-Martín 等,2019);也有直接学习变刚度策略的工作(Buchli 等,2011)。

    Torque-controlled cobots: the Cartesian impedance control of the DLR Light-Weight Robot (LWR III; Albu-Schäffer et al., 2003) went on into the KUKA LBR iiwa, whose Sunrise software offers CartesianImpedanceControlMode with translational stiffness up to 5000 N/m and rotational stiffness up to 300 N·m/rad. The Franka Emika Panda's libfranka ships a cartesian_impedance_control example and franka_ros a cartesian_impedance_example_controller; both send \(\boldsymbol\tau=J^\top[K(\mathbf x_0-\mathbf x)-D\dot{\mathbf x}]+\dots\) at 1 kHz (gravity is compensated by the robot itself). Position-controlled industrial arms: ABB, FANUC and KUKA KR arms with a six-axis sensor such as an ATI at the wrist use admittance control for grinding, deburring, assembly and hand-guiding; ROS 2's ros2_controllers include a ready-made admittance_controller. Universal Robots' force_mode uses a "selection vector" to pick the force-controlled axes, an industrial form of the hybrid idea. Legged robots: the MIT Cheetah uses proprioceptive impedance control so that its legs land like springs (Hyun et al., 2014), and the Mini Cheetah's leg controller takes feedforward torques together with joint and Cartesian PD gains. Haptics and rehabilitation: the range of impedances a haptic device can render stably is its "Z-width" (Colgate and Brown, 1994); upper-limb rehabilitation robots such as MIT-MANUS use impedance control to interact safely with patients. Learning: using the set point and stiffness of an end-effector impedance controller as the action space of reinforcement learning makes contact-rich tasks easier to learn than raw joint torques (Martín-Martín et al., 2019), and variable-stiffness policies have been learned directly (Buchli et al., 2011).

    7常见误区Common pitfalls

    误区 1:"刚度越高越好"Pitfall 1: "the stiffer the better"

    高刚度让空中定位更准,但会把每一点位置误差放大成接触力:法向刚度 3000 N/m 时,1 cm 的表面高度误差就是 30 N。它还会碰上采样和延迟的上限:FIG 3 里 3 ms 延迟时,3 kg 的手爪只能稳定渲染约 \(1.3\times10^5\) N/m。按 \(k_n\lesssim\Delta f/\delta\)(允许的力波动除以位置不确定度)来选法向刚度,只在需要精度的方向上硬。

    High stiffness makes free-space positioning more accurate, but it turns every bit of position error into contact force: at a normal stiffness of 3000 N/m, a 1 cm error in the surface height is 30 N. It also runs into the limits of sampling and delay: in FIG 3 with 3 ms of delay the 3 kg gripper can stably render only about \(1.3\times10^5\) N/m. Choose the normal stiffness from \(k_n\lesssim\Delta f/\delta\) (allowed force variation over position uncertainty) and be stiff only in directions that need accuracy.

    误区 2:导纳控制里把虚拟质量设得很轻Pitfall 2: a very light virtual mass in admittance control

    "虚拟质量越轻,推起来越跟手"在空中是对的,但碰到硬物时导纳回路的穿越频率 \(\sqrt{k_{\mathrm{eff}}/m_a}\) 会超过伺服带宽,手爪开始打颤(FIG 2)。在 FIG 3 的设定里,钢上需要约 38 kg。常见做法是:接触时自动加大 \(m_a\) 和 \(d_a\),或者在检测到接触后切换到更保守的参数;给力传感器加更重的低通滤波只会增加相位滞后,往往适得其反。

    "The lighter the virtual mass, the more responsive it feels" is true in free space, but against a hard object the admittance loop's crossover \(\sqrt{k_{\mathrm{eff}}/m_a}\) rises above the servo bandwidth and the gripper chatters (FIG 2). With FIG 3's settings, steel needs about 38 kg. Common practice is to raise \(m_a\) and \(d_a\) automatically in contact, or to switch to more conservative parameters once contact is detected; filtering the force sensor more heavily only adds phase lag and often makes things worse.

    误区 3:阻尼与刚度、质量脱钩Pitfall 3: damping chosen independently of stiffness and mass

    阻尼比是 \(\zeta=d/(2\sqrt{k\,m})\)。固定 \(d\) 而调大 \(k\),或者手臂换了个姿态使 \(\Lambda\) 变了,\(\zeta\) 就会漂走:同一组参数在一个姿态下临界阻尼,在另一个姿态下振荡。多维时应按 \(\Lambda\) 设计 \(D\)(双对角化)。另外,平移刚度(N/m)和转动刚度(N·m/rad)单位不同,不能用同一个数字,也不能把 6 维 \(K\) 的特征值直接比较。

    The damping ratio is \(\zeta=d/(2\sqrt{k\,m})\). Keep \(d\) fixed while raising \(k\), or let the arm move to a posture with a different \(\Lambda\), and \(\zeta\) drifts: the same parameters are critically damped in one posture and ring in another. In several dimensions, design \(D\) with \(\Lambda\) (double diagonalization). Also, translational stiffness (N/m) and rotational stiffness (N·m/rad) have different units: do not use one number for both, and do not compare the eigenvalues of a 6D \(K\) directly.

    误区 4:随手改变刚度和设定点Pitfall 4: changing stiffness and set point carelessly

    每个瞬间的参数都稳定,不代表随时间变化的参数也稳定:弹簧被拉长时变硬会注入能量 \(\tfrac12\Delta k\,(x-x_0)^2\),按 \(2\omega_n\) 周期变化能引发参数共振(FIG 4)。学习出的策略每一步输出刚度时尤其要小心:限制 \(\dot K\)、用能量罐,或者至少只在弹簧接近松弛时变硬。同理,设定点 \(\mathbf x_0\) 一下子跳很远,弹簧力 \(K(\mathbf x_0-\mathbf x)\) 也会一下子很大,实际系统通常会对 \(\mathbf x_0-\mathbf x\) 或弹簧力做限幅。

    Parameters that are stable at every frozen instant are not necessarily stable when they vary: stiffening a stretched spring injects the energy \(\tfrac12\Delta k\,(x-x_0)^2\), and varying it at \(2\omega_n\) can cause parametric resonance (FIG 4). Be especially careful when a learned policy outputs a stiffness every step: limit \(\dot K\), use an energy tank, or at least stiffen only when the spring is nearly relaxed. Likewise, a set point \(\mathbf x_0\) that jumps far away makes the spring force \(K(\mathbf x_0-\mathbf x)\) jump too, which is why real systems usually saturate \(\mathbf x_0-\mathbf x\) or the spring force.

    误区 5:在不能反向驱动的硬件上做"纯"阻抗控制,或者不校准力传感器Pitfall 5: "pure" impedance control on non-backdrivable hardware, or an uncalibrated force sensor

    阻抗控制假设发出的力矩如实到达关节。大减速比的关节里,摩擦会留下最大 \(f_c/k\) 的位置误差(FIG 2 里 15 N 摩擦、500 N/m 刚度时实测约 2–3 cm),还会让手爪"粘"住。这类机器人要么用关节力矩传感器闭环把摩擦压下去,要么改用导纳控制。反过来,导纳控制完全依赖力传感器的读数:没有去皮、没有补偿工具重力(7.6 节误区 4),或者力旋量没有换到正确的坐标系,机器人就会对着一个不存在的力"顺从"地漂走。

    Impedance control assumes the commanded torque reaches the joint. In a high-ratio joint, friction leaves a position error of up to \(f_c/k\) (measured at about 2–3 cm in FIG 2 with 15 N of friction and 500 N/m of stiffness) and makes the gripper "stick". Such robots either close a loop on joint torque sensors to suppress friction, or switch to admittance control. Conversely, admittance control depends entirely on the force sensor: without taring, without compensating the tool's weight (Pitfall 4 of Lesson 7.6), or with the wrench expressed in the wrong frame, the robot will "comply" with a force that does not exist and drift away.

    8小练习Check yourself

    1. 阻抗控制器沿 \(x\) 方向的刚度是 \(k=800\) N/m。人用 20 N 的恒力沿 \(x\) 推手爪,手爪停下时偏离设定点多远?1. An impedance controller has stiffness \(k=800\) N/m along \(x\). A person pushes the gripper along \(x\) with a constant 20 N. How far from the set point does the gripper come to rest?
    静止时 \(\ddot x=\dot x=0\),目标方程只剩 \(k\,\Delta x=f\),所以 \(\Delta x=20/800=0.025\) m \(=2.5\) cm,与 \(m_d\) 和 \(d\) 无关。40 cm 是把 \(k/f\) 当成了变形。At rest \(\ddot x=\dot x=0\), so the target equation reduces to \(k\,\Delta x=f\) and \(\Delta x=20/800=0.025\) m \(=2.5\) cm, independent of \(m_d\) and \(d\). 40 cm comes from taking \(k/f\) as the deflection.
    2. 目标质量 \(m_d=2\) kg、刚度 \(k=800\) N/m。要临界阻尼(\(\zeta=1\)),阻尼 \(d\) 应取多少?2. Target mass \(m_d=2\) kg, stiffness \(k=800\) N/m. What damping \(d\) gives critical damping (\(\zeta=1\))?
    \(d=2\zeta\sqrt{k\,m_d}=2\sqrt{800\times2}=2\times40=80\) N·s/m。40 是忘了因子 2,1600 是忘了开方。此时 \(\omega_n=\sqrt{800/2}=20\) rad/s,也可以写成 \(d=2\zeta m_d\omega_n\)。\(d=2\zeta\sqrt{k\,m_d}=2\sqrt{800\times2}=2\times40=80\) N·s/m. 40 forgets the factor 2, 1600 forgets the square root. Here \(\omega_n=\sqrt{800/2}=20\) rad/s, so equivalently \(d=2\zeta m_d\omega_n\).
    3. 一台减速比很大、不能反向驱动的工业机器人,腕部装了六维力传感器,要打磨一个钢制工件。最合适的方案是?3. An industrial robot with large gear ratios, not backdrivable, has a six-axis force sensor at the wrist and must grind a steel part. Which approach fits best?
    位置控制的硬件 + 力传感器正是导纳控制的场景:伺服压住减速器的摩擦。选项 A 的力矩会被摩擦吃掉,位置误差可达 \(f_c/k\)。选项 B 会把毫米级误差变成上千牛的力。选项 C 在失去接触时没有位置参考。对钢件要注意 FIG 3 的结论:虚拟质量太轻会打颤。Position-controlled hardware plus a force sensor is exactly the admittance setting: the servo overpowers the gearbox friction. In option A friction eats the torque and leaves position errors up to \(f_c/k\). Option B turns millimetre errors into kilonewtons. Option C has no position reference once contact is lost. For a steel part, mind FIG 3: too light a virtual mass chatters.
    4. 手爪偏离设定点 5 cm、静止不动时,控制器把刚度从 200 N/m 瞬间提高到 400 N/m。系统的能量增加了多少?4. While the gripper sits at rest 5 cm away from its set point, the controller instantly raises the stiffness from 200 N/m to 400 N/m. By how much does the system's energy increase?
    弹簧势能 \(\tfrac12k\,\Delta x^2\) 从 \(\tfrac12\times200\times0.05^2=0.25\) J 变成 \(\tfrac12\times400\times0.05^2=0.5\) J,增加 0.25 J,正是 \(\tfrac12\Delta k\,\Delta x^2\)。这份能量是控制器凭空注入的,不是外界做的功:这就是变刚度破坏无源性的机制。0.5 J 是变刚度后的总势能,不是增量。The spring energy \(\tfrac12k\,\Delta x^2\) goes from \(\tfrac12\times200\times0.05^2=0.25\) J to \(\tfrac12\times400\times0.05^2=0.5\) J, an increase of 0.25 J, which is exactly \(\tfrac12\Delta k\,\Delta x^2\). The controller injected this energy out of nothing; no outside work was done: this is how varying stiffness breaks passivity. 0.5 J is the total spring energy afterwards, not the increase.
    5. 在 FIG 2 里,同样的刚度和阻尼比,导纳控制顶着钢墙打颤,阻抗控制却很平稳。根本原因是?5. In FIG 2, with the same stiffness and damping ratio, admittance control chatters against the steel wall while impedance control stays calm. What is the root cause?
    两种模式在 FIG 2 里都以 1 kHz 运行、带同样的 1 ms 延迟,墙也没有切向摩擦。区别在结构:导纳回路的增益约为 \(k_{\mathrm{eff}}/(m_a\omega^2)\),硬墙让穿越频率升到伺服带宽附近;阻抗控制的能量函数满足 \(\dot W\le\dot{\mathbf x}^\top\mathbf F_{\mathrm{ext}}\),与任何无源环境耦合都稳定(采样和延迟只在渲染刚度很高时才成问题)。Both modes in FIG 2 run at 1 kHz with the same 1 ms delay, and the wall has no tangential friction. The difference is structural: the admittance loop gain is about \(k_{\mathrm{eff}}/(m_a\omega^2)\), and a stiff wall pushes the crossover up to the servo bandwidth; impedance control's energy function satisfies \(\dot W\le\dot{\mathbf x}^\top\mathbf F_{\mathrm{ext}}\), so coupling to any passive environment is stable (sampling and delay only matter when the rendered stiffness is very high).

    9延伸阅读Further reading

    • N. Hogan, Impedance Control: An Approach to Manipulation, Parts I–III, ASME J. Dynamic Systems, Measurement, and Control 107(1), 1985 — 阻抗控制的奠基论文:因果、能量与操作The founding papers of impedance control: causality, energy and manipulation
    • M. T. Mason, Compliance and Force Control for Computer Controlled Manipulators, IEEE Trans. Systems, Man, and Cybernetics 11(6), 1981 — 自然约束与人工约束Natural and artificial constraints
    • M. H. Raibert & J. J. Craig, Hybrid Position/Force Control of Manipulators, ASME J. Dynamic Systems, Measurement, and Control 103(2), 1981 — 选择矩阵与力/位混合控制The selection matrix and hybrid position/force control
    • J. E. Colgate & N. Hogan, Robust Control of Dynamically Interacting Systems, Int. J. Control 48(1), 1988 — 无源性与耦合稳定性Passivity and coupled stability
    • J. E. Colgate & G. G. Schenkel, Passivity of a Class of Sampled-Data Systems: Application to Haptic Interfaces, J. Robotic Systems 14(1), 1997 — 采样渲染的无源性条件 \(b>KT/2+|B|\)The passivity condition for sampled rendering, \(b>KT/2+|B|\)
    • D. E. Whitney, Historical Perspective and State of the Art in Robot Force Control, Int. J. Robotics Research 6(1), 1987 — 力控制早期方法的综述A survey of the early force-control methods
    • A. Albu-Schäffer, C. Ott, U. Frese & G. Hirzinger, Cartesian Impedance Control of Redundant Robots: Recent Results with the DLR-Light-Weight-Arms, ICRA 2003 — 力矩控制臂上的笛卡尔阻抗与双对角化阻尼设计Cartesian impedance on torque-controlled arms and the double-diagonalization damping design
    • C. Ott, R. Mukherjee & Y. Nakamura, Unified Impedance and Admittance Control, ICRA 2010 — 阻抗与导纳的对偶及其融合The duality of impedance and admittance, and how to blend them
    • F. Ferraguti, C. Secchi & C. Fantuzzi, A Tank-Based Approach to Impedance Control with Variable Stiffness, ICRA 2013 — 用能量罐保持变刚度的无源性Keeping variable stiffness passive with an energy tank
    • B. Siciliano, L. Sciavicco, L. Villani & G. Oriolo, Robotics: Modelling, Planning and Control, Springer, 2009, Ch. 9 — 力控制:阻抗、导纳、力/位混合与并联控制Force control: impedance, admittance, hybrid and parallel force/position control
    • K. Lynch & F. Park, Modern Robotics, Ch. 11 — 力控制、混合运动–力控制与阻抗控制Force control, hybrid motion–force control and impedance control
    • R. Martín-Martín, M. A. Lee, R. Gardner, S. Savarese, J. Bohg & A. Garg, Variable Impedance Control in End-Effector Space: An Action Space for Reinforcement Learning in Contact-Rich Tasks, IROS 2019 — 把阻抗控制器当作学习的动作空间The impedance controller as an action space for learning