circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

April 2004, Issue 165

Mini Rover 7
Electronic Compassing fo Mobile Robotics


by Joseph Miller

V2Xe IN THE MINI ROVER 7

The Mini Rover 7 depicted in Photo 1 is a working scale model of the NASA/JPL Rocky 7 Mars rover. It incorporates six drive motors, and it has a rocker-bogey suspension as well as a zero turn radius steering system that’s capable of rotating the rover in place. The robot contains a Maxstream 900-MHz wireless modem for receiving commands and transmitting data to and from a terminal program on a host PC, which has a matching wireless modem.

Photo 1—No, it isn’t the Spirit rover you’ve seen on the news; it’s my Mini Rover 7 robot

The Mini Rover 7 also sports a C8051F330 microcontroller that’s mounted on a CStamp, which is a Basic Stamp II socket-compatible module. It contains two regulators and a JTAG programming/debugger port connector. I used the free integrated development environment and evaluation C compiler supplied by Silicon Laboratories along with its EC2 serial-to-JTAG adapter. The wiring diagram for the robot is shown in Figure 6.

(Click on image to enlarge)

Figure 6—Because I like to make my robots as expandable and serviceable as possible, most subsystems are modularized and plug into the main board using connectors.

 

Photo 2 shows the placement of the compass in the Mini Rover 7. What is not clear from this photo is that I raised the compass to distance it from the motors and current-carrying wires in an effort to reduce distortion. Additionally, the wires are twisted in complimentary pairs to alternate the magnetic field direction and to minimize the distance of the radiated field generated by current flow; this effectively reduces offsets to the measured field.

Photo 2—I thought you’d like a look inside the Mini Rover 7’s enclosure.

The end result is illustrated by the red trace in Figure 5, which shows that the robot’s magnetic signature has only a small hard iron offset. The compass can easily compensate for this simple offset mathematically after a calibration is performed.

To explore the compass’s performance in various environments, I wrote a simple program to perform basic moves and transmit the robot’s heading, as well as the measured field magnitude and raw sensor values. You may download the code from the Circuit Cellar ftp site.

The wireless modem that links the Mini Rover 7 to a remote terminal enables you to use the keyboard on the remote terminal to send the Mini Rover 7 commands for maneuvering and to select the type of data you want the robot to report. For instance, sending a "c" to the robot tells it to begin calibrating of the V2Xe compass. An "s" stops the calibration process and any movements. Sending an "h" tells it to include only heading data in its periodic data transmissions.

You can command the robot to rotate in a circle ("r" or "l"). It also can send raw sensor data ("b") in its datastream, which I was able to cut from a terminal program receive buffer window and paste into a spreadsheet program to create the x-y magnetic signature plots shown in Figure 5.

Another good test is to command the robot to move forward in a straight line. You can then observe the heading and magnitude values for irregularities. For this test, I commanded the Mini Rover 7 to travel down a hall in my house and into the living room. Along the way, the robot passed the kitchen. As it passed the backside of the refrigerator, the heading reported by the compass drifted. The magnitude was simultaneously changing, therefore signifying a magnetic field anomaly.

Figure 7 is a graph of the distance the robot traveled versus the heading and magnitude. Notice that the field magnitude is a good indicator of magnetic anomalies, which can be used to determine the quality of the compass heading information.

Figure 7—Here you have the robot’s distance from the origin versus heading and magnitude during a straight-line test with a soft iron distortion effect near the 125² mark.

I performed an outdoor test that proved more successful than the indoor test. The outdoor environment didn’t reveal any of the magnetic disturbances that I had observed indoors because I didn’t encounter manmade iron objects.

THE NEXT MOVE

The program listing posted on the Circuit Cellar ftp site also contains a PID-based steering control system that keeps the robot on a steady course—if it doesn’t encounter magnetic anomalies. The next step for this project is to add two wheel encoders to create a differential odometer. I plan to experiment with this data along with compass heading and magnitude information in a weighted averaging algorithm to increase heading accuracies.