It’s All About Command And Control
It is imperative that we incorporate a robust remote control capability into each of our robots or else, as history has shown, they will become our robotic overlords! If the engineers of Skynet, Colossus and HAL had considered remote control in their design these evil machines would never have been able to take over the local ship or the world. What a minute, those were just movies! (Never mind) Actually, the reason I built the Robot Remote Control Console (RRCC) is far less dramatic and a great deal more practical than what you saw on the big screen.
For telepresence robots remote control is central to their design. As for autonomous robots, remote control can be used to monitor, debug and provide occasional help when they get into trouble. Since I build both telepresence and autonomous robots I wanted a flexible remote control system that I could use with any of my current and future robots. To meet that goal I built the RRCC to be both fully programmable and easily expandable.
I designed the RRCC to be portable and easy to use while holding it or resting it on a table surface. It can be held with one hand but is generally used with both hands. The thumb on your right hand has access to a joystick and the numeric keyboard while the left hands thumb can move the other joystick. The functions of the joysticks and keyboard are implemented in the Propeller software and are dependent on the type of robot being controlled.
The RRCC sports two different displays. The simplest is a two line serial LCD from Parallax that is mounted on the left side of the RRCC and located under the left joystick. It is primarily used for robot and mode selection using a simple menu system. It is also used to display of short status messages. The primary display is a Mini 3 Â½ LCD TV Color Display mounted in the upper center of the RRCC. It was originally purchased from Parallax. Parallax has since replaced it with a larger 7-inch version. This display is driven by two video sources. The first is a Propeller Backpack (more on this later) and the second is a video receiver. The Backpack supplies text which can be layered over the live video feed received (via the video receiver) from the robots video camera. Both the text and live video display are optional depending on the capabilities of the robot.
PARALLAX PROPELLER CONTROLLER
As you may already know, most of my projects use the Parallax Propeller chip as the main controller. The RRCC is no exception.
The Propeller is actually eight individual microcontrollers called Cogs built into one chip. This means you can have up to eight separate operations running at the same time. For the RRCC this includes processing the user interface and communicating to the remote robot using radio (RF). Each of the Cogs has its own memory in addition to the main 32K of RAM which is shared by all eight. The Cogs can perform simultaneous tasks cooperatively or individually while sharing resources through a common hub. The Propeller also supports 32 input/output pins. With eight cogs and 32 I/O pins it is easy to expand the RRCC.
The Propeller can be programmed in a C like high level language called Spin or in Propeller Assembly. There is also an optional C compiler available for purchase if you are not interested in using Spin. Programs are downloaded into the Propeller using a USB connection and the Propeller integrated development environment (IDE). Spin or assembly code can be written and organized into objects. The code for an object is stored in a file and it is important to note that there is not necessarily a one to one correlation between objects and cogs. The code in an object can start multiple cogs thus creating as many parallel processes (threads) as it needs.
If you are from the Java, C++, or C# programming worlds you will note that the term object is used loosely and Spin does not really represent a true object oriented (OO) language. Crucial OO features such as inheritance and polymorphism are not supported by Spin objects. Instead its best to think of Spin objects as an organizational structure for related functions.
HELPFUL DEVICE DRIVER LIKE OBJECTS
Despite these limitations Spin objects do promote code reuse and Parallax provides a very comprehensive collection of device driver like objects. This collection includes objects supporting a wide variety of peripherals like a PS/2 keyboard, VGA and TV monitors, LCD displays, motor controllers, serial devices, as well as sensors like the Ping and accelerometers. Parallax has a community exchange site where Propeller users can share objects that they have created.
The Parallax Propeller Proto Board was used to simplify the use of the Propeller Chip. It contains all the support hardware needed for the Propeller. This includes power supply, EEPROM, 5 MHz crystal, and programming connector. All the Propeller I/O pins are easily accessible using this board. All the wiring was done using point to point soldered wiring.
THE PROPELLER BACKPACK
As mentioned before the primary LCD display is driven by a Propeller Backpack from Parallax. The Backpack is a Propellerbased module that is optimized for audio and video applications. Out of the box, and without programming, it serves as a video character display. Using a 3-wire extension cable, you can plug the Backpack into a standard 3-pin servo header and communicate using a simple serial protocol. The Mini 3 Â½ LCD TV Color Display is plugged into the Backpacks A/V connector and displays the characters sent by the RRCC in color, in selectable windows, and with selectable character sizes.
The Propeller Backpack is also a fully-capable Propeller development platform, which you can program with the above mentioned Propeller IDE. The Propeller Backpack can work with your own software or that from the Propeller Object Exchange (OBEX). The Propeller Backpack is also expandable using an onboard 12-pin socket that makes it compatible with Parallaxs line of plug-in daughter boards.
For the RRCC the Backpack was loaded with the optional TV Overlay Object which supports the display of text over a live video feed.
To send commands to a robot and receive telemetry data the RRCC uses one of two communications channels. This can be either an XBee RF module or a Parallax 912 MHz Transceiver. The XBee modules can be configured to communicate in one of two modes. The first is a simple serial method of transmit/receive and the second is an advanced framed mode. XBees can be configured through a PC utility or directly from the Propeller. These modules can communicate point to point, from one point to a PC, or in a mesh network.
Unfortunately Parallax is no longer selling the 912 MHz RF transceiver but I still have several robots that use it for remote communications. Unlike the XBee it only has one mode of serial communications preset to 9600 baud.
The RRCC uses both the XBee and the 912 MHz Transceiver in a simple serial mode using my own communications protocol. The protocol was designed to be easy to implement and also allow communications packets to be typed directly from a keyboard using any terminal emulator program like HyperTerminal or the Parallax Serial Terminal. All packets start with a three character header and end with an ASCII Return character. The first character of the header is always an Â¡Â§!Â¡Â¨ and the second character is the Network ID such as Â¡Â§RÂ¡Â¨ for robot. The third is the destination device (robot) ID. The special character Â¡Â§#Â¡Â¨ is used to specify a broadcast to all devices. Data following the three character header is device dependent. Here is an example for a Move Forward command sent to device ID 3 in the robot network:
Telemetry returned from a device is formatted in a similar manner but with the header starting with an asterisk, Â¡Â§*Â¡Â¨ instead. Although this protocol is certainly not as robust as others it has proven to be quite adequate for all my robot and electronics applications.
The robot can transmit a live video feed using a 2.4 GHz wireless color video camera available from Smarthome. This camera can transmit a standard video composite signal directly to a television or DVR up to 300 feet away. It also has a built-in IR illuminator which can see up to 45 feet in total darkness. The camera can be set to one of four channels.
The RRCC uses a matching four-channel SecurityMan 2.4 GHz video receiver also available from Smarthome. It is mounted along with its A/V cables in a lower enclosure that is bolted underneath the main enclosure. The video output is connected to the Backpack which in turn connects to the Mini 3 1/2Â¡Â¨ LCD TV Color Display.
Power for the RRCC is provided by two standard 3300mAh 7.2 volt NiMH batteries. One of the batteries provides power to all the electronics through a single SPST switch. The second battery is used to power the Mini 3 1/2- inch LCD TV Color Display and optionally, selected by a DPDT switch, the video receiver. If the robot under control does not support live video the display can be shut off to conserve battery power. Two 2.5mm jacks mounted on the back panel are used to connect the batteries to a standard NiMH Charger.
All user input into the RRCC is through the two analog joysticks and the 4×4 numeric keyboard. The joystick and the keyboard were obtained from Parallax. The joysticks consists of two 10K pots used to indicate the amount of movement along the X and Y axis. Using two capacitors, each joystick is connected directly to two of the PropellerÂ¡Â¦s I/O pins. This forms a simple RC circuit which the Propeller can read using a simple timing algorithm.
The keyboard has 16 keys which are configured in a 4 x 4 matrix. Using a dedicated Cog the Propeller continually scans the keyboard to determine which key has been pressed.
In addition to the two LCD displays the RRCC has a small vibration motor and a LED used to provide user feedback. The vibration and is used to confirm key presses as well as menu selections. The LED is used to indicate transmission of commands to the robot.
What makes the RRCC so powerful and flexible is its ability to be programmed to control a particular robot. Despite the assortment of robots that I have built most of them do conform to a common remote control configuration. Typically the right joystick is used to control the robots movement while the left joystick is used to control the pan and tilt of the video camera. The keyboard is used for speed selection as well as activating robot specific functions like docking and power control. Because all these common functions exist I have incorporated virtually all my robots into a single RRCC program. As I build new robots I simply add a new software routine that controls the unique features for that robot.
I hope my approach to remote robot control has been helpful to you as you consider your future robot applications. The source code and schematics for the RRCC can be downloaded from www.botmag.com /issue27.V
Parallax, www.parallax.com , (888) 512-1024
Smarthome, www.smarthome.com , (800) 762-7846
Steve Norris website, www.norrislabs.com
Words by Steve Norris