EECE-218 Project Information

Controlling the Line Tracker Robot
(using the Vanderbilt Development Kit)

Overview

This project is about designing a controller for the Line Tracker robot, and use of the Vanderbilt Development Kit (HC11-VDK) to control the system. As you may already know, the robot comes with infrared emitters and sensors to track a black line on a light-colored floor. Each emitter is immediately beside a sensor, but there is a barrier between them. Thus, infrared light cannot pass directly from emitter to sensor. The emitted infrared light will hit the sensor only by reflecting off of the floor. Dark objects (like the line to be tracked) absorb more light and therefore will reflect less infrared light to the sensor. Light objects (like the floor) reflect more light, and therefore will reflect more infrared light to the sensor. The robot uses this information to tell whether a sensor/emitter pair is over a dark line or a light floor.

The goal of this project is very similar as the one in EECE116: record the path taken by the robot, and then play it back. But, this time you will be using the HC11-VDK to achieve this goal. You will use the experience you have gained throughout the labs. You must have a solid understanding of the ports and timers. You will be working in teams for this project (maximum 2 people). Each group must demonstrate their working project to a TA and to the class instructor before the deadline. The deadline is the last day of classes.

There are three stages of this project. Timing is flexible and you can complete each stage whenever you are available. However, you must always be aware of the deadline.

  • Construct the robot after receiving the robot from your lab TA. Pay special attention to the electrical assembly and make sure that it works properly. It is very important to complete and verify that the robot works properly before starting the next stage.
  • Build the circuits explained below on a wire-wrap board.
  • Demonstrate to your TA and the class instructor that your project works, and is ready to enter the final competition. See the Extra Credit section at the end for details.

Equipment

The following equipment is necessary to complete the project:

  • The Line Tracker robot
  • The HC11 Vanderbilt Development Kit (HC11-VDK)
  • (1) Wire-wrap board
  • (1) 34-pin header, wire-wrap length legs
  • (2) 10-pin headers, wire-wrap length legs
  • (4) 14-pin IC sockets, wire-wrap length legs
  • (1) 8-pin IC socket, solder length legs (optional)
  • (1) 7416: Hex Open-Collector Inverter chip
  • (1) 7404: Hex Inverter chip
  • (1) 7432: Quad OR chip
  • (1) 7408: Quad AND chip
  • (4) 10k Ohm Resistors
  • (2) 390 Ohm Resistors (optional)
  • (1) 6"-long 34-wire ribbon cable with connectors (To/From HC11)
  • (1) 4'-long 10-wire ribbon cable with connectors (To/From Blinky)

Design

The following is a block diagram of the electronics in the Blinky.

Blinky Block Diagram

As you can see, the sensor logic produces 0 or 1 depending on which motor needs to run. It means that if there is a straight line, Blinky will try to approximate the line with "10101..." sequence.

However, there is a complication. The signals for logic 1 and 0 in the robot are 0 and 9V (more or less), while the HC11-VDK uses 0 and 5V. Care must be taken to make the proper conversions, or damage to the robot and/or the HC11-VDK will result. Two circuits, the Up Converter and the Down Converter, perform these conversions. These circuits should be constructed on the wire-wrap board. The Up Converter does more than just convert voltages. It has additional logic gates to set Q1 and Q2 properly. This will be described in more detail later.

The Up Converter is used to convert from 0 to 5V voltage levels to the levels used by the robot, 0 to 9V. The Up Converter electronic schematic is shown below.

The Down Converter converts the voltage levels from the 0 to 9V range down to the 0 to 5V range used by the HC11. The electronic schematic for the Down Converter is shown below.

Down Converter

Learning

In the learning stage, set QR low and QL high (QL = Learn, QR = Replay). In the unmodified version of the robot (i.e., before you modify it for this project), the robot's own logic circuits do the work of deciding when to turn on and off the left and right motors. Note that the design is such that only one motor is ON at a time, and at least one motor is always ON. So, if we know when the left motor is on, we know when the right motor is on (the right motor is on when the left motor is off). So, we don't need to store information for when both motors should be on. We arbitrarily choose to record when the left motor should be turned on.

You will make two cuts to the robot's circuit board (explained below). These cuts sever the connections between the robot's logic circuits and the motor control circuits. With these cuts, the robot's motor signals never reach the motors. You will intercept this information and record it. As noted above, we only need to record information for one motor. So, we record the robot's signals that used to go to the left motor. Since we still need the motors to move, you will have to supply the signals to the other sides of the cuts (i.e., to the motors).

Specifically, you would like to monitor the line coming from R10 (A) on the robot. This line will indicate when the robot's logic wants to turn off and on the right motor. This is indicated by logic 0 and 1 levels on this line. These levels are actually 0 and 9V, and so the Down Converter must be used to convert the voltages to those safe for the HC11-VDK (0 and 5V). The converted signal, called QSENSOR, will then be sent to the HC11-VDK. The value on this line indicates when the right motor should be on. This information was once used by the robot to activate the right motor. When said "once used", it is because you have cut that connection, and now you have to read in this information and store it. Also, you must provide the information to the right motor control module so that the robot will move. You cannot send it directly to the robot, since the voltage levels differ in the HC11-VDK and the robot. So, you will send the information to the Up Converter. The line labeled OUT in the Up Converter schematic is where you send the information. The logic gates in the Up Converter will use the signal sent to OUT to send proper signals to both the right and left motors. These motor signals are labeled Q1 and Q2 in the Up Converter schematic.

Replay

