模拟电位器 - 硬件
备注
This section covers analog potentiometer hardware. For a software guide to analog potentiometers, see Analog Potentiometers - Software.
警告
电位计通常具有受机械限制的行程范围。用户应注意其机械装置不要使电位计旋转超过最大行程,因为这会损坏或破坏电位计。
Apart from quadrature encoders, another common way of measuring rotation on FRC® robots is with analog potentiometers. A potentiometer is simply a variable resistor - as the shaft of the potentiometer turns, the resistance changes (usually linearly). Placing this resistor in a voltage divider allows the user to easily measure the resistance by measuring the voltage across the potentiometer, which can then be used to calculate the rotational position of the shaft.
连接一个模拟电位器
就如其名,模拟电位器需要连接到roboRIO的模拟输入口<analog-inputs-hardware>。但是,若要了解如何精确连接电位计,了解其内部电路非常重要。
左上方的图片显示了一个典型的电位计。就像RIO的模拟输入口一样,它共有三个引脚。中间引脚是信号引脚,而外部两引脚可以是电源或地线任意一个。
如前所述,电位器是分压器,如右图所示。随着电位计轴的旋转,电阻R1和R2改变;但是,它们的总和保持不变[1]_。因此,整个电位计上的电压保持恒定(对于roboRIO,这将是5伏),但是信号轴与电源或地线引脚之间的电压随轴旋转而线性变化。
由于电路是对称的,因此也是可逆的——允许用户选择在行程的哪一端测得的电压为零,在哪一端为5伏。若要反转传感器的方向,只需将其供电引脚反向接线即可!在将电线焊接到触点之前,请务必用万用表检查电位计的方向性,以确保其方向正确。