Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
ECE 4600: Capstone Design Project
Fall 2006 Instructor: Dr. Syed Masud Mahmud 12/19/2006 Group 1: Eduardo Carvalho, Dave Conger, Jason Mantey
LF3000 by Carvalho, Conger and Mantey 2
Table of Contents
Abstract ......................................................................................................................................................... 4
Executive Summary ....................................................................................................................................... 5
Purpose ......................................................................................................................................................... 6
Introduction and Overview ........................................................................................................................... 7
Prior Work and Design .................................................................................................................................. 8
Design Alternatives Considered .................................................................................................................. 11
Operation and Design Theory ..................................................................................................................... 13
Infrared Line Sensor Array ...................................................................................................................... 13
Steering Servo Motor .............................................................................................................................. 15
Proximity Sensor ..................................................................................................................................... 15
DC Motor ................................................................................................................................................. 17
Main Circuit Board .................................................................................................................................. 17
RF Transmitter and Receiver ................................................................................................................... 18
Microprocessor Board ............................................................................................................................. 18
Operating Procedure................................................................................................................................... 20
OSHA, FCC and EU Constraints ................................................................................................................... 22
Parts List ...................................................................................................................................................... 24
Cost Analysis ............................................................................................................................................... 25
Schematic Diagrams .................................................................................................................................... 26
Design Problems Encountered .................................................................................................................... 29
Distribution of Work ................................................................................................................................... 30
Program Flow Chart .................................................................................................................................... 31
Program Listing ........................................................................................................................................... 32
Component Datasheets .............................................................................................................................. 38
LF3000 by Carvalho, Conger and Mantey 3
Table of Figures
Figure 1: Infrared Line Sensor Array (Bottom) ...................................................................................... 13
Figure 2: Infrared Line Sensor Array (Top) ............................................................................................. 13
Figure 3: Infrared Sensor Assembly ....................................................................................................... 14
Figure 4: Hex Inverter Board Interconnect ............................................................................................ 14
Figure 5: Futaba Steering Servo Motor.................................................................................................. 15
Figure 6: Sharp Proximity Sensor ........................................................................................................... 16
Figure 7: Proximity Sensor Output Relationship ................................................................................... 16
Figure 8: DC Motor (Top) ....................................................................................................................... 17
Figure 9: DC Motor (Side) ...................................................................................................................... 17
Figure 10: Main Circuit Board ................................................................................................................ 17
Figure 11: RF Transmitter ...................................................................................................................... 18
Figure 12: Ribbon Cable Connected to MCU Port ................................................................................. 19
Figure 13: Modified Reset Connection .................................................................................................. 19
Figure 14: 19.2V Battery Installation ..................................................................................................... 20
Figure 15: 9V Battery Installation .......................................................................................................... 20
Figure 16: 7.2V Battery Installation ....................................................................................................... 20
Figure 17: ON/OFF and RESET Switches ................................................................................................ 21
Figure 18: Remote RESET Switch ........................................................................................................... 21
Figure 19: Complete Wiring Diagram .................................................................................................... 26
Figure 20: Sensor Array Diagram ........................................................................................................... 27
Figure 21: MCU Port Pinout ................................................................................................................... 27
Figure 22: Port Assignments .................................................................................................................. 28
Figure 23: Gantt Progress Chart ............................................................................................................ 30
Figure 24: Program Flow Chart .............................................................................................................. 31
LF3000 by Carvalho, Conger and Mantey 4
Abstract
With major automakers struggling for market share, automobile safety is becoming increasingly
important. One of the newest safety technologies, automated driving systems, are leading the way for
the future of auto design. Since most accidents happen as a result of driver error, eliminating the driver
must therefore increase safety. To examine this hypothesis, a small-scale car model was designed to
follow a line on the ground. The model was also designed to avoid collisions by braking when an object
was detected. After constructing the model, dubbed the LF3000, it was found to sufficiently follow the
line for its preliminary design stage. With further design and modification for full-scale vehicles, this
technology could eventually allow cars to drive themselves, permanently changing the way automobiles
are designed.
LF3000 by Carvalho, Conger and Mantey 5
Executive Summary
As the creators of the LF3000, the Ultimate Line-Following Driving Machine, we believe automobile
safety is a top priority. Since forming Group 1 in the fall of 2006, we have strived to research and
develop leading-edge technologies in auto safety.
Our most important development focuses on automated driving systems. Since most accidents happen
as a result of driver error, eliminating the driver must therefore increase safety. To further examine this
technology, we designed and constructed the LF3000 to model automated driving control. Having seen
a glimpse of what this technology can do, we are excited to continue developing the idea and eventually
hope to implement the system on full-scale automobiles.
Though the auto industry is currently struggling, safety systems are in high demand and automakers are
constantly looking for an edge over the competition. The LF3000 technology will revolutionize how cars
are designed and every major automaker will want to be a part of the next generation automobile.
Once our system is further developed and tested, we should have no difficulty either licensing or selling
the technology to a leading auto manufacturer.
The competition will primarily come from third-party auto suppliers who are also working on safety
technologies and similar automated driving systems. Though these competitors may have the
advantage of resources, our prototype has already shown significant progress and we will undoubtedly
be a part of this revolutionary technology.
Therefore, we will continue to develop small-scale prototypes like the LF3000 and work our way up to
full-scale vehicles. To do so we will seek outside funding from investors and keep the workforce limited.
Once the design is fully saleable, we project to recoup all invested funds through licensing or selling the
technology as mentioned above. We also expect to gain enough capital to continue researching and
developing new auto safety technologies.
LF3000 by Carvalho, Conger and Mantey 6
Purpose
The design of automobiles continues to move towards driverless control with systems such as lane
detection and collision avoidance. Soon enough cars will be able to drive themselves. In order to
explore the feasibility of automated driving systems, we designed and constructed a small-scale model
car that follows a line. The model is a prototype of a system that could be implemented on a full-scale
level in which an automobile drives itself on the freeway by following the lane markers. The result of
the project gives an idea of how effective the system is and what kind of steps need to be taken to
implement the design for the real world.
LF3000 by Carvalho, Conger and Mantey 7
Introduction and Overview
The LF3000 is a prototype line-following car. Using several optical sensors in the front of the vehicle, the
car is able to detect a black line on the ground and maneuver in such a way as to stay on top of the line.
There is also an additional sensor that enables the car to avoid collisions by stopping when an object is
detected. Although the LF3000 has been constructed as small-scale model, with further development
and modification the system could be implemented on a full-scale vehicle.
This report will examine the various aspects that went into designing our prototype and highlight the
following sections:
Prior Work and Design
Design Alternatives
Operation and Design Theory
Operating Procedure
OSHA, FCC and EU Constraints
Parts and Cost Analysis
Schematic Diagrams
Design Problems Encountered
Distribution of Work
Program Listing
LF3000 by Carvalho, Conger and Mantey 8
Prior Work and Design
Several US patents exist that relate to our project specifically regarding object detection and lane
detection. This is to be expected since many auto manufacturers are aggressively pursuing automated
driving systems as discussed above.
US Patent 7,091,837: Obstacle detecting apparatus and method
Inventors: Nakai; Hiroaki (Tokyo, JP), Takeda; Nobuyuki (Tokyo, JP), Hattori; Hiroshi (Tokyo, JP),
Onoguchi; Kazunori (Tokyo, JP)
Assignee: Kabushiki Kaisha Toshiba (Tokyo, JP)
Appl. No.: 10/387,465
Filed: March 14, 2003
Abstract: An obstacle detecting apparatus configured to detect an obstacle present on the road, such
as a vehicle running ahead, a parked vehicle, and a pedestrian, by distinguishing the
obstacle from a mere object causing no obstruction to driving of the vehicle, such as the
texture like the white line or signs on the road surface, and the guardrail along the
roadside.
This patent describes an apparatus which not only detects objects on the road but can also distinguish
which ones will cause a collision. There is no description regarding the outcome of a detected object
but it would assumedly be used in conjunction with applying the vehicle’s brakes. The LF3000 uses a
simplified form of object detection by determining the distance from an object directly in front of it and
deciding whether or not to brake.
US Patent 6,973,380: Lane keep control apparatus and method for automotive vehicle
Inventors: Tange; Satoshi (Kanagawa, JP), Matsumoto; Shinji (Kanagawa, JP)
Assignee: Nissan Motor Co., Ltd. (Yokohama, JP)
Appl. No.: 10/695,799
Filed: October 30, 2003
Abstract: In lane keep control apparatus and method for an automotive vehicle, a behavior of the
vehicle is controlled in such a manner that a yaw moment is developed in a direction to
avoid a deviation of the vehicle from the traffic lane in accordance with the traveling state
of the vehicle when determining that the vehicle has a tendency of the deviation of the
vehicle from the traffic lane and lane markers are detected, each lane marker representing
one side of the traffic lane, and the behavior of the vehicle is controlled on the basis of the
detected lane marker at one side of the traffic lane when a detection state of the lane
LF3000 by Carvalho, Conger and Mantey 9
markers is transferred from a state in which both of the lane markers at both sides of the
traffic lane are detected to a state in which the lane marker only at one side of the traffic
lane is detected.
This patent describes a system that can detect lane markers and control a vehicle to stay within its lane.
The LF3000 works in a similar fashion by changing the direction of the car based on markings on the
ground. The difference would be that our prototype is on a smaller scale and rather than staying inside
a lane it drives directly above a black line on the ground.
US Patent 6,763,904: Method for adjusting the speed of a motor vehicle
Inventors: Winner; Hermann (Karlsruhe, DE), Lueder; Jens (Kornwestheim, DE)
Assignee: Robert Bosch GmbH (Stuttgart, DE)
Appl. No.: 10/018,149
Filed: April 4, 2002
Abstract: A method for controlling the speed of a vehicle is proposed, where, in the vehicle to be
controlled, the yaw rate or rotation rate is measured, in particular to determine the
curvature of the vehicle's own travel trajectory, and where, using a proximity sensor or
position sensor, at least one vehicle traveling ahead or at least some other object within a
sensor's sensing range is detected, particularly with regard to an offset from the travel
course of the vehicle to be controlled. By delaying the travel-course offset of a vehicle
driving ahead, determined in preset measuring cycles, by a predefined time span, and by
using the then instantaneous curvature of the travel trajectory, a historical travel-course
offset is ascertained, one is able to simply and rapidly predict the travel course of the
vehicle to be controlled.
The method described in this patent takes into account vehicle trajectory, yaw and proximity to objects
ahead to adjust the vehicle’s speed appropriately. Our prototype has several similar features. The
LF3000 slows down when making sharper turns and speeds up when moving in a straighter path. It also
slows to a stop when an object is detected in its path.
US Patent 6,741,186: Infrared road line detector
Inventors: Ross; Phillip N. (Washington Ter., UT)
Appl. No.: 10/328,815
Filed: December 24, 2002
Abstract: A detector for detecting light, such as infrared light, reflected from discontinuous lane
dividing lines or other lines on a highway surface from a moving motor vehicle to determine
the position of the vehicle on the highway detects light reflected from the surface of the
highway and includes circuitry to determine from the reflected light sensed not only the
presence of a road line but a characteristic of the road line sensed to determine if the road
LF3000 by Carvalho, Conger and Mantey 10
line detected is consistent with previously detected road lines and therefore appears to be
a valid road line. The alarm, when enabled, is activated unless a road line consistent with
previously sensed road lines is sensed within successive fixed periods of time in which it is
expected that a line should be sensed. By detecting the beginning and end of a signal,
various characteristics of the sensed line can be determined, and such things as the type of
line likely sensed or the speed of travel of the vehicle can also be determined.
The patent above describes a system using infrared sensors to detect a lane marker and signal an alarm
when the vehicle crosses the lane. Though the intended outcome of this patent is simply to alert drivers
that they are changing lanes, it does, however, employ the same line detection methods used for the
LF3000 – specifically, using infrared detectors.
LF3000 by Carvalho, Conger and Mantey 11
Design Alternatives Considered
Several parts of our project were changed after discussing design alternatives. Below is a table of the
choices made for various portions of the project.
Item Final Choice and Reasoning
Line Detection Options -- Electromagnetic – detection with wire under the road -- Optical (especially infrared) – with non-reflective line on the road Final Decision -- Infrared sensing with non-reflective line Reasoning -- Electromagnetic line following was our first choice for line sensing. The incentive behind the electromagnetic detection was that a wire could be placed underground and would be unaffected by weather, thus making it an overall more reliable system. However, it was determined that the magnetic detection would be more costly (commercially) and that in order to properly detect the wire a current would need to be passed through it, adding to the complexity of the project and implementation.
Remote Control Car
Options -- Hobby Grade Remote Control Car -- Proprietary 1/6 Scale Remote Control Car -- Proprietary 1/10 Scale Remote Control Car Final Decision -- Proprietary 1/6 Scale Remote Control Car with modified steering Reasoning -- Hobby grade remote control products were the best option for the group in terms of modification. The parts that are used in hobby products are open and understandable. You can research how each part works and modify each piece to fit your application. However, the cost of the hobby grade materials was approximately three times as expensive, and was thus cost prohibitive for us. Our solution was to buy a proprietary car and remove the steering servo completely and replace it with a hobby grade steering servo motor. This way we were able to understand how the steering worked, while achieving the cost-effectiveness of the proprietary car. We also decided that the larger 1/6 scale product would fit our electronics better and would therefore contribute to a more professional looking product. The larger size did not increase the cost of the vehicle substantially.
LF3000 by Carvalho, Conger and Mantey 12
Remote Start and Reset
Options -- Infrared -- Radio Frequency Final Decision -- Radio Frequency Reasoning -- An important part of our project was to be able to start and reset the vehicle from a distance. This was important because our project is a moving vehicle, and it is convenient to be able to stop the car from far away. From a design perspective, the digital qualities of infrared make it a tempting choice. However, there are drawbacks of using infrared – notably that the receiver and transmitter must be pointed at each other for proper operation. Our approach was to use the RF parts of the original transmitter and receiver included with the vehicle and modify it to only transmit the signal we wanted – a reset signal. This was cost effective and not difficult to implement.
Proximity Sensor
Options -- Ultrasonic -- Infrared Final Decision -- Infrared Reasoning -- Although the accuracy in distance is more effective for ultrasonic proximity sensors, we decided on using the infrared sensor. The ultrasonic sensors considered were more expensive and required manually calculating the distance based on input and output pulse relationships. While this is not impossible, we decided that it would be more effective to use the built-in analog to digital converter that our microprocessor is capable of. The infrared sensor outputs an analog voltage, and thus works with our A/D converter. The range of an ultrasonic sensor is physically further than that of the infrared sensor, but the range that we required to stop the car was within the range of the infrared proximity sensor.
LF3000 by Carvalho, Conger and Mantey 13
Operation and Design Theory
Our project consisted of several modular sections which are described in detail below.
Infrared Line Sensor Array
The line sensor is located in the front of the vehicle in close proximity to the ground. It consists of an
array of seven infrared emitters and detectors located horizontally from the left side of the car to the
right side. When the vehicle is following a line, only one sensor should be “ON” at any given time. With
this knowledge, the microprocessor is able to figure out which direction the car needs to travel to
continue over the line. For instance, if the only sensor that detects the line is on the right half of the
vehicle, the microprocessor would change the direction of the wheels to the right to try to center the
car over the line.
Figure 1: Infrared Line Sensor Array (Bottom)
Figure 2: Infrared Line Sensor Array (Top)
The sensor array is divided into seven distinct sections. Each section contains one infrared emitter and
one infrared receiver. The emitter emits a constant output of infrared light, as it is connected directly
the power of the board. The receiver is a logical device. This means that the output is either “ON” or
“OFF” at any given time. This makes line detection very easy, as we only need to determine which one
sensor assembly is unlike the others. The receiver outputs a high (logical 1) when it is receiving infrared
light from the emitter and outputs a low (logical 0) when it is not. The light from the emitter is reflected
off of the ground – and thus if there is a dark spot (line) present, the light will not reflect. Each assembly
also includes a green output LED to indicate the sensor output. This is especially useful for
troubleshooting since we cannot see the infrared light.
LF3000 by Carvalho, Conger and Mantey 14
Figure 3: Infrared Sensor Assembly
The outputs of all seven sensors come together and leave the board in front of the vehicle. They arrive
midway to the main circuit board at a small circuit board that inverts each signal using two hex inverter
integrated circuits. For instance, if a sensor is high (receiving reflected light), the new output would
become low. The new signals leave the small circuit board and continue to the main board.
Figure 4: Hex Inverter Board Interconnect
The purpose of this interconnect is twofold. First, the high outputs of the receivers only reached
approximately 3.8 volts. We wanted to ensure that our microprocessor receives the data correctly, so
the inverter circuit changes the 3.8 volt output to a low (approximately 0 volts) and a low output to a
LF3000 by Carvalho, Conger and Mantey 15
high (approximately 5 volts). In our code, we are checking for which sensor is over the line. By
inverting, we only have one high and six lows when the line is detected, making the system more
reliable and the code slightly less complex.
Steering Servo Motor
The turning mechanism that came with our vehicle only had three directions. The device was either
going straight, turning fully left, or turning fully right. Our concern for this design was that our car would
be very erratic and therefore less stable. Rather than making minor corrections, the vehicle would make
a massive turn only to overcorrect itself and need to turn back and repeat the overcorrection on the
other side. A more variable turning radius removes this problem and improves the project.
Figure 5: Futaba Steering Servo Motor
We decided to buy a Futaba S3003 servo – a commercially available hobby servo. The Futaba servo is
controlled using Pulse Width Modulation (PWM). By varying the duty cycle of the servo input, the servo
will rotate to change the direction of the front tires. To center the servo, the device must receive a 1.5
millisecond pulse (high time at +5 volts) 50 times per second. This equates to a period of 20 milliseconds
(regardless of high time).
Our “center” value for the car wheels occurs when we output pulses of 1.55 ms. By increasing the
duration of the pulse to 1.75 ms, we effectively turn the wheels approximately 45 degrees to the right.
Similarly, we can decrease the duration of the output pulse to 1.35 ms to turn the wheels approximately
45 degrees to the left. In this way, the angle of the wheels can be varied by varying the pulse duration
from 1.35 ms to 1.75 ms.
Proximity Sensor
We are using a Sharp 2Y0A02 infrared proximity sensor in the front of the vehicle. The purpose of this
device is to recognize when the vehicle is approaching an object that it would eventually strike based on
its current path. We need the sensor to prevent damage to the vehicle.
LF3000 by Carvalho, Conger and Mantey 16
Figure 6: Sharp Proximity Sensor
The Sharp proximity sensor we are using uses a series of infrared pulses to determine the distance based
on the amount of time required for the pulse to bounce back from the object it hit. This specific Sharp
proximity detector can determine distances between 20 cm and 150 cm. The distance is converted to
an analog voltage that is read by our microprocessor. Below is the relationship between distance and
output voltage as given by the manufacturer of the proximity sensor.
Figure 7: Proximity Sensor Output Relationship
Using this relationship, we were able to determine an analog voltage relating to the point the car should
stop. Based on our calculations and intuition, we decided that the car should be stopped at
approximately 1 meter from an object to avoid collisions, which produces an analog voltage of
approximately 0.7 volts. Our microprocessor stops the vehicle when the input value (an 8 bit value) is
greater than 32 (out of 256), as shown below.
20$3284.352560.5
7.0positions
V
V (the precise distance is not important)
LF3000 by Carvalho, Conger and Mantey 17
DC Motor
Figure 8: DC Motor (Top)
Figure 9: DC Motor (Side)
We used the DC motor that came pre-installed in the car. The simple reasoning for this was that the
motor was far too integrated with the vehicle and replacing it would potentially destroy our vehicle.
The motor is a 19.2 volt motor by default. However, we determined that the speed produced at the full
19.2 volts is too great for our project. We thus decided to limit the voltage to a lesser value of 9 volts
and 12 volts, and vary the speed depending on the current direction of the vehicle. These speeds are
controlled using two relays and two voltage regulators, located on the main electrical board (explained
later). These voltages resulted in speeds that were more acceptable.
Main Circuit Board
The main board contains most of the electronics in the project including the bus to the microprocessor,
relays, connections to the sensor array, the motor output, the proximity input, and all voltage
references.
Figure 10: Main Circuit Board
LF3000 by Carvalho, Conger and Mantey 18
RF Transmitter and Receiver
The radio frequency portion of our project is simply a reset button that can be used remotely.
Considering our project is essentially a moving object, it was safety and convenience factors that pushed
us to utilize a wireless reset button.
Figure 11: RF Transmitter
The old remote control of the vehicle was used to create a remote reset button. We used the old
transmitter and receiver to do all RF communication for us. We were able to determine where the car
turning control was created. We replaced this wheel with a button that we could decode from the old
receiver module. When the button on the remote is pressed, a relay is activated on our main board to
reset the microprocessor board. This can be used for remote starting the vehicle.
Microprocessor Board
The microprocessor board is mostly unused as far as the breadboard is concerned. We were able to do
this because we used a ribbon cable to connect the microprocessor board to our main board. We
connected our board to the microprocessor board through the MCU port, which contains Ports A, D, and
E, along with power and ground. Effectively, we had the entire microprocessor I/O available to us at our
main board, cleaning the appearance of the microprocessor board.
LF3000 by Carvalho, Conger and Mantey 19
Figure 12: Ribbon Cable Connected to MCU Port
To enable the external resets that we needed, we had to modify the microprocessor board. We found a
pin on the board that was unused and was connected to the reset button. When this pin is connected to
ground (through our reset button), it serves the same function as the hardware reset button on the
board. A picture of the board can be seen below.
Figure 13: Modified Reset Connection
LF3000 by Carvalho, Conger and Mantey 20
Operating Procedure
The following are instructions on how to operate the LF3000. It is assumed that the product will be fully
assembled when the customer receives it.
Required Parts
2 AA batteries for remote reset switch (Not Included)
9V battery to power the microprocessor (Not Included)
7.2V hobby grade RC battery to power the sensors
19.2V battery to power the DC motor Battery Installation
Ensure that the batteries are fully charged.
Turn vehicle upside-down and locate 19.2V battery connector.
Attach battery and ensure that the lock is engaged.
Figure 14: 19.2V Battery Installation
Turn car back to normal position.
Remove car cover and locate internal battery connectors (9V and 7.2V batteries).
Plug in the batteries and ensure that they are secured.
Figure 15: 9V Battery Installation
Figure 16: 7.2V Battery Installation
Install AA batteries in the remote reset switch.
LF3000 by Carvalho, Conger and Mantey 21
Powering and Starting
NOTE: ON/OFF and RESET switches are located in the back window of the vehicle. There is also a RESET
button on the remote.
Figure 17: ON/OFF and RESET Switches
Figure 18: Remote RESET Switch
Position vehicle over the black line that it will follow.
Move the ON/OFF switch to ON position to power the vehicle. It should turn on the headlights and the sensor array LEDs.
Position the vehicle over the line such that the middle LED on the sensor array turns off. This will ensure that the vehicle starts centered on the line. Positioning the vehicle so that any other sensor is over the line also works, but the vehicle will start turning right away after it starts.
Press the reset button on the back of the vehicle or on the remote.
The car should start following the line.
Ensure that nothing is obstructing its path, otherwise the car will stop to avoid collision and the brake lights will turn on.
If the line ends, the vehicle will continue driving in the direction that it was moving last.
To restart, follow this procedure again.
Powering Down
To turn off the vehicle simply switch the ON/OFF button to the OFF position. The headlights should turn off as well as the sensor array LEDs.
Remove the batteries before storing to prevent battery leak.
LF3000 by Carvalho, Conger and Mantey 22
OSHA, FCC and EU Constraints
Throughout the making of the product, we tried to ensure safety. We had to modify several of our
circuit boards to account for additional current that would be passed through our wires. We primarily
used wire gauge AWG 22, which can hold around 1.0 amperes of current. However, some of our lines
required more than one amp, and we thus modified our circuit to account for this by adding a second
wire. Another addition we made to our product for safety concerns was a proximity sensor in the front
of the vehicle. If our device or another device based on our designs were to enter the marketplace, it is
essential that the device be aware of objects in the desired path. Because our vehicle could potentially
be used for automatic and unmanned travel, we need to account for the potential dangers of
obstructive objects in the vehicle’s path.
OSHA
There were several applicable sections of the OSHA code that we needed to observe during the scope of
this project. In addition to maintaining a safe working environment, we found two sections of utmost
importance regarding the finished product. Our product is considered a class 1 device for remote
control devices because of its low power ratings. To be considered a class 1 product, you must use
fewer than 30 volts and 1000 watts, which our product was significantly under.
• 1910.303 (c) – Splices – Conductors shall be spliced or joined with splicing devices suitable for the use or by
brazing, welding, or soldering with a fusible metal or alloy. Soldered splices shall first be so spliced or joined as to be mechanically and electrically secure without solder and then soldered. All splices and joints and the free ends of conductors shall be covered with an insulation equivalent to that of the conductors or with an insulating device suitable for the purpose.
Part 1910.313 (c) was important for us considering the amount of soldering and splicing that we did in
order to complete our product. As can be witnessed from the figures in this report, the bulk of our
product is soldered and spliced. We feel that our product meets this requirement and that our product
can be manufactured in such a safe manner.
• 1910.305 (f) – Conductors for General Wiring – All conductors used for general wiring shall be insulated unless otherwise permitted in
this Subpart. The conductor insulation shall be of a type that is approved for the voltage, operating temperature, and location of use. Insulated conductors shall be distinguishable by appropriate color or other suitable means as being grounded conductors, ungrounded conductors, or equipment grounding conductors.
LF3000 by Carvalho, Conger and Mantey 23
Similarly, our product complies with OSHA 1910.305 (f) in the use of insulation. We color coordinated
our wires to ensure safety in our product. For instance, all black wire on our product is colored black,
while power cables are yellow. This distinction prevented accidents during the creation of our product.
FCC
The FCC classifies our product as complying with section 15. Under this section, our device must not
create any harmful interference and must accept any interference received. Our product does adhere
to these requirements. We are certain of this, because the originally purchased remote control vehicle
complied with these standards. We did not make any modifications to power or other factors that
would reflect otherwise. The user of our product must be made aware of section 15 of the FCC rules
and regulations before operating.
European Union
In order to sell products in the states associated with the European Union, our device must be
composed entirely of RoHS compliant parts. RoHS compliance is adhering to the restriction of
hazardous materials from our product. Before buying our parts, we ensured that all parts bought were
adherent to these regulations, and we can therefore promote our product as RoHS compliant. With this
compliance, we hope to be able to sell our product to European Union countries in the future.
LF3000 by Carvalho, Conger and Mantey 24
Parts List
Manufacturer Model Description Unit Price Quantity
Axiom CME11E9-EVBU Motorola HC11 Development Board $99.00 1
New Bright 6687 Radio Controlled 1/6 Scale Dodge Ram $85.80 1
Sharp 2Y0A02 Infrared Distance Sensor $17.25 1
Futaba S3003 Servo Motor (steering) $10.99 1
BPS BR1 1.85 x 7.05 Inch PC Board $6.50 2
RadioShack 276-149 2 x 3 Inch PC Board $1.79 1
Fairchild QSE156 Logical Output Infrared Detector $0.77 7
Fairchild QEE113 Infrared Emitter $0.35 7
Synton-Tech 120 1/4 Watt Carbon Film Resistor - 120 ohm $0.01 15
Synton-Tech 1k 1/4 Watt Carbon Film Resistor – 1k ohm $0.01 7
Synton-Tech 10k 1/4 Watt Carbon Film Resistor – 10k ohm $0.01 2
Synton-Tech 33 1/2 Watt Carbon Film Resistor – 33 ohm $0.01 2
On P2N2222A NPN Transistor (General Purpose) $0.17 2
Philips 74HCT04 Hex Inverter $0.16 1
Tyco T90S5D12-5 5 Volt DC 20 Amp Relay $2.34 2
RadioShack 275-240 5 Volt DC 1 Amp Relay $4.49 1
RadioShack 276-1538 9 Pin Female D-Sub Connector $1.79 3
RadioShack 276-1537 9 Pin Male D-Sub Connector $1.79 3
RadioShack 274-222 Power Connector (Male Female Combo) $1.99 1
RadioShack 276-1114 2.5A Silicon Diode $0.60 2
RadioShack 275-609 Normally Off Push Button $3.29 2
RadioShack 275-664 DPDT Switch $4.99 1
STMicro L78S12CV 12 Volt 2 Amp Voltage Regulator $0.46 1
STMicro L78S09CV 9 Volt 2 Amp Voltage Regulator $0.46 1
STMicro L78S05CV 5 Volt 2 Amp Voltage Regulator $0.46 1
LED-Tech Unknown Green LED $0.12 7
Light-On LTW-2E3C4 White LED $1.37 2
Kingbright L7113SED Orange LED $0.31 4
Chicago Mini 4304H1 Red LED $0.21 2
7.2 Volt Remote Control Hobby Battery $20.00 1
Floppy Disk Cable Connector $3.99 1
1 Cubic Inch Block of Wood WSU 1
Wire Spool (22 gauge) $5.49 4
4 Inch Brass Threaded Rod WSU 2
Nuts and Washers for Brass Rod WSU 6
LF3000 by Carvalho, Conger and Mantey 25
Cost Analysis
The total cost of the vehicle was $324 dollars, which includes the Motorola Evaluation Board and the RC
vehicle. When setting the requirements for the project the group was focused on keeping the cost of
the product down without jeopardizing the final outcome.
We had two options when selecting the RC vehicle to be used – a hobby grade vehicle or a toy grade
vehicle. Since the hobby RC car was over the budget planned for the project, the group decided to go
with a toy grade RC car. The car was purchased for $85.80 but since we needed a specific turning
application the turning servo was replaced by a hobby grade turning servo. With the new servo, $10.99
was added to the cost of the vehicle, but the functionality was improved.
After the main components for the project were purchased, additional components were needed as
well. Due to the complexity of the design and the controlling circuitry, interface boards, sensors, and
other various electronics parts were necessary to complete the project. However, these electronics
were a small percentage of the total cost of the project. Another feature used in the project that had
more impact on the cost was the connecting interfaces. They allowed for modularity of the project and
easy assembly, which were valuable features of the design in the assembly and testing phases.
The group also made use of the machine shop in the College of Engineering for some metal hardware
and to manufacture several parts. By using the resources already available in the university, the group
was able to keep the tooling costs down. All of the hardware parts used from the machine shop were
scrap or from the inventory used for students.
It is also important to notice that this is a prototype vehicle and additional parts may be needed for
production compliance. Production would also allow for purchase of parts in bulk, which would
decrease the total cost of the vehicle.
LF3000 by Carvalho, Conger and Mantey 26
Schematic Diagrams
Figure 19: Complete Wiring Diagram
LF3000 by Carvalho, Conger and Mantey 27
Figure 20: Sensor Array Diagram
Figure 21: MCU Port Pinout
LF3000 by Carvalho, Conger and Mantey 28
PO
RTA
PA7 (Brake Light)
PA6 (Servo)
PA5 (Motor 5V)
PA4 (Motor 12V)
PA2 (Center Sensor)
PA1 (L15 Sensor)
PA0 (L45 Sensor)
PD5 (Right Blinker)
PD4 (Left Blinker)
PD3 (R45 Sensor)
PD2 (R15 Sensor)
PD1 (R30 Sensor)
PD0 (L30 Sensor)
PO
RTD
PE5
PE4
PE3
PE2 (Proximity Sensor)
PE1
PE0
PO
RTE
PE6
PE7
PA3
Figure 22: Port Assignments
LF3000 by Carvalho, Conger and Mantey 29
Design Problems Encountered
The design is completely modular, which allowed for easier development stages in the project. All main
components were assembled and tested separately including the program code, which allowed for the
minimization of problems in the final assembly. Even though the components functioned satisfactorily
as separate entities, the group faced some challenges bring everything together.
Originally the vehicle contained two power sources – the main battery that came with the vehicle and
an auxiliary 9V battery. The 9V was regulated using voltage regulators and powered the microprocessor
board, sensors, turning servo and headlight LEDs, while the main battery supplied power to the driving
motor only. When the vehicle was powered and a test run was attempted, the 9V was unable to supply
enough power. The group then decided to add an auxiliary hobby grade RC 7.2V battery to power the
sensors, servo and LEDs, and use the 9V battery only for the microprocessor. This fixed the problem.
When testing the sensor array, the group found out that the sensors did not have enough power to
output a stable 5V signal to the microprocessor, leading to false readings by the program. By adding an
inverter IC to act as a signal buffer, the problem was solved since the IC has enough power to provide a
stable 0 or 5V signal. Also, since the sensors have the inverse logic of the program, this fix also allowed
the code to work correctly with the output from the sensors without needing to invert the signals in the
code. The result is a more intuitive program design.
One last improvement that was required was the need to update the regulators to ones with higher
current rating. This problem was discovered during the final tests when the regulators were getting hot
quickly since they were only rated for 1 ampere each. The sudden changes in speeds were also causing
the relays to create an inverse current when switched. A solution to the problem was found by
substituting the regulator for ones of higher current rating (2 amperes) and adding a diode on the
output of the relays that power the driving motor. Heat sinks were also included in the final design for
better heat dissipation. After the change, the vehicle was able to quickly change speeds without
damaging the circuitry and could also provide more power to the applications.
LF3000 by Carvalho, Conger and Mantey 30
Distribution of Work
The group worked on all parts of the project together, from brainstorming and design to the testing
phase. By working together in all tasks, the group performance was increased since all members could
draw from their own experiences to solve problems and also learn from each other. The following table
indicates the distribution of work:
Task Eduardo Carvalho
Dave Conger
Jason Mantey
Design/Idea 33% 33% 33%
Hardware 33% 33% 33%
Software 33% 33% 33%
Testing 33% 33% 33%
Report 33% 33% 33%
Presentation 40% 20% 40%
Video 10% 80% 10%
A Gantt chart was also created to track the tasks and progress of the group. The following is the Gantt
chart that was used to define the tasks and project target dates.
Figure 23: Gantt Progress Chart
LF3000 by Carvalho, Conger and Mantey 31
Program Flow Chart
Figure 24: Program Flow Chart
LF3000 by Carvalho, Conger and Mantey 32
Program Listing
***********************************************************************
* *
* ------------ Group 1 -------------- *
* *
* - Eduardo Carvalho *
* - Dave Conger *
* - Jason Mantey *
* *
* Final Project -- Line Follower 3000 *
* *
***********************************************************************
***********************************************************************
* Code Begins *
***********************************************************************
REGBAS EQU $1000 ; Base address of registers
PORTA EQU $00 ; Offsets for Various Registers
* PA0 = 45 degrees left sensor input (furthest left sensor)
* PA1 = 15 degrees left sensor input (3rd from left)
* PA2 = Center sensor input
* PA3 = N/A
* PA4 = 12 volt motor speed (higher speed output to relay)
* PA5 = 9 volt motor speed (lower speed output to relay)
* PA6 = servo output (PWM signal)
* PA7 = Brake LED output
PORTD EQU $08
* PD0 = 30 degrees left sensor input (2nd from left)
* PD1 = 30 degrees right sensor input (2nd from right)
* PD2 = 14 degrees right sensor input (3rd from right)
* PD3 = 45 degrees right sensor input (furthest right sensor)
* PD4 = Left turn signal LED output
* PD5 = Right turn signal LED output
* PD6 = N/A
* PD7 = N/A
PORTE EQU $0A ; Used for proximity sensor (A/D)
ADCTL EQU $30 ; ADCTL register
OPTION EQU $39 ; OPTION register
ADR1 EQU $31 ; ADR1 register
ADR2 EQU $32 ; ADR2 register
ADR3 EQU $33 ; ADR3 register
ADR4 EQU $34 ; ADR4 register
TCNT EQU $OE
TOC2 EQU $18
TMSK1 EQU $22
TFLG1 EQU $23
TMSK2 EQU $24
TFLG2 EQU $25
DDRD EQU $09
PACTL EQU $26
ORG $200
DATAA2D RMB 4 ; Locations for keeping samples
AVERAGE RMB 1 ; Location for average value
TEMP RMB 1 ; A variable for the PWM signal
LF3000 by Carvalho, Conger and Mantey 33
* ; TEMP = 1 or 0 depending on
* ; - previous state (high or low)
* ; - of the PWM signal
HITIME RMB 2 ; Hightime for servo PWM signal
LOWTIME RMB 2 ; Lowtime for servo PWM signal
TSGN RMB 1 ; Turn Signal Information
TSGNSTAT RMB 1 ; - Current state
TSGNCNT RMB 1 ; - Count
***********************************************************************
* EEPROM *
***********************************************************************
ORG $FFFE ; The reset button address
FDB BEGIN
ORG $FFE6 ; The OC2 service routine address
FDB OC2SERV
ORG $E000 ; Stack Address
BEGIN LDS #$23FF
***********************************************************************
* Run from RAM *
***********************************************************************
* ORG $00DC
* JMP OC2SERV
*
* ORG $1040
* LDX #REGBAS
***********************************************************************
* A/D SETUP *
***********************************************************************
BCLR OPTION,X $40 ; Select the E clock
BSET OPTION,X $80 ; Enable the A/D converter
LDY #30
WAIT1AD DEY ; Wait for 105 micro sec. for the
BNE WAIT1AD ; - charge pump to stabilize
LDAA #$02 ; Select nonscan, single-channel, and
STAA ADCTL,X ; - channel AN2
***********************************************************************
* Front Sensor Setup *
***********************************************************************
SEI ; Don't allow interrupts until prepared
LDX #REGBAS
CLR TEMP
BCLR DDRD,X $0F ; Set PORTD inputs
BSET DDRD,X $30 ; Set PORTD outputs
BCLR PACTL,X $40 ; Disable pulse accumulator
BSET PACTL,X $80 ; Set PA7 as output
BCLR TMSK2,X $03 ; Set prescale factor of 1
BSET TMSK1,X $40 ; Set OC2 interrupt bit
BCLR TFLG1,X $BF
LDD #3000 ; 1.5 ms hightime for servo PWM
STD HITIME ; - to center the wheels
LDD #37000 ; 18.5 ms lowtime (20 ms period)
STD LOWTIME
LDD TCNT,X ; OC2 is used for PWM on the servo
ADDD HITIME
LF3000 by Carvalho, Conger and Mantey 34
STD TOC2,X
BCLR PORTA,X $80 ; Turn off brake light
CLR TSGN ; Turn off turn signal
BCLR PORTD,X $30 ; Clear both turn signals (PA4 and PA5)
CLR TSGNCNT
BSET TSGNCNT $06 ; Set turn signal counter to 6
CLR TSGNSTAT
BSET TSGNSTAT $02 ; Set turn signal status to center
CLI ; Enable interrupts again
***********************************************************************
* *
* Main Program Loop *
* *
***********************************************************************
START JSR LOOPA2D ; Check proximity sensor for distance
LDAA PORTA,X ; Start sensor check...
ANDA #%00000111 ; Only concerned with PA0-PA2
* ; (L45, L15, and Center sensors)
LDAB PORTD,X ; Continue sensor check...
ANDB #%00001111 ; Only concerned with PD0-PD3
* ; (L30, R30, R15, R45 sensors)
LSLB
LSLB ; Shift ACCB left by 3
LSLB
ABA ; A = A + B
* ; Now Accumulator A contains each of
* ; - the 7 sensors (not in order though)
CMPA #%00000100
BEQ CLINK ; If bit 2 is set - car should be center
CMPA #%00100000
BEQ R15 ; If bit 5 is set - car should turn R15
CMPA #%00000010
BEQ L15LINK ; If bit 1 is set - car should turn L15
CMPA #%00010000
BEQ R30 ; If bit 4 is set - car should turn R30
CMPA #%00001000
BEQ L30LINK ; If bit 3 is set - car should turn L30
CMPA #%01000000
BEQ R45 ; If bit 6 is set - car should turn R45
CMPA #%00000001
BEQ L45LINK ; If bit 0 is set - car should turn L45
BRA START ; Else, check sensors again (start over)
CLINK JMP CENTER ; These "LINKs" are just to help the branch
L15LINK JMP L15 ; - commands. BRA could not reach, so we
L30LINK JMP L30 ; - are opting for JMP to get further down
L45LINK JMP L45 ; - our program code
R45 LDD #3500 ; Adjust PWM servo signal for R45 turn
STD HITIME ; -> 3500 clock pulses = 1.75 ms high time
LDD #36500 ; -> 36500 = 18.25 ms low time
STD LOWTIME
BCLR PORTA,X $10 ; Clear speed 12 (12V)
BSET PORTA,X $20 ; Set to speed 9 (9V)
* ; Speed is too high for a 45 degree turn
* ; - so use the slow (9V) speed
LDAA #%00000001 ; Turn on right turn signal
STAA TSGNSTAT
JMP START ; Return
R30 LDD #3375 ; Adjust PWM servo signal for R30 turn
STD HITIME ; -> 3375 = 1.6875 ms high time
LDD #36625 ; -> 36625 = 18.3125ms low time
LF3000 by Carvalho, Conger and Mantey 35
STD LOWTIME
BCLR PORTA,X $10 ; Clear speed 12 (12V)
BSET PORTA,X $20 ; Set to speed 9 (9V)
LDAA #%00000001 ; Turn on right turn signal
STAA TSGNSTAT
JMP START ; Return
R15 LDD #3250 ; Adjust PWM servo signal for R15 turn
STD HITIME ; -> 3250 = 1.625 ms high time
LDD #36750 ; -> 36750 = 18.375 ms low time
STD LOWTIME
* BCLR PORTA,X $10 ; Clear speed 12 (12V), used for testing only
* BSET PORTA,X $20 ; Set to speed 9 (9V), used for testing only
BCLR PORTA,X $20 ; Clear speed 9
BSET PORTA,X $10 ; Set to speed 12 (12V)
LDAA #%00000001 ; Turn on right turn signal
STAA TSGNSTAT
JMP START ; Return
CENTER LDD #3100 ; Adjust PWM servo signal for Centering
STD HITIME ; -> 3100 = 1.55 ms high time
LDD #36900 ; -> 36900 = 18.45 ms low time
STD LOWTIME
* BCLR PORTA,X $10 ; Clear speed 12 (12V), used for testing only
* BSET PORTA,X $20 ; Set to speed 9 (9V), used for testing only
BCLR PORTA,X $20 ; Clear speed 9
BSET PORTA,X $10 ; Set to speed 12 (12V)
LDAA #%00000010 ; Turn off turn signals
STAA TSGNSTAT
JMP START ; Return
L15 LDD #2950 ; Adjust PWM servo signal for L15 turn
STD HITIME ; -> 2950 = 1.475 ms high time
LDD #37050 ; -> 37050 = 18.525 ms low time
STD LOWTIME
* BCLR PORTA,X $10 ; Clear speed 12 (12V), used for testing only
* BSET PORTA,X $20 ; Set to speed 9 (9V), used for testing only
BCLR PORTA,X $20 ; Clear speed 9
BSET PORTA,X $10 ; Set to speed 12 (12V)
LDAA #%00000100 ; Turn on left turn signal
STAA TSGNSTAT
JMP START ; Return
L30 LDD #2825 ; Adjust PWM servo signal for L30 turn
STD HITIME ; -> 2825 = 1.4125 ms high time
LDD #37175 ; -> 37175 = 18.5875 ms low time
STD LOWTIME
BCLR PORTA,X $10 ; Clear speed 12 (12V)
BSET PORTA,X $20 ; Set to speed 9 (9V)
LDAA #%00000100 ; Turn on left turn signal
STAA TSGNSTAT
JMP START ; Return
L45 LDD #2700 ; Adjust PWM servo signal for L45 turn
STD HITIME ; -> 2700 = 1.35 ms high time
LDD #37300 ; -> 37300 = 18.65 ms low time
STD LOWTIME
BCLR PORTA,X $10 ; Clear speed 12 (12V)
BSET PORTA,X $20 ; Set to speed 9 (9V)
LDAA #%00000100 ; Turn on left turn signal
STAA TSGNSTAT
JMP START ; Return
***********************************************************************
* *
* OC2 - Waveform Generation for SERVO *
LF3000 by Carvalho, Conger and Mantey 36
* *
***********************************************************************
OC2SERV PSHA
PSHB
LDAA TEMP ; Temp is 1 or 0
* ; - for PWM output from OC2
BNE NOT0
ZERO LDD TOC2,X ; If Temp is 0
ADDD HITIME ; Come back to OC2 after high time
STD TOC2,X ; - and set Temp to 1
CLR TEMP
INC TEMP
BSET PORTA,X $40 ; PA6 SET HIGH (servo output)
BRA OC2DONE ; Done with OC2 routine
NOT0 LDD TOC2,X ; If Temp is 1 (not zero)
ADDD LOWTIME ; Come back to OC2 after low time
STD TOC2,X ; - and set Temp to 0
CLR TEMP
BCLR PORTA,X $40 ; PA6 SET LOW (servo output)
DEC TSGNCNT ; Decrement turn signal counter
BNE OC2DONE ; OC2DONE if TSGNCNT is not 0
LDAA #$06 ; Else...
STAA TSGNCNT ; If counter is 0, reset to 6 and
JSR TSGNR ; - go to turn signal routine
OC2DONE BCLR TFLG1,X $BF
PULB
PULA
RTI
***********************************************************************
* Turn Signal Routine *
***********************************************************************
TSGNR COM TSGN ; If turn signal is ready
BEQ TOFF ; - compliment TSGN
LDAA TSGNSTAT ; - and change the state
CMPA #%00000001
BEQ RSGN ; If turning right, branch
CMPA #%00000010
BEQ TOFF ; If not turning, branch
CMPA #%00000100
BEQ LSGN ; If turning left, branch
BRA TDONE ; Otherwise skip
RSGN BSET PORTD,X $20 ; Change right blinker
BRA TDONE
LSGN BSET PORTD,X $10 ; Change left blinker
BRA TDONE
TOFF BCLR PORTD,X $30 ; Turn off blinkers (both)
TDONE RTS
***********************************************************************
* *
* A/D Converter Program - Proximity Sensor *
* *
***********************************************************************
LOOPA2D PSHA
PSHB
BCLR ADCTL,X $80
WAIT2AD BRCLR ADCTL,X $80 WAIT2AD ; Wait until CCF bit is set
* Collect samples and save them
LF3000 by Carvalho, Conger and Mantey 37
LDAA ADR1,X ; Get the first sample
STAA DATAA2D ; - and save it
LDAA ADR2,X ; Get the second sample
STAA DATAA2D+1 ; - and save it
LDAA ADR3,X ; Get the third sample
STAA DATAA2D+2 ; - and save it
LDAA ADR4,X ; Get the fourth sample
STAA DATAA2D+3 ; - and save it
* Compute the average value and save it
LDAA DATAA2D ; A = 1st Sample
ADDA DATAA2D+1 ; (C-bit,A) = 1st Sample + 2nd Sample
RORA ; A = (1st Sample + 2nd Sample)/2
LDAB DATAA2D+2 ; B = 3rd Sample
ADDB DATAA2D+3 ; (C-bit,B) = 3rd Sample + 4th Sample
RORB ; B = (3rd Sample + 4th Sample)/2
ABA ; (C-bit,A) = (1st + 2nd + 3rd + 4th Sample)/2
RORA ; A = (1st + 2nd + 3rd + 4th Sample)/4
STAA AVERAGE ; Save average
LDAB PORTA,X ; Check if at lower speed
ANDB #$20
BNE SPEED9
* ; Stop for higher speed mode
CMPA #$20 ; Check if less than 1 meter away from target
BHI STOPCAR
* ; Stop for lower speed mode
SPEED9 CMPA #$2E ; Check if less than 70 cm away from target
BHI STOPCAR
PULB
PULA
RTS
STOPCAR BCLR PORTA,X $38 ; Turn off driving motor
BSET PORTA,X $80 ; Turn on brake light
LDAA #%00000010 ; Turn off signals
STAA TSGNSTAT
NOEND NOP ; Infinite loop, stops the car
BRA NOEND
************************************************************************
LF3000 by Carvalho, Conger and Mantey 38
Component Datasheets
The datasheets for the following components have been appended to the report:
New Bright 6687
Sharp 2Y0A02
Futaba S3003
Fairchild QSE156
Fairchild QEE113
On P2N2222A
Philips 74HCT04
Tyco T90S5D12-5
RadioShack 275-240
STMicro L78S12CV
STMicro L78S09CV
STMicro L78S05CV