Part II · 第 9 章 机器人形态 · 9.4Part II · Ch. 9 Embodiments · 9.4

执行器与传感器Actuators & Sensors

前面所有章节里的力矩 \(\boldsymbol\tau\) 都是凭空给出的,所有的 \(q,\dot q\) 都是精确读到的。真实的机器人上,每个 \(\tau\) 都要由一台有电压、电流、转速和温度限制的电机加减速器产生,每个 \(q,\dot q\) 都来自一个带量化、噪声、零偏和延迟的传感器。这一节是从数学走向硬件的桥:直流电机的转矩-转速直线、传动比与折算惯量、串联弹性执行器,编码器的量化与差分测速,IMU 的积分漂移与互补滤波,以及延迟如何吃掉相位裕度。仿真到现实的差距,大半就出在这里。 Every torque \(\boldsymbol\tau\) in the earlier chapters appeared out of thin air, and every \(q,\dot q\) was read exactly. On a real robot each \(\tau\) must be produced by a motor and gearbox with voltage, current, speed and temperature limits, and each \(q,\dot q\) comes from a sensor with quantization, noise, bias and delay. This lesson is the bridge from mathematics to hardware: the DC-motor torque-speed line, gear ratios and reflected inertia, series elastic actuators, encoder quantization and finite-difference velocity, IMU drift and the complementary filter, and how latency eats phase margin. Most of the sim-to-real gap lives here.

