Robot Report

by Jason Morejon

on

Lemming-bot

EEL 5666C Intelligent Machines Design Laboratory

Instructors: Dr. A. Antonio Arroyo, Dr. Eric M. Schwartz

TAs: Adam Barnett, Kevin Claycomb

Table of Contents

Abstract 3

Executive Summary 3

Instroduction 3

Integrated System 4

Mobile Platform 4

Actuation 4

Sensors5

Behaviors 6

Experimental Layout and Results 7

Conclusion 8

Documentation 8

Appendices 8

Abstract

This robot will be able to produce a three dimensional topographic map of an enclosed area. It will be designed for indoor use, although the theory is applicable to the outdoors. It will be able to relay information to a computer wirelessly which will be able to draw the map. It will be able to avoid obstacles and map them, and construct a reasonably thorough map of the given boundaries. It will also be able to reassert its location using tape markings and photo transistors.

Executive Summary

This project is to produce a robot that proves the feasibility of this using these sensors to produce results. This will be done by having the robot travel in a given compass direction while avoiding obstacles. It will also measure distance traveled while doing this. This could be applied to making a map by merely recording directions and distances while traveling in either a given pattern or possibly randomly.

Introduction

Cartography is a basic problem that can be done simply, but is not always practical. In situations where a human does not fit, or is not hospitable, the use of a robot would be a boon. Cases where remote control may not be possible or practical suggest that automatic control would also be beneficial. The objectives of this project is to form a robot that will be able to form a topographic map of an enclosed area with some accuracy. The primary problems that must be overcome are determining how far the robot has moved, despite slipping, and orientation the robot is moving at. This paper will illustrate methods by which a system will allow somewhat accurate mapping.

Integrated System

The system will be primarily controlled by the robot. The map will be constructed on the computer using distance traveled between points and three dimensional orientation which will be determined by the robot. Movement will be primarily controlled by the robot, but there may be some basic control added on the computer, such as to travel to a given point or reset. This could be used to fill in any gaps in the map that may be left by the AI. The robot should be able to use the accelerometers and sonar to minimize errors due to slipping of the wheels. Weighting between distance measurement from motor encoders versus other sensors will be experimented with to determine what provides the most accuracy.

Methods of pathing that will be used to map the area are also to be experimented with.

Mobile Platform

The robot platform will be circular and constructed out of wood. It does not have extensive requirements as the robot is not expected to operate at high speed or perform lifting. The motors being the largest device on the robot will be the size constraint, making the diameter at that point about a foot. The accelerometer will be placed on the edge of the circle to maximize any rotational acceleration. The sonar will be placed on top of the robot to attempt to avoid interference by the ground. The phototransistors will be attached to the bottom front of the robot and spread out, so as to serve both finding the starting location and deter falling off an edge. The compass is raised above the main frame of the robot to prevent the fields produced by the other circuitry and motors from interfering with it.

Actuation

The robot will be driven by two motors on two of the three wheels on the robot. These motors are Maxon 6 watt with 24 volts nominal. It will likely be run at a lower voltage to reduce the speed of the robot. Their maximum continuous torque is 12.5mNm, the nominal speed is 2360 rpm, and the maximum efficiency is 70%. The gearbox operates with a 6:1 ratio. The robot will act on a differential drive system to allow turning with minimum displacement1. Although there will be some slippage which will affect the robot, it should be minimized with the help of the sensors. The wheels have been ordered and are 2.13” diameter and 1.5” width, but have not yet arrived. Specification sheets can be found on Maxon's website2 under motor number 2140-937-58-236-050 with gear head number 110451.

Sensors

The first type of sensor will be sonar. The sonar used is the MaxSonar-EZ1 Ultrasonic Range Finder. This was item #TS-040-000 and can be found at their website3. This sensor operates on a 5V source consuming 2mA. It has a range of up to 20ft and operates at 42KHz, reading at up to 20Hz. Five were ordered however the robot is only expected to use three or four. These were tested with a oscilloscope and were shown to work at a foot and the distance to the ceiling. Further testing while on the robot demonstrates that although it does effectively determine the presence of an obstacle, a small size or unaligned target surface can skew the results.

The second sensor is that of a accelerometer. The specific sensor used is the triple axis accelerometer from Spark Fun Electronics. The chip is the MMA7260Q while the part ordered comes with a breakout board and specification sheets are on their website4. This will be used to calculate inclinations so the map can be three dimensional and attempt to measure turning. This sensor can accurately calculate the tilt of the robot, which when extended to the path the robot takes, provides relative elevations. It can be used with the motors to attempt to form an accurate determination of distance for mapping. It will be configured to measure up to 1.5g of acceleration and sustain up to 1000g without damage. The output is from 0 to 2.4V with 800mV/g in this configuration.

