0 / 8 页已完成

定位轮安装指南Tracking Wheel Installation Guide

提示Tip:如果你正在学原理阶段,还没有实体机器人,可以先跳到下一节(LemLib)继续学代码,等装车时再回来看这一节。: If you're still learning the theory and don't have a physical robot yet, you can skip to the next section (LemLib) to continue learning code, and come back here when you're ready to build.
视频讲解Video Explanation
VEX Auton Tutorial Part 1 — Tracking Wheels(安装部分)
EthanMik · 11 分钟min · 英文English · 含 CAD 文件和弹簧安装细节Includes CAD files and spring installation details
VEX Auton Tutorial Part 2 — Setting Up Odometry Template
EthanMik · 13 分钟min · 英文English · 轮径测量和偏移量计算Wheel diameter measurement and offset calculation

安装质量直接决定定位精度。Installation quality directly determines tracking accuracy.

4.1 位置4.1 Placement

要求Requirement原因Reason
竖轮尽量在旋转中心的纵线上Vertical wheel should be on the rotation center's vertical line减少原地转圈时的误差Reduces error when spinning in place
横轮尽量在旋转中心的横线上Horizontal wheel should be on the rotation center's horizontal line同上Same reason
离旋转中心越近越好As close to rotation center as possible偏移越大,补正误差越大Larger offset = larger correction error
旋转中心在哪?Where is the center of rotation? 一般在底盘的几何中心附近。可以让机器人原地旋转,看哪个点不动,那就是旋转中心。Usually near the geometric center of the chassis. Spin the robot in place and watch which point stays still — that's the center of rotation.

4.2 机械要求4.2 Mechanical Requirements

要求Requirement原因Reason不达标的后果Consequence if not met
轮子必须完全平行/垂直于底盘Wheel must be perfectly parallel/perpendicular to chassis哪怕偏 2 度,走远了误差很大Even 2° off causes large errors over distance走 3 米偏 10cm+10cm+ drift over 3 meters
左右晃动极小Minimal lateral wobble(掰不动的程度) (should be immovable)晃动 = 每次读数方向不一致Wobble = inconsistent reading direction误差快速积累Error accumulates rapidly
轮子始终贴地Wheel must stay on the ground离地就读不到数据No data when lifted off ground定位直接失效Tracking fails completely
用皮筋或弹簧向下压Use rubber bands or springs to press down保证过颠簸时不离地Keeps wheel grounded over bumps弹起瞬间数据丢失Data lost when wheel bounces
旋转阻力越小越好Minimize rotational resistance阻力大 = 轮子跟不上机器人High resistance = wheel can't keep up读数滞后Readings lag behind
皮筋力方向竖直向下Rubber band force should be straight down斜着拉会给轮子施加扭矩Pulling at an angle applies torque to the wheel轮子被拉歪Wheel gets pulled out of alignment
怎么检查轮子是否平行?How to check if the wheel is parallel? 把机器人放在场地上,手推着它走一条直线(3米),看竖轮读数是否一直增长(不应该有来回跳动)。如果跳动,说明轮子歪了或者有晃动。Place the robot on the field, push it by hand in a straight line (3 meters), and check if the vertical wheel reading keeps increasing (no back-and-forth jumps). Jumping means the wheel is misaligned or has wobble.

4.3 最常见的错误4.3 Most Common Mistakes

常见安装错误Common Installation Mistakes

轮子歪了 2-3 度,以为没影响Wheel misaligned by 2-3°, assumed it doesn't matter
走一圈回来坐标偏了 20cmCoordinates off by 20cm after one loop

轮子没压紧,过坎时弹起来Wheel not pressed down firmly, bounces over bumps
弹起的瞬间数据丢失,位置跳变Data lost during bounce, position jumps

在定位线程里打印数据到遥控器屏幕Printing data to controller screen in the tracking thread
打印很慢,拖慢刷新频率(从 200Hz 降到 50Hz),精度下降Printing is slow, reduces refresh rate (200Hz → 50Hz), accuracy drops

编码器接线松动Loose encoder wiring
偶尔读到 0,坐标瞬间飘走Occasional zero readings, coordinates instantly drift

横轮装反了(向右滚读出负值)Horizontal wheel installed backwards (rolling right gives negative)
x 坐标方向反了,机器人以为自己在镜像位置x coordinate is reversed, robot thinks it's at the mirror position
解决:传感器设置里 reverse,或代码里取反Fix: reverse in sensor settings, or negate in code

4.4 偏移距离怎么测?4.4 How to Measure the Offset Distance

测量定位轮到旋转中心的距离:Measuring the distance from tracking wheel to center of rotation:

  1. 设定初始位置 (0, 0),先把偏移距离设为 0Set initial position to (0, 0), start with offset set to 0
  2. 让机器人原地顺时针转 10 圈Spin the robot clockwise 10 full rotations
  3. 看程序报告的 (x, y) —— 理论上应该还是 (0, 0)Check the reported (x, y) — it should theoretically still be (0, 0)
  4. 如果 x 偏了,调整竖轮偏移(OFFSET_V);如果 y 偏了,调整横轮偏移(OFFSET_H)If x drifted, adjust vertical wheel offset (OFFSET_V); if y drifted, adjust horizontal wheel offset (OFFSET_H)
  5. 反复调整直到转 10 圈后坐标几乎不变(x, y 都在 2cm 以内)Repeat until coordinates barely change after 10 spins (x and y both within 2cm)
偏移值有正负:轮子在旋转中心右边就是正,左边就是负。可以先量个大概值,再用上面的方法微调。Offset values can be positive or negative: right of rotation center = positive, left = negative. Start with a rough measurement, then fine-tune with the method above.
检查点Checkpoint
定位轮安装时最重要的是?What's the most important thing when installing tracking wheels?