约 35 分钟~35 min 前置:4.3 方差 · 4.4 高斯 · 4.8 卡尔曼滤波 · 2.5 ODE · 7.6 静力学 · 8.3 质量矩阵Prereqs: 4.3 Variance · 4.4 Gaussian · 4.8 Kalman Filter · 2.5 ODEs · 7.6 Statics · 8.3 Mass Matrix 6 个交互6 interactives

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

    你在仿真里训练好一个腿式机器人的策略,放到真机上,机器人抖、软、慢半拍,甚至把电机烧了。几乎每一次,原因都是仿真里的关节是一个理想的力矩源,而真机的关节不是:

    • 力矩有上限,而且随转速下降。电机转得越快,反电动势越大,能推出的电流越小(FIG 1)。"峰值力矩"只在低速时成立。
    • 电机的力矩不是关节的力矩。减速器把力矩放大 \(N\) 倍,却把转子惯量放大 \(N^2\) 倍,还带来摩擦和效率损失(FIG 2)。8.3 节的质量矩阵 \(M(q)\) 的对角线上要加上这一项。
    • 电机会发热。发热正比于电流的平方,所以"持续力矩"远小于"峰值力矩"。
    • 你读到的 \(q\) 和 \(\dot q\) 是估计,不是真值。编码器有量化,差分测速噪声很大;陀螺仪有零偏,积分后越漂越远(FIG 4、5)。
    • 从传感器到电机有延迟。几毫秒的延迟就能让一个在仿真里很稳的 PD 控制器振荡起来(FIG 6)。

    这一节把这五件事逐个做成可以拖动的小实验。它们是 Part IV(PID/阻抗控制、状态估计、视觉惯性里程计)和 Part VI(仿真到现实:执行器模型与执行器网络)的硬件前提。

    You train a legged-robot policy in simulation, deploy it, and the robot jitters, feels soft, lags a beat behind, or cooks a motor. Almost every time the reason is that the simulated joint is an ideal torque source and the real one is not:

    • Torque is limited, and falls with speed. The faster a motor spins, the larger its back-EMF and the less current the supply can push (FIG 1). "Peak torque" holds only near standstill.
    • Motor torque is not joint torque. A gearbox multiplies torque by \(N\) but rotor inertia by \(N^2\), and adds friction and losses (FIG 2). The mass matrix \(M(q)\) of Lesson 8.3 gets this term added on its diagonal.
    • Motors heat up. Heating goes as current squared, so the "continuous torque" is far below the "peak torque".
    • The \(q\) and \(\dot q\) you read are estimates, not truth. Encoders quantize and differencing them is noisy; gyroscopes have bias and drift without bound when integrated (FIG 4, 5).
    • There is delay from sensor to motor. A few milliseconds can make a PD controller that is rock-steady in simulation start to ring (FIG 6).

    This lesson turns those five facts into small experiments you can drag. They are the hardware premises for Part IV (PID/impedance control, state estimation, visual-inertial odometry) and Part VI (sim-to-real: actuator models and actuator networks).

    2直觉:电机是一个越转越弱的力矩源Intuition: a motor is a torque source that weakens as it spins

    直流电机(无刷电机经磁场定向控制后,等效成同样的模型)只有两条定律。电流产生力矩:\(\tau = k_t\, i\)。转动产生反电动势:绕组在磁场里转,会发出一个方向与供电相反、大小正比于转速的电压 \(k_e\omega\)。电压方程是 \(V = R\,i + k_e\,\omega\),电感的作用很快(毫秒级),先忽略。

    于是电流 \(i = (V - k_e\omega)/R\):转得越快,反电动势抵消的电压越多,剩下的电流越少,力矩也越小。转速为 0 时(堵转)电流最大,力矩 \(\tau_s = k_tV/R\) 最大;转到 \(\omega_0 = V/k_e\)(空载转速)时电流为 0,力矩也为 0。力矩-转速关系是一条直线,两个端点就决定了一切:功率、效率和发热都由它导出。

    下图用一台中型无刷电机(参数是示意性的,量级合理)。青色实线是电机能给出的力矩,紫色线是负载要的力矩(恒定部分模拟重力或库仑摩擦,斜率部分模拟黏性阻力),两线的交点就是稳态工作点。左图看力矩,右图看功率、发热和效率。

    A DC motor (a brushless motor under field-oriented control reduces to the same model) obeys just two laws. Current makes torque: \(\tau = k_t\, i\). Rotation makes back-EMF: the windings moving through the magnetic field generate a voltage opposing the supply and proportional to speed, \(k_e\omega\). The voltage equation is \(V = R\,i + k_e\,\omega\); inductance acts within milliseconds and we ignore it for now.

    So the current is \(i = (V - k_e\omega)/R\): the faster the rotor spins, the more voltage the back-EMF cancels, the less current remains, and the less torque. At zero speed (stall) the current and torque \(\tau_s = k_tV/R\) are largest; at \(\omega_0 = V/k_e\) (the no-load speed) the current and torque vanish. The torque-speed relation is a straight line, and its two end points determine everything: power, efficiency and heating all follow.

    The figure uses a mid-size brushless motor (parameters are illustrative but of a realistic magnitude). The cyan solid line is the torque the motor can give; the purple line is the torque the load demands (a constant part models gravity or Coulomb friction, the sloped part viscous drag); their intersection is the steady operating point. The left plot shows torque; the right one power, heat and efficiency.

    FIG 1一台直流电机的全部A DC motor in one picture
    力矩-转速TORQUE-SPEED
    功率、铜损、效率 vs 转速POWER, COPPER LOSS, EFFICIENCY vs SPEED
    参数:\(k_t=k_e=0.06\) N·m/A,\(R=0.5\ \Omega\),绕组热阻 5 K/W、温升上限 90 K,因此持续电流 \(I_c=\sqrt{90/(5\cdot0.5)}=6\) A,持续力矩 0.36 N·m。左图:虚线是不限流的理想直线,实线是驱动器限流后的实际力矩,绿色底是持续区,琥珀色底是只能短时使用的峰值区。右图:琥珀色是机械功率 \(\tau\omega\),红色是铜损 \(i^2R\),青色虚线是效率(右轴)。热模型是集总一阶:\(\Delta T_{ss}=i^2R\,R_{th}\),热容 40 J/K。 Parameters: \(k_t=k_e=0.06\) N·m/A, \(R=0.5\ \Omega\), winding thermal resistance 5 K/W with a 90 K rise limit, hence continuous current \(I_c=\sqrt{90/(5\cdot0.5)}=6\) A and continuous torque 0.36 N·m. Left: the dashed line is the ideal unlimited line, the solid line is the torque after the driver's current limit, the green band is the continuous zone and the amber band the short-time peak zone. Right: amber is mechanical power \(\tau\omega\), red is copper loss \(i^2R\), the dashed cyan curve is efficiency (right axis). The thermal model is lumped first-order: \(\Delta T_{ss}=i^2R\,R_{th}\), heat capacity 40 J/K.
    试一试Try this
    • 加大负载力矩,直到电机堵转(转速为 0)。读数里的电流是多少?热模型说它多久会烧到温升上限?Raise the load torque until the motor stalls (speed 0). What is the current, and how long until the thermal model says the winding hits its limit?
    • 找到机械功率最大的工作点(达到理论值 \(V^2/4R\) 的 95% 以上)。此时转速是空载转速的多少?效率是多少?Find the operating point of maximum mechanical power (above 95% of the theoretical \(V^2/4R\)). What fraction of the no-load speed is it, and what is the efficiency?
    • 不烧电机地长期工作:让电流低于持续电流 6 A,同时输出机械功率超过 100 W。需要高转速还是大力矩?Run indefinitely without cooking the motor: keep the current below the 6 A continuous limit while delivering over 100 W of mechanical power. Do you need high speed or high torque?
    核心洞见Key insight

    机械功率 \(\tau\omega\) 在半个空载转速处最大,\(P_{\max}=\tau_s\omega_0/4\),而那里的效率恰好只有 50%:一半的电功率变成了铜损发热。高效率只存在于高转速、小力矩的区域。机器人在抬腿起跳时恰恰处在低速大力矩区,所以"峰值力矩"一用就是热。

    Mechanical power \(\tau\omega\) peaks at half the no-load speed, \(P_{\max}=\tau_s\omega_0/4\), and the efficiency there is exactly 50%: half the electrical power becomes copper-loss heat. High efficiency lives only at high speed and low torque. A leg pushing off the ground sits in exactly the opposite corner, low speed and high torque, so using "peak torque" always means heat.

    3动手玩:传动比,力矩的杠杆与惯量的平方Play: gear ratio, a lever for torque and a square for inertia

    电机的力矩太小、转得太快,机器人关节要的是低速大力矩,于是要加减速比为 \(N\) 的减速器。理想的减速器是一根杠杆:关节侧力矩 \(\tau_j = N\eta\,\tau_m\)(\(\eta\) 是效率),关节侧转速 \(\omega_j=\omega_m/N\),功率只损失一个 \(\eta\)。

    代价藏在惯量里。转子的动能是 \(\tfrac12J_m\omega_m^2=\tfrac12(N^2J_m)\,\omega_j^2\),从关节这一侧看,转子的惯量被放大了 \(N^2\) 倍,叫折算惯量(reflected inertia)。给定电机力矩 \(\tau_m\),让一根转动惯量为 \(J_L\) 的连杆(不受其他外力矩)加速,关节角加速度是

    A motor gives too little torque at too high a speed; a robot joint wants low-speed, high torque. So we add a gearbox of ratio \(N\). An ideal gearbox is a lever: the joint torque is \(\tau_j = N\eta\,\tau_m\) (\(\eta\) is the efficiency), the joint speed is \(\omega_j=\omega_m/N\), and power loses only the factor \(\eta\).

    The price hides in inertia. The rotor's kinetic energy is \(\tfrac12J_m\omega_m^2=\tfrac12(N^2J_m)\,\omega_j^2\): from the joint side the rotor looks \(N^2\) times heavier, the reflected inertia. For a given motor torque \(\tau_m\) accelerating a link of inertia \(J_L\) (with no other external torque), the joint acceleration is

    $$ \alpha_j \;=\; \frac{\hl{tj}{N\eta\,\tau_m}}{J_L + \hl{jrefl}{N^2J_m}} \;\;\Longrightarrow\;\; \text{maximal at}\quad \hl{nstar}{N^\star=\sqrt{J_L/J_m}} . $$

    \(N\) 太小,力矩杠杆不够;\(N\) 太大,转子自己的 \(N^2J_m\) 成了负担,加速度反而下降。最佳点上折算的转子惯量刚好等于负载惯量("惯量匹配")。下图左边是 \(\alpha_j\) 随 \(N\) 变化的曲线(双对数),右边是关节侧的力矩-转速包络,也就是 FIG 1 的直线经 \(N\) 变换后的样子。拖动琥珀色的点,设定你的关节需要的力矩和速度。

    With small \(N\) the torque lever is too short; with large \(N\) the rotor's own \(N^2J_m\) becomes the burden and the acceleration falls again. At the optimum the reflected rotor inertia equals the load inertia ("inertia matching"). On the left is \(\alpha_j\) against \(N\) (log-log); on the right the joint-side torque-speed envelope, i.e. the line of FIG 1 transformed by \(N\). Drag the amber dot to set the torque and speed your joint needs.

    FIG 2传动比实验室Gear-ratio lab
    关节角加速度 α vs 传动比 NJOINT ACCELERATION α vs RATIO N
    关节侧力矩-转速包络(双对数)JOINT-SIDE TORQUE-SPEED ENVELOPE (LOG-LOG)
    转子惯量 \(J_m=10^{-4}\) kg·m²,电机同 FIG 1(24 V,峰值电流 30 A,持续电流 6 A),左图用峰值电机力矩 1.8 N·m。虚线是 \(J_L\) 缩小/放大 4 倍时的曲线,圆点是 \(N^\star\):负载越重,最佳传动比越大。右图:青色区域是峰值能力,绿色是持续能力,灰色虚线是 \(N=1\),紫色虚线是电机的功率上限 \(\eta V^2/4R\):改变 \(N\) 只是让包络沿这条功率双曲线滑动,并不增加功率。"足端折算质量"取腿长 0.25 m:\(N^2J_m/\ell^2\)。 Rotor inertia \(J_m=10^{-4}\) kg·m²; the motor is that of FIG 1 (24 V, 30 A peak, 6 A continuous), and the left plot uses the peak motor torque 1.8 N·m. Dashed curves are \(J_L\) divided or multiplied by 4, dots mark \(N^\star\): the heavier the load, the larger the best ratio. Right: the cyan area is the peak capability, green the continuous one, the grey dashed line is \(N=1\), and the purple dashed line is the motor's power cap \(\eta V^2/4R\): changing \(N\) only slides the envelope along this power hyperbola; it never adds power. "Foot-reflected mass" uses a 0.25 m leg: \(N^2J_m/\ell^2\).
    试一试Try this
    • 把 \(N\) 调到最佳传动比 \(N^\star\)(误差 10% 以内)。此时折算的转子惯量和负载惯量之比是多少?再改变 \(J_L\),\(N^\star\) 怎么变?Set \(N\) to the best ratio \(N^\star\) (within 10%). What is the ratio of reflected rotor inertia to load inertia? Now change \(J_L\): how does \(N^\star\) move?
    • 让需求点(至少 50 W)落在绿色持续区内。依次试"准直驱""行星""谐波"三个预设:默认的需求点只有哪一个能持续做到?为什么传动比太小和太大都不行?Put the demand point (at least 50 W) inside the green continuous zone. Try the "QDD", "Planetary" and "Harmonic" presets in turn: which one alone sustains the default demand, and why do both a too-small and a too-large ratio fail?
    核心洞见Key insight

    传动比是在力矩与速度之间做交易,并以 \(N^2\) 的价格出售惯量。腿式机器人偏偏不选最佳的 \(N^\star\),而选很小的 \(N\approx6\text{–}10\)(准直驱,QDD):折算惯量小,关节几乎可以被外力反向驱动(backdrivable),电流直接反映关节力矩(于是 7.6 节的 \(\boldsymbol\tau=J^\top F\) 可以直接用来估计足端力),落地冲击由连杆自己"让"掉,而不是靠齿轮硬扛。加速度峰值不是唯一的指标;足式机器人的整体设计见 9.2。

    A gear ratio trades torque against speed and sells inertia at the price of \(N^2\). Legged robots deliberately do not pick the optimal \(N^\star\); they pick a small \(N\approx6\text{–}10\) (quasi-direct drive, QDD): small reflected inertia, a joint that outside forces can easily backdrive, motor current that directly reflects joint torque (so \(\boldsymbol\tau=J^\top F\) of Lesson 7.6 can estimate foot force straight from current), and landing impacts absorbed by the links yielding rather than by gear teeth. Peak acceleration is not the only metric; the overall design of legged robots is in Lesson 9.2.

    回到 8.3 节的运动方程:把每个电机的转子并进去,有效的质量矩阵是 \(M_{\text{eff}}(q)=M(q)+\operatorname{diag}(N_i^2J_{m,i})\)(忽略转子旋转带来的陀螺耦合)。当 \(N\) 很大时,对角线上的常数项压倒 \(M(q)\) 的位形相关部分,每个关节"看到"的惯量几乎不随姿态变化,关节之间的耦合也变得很弱,这正是工业机械臂可以逐关节独立做 PD 控制的原因;而 QDD 的腿,\(M(q)\) 的位形相关部分和耦合都很显著,需要基于模型的全身控制(Part IV)。

    Back to the equations of motion of Lesson 8.3: fold in each motor's rotor and the effective mass matrix is \(M_{\text{eff}}(q)=M(q)+\operatorname{diag}(N_i^2J_{m,i})\) (ignoring gyroscopic coupling from the spinning rotors). With a large \(N\), the constant diagonal term swamps the configuration-dependent part of \(M(q)\): every joint "sees" nearly the same inertia whatever the posture, and the coupling between joints is weak. That is why industrial arms can run independent joint PD loops. A QDD leg keeps a strongly configuration-dependent \(M(q)\) with significant coupling and calls for model-based whole-body control (Part IV).

    传动TransmissionNη回差Backlash可反向驱动Backdrivable特点Notes
    直驱Direct drive1≈1无none是yes最透明,力矩小而重(大直径力矩电机)Most transparent; low torque for the mass (large-diameter torque motors)
    准直驱 QDD(单级行星)QDD (single-stage planetary)≈ 6–10≈ 0.9小small是yes电流≈力矩,耐冲击;持续力矩受发热限制Current ≈ torque, impact tolerant; continuous torque is thermally limited
    多级行星Multi-stage planetary≈ 20–100≈ 0.7–0.85角分量级arc-minutes费力with effort力矩密度高,摩擦与折算惯量显著High torque density; friction and reflected inertia are significant
    谐波(应变波)Harmonic (strain wave)≈ 30–160≈ 0.6–0.85几乎为零near zero很难hard单级大减速比、体积小;柔性、力矩波动,效率随负载和温度变化Large single-stage ratio, compact; flexible, torque ripple, efficiency varies with load and temperature
    摆线Cycloidal≈ 10–100+≈ 0.8–0.9小small中等moderate抗冲击,刚度高Shock resistant, stiff

    表中数字是常见量级,具体型号差别很大,选型时以数据手册为准。The numbers are typical orders of magnitude; individual parts differ a lot, so use the datasheet when choosing.

    4第二、第三视角:弹簧、编码器与陀螺仪Second and third views: springs, encoders and gyros

    串联弹性执行器:把力矩变成位移Series elastic actuators: turning torque into displacement

    刚性的减速器很难精确控制力:输出端稍有位移,力就变化很大,摩擦和折算惯量又把真实力矩藏了起来。Pratt 和 Williamson(1995)的办法是在电机与负载之间故意串一根弹簧:弹簧的形变正比于力矩,\(\tau_s=k(\theta_m-\theta_l)\),于是"测力"变成了"测角度差",只要两个编码器;力控制问题变成了让电机去追一个弹簧形变。

    代价是带宽。电机转子的惯量与弹簧组成一个二阶系统,固有频率 \(\omega_n=\sqrt{k/J_m}\) 限制了力矩的响应速度;弹簧越软,力矩分辨率越好(同样的编码器分辨率对应更细的力矩 \(k\,\delta\theta\)),耐冲击越强(输出端被撞时,弹簧先吃掉动能,齿轮箱承受的力矩上限是 \(\omega\sqrt{kJ_m}\)),可带宽越低。下图在输出端被锁住(撞墙)或自由两种情形下,用 RK4(2.5 节)仿真对力矩阶跃命令的响应。

    A stiff gearbox is bad at controlling force: a small displacement at the output changes the force a lot, and friction and reflected inertia hide the true torque. Pratt and Williamson (1995) deliberately put a spring in series between motor and load. The spring deflection is proportional to torque, \(\tau_s=k(\theta_m-\theta_l)\), so "measure force" becomes "measure an angle difference" with two encoders, and force control becomes making the motor chase a spring deflection.

    The price is bandwidth. The rotor inertia and the spring form a second-order system whose natural frequency \(\omega_n=\sqrt{k/J_m}\) limits how fast torque can change. A softer spring gives finer torque resolution (the same encoder resolution maps to a finer torque \(k\,\delta\theta\)) and better shock tolerance (when the output is hit the spring absorbs the kinetic energy and the gearbox sees at most \(\omega\sqrt{kJ_m}\)), but lower bandwidth. The figure simulates the response to a torque step command with the output locked (a wall) or free, using RK4 (Lesson 2.5).

    FIG 3串联弹性执行器Series elastic actuator
    机构与弹簧力矩响应MECHANISM AND SPRING-TORQUE RESPONSE
    带宽、冲击力矩、力矩分辨率 vs 刚度 kBANDWIDTH, IMPACT TORQUE, RESOLUTION vs STIFFNESS k
    关节侧等效转子惯量 \(N^2J_m=0.01\) kg·m²(\(N=10\)),电机摩擦 \(b=0.02\) N·m·s/rad,命令是 \(t=0.05\) s 时 0→5 N·m 的阶跃。控制律 \(u=(1+K_p)\tau_{des}-K_p\tau_s-K_d\dot\delta\)(前馈加比例反馈,再对形变速度 \(\dot\delta=\dot\theta_m-\dot\theta_l\) 加阻尼),\(K_d\) 按目标阻尼比 \(\zeta\) 自动整定。"自由"情形负载惯量 0.5 kg·m²,会被拖着转。右图三条线共用纵轴数值:青色为闭环带宽 (Hz),红色为转子 10 rad/s 撞上锁死输出时弹簧承受的力矩 (N·m),琥珀色为 14 位关节编码器对应的力矩分辨率 (N·m);虚线竖线标出刚性齿轮传动的量级。 Joint-side equivalent rotor inertia \(N^2J_m=0.01\) kg·m² (\(N=10\)), motor friction \(b=0.02\) N·m·s/rad, command a 0→5 N·m step at \(t=0.05\) s. Control law \(u=(1+K_p)\tau_{des}-K_p\tau_s-K_d\dot\delta\) (feed-forward plus proportional feedback, plus damping on the deflection rate \(\dot\delta=\dot\theta_m-\dot\theta_l\)), with \(K_d\) tuned automatically for the target damping ratio \(\zeta\). In the "free" case the load has inertia 0.5 kg·m² and is dragged along. The three lines on the right share one numeric axis: cyan is the closed-loop bandwidth (Hz), red the torque the spring must carry when the rotor at 10 rad/s hits a locked output (N·m), amber the torque resolution of a 14-bit joint encoder (N·m); the dashed vertical line marks the order of magnitude of a rigid gear train.
    • 找到最硬的弹簧,使冲击力矩不超过 15 N·m(落在 13–15 N·m 之间)。你买到了多少带宽?力矩分辨率变成多少?Find the stiffest spring whose impact torque stays within 15 N·m (between 13 and 15 N·m). How much bandwidth did you buy, and what is the torque resolution?

    执行器家族The actuator family

    类型Type力矩/力的来源Where force comes from典型特点Typical character代价Cost
    高减速比电动High-ratio electric电机 + 减速器,力矩 ≈ \(N\eta k_ti\)Motor + gearbox, torque ≈ \(N\eta k_ti\)力矩密度高,位置控制精确,工业机械臂的主流High torque density, accurate position control; the industrial-arm mainstream摩擦、回差、折算惯量,力控制需要力矩传感器Friction, backlash, reflected inertia; force control needs a torque sensor
    准直驱 (QDD)Quasi-direct drive低减速比,电流直接估计力矩Low ratio; current estimates torque directly透明、耐冲击、力矩带宽高(电流环 kHz 量级)Transparent, impact tolerant, high torque bandwidth (current loop at kHz scale)发热是瓶颈,需要大电机Heat is the bottleneck; needs a large motor
    串联弹性 (SEA)Series elastic (SEA)弹簧形变 \(k\,\delta\theta\)Spring deflection \(k\,\delta\theta\)力矩测量干净,耐冲击,力矩带宽通常是几十 Hz 的量级Clean torque measurement, shock tolerant; torque bandwidth typically tens of Hz体积、位置带宽受限,需要第二个编码器Bulk, limited position bandwidth, a second encoder
    变刚度 (VSA)Variable stiffness (VSA)弹簧 + 第二个电机改变刚度Spring + a second motor to change its stiffness可调节柔顺性,适合碰撞安全与储能Tunable compliance; useful for collision safety and energy storage机构复杂、质量大,多为研究原型Complex and heavy; mostly research prototypes
    液压Hydraulic油压(约 20 MPa,即 3000 psi 的量级)× 活塞面积Oil pressure (order of 20 MPa ≈ 3000 psi) × piston area功率密度和力密度极高,伺服阀带宽可达几十到上百 HzVery high power and force density; servo-valve bandwidth tens to over 100 Hz泵、油管、泄漏、噪声,效率较低Pump, hoses, leaks, noise; lower efficiency
    气动 / 气动肌肉Pneumatic / air muscle气压(约 0.3–0.8 MPa)Air pressure (about 0.3–0.8 MPa)天然柔顺,质量轻,力/重比高Inherently compliant, light, high force-to-weight空气可压缩,迟滞明显,精度与带宽低(几 Hz 量级)Compressible air, hysteresis, low precision and bandwidth (a few Hz)
    人工肌肉(介电弹性体、HASEL、形状记忆合金、绞合聚合物纤维)Artificial muscles (dielectric elastomer, HASEL, SMA, twisted polymer)静电、热或相变驱动Electrostatic, thermal or phase-change应变大、质量轻,仿生Large strain, light, bio-inspired高压 (kV),或热驱动而缓慢,效率低,大多处于研究阶段kV voltages, or slow thermal drive; low efficiency; mostly at research stage

    编码器:位置被量化,速度被差分放大Encoders: position is quantized, velocity amplifies the error

    关节编码器给出的是角度的整数倍:\(B\) 位编码器把一圈分成 \(2^B\) 份,分辨率 \(\Delta=2\pi/2^B\)。量化误差在 \(\pm\Delta/2\) 内,近似均匀分布,标准差 \(\Delta/\sqrt{12}\)。位置上这很小(12 位约 0.0004 rad),但控制器要的往往是速度,而最朴素的做法是差分:\(\hat\omega_k=(\theta_k-\theta_{k-W})/(W T_s)\)。两个量化误差相减、再除以很小的时间,噪声被放大:速度估计只能取 \(\Delta/(WT_s)\) 的整数倍,低速时就是一排 0 与一个脉冲交替的"锯齿"。

    加大窗口 \(W\) 能降噪声(反比于 \(W\)),代价是延迟 \(WT_s/2\):速度在变化时,估计滞后了。最优的 \(W\) 是噪声误差和滞后误差相等的地方,下图右侧是这条 U 形曲线。

    A joint encoder reports integer multiples of an angle: a \(B\)-bit encoder splits a revolution into \(2^B\) parts, with resolution \(\Delta=2\pi/2^B\). The quantization error lies within \(\pm\Delta/2\), roughly uniform with standard deviation \(\Delta/\sqrt{12}\). In position that is small (about 0.0004 rad for 12 bits), but controllers often want velocity, and the naive route is differencing: \(\hat\omega_k=(\theta_k-\theta_{k-W})/(W T_s)\). Two quantization errors are subtracted and divided by a small time, so the noise is amplified: the velocity estimate can only take multiples of \(\Delta/(WT_s)\), and at low speed it is a "sawtooth" of zeros alternating with pulses.

    A larger window \(W\) reduces noise (inversely with \(W\)) at the price of delay \(WT_s/2\): when the velocity is changing the estimate lags. The best \(W\) is where the noise error equals the lag error; the right plot is that U-shaped curve.

    FIG 4编码器与差分测速Encoder and finite-difference velocity
    量化误差(单位 LSB)与速度估计QUANTIZATION ERROR (LSB) AND VELOCITY ESTIMATE
    速度估计的均方根误差 vs 窗口 W(双对数)VELOCITY RMS ERROR vs WINDOW W (LOG-LOG)
    真实运动:转速 \(v(t)=v_0(1+0.5\sin 4\pi t)\),即平均 \(v_0\)、2 Hz 起伏。上图上半部分是每个采样点的量化误差 \((\theta_q-\theta)/\Delta\),永远在 \(\pm0.5\) 个 LSB 内;下半部分紫色是真实速度,琥珀色阶梯是 \(W\) 点差分的估计。右图:红色是仿真测得的均方根误差,青色虚线是量化噪声模型 \(\Delta/(\sqrt6\,WT_s)\),紫色虚线是滞后模型 \(a_{rms}WT_s/2\),绿色竖线是两者平衡点的预测 \(W^\star\)。 True motion: speed \(v(t)=v_0(1+0.5\sin 4\pi t)\), i.e. mean \(v_0\) with a 2 Hz ripple. The upper strip shows the quantization error \((\theta_q-\theta)/\Delta\) at every sample, always within \(\pm0.5\) LSB; below, purple is the true velocity and the amber staircase the \(W\)-point difference estimate. Right: red is the simulated rms error, the cyan dashed line the quantization-noise model \(\Delta/(\sqrt6\,WT_s)\), the purple dashed line the lag model \(a_{rms}WT_s/2\), and the green vertical line the predicted balance point \(W^\star\).
    • 把 \(W\) 调到误差曲线的最低点附近(与最优值相差不超过 15%)。再把转速 \(v_0\) 降到很低,让估计变成 0 与脉冲交替:最优的 \(W\) 怎么变?Set \(W\) near the bottom of the error curve (within 15% of the best). Then drop the speed \(v_0\) until the estimate turns into zeros and pulses: how does the best \(W\) change?

    IMU:陀螺仪准但会漂,加速度计不漂但有噪声The IMU: a gyro that is precise but drifts, an accelerometer that is noisy but anchored

    惯性测量单元(IMU)里的陀螺仪测角速度 \(\omega_g=\dot\theta+b+n\)(零偏 \(b\),白噪声 \(n\))。积分得到角度,零偏变成线性增长的漂移 \(b\,t\),白噪声变成随机游走,标准差 \(N\sqrt t\)(\(N\) 叫角度随机游走系数,常用 °/√s 或 °/√h;数据手册里的"噪声密度",单位 °/s/√Hz,数值上就是 \(N\))。几十秒之后,漂移大到不能用。

    加速度计在静止或匀速时测到的是重力方向,\(\theta_{acc}=\operatorname{atan2}(a_x,a_z)\):不漂,但噪声大,而且一旦机器人自己有加速度(起步、落地、振动)就被污染。两者的缺陷在频率上是互补的:陀螺仪的高频好、低频差,加速度计的低频好、高频差。于是用一个交叉频率 \(f_c\) 把它们接起来:低通的加速度计 + 高通的积分陀螺仪,叫互补滤波器。图中的真实姿态是 \(15^\circ\sin(2\pi\cdot0.2t)+4^\circ\sin(2\pi\cdot1.1t)\),第 11–12 秒有 0.15 g 的水平加速度干扰。

    The gyroscope in an inertial measurement unit (IMU) measures angular rate, \(\omega_g=\dot\theta+b+n\) (bias \(b\), white noise \(n\)). Integrate to get an angle and the bias becomes a linearly growing drift \(b\,t\), while the white noise becomes a random walk with standard deviation \(N\sqrt t\) (\(N\) is the angle random walk coefficient, usually in °/√s or °/√h; the "noise density" on a datasheet, in °/s/√Hz, is numerically this \(N\)). After tens of seconds the drift is unusable.

    At rest or at constant velocity the accelerometer sees the direction of gravity, \(\theta_{acc}=\operatorname{atan2}(a_x,a_z)\): it never drifts but is noisy, and it is corrupted whenever the robot itself accelerates (start, stop, landing, vibration). The two flaws are complementary in frequency: the gyro is good at high frequency and poor at low, the accelerometer the opposite. So join them at a crossover frequency \(f_c\): a low-passed accelerometer plus a high-passed integrated gyro, the complementary filter. The true attitude in the figure is \(15^\circ\sin(2\pi\cdot0.2t)+4^\circ\sin(2\pi\cdot1.1t)\), with a 0.15 g lateral acceleration disturbance during seconds 11 to 12.

    FIG 5陀螺仪 + 加速度计 → 互补滤波Gyro + accelerometer → complementary filter
    俯仰角 (°) vs 时间 (s)PITCH ANGLE (°) vs TIME (s)
    融合误差均方根 vs 交叉频率 fcFUSED RMS ERROR vs CROSSOVER fc
    采样 100 Hz,随机数由固定种子生成(点"换一组噪声"换种子)。紫色是真实角度,红色是只积分陀螺仪,青色是只用加速度计,琥珀色是互补滤波。默认零偏 0.5 °/s 是出厂校准之后还会剩下的开机零偏的量级;加速度计噪声 0.03 g 包含了振动,远大于电子噪声本身。右图:融合误差随 \(f_c\) 变化,U 形的左边是零偏没被压住,右边是加速度计的噪声和干扰漏了进来。 Sampled at 100 Hz; the random numbers come from a fixed seed (press "New noise" to change it). Purple is the true angle, red the gyro integrated alone, cyan the accelerometer alone, amber the complementary filter. The default bias 0.5 °/s is the order of turn-on bias left after factory calibration; the 0.03 g accelerometer noise includes vibration and is far above the electronic noise floor. Right: the fused error against \(f_c\). On the left of the U the bias is not suppressed; on the right accelerometer noise and disturbance leak in.
    • 找到一个 \(f_c\),使融合误差同时小于"只用陀螺仪"和"只用加速度计",并且第 11–12 秒的加速度干扰造成的最大误差小于 5°。Find an \(f_c\) such that the fused error is below both "gyro only" and "accelerometer only", and the peak error during the acceleration disturbance at seconds 11–12 stays under 5°.
    • 把 \(f_c\) 提到 3 Hz 以上,看干扰期间融合角度被拉偏多少(超过 8°)。滤波器此时几乎"相信"加速度计。Raise \(f_c\) above 3 Hz and see the fused angle get pulled off by more than 8° during the disturbance: the filter now almost "believes" the accelerometer.
    互补滤波是最简单的卡尔曼滤波The complementary filter is the simplest Kalman filter

    固定的 \(f_c\) 等于固定的卡尔曼增益。4.8 节的卡尔曼滤波把状态扩成"角度 + 陀螺零偏",按两个传感器的噪声方差自动算出最优增益,并且把零偏估计出来:稳态零偏误差 \(b\tau\) 会变成 0,不用在"压制漂移"和"抵抗干扰"之间折中。真实机器人的姿态估计(EKF、Mahony/Madgwick 滤波器,三维时作用在 \(\SO\) 上,见 5.2 节与 5.5 节)都是这个想法的推广。

    A fixed \(f_c\) is a fixed Kalman gain. The Kalman filter of Lesson 4.8, with the state extended to "angle + gyro bias", computes the optimal gain from the two sensors' noise variances and estimates the bias itself, so the steady-state bias error \(b\tau\) vanishes and there is no compromise between "suppress drift" and "resist disturbance". Real attitude estimators (EKFs, the Mahony and Madgwick filters, which in 3D act on \(\SO\), see Lessons 5.2 and 5.5) generalize this idea.

    传感器分类A taxonomy of sensors

    按"测的是机器人自己还是外部世界"分为本体感觉(proprioceptive)和外部感觉(exteroceptive)。数字是常见量级,以具体型号为准。

    Sensors split by whether they measure the robot itself or the world: proprioceptive and exteroceptive. Numbers are common orders of magnitude; consult the actual part.

    传感器Sensor测什么Measures典型速率 / 量级Typical rate / scale主要误差Main errors
    关节编码器(光电 / 磁)Joint encoder (optical / magnetic)\(q\)随控制环读取(kHz);12–20 位 / 圈Read at the control rate (kHz); 12–20 bits per turn量化、非线性、读取延迟Quantization, nonlinearity, read latency
    电机电流Motor current\(\tau\approx N\eta k_ti\)电流环 10 kHz 量级Current loop at the 10 kHz scale摩擦、效率 \(\eta\)、\(k_t\) 随温度漂移Friction, efficiency \(\eta\), \(k_t\) drift with temperature
    关节力矩传感器 / SEA 弹簧Joint torque sensor / SEA spring\(\tau\)约 1 kHzabout 1 kHz温漂、交叉耦合、过载Thermal drift, cross-talk, overload
    IMU\(\omega,\ a\)100 Hz 到 1 kHz 以上;MEMS 陀螺噪声密度约 0.005–0.02 °/s/√Hz100 Hz to over 1 kHz; MEMS gyro noise density about 0.005–0.02 °/s/√Hz零偏、温漂、振动Bias, thermal drift, vibration
    六维力/力矩传感器6-axis force/torque sensorwrench \(F\)约 1 kHzabout 1 kHz温漂、重力补偿、零点Thermal drift, gravity compensation, zero offset
    触觉(阵列、视触觉)Tactile (arrays, vision-based)接触位置、压力、形变Contact location, pressure, deformation10–100 Hz 量级10–100 Hz scale迟滞、标定、耐久Hysteresis, calibration, durability
    相机 / 立体 / 深度相机Camera / stereo / depth camera图像、深度Images, depth30–120 Hz;立体深度误差随距离平方增长30–120 Hz; stereo depth error grows with the square of range曝光、运动模糊、同步、反光Exposure, motion blur, synchronization, reflections
    LiDAR三维点云3D point cloud机械旋转式 10–20 Hz;量程百米以上,测距误差厘米级Spinning types 10–20 Hz; range beyond 100 m, centimetre-level ranging error运动畸变、雨雾、镜面Motion distortion, rain and fog, mirrors
    动作捕捉Motion capture外部标定的位姿Externally calibrated pose百 Hz 量级,亚毫米精度(实验室)100s of Hz, sub-millimetre accuracy (in the lab)遮挡、标记点脱落、无法出实验室Occlusion, lost markers, confined to the lab

    5再看数学The math

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

    直流电机方程The DC-motor equations

    电与机械两个方程,通过 \(k_t\) 与 \(k_e\) 耦合:

    One electrical and one mechanical equation, coupled by \(k_t\) and \(k_e\):

    $$ V = R\,i + L\,\frac{di}{dt} + k_e\,\omega,\qquad \tau = k_t\,i,\qquad J_m\dot\omega = \tau - \tau_L . $$

    在国际单位制里 \(k_t\)(N·m/A)与 \(k_e\)(V·s/rad)数值相同:反电动势功率 \(k_e\omega\, i\) 就是机械功率 \(\tau\omega = k_t i\,\omega\),能量守恒要求 \(k_e=k_t\)。稳态时(\(di/dt=0\))得到力矩-转速直线,两个端点和最大功率是

    In SI units \(k_t\) (N·m/A) and \(k_e\) (V·s/rad) are numerically equal: the back-EMF power \(k_e\omega\, i\) is the mechanical power \(\tau\omega = k_t i\,\omega\), and energy conservation demands \(k_e=k_t\). At steady state (\(di/dt=0\)) we get the torque-speed line, its two end points, and the maximum power:

    $$ \tau(\omega) = \frac{k_t}{R}\big(V - k_e\omega\big),\qquad \hl{stall}{\tau_s = \frac{k_tV}{R}},\qquad \hl{noload}{\omega_0 = \frac{V}{k_e}},\qquad \hl{pmax}{P_{\max} = \max_\omega \tau\omega = \frac{\tau_s\omega_0}{4} = \frac{V^2}{4R}}\ \ \text{at}\ \ \omega=\tfrac{\omega_0}{2}. $$

    推导:\(P(\omega)=\tau_s\,\omega\,(1-\omega/\omega_0)\) 是开口向下的抛物线,在 \(\omega_0/2\) 处取最大值 \(\tau_s\omega_0/4\)。数值检查(FIG 1 的参数):\(\tau_s=0.06\cdot24/0.5=2.88\) N·m,\(\omega_0=24/0.06=400\) rad/s,\(P_{\max}=2.88\cdot400/4=288\) W \(=24^2/(4\cdot0.5)\)。铜损与效率:

    Derivation: \(P(\omega)=\tau_s\,\omega\,(1-\omega/\omega_0)\) is a downward parabola, maximal at \(\omega_0/2\) with value \(\tau_s\omega_0/4\). Numerical check (FIG 1 parameters): \(\tau_s=0.06\cdot24/0.5=2.88\) N·m, \(\omega_0=24/0.06=400\) rad/s, \(P_{\max}=2.88\cdot400/4=288\) W \(=24^2/(4\cdot0.5)\). Copper loss and efficiency:

    $$ P_{cu} = i^2R = \frac{\tau^2}{K_m^2},\quad K_m=\frac{k_t}{\sqrt R};\qquad \eta = \frac{\tau\omega}{\tau\omega + i^2R} = \frac{\omega}{\omega_0}\ \ (\text{voltage-limited}),\qquad T_{mech}=\frac{R J_m}{k_tk_e}. $$

    \(K_m\)(N·m/√W)是电机的"品质因数":要的力矩一定,发热就是 \(\tau^2/K_m^2\),与绕组怎么绕(匝数换 \(k_t\) 与 \(R\))无关。力矩加倍,发热变 4 倍,所以持续力矩由 \(I_c=\sqrt{\Delta T_{\max}/(R\,R_{th})}\) 决定,远低于峰值。\(T_{mech}\) 是机电时间常数:给电机一个电压阶跃,转速以此为时间常数指数趋近 \(\omega_0\)(FIG 1 的电机约 14 ms)。驱动器限流时,等效电压被降低,效率不再是 \(\omega/\omega_0\) 而是用 \(\tau\omega/(\tau\omega+i^2R)\) 计算,图中的曲线用的就是这个。无刷电机在磁场定向控制(FOC)下,把三相电流变换到转子的 d-q 坐标,力矩只由 q 轴电流决定,上面的公式照用,只要用等效的 \(k_t\)、\(R\)。

    The motor constant \(K_m\) (N·m/√W) is a figure of merit: for a required torque the heat is \(\tau^2/K_m^2\), regardless of how the winding is made (turns trade \(k_t\) against \(R\)). Doubling torque quadruples heat, so the continuous torque is set by \(I_c=\sqrt{\Delta T_{\max}/(R\,R_{th})}\), far below the peak. \(T_{mech}\) is the electromechanical time constant: after a voltage step the speed approaches \(\omega_0\) exponentially with this time constant (about 14 ms for the FIG 1 motor). When the driver limits current the effective voltage is reduced and the efficiency is no longer \(\omega/\omega_0\) but \(\tau\omega/(\tau\omega+i^2R)\), which is what the plot uses. For a brushless motor under field-oriented control (FOC), the three phase currents are transformed into the rotor's d-q frame and torque depends only on the q-axis current; the formulas above apply with the equivalent \(k_t\) and \(R\).

    传动比、折算惯量与最佳 \(N\)Gear ratio, reflected inertia and the best \(N\)

    理想减速器的约束 \(\theta_m=N\theta_j\)。功率守恒(含效率)给出 \(\tau_j\omega_j=\eta\,\tau_m\omega_m\),即 \(\tau_j=N\eta\tau_m\)。把转子的动能折算到关节一侧,得到关节侧的运动方程(转子与齿轮的惯量并入 \(J_m\)):

    The ideal gearbox constraint is \(\theta_m=N\theta_j\). Power conservation with efficiency gives \(\tau_j\omega_j=\eta\,\tau_m\omega_m\), i.e. \(\tau_j=N\eta\tau_m\). Referring the rotor's kinetic energy to the joint side gives the joint-side equation of motion (rotor and gear inertia lumped into \(J_m\)):

    $$ \big(J_L + N^2J_m\big)\,\dot\omega_j \;=\; N\eta\,\tau_m - \tau_{ext},\qquad \alpha_j(N)=\frac{N\eta\tau_m}{J_L+N^2J_m},\qquad \frac{d\alpha_j}{dN}=0\ \Rightarrow\ N^\star=\sqrt{\frac{J_L}{J_m}},\quad \alpha_j^\star=\frac{\eta\,\tau_m}{2\sqrt{J_LJ_m}} . $$

    推导:\(\frac{d}{dN}\frac{N}{J_L+N^2J_m}=\frac{J_L-N^2J_m}{(J_L+N^2J_m)^2}\),分子为零即 \(N^2=J_L/J_m\),此时 \(N^2J_m=J_L\)。数值检查:\(J_L=0.03,\ J_m=10^{-4}\) 得 \(N^\star=17.3\),\(\alpha^\star=0.9\cdot1.8/(2\sqrt{0.03\cdot10^{-4}})=467\) rad/s²,在 node 里对 \(N\) 做网格搜索得到同样的峰值。前提要写清楚:负载只有惯性(无重力、无摩擦),电机力矩与效率不随 \(N\) 变化;如果还要抵抗重力力矩 \(\tau_g\),需要 \(N\eta\tau_m\ge\tau_g\),如果关节要转得快,还需要 \(N\le\omega_0/\omega_{j,\max}\)。在 8.3 节的符号下,所有关节合起来是 \(M_{\text{eff}}(q)=M(q)+\operatorname{diag}(N_i^2J_{m,i})\)。折算也适用于摩擦:电机侧的库仑摩擦 \(\tau_f\) 在关节侧是 \(N\tau_f\),它正是不能反向驱动的原因。

    Derivation: \(\frac{d}{dN}\frac{N}{J_L+N^2J_m}=\frac{J_L-N^2J_m}{(J_L+N^2J_m)^2}\); the numerator vanishes at \(N^2=J_L/J_m\), where \(N^2J_m=J_L\). Numerical check: \(J_L=0.03,\ J_m=10^{-4}\) gives \(N^\star=17.3\) and \(\alpha^\star=0.9\cdot1.8/(2\sqrt{0.03\cdot10^{-4}})=467\) rad/s²; a grid search over \(N\) in node finds the same peak. State the assumptions: the load is purely inertial (no gravity, no friction) and motor torque and efficiency do not depend on \(N\). If gravity torque \(\tau_g\) must also be resisted you need \(N\eta\tau_m\ge\tau_g\), and if the joint must turn fast you also need \(N\le\omega_0/\omega_{j,\max}\). In the notation of Lesson 8.3 all joints together give \(M_{\text{eff}}(q)=M(q)+\operatorname{diag}(N_i^2J_{m,i})\). Reflection applies to friction too: Coulomb friction \(\tau_f\) on the motor side is \(N\tau_f\) at the joint, which is why a high-ratio joint cannot be backdriven.

    串联弹性执行器的传递函数The SEA transfer function

    令 \(\delta=\theta_m-\theta_l\)。运动方程:

    Let \(\delta=\theta_m-\theta_l\). The equations of motion:

    $$ J_m\ddot\theta_m = u - k\,\delta - b\dot\theta_m,\qquad J_L\ddot\theta_l = k\,\delta - \tau_{ext},\qquad \tau_s = k\,\delta . $$

    输出锁死(\(\theta_l=0\))时,开环 \(\tau_s/u=k/(J_ms^2+bs+k)\),固有频率 \(\omega_n=\sqrt{k/J_m}\)。取控制律 \(u=(1+K_p)\tau_{des}-K_p\tau_s-K_d\dot\delta\),闭环为

    With the output locked (\(\theta_l=0\)) the open loop is \(\tau_s/u=k/(J_ms^2+bs+k)\) with natural frequency \(\omega_n=\sqrt{k/J_m}\). With the control law \(u=(1+K_p)\tau_{des}-K_p\tau_s-K_d\dot\delta\) the closed loop is

    $$ \frac{\tau_s(s)}{\tau_{des}(s)}=\frac{\omega_c^2}{s^2+2\zeta\omega_c s+\omega_c^2},\quad \omega_c^2=\frac{k(1+K_p)}{J_m},\quad 2\zeta\omega_c=\frac{b+K_d}{J_m},\quad \omega_{bw}=\omega_c\sqrt{1-2\zeta^2+\sqrt{(1-2\zeta^2)^2+1}} . $$

    直流增益为 1(前馈项保证了稳态无偏差)。\(\zeta=0.7\) 时 \(\omega_{bw}\approx1.01\,\omega_c\),我们用 node 对 \(k=100\)、\(K_p=2\) 的仿真验证过:\(|H(j\omega_{bw})|=0.707\),超调 4.6%,与二阶系统的 \(e^{-\pi\zeta/\sqrt{1-\zeta^2}}=4.6\%\) 一致。带宽 \(\propto\sqrt k\)。力矩分辨率:编码器分辨率 \(\Delta_\theta=2\pi/2^B\),对应 \(\delta\tau=k\,\Delta_\theta\propto k\)。冲击:转子以关节侧速度 \(\omega\) 撞上锁死的输出,能量 \(\tfrac12J_m\omega^2=\tfrac12\tau_{imp}^2/k\),所以 \(\tau_{imp}=\omega\sqrt{kJ_m}\propto\sqrt k\)。带宽、冲击与分辨率都随 \(k\) 变,没有免费的午餐。

    The DC gain is 1 (the feed-forward term removes the steady-state error). For \(\zeta=0.7\), \(\omega_{bw}\approx1.01\,\omega_c\); we verified in node for \(k=100\), \(K_p=2\) that \(|H(j\omega_{bw})|=0.707\) and the overshoot is 4.6%, matching the second-order value \(e^{-\pi\zeta/\sqrt{1-\zeta^2}}=4.6\%\). Bandwidth scales as \(\sqrt k\). Torque resolution: an encoder with resolution \(\Delta_\theta=2\pi/2^B\) resolves \(\delta\tau=k\,\Delta_\theta\propto k\). Impact: the rotor hits a locked output at joint-side speed \(\omega\); energy gives \(\tfrac12J_m\omega^2=\tfrac12\tau_{imp}^2/k\), so \(\tau_{imp}=\omega\sqrt{kJ_m}\propto\sqrt k\). Bandwidth, impact and resolution all move with \(k\); there is no free lunch.

    编码器:量化噪声与差分Encoders: quantization noise and differencing

    量化误差 \(e\sim U(-\Delta/2,\Delta/2)\),\(\operatorname{Var}(e)=\Delta^2/12\)(4.3 节:均匀分布的方差 \((b-a)^2/12\))。\(W\) 点差分 \(\hat\omega=(\theta_q[k]-\theta_q[k-W])/(WT_s)\) 含两个独立的量化误差,方差 \(2\Delta^2/12=\Delta^2/6\)。再有加速度 \(a\) 时的滞后(估计的是窗口中点的速度):

    The quantization error is \(e\sim U(-\Delta/2,\Delta/2)\), \(\operatorname{Var}(e)=\Delta^2/12\) (Lesson 4.3: the variance of a uniform distribution is \((b-a)^2/12\)). The \(W\)-point difference \(\hat\omega=(\theta_q[k]-\theta_q[k-W])/(WT_s)\) contains two independent quantization errors, variance \(2\Delta^2/12=\Delta^2/6\). Add the lag when the acceleration is \(a\) (the estimate is the velocity at the middle of the window):

    $$ q=\frac{\Delta}{WT_s},\qquad \sigma_{\text{noise}}=\frac{q}{\sqrt6},\qquad e_{\text{lag}}\approx a\,\frac{WT_s}{2},\qquad W^\star=\Big(\tfrac23\Big)^{1/4}\sqrt{\frac{\Delta}{a_{rms}T_s^2}} . $$

    \(W^\star\) 来自最小化 \(\Delta^2/(6W^2T_s^2)+a^2W^2T_s^2/4\)。FIG 4 的默认参数(12 位,1 kHz,\(v_0=3\) rad/s,\(a_{rms}=4.44\,v_0\))预测 \(W^\star\approx9.7\),仿真测得的最低点在 \(W=10\)。注意 \(q/\sqrt6\) 是对所有速度取平均的结果:真实速度恰在两个量化台阶之间的某处时,估计在相邻两个值之间跳,均方根是 \(q\sqrt{p(1-p)}\),\(p\) 是小数部分;对 \(p\) 均匀分布平均得 \(q/\sqrt6\)(我们用 node 对近千个恒定速度验证为 \(0.419\,q\),理论 \(0.408\,q\))。

    \(W^\star\) comes from minimizing \(\Delta^2/(6W^2T_s^2)+a^2W^2T_s^2/4\). The FIG 4 defaults (12 bits, 1 kHz, \(v_0=3\) rad/s, \(a_{rms}=4.44\,v_0\)) predict \(W^\star\approx9.7\); the simulated minimum sits at \(W=10\). Note that \(q/\sqrt6\) is an average over speeds: when the true speed falls somewhere between two quantization steps, the estimate flips between the neighbours and its rms is \(q\sqrt{p(1-p)}\) with \(p\) the fractional part; averaging over a uniform \(p\) gives \(q/\sqrt6\) (checked in node over almost a thousand constant speeds: \(0.419\,q\) against theory \(0.408\,q\)).

    陀螺积分与互补滤波Gyro integration and the complementary filter

    陀螺读数 \(\omega_g=\dot\theta+b+n\),\(\mathbb E[n(t)n(t')]=N^2\delta(t-t')\)(白噪声,4.4 节)。积分后

    The gyro reads \(\omega_g=\dot\theta+b+n\) with \(\mathbb E[n(t)n(t')]=N^2\delta(t-t')\) (white noise, Lesson 4.4). Integrating,

    $$ \theta_g(t)-\theta(t) = b\,t + N\,B(t),\qquad \operatorname{std}=N\sqrt t\ \ (B\ \text{a Wiener process}),\qquad \text{bias dominates once}\ t>(N/b)^2 . $$

    互补滤波器的连续形式与离散形式(\(\tau=1/(2\pi f_c)\),\(\alpha=\tau/(\tau+T_s)\)):

    The complementary filter in continuous and discrete form (\(\tau=1/(2\pi f_c)\), \(\alpha=\tau/(\tau+T_s)\)):

    $$ \hat\theta=\underbrace{\frac{1}{\tau s+1}}_{G_{lp}}\theta_{acc}+\underbrace{\frac{\tau s}{\tau s+1}}_{G_{hp}}\frac{\omega_g}{s},\quad G_{lp}+G_{hp}=1;\qquad \hat\theta_k=\alpha\big(\hat\theta_{k-1}+\omega_{g,k}T_s\big)+(1-\alpha)\,\theta_{acc,k} . $$

    因为 \(G_{lp}+G_{hp}=1\),真实的姿态信号无失真地通过(精确传感器下没有滞后);只有传感器的缺陷被各自的滤波器处理。零偏造成稳态误差:令 \(e=\hat\theta-\theta\),得 \(\dot e=b-e/\tau\),所以 \(e_{ss}=b\,\tau\)(\(b=0.5^\circ\)/s、\(f_c=0.1\) Hz 时 0.80°,仿真 0.794°)。加速度计的白噪声 \(\sigma_a\) 经低通后方差为 \(\sigma_a^2(1-\alpha)/(1+\alpha)\approx\sigma_a^2T_s/(2\tau)\)。减小 \(f_c\) 压低噪声与干扰,增大 \(f_c\) 压低零偏误差,U 形曲线的最低点是折中。

    Since \(G_{lp}+G_{hp}=1\) the true attitude signal passes undistorted (no lag with perfect sensors); only the sensors' flaws are handled, each by its own filter. Bias causes a steady-state error: with \(e=\hat\theta-\theta\), \(\dot e=b-e/\tau\), so \(e_{ss}=b\,\tau\) (0.80° for \(b=0.5^\circ\)/s and \(f_c=0.1\) Hz; the simulation gives 0.794°). White accelerometer noise \(\sigma_a\) leaves the low-pass with variance \(\sigma_a^2(1-\alpha)/(1+\alpha)\approx\sigma_a^2T_s/(2\tau)\). Lowering \(f_c\) suppresses noise and disturbance, raising it suppresses the bias error, and the bottom of the U is the compromise.

    延迟与相位裕度Delay and phase margin

    单关节惯量 \(J\) 由 PD 控制 \(u=K_p(q_d-q)-K_d\dot q\),总回路延迟 \(T_d\)(传感器滤波 + 计算 + 通信 + 放大器 + 零阶保持的半个采样周期),开环传递函数是

    A single joint with inertia \(J\) under PD control \(u=K_p(q_d-q)-K_d\dot q\) and a total loop delay \(T_d\) (sensor filtering + computation + communication + amplifier + half a sample period for the zero-order hold) has open-loop transfer function

    $$ L(s)=\frac{(K_p+K_ds)\,e^{-sT_d}}{Js^2},\quad \omega_c^2=\frac{K_d^2+\sqrt{K_d^4+4J^2K_p^2}}{2J^2},\quad \mathrm{PM}=\arctan\frac{K_d\omega_c}{K_p}-\omega_cT_d,\quad T_{d,\max}=\frac{\arctan(K_d\omega_c/K_p)}{\omega_c} . $$

    \(\omega_c\) 来自 \(|L(j\omega_c)|=1\),即 \(J^2\omega^4-K_d^2\omega^2-K_p^2=0\)。延迟不改变幅值,只让相位线性下降 \(\omega T_d\)。取 \(\zeta=0.7\)(\(K_p=J\omega_n^2\),\(K_d=2\zeta\omega_nJ\)):\(\omega_c=1.54\,\omega_n\),无延迟的 \(\mathrm{PM}=65^\circ\),延迟裕度 \(T_{d,\max}\approx0.74/\omega_n\)。\(\omega_n=40\) rad/s 时是 18.4 ms,FIG 6 的仿真验证了:延迟取裕度的 0.8 倍衰减、1.2 倍发散。经验:回路延迟乘以截止频率,\(\omega_cT_d\),要远小于 0.5 rad,才能留下像样的裕度。

    \(\omega_c\) follows from \(|L(j\omega_c)|=1\), i.e. \(J^2\omega^4-K_d^2\omega^2-K_p^2=0\). Delay does not change the magnitude; it just subtracts \(\omega T_d\) of phase linearly. With \(\zeta=0.7\) (\(K_p=J\omega_n^2\), \(K_d=2\zeta\omega_nJ\)): \(\omega_c=1.54\,\omega_n\), the delay-free \(\mathrm{PM}=65^\circ\) and the delay margin \(T_{d,\max}\approx0.74/\omega_n\). For \(\omega_n=40\) rad/s that is 18.4 ms; the FIG 6 simulation confirms it: with delay at 0.8 times the margin the response decays, at 1.2 times it diverges. Rule of thumb: the loop delay times the crossover frequency, \(\omega_cT_d\), must stay well below 0.5 rad to leave a decent margin.

    6机器人中的它:真实的关节是一个有延迟、会饱和的闭环In robotics: a real joint is a delayed, saturating loop

    把前面几块拼起来,一个真实关节的力矩链条是:传感器 → 滤波 → 控制器 → 通信 → 放大器与电流环 → 电机 → 减速器 → 连杆。每一段都有延迟,最后一段还有 FIG 1 的力矩-转速限制。下图让一根惯量 \(J=0.05\) kg·m² 的连杆做 PD 位置阶跃(0.5 rad):滑块改变回路延迟和控制带宽 \(\omega_n\),开关可选"理想力矩源"或"饱和在 12 N·m"。下半部分是相位裕度随延迟的变化。三个预设对应三种典型的软硬件栈,延迟的构成(毫秒)是示意性的量级。

    Assemble the pieces and the torque chain of a real joint is: sensor → filter → controller → communication → amplifier and current loop → motor → gearbox → link. Every stage adds delay, and the last has the torque-speed limit of FIG 1. The figure drives a link of inertia \(J=0.05\) kg·m² through a PD position step (0.5 rad): the sliders change the loop delay and the control bandwidth \(\omega_n\), and the switch picks an "ideal torque source" or one "saturating at 12 N·m". The lower plot shows phase margin against delay. The three presets correspond to three typical hardware-software stacks; the stage-by-stage delays (milliseconds) are illustrative orders of magnitude.

    FIG 6延迟预算与相位裕度Latency budget and phase margin
    阶跃响应 q(t) 与相位裕度 PM(Td)STEP RESPONSE q(t) AND PM(Td)
    控制器 \(K_p=J\omega_n^2\),\(K_d=2\cdot0.7\,\omega_nJ\)。延迟用环形缓冲区实现(步长 0.2 ms,半隐式欧拉)。上图:琥珀色是带延迟的响应,灰色细线是无延迟的响应,紫色虚线是目标。下图:\(\mathrm{PM}(T_d)=\mathrm{PM}_0-\omega_cT_d\) 是一条直线,与零线的交点就是延迟裕度;红色区域是不稳定的延迟。饱和之后,线性分析不再严格成立:延迟超过裕度时系统不会发散到无穷,而是被力矩限制"夹"成一个极限环。 Controller \(K_p=J\omega_n^2\), \(K_d=2\cdot0.7\,\omega_nJ\). Delay is a ring buffer (0.2 ms step, semi-implicit Euler). Top: amber is the delayed response, the thin grey line the delay-free one, the purple dashed line the target. Bottom: \(\mathrm{PM}(T_d)=\mathrm{PM}_0-\omega_cT_d\) is a straight line whose zero crossing is the delay margin; the red zone marks unstable delays. With saturation the linear analysis no longer holds strictly: beyond the margin the response does not diverge to infinity but is clamped by the torque limit into a limit cycle.
    • 把延迟拉过延迟裕度,让回路失稳(或进入极限环)。裕度是多少毫秒?它是否等于 \(0.74/\omega_n\)?Push the delay past the delay margin so the loop goes unstable (or into a limit cycle). How many milliseconds is the margin, and does it equal \(0.74/\omega_n\)?
    • 保持 10 ms 以上的延迟,通过降低带宽 \(\omega_n\) 把相位裕度恢复到 40° 以上。这就是"为什么真机的增益比仿真里调得低"。Keep the delay at 10 ms or more and lower the bandwidth \(\omega_n\) to bring the phase margin back above 40°. This is "why gains on hardware end up lower than the ones tuned in simulation".

    最简单的执行器模型就是把仿真器给出的 PD 力矩按直流电机特性裁剪:\(\tau=\operatorname{clip}\big(\tau_{des},\,\pm\tau_{\max}(\omega)\big)\),\(\tau_{\max}(\omega)=\min\big(\tau_{pk},\ \tau_s(1-|\omega|/\omega_0)\big)\),再加一个延迟缓冲区。Isaac Lab 等仿真框架里的直流电机执行器模型做的就是这件事。更精确的办法是 Hwangbo 等(2019)的执行器网络:在真机(ANYmal,串联弹性执行器)上记录"位置误差、速度的短历史 → 实际力矩",训练一个小网络代替解析模型,放进仿真后策略几乎无需调整就能迁移。

    The simplest actuator model clips the PD torque from the simulator by the DC-motor characteristic, \(\tau=\operatorname{clip}\big(\tau_{des},\,\pm\tau_{\max}(\omega)\big)\) with \(\tau_{\max}(\omega)=\min\big(\tau_{pk},\ \tau_s(1-|\omega|/\omega_0)\big)\), and adds a delay buffer. The DC-motor actuator models in simulation frameworks such as Isaac Lab do exactly that. A more accurate route is the actuator network of Hwangbo et al. (2019): record on the real robot (ANYmal, with series elastic actuators) "short history of position error and velocity → actual torque", train a small network to replace the analytic model, and put it in the simulator; the trained policy then transfers with almost no tuning.

    真实系统里In real systems

    关节力矩传感:Franka Emika Panda 和 KUKA LBR iiwa 在每个关节里装了力矩传感器,控制环 1 kHz,因此能做阻抗控制和碰撞检测;UR 系列主要从电机电流估计关节力矩,e 系列在法兰处另有一个六维力/力矩传感器。腿式机器人:MIT Cheetah / Mini Cheetah 把低减速比(Mini Cheetah 为 6:1 行星减速)与大尺寸无刷电机结合,称为"本体感觉执行器":靠电流估计足端力,靠小折算惯量承受落地冲击(Seok et al. 2013;Wensing et al. 2017;Katz et al. 2019);Unitree 的四足与人形关节采用同一思路,减速比约 6–10;ANYmal 用串联弹性执行器(ANYdrive);较早的 Atlas 用液压。伺服与驱动器:Dynamixel 一类的智能舵机把编码器、减速器、驱动和位置环封装在一起,可选位置、速度或电流(力矩)模式;无刷电机的驱动器(ODrive、VESC、moteus 等)用 FOC,电流环在 10 kHz 量级。总线与实时:EtherCAT 把多关节的控制环固定在 1 kHz 左右并保证抖动在微秒量级;CAN 与 USB 串口抖动较大。外部传感:RealSense、ZED 提供 30–90 Hz 的立体/深度图像;动作捕捉(Vicon、OptiTrack)提供实验室里的"真值",用于标定和评估。IMU 与相机的融合(视觉惯性里程计)见 Part IV。

    Joint torque sensing: the Franka Emika Panda and the KUKA LBR iiwa carry torque sensors in every joint and run a 1 kHz control loop, enabling impedance control and collision detection; Universal Robots arms mainly estimate joint torque from motor current, and the e-Series adds a six-axis force/torque sensor at the flange. Legged robots: the MIT Cheetah and Mini Cheetah combine a low gear ratio (6:1 planetary on the Mini Cheetah) with large brushless motors, called "proprioceptive actuators": foot force from current, impact tolerance from small reflected inertia (Seok et al. 2013; Wensing et al. 2017; Katz et al. 2019). Unitree's quadruped and humanoid joints follow the same idea with ratios around 6–10; ANYmal uses series elastic actuators (ANYdrive); the older Atlas was hydraulic. Servos and drivers: smart servos such as Dynamixel package the encoder, gearbox, driver and position loop, with position, velocity or current (torque) modes; brushless drivers (ODrive, VESC, moteus and others) run FOC with current loops at the 10 kHz scale. Buses and real time: EtherCAT pins multi-joint control loops at about 1 kHz with microsecond-scale jitter, while CAN and USB-serial jitter more. Exteroception: RealSense and ZED deliver 30–90 Hz stereo/depth images; motion capture (Vicon, OptiTrack) provides lab "ground truth" for calibration and evaluation. Fusing an IMU with cameras (visual-inertial odometry) is in Part IV.

    7常见误区Common pitfalls

    误区 1:把电机力矩当成关节力矩Pitfall 1: confusing motor torque with joint torque

    关节力矩是 \(N\eta\,\tau_m\) 再减去摩擦(电机侧的摩擦在关节侧被放大 \(N\) 倍),要加速关节还要同时推动 \(N^2J_m\) 的转子惯量。用电流估计关节力矩在 QDD 上很好(\(N\) 小、\(\eta\) 高),在 100:1 的谐波减速器上,效率随负载、温度和方向变化 10–30 个百分点,电流估计出来的力矩可能偏差很大,这时才需要真正的力矩传感器。

    Joint torque is \(N\eta\,\tau_m\) minus friction (friction on the motor side is multiplied by \(N\) at the joint), and accelerating the joint also means pushing the \(N^2J_m\) rotor inertia. Estimating joint torque from current works well on a QDD (small \(N\), high \(\eta\)); on a 100:1 harmonic drive the efficiency varies by 10–30 percentage points with load, temperature and direction, the current-based torque can be far off, and that is when a real torque sensor is needed.

    误区 2:峰值力矩可以一直用Pitfall 2: believing peak torque is available all the time

    发热 \(\propto\tau^2\):FIG 1 里的 1.8 N·m 峰值力矩是持续力矩 0.36 N·m 的 5 倍,发热是 25 倍,堵转时只能撑 8 秒左右。机器人站立不动时,关节在重力下保持姿态,电机堵转似的发热却一点也不少,这是腿式机器人"站着不动也会烫"的原因。设计和仿真都应该给出持续力矩、峰值力矩、以及占空比(或热模型)。

    Heat goes as \(\tau^2\): the 1.8 N·m peak torque in FIG 1 is 5 times the 0.36 N·m continuous torque, which means 25 times the heat, and a stall lasts only about 8 seconds. A robot standing still holds its posture against gravity with the joints, and the motors heat as if nearly stalled, which is why a legged robot can get hot while doing nothing. Designs and simulations should state continuous torque, peak torque, and a duty cycle (or a thermal model).

    误区 3:直接对量化的编码器求导Pitfall 3: differentiating a quantized encoder

    一步差分的速度只能取 \(\Delta/T_s\) 的整数倍,低速时是 0 与脉冲交替,PD 控制器的 D 项把它放大成力矩抖动,电机发出"嘶嘶"声。加长窗口、低通滤波、用观测器(卡尔曼滤波)、或者改用高分辨率编码器,都是在噪声和滞后之间折中(FIG 4)。反过来,在仿真里直接用精确的 \(\dot q\) 训练的策略,到了真机上会因为速度反馈噪声而失效。

    A one-step difference can only take multiples of \(\Delta/T_s\); at low speed it alternates between zero and pulses, the D term of a PD controller amplifies that into torque chatter, and the motor hisses. A longer window, low-pass filtering, an observer (Kalman filter) or a higher-resolution encoder all trade noise against lag (FIG 4). Conversely, a policy trained in simulation on the exact \(\dot q\) can fail on hardware because of noisy velocity feedback.

    误区 4:直接积分陀螺仪,或在机器人加速时相信加速度计Pitfall 4: integrating a gyro raw, or trusting the accelerometer while the robot accelerates

    零偏 0.5 °/s 积分 60 秒就是 30°;而加速度计在起步、急停、落地时测到的是"重力 + 自身加速度",倾角估计错得离谱(FIG 5 里 0.15 g 就错 8.5°)。两者要融合,并且要估计零偏。三维旋转要积分在 \(\SO\) 上(5.2 节、5.6 节),不能把三个角速度分量直接当欧拉角的导数积分。陀螺零偏也会随温度和时间漂("零偏不稳定性"),不是一次标定就能解决。

    A 0.5 °/s bias integrates to 30° in 60 seconds; and at start, stop or landing the accelerometer measures "gravity plus the robot's own acceleration", so tilt estimates go badly wrong (0.15 g already gives 8.5° in FIG 5). Fuse the two, and estimate the bias. In 3D the rotation must be integrated on \(\SO\) (Lessons 5.2, 5.6), not by treating the three rate components as derivatives of Euler angles. Gyro bias also drifts with temperature and time ("bias instability"), so a single calibration does not solve it.

    误区 5:忽略延迟和抖动,把仿真里的关节当成理想力矩源Pitfall 5: ignoring latency and jitter, and treating the simulated joint as an ideal torque source

    仿真里的关节通常是"今天算出力矩,当步立刻施加,且无限大也施加得出来"。真机上有几毫秒的延迟、不均匀的采样(抖动)、力矩饱和、摩擦、回差和柔性。FIG 6 里 18 ms 的延迟就能让带宽 40 rad/s 的环失稳;而一个"位置控制"的舵机在仿真里常被建模成"直接到达目标位置",真实的内部位置环有自己的带宽和饱和。仿真到现实的训练要在仿真里随机化延迟、摩擦、电机常数,或者像 Hwangbo 等那样直接学出执行器模型。

    A simulated joint typically "computes the torque and applies it this very step, however large". Real hardware has milliseconds of delay, uneven sampling (jitter), torque saturation, friction, backlash and compliance. In FIG 6 an 18 ms delay is enough to destabilize a 40 rad/s loop, and a "position-controlled" servo that simulation models as "jump to the target" actually has an internal position loop with its own bandwidth and saturation. Sim-to-real training should randomize delay, friction and motor constants in simulation, or learn the actuator model directly as Hwangbo et al. did.

    8小练习Check yourself

    1. 理想直流电机:\(V=12\) V,\(R=1\ \Omega\),\(k_t=k_e=0.1\)。它能输出的最大机械功率,以及此时的转速和效率是?1. An ideal DC motor has \(V=12\) V, \(R=1\ \Omega\), \(k_t=k_e=0.1\). What are its maximum mechanical power, the speed at which it occurs, and the efficiency there?
    \(\tau_s=k_tV/R=1.2\) N·m,\(\omega_0=V/k_e=120\) rad/s,\(P_{\max}=\tau_s\omega_0/4=V^2/(4R)=36\) W,发生在 \(\omega_0/2=60\) rad/s,那里的电流是堵转电流的一半,效率 \(\omega/\omega_0=50\%\)。在 \(\omega_0\) 处电流和力矩都是 0,功率也是 0。\(\tau_s=k_tV/R=1.2\) N·m, \(\omega_0=V/k_e=120\) rad/s, \(P_{\max}=\tau_s\omega_0/4=V^2/(4R)=36\) W, at \(\omega_0/2=60\) rad/s, where the current is half the stall current and the efficiency is \(\omega/\omega_0=50\%\). At \(\omega_0\) current and torque are both zero, hence so is the power.
    2. 转子惯量 \(J_m=10^{-4}\) kg·m²,要加速的连杆惯量 \(J_L=0.09\) kg·m²(只受电机力矩)。让关节角加速度最大的传动比是多少?此时折算转子惯量是多少?2. Rotor inertia \(J_m=10^{-4}\) kg·m², link inertia \(J_L=0.09\) kg·m², driven by motor torque alone. Which gear ratio maximizes the joint angular acceleration, and what is the reflected rotor inertia there?
    \(N^\star=\sqrt{J_L/J_m}=\sqrt{900}=30\),折算转子惯量 \(N^2J_m=900\cdot10^{-4}=0.09=J_L\):惯量匹配。\(N\) 更大时转子的 \(N^2J_m\) 超过负载,加速度反而降低。\(N^\star=\sqrt{J_L/J_m}=\sqrt{900}=30\), and the reflected rotor inertia is \(N^2J_m=900\cdot10^{-4}=0.09=J_L\): inertia matching. With larger \(N\) the rotor's \(N^2J_m\) exceeds the load and acceleration drops again.
    3. 12 位编码器,1 kHz 采样,用相邻两次读数的一步差分估计速度。速度估计的最小"台阶"(量化步长)是多少?3. A 12-bit encoder sampled at 1 kHz, velocity estimated by a one-step difference of consecutive readings. What is the quantum (the smallest step) of the velocity estimate?
    \(\Delta=2\pi/4096=1.534\times10^{-3}\) rad,\(q=\Delta/T_s=1.534\times10^{-3}\cdot1000=1.53\) rad/s(0.0015 是 \(\Delta\) 本身,忘了除以 \(T_s\))。关节以 1 rad/s 转动时,估计会在 0 与 1.53 rad/s 之间跳动,平均值正确,但瞬时值噪声巨大。\(\Delta=2\pi/4096=1.534\times10^{-3}\) rad and \(q=\Delta/T_s=1.534\times10^{-3}\cdot1000=1.53\) rad/s (0.0015 is \(\Delta\) itself, forgetting to divide by \(T_s\)). A joint turning at 1 rad/s makes the estimate flip between 0 and 1.53 rad/s: right on average, wildly noisy instant to instant.
    4. 陀螺零偏 \(b=0.5^\circ\)/s,用时间常数 \(\tau=2\) s 的互补滤波器(其余传感器完美)融合,稳态倾角误差是多少?4. A gyro has bias \(b=0.5^\circ\)/s and is fused with a complementary filter of time constant \(\tau=2\) s (everything else perfect). What is the steady-state tilt error?
    \(\dot e=b-e/\tau\),稳态 \(e_{ss}=b\tau=0.5\cdot2=1^\circ\)。加速度计把误差"拉住"了,所以不再无限增长,但固定增益的互补滤波器并没有估计出零偏,留下一个与 \(\tau\) 成正比的常值误差;想让它为 0,要把零偏放进状态里(卡尔曼滤波,或加积分项的 Mahony 滤波器)。\(\dot e=b-e/\tau\), so \(e_{ss}=b\tau=0.5\cdot2=1^\circ\). The accelerometer holds the error down so it no longer grows, but a fixed-gain complementary filter does not estimate the bias and leaves a constant error proportional to \(\tau\); to drive it to zero put the bias in the state (Kalman filter, or a Mahony filter with an integral term).
    5. 一个 PD 位置环的截止频率是 \(\omega_c=40\) rad/s。通信链路又增加了 10 ms 的延迟,相位裕度损失多少?5. A PD position loop has crossover \(\omega_c=40\) rad/s. A communication link adds another 10 ms of delay. How much phase margin is lost?
    延迟 \(T\) 在截止频率处贡献相位 \(-\omega_cT=-40\cdot0.01=-0.4\) rad \(=-22.9^\circ\)(0.4 是弧度,不是度)。延迟不改变幅值,只让相位随频率线性下降,所以高带宽的回路对延迟最敏感。A delay \(T\) contributes phase \(-\omega_cT=-40\cdot0.01=-0.4\) rad \(=-22.9^\circ\) at crossover (0.4 is radians, not degrees). Delay leaves the magnitude alone and lowers the phase linearly with frequency, so high-bandwidth loops are the most sensitive to it.

    9延伸阅读Further reading

    • M. W. Spong, S. Hutchinson & M. Vidyasagar, Robot Modeling and Control, "独立关节控制"一章(2006 年版第 6 章)the "Independent Joint Control" chapter (Ch. 6 of the 2006 edition) — 直流电机方程、齿轮折算、执行器动力学与单关节控制DC-motor equations, gear reflection, actuator dynamics and single-joint control
    • B. Siciliano, L. Sciavicco, L. Villani & G. Oriolo, Robotics: Modelling, Planning and Control, Ch. 5 — 执行器与传感器:电机、传动、编码器、力传感器、视觉Actuators and sensors: motors, transmissions, encoders, force sensors, vision
    • G. A. Pratt & M. M. Williamson, Series elastic actuators, IEEE/RSJ IROS 1995 — 串联弹性执行器的原始论文The original series elastic actuator paper
    • S. Seok, A. Wang, M. Y. Chuah, D. Otten, J. Lang & S. Kim, Design principles for highly efficient quadrupeds and implementation on the MIT Cheetah robot, IEEE ICRA 2013 — 为什么腿式机器人需要大力矩电机与小传动比Why legged robots want large-torque motors and low gear ratios
    • P. M. Wensing, A. Wang, S. Seok, D. Otten, J. Lang & S. Kim, Proprioceptive actuator design in the MIT Cheetah: impact mitigation and high-bandwidth physical interaction for dynamic legged robots, IEEE Trans. Robotics 33(3), 2017 — 折算惯量、冲击与本体感觉执行器Reflected inertia, impact and the proprioceptive actuator
    • J. Hwangbo et al., Learning agile and dynamic motor skills for legged robots, Science Robotics 4(26), 2019 — 用神经网络建模执行器(执行器网络),实现仿真到现实的迁移Modelling the actuator with a neural network (the actuator network) for sim-to-real transfer
    • O. J. Woodman, An introduction to inertial navigation, University of Cambridge Computer Laboratory Technical Report UCAM-CL-TR-696, 2007 — 陀螺与加速度计的误差模型:噪声、零偏、积分漂移Gyro and accelerometer error models: noise, bias, integration drift
    • R. Mahony, T. Hamel & J.-M. Pflimlin, Nonlinear complementary filters on the special orthogonal group, IEEE Trans. Automatic Control 53(5), 2008 — 把互补滤波推广到三维姿态,并估计陀螺零偏Complementary filtering generalized to 3D attitude, with gyro-bias estimation