USB Serial Port Adapters

From MobileRobots Research and Academic Customer Support

Jump to: navigation, search

A USB-serial adapter allows a computer to communicate over an RS-232 serial connection through its USB port, and can be used to connect a laptop or other computer to the robot’s HOST or SERIAL port for control by ARIA or other software, or for firmware configuration and updates , or to another device that uses RS-232 serial communication. (see your robot’s manual for location of serial port)

Note that some USB devices can be unreliable or include a lot of latency in transmitting data, try another cable or adjust driver settings if you encounter problems.

Note: The robot uses an RS-232 serial interface, so your USB adapter must be a USB-RS232 serial adapter; an adapter for TTL serial only will not work.

Warning: Using an unreliable cable to apply an ARCOS or other firmware upgrade to a robot may corrupt the firmware. Test the cable using ARCOScf and ARIA demo first. Using a plain serial cable with a desktop or other computer equipped with a standard serial (COM) port, rather than a USB-serial cable, is recommended for applying firmware to the robot controller.

Contents

ACT0160 USB-Serial Cable available from MobileRobots

A USB-serial adapter cable is available from Adept MobileRobots (Part number ACT0160). This cable has been tested by MobileRobots and is recommended. This converter uses an FTDI US232R chipset. Drivers are available for Windows at http://www.ftdichip.com/FTDrivers.htm, and this device is supported automatically by the standard Linux `ftdi_sio` driver.


Use on Windows

On Windows, USB-serial devices are accessed via new COM ports created by Windows when the device is attached. The COM port name will be shown in the “Ports (COM & LPT)” section of the Device Manager, which can be opened from the System control panel, and also listed in the output of the mode command (see List Available Serial Ports (COM Ports)). It may also be shown as a temporary tooltip in the taskbar when the device is attached.

Important Note: By default, on Windows a latency timer of 16 ms is set. For proper performance of the USB-serial connection, this must be changed to 4 ms. To change the latency timer (and other settings), double-click the USB Serial Port entry in the “Ports (COM & LPT)” section of the Device Manager; select Port Settings; click Advanced…; and change the Latency Timer in the “BM Options” section.

Image:USB-Serial_Windows_Set_Latency_Timer_(Small).png‎

It is also recommended that you disable "Serial Enumerator" (uncheck box) and disable "Modem Ctrl At Startup" (check box) to prevent Windows from automatically reading/writing from/to the serial device at startup or attempting to autodetect the device as a serial mouse.

The COM port number can also be changed here.

Detailed descriptions of the FTDI driver settings is available at http://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf.

The USB-serial device name can be provided to ARIA programs or ARCOScf via the -robotPort command-line parameter. For example, if the USB-serial device is `COM4`:

  cd "C:\Program Files\MobileRobots\Aria\bin"
  demo.exe -robotPort COM4

This command line parameter can be automatically set for all ARIA programs by storing it in the an `ARIAARGS` environment variable (environment variables can be set by clicking “Advanced system settings” in the System control panel, then clicking the “Environment Variables…” button.

Note that prior to ARIA 2.8.1, COM ports 10 and higher were incorrectly specified internally by ARIA. This has been fixed in ARIA 2.8.1.

Use on Linux

On Linux, USB-serial devices are accessed via devices in /dev prefixed with ttyUSB. For example, the first USB-serial device will be named /dev/ttyUSB0, the second will be named /dev/ttyUSB1, etc.

When a USB-serial device is attached, the Linux kernel indicates the device name in the diagnostic log. Use the dmesg command to print this log.

The device interfaces in /dev are automatically created when the device is added, and will be accessible only to root or users in the dialout group. You can add your user account to the dialout group using the usermod command:

  sudo usermod -a -G dialout yourusername

Or, configure udev to use different permissions and groups for the devices. For more on configuring udev, see Linux udev USB Device Permissions Configuration.

The USB-serial device name can be provided to ARIA programs or ARCOScf via the -robotPort command-line parameter (or use -rp abbreviation). For example, if the USB-serial device is /dev/ttyUSB0:

  /usr/local/Aria/examples/demo -robotPort /dev/ttyUSB0

This command line parameter can be automatically set for all ARIA programs by storing it in the /etc/Aria.args file, or an ARIAARGS environment variable (which can be set for each new command shell in .bashrc or .bash_aliases in your home directory)

Symptoms of Communications Errors in ARIA

If there are data transmission problems with the robot, ARIA will print warnings similar to:

ArRobotPacketReceiver::receivePacket: bad packet, bad checksum

If there are data transmission problems with the SICK laser, ARIA will print warnings similar to:

ArSickPacketReceiver::receivePacket: bad packet, bad checksum
ArSickPacketReceiver::receivePacket: wrong address (0x9 instead of 0x80)

or

ArLMS2xxPacketReceiver::receivePacket: bad packet, bad checksum
ArLMS2xxPacketReceiver::receivePacket: wrong address (0x9 instead of 0x80)

You may also receive similar errors if there is an IRQ conflict -- see Serial Port Configuration.

Personal tools