关节要跟得住指令,靠的是位置反馈。但只用一颗编码器,减速器背隙就是闭环外的东西——转子已经动了,输出端还没动。这一篇把双编码器架构讲透,再把光学、磁、电感、旋变、电位计五条位置传感器路线的优缺点摊开对比,让你按现场条件选型,而不是只看参数表。A joint tracks its command through position feedback. With a single encoder, gearbox backlash sits outside the loop — the rotor has already moved while the output hasn't. This piece explains the dual-encoder architecture, then lays out the strengths and weaknesses of five position-sensing routes — optical, magnetic, inductive, resolver and potentiometer — so you can select against real field conditions instead of a datasheet.
电机端编码器装在转子上,负载端编码器装在减速器输出侧。两者同时采样,控制器能实时算出真实关节角,也能把背隙当 disturbance 主动补偿。The motor-side encoder sits on the rotor, the load-side encoder on the gearbox output. Sampling both lets the controller recover the true joint angle and treat backlash as a disturbance it can cancel.
装在电机转子上,紧贴气隙,采样率高(常与 FOC 换向同步)。它回答"转子转到哪了",用于换相、电流环与力矩估算。要求带宽高、延迟低,但对绝对精度的要求相对宽松——因为传动误差会被负载端兜住。Mounted on the rotor with a tight air gap and sampled fast (often synchronous with FOC commutation). It answers "where is the rotor" for commutation, the current loop and torque estimation. Bandwidth and latency matter more than absolute accuracy here, because transmission error is caught by the load side.
装在减速器输出轴或关节壳体上,测的是连杆真实朝向。它回答"末端到底在哪",用于位置环、轨迹跟踪与安全监控。这一侧的绝对精度与重复精度直接决定整机精度,是选型时最该用预算的地方。
Mounted on the gearbox output or joint housing, measuring the link's true orientation. It answers "where is the end of the arm" for the position loop, trajectory tracking and safety monitoring. Its absolute and repeatability set the machine's precision — this is where the selection budget belongs.关节 MCU 同步读两颗编码器,用 θ_load 与 θ_motor × 减速比 N 的差值在线估计背隙量与传动刚度,再做前馈补偿或增益调度。进阶做法是把差值作为扰动观测器(DOB)输入,实时给出摩擦与弹性的等效补偿。EtherCAT 从站按 CiA402 把位置值随同步帧广播给主站。The joint MCU reads both encoders synchronously and uses the difference between θ_load and θ_motor × N to estimate backlash and transmission stiffness online, then applies feed-forward or gain scheduling. Advanced schemes feed that difference into a disturbance observer (DOB) for equivalent friction and elasticity compensation. The EtherCAT slave broadcasts the position with each sync frame under CiA402.
关节现场的核心约束不是"最高精度",而是抗污染、抗振动、温度范围与成本的综合平衡。下面是五条路线的定性对比。The real constraint in a joint is not peak accuracy but the balance of contamination, vibration, temperature and cost. Here is a qualitative comparison of the five routes.
参数会随具体型号与工艺变化,下面给的是量级判断(选型层面参考),具体指标以原厂 datasheet 为准。Numbers shift with part and process; the figures below are order-of-magnitude guidance for selection, with exact specs per vendor datasheet.
| 路线Route | 分辨率 / 精度量级Resolution / accuracy | 优点Strengths | 缺点Weaknesses | 典型场景Where it fits |
|---|---|---|---|---|
| 光学编码器 OpticalOptical |
16–24 bit,角秒级 可达 27 bit,±0.0001°up to 27 bit, ±0.0001° |
精度最高、分辨率最高,长期稳定性最好;原理成熟,协议生态完备(EnDat / BiSS / SSI)。 Highest accuracy and resolution, best long-term stability; mature principle, complete protocol ecosystem (EnDat / BiSS / SSI). | 光栅盘与码盘是磨损件,有 MTBF 上限(优质件约 3–5 万小时,磁编可达 10 万小时以上);怕灰尘、油污、金属屑,光路被遮挡即失准;抗振一般(100 g 量级);温区窄(典型 −10 ~ +70 °C);体积大、成本高;高速时受码盘圆周速度限制。 The disc is a wear item with an MTBF ceiling (quality parts ~30–50k hours vs 100k+ for magnetic); susceptible to dust, oil and metal chips — a blocked light path ruins accuracy; moderate shock/vibration (~100 g); narrow temperature window (typ. −10 to +70 °C); bulky, costly, and limited by disc rim speed at high rpm. | 洁净室、半导体检测设备、光学仪器、高端机床、实验室精密测控Cleanrooms, semiconductor inspection, optical instruments, high-end machine tools, lab metrology |
| 磁编码器 Magnetic(霍尔 / AMR / TMR)Magnetic (Hall / AMR / TMR) |
12–18 bit,系统精度 ±0.05–0.3° AS5048A 14 bit,线性化后 ±0.05°AS5048A 14 bit, ±0.05° after linearization |
非接触、无光路,不怕灰尘油污;芯片级集成,体积小重量轻,BOM 最低之一;抗振好(2000 g 量级);温区宽(−40 ~ +150 °C);绝对值输出,上电即知位置免回零;单芯片可同时给出换相 UVW 与绝对角度。 Contactless with no light path — immune to dust and oil; die-level integration, tiny and light, among the lowest BOM; strong vibration tolerance (~2000 g); wide temperature (−40 to +150 °C); absolute output knows position at power-on with no homing; one chip can output commutation UVW and absolute angle together. | 精度低于光学(典型 ±0.1–1°,需系统线性化与均化);受外部磁场干扰——电机自身磁场、永磁体、附近铁磁件都可能影响,需磁屏蔽或选带杂磁抑制能力的型号;对气隙敏感,安装同心度与气隙变化直接体现在读数上;高温下磁体退磁会造成长期漂移,必须监控信号幅度(magnetic field status)诊断气隙增大。 Accuracy below optical (typ. ±0.1–1°, needs system linearization and averaging); vulnerable to stray fields from the motor's own magnets and nearby ferrous parts, so shielding or a stray-field-immune part is needed; air-gap sensitive — mounting concentricity and gap changes show up directly in the reading; long-term drift from magnet demagnetization at temperature, so watch the field-status bits to catch a growing gap. | 机器人关节主流选择、成本敏感型伺服、AGV/AMR 驱动轮、工业电机、汽车电子The mainstream robot-joint choice, cost-sensitive servos, AGV/AMR drive wheels, industrial motors, automotive |
| 电感编码器 Inductive(Inductosyn 类)Inductive |
约 ±50 arcmin(≈±0.014°)起,取决于系统 分辨率高,优于磁编High resolution, better than magnetic |
可看作光学与磁编之间的"第三极":精度接近光学,环境鲁棒性接近磁编。既不怕灰尘油污,也不怕外部磁场;抗振极佳;可做成分体式 PCB,支持超薄中空结构——这一点对中空杯电机与紧凑关节非常关键;温区宽。 The "third pole" between optical and magnetic: optical-like accuracy with magnetic-like ruggedness. Immune to dust and oil yet immune to stray fields; excellent vibration tolerance; can be built as a split PCB enabling ultrathin hollow-cup architectures, which matters for hollow-cup motors and compact joints; wide temperature range. | 技术较新,供应链成熟度与资料量不如光编和磁编;成本介于两者之间;需要专用解算芯片与特定激励/解调电路,系统复杂度高于磁编;供应商相对集中。 Newer technology with less supply-chain maturity and documentation than optical or magnetic; cost sits between the two; needs dedicated signal-conditioning ICs and excitation/demodulation circuitry, making the system more complex than a magnetic part; concentrated vendor base. | 人形机器人关节、协作机器人、户外自动化、恶劣工况下的高精度应用Humanoid joints, cobots, outdoor automation, high-precision work in harsh conditions |
| 旋转变压器 ResolverResolver |
取决于绕组与励磁,典型 ±0.02–0.5° 模拟 sin/cos 输出,需 RDC 解算Analog sin/cos, needs an RDC |
工业界"老黄牛",绝对无磨损;耐极端温度(−55 ~ +155 °C);抗强振动冲击(500 g 量级)与冲击;抗电磁干扰极强;抗辐射,适合军工航天;本质绝对值,多圈可测;寿命极长(MTBF 15 万小时以上)。 The industrial workhorse: absolutely wear-free; survives extreme temperature (−55 to +155 °C), heavy shock and vibration (~500 g), EMI and radiation; inherently absolute with multi-turn capability; very long life (MTBF 150k+ hours). | 系统复杂:需励磁 + 绕组 + 专用 RDC 芯片解算,体积大、成本高;接口延迟大(50–500 μs 级,远高于数字式编码器的 1–20 μs),高频闭环时是明显瓶颈;高频励磁信号会带来 EMI 问题需要处理;精度通常不如光编。 System complexity: excitation windings plus a dedicated RDC decoder; bulky and expensive; much higher interface latency (50–500 μs vs 1–20 μs for digital encoders), a real bottleneck in high-rate loops; the excitation signal creates EMI that needs managing; accuracy generally below optical. | 航空航天、军工、高温高振场合、重型工业伺服、新能源汽车电机Aerospace, defence, high-temperature/high-vibration, heavy-duty industrial servos, EV traction motors |
| 电位计 / 霍尔开关 Potentiometer / Hall switchPotentiometer / Hall switch |
约 10–12 bit,±0.25–1.5% 线性度 霍尔开关仅给"有/无"限位Hall switch gives limit only |
原理最简单、成本最低(数美元级)、信号处理直接(ADC 读电压);绝对值输出;霍尔开关可做机械限位与零位检测,适合安全冗余通道。 Simplest principle and lowest cost (single-digit dollars), straightforward signal path (ADC read), absolute output; Hall switches serve as mechanical limit and zero detection, useful as a safety-redundant channel. | 电刷机械磨损,寿命有限——连续运行约 200 万次后线性度可从 ±0.25% 恶化到 ±1.5%;有温漂(每 10 °C 约 0.3% 阻值漂移);抗振差;噪声大需滤波;精度最低。霍尔开关只能检测特定角度,做不了连续位置反馈。 Mechanical wiper wear limits life — after ~2 million cycles linearity can degrade from ±0.25% to ±1.5%; temperature drift (~0.3% per 10 °C); poor vibration tolerance; noisy and needs filtering; lowest accuracy. A Hall switch only detects a specific angle, not continuous position. | 低成本 / 低精度关节、夹爪开合、机械限位与安全冗余通道Low-cost / low-precision joints, grippers, mechanical limits, safety-redundant channels |
同样是"双编",预算与关节规模不同,落法差别很大。Same dual-encoder principle, very different builds depending on budget and joint size.
电机端与负载端各一颗 AS5047U(14 bit,带 DAEC 动态角度误差补偿与DFS 动态滤波,±0.4° typ.),经 SPI 读入带 EtherCAT 从站的 MCU。AS5047U 的 UVW 换相输出可直接驱动 FOC 换相,ABI 增量接口可做高速捕获。单 TSSOP14 封装、−40 ~ +125 °C,磁体兼容性好。适合成本敏感的中小型关节,我们已有现成的参考设计与模块。One AS5047U (14-bit, DAEC dynamic angle error compensation, DFS dynamic filtering, ±0.4° typ.) on each side, read over SPI by an MCU with an integrated EtherCAT slave. AS5047U's UVW outputs drive FOC commutation directly and its ABI incremental interface allows high-speed capture. TSSOP14, −40 to +125 °C, good magnet compatibility. Suits cost-sensitive mid-size joints — we already have a reference design and module.
电机端用磁编保证高带宽与换相实时性,负载端用绝对式光学编码器(EnDat 2.2 或 BiSS-C 协议)拿最高的位置精度。两者分工明确:动态靠电机端,精度靠负载端。代价是 BOM 上升、体积变大,且光编怕污染——适合洁净环境或对末端精度要求极高的应用,如半导体搬运、精密装配。Magnetic on the motor for high bandwidth and commutation timing, absolute optical (EnDat 2.2 or BiSS-C) on the load for maximum positional accuracy. Clean division: dynamics from the motor side, precision from the load side. The cost is a higher BOM, more volume, and optical's sensitivity to contamination — a fit for clean environments or extreme end-effector precision such as semiconductor handling and precision assembly.
户外、军工、高温或强振场合选电感编码器——既不怕灰尘油污也不怕外部磁场;更高温或强辐射场合选旋转变压器,用 RDC 解算,牺牲接口延迟换极限环境适应性。两者 BOM 都明显更高,但在恶劣环境下反而是唯一能长期可靠工作的选择。For outdoor, defence, high-temperature or high-vibration duty, inductive encoders — immune to both contamination and stray fields. For extreme temperature or radiation, resolvers with an RDC, trading interface latency for environmental survival. Both cost considerably more, yet in harsh environments they may be the only reliable choice long-term.
| 坑Pitfall | 原因Cause | 对策Countermeasure |
|---|---|---|
| 两路采样不同步Unsynchronized sampling | 两颗编码器分时读取,电机高速时两路角度不对应同一个时刻,算出的差值里混入了速度误差,补偿反而变差。Reading the two encoders at different instants means that at high speed the two angles do not correspond to the same moment; the computed difference is contaminated by velocity error and compensation gets worse. | 用同一 SPI 总线并在 DMA/定时器触发下严格同时读取;两路用同型号器件、同一磁体规格,把系统误差做成共模以便标定抵消。Share one SPI bus and read both under a timer/DMA trigger; use identical parts and magnets so system error becomes common-mode and cancels during calibration. |
| 机械同心度与气隙Concentricity and air gap | 磁编码器对气隙敏感,安装偏心或气隙波动直接转为角度误差。负载端尤其要小心——轴承压装、壳体公差、装配应力都会改变气隙。Magnetic sensors are gap-sensitive: mounting eccentricity or gap variation converts directly into angle error. This matters most on the load side, where press-fit bearings, housing tolerances and assembly stress all shift the gap. | 设计时给气隙留足余量并做公差分析;装配后强制标定并把标定值写入 NVM;持续读取磁场强度诊断位,气隙增大即报警。Leave gap margin in the design and run a tolerance analysis; force a calibration after assembly and store it in NVM; poll the field-strength status bit and raise an alarm when the gap grows. |
| 电机磁场干扰Motor stray field | 永磁电机与关节内其他磁体(制动器、磁联轴器)都会在传感器处产生杂散场,超出芯片耐受范围就引入非线性误差。The permanent-magnet motor and other magnets in the joint (brake, magnetic coupling) create stray fields at the sensor; beyond the part's tolerance this introduces non-linearity. | 选带杂磁抑制能力的型号(如 AS5047U 的 homogeneous stray-field immunity);磁体与传感器保持原厂推荐气隙与同心度;必要时加高磁导屏蔽罩并做温升验证。Use a stray-field-immune part (e.g. AS5047U's homogeneous stray-field immunity); respect the vendor's recommended gap and concentricity; add a high-permeability shield where needed and verify it thermally. |
| 标定与温漂Calibration and drift | 出厂标定在室温做,装到整机并打温升后,气隙、磁体温度、轴承间隙都会变化,标定值不再成立,精度悄悄流失。Factory calibration happens at room temperature; once installed and heat-soaked, gap, magnet temperature and bearing clearance have all shifted, so the calibration no longer holds and accuracy silently bleeds away. | 做整机级标定流程(含温升曲线);必要时加温度传感器做在线补偿表;用两颗器件的差值做自诊断,趋势下滑即提示需要重新标定。Run an assembly-level calibration including a thermal profile; add a temperature sensor with an online compensation table if needed; use the difference between the two devices as a self-test and flag a downward trend for recalibration. |
告诉我们你的关节规格——负载、减速器类型、温度范围、精度目标、预算,我们按上面的框架帮你过一遍,给出选型建议与 BOM 参考。已有 AS5047U 双编模块现货可直接打样。Send us your joint spec — payload, gearbox type, temperature range, accuracy target, budget — and we'll walk it through the framework above with a selection recommendation and a reference BOM. The AS5047U dual-encoder module is in stock for immediate prototyping.