This page outlines the design of a robot named Walt and his unique navigation system. We set out to build a robot that would navigate by triangulating its position based on signals coming from four infrared beacons. Two of these beacons also contain Grid Eye sensors. The Grid Eye sensors follow the movement of humans throughout an arena and transmit their position to Walt. Walt can then follow the person as they move throughout the area.

Table of Contents

Beacons

The purpose of the beacons was to provide a way for the robot to triangulate its current position at any time. We setup four infrared beacons, with one at each corner of the arena. Two of these beacons were equipped with Panasonic Grid Eye sensors.

Infrared Emitters

The infrared emitters were designed to operate the same way a remote control does. Each of the four emitters transmitted a signal modulated at 38 kHz. By modulating the signal the same way a remote control does, we were able to use ordinary digital remote control receivers. Each beacon emitted a different self-identifying bit pattern. This allowed us to distinguish each tower by pointing the receiver at it.

To create the modulated signal, we opted to use an Atmel ATTINY85 microcontrollers. We decided to use a microcontroller for this operation because of its simplicity and ease of altering the signal during testing. Below is the schematic used for each beacon and an example signal.

During testing, we found that the internal oscillator of the ATTiny85 was slightly inaccurate to create a completely steady 38 kHz signal. Although the receiver handled a wide tolerance, we decided to make it as steady as possible. We added the 8 MHz external oscillator and a smoothing capacitor at the voltage input of the microcontroller.

Schematic

The beacons were designed to run off either 3.3 volts or 5 volts. When switching between voltage sources, the resistor (R1) on L1 needs to be changed between 6.8 Ohm and 33 Ohm, respectfully.

Code

Output Signal

The following is tower three output.

Here is the same signal zoomed in showing the 38 kHz modulation.

Grid Eye

Two of the four infrared beacon towers each contain Grid Eye modules that are fine-tuned to recognize people. By utilizing two Grid Eyes, we are able to track the movements of humans and triangulate their position.

For this project we used a SAM4L to communicate with each of the Grid Eye modules. For this project, we wrote a fully functional Grid Eye library for the SAM4L using the Atmel Software Framework.

To detect people we analyzed each pixel of the incoming 8x8 pixel array coming from the Grid Eye. We threw out any outlier pixels which we defined as any pixel with high thermal activity without another high pixel directly beside it. This reduced the noise and allowed us to focus on high thermal 'blobs' which were humans in our case. After reducing noise and focusing on the human 'blobs,' we were able to calculate the center of thermal mass on the frame. With this, we found the horizontal position of the mass and converted it to an angle. The Grid Eye has a 70 degree viewing angle. If the human was on the left side of the frame we noted they were at -35 degrees and +35 degrees if they were on the right side. From these angles, we found the Tau and Phi angles shown in the figure below.

Finally, we were able to find (x,y) of the person's location in inches. The person's x and y values are sent to Walt via XBee communication.

Robot (Walt)

Walt was built using a PIC24FJ128GA010 micro controller on an Explorer16 demo board. He is encased in a plexiglass box, is driven by two parallax continuous rotation servo motors, and carries a compass and two infrared receivers to assist in his navigation. Here we outline each element of Walt and how they work.

Infrared Receivers

The infrared receivers work similarly to a TV or other electronic device that is controlled by a remote. The receiver takes in the infrared signal then demodulates and decodes the signal to determine what the signal is telling it. In this case the signal is merely a number 1-4 to tell the receiver which tower it is looking at. The receivers are mounted on Parallax servo motors allowing the receivers to pan around and look for the wanted infrared signals. Once a valid signal is found the receiver stays focused on this signal until it loses it. The schematic for the receiver circuit is shown below along with a BOM. The receivers chosen contain a band pass filter and a comparator all in the same package making the signal processing fairly simple. The signal was decoded using a finite state machine. A more detailed explanation of the infrared communication can be foundhere.

Servo Control

Once the infrared signals could be decoded another finite state machine (right figure) was developed to control the panning motion of the servos carrying the receivers. The resulting motion of the receivers is shown in the video on the left. The LEDs indicate when a signal is seen by the receiver and the color that it lights up as indicates which tower it is looking at. The receivers continually rotate back and forth always trying to keep the signal in sight. When the signal is lost the receiver reverses direction and tries to regain the signal.

When building Walt several issues arose with the signal clarity going to and the power being used by the servo motors. Excess noise on the breadboard caused the signal going to the motors to be distorted enough that the motors would not operate. To assist in this the power for the circuit was adjusted and the connections to the servo motors were spread out over the breadboard to reduce noise.

Servo motors often cause large spikes in the power lines of the circuit. To prevent this from affecting other parts of the system three DC/DC switching regulators were used. Eight AA batteries were used to supply voltage to the three regulators. Each of the three regulators then supplied power to a different part of the system. One regulator controlled the two continuous rotation servos that drive the robot, one controlled the two servo motors that carry the receivers, and the third regulator powered the micro controller, Xbee module, and infrared receivers. This eliminated the power spikes that occurred when powering the entire system off of one power source. The schematic and BOM for the power circuit are shown below.

Triangulation

To triangulate the position of Walt a compass was added to the system. An Atmel Sensors Xplained development board was used for this. The board includes a compass, gyroscope and accelerometer although all we used was the compass. I2C was used to connect to the compass and a simple algorithm was used to get a heading for Walt. The code used to take readings from the compass is attached below. Included in the source code is basic I2C read and write functions for the PIC24.

Once the angles alpha, beta, and gamma are found the coordinates of Walt can be calculated using trigonometry. Alpha can be found based on the heading read in from the compass and the general heading (North, East, South, or West) that Walt is facing. Since the infrared beacons are stationary we know the general heading based on which two towers we are looking at. Alpha is then calculated using equation (1).

Beta and Gamma are found based on the positions of the servo motors carrying the infrared receivers. Based on the two positions recorded when the servo motors are panning (see Servo Control) the position of the tower relative to the infrared receiver can be found. This is then used to find the angle of the servo motor (0-180 degrees). Once the angle of each servo is known beta and gamma can be found using (2) and (3).

The other two angles in the triangle can be found simply by knowing that all the angles in a triangle must add to 180 degrees. This gives us (4) and (5).

Now that all of the angles in the diagram are known the lengths x and y can be found using the law of sines. Using the diagram at right the Law of Sines can be written as:

By manipulating this we get (6) and (7).

After finding x and y we know every length and angle within the triangle formed by the two towers and Walt. With this information the distance formula can be used to solve for the coordinates of Walt. The distance formula gives us (8) and (9). By manipulating these two equations the values cx and cy can be found.

And viola! We now know the location of Walt.

PIC24 I2C Functions to read compass

BOM

XBee Communication

XBee RF transceivers make wireless communication a breeze. The Xbee Pro modules used need only four connections to work and are easy to configure. To configure the Xbees the procedure here was followed. Once the Xbees were configured UART was used to communicate between two of the towers and Walt. One of the towers transmitted its grid eye data to the main tower using the Xbee and the main tower then transmitted the location of the target to Walt.

Schematic

Walt

Once all of the elements of Walt were up and running they were combined to bring Walt to life. The figure shows what Walt looks liked with all of the elements connected together. The schematic and BOM for the final system are below as well.