Project 5 - Search and Rescue

This final project truly was the big kahuna. It would combine everything we had learned in class and in the previous assignments into one ultimate mission. We were to design a robot capable of navigating the grid used in project 4 with the same initial handicaps: the robot would have no prior knowledge of the arena layout, and it would have to create a map and update it with a wireless host as the arena was explored. Instead of searching for a "fire" as with the previous assignment, this time the robot had to locate a known amount of "victims" who were trapped inside of the warehouse. Upon finding the victims, the robot would need to communicate with them by emitting a 1kHz tone and wait for a response. A 750Hz answer meant they were OK, a 3.5kHz tone meant the were hurt, and no response signified unconsciousness (project 3). Each victim could then be removed from the arena for extra credit. This was the purpose of creating a robot capable of lifting a can in project 4. The really difficult part of all of this is that victims could be placed anywhere, and there would be various random obstacles representing fallen debris also present throughout the warehouse. To complete this assignment, two additional robots were designed and built with very different abilities resulting in a coordinated search and rescue mission.

Project Requirements

Our robot had a lot of goals to meet in this assignment including a slightly modified version of those in previous projects.

  1. Remove barrier in front of warehouse.
  2. Navigate through an unknown area, avoiding various obstacles.
  3. Create a map and transmit it to a wireless host with periodic updates.
  4. Search for "victims."
  5. Communicate with victims (speak and listen).
  6. Report status of victims to wireless host.
  7. Remove victims from warehouse (optional, extra credit).
  8. Explore every room of warehouse and exit.
  9. Climb a 20 degree incline.
  10. Complete mission within 10 minutes.

The bad part about it all is that a lot of the previous code had to be rewritten because it was never intended to be used all at once. This means that we basically had to start over.

Mechanical Design

Because there was so much to this project, we decided to build two separately functioning robots that could work together to complete all of the goals. One would have the primary function of searching for victims and checking their status while the second had the ability to remove them from the arena and climb the ramp to see if any were up there. The smaller and more agile robot is named Optimus Prime, and the larger, stronger robot is called Megatron.

Optimus Prime

This is really the more important of the two robots as it has to job of actually finding the victims and generating a map. The priorities of this robot are speed and mobility rather than strength. As usual, as few of parts are used to construct a functional and aesthetically appealing body. Continuous servo motors were used in a differential drive configuration. Another servo was placed in the front of the robot to serve as a turret for panning the sensors and camera. Rear omni-wheels were once again incorporated for better navigation. Also, a rear bumper system consisting of spring loaded switches and wheels was placed on the back in such a way that the robot could easily align itself with a wall by backing into it. The wheels allow the robot to move up against the wall without ripping loose any of the sensors. Finally, a bracket is placed on top of the robot to hold the communication circuitry.

This robot seemed to be performing very well at first, but it was noticed that the front wheel tended to slip when they first turned. This was huge problem considering our robot needed to know somewhat exactly how far it was traveling. Wheel slippage would result in inaccurate results so my team built a weight box for the front of the robot to give it more traction.

If it had been me, I would have just moved the XBC further forward, but I was not there when this was done. Also, since the weight appeared to be helping, I decided not to mess with it.


The creation of this robot was done for fun just as much as anything. This robot had two main functions: climb the ramp and carry a victim. Climbing the ramp was tacked first. A set of thick, sticky sumo tires were found in the lab and screwed to Lego gears to be used for increased traction. A gear reduction of 7.5 to 1 was applied to each drive wheel and a frame was built around it. This first robot, named "Blue" because of the color scheme, was tested successfully on the ramp.

Although this robot proved to have ample strength in its initial state, a lot of trouble was encountered while trying to create a claw capable of grabbing and moving the victims. adding weight to the front of the robot would cause to tilt forward and rock back and forth. This was not good, and entire new robot was designed. This time, a four wheel drive drive train was built around the sumo tires with a single motor driving each side pair of wheels. The gear boxes created in the first version robot were duplicated such that the robot had four identical sets.

The main problem with this arrangement is turning. The lack of any sort of castor wheels combined with four very thick and sticky tires made rotation almost impossible for the robot. To correct this, a kickstand was created and placed in the rear of the robot so that if the robot needs to do a standing rotation, it will first lower the kickstand to raise the back in off of the ground. This apparatus would have been powered by a servo, but it was not strong enough on its own, and there was not enough room to create a gear box around it. So a standard Lego motor was used because of the ease of creating a gear box for it.

The two sides of the robot were connected in such a way that it would be easy to separate it in case any other changes needed to be made and a front claw was created. Rather than making a simple front claw consisting of two swing arms as was done in project 4, an entire arm was placed on top of the robot. This arm would rest on top of the robot to allow full use of the front sensors at all times. When it was time to be used, the arm would swing down into position. Two servos were used to power the arm with a 5:1 gear ratio on each. Another servo is used to rotate the the gripper and a final servo opens and closes the end effector. This arm proves to be more then capable of picking up any victims.

Electrical Design

Once the robots were built, it was time to add some intelligence. Both robots uses quite a few sensors, but Optimus also has an intricate communication circuit on board.

Optimus Prime

