# 正余弦编码器

正余弦编码器（正/余弦编码器）是一种位置传感器，输出两路相移 90 电角度的模拟正弦信号，其瞬时比值在一个信号周期内编码轴或工作台的位置。它不提供传统增量式编码器那样的方波脉冲串，而是输出差分正弦和余弦电压，最常见为 1 V 峰峰值；下游电子设备对这些信号进行插值，从而得到比仅靠物理线数所能达到的精细得多的位置。<sup>[1](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)</sup><sup> • </sup><sup>[2](https://www.ti.com/lit/ug/tidua05a/tidua05a.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 输出信号 | 两路近似正弦的信号 A 和 B，相移 90°，以差分方式传输；常用电平为 1 Vpp（海德汉（HEIDENHAIN）1 Vpp 接口的容差为 0.6–1.2 Vpp）<sup>[1](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)</sup><sup> • </sup><sup>[3](https://www.heidenhain.com/fileadmin/pdf/en/01_Products/Prospekte/PR_Interfaces_ID1078628_en.pdf)</sup> |
| 每转周期数 | 旋转编码器通常每机械转最多 10,000 个周期；海德汉 RON 200 系列借助集成插值可达每转 180,000 个信号周期<sup>[1](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)</sup><sup> • </sup><sup>[4](https://www.heidenhain.com/products/encoders/angle-encoders/integral-bearing/ron-200)</sup> |
| 插值深度 | 商用接口将每个周期细分为 256 至 8192 份（8 至 13 位）；速度控制通常使用大于 1000 的插值系数<sup>[1](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)</sup><sup> • </sup><sup>[3](https://www.heidenhain.com/fileadmin/pdf/en/01_Products/Prospekte/PR_Interfaces_ID1078628_en.pdf)</sup> |
| 角度提取 | 反正切法 \( \theta = \tan^{-1}(\sin\theta / \cos\theta) \) 是最常见的软件细分方法<sup>[5](https://patents.google.com/patent/CN102564462B/en)</sup> |
| 分辨率示例 | 1024 线编码器配合双 12 位 ADC 可得到 22 位分辨率，配合双 16 位 ADC 可得到 26 位<sup>[6](https://www.ti.com/document-viewer/ja-jp/lit/html/SSZTBY0/GUID-C747A6AA-C0A0-4FD7-8AC1-7918BC9FE60A)</sup> |
| 信号频率 | 线数为 N、转速为 v（rpm）时，\( f = N \cdot v/60 \) Hz；2000 线编码器在 12,000 rpm 下产生 400 kHz<sup>[2](https://www.ti.com/lit/ug/tidua05a/tidua05a.pdf)</sup> |
| 测量类型 | 增量式：周期内的位置是绝对的，但除非增加参考标记或绝对通道，总位置在断电后不会保留<sup>[7](https://www.kollmorgen.com/en-us/developer-network/sine-encoder)</sup> |

## 信号如何产生

在光学正余弦编码器中，光源、码盘或光栅尺以及光电探测器构成传感核心。当码盘旋转时，其刻线调制光束，光电探测器产生两路相移 90 电角度的正弦信号 A 和 B；从轴侧看顺时针旋转时，B 滞后于 A。每机械转的信号周期数等于编码器的线数 N，另有一条参考轨每转最多产生一个标记脉冲 R，在安装角度已知时可据此确定绝对角度。<sup>[2](https://www.ti.com/lit/ug/tidua05a/tidua05a.pdf)</sup> 同样的正弦输出原理并不限于光学：采用霍尔传感器的磁扫描以及其他模拟原理也能产生等效的正弦和余弦信号。<sup>[7](https://www.kollmorgen.com/en-us/developer-network/sine-encoder)</sup><sup> • </sup><sup>[5](https://patents.google.com/patent/CN102564462B/en)</sup>

信号以差分方式传输，每个信号都由一条信号线及其反相信号构成，信息由电压差承载。正弦信号的完整 360° 循环为一个周期，输出频率随线数和机械转速二者上升。<sup>[1](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)</sup><sup> • </sup><sup>[2](https://www.ti.com/lit/ug/tidua05a/tidua05a.pdf)</sup>

## 插值：把正弦波转化为分辨率

普通增量式编码器只计数完整信号周期，因此其分辨率由线数固定。由于正弦和余弦输出是模拟量，每个周期都可以通过电子方式细分为许多中间位置。在最简单的配置中，比较器将每个正弦波转换为方波；用插值电路替代比较器，可将周期划分为选定数量的位置，并利用正弦周期内的角度来保持位置完整性。<sup>[8](https://www.encoder.com/wp2001-new-approach-interpolated-high-resolution-encoders)</sup>

**反正切计算。** 主流的软件方法用同步采样 ADC 将两个通道数字化，并按 \( \theta = \tan^{-1}(\sin\theta / \cos\theta) \) 计算角度，由此得到在周期内任何位置都有效的位置值。在 FPGA 实现中，CORDIC 算法迭代计算反正切，得到的离散角度再经过插值并与阈值比较，以输出等效于高分辨率增量式编码器的正交脉冲。<sup>[5](https://patents.google.com/patent/CN102564462B/en)</sup><sup> • </sup><sup>[9](https://patents.google.com/patent/CN115001345A/en)</sup> 一种典型架构为粗角度（由比较器产生的脉冲驱动的正交计数器）和细角度（插值后的相位）保留独立的硬件模块，并设置校正，只要两者的相位失配保持在 ±90° 以内，就使二者一致。<sup>[6](https://www.ti.com/document-viewer/ja-jp/lit/html/SSZTBY0/GUID-C747A6AA-C0A0-4FD7-8AC1-7918BC9FE60A)</sup>

**跟踪型转换器。** 由于正余弦编码器反馈的模拟信号在形式上类似于解调后的旋转变压器信号，常常改用跟踪环路：闭环转换器使估计的输出角度与输入所编码的真实角度相匹配。包括[锁相环](https://www.edgepedia.org/zh/phase-locked-loop)、矢量跟踪方法和角度跟踪观测器在内的闭环方案具有鲁棒性，并能检测某些传感器信号误差。<sup>[10](https://www.sciencedirect.com/topics/engineering/sine-encoder)</sup><sup> • </sup><sup>[11](https://www.sciencedirect.com/science/article/pii/S0924424718304680)</sup> 当时在[德州仪器](https://www.edgepedia.org/zh/texas-instruments)（Texas Instruments）和阿尔法西塔技术公司（Alpha Theta Technologies）任职的詹金斯（Jenkins）与希尔克特（Hilkert）描述了一种跟踪型转换器，它使用夫琅禾费（Fraunhofer）衍射模型预测非理想编码器输出的相位，从而减少开环预处理假设——这些假设会限制比率式设计的精度。<sup>[12](https://www.researchgate.net/publication/252415105_Sincosine_encoder_interpolation_methods_Encoder_to_digital_tracking_converters_for_rate_and_position_loop_controllers)</sup>

**开环线性化。** 另一种替代方案完全避免反馈：对正弦信号移相，并利用其绝对值的线性段，只使用加法、减法和乘法。2019 年，该策略在 FPGA 中的一种实现以 20 μm 栅距的直线光学编码器进行测试，结果显示在 360° 信号周期内理论插值误差在 0.072° 以内。<sup>[11](https://www.sciencedirect.com/science/article/pii/S0924424718304680)</sup>

## 插值带来什么

分辨率增益与线数相乘。倍福（Beckhoff）EL5021 接口将每个 1 Vpp 周期分辨到 8 至 13 位，即在该区间内实现 256 倍至 8192 倍的微分辨率，并以计数值形式输出结果，该计数值将最多 24 位的整周期与最多 13 位的周期内细分组合起来。<sup>[1](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)</sup> 采用反正切法时，理想插值分辨率随线数和 ADC 位深成比例提高：1024 线编码器配合双 12 位 ADC 可达 22 位，配合 16 位 ADC 可达 26 位。[亚德诺半导体](https://www.edgepedia.org/zh/analog-devices)（Analog Devices）用同样的算术说明：一个 1024 槽光学编码器由 16 位 ADC 采样，每槽 2<sup>16</sup> 个码，分辨率最高可达 26 位，并可通过片上过采样扩展到 28 位。<sup>[6](https://www.ti.com/document-viewer/ja-jp/lit/html/SSZTBY0/GUID-C747A6AA-C0A0-4FD7-8AC1-7918BC9FE60A)</sup><sup> • </sup><sup>[13](https://www.analog.com/en/resources/analog-dialogue/articles/fast-reacting-optical-encoder-feedback-system-for-miniature-motor-driven-applications.html)</sup>

高分辨率对低轴速下的速度控制最为重要；此时即使编码器几乎不动，高于 1000 的插值系数也能提供可用数据。<sup>[3](https://www.heidenhain.com/fileadmin/pdf/en/01_Products/Prospekte/PR_Interfaces_ID1078628_en.pdf)</sup> 模拟格式还具有传输优势：正弦和余弦信号具有单一频率成分，比方波能传输更远而不衰减或失真。<sup>[5](https://patents.google.com/patent/CN102564462B/en)</sup>

## 误差来源与校正

插值精度直接取决于模拟正弦波的质量。如果波形失真，插值电路就无法正确确定角度，导致输出方波中的脉冲变短或丢失。<sup>[8](https://www.encoder.com/wp2001-new-approach-interpolated-high-resolution-encoders)</sup> 主要缺陷是直流偏置、正弦与余弦通道之间的幅度失配，以及破坏精确 90° 正交关系的相位不平衡。<sup>[14](https://www.analog.com/media/en/technical-documentation/technical-articles/452913422000_sin_encoder.pdf)</sup><sup> • </sup><sup>[5](https://patents.google.com/patent/CN102564462B/en)</sup> 这些影响可以量化：任一信号上每 1% 的偏置会产生 0.32% 的插值误差。<sup>[15](https://www.newport.com/medias/sys_master/npresources/h0f/h6d/9954434908190/EDH0407En1041_XPS-D%20Features%20Manual/EDH0407En1041-XPS-D-Features-Manual.pdf)</sup>

商用系统通过多种方式校正这些误差。运动控制器的插值功能可直接检测并校正偏置以及正弦与余弦之间的幅度差。<sup>[15](https://www.newport.com/medias/sys_master/npresources/h0f/h6d/9954434908190/EDH0407En1041_XPS-D%20Features%20Manual/EDH0407En1041-XPS-D-Features-Manual.pdf)</sup> 磁编码器方案在启动时自动调整偏置、增益和相位。<sup>[16](https://www.renesas.com/en/applications/industrial/motor-drives-robotics/motor-solution-using-magnetic-encoder)</sup> 专用补偿器件以数字方式校正直流、幅度和相位误差，因为模拟校正电路难以应对信号从 0 Hz 到 1 MHz 的宽频率范围。<sup>[5](https://patents.google.com/patent/CN102564462B/en)</sup> 接口规范限定可接受的缺陷：海德汉 1 Vpp 接口允许幅度为 0.6 至 1.2 Vpp，通道间幅度比为 0.8 至 1.25，相位角为 90° ±10° 电角度。<sup>[3](https://www.heidenhain.com/fileadmin/pdf/en/01_Products/Prospekte/PR_Interfaces_ID1078628_en.pdf)</sup>

## 应用与接口

正余弦编码器用作伺服驱动和高精度运动控制中的反馈装置，应用领域包括电动机、机床、印刷和纺织机械、机器人以及测量与检测设备。<sup>[7](https://www.kollmorgen.com/en-us/developer-network/sine-encoder)</sup><sup> • </sup><sup>[2](https://www.ti.com/lit/ug/tidua05a/tidua05a.pdf)</sup> 许多商用产品将模拟正弦/余弦通道与数字接口结合：罗克韦尔（Rockwell）的 Bulletin 842HR 将正/余弦差分接口与兼容 Hiperface 协议的双向 RS-485 串行链路结合，在一个 15 位设备中提供绝对位置反馈和高分辨率增量速度反馈。<sup>[17](https://www.rockwellautomation.com/en-mde/products/hardware/motion-control/842hr-sine-cosine.html)</sup> 安全级驱动器增加了更多约束；[博世力士乐](https://www.edgepedia.org/zh/bosch-rexroth)（Bosch Rexroth）要求正弦和余弦信号差分传输，幅度在 0.8 Vpp 至 1.2 Vpp 之间，采用模拟（而非合成）信号生成，并且用于最高 SIL 2（安全完整性等级 2）时截止频率不高于 400 kHz。<sup>[18](https://docs.automation.boschrexroth.com/pdf/document/ID1783472_475533185?filename=Required+motors+and+measuring+systems&lang=eng)</sup>

与旋转变压器相比——后者由电磁转子产生类似的正弦/余弦幅度信号——编码器提供便于数字集成的方案，并在尺寸和升级方面具有更大灵活性；只有在输入设备接受旋转变压器正弦/余弦信号时，旋转变压器才能替代编码器。<sup>[19](https://www.heidenhain.us/resources-and-news/resolvers-vs-encoders/)</sup>

## References

1. [Beckhoff EL5021 Commissioning documentation, SinCos encoder interfaces](https://download.beckhoff.com/download/document/io/ethercat-terminals/EL5021_en.pdf)
2. [Texas Instruments, Interface to Sin/Cos Encoders Design Guide (TIDUA05B)](https://www.ti.com/lit/ug/tidua05a/tidua05a.pdf)
3. [HEIDENHAIN, Interfaces of HEIDENHAIN Encoders](https://www.heidenhain.com/fileadmin/pdf/en/01_Products/Prospekte/PR_Interfaces_ID1078628_en.pdf)
4. [HEIDENHAIN, RON 200 series incremental angle encoders](https://www.heidenhain.com/products/encoders/angle-encoders/integral-bearing/ron-200)
5. [CN102564462B, Error compensation device for sin/cos encoder, Google Patents](https://patents.google.com/patent/CN102564462B/en)
6. [Texas Instruments, Sin/Cos encoder interface technical article (SSZTBY0)](https://www.ti.com/document-viewer/ja-jp/lit/html/SSZTBY0/GUID-C747A6AA-C0A0-4FD7-8AC1-7918BC9FE60A)
7. [Kollmorgen, Sine Encoder](https://www.kollmorgen.com/en-us/developer-network/sine-encoder)
8. [Encoder Products Company, White Paper WP-2001: A New Approach to Interpolated High Resolution Encoders](https://www.encoder.com/wp2001-new-approach-interpolated-high-resolution-encoders)
9. [CN115001345A, Sine and cosine encoder subdivision output method based on angle interpolation, Google Patents](https://patents.google.com/patent/CN115001345A/en)
10. [ScienceDirect Topics, Sine Encoder overview](https://www.sciencedirect.com/topics/engineering/sine-encoder)
11. [Ye et al. (2019), Development of a digital interpolation module for high-resolution sinusoidal encoders, Sensors and Actuators A: Physical](https://www.sciencedirect.com/science/article/pii/S0924424718304680)
12. [Jenkins & Hilkert (2008), Sin/cosine encoder interpolation methods: encoder to digital tracking converters, Proc. SPIE 6971](https://www.researchgate.net/publication/252415105_Sincosine_encoder_interpolation_methods_Encoder_to_digital_tracking_converters_for_rate_and_position_loop_controllers)
13. [Analog Devices, Fast Reacting Optical Encoder Feedback System for Miniature Motor Driven Applications](https://www.analog.com/en/resources/analog-dialogue/articles/fast-reacting-optical-encoder-feedback-system-for-miniature-motor-driven-applications.html)
14. [Analog Devices, Sinusoidal encoder error analysis technical article](https://www.analog.com/media/en/technical-documentation/technical-articles/452913422000_sin_encoder.pdf)
15. [Newport, XPS-D Features Manual, analog encoder interpolation](https://www.newport.com/medias/sys_master/npresources/h0f/h6d/9954434908190/EDH0407En1041_XPS-D%20Features%20Manual/EDH0407En1041-XPS-D-Features-Manual.pdf)
16. [Renesas, Motor Solution Using a Magnetic Encoder](https://www.renesas.com/en/applications/industrial/motor-drives-robotics/motor-solution-using-magnetic-encoder)
17. [Rockwell Automation, Bulletin 842HR Sine/Cosine Absolute Encoders](https://www.rockwellautomation.com/en-mde/products/hardware/motion-control/842hr-sine-cosine.html)
18. [Bosch Rexroth, Required motors and measuring systems (ctrlX DRIVE documentation)](https://docs.automation.boschrexroth.com/pdf/document/ID1783472_475533185?filename=Required+motors+and+measuring+systems&lang=eng)
19. [HEIDENHAIN, Resolvers vs Encoders for Motion Control](https://www.heidenhain.us/resources-and-news/resolvers-vs-encoders/)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Mechanical foundations of robotics › Sensors, encoders, and feedback components

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sine-cosine-encoder

English original: https://www.edgepedia.org/sine-cosine-encoder
