模拟输入 - 硬件

备注

This section covers analog input hardware. For a software guide to analog inputs, see Analog Inputs - Software.

模拟信号 analog signal 是一种信号,其值可以位于连续间隔内的任何位置。这与数字信号形成鲜明对比,数字信号<digital-inputs-hardware>只能采用几个离散值之一。 roboRIO的模拟输入端口允许测量0V至5V范围内的模拟信号。

实际上,无法使用数字设备比如计算机(roboRIO)来测量模拟信号是否为“真”。因此,模拟输入实际上被当作12位数字信号来测量。这么高的测量分辨率已经足够了 [1]

模拟输入通常(但不总是)用于其测量值在一定范围内连续变化的传感器,例如超声波测距仪<ultrasonics-hardware>和电位计<analog-potentiometers-hardware>,因为它们可以通过输出与测量值成比例的电压进行通信。

连接到roboRIO的模拟输入端口

备注

通过“ MXP”扩展端口还可以使用另外四个模拟输入。要使用它们,需要和MXP连接的分线板上的端口相连。

警告

在对传感器进行接线之前,请务必先阅读正在使用的传感器的技术文档,以确保将正确的导线连接到每个引脚。否则可能会损坏传感器或roboRIO。

警告

**切勿**将传感器的电源引脚直接连接到roboRIO任意端口上的接地引脚!这将触发roboRIO上的保护功能,并可能导致意外行为。

The roboRIO, with the location of the Analog Inputs highlighted.

如上图所示,roboRIO内置4路模拟输入端口(0-3号)。每一个端口有三根引脚——信号引脚(S),电源引脚(V)和地线引脚(⏚)。电源引脚和地线引脚 [2]_用于给传感器外设供电,电压是5V。信号引脚则是实际测量信号的引脚。

将传感器连接到单个模拟输入端口

备注

有的传感器(如电位器<analog-potentiometers-hardware>)可能会共享电源和地线引脚。

连接到模拟输入端口的大多数传感器将具有三根线——信号,电源和地线——精确地对应于模拟输入端口的三个引脚。它们应进行相应连接。

Hooking a ADXL193 single axis accelerometer to an analog input on the roboRIO.

将传感器连接到多个模拟输入端口

Some sensors may need to connect to multiple analog input ports in order to function. In general, these sensors will only ever require a single power and a single ground pin - only the signal pin of the additional port(s) will be needed. The image below is shows an analog accelerometer that requires three analog input ports, but similar wiring can be used for analog sensors requiring two analog input ports.

Hooking a triple axis accelerometer to three different analog input channels of the roboRIO.

脚注