This guy uses a lot of sensors. Each side held two IR "ET" sensors, and the back incorporated two spring action switches used for allignment. The front of the robot held a camera, ET, and sonar as well as light sensors, lights, a speaker, and a microphone. All of these electronics were placed on the aforementioned servo turret to allow panning.

The circuit used in project 3 was redesigned with new functionality, namely, a 750Hz tone decoder and a 1kHz tone generator. At first, the XBC itself was used to create this tone with an amplified speaker attached to the headphone jack, but the tone was not very pure and seemed to contain a static associated with ground loops. A 555 timer circuit was instead used to create the 1kHz waveform used. This is the completed block diagram.

Because the creation of the 3.5kHz tone decoder was described in detail in the project 3 page, it will not really be discussed here. The same equations were used to create a 740Hz tone decoder as were used for the 3.5kHz one.

The outputs of the filters were directed into two LM567 tone decoders, and a potentiometer across the timing resistor nodes so that the correct tone(s) to be decoded could be precisely keyed in using test tone generators in the lab. The outputs of the decoders illuminate an LED to give a visual cue of the victims' responses before being fed into the digital inputs of the XBC. This method was used instead of the one used in project 3 because the robot only cares what tone is being emitted, not how loud it is.

The next stage to be designed is the 555 timer circuit. The values for RA, RB, and C1 were chosen to satisfy Equation 1 in generating a period of 1 / 1000Hz. This circuit and the resulting simulated waveform are shown.

The complete circuit was built and attached to the top of the robot. The power for the circuit was supplied directly by the XBC instead of using an external battery pack.


Because this guy doesn't have to talk to any of the victims, he only needs sensors to keep himself from running into anything. Two "ET" distance sensors are used on either side as with Optimus, and two small push buttons are in place on the back of the robot to allow wall alignment. A camera is also placed on the front of Megatron for visibility and an "ET" is used on the front for object distance detection. An "ET" is also placed at the rear of the robot. Two light sensors are attached to the bottom tn ensure he does not drive off of the ramp. They will trigger if he crosses the white line down the center of the ramp of if they go over the edge.

The most unusual sensor used on Megatron is a break beam sensor acting as an encoder for the kick stand. As the robot rotates, the Lego wheel turns and the break beam sensor is triggered by each of the holes in the frame of the wheel. This allows for very accurate rotations as it was not feasible to use the "motor ticks" method from project 2 alone because of the sumo tires.


The plan was to have Megatron clear the entryway by using his claw to wedge between the cans, open it wide, and pull them all out of the way. Optimus would then enter the warehouse and begin to search for victims using a similar left hand turning rule as was used in project 4, all the way avoiding obstacles and generating a map.

Megatron would then enter and go straight down the hallway, looking for the ramp to climb. Once there, he would climb the ramp to look for any victims up there. If any were found, he could carry them back down to be questioned for their health status by Optimus. As Optimus found victims and communicated with them, he would update the host and Megatron with their coordinates in the warehouse as well as their condition. Megatron could then go to retrieve the victims, removing them from the warehouse. Once every room had been searched and every victim had been removed, both robots would exit the warehouse, and our group would be praised by the class and instructors on what an awesome job we did. That was the plan anyway... robots can sometimes seem to have a mind of their own.


Had we just paid attention to motto of the creators of the XBC (KISS - Keep it Simple, Stupid) we might have done a little bit better in this final project. Although everything worked pretty well individually, combing it all into one super functioning robot did not prove that effective. Optimus had to move much slower than anticipated, and as a result, was barely able to search each area before the time ran out. Although each victim was found and questioned, Megatron never actually figured out how to get to them for removal. Part of the problem was a mechanical issue encountered a few days before the demonstration. One of the gear boxes failed in Megatron, and an entire new one had to be created. After this, he was never quite as strong, nor could he drive in a straight line. That meant he was constantly stopping to realign himself with the walls and barely made it up the ramp.

Even though the only goal not completed was the removal of the victims, that was the part we had planned the most on - primarily for the glory aspects of doing so. In the end, we learned a valuable lesson that with increased functionality comes increased complexity. When designing robots, it is more important that they do one thing perfectly than 10 things once in a while.

The warehouse layout used in projects 4 and 5 - again, unknown to the robot.

A "victim" and typical obstacle to be avoided.

Using wheels attached to a spring switch as the back bumpers worked incredibly well and looked nice.

Trans-wheels are used instead of rear castors.

The front weight box is rather unsightly, but it serves its purpose.

The XBC placing was tricky to allow the robot to keep its balance while climbing.

The drive train was first designed and the rest of the robot was built after.

The rear kickstand lifted the back wheels off of the ground, allowing rotation.

There are minimal pieces connecting the two sides of the robot together.

This arm has some oompf.

Weather stripping works great to add some grip.

All of the front sensors can pan thanks to the servo.

The amplifier and filter stages simulate very well.

T = 2RB*C*ln(2)
Equation 1

f = 1 / T
Equation 2

The circuit is attached.

ET Sensors are great for wall following.

The kickstand encoder made for perfect rotation.

An example layout of the warehouse. The entrance was completely blocked and many more obstacles and victims were used.

Megatron and Optimus taking a much deserved break after the demo.