Robotics/Computer Control/The Interface/Computers
Personal computers (PC) have a large number of ports to which you could add your own hardware to control your robot. Some of these are very easy to use, while others are nearly impossible without special (expensive) ICs. Not all of these interfaces are available on all computers. This section gives an overview of some of the best known ports on a PC. These ports and their uses are well document all over the internet.
These are all the ports that are available on the outside of a PC. Most computer users are familiar with them (or at least know them by name and looks).
The serial port is one of the two easiest to use ports on a PC. This port consist of 2 wires to transfer your data (one for each direction) and a number of signal wires. This port is reasonably sturdy, and if you know some digital electronics or use a microcontroller, is pretty easy to use too. It is limited on speed and can only connect two devices directly. By using special ICs you can connect the serial port to a RS-485 network and connect it to multiple devices.
- Serial Programming/RS-232
- This site contains a lot information on serial ports (among others).
The parallel port is the second of the easiest to use ports on a PC. This port uses 8 lines to transfer data and has several signal lines. Modern parallel ports can send and receive data. This port is easier to use, but less sturdy than the serial port. Since it operates on TTL voltage levels (0 and 5V) it can connect directly to microcontrollers and TTL logic.
This page covers parallel ports and the differend modes of operation.
USB is the successor of the serial port. It's faster and allows connecting devices without turning off the PC. Some modern microcontrollers have built in USB support.
- Everything you'd need to know about USB.
- Serial Programming:USB Technical Manual
- Embedded Systems/Particular Microprocessors#USB interface
IEEE 1394: Firewire, i.link, LynxEdit
IEEE 1394 also known as FireWire, i.link or lynx is a (much) faster port, similar to the USB port. It reaches speeds up to 400Mbit/s.
- The Connector
- Article about IEEE 1394.
- Linux FireWire wiki
Keyboards use TTL level signals to transfer button presses and releases to the PC. A keyboard sends a code when a button is pressed and sends another one when the button is released. This port could be used for some purposes.
See this site for a in depth explanation and example of how to interface the keyboard. (menu: miscellaneous -> interfacing the AT keyboard) Covers both how to replace the keyboard as how to use the keyboard for other purposes.
Ethernet can be used to connect other devices to a PC. Complete webserver-on-a-chip are available these days, and an ethernet network can be a way to connect multiple devices in a robot (and even hook it up to the internet and let people control the robot from all over the world).
These are the connectors inside the PC, generally these are used with special PCBs (called cards). Although harder to use, they offer great speed.
ISA was the (8-, later 16-bit) bus where you plugged your video, sound, IDE and network card in the old days. You'll find these on PC up to (some) early Pentium II (the latter usually has only 1 E-ISA socket, if any). This bus is pretty easy to use for your own projects and well documented on the internet.
ISA bus connector More indepth explanation of the ISA bus
PCI is the successor of the ISA bus. It's a faster 32bit bus. Since it support plug and play, a PCI device needs a few registers which identify the component and manufacturer. This page covers most of the basics of the PCI bus.
The Accelerated Graphics Port is aimed at 3D graphic cards. It's a fast bus, but optimized for graphics.
PCI Express replaces both PCI and AGP. It's quite different from all the other busses, as it uses serial communication, rather than parallel. Its speed depend on the number of "lanes" (serial connections) used PCI Express support 1, 2, 4, 8 and 16 lanes.
These are "ports" too as they can be used to connect other devices to the PC.
IRDA is an infrared communication port. Modern versions reach speeds up to 4Mbit/s. IRDA may be a good alternative to wires for table top robots. Since it's an Infrared port it needs a line of sight to work reliable and its range is limited to 1m. Note that this port works at a much higher speed than remote controls and therefor standard remote control repeaters may not work reliable for IRDA.
This site covers the basics of IRDA.
Here is a pinout of the mainboard IRDA connector.
WiFi / WLAN / 802.11 / Wireless EthernetEdit
All the names in the headline are synonyms for the same technology. WLANs are commonly used in PCs (especially laptops) as data networks. The bandwidth available is in the order of several megabits per second or more, far more than normally is necessary in any robotics project. A WLAN typically reaches about 100m, but with special directional antennas far more is possible (in a specific direction).
A WLAN is the obvious choice if your robot has an inbuilt PC or perhaps even PDA for control. Also, when you have ethernet connectivity in your controller (reasonably low cost but not a standard feature except in certain kits), there are low cost (~€50) WLAN bridges available, such as the D-Link DWL-810+ and DWL-G810.
If you only have a serial port available, a wireless device server could be used. The cost of one of them is, however, over €100.
Bluetooth is a low bandwidth protocol most commonly found in cellular phones. It is increasingly being deployed in laptops, and there are separate USB "sticks" available as well. Bluetooth can be used for making a serial connection wireless - there are Bluetooth serial ports available on the market, which can be used as converters. Total bandwidth in the system is about a megabit per second, with range up to about ten meters (standard Bluetooth, 2.5 mW), or about hundred meters (industrial Bluetooth, 100 mW). There are limitations on scaling with Bluetooth - it is mostly deployed in 1:1 links even though the standard includes networks with up to 8 active nodes (and even more passive ones). This means that if you plan on building large numbers of robots with a common communication network, Bluetooth might be less well suited.
ZigBee is a protocol stack based on the 802.15.4 wireless network communication standard. It is low-cost, low-power and all-in-all perfectly suited for low-bandwidth communication needs. The bandwidth is on the order of tens to hundreds kilobits per second, and the range is up to about a kilometer, depending on equipment.
Interesting solutions are XBee from Maxstream, which basically provide a wireless serial link. There also is a list of other vendors at w:ZigBee.
A possibility is to use standard cellular networks (mobile phones). It is only a viable solution for large-scale geostationary outdoor applications with low communication needs though, because of cost, latency and bandwidth limitations.
Radio modems are normally older proprietary solutions for wireless linking of serial ports. Proprietary solutions probably shouldn't be considered for new designs.
Using a PC or laptop in a robotEdit
PCs have the benefit of abundance of memory, program space and processing power. Additionally they provide the best debug I/O (screen, keyboard and mouse) you could wish for. But they do have a few flaws that limit their usefulness in a mobile robot.
- First of all their size. Even the smallest PC, a laptop, is quite bulky and forces you to use a rather large frame.
- Secondly, except for a laptop, power consumption is large and provide AC-power on a mobile unit is bulky as you need heavy batteries and an inverter.
- Lastly Pcs are lousy when it comes to getting a reliable accurate timing from the outside world.
The first two points basically shape most of your robot's frame and other than using a different controller not much you can do about it. Picking the best hardware you can find is pretty much all that can make these points a little less troublesome.
The last point is quite easy to get around. Most PCs have a serial port. Most microcontrollers have a serial port as well. Use a level converter to connect the TTL level serial port of the microcontroller with the RS232 level computer serial port and use a little program that handles the accurate timing in the microcontroller and transfers this information to the computer through the serial connection. This is a very powerful setup that combines the strengths of both the PC and the microcontroller.
See this site for example interfacing hardware for the serial port. Covers an I/O module and RS232 to TTL level converter for use with robotics or microcontroller based projects.
Some microcontrollers provide USB or Ethernet ports, which can be used in pretty much the same way, although the software would be a bit harder to implement.