Swarm Robot Project Documentation
The e-puck is a cylindrical robot from EPFL with a diameter of 70 mm and a height of 53 mm, with a stepper motor driven wheel mounted on each side of the body. The e-puck’s size was ideal for the project, and its stepper motor driven wheels offered consistency and accuracy—highly desirable features for motion planning and dead reckoning. In order to address the requirement for wireless communication, the original extension module on the e-puck which contained peripherals including a speaker, infrared receiver, and mode selection switch, was replaced by a custom-made extension module that held an XBee radio module which connected to the serial port of the microcontroller.
Information about the e-puck can be found at http://www.e-puck.org/
XBee Radio Configuration
The XBee radio has 20 input/output pins whose signals and functions can be found in section 1.5 in the user’s manual. The only pins that are of particular interest us are:
- Pin 1: 3.3V Power
- Pin 2 (output): UART Data Out
- Pin 3 (input): UART Data In
- Pin 10: Power Ground
- Pin 12 (output): CTS flow control
- Pin 16 (input): RTS flow control
The RTS and CTS signals are for flow control. When the RTS line is pulled low, the XBee module will hold any data waiting to be sent to the microcontroller in a buffer until the line is pulled high again. When the buffer is almost full, the XBee module will pull the CTS signal high.
Details about the XBee radio and its operation can be found in the user’s manual.
Two firmware options for the microcontroller are available from Digi. The first option implements a suite of networking capabilities including packets, checksums, addressing, and diagnostics; this implementation is specific to the XBee radios and not compatible with other wireless devices. The second option is a ZigBee protocol stack, which is a mesh networking standard for low data rate networks. Because routing and mesh networking capabilities were not needed for this project, the first option was used for simplicity.
The XBee module can be configured using the X-CTU terminal program from Digi, either by sending commands from the terminal or by using the configuration utility found under the “Modem Configuration” tab. For this project, each of the radios on the e-pucks were configured by typing the following commands into the terminal:
+++ atre atmy <ID> atap 2 atd6 1 atbd 7 atwr
where <ID> is an ID number used to differentiate the radios. The firmware on the e-puck requires that the IDs range from 0 to 31. In our case, the XBee radios on the robots were given ID numbers 1 through 8, and the base station radio was given an ID of 0.
Entering the +++ command into the terminal will make the radio enter command mode. The functions of the commands are described below:
|ATRE||Resets the radio parameters to their factory default.|
|ATMY <ID>||Sets the ID of the radio.|
|ATAP 2|| Enables mode 2 of the radio’s API to enable |
advanced features such as packets and addressing
|ATD6 1|| Enables the RTS flow control pin. If this pin is pulled low, |
the XBee will hold bytes to be transmitted to the microcontroller in its buffer.
|ATBD 7||Sets to baud rate to 115200 bps.|
|ATWR||Writes the new setting to non-volatile memory.|