In the replay stage, the robot must replay the path that was stored in memory. You must provide the stored path information to the left and right motor control circuits. The points labeled Q1 and Q2 in the Up Converter are connected to the robot's motor control circuits. So, you want to send the stored path information to Q1 and Q2. Remember that you only stored information for the left motor. But, you already know that the left motor is on whenever the right motor is off. The logic in the Up Converter sets Q1 and Q2 from the stored path information that you send to OUT.

For Replay, set QR high and QL low (again, QL = Learn, QR = Replay). Next, send the stored path information to the line marked "OUT" in the Up Converter. Q1 and Q2 will be set appropriately, thanks to the logic gates. Since the HC11-VDK logic levels and the robot's logic levels are different voltage ranges, the Up Converter converts the logic values into the proper voltages.

Modifications to the Robot

You must make two cuts to the robot's circuit board. Both of these cuts are to resistor leads. The cuts that you should make to resistors R10 and R13 are illustrated in the figure below.

Connecting R10 and R13

How to connect to R10 and R13

Note that for R10, you will have to wire-wrap to both the cut end of the resistor (B) and the cut stub left on the board (A). So, make sure that when you cut you don't cut too close to either the resistor or the board. If you cut too close, you won't be able to make a wire-wrap connection. For R13, you only need to wire-wrap to the resistor end of the cut, so be sure to not cut too close to the resistor.

The next step is to connect the wire-wrap board to the robot. The grounds on the robot and the HC11-VDK must be connected. Also, the circuitry on the wire-wrap board needs the 9V supplied by the robot. Referring the Up Converter schematic, you can see that two lines go to the robot for the Up Converter. Finally, the Down Converter receives input from R10 on the robot (A). This makes a total of five lines between the robot and the wire-wrap board. To keep the connections neat, we will use ribbon cables (will be provided). You will attach a couple of headers to your wire-wrap board: one 34-pin and one 10-pin headers (a 34-pin header and a couple of 10-pin headers are provided as part of the interface kit). A ribbon cable will connect the 34-pin header to the appropriate header of the HC11-VDK. To determine which headers on the HC11-VDK you need to connect to, you must decide what port lines you want to use for communications with the robot (It is recommended to use Port C, therefore you will use Header H5 on the satellite board). Refer to Interfacing with the Vandymatic page for more information.

Chip Diagrams

The figure below shows the pin outs for some logic chips, including those used in the project. Data sheets for each of these IC's are found in the Equipment section above by following the appropriate link.

A few chips pinouts

Some logic chip pin outs

Software

You may work on the software for controlling your robot well before you have completed the hardware interface. If you use simple polling techniques, all your software may be tested on the HC11 simulators (SIM68 or Wookie). If you use interrupts, you can test your programs on the HC11-VDK by using logic levels that you control to simulate the robot's sensor readings, while observing the output to the motors on an oscilloscope or multimeter.

The software control for the robot breaks down like so:

  • Setup: Initialize PORTC for both input and output (assuming that you are using PORTC). You'll be reading QSENSOR from your circuit, while writing QL, QR, and OUT. If you are using interrupts, they should be initialized here. Don't forget the IT vector table!
  • Servo loop: For those who do not use interrupts, you'll do one of the following depending upon the mode. In learn mode, you'll sample QSENSOR, store it into memory, and send it back to the robot. In replay mode, you'll simply read the value saved from memory and write it to PORTC. A delay will need to be introduced to lower the sampling frequency. Somewhere around 10 hertz should be adequate. If you use interrupts, you'll do all the above in your ISR except you won't need a delay and you have to reset your IT.

Please note that learn stores into memory starting at a user specified address. The best way to control your program is to allocate 1024 bytes for sensor readings and check when you have filled this amount. When this occurs, simply disable interrupts or exit with an SWI. NOTE: You may also want to stop the robot!

Check this page often, as we are constantly adding more information as needed.

Extra Credit

As a minimum requirement, every project must work as well as the simpler (EECE-116) version. However, with clever software, the robot can be made faster and more intelligent. Any solution that, after learning the path, takes the robot significantly (at least 50%) faster to the goal from the starting point will earn the group extra credit (Ask Prof. Karsai about it). The last two weeks are reserved for this project, but the groups can start working on the projects as early as the parts arrive.

Miscellaneous

The figure below illustrates a few details of the terrain that the line tracker robot will be traveling (dimensions are given in inches). Thus, the purpose of the project is to make the Blinky robot travel the distance between the Start and End points. Two checkpoints have been defined (CP1 and CP2) in this path. A minimum requirement is to have the robot hit at least one of the two checkpoints before reaching the End point. A small time penalty will be applied if only one checkpoint is hit. Now, since all rules are made to be broken, it is possible to go from the Start point to the End point in a straight line (thus, the fastest time will be achieved). So, if none of the checkpoints is hit, a second time penalty will be applied to the final time recorded. These time penalties are to be determined, and they will be announced during the day of the contest. Note that the dimensions on the terrain are for reference purposes only. The final dimensions and shape of the terrain will be disclosed during the contest.

Blinky Project Traveling Terrain

Project Related Information

How to get Data Sheets


| EE-218  Home page | Syllabus | Schedule | Lab News | Faculty | Contact Information | Lab Info | Project |


Department of Electrical Engineering and Computer Science
Box 1824 Station B
Nashville, TN 37235
Phone: 322-2771
Fax: 343-6702


 | Search | Site Index | People Finder | Phone Directory | VUnet | VUmail | VU Library | Help |


Last Updated: Saturday, March 05, 2005

Juan J. Rodriguez-Moscoso

Copyright © 2002 Vanderbilt University