The third sensor is the compass, which can be used to determine the directional orientation of the robot. This is also from Spark Fun Electronics with respective data sheets5. The compass has a 0.5 degree resolution, 1 degree repeatability, and a 2.5 degree accuracy. It operates on the I2C protocol. It is used in a constant running mode where it continuously takes measurements, averages them, and then when sent the proper code transmits the reading in two bytes as ten times the degree measurement in ASCII. It is also specified to be suitable to be operated in an environment with strong magnetic fields. Despite this, it was still necessary to mount it at a distance from the other electronics on the robot. When close, turning the robot did not affect the reading while turning the compass did. Hence the fields produced were drowning the natural magnetic field. However, mounting it a few inches away from the rest of the robot resolved this allowing it to produce accurate readings.

The fourth sensor is a phototransistor. This can be used in establishing a starting point and alignment. These are also from Spark Fun Electronics with their own data sheets6. It may also be used to prevent the robot from running off a precipice. The optimum distance for this is to detect the floor is 20-30mils.

The fifth sensor is feedback on the motors to provide a measurement of their movement. It provides pulses acting as counts, and is specified as 100 counts per turn, with two channels. The encoder specifications can be found on Maxon's website2, under encoder number 103935. This is measured using the signals measured as external clocks. Setting the overflow at 100, an interrupt occurs approximately 5 times per revolution. This test was run by hand turning the wheels at various speeds, and at all speeds on both wheels the results were the same.

The source code for operating the phototransistors, accelerometer, and sonars are all in the SensorSweep function in the source code in the appendices, along with the initialize function. These are all approximately the same as they all are read with the AD converter. The compass is also in the SensorSweep function at the end and uses functions made to use the TWI for I2C communications. The motor encoders are read as external clocks, thus their source code is on interrupts as well as configuration in the InitTimers function.

Behaviors

For behaviors there will be a series that will need to be performed. First, obstacle avoidance must be accomplished so the robot does not crash. Second, the robot must trace the boundaries of the obstacle to provide its description on the map. Lastly, the robot must have some way of judging or correcting its orientation.

The overall operations of the robot consist of initialization then flows in a control loop. Each pass in this loop it first tests the sonars for obstacles. If there are none then it turns towards the compass direction it was initialized to. For obstacles it first tests if there is anything in front, and if so does a sharp turn with one wheel going forward and the other in reverse. If surrounded on the front and sides, it travels in reverse. If there is no obstacle in front of it, it veers to the side with one motor turning faster than the other. If it is turning to meet the compass, one wheel turns forward while the other doesn't move for a gradual turn that isn't too sharp. This also allows you to visually differentiate which behavior the robot is doing. The last behavior the robot does is if there is an obstacle further away than the normal threshold on the front sonar, but still near, the robot slows down. This is to help prevent the robot from crashing into something because it can't slow down fast enough. During this all, about four times a second, on a clock interrupt, the motor values are shifted towards the settings of the current behavior.

The first difficulty was the compass getting swamped by the fields from the other electronics. The second was the response rate of the motors. Originally the motor adjustment was also in the control loop, but it did not trigger often enough. The solution was to move it to the interrupt. The last problem was the sonars not picking up small obstacles along the wall. These would then clip the robot as it moved forward. The solution was to add the behavior so if the wall is too close to the side sensor the robot veers away from the wall.

Experimental Layout and Results

A simple test was performed to determine the repeatability and effectiveness of the accelerometers and the data from this is showed in Figure 1. It is notable that the variance in the 45º/45º measurement is due to the inability to hold it steady and that it was only positioned by eyesight thus was not at precisely the desired angle to be read. This was to ensure that they didn't interfere with one another, which it successfully demonstrates. As the data demonstrates the readings were fairly consistent and all three in the unit functioned properly.

Figure 1

The other tests on sensors were not number specific. The sonar tests were inconsistent between different objects, but held steady for each individual object. The essential test of the sonar was using it for obstacle avoidance. After reaction times were corrected, it was decided to use a reading of eight for the distance for a close obstacle, which on an ideal read is two feet. This allowed sufficient time for the robot to react without hitting the obstacle. A value of three times this was used to define the distance where the robot slows down, to allow more reaction time if and when it reaches the obstacle.

Conclusion

While the robot does work as intended there are drawbacks. First, the sonar doesn't operate well at close distances. This could possibly be remedied by using more sonars or using a different brand. The result of this is that it would not provide a very precise map on a small scale. However, you could still use the principles to make a larger scale map, where the precision is sufficient. This would also make it difficult to climb something sloped like a ramp, as it may appear as a solid object resulting in the robot avoiding it before reaching the slope. However, despite these shortcomings, the fundamentals are solid. Thus, it supports that the abstract goal is certainly possible, if perhaps needing minor modifications.

Documentation

1. Joseph L. Jones, Anita M. Flynn, Bruce A. Seiger, Mobile Robots. Second Edition. A K Peters, Ltd, 1999.

2. Maxon Motor website.

3. Sonar data sheets..

4. Accelerometer data sheets..

5. Compass data sheets.

6. Photo transistor data sheets.

Appendices

Source code attached to seek a compass direction, avoid obstacles, and periodically stop for 15 seconds.

1