Main Content
Quadrature Decoder
Comp你tepos一世t一世onof quadrature encoder
在页面中扩展全部
描述
这Quadrature Decoder块计算正交编码器的位置。
为了计算成正交编码器(和转子)的角度位置,弧度或每个单位,该块使用以下方法之一。
该图显示了带有两个通道(QEPA和QEPB)和一个索引脉冲(QEPI)的正交编码器磁盘:
我nthis example, the timer driven by the QEP increments by four for each slit:
方程式
该块计算正交编码器的角度位置(计数)为:
当编码器沿顺时针方向旋转时:
如果
,,,,
如果
and the shaft continues to rotate in the clockwise direction,
如果
and the shaft starts rotating in the anticlockwise direction,
当编码器沿逆时针方向旋转时:
如果
,,,,
如果
and the shaft continues to rotate in the anticlockwise direction,
如果
轴开始沿顺时针方向旋转,
When you clear the外部索引计数参数,IDXp你lseresetsCNT因此,零:
在哪里:
块Comp你testhe outputθm作为:
((一世ndegrees)
(在弧度中)
(在每个单位中)
ports