Part II · 第 7 章 结构与运动学 · 7.1Part II · Ch. 7 Structure & Kinematics · 7.1

连杆、关节与自由度Links, Joints & Degrees of Freedom

机器人是一张图:节点是刚体(连杆),边是关节。动手写任何运动学公式之前,先学会数数:一个刚体有几个自由度,一个关节拿走几个,整台机器人还剩几个。这个数字决定了要装几台电机、末端能够到达怎样的位姿,也决定了一个多杆机构到底能不能动。 A robot is a graph: the nodes are rigid bodies (links) and the edges are joints. Before writing any kinematic formula, learn to count: how many degrees of freedom a rigid body has, how many a joint takes away, and how many the whole machine keeps. That number decides how many motors you need, what end-effector poses are reachable, and whether a multi-bar mechanism can move at all.

约 32 分钟~32 min 前置:5.1 位姿 · 5.3 SE(3) · 5.10 指数积 · 1.6 秩Prereqs: 5.1 Frames & Poses · 5.3 SE(3) · 5.10 PoE · 1.6 Rank 5 个交互5 interactives

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

    拿到一台新机器人,第一个问题常常是:它有几个自由度?UR5 是 6,Franka 是 7,SCARA 通常是 4,Delta 并联机器人是 3,Stewart 平台是 6,一只灵巧手有二十来个,一台人形机器人再加上"浮动基座"的 6 个,超过三十。这个数字背后是三个很实际的问题。

    末端需要几个?空间里一个刚体的位姿有 6 个数(5.3 节的 \(\SE\) 是 6 维的)。要让手爪到达任意位姿,至少需要 6 个互相独立的关节;只要把零件放到桌面上并转一个角度,4 个就够(这正是 SCARA 的设计理由)。要装几台电机?每个主动关节一台,被动关节没有。数少了,机器人会有一部分在晃动、不受控;数多了,白白增加重量和成本。这个机构能不能动?并联机器人和各种闭链机构,光看图常常分不出它是刚性的结构还是可以运动的机构,必须数。

    这一课没有重的公式。我们先在图上数,再把"数数"写成 Grübler 公式,把它理解成"每个关节从自由刚体手里扣掉一部分自由度"。接着你会看到这条公式在哪里会失灵,以及更诚实的定义:局部自由度就是关节螺旋轴矩阵的秩(接上 5.10 节的螺旋轴和 1.6 节的秩)。

    The first question about a new robot is often: how many degrees of freedom does it have? A UR5 has 6, a Franka 7, a SCARA usually 4, a Delta parallel robot 3, a Stewart platform 6, a dexterous hand around twenty, and a humanoid more than thirty once you add the 6 of its "floating base". Behind this number sit three very practical questions.

    How many does the end effector need? A rigid body in space has a 6-number pose (the \(\SE\) of Lesson 5.3 is 6-dimensional). To place a hand at any pose you need at least 6 independent joints; to put a part on a table and turn it through one angle, 4 are enough (exactly the design argument for the SCARA). How many motors do I buy? One per actuated joint, none for passive ones. Count too few and part of the robot wobbles uncontrolled; count too many and you pay for weight and cost. Can this mechanism move at all? For parallel robots and closed-chain linkages, a drawing often does not reveal whether the thing is a rigid structure or a mechanism; you have to count.

    This lesson has little heavy algebra. We count on pictures first, then write the counting as the Grübler formula, read as "every joint takes some freedom away from a free rigid body". Then you will see where the formula fails, and the more honest definition: local mobility is the rank of the matrix of joint screw axes (building on the screw axes of Lesson 5.10 and the rank of Lesson 1.6).

    2直觉:关节是一条"允许与禁止"的规则Intuition: a joint is a rule of "allowed and forbidden"

    先固定一个物体 A(地面,或者上一节连杆)。一个自由的刚体 B 在平面里有 3 个自由度 \((x,y,\theta)\),在空间里有 6 个:3 个平移加 3 个转动,也就是 \(\SE\) 的 6 个维度。把 B 用一个关节连到 A 上,就是给 B 的运动立一条规则:这几个方向允许,其余方向禁止。允许的相对自由度个数记作 \(f\),被禁止的个数就是约束数 \(c = 6 - f\)(平面里是 \(3-f\))。

    工程里常见的关节只有六种。转动关节 R(铰链)与移动关节 P(滑轨)\(f=1\);螺旋关节 H(螺母沿螺杆)也是 \(f=1\),转角和平移被螺距 \(h\) 绑在一起;圆柱关节 C(转动加沿同一根轴的移动)和万向节 U(两根相交的垂直转轴)\(f=2\);球关节 S(肩、髋、球头)\(f=3\)。下面的实验让 B 在每种关节的规则下运动。每个关节的运动都可以写成 5.10 节的螺旋轴 \(S_i\) 和指数映射 \(T=\Exp(S_1\theta_1)\Exp(S_2\theta_2)\cdots\),图中紫色虚线就是此刻这些轴的位置。

    Fix a body A (the ground, or the previous link). A free rigid body B has 3 degrees of freedom \((x,y,\theta)\) in the plane and 6 in space: 3 translations and 3 rotations, the 6 dimensions of \(\SE\). Connecting B to A by a joint lays down a rule for B: these directions of motion are allowed, all others forbidden. The number of allowed relative degrees of freedom is \(f\); the number of forbidden ones is the number of constraints \(c = 6 - f\) (in the plane \(3-f\)).

    Only six joint types are common in engineering. The revolute joint R (hinge) and the prismatic joint P (slide) have \(f=1\); the helical joint H (a nut on a screw) also has \(f=1\), the rotation and the translation being tied together by a pitch \(h\); the cylindrical joint C (rotation plus translation along the same axis) and the universal joint U (two perpendicular intersecting axes) have \(f=2\); the spherical joint S (shoulder, hip, ball stud) has \(f=3\). The lab below lets B move under each joint's rule. Every joint motion can be written with the screw axes \(S_i\) and exponentials of Lesson 5.10, \(T=\Exp(S_1\theta_1)\Exp(S_2\theta_2)\cdots\); the dashed purple lines show where those axes are right now.

    FIG 1关节动物园:B 相对 A 能怎么动Joint zoo: how B may move relative to A
    拖动画面旋转视角drag to orbit
    连杆 A 固定(灰色底座与淡色坐标系)。连杆 B 是带"旗帜"的板,淡色影子是零位。紫色虚线是各关节轴当前的位置:第二根轴和第三根轴是被前面的关节带着走的(\(\operatorname{Ad}\) 作用于零位轴,5.8 节)。右侧的方块条:绿色是允许的相对自由度 \(f\),红色是被禁止的约束 \(c=6-f\)。读数里的"轴的秩"是这些当前螺旋轴张成的空间的维数。 Link A is fixed (grey base and faint frame). Link B is a plate with a "flag"; the faint shadow is the home pose. The dashed purple lines are the current joint axes: the second and third axes are carried along by the earlier joints (\(\operatorname{Ad}\) acting on the home axes, Lesson 5.8). In the square bar on the right, green squares are the allowed relative freedoms \(f\) and red ones the forbidden constraints \(c=6-f\). The "rank of axes" in the readout is the dimension of the space spanned by these current screw axes.
    试一试Try this
    • 选螺旋关节,把螺距设为 \(h=0.5\),再把 \(\theta\) 转满一圈(\(360^\circ\))。B 沿轴前进了多少?它与读数里的 \(h\theta\) 一致吗?为什么只有一个滑块就够了?Choose the helical joint, set the pitch to \(h=0.5\) and turn \(\theta\) a full revolution (\(360^\circ\)). How far has B advanced along the axis? Does it agree with \(h\theta\) in the readout? Why is one slider enough?
    • 选球关节,把中间的角 \(\theta_2\) 设为 \(90^\circ\)。三根轴的秩掉到了 2,可是球关节的 \(f\) 仍然是 3,B 依然能转到任何朝向。这是怎么回事?(提示:5.2 节的万向锁。)Choose the spherical joint and set the middle angle \(\theta_2\) to \(90^\circ\). The rank of the three axes drops to 2, yet \(f\) of the spherical joint is still 3 and B can still reach every orientation. What is going on? (Hint: gimbal lock, Lesson 5.2.)
    关节Joint\(f\)\(c\)等价的 1 自由度链Equivalent chain of 1-DoF joints例子Example
    转动 RRevolute R15—机械臂肘部、门铰链arm elbow, door hinge
    移动 PPrismatic P15—直线电机、龙门架、Stewart 的电动缸linear stage, gantry, Stewart actuator leg
    螺旋 HHelical H15—丝杠与螺母、螺栓lead screw and nut, bolt
    圆柱 CCylindrical C24R + P (同轴)(same axis)能转的伸缩杆a telescoping rod that also spins
    万向节 UUniversal U24R + R (轴相交且垂直)(axes intersecting, perpendicular)传动轴十字节、云台driveshaft Cardan joint, pan-tilt head
    球 SSpherical S33R + R + R (轴交于一点)(axes meeting in one point)髋、肩、球头拉杆hip, shoulder, ball-and-socket rod end

    表的第四列是一个重要的简化:任何多自由度关节都可以看成零长度连杆连起来的 1 自由度关节串。万向节是两个轴相交的转动关节,球关节是三个。所以机器人里真正需要的零件只有 R 和 P(有时再加 H):电机驱动的几乎都是 1 自由度关节。这也是机器人描述文件 URDF 只提供 revolute、continuous、prismatic、fixed、floating、planar 几种关节的原因:万向节和球关节要写成带"零质量连杆"的转动关节链。平面机构里只剩 R 和 P,每个 \(f=1\)、\(c=2\)。

    The fourth column is an important simplification: every multi-DoF joint can be seen as a chain of 1-DoF joints joined by zero-length links. A universal joint is two revolute joints with intersecting axes, a spherical joint is three. So the parts a robot really needs are R and P (and occasionally H): motors drive 1-DoF joints almost without exception. This is also why the robot description format URDF offers only revolute, continuous, prismatic, fixed, floating and planar joints: universal and spherical joints have to be written as chains of revolute joints with "massless links". In planar mechanisms only R and P remain, each with \(f=1\), \(c=2\).

    3动手玩:数自由度Play: counting degrees of freedom

    把机构画成一张图:每个刚体是一个节点(地面也是一个节点,并且要算进去),每个关节是连接两个节点的边。数出节点数 \(N\)、边数 \(J\),再把每条边的 \(f_i\) 加起来。道理一句话就说完:除去地面,有 \(N-1\) 个活动刚体,各自有 \(\lambda\) 个自由度(空间 \(\lambda=6\),平面 \(\lambda=3\));每个关节扣掉 \(c_i=\lambda-f_i\) 个。剩下的就是机构的活动度 (mobility):

    Draw the mechanism as a graph: every rigid body is a node (the ground is a node too, and it counts), every joint is an edge between two nodes. Count the nodes \(N\), the edges \(J\), and add up the \(f_i\) of all edges. The reasoning takes one sentence: besides the ground there are \(N-1\) moving bodies with \(\lambda\) degrees of freedom each (\(\lambda=6\) in space, \(\lambda=3\) in the plane); each joint removes \(c_i=\lambda-f_i\) of them. What remains is the mobility of the mechanism:

    $$ \hl{m}{m} \;=\; \lambda\,(\hl{N}{N}-1) - \sum_{i=1}^{\hl{J}{J}} \hl{c}{(\lambda-f_i)} \;=\; \lambda\,(N-1-J) + \sum_{i=1}^{J} f_i. $$

    这就是 Grübler–Kutzbach 公式(推导在第 5 节)。FIG 2 左边是机构的图(边上标着关节类型),右边是"预算表":从 \(\lambda(N-1)\) 的总自由度出发,各类关节依次扣掉约束,剩下的绿柱是 \(m\)。点击预设,先在心里算一遍再看答案。

    This is the Grübler–Kutzbach formula (derived in Section 5). On the left of FIG 2 is the graph of the mechanism (edges labelled by joint type); on the right is the "budget": start from the total freedom \(\lambda(N-1)\), let each joint type subtract its constraints, and the green bar that remains is \(m\). Click a preset, and compute it in your head before reading the answer.

    FIG 2Grübler 计数器:图与预算Grübler counter: graph and budget
    运动学图:节点 = 刚体,边 = 关节kinematic graph: node = body, edge = joint
    自由度预算freedom budget
    图中方块是地面,琥珀色圆点是末端平台(若有),边上的字母是关节类型(青色 \(f=1\)、绿色 \(f=2\)、紫色 \(f=3\)、琥珀色是 6 自由度的"自由关节"F)。右图:青色柱是 \(\lambda(N-1)\),红柱是各类关节扣掉的 \(\sum c_i\),最右一根是 \(m\)(绿:能动;琥珀:0,刚性结构;红:负数,"过约束")。Grübler 数得出来的是公式的结果;"实际活动度"一栏是用别的办法(几何、数值秩)得到的真实值,两者不一致的几行,就是第 4 节要讲的例外。悬停公式里的符号,图中对应部分会高亮。 In the graph, the square is the ground, the amber dot is the end platform (if any), and the letters on the edges are joint types (teal \(f=1\), green \(f=2\), purple \(f=3\), amber for the 6-DoF "free joint" F). In the budget chart, the cyan bar is \(\lambda(N-1)\), the red bars are the \(\sum c_i\) removed by each joint type, and the last bar is \(m\) (green: it moves; amber: 0, a rigid structure; red: negative, "over-constrained"). Grübler gives the result of the formula; the "actual mobility" line is the true value found another way (geometry, numerical rank). The rows where the two disagree are the exceptions of Section 4. Hover the symbols in the formula to highlight the matching part of the figure.
    试一试Try this
    • 先自己算 6-UPS Stewart 平台:\(N=14\)(地面、平台、6 条腿各 2 节),\(J=18\),\(\sum f_i=6\cdot2+6\cdot1+6\cdot3=36\)。再点预设对答案。6 个自由度,由 6 个移动关节驱动,一一对应。First compute the 6-UPS Stewart platform yourself: \(N=14\) (ground, platform, and two parts for each of the 6 legs), \(J=18\), \(\sum f_i=6\cdot2+6\cdot1+6\cdot3=36\). Then click the preset to check. Six degrees of freedom, driven by the six prismatic joints, one for one.
    • 依次打开 6-SPS Stewart 与 Delta。Grübler 给出 12 和 9,大于平台真正能做的 6 和 3。多出来的是什么?(读数里的"被动/空转"一行。)Open 6-SPS Stewart and then Delta. Grübler gives 12 and 9, more than the 6 and 3 the platform can really do. What is the surplus? (See the "passive / idle" line in the readout.)
    • 打开 Bennett、Sarrus 或 双平行四边形 之一:公式给出 \(m\le0\),似乎是刚性结构,可是"实际活动度"是 1。数出了错吗?(第 4 节解释。)Open one of Bennett, Sarrus or the double parallelogram: the formula gives \(m\le0\), apparently a rigid structure, yet the "actual mobility" is 1. Did the count go wrong? (Explained in Section 4.)

    闭链:一根曲柄带动整个机构Closed chains: one crank drives the whole mechanism

    串联机械臂的图是一条链,\(m=\sum f_i\),没什么好数的。有意思的是闭链:图里有环。每多一个独立的环,就多一组闭合条件,吃掉 \(\lambda\) 个自由度。平面四连杆 (four-bar) 是最小的例子:\(N=4\),\(J=4\),4 个转动关节,\(m=3(4-1-4)+4=1\)。一个自由度,所以转动曲柄,其余的杆都跟着确定地运动。FIG 3 里拖动曲柄末端的紫色圆圈,机构的两种"装配方式"(对应回路方程两个解)可以用按钮切换。

    四连杆的 4 根杆长决定它的"性格"。Grashof 条件:最短杆 \(s\) 加最长杆 \(l\) 不超过另两根之和 \(p+q\) 时,至少有一根杆可以相对邻杆整圈转动;否则每一根都只能摆动(三摇杆)。再看最短杆是哪一根,就能区分曲柄摇杆、双曲柄、双摇杆。切换"五连杆":把地面到末端的回路再加一根杆,\(m=2\),需要两台电机,末端 E 扫出的就不再是一条曲线,而是一块面积。

    The graph of a serial arm is a chain, \(m=\sum f_i\), and there is nothing to count. The interesting case is the closed chain, a graph with loops. Every independent loop adds a closure condition that eats \(\lambda\) degrees of freedom. The planar four-bar is the smallest example: \(N=4\), \(J=4\), four revolute joints, \(m=3(4-1-4)+4=1\). One degree of freedom: turn the crank and every other bar moves in a definite way. In FIG 3, drag the purple circle at the end of the crank; the two "assembly modes" of the mechanism (the two solutions of the loop equation) can be switched with a button.

    The four bar lengths decide the mechanism's "character". The Grashof condition: if the shortest bar \(s\) plus the longest bar \(l\) is no more than the sum \(p+q\) of the other two, at least one bar can rotate fully relative to its neighbours; otherwise every bar only rocks (a triple rocker). Which bar is the shortest then separates crank-rocker, double-crank and double-rocker. Switch to "five-bar": one more bar in the loop, \(m=2\), two motors, and the end point E no longer sweeps a curve but an area.

    FIG 3闭链实验室:四连杆与五连杆Closed-chain lab: four-bar and five-bar
    四连杆:地面铰点 \(O_2,O_4\),曲柄 \(a\)、连杆 \(b\)、摇杆 \(c\)。琥珀色曲线是固连在连杆上的点 P(可拖动)走出的耦合曲线,淡虚线是另一种装配方式下的曲线。曲柄转不动时说明走到了极限位置(画面和读数里都会标出"受阻")。读数中的 \(\mu\) 是连杆与摇杆之间的夹角;\(\mu\to0^\circ\) 或 \(180^\circ\)(连杆与摇杆共线)是死点/折叠位置:把曲柄锁住,连杆与摇杆仍可发生一阶微小运动,即瞬时多出一个自由度。五连杆:拖动两个紫色圆圈,E 是两个圆的交点;淡点是 E 在所有 \((\varphi_1,\varphi_2)\) 下可达的区域。 Four-bar: ground pivots \(O_2,O_4\), crank \(a\), coupler \(b\), rocker \(c\). The amber curve is the coupler curve traced by a point P rigidly attached to the coupler (draggable); the faint dashed curve belongs to the other assembly mode. When the crank will not turn further, it has reached a limit position (flagged "blocked" on the canvas and in the readout). In the readout \(\mu\) is the angle between coupler and rocker; \(\mu\to0^\circ\) or \(180^\circ\) (coupler and rocker collinear) is a dead-centre / toggle position: with the crank locked, the coupler and rocker can still move to first order, an instantaneous extra degree of freedom. Five-bar: drag the two purple circles; E is the intersection of two circles; the faint dots are the region E can reach over all \((\varphi_1,\varphi_2)\).
    试一试Try this
    • 在"曲柄摇杆"预设上,把曲柄长度 \(a\) 的滑块慢慢拉大,直到 Grashof 判定从"是"变成"否"。此时曲柄还能整圈转动吗?数值扫描与判据一致吗?On the "crank-rocker" preset, slowly increase the crank length \(a\) until the Grashof verdict flips from yes to no. Can the crank still turn a full circle? Does the numerical sweep agree with the criterion?
    • 选"三摇杆",拖动曲柄直到它被卡住。这时 \(\sin\mu\approx0\),速度比 \(\mathrm d\chi/\mathrm d\varphi\) 发生了什么?再选"平行四边形",转到 \(\varphi=0^\circ\) 附近,观察"环路秩"。Choose "triple rocker" and drag the crank until it jams. Now \(\sin\mu\approx0\); what happens to the velocity ratio \(\mathrm d\chi/\mathrm d\varphi\)? Then choose "parallelogram", turn to near \(\varphi=0^\circ\) and watch the "loop rank".
    • 切换到"五连杆",把两个曲柄都拖一拖。只拖一个,末端 E 走出一条曲线;两个一起拖,E 能去哪些地方?需要几台电机?Switch to "five-bar" and drag both cranks. With one crank, E traces a curve; with both, where can E go? How many motors are needed?

    4第二、第三视角:秩,以及公式的盲区Second and third views: rank, and the blind spot of the formula

    自由度 = 秩Degrees of freedom = rank

    数数是粗糙的,它假设每个约束都管用。更可靠的定义是局部的、线性代数的:在位形 \(\boldsymbol\theta\) 处,让每个关节单独转一点,末端的位姿各自朝哪个方向变化?这就是 5.10 节空间雅可比的各列 \(\operatorname{Ad}_{\Exp(S_1\theta_1)\cdots}S_i\)(当前位形下各关节轴的样子)。末端能朝多少个独立方向运动,就是这些列的秩。关节有 \(n\) 个,秩是 \(r\),那么 \(n-r\) 个关节方向的运动是"白费力气"(1.6 节的零空间)。

    FIG 4 让你自己搭一条链:点击每个关节按钮,在转动/移动、三个方向之间循环,或设为"—"(拿掉)。矩阵是当前的 \(J_s\),右图是它的奇异值。试试看:六个关节是不是总给你六个自由度?

    Counting is crude: it assumes every constraint does its job. The more reliable definition is local and linear-algebraic: at a configuration \(\boldsymbol\theta\), nudge each joint alone; in which direction does the end-effector pose change? Those are the columns \(\operatorname{Ad}_{\Exp(S_1\theta_1)\cdots}S_i\) of the space Jacobian of Lesson 5.10 (each joint axis as it looks in the current configuration). The number of independent directions the end effector can move in is the rank of these columns. With \(n\) joints and rank \(r\), \(n-r\) directions of joint motion are "wasted effort" (the null space of Lesson 1.6).

    FIG 4 lets you build a chain yourself: click each joint button to cycle through revolute/prismatic and the three directions, or set it to "—" (removed). The matrix is the current \(J_s\) and the right panel shows its singular values. Try it: do six joints always give you six degrees of freedom?

    FIG 4自由度 = 螺旋轴矩阵的秩DoF = rank of the screw-axis matrix
    拖动画面旋转视角drag to orbit
    \(J_s\) 的奇异值singular values of J_s
    3D 图:灰色粗线是连杆骨架,彩色虚线是各个关节当前的轴,琥珀点是末端。关节 1–3 的轴在肩,关节 4 在肘,关节 5–7 在腕。右图:\(J_s\) 的 6 个奇异值(条越短,该方向越难动);红色条代表数值上为 0(低于 \(10^{-3}\)),即这个方向上末端无法瞬时运动。秩 \(r\) 就是非零奇异值的个数;\(r<6\) 说明末端有 \(6-r\) 个方向动不了。 3D view: the thick grey polyline is the link skeleton, the dashed coloured lines are the current joint axes and the amber dot is the end effector. Axes of joints 1–3 sit at the shoulder, joint 4 at the elbow, joints 5–7 at the wrist. Right: the 6 singular values of \(J_s\) (a shorter bar means a direction that is harder to move in); red bars are numerically zero (below \(10^{-3}\)), i.e. directions in which the end effector cannot move instantaneously. The rank \(r\) is the number of non-zero singular values; \(r<6\) means \(6-r\) directions are stuck.
    试一试Try this
    • 载入"六个同向转轴"。六个关节,为什么秩只有 3?把关节按钮改成别的方向,看看秩怎样变化。Load "six parallel axes". Six joints, why is the rank only 3? Change some joint buttons to other directions and watch how the rank changes.
    • 载入"一般 6R 臂",把第 6 个关节(腕部中间的 \(R_y\);这个预设去掉了第 3 个)拖到 \(0^\circ\):两根腕轴重合,秩从 6 掉到 5。把它稍微转开,秩立刻恢复。这是奇异位形(见 7.4)。再载入"7R 臂":7 个关节,秩仍是 6,多出来的 1 个是什么?Load "generic 6R arm" and drag joint 6 (the middle wrist \(R_y\); this preset removes joint 3) to \(0^\circ\): two wrist axes coincide and the rank falls from 6 to 5. Turn it slightly away and the rank recovers at once. This is a singular configuration (see 7.4). Then load the "7R arm": 7 joints, still rank 6. What is the extra one?

    Grübler 的盲区:当约束并不独立Grübler's blind spot: when constraints are not independent

    公式假定每个关节拿走的自由度是"新的"。如果有些约束其实是同一个约束的重复,公式就会少数。最简单的例子是"双平行四边形":两根等长的平行曲柄,上面装一根与地面平行的连杆,再在曲柄中间加第二根平行于地面的杆 CD。\(N=5\),\(J=6\),\(m=3(5-1-6)+6=0\):公式说这是一个刚性结构。可是只要杆 CD 的长度恰好等于地面长度,CD 就始终与地面平行,没有给机构增加任何新约束,整个机构依然是 1 自由度。这就是过约束 (overconstrained) 机构。FIG 5 里把 CD 的长度偏差 \(\varepsilon\) 从 0 拉开一点,看会发生什么。

    The formula assumes every joint takes away "new" freedom. If some constraints are really repeats of the same one, the formula undercounts. The simplest example is the "double parallelogram": two equal parallel cranks with a coupler parallel to the ground, plus a second bar CD midway between the cranks, also parallel to the ground. \(N=5\), \(J=6\), \(m=3(5-1-6)+6=0\): the formula says this is a rigid structure. But if the length of bar CD is exactly the length of the ground, CD stays parallel to the ground and adds no new constraint; the whole mechanism still has 1 degree of freedom. This is an over-constrained mechanism. In FIG 5, pull the length error \(\varepsilon\) of CD away from 0 and see what happens.

    FIG 5双平行四边形:公式说 0,真实是 1Double parallelogram: the formula says 0, reality is 1
    拖动紫色圆圈转动曲柄。红色是第 5 根杆 CD 的"应有长度" \(g+\varepsilon\) 与它两端铰点之间实际距离 \(g\) 的差:\(\varepsilon=0\) 时二者重合,曲柄想转就转;\(\varepsilon\ne0\) 时杆在每一个位置都要被拉长或压短 \(\varepsilon\),只有靠杆的弹性变形才能动,没有变形余量的真实机构就是一个卡死的刚体。公式的"0"在 \(\varepsilon\ne0\) 时才是对的,\(\varepsilon=0\) 恰好是它的盲区。 Drag the purple circle to turn the crank. The red part shows the difference between the "required length" \(g+\varepsilon\) of the fifth bar CD and the actual distance \(g\) between its two pivots: at \(\varepsilon=0\) they coincide and the crank turns freely; at \(\varepsilon\ne0\) the bar would have to stretch or shrink by \(\varepsilon\) at every position, so it can only move by elastic deformation, and a real mechanism without such slack is a jammed rigid body. The formula's "0" is right when \(\varepsilon\ne0\); \(\varepsilon=0\) is exactly its blind spot.
    试一试Try this
    • 把 \(\varepsilon\) 从 0 拉到 \(|\varepsilon|\ge0.1\)(\(g=2\),只有 5%),读出杆内的应变。再拖曲柄,应变变化吗?现实中的机构靠什么容忍这样的误差?Pull \(\varepsilon\) from 0 to \(|\varepsilon|\ge0.1\) (with \(g=2\), only 5%) and read the strain in the bar. Drag the crank: does the strain change? What lets real mechanisms tolerate such an error?
    一个数字的三种求法Three ways to get one number

    记账:\(m=\lambda(N-1-J)+\sum f_i\),只看节点数、边数和关节类型,不管几何尺寸,所以算得快,也会算错。数环:\(m=\sum f_i-\lambda L\),其中 \(L=J-N+1\) 是图里独立环的个数,每个环吃掉 \(\lambda\) 个自由度;这和记账是同一个公式换了说法。算秩:\(m_{\text{local}}=n-\operatorname{rank}(A(\boldsymbol\theta))\),\(A\) 是闭环约束的雅可比矩阵(对串联链,螺旋轴矩阵 \(J_s\) 的秩数的是末端能动的方向数,\(n-\operatorname{rank}J_s\) 是零空间维数,见 FIG 4)。它看的是真实的几何,所以不会被特殊尺寸骗到,也会如实反映奇异位形里"瞬时自由度"的变化。前两种是估计,第三种才是定义。

    Bookkeeping: \(m=\lambda(N-1-J)+\sum f_i\) looks only at node count, edge count and joint types, ignoring all dimensions, so it is quick, and can be wrong. Loop counting: \(m=\sum f_i-\lambda L\), where \(L=J-N+1\) is the number of independent loops in the graph and each loop eats \(\lambda\) freedoms; this is the same formula in other words. Rank: \(m_{\text{local}}=n-\operatorname{rank}(A(\boldsymbol\theta))\), where \(A\) is the Jacobian of the loop-closure constraints (for a serial chain, the rank of the screw-axis matrix \(J_s\) counts the end-effector directions instead, and \(n-\operatorname{rank}J_s\) is the null-space dimension; see FIG 4). It looks at the real geometry, so special dimensions cannot fool it, and it faithfully reports changes of "instantaneous freedom" at singular configurations. The first two are estimates; the third is the definition.

    5再看数学The math

    提示:把鼠标悬停在公式中带底色的符号上,FIG 2 中对应的部分会被高亮。Tip: hover the highlighted symbols in the formulas; the matching part of FIG 2 lights up.

    自由度与约束Degrees of freedom and constraints

    自由度 (degree of freedom, DoF) 是完全确定机构位形所需的最少独立坐标个数。一个自由刚体:平面 \(\lambda=3\)(\(\mathrm{SE}(2)\)),空间 \(\lambda=6\)(\(\SE\),5.3 节)。\(f\) 自由度的关节在 B 的位形空间里切出一个 \(f\) 维的子集,等价于 \(c=\lambda-f\) 个独立的位形约束。

    A degree of freedom (DoF) is a coordinate in the minimal set of independent coordinates that fixes the configuration of the mechanism. A free rigid body has \(\lambda=3\) in the plane (\(\mathrm{SE}(2)\)) and \(\lambda=6\) in space (\(\SE\), Lesson 5.3). A joint with \(f\) degrees of freedom cuts out an \(f\)-dimensional subset of B's configurations, equivalent to \(c=\lambda-f\) independent configuration constraints.

    Grübler–Kutzbach 公式的推导Deriving the Grübler–Kutzbach formula

    地面固定,\(N-1\) 个活动刚体在不受约束时共有 \(\lambda(N-1)\) 个自由度。每个关节 \(i\) 带来 \(c_i=\lambda-f_i\) 个约束方程。若所有方程相互独立,则每个方程恰好消去一个自由度:

    The ground is fixed, so the \(N-1\) moving bodies have \(\lambda(N-1)\) degrees of freedom when unconstrained. Each joint \(i\) contributes \(c_i=\lambda-f_i\) constraint equations. If all the equations are independent, each removes exactly one degree of freedom:

    $$ \hl{m}{m} = \lambda(\hl{N}{N}-1) - \sum_{i=1}^{\hl{J}{J}}\hl{c}{(\lambda-f_i)} = \lambda\,(N-1-J) + \sum_{i=1}^{J}\hl{f}{f_i}, \qquad \lambda=\begin{cases}6 & \text{spatial}\\ 3 & \text{planar}\end{cases} $$

    图的独立环个数是 \(L=J-N+1\)(圈秩,cyclomatic number),代入得 \(m=\sum f_i-\lambda L\):每个独立回路吃掉 \(\lambda\) 个自由度。树形结构(\(L=0\),所有串联臂、人形机器人去掉浮动基座后的树)没有环,\(m=\sum f_i\),关节自由度直接相加。公式还有一个常被忽略的性质:方程之间若有依赖,真正独立的约束更少,解集的维数不会低于"未知数减去方程数"。所以只要机构能够装配起来,真实活动度\(\ge\)公式的值;公式给出 0 或负数,并不意味着机构一定动不了(FIG 5)。

    The number of independent loops of the graph is \(L=J-N+1\) (the cyclomatic number), which gives \(m=\sum f_i-\lambda L\): every independent loop eats \(\lambda\) degrees of freedom. A tree (\(L=0\): every serial arm, and a humanoid once the floating base is removed) has no loops, \(m=\sum f_i\), and joint freedoms simply add. The formula has a property that is often overlooked: when the equations depend on each other, fewer constraints are really independent, and the dimension of the solution set is never below "unknowns minus equations". So if the mechanism can be assembled at all, its actual mobility is \(\ge\) the formula's value; a formula result of 0 or below does not prove that the mechanism cannot move (FIG 5).

    两个手算例子Two worked examples

    $$ \text{four-bar:}\quad m = 3\,(4-1-4) + 4\cdot 1 = 1, \qquad\text{6-UPS Stewart:}\quad m = 6\,(14-1-18) + \underbrace{6\cdot2}_{U}+\underbrace{6\cdot1}_{P}+\underbrace{6\cdot3}_{S} = -30+36 = 6. $$

    Stewart 平台:地面 + 平台 + 6 条腿 \(\times\) 2 节(缸筒与活塞杆)= 14 个刚体;每条腿 3 个关节(地面端 U,缸筒与活塞杆之间 P,平台端 S),共 18 个。把地面端的 U 换成 S(6-SPS,两端都是球关节)则 \(\sum f_i=6\cdot(3+1+3)=42\)、\(m=12\):多出的 6 是每条腿绕自身轴线的空转,对平台的位姿毫无影响。

    Stewart platform: ground + platform + 6 legs \(\times\) 2 parts (cylinder and piston rod) = 14 rigid bodies; 3 joints per leg (U at the ground end, P between cylinder and rod, S at the platform end) give 18. Replacing the ground-end U with S (6-SPS, ball joints at both ends) gives \(\sum f_i=6\cdot(3+1+3)=42\) and \(m=12\): the extra 6 is each leg spinning about its own axis, which has no effect on the platform pose.

    活动度的局部定义:秩The local definition of mobility: rank

    设位形用 \(n\) 个坐标 \(\mathbf q\) 描述,闭环等约束写成 \(g(\mathbf q)=0\)(这样的约束叫完整约束,holonomic,它们能积分成位形之间的代数关系)。在一点 \(\mathbf q\) 处,允许的速度满足 \(A(\mathbf q)\dot{\mathbf q}=0\),\(A=\partial g/\partial\mathbf q\)。于是

    Describe the configuration with \(n\) coordinates \(\mathbf q\) and write the loop-closure equations as \(g(\mathbf q)=0\) (such constraints are called holonomic: they are algebraic relations between configurations). At a point \(\mathbf q\), the allowed velocities satisfy \(A(\mathbf q)\dot{\mathbf q}=0\) with \(A=\partial g/\partial\mathbf q\). Hence

    $$ m_{\text{local}}(\mathbf q) = n - \operatorname{rank}A(\mathbf q), \qquad m = \max_{\mathbf q}\, m_{\text{local}}\ \ \text{(generic mobility, if the solution set is a manifold)}. $$

    秩在特殊位形处下降,\(m_{\text{local}}\) 就在那里变大:这就是 FIG 3 里平行四边形折叠位置的"瞬时多出的自由度"(环路秩从 2 降到 1,3 个坐标减去秩,\(3-1=2\))。串联臂也一样:\(\boldsymbol\theta\) 处末端能动的方向数是 \(\operatorname{rank}J_s(\boldsymbol\theta)\)(FIG 4),它在奇异位形处变小。两者方向相反,是因为一个数的是"约束掉多少",另一个数的是"还能走多少"。形如 \(A(\mathbf q)\dot{\mathbf q}=0\) 的速度约束(例如冰刀、轮子不能侧滑)如果不能积分成位形约束,就是非完整约束 (nonholonomic):它们减少可用的速度方向,却不减少可达位形的维数,这是 9.1 节的主题。

    When the rank drops at a special configuration, \(m_{\text{local}}\) grows there: this is the "instantaneous extra freedom" at the folded parallelogram position of FIG 3 (loop rank 2 falls to 1, and 3 coordinates minus rank gives \(3-1=2\)). For a serial arm the number of directions the end effector can move in at \(\boldsymbol\theta\) is \(\operatorname{rank}J_s(\boldsymbol\theta)\) (FIG 4), and it shrinks at singular configurations. The two go in opposite directions because one counts "how much is constrained" and the other "how much can still move". Velocity constraints of the form \(A\dot{\mathbf q}=0\) (a skate blade, a wheel that cannot slip sideways) that do not integrate to configuration constraints are nonholonomic: they reduce the available velocity directions but not the dimension of the reachable configurations. That is the subject of Lesson 9.1.

    关节自由度、任务自由度、冗余与欠驱动Joint DoF, task DoF, redundancy and underactuation

    要区分三个数:机构的活动度 \(m\)(也就是需要几个独立坐标),任务的维数 \(d\)(末端要控制几个量:只定位是 3,定位加朝向是 6,平面里 3),主动关节数 \(n_a\)(几台电机)。它们的大小关系给出常见的几类机器人:

    Keep three numbers apart: the mobility \(m\) of the mechanism (how many independent coordinates it needs), the dimension \(d\) of the task (how many quantities of the end effector you control: 3 for position only, 6 for position and orientation, 3 in the plane), and the number of actuated joints \(n_a\) (how many motors). Their relative sizes give the familiar classes of robots:

    条件Condition名称Name例子与后果Example and consequence
    \(n_a=m\)全驱动fully actuated工业机械臂:每个自由度都有电机,可以直接指令加速度(Part IV 的计算力矩控制)an industrial arm: every DoF has a motor and you can command accelerations directly (computed-torque control, Part IV)
    \(n_a<m\)欠驱动underactuated带浮动基座的人形与足式机器人(6 个自由度没有电机)、四旋翼(6 自由度,4 个旋翼)、Acrobot。必须借助动力学和接触力来"间接驱动"a floating-base humanoid or legged robot (6 DoF without motors), a quadrotor (6 DoF, 4 rotors), the Acrobot. They must be driven "indirectly" through dynamics and contact forces
    \(n_a>m\)冗余驱动redundantly actuated多腿并联机器人(3 自由度用 4 条腿):可以消除奇异位形、产生内部预紧力,代价是电机之间必须协调a parallel robot with more legs than DoF (4 legs for 3 DoF): removes singularities and allows internal pre-load, at the price of coordinating the motors
    \(m>d\)运动学冗余kinematically redundant7R 臂做 6 维任务:同一个末端位姿对应一条 \(m-d=1\) 维的关节位形曲线(自运动),3.4 节的零空间a 7R arm on a 6D task: one end-effector pose corresponds to a curve of \(m-d=1\) dimensions in joint space (self-motion), the null space of Lesson 3.4
    \(m<d\)任务无法完全控制task not fully controllable5 自由度机械臂做 6 维位姿:只能到达位姿集合里一个"零测度"的子集a 5-DoF arm on a 6D pose task: it reaches only a measure-zero subset of poses

    为什么是 6,为什么是 7Why six, and why seven

    串联臂的正运动学是一个光滑映射 \(F:\mathbb R^n\to\SE\),\(\SE\) 是 6 维的。若 \(n<6\),像集的维数不超过 \(n\),在 \(\SE\) 里测度为 0(Sard 定理):绝大多数位姿够不到。\(n=6\) 时,在秩为 6 的位形附近 \(F\) 是局部的满射,每个位姿有有限个原像,也就是有限个逆运动学解(一般的 6R 最多 16 个,7.5 节)。\(n=7\) 时每个位姿的原像是一条一维曲线,即上表中的运动学冗余。6 是"够用的最小值",7 是"多出一个可调节的维度",代价是更多的关节与更复杂的控制。

    The forward kinematics of a serial arm is a smooth map \(F:\mathbb R^n\to\SE\) into a 6-dimensional space. If \(n<6\) the image has dimension at most \(n\) and measure zero in \(\SE\) (Sard's theorem): almost every pose is unreachable. With \(n=6\), near a configuration where the rank is 6, \(F\) is locally onto and each pose has finitely many pre-images, i.e. finitely many inverse-kinematics solutions (up to 16 for a general 6R, Lesson 7.5). With \(n=7\) the pre-image of each pose is a one-dimensional curve, the kinematic redundancy of the table above. Six is "the least that suffices"; seven buys one adjustable dimension at the cost of more joints and more complex control.

    浮动基座The floating base

    足式机器人和人形机器人没有固定在地面上。把"世界"当作地面,机身通过一个自由关节 (free joint,\(f=6\),\(c=0\)) 连到世界:FIG 2 里的"人形"预设就是这样,\(m=6+30=36\),但只有 30 台电机。这 6 个无电机的自由度正是欠驱动:机身的运动完全由腿与地面的接触力决定(9.2 节)。MuJoCo 和 Pinocchio 都用 7 个数描述自由关节的位形(位置加单位四元数),速度只有 6 维:位形坐标的个数不等于自由度,这正是下一课 7.2 节的内容。

    Legged robots and humanoids are not bolted to the ground. Take the "world" as the ground and attach the trunk to it by a free joint (\(f=6\), \(c=0\)): the "humanoid" preset in FIG 2 does exactly this, \(m=6+30=36\), but there are only 30 motors. Those 6 motor-less degrees of freedom are precisely the underactuation: the trunk's motion is determined entirely by the contact forces between the legs and the ground (Lesson 9.2). MuJoCo and Pinocchio describe the configuration of a free joint with 7 numbers (position plus a unit quaternion) but its velocity with 6: the number of configuration coordinates is not the number of degrees of freedom, which is the subject of the next lesson, 7.2.

    6机器人中的它:架构怎么选In robotics: choosing an architecture

    每一种常见的机器人构型,都是对"数出来的自由度"的一个回答:任务需要几个自由度,就给几个,再用构型换取速度、刚度、负载或成本。

    Every common robot architecture is an answer to the counted degrees of freedom: give the task as many as it needs, then trade architecture for speed, stiffness, payload or cost.

    机器人Robot结构Structure自由度DoF为什么这样设计Why it is built this way
    工业 6R 臂(UR5e、ABB IRB、KUKA KR)Industrial 6R arm (UR5e, ABB IRB, KUKA KR)6 个转动关节6 revolute joints6恰好够到达任意位姿;许多型号的腕部三轴相交(球腕),使逆运动学有解析解just enough to reach any pose; many models have three wrist axes meeting at a point (a spherical wrist), which gives closed-form inverse kinematics
    7R 协作臂(Franka Panda、KUKA LBR iiwa)7R collaborative arm (Franka Panda, KUKA LBR iiwa)7 个转动关节7 revolute joints7任务 6 维,多 1 个自运动维度:躲障碍、避开关节极限和奇异位形a 6D task with one extra self-motion dimension: dodge obstacles, avoid joint limits and singularities
    SCARAR-R-P-RR-R-P-R4装配、搬运只需要 \((x,y,z,\text{yaw})\);水平方向柔顺、竖直方向刚硬,速度快、便宜(FIG 4 里的预设,秩为 4)assembly and pick-and-place need only \((x,y,z,\text{yaw})\); compliant horizontally, stiff vertically, fast and cheap (the preset in FIG 4, rank 4)
    Delta(Clavel 1988;ABB FlexPicker)Delta (Clavel 1988; ABB FlexPicker)3 个基座电机 + 3 组平行四边形杆3 base motors + 3 parallelogram rod pairs3(平移)3 (translation)电机都在底座,运动部分极轻,每分钟可抓取上百次;平行四边形使平台始终不转。工业型号常再加一根伸缩中轴给出第 4 个转动自由度all motors on the base, very light moving parts, over a hundred picks per minute; the parallelograms keep the platform from rotating. Industrial models often add a telescopic central shaft for a 4th, rotational DoF
    Stewart–Gough 平台Stewart–Gough platform6-UPS6六条腿共同承载,刚度和负载比串联臂高得多,用于飞行模拟器和精密定位台;代价是工作空间小six legs share the load, giving much higher stiffness and payload than a serial arm; used in flight simulators and precision positioners; the price is a small workspace
    四足机器人(如 Boston Dynamics Spot)Quadruped (e.g. Boston Dynamics Spot)每腿 3 个电机,浮动基座3 motors per leg, floating base12 个驱动 + 6 个无驱动12 actuated + 6 unactuated三个关节足以把脚放到腿部工作空间内的任意点;机身的 6 个自由度靠足底接触力控制three joints suffice to place the foot at any point of the leg's workspace; the trunk's 6 DoF are controlled through foot contact forces
    全尺寸人形(如 Unitree H1)Full-size humanoid (e.g. Unitree H1)19 个驱动关节,浮动基座19 actuated joints, floating base19 个驱动 + 6 个无驱动19 actuated + 6 unactuated每条腿 5 个、每条手臂 4 个、腰部 1 个;手臂自由度少于人类的 7,是成本与任务需要之间的折衷5 per leg, 4 per arm, 1 at the waist; arms have fewer than the human 7, a trade-off between cost and what the tasks need
    灵巧手(Shadow Hand、Allegro Hand)Dexterous hand (Shadow Hand, Allegro Hand)多指,每指 3–4 个关节several fingers, 3–4 joints eachShadow:24 个关节中 20 个有独立驱动;Allegro:16Shadow: 24 joints, 20 independently driven; Allegro: 16操作一个自由物体(6 维位姿)需要的接触与关节远多于 6,且指尖之间形成闭链(9.3 节)manipulating a free object (a 6D pose) needs far more than 6 joints and contacts, and the fingertips form closed chains with the object (Lesson 9.3)
    人的手臂The human arm肩 3 + 肘 1 + 前臂旋转 1 + 腕 2shoulder 3 + elbow 1 + forearm rotation 1 + wrist 27与 7R 协作臂同样的冗余:手固定不动,肘部仍能画圆the same redundancy as a 7R arm: with the hand held still, the elbow can still swing around a circle
    真实系统里In real systems

    URDF 描述的是一棵树:每个关节有一个父连杆和一个子连杆,所以闭链机构(四连杆、Delta、Stewart、手加物体)无法直接表达。仿真器的通行做法是把环"剪开",再加一个约束把断口接回去:MuJoCo 的 equality 里的 connect 去掉 3 个自由度(球关节的闭合),weld 去掉 6 个,这正是上面"每个环吃掉 \(\lambda\) 个自由度"的数值实现。Pinocchio 和 MuJoCo 的浮动基座都是 7 维位形、6 维速度的自由关节;URDF 用 floating 关节类型,SDF(Gazebo)还提供 ball、universal、screw 等多自由度关节类型。并联机器人和串联臂的难易正好相反:Stewart 平台由位姿求六条腿的长度有闭式解(逆运动学很容易),而由腿长求位姿(正运动学)是一个多项式方程组,一般的 Stewart 平台最多有 40 组解,只能数值求解。这就是闭环的代价。

    URDF describes a tree: every joint has one parent link and one child link, so closed-chain mechanisms (four-bar, Delta, Stewart, a hand plus an object) cannot be expressed directly. The common practice in simulators is to "cut" each loop and add a constraint that closes the gap: in MuJoCo an equality constraint of type connect removes 3 degrees of freedom (closing a ball joint) and weld removes 6, which is the numerical realisation of "every loop eats \(\lambda\) degrees of freedom" above. In both Pinocchio and MuJoCo a floating base is a free joint with a 7-dimensional configuration and a 6-dimensional velocity; URDF uses the floating joint type, and SDF (Gazebo) offers multi-DoF joint types such as ball, universal and screw. Parallel robots reverse the difficulty of serial arms: for a Stewart platform the six leg lengths for a given pose have a closed form (inverse kinematics is easy), whereas the pose from the leg lengths (forward kinematics) is a polynomial system; a general Stewart platform has up to 40 solutions and it is solved numerically. That is the price of closed loops.

    7常见误区Common pitfalls

    误区 1:漏掉地面与被动关节Pitfall 1: forgetting the ground and the passive joints

    \(N\) 里必须算上地面:四连杆是 4 个刚体,不是 3 个。被动关节(没有电机的铰点)和主动关节一样占约束、占自由度,也要进 \(\sum f_i\);它们的运动是机构自己"决定"的,不需要电机,但仍然是活动度的一部分。反过来,连杆两端都是球关节时,杆绕自身轴线的空转也是一个自由度,公式会如实数出来(6-SPS 给 12,Delta 给 9)。数出的 \(m\) 要拿去和"平台真正有几个自由度"、"需要几台电机"分开对照,两者不一定相等。

    \(N\) must include the ground: a four-bar has 4 rigid bodies, not 3. Passive joints (pivots without motors) use up constraints and freedoms just like active ones and belong in \(\sum f_i\); their motion is "decided" by the mechanism and needs no motor, yet it is still part of the mobility. Conversely, when a rod has ball joints at both ends, its spin about its own axis is a degree of freedom, and the formula counts it faithfully (6-SPS gives 12, the Delta gives 9). Compare the counted \(m\) separately with "how many degrees of freedom the platform really has" and "how many motors are needed"; they need not be equal.

    误区 2:把 Grübler 当成定理Pitfall 2: treating Grübler as a theorem

    它只是依赖"约束独立"这一假设的估计,是活动度的下界。Bennett 四杆机构(1903)是 4 个转动关节的空间闭环,公式给 \(6(4-1-4)+4=-2\),它却能运动,活动度为 1,条件是杆长和扭角满足 \(a_{12}=a_{34}\)、\(a_{23}=a_{41}\)、\(\alpha_{12}=\alpha_{34}\)、\(\alpha_{23}=\alpha_{41}\) 并且 \(a_{12}/\sin\alpha_{12}=a_{23}/\sin\alpha_{23}\);Sarrus 机构(6 个转动关节,两条腿)公式为 0,实际为 1,可以让平台沿一条直线平移。这些都是过约束机构:特殊尺寸使一部分约束重复了。它们在工程里真的用,但对加工精度极其敏感:尺寸偏一点(FIG 5 的 \(\varepsilon\)),机构就卡死。

    It is an estimate that rests on the assumption "the constraints are independent", a lower bound for the mobility. The Bennett four-bar (1903) is a spatial loop of 4 revolute joints for which the formula gives \(6(4-1-4)+4=-2\), yet it moves with mobility 1, provided the lengths and twist angles satisfy \(a_{12}=a_{34}\), \(a_{23}=a_{41}\), \(\alpha_{12}=\alpha_{34}\), \(\alpha_{23}=\alpha_{41}\) and \(a_{12}/\sin\alpha_{12}=a_{23}/\sin\alpha_{23}\). The Sarrus linkage (6 revolute joints, two legs) gets 0 from the formula but really has mobility 1, letting the platform translate along a straight line. These are over-constrained mechanisms: special dimensions make some constraints repeat. They are used in real designs, but are extremely sensitive to manufacturing accuracy: a small error in dimensions (the \(\varepsilon\) of FIG 5) and the mechanism jams.

    误区 3:关节数 = 末端自由度Pitfall 3: joints = end-effector freedoms

    六个关节可以只给末端 3 个自由度:六个转轴全部平行时(FIG 4 的预设),末端只能在一个平面内平移并绕垂直轴转动,秩为 3。关节轴重合、共线、平行都会制造这样的"重复"。反过来,SCARA 只用 4 个关节就给出 \((x,y,z,\text{yaw})\) 这 4 个对装配最有用的自由度。7R 臂的末端自由度仍是 6,而不是 7。设计时要数的是末端能向多少个独立方向运动,也就是秩,而不是关节的个数。

    Six joints can give the end effector only 3 freedoms: when all six axes are parallel (the FIG 4 preset), the end effector can only translate within a plane and rotate about the perpendicular axis, rank 3. Coincident, collinear or parallel joint axes all create such "repeats". Conversely, a SCARA uses only 4 joints to give exactly the 4 freedoms \((x,y,z,\text{yaw})\) that matter most for assembly. A 7R arm still gives the end effector 6 freedoms, not 7. What you must count in a design is how many independent directions the end effector can move in, the rank, not the number of joints.

    误区 4:自由度告诉你"有几个",不告诉你"能到哪里"Pitfall 4: DoF tells you "how many", not "how far"

    活动度是一个维数,不是大小和形状。6 自由度臂的可达工作空间(5.10 节用采样画过)仍然受杆长、关节限位和自碰撞限制;一个 6R 臂也不能把手爪放到每一个想要的位姿上,更不能在所有位置上都灵巧。反过来,两个同样是 6 自由度的机器人(串联臂与 Stewart 平台)工作空间的大小、刚度与负载能力可以差几个数量级。同一个位姿对应多少个逆运动学解,也不能从自由度读出来,那要看具体的几何(7.5 节)。

    Mobility is a dimension, not a size or a shape. The reachable workspace of a 6-DoF arm (sampled in Lesson 5.10) is still bounded by link lengths, joint limits and self-collision; a 6R arm cannot put its hand at every desired pose, and certainly cannot be dexterous everywhere. Conversely, two robots that both have 6 DoF (a serial arm and a Stewart platform) can differ by orders of magnitude in workspace size, stiffness and payload. How many inverse-kinematics solutions a pose has cannot be read off the DoF either; that depends on the specific geometry (Lesson 7.5).

    误区 5:奇异位形里的"局部自由度"也会变Pitfall 5: the "local freedom" changes at singular configurations

    机构的活动度 \(m\) 是整体的、通用的数;局部自由度 \(m_{\text{local}}\) 会随位形而变。6R 臂的腕部奇异位形里 \(\operatorname{rank}J_s=5\):此刻有一个方向动不了,而你说"这是 6 自由度臂"仍然是对的。四连杆在折叠位置反过来,瞬时多出一个自由度,控制器不再能确定下一步往哪里走。另外要分清位形坐标的个数与自由度:四元数用 4 个数表示 3 维的转动,关节角相差 \(2\pi\) 是同一个位形,浮动基座是 7 个数 6 个自由度,这些在 7.2 节处理。

    The mobility \(m\) of a mechanism is a global, generic number; the local freedom \(m_{\text{local}}\) changes with the configuration. At the wrist singularity of a 6R arm \(\operatorname{rank}J_s=5\): one direction cannot be moved in right now, and it remains correct to say "this is a 6-DoF arm". A four-bar at its folded position is the opposite: it gains an instantaneous freedom, and the controller can no longer tell which way the next step goes. Also keep the number of configuration coordinates apart from the degrees of freedom: a quaternion uses 4 numbers for a 3-dimensional rotation, joint angles differing by \(2\pi\) are the same configuration, a floating base is 7 numbers for 6 degrees of freedom. Lesson 7.2 deals with these.

    8小练习Check yourself

    1. 一个平面五连杆:地面加 4 个活动杆,由 5 个转动关节首尾相接成环。它的活动度是?1. A planar five-bar: the ground plus 4 moving bars, joined end to end in a loop by 5 revolute joints. Its mobility is
    平面 \(\lambda=3\),\(N=5\)(含地面),\(J=5\),\(\sum f_i=5\):\(m=3(5-1-5)+5=2\)。需要两台电机,末端扫出的是一块面积(FIG 3)。选 A(1)的人把四连杆的结果套了过来;选 C(3)忘了每个环要吃掉 3 个自由度。Planar \(\lambda=3\), \(N=5\) (ground included), \(J=5\), \(\sum f_i=5\): \(m=3(5-1-5)+5=2\). Two motors are needed and the end point sweeps an area (FIG 3). Option A (1) reuses the four-bar result; option C (3) forgets that the loop eats 3 degrees of freedom.
    2. 一台 7R 机械臂要把手爪放到一个给定的 6 维位姿。满足这个位姿的关节位形构成怎样的集合(在非奇异处)?2. A 7R arm must put its hand at a given 6D pose. What kind of set do the joint configurations achieving that pose form (at a non-singular point)?
    \(F:\mathbb R^7\to\SE\) 在秩 6 处,原像的维数是 \(7-6=1\),即一条曲线:保持手爪不动,肘部可以绕圈(人的手臂同理)。选项 B 是 6R 的情形。For \(F:\mathbb R^7\to\SE\) at rank 6 the pre-image has dimension \(7-6=1\): a curve, along which the elbow swings while the hand stays put (as with the human arm). Option B is the 6R case.
    3. 6-SPS Stewart 平台的 Grübler 计数是 12,可是平台只有 6 个自由度。多出的 6 是什么?3. The Grübler count of the 6-SPS Stewart platform is 12, yet the platform has only 6 degrees of freedom. What is the extra 6?
    腿的两端都是球关节时,腿可以绕它两端连线转动,这对平台毫无影响,却是机构的真实活动度:公式没有错,是它数得诚实。电机位置是那 6 个"有用"自由度的一部分(选项 C 把它们数进去了)。换成 UPS,万向节不允许腿空转,\(m=6\)。With ball joints at both ends a leg can spin about the line joining them. That does nothing to the platform yet is real mobility of the mechanism: the formula is not wrong, it counts honestly. The actuator positions are part of the 6 "useful" freedoms (option C counted them). With a U joint (6-UPS) the leg cannot spin and \(m=6\).
    4. Bennett 机构有 4 个转动关节的空间闭环,Grübler 给出 \(-2\),可是它会动。最恰当的解释是?4. The Bennett linkage is a spatial loop of 4 revolute joints. Grübler gives \(-2\), yet it moves. The best explanation is
    公式用的是通用情形下的方程个数,没有看矩阵的实际秩。几何条件特殊时,约束雅可比的秩掉了,活动度 = 变量数 − 秩 就变大。选项 A 不对:这里恰恰是空间机构(平面的例子是 FIG 5 的双平行四边形)。D 描述的是现实中的松动,不是理想机构的性质。The formula uses the number of equations of the generic case without looking at the actual rank. With special geometry the rank of the constraint Jacobian drops and mobility = variables − rank becomes larger. Option A is wrong: this is precisely a spatial mechanism (a planar example is the double parallelogram of FIG 5). D describes real-world slack, not a property of the ideal mechanism.
    5. 四连杆的杆长是:地面 6、曲柄 2、连杆 3、摇杆 4。曲柄能整圈转动吗?5. A four-bar has lengths: ground 6, crank 2, coupler 3, rocker 4. Can the crank turn a full circle?
    Grashof 条件要求 \(s+l\le p+q\)。这里 \(8>7\),是三摇杆。曲柄最短不是充分条件:必须同时满足 Grashof。在 FIG 3 里选"三摇杆"预设,会看到曲柄很快被卡住。The Grashof condition needs \(s+l\le p+q\). Here \(8>7\): a triple rocker. The crank being the shortest bar is not sufficient; Grashof must hold too. Choose the "triple rocker" preset in FIG 3 and the crank jams quickly.

    9延伸阅读Further reading

    • K. Lynch & F. Park, Modern Robotics, Ch. 2 (Configuration Space) — 刚体与机器人的自由度、关节类型、Grübler 公式、完整与非完整约束;本课的记号与之一致degrees of freedom of rigid bodies and robots, joint types, Grübler's formula, holonomic and nonholonomic constraints; the notation of this lesson follows it
    • B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo, Robotics: Modelling, Planning and Control, Ch. 1–2 — 机械结构、关节与自由度、工作空间、运动学冗余mechanical structure, joints and degrees of freedom, workspace, kinematic redundancy
    • R. Murray, Z. Li, S. Sastry, A Mathematical Introduction to Robotic Manipulation, Ch. 3 — 机械臂运动学,包括冗余臂与并联机构(Stewart 平台)的活动度manipulator kinematics, including redundant manipulators and the mobility of parallel mechanisms (the Stewart platform)
    • G. Gogu, "Mobility of mechanisms: a critical review", Mechanism and Machine Theory 40(9), 2005 — 对各种活动度公式及其例外(过约束机构)的综述a survey of mobility formulas and their exceptions (over-constrained mechanisms)
    • R. Clavel, "Delta, a fast robot with parallel geometry", Proc. 18th Int. Symp. on Industrial Robots, Lausanne, 1988 — Delta 机器人的出处the original Delta robot paper
    • D. Stewart, "A platform with six degrees of freedom", Proc. Institution of Mechanical Engineers 180(1), 1965 — Stewart 平台的出处the original Stewart-platform paper
    • C. Gosselin & J. Angeles, "Singularity analysis of closed-loop kinematic chains", IEEE Trans. Robotics and Automation 6(3), 1990 — 闭链的三类奇异位形(FIG 3 的"死点"是其中之一)the three kinds of singularity of closed chains (the "dead centre" of FIG 3 is one of them)
    • R. Norton, Design of Machinery, Ch. 2 — 四连杆、Grashof 条件、传动角与死点的教科书讲法the textbook treatment of the four-bar, the Grashof condition, transmission angle and dead centres

    下一课 7.2 构型空间 会处理"位形坐标的个数 ≠ 自由度";7.3 正运动学 与 7.4 速度运动学 把本课的螺旋轴矩阵变成雅可比;足式与人形的浮动基座见 9.2,灵巧手见 9.3。The next lesson, 7.2 Configuration Space, handles "number of coordinates ≠ degrees of freedom"; 7.3 Forward Kinematics and 7.4 Velocity Kinematics turn this lesson's matrix of screw axes into the Jacobian; floating bases of legged robots and humanoids are in 9.2, dexterous hands in 9.3.