Locomotion:Exercise3-Homing
Contents |
Overview
This exercise involves using the Create robot and two photoresistors to move toward a light beacon. The setup is similar to the Exercise2-Path Following, however the photoresistors are oriented parrallel to the plane of motion.
Setup
We assume that you have completed Exercise 2-Path Following, and are therefore familiar with the photoresistors. If you haven't worked through Exercise 2, and would like to jump into this exercise, then please read through the setup in Exercise 2 first.
Instead of orienting the photoresistors vertically on the robot's edge, you should mount them on top of the robot facing forward with a fair bit of distance between the two. This is not an exact science, however you should consider that the robot must be able to detect the direction of the light source. Placing the photoresistors close together will cause them to see the same light, and therefore limit the accuracy. Below is a picture of an example setup.
The final setup step is to create a dark room in which to place the robot and flashlight. The darker the room the better, as more ambient light will dilute the beacon.
The Problem
The goal of this exercise is to write a control routine that will drive the robot toward a light source, and have the robot stop before hitting the beacon. By this point, you should be familar with accessing data from the photoresistors, and how to properly setup them up. If you are not comfortable with photoresitors, complete Exercise 2 - Path Following.
Here are a few tips.
- Try shrouding the photoresistors with electrical tape to create "tunnel vision".
- To make your life easier, place the light source at the same height as the photoresistors.
- Consider calibrating the photoresistors at startup (with the beacon switched off).
- Stopping before the beacon can be the most difficult part of this exercise. Try manually driving the robot toward the beacon while observing the sensor values. Base you stopping clause on these observations.
The Answer
Here is a solution to this problem.
![[LOGO]](/workbook/skins/workbook/create_small2.png)



