1
Autonomous Speed Control Vehicle RIT Computer Engineering Senior Design Project Fall 2006 Designed by: Laura Celentano, Glenn Ramsey, and Michael Szalkowski User Interface The user interface consists of two switches two lights, and two seven- segment displays. The seven-segment displays show the speed of the vehicle in ft/s. One switch/light pair corresponds to power, the other to operations. The details of the operation are in the tables below. Switch Up Down Power Power is off Power is on Operati onal System is halted System is running Ligh t Functi on Description Red Power On when the power is on Gree n Operat ion On when the system is running Track Following Load SensorInput C urrent Sensor InputEqual to Previous Sensor Input? Yes Lose Any Back Sensors From Last Time? No Load Previous SensorInput Store C urrentSensorInput to Previous SensorInput U se SensorInputto Index into Look-up Table and R etrieve Turning Value Yes No Fron t Left Front Middl e Fron t Righ t Bac k Lef t Back Righ t Turn Off Off Off Off Off Center Off Off Off Off On Right Hard Off Off Off On Off Left Hard Off Off Off On On Right Hard Off Off On Off Off Right Hard Off Off On Off On Right Hard Off Off On On Off Right Hard Off Off On On On Right Hard Off On Off Off Off Center Off On Off Off On Center Off On Off On Off Center Off On Off On On Center Off On On Off Off Right Soft Off On On Off On Right Soft Off On On On Off Right Soft Off On On On On Right Hard On Off Off Off Off Left Hard On Off Off Off On Left Hard On Off Off On Off Left Hard On Off Off On On Left Hard On Off On Off Off Center On Off On Off On Center On Off On On Off Center On Off On On On Center On On Off Off Off Left Soft The track following algorithm utilizes five optoreflector sensors mounted on the underside of the vehicle. Three sensors are mounted at the front of the vehicle and two are mounted at the rear. When the vehicle is properly following the track, all five sensors should detect the track. The sensor values are polled by the microcontroller. The implemented algorithm can be seen in the flow chart below. The algorithm utilizes a look-up table to determine how the vehicle should turn to stay on the track depending on the sensor values. This look-up table can be seen below. Speed Limit Detection Speed Control Project Costs Power Operation Off On Off On The speed control consists of both measuring and adjusting the speed of the vehicle. Measuring the speed is accomplished by a shaft encoder mounted on the rear axle. An opto- interrupter is mounted in such a way as to generate a square wave as the vehicle moves. The frequency of the wave is directly proportional to the speed of the vehicle. Controlling the speed is done through the use of an H-Bridge. The speed duty cycle is adjusted up and down according to the desired speed until it matches. Additionally, the turning amount must be taken into account in the speed control. This is because the friction increases when the vehicle goes into a turn and decreases when it comes out of a turn. This is taken into account by detecting turn changes and adding or subtracting empirically determined constants from the speed duty cycle. Item Our Cost Actual Cost HCS12 Microcontroller $0 $130 Vehicle $40 $40 Direction Control Hardware $0 $10 Speed Control Hardware $15 $15 Speed Limit Detection Hardware $10 $10 Track Following Hardware $15 $15 Track and Overpass Construction $20 $50 User Interface Hardware $12 $12 The objective of this project was to create an autonomously speed controlled vehicle. The vehicle follows an oval reflective track through the use of infrared sensors mounted on the underside of the vehicle. Infrared sensors mounted on the roof of the vehicle detect reflective patterns on the underside of overpasses. These patterns correspond to different speeds. The vehicle’s speed is controlled to match the last recognized pattern. Overvie w From Left-to-Right Laura Celentano Responsiblity: Track- Following Glenn Ramsey Responsibility: Speed Control Michael Szalkowski: Responsibility: Speed Limit In order to detect the speed limit, it was important that the correct bit pattern be interpreted. In order to alleviate this problem, a comparator algorithm was used, and can be seen in Figure 1. By comparing the patterns stored in memory at the current time to some previous time, one can decipher the bit pattern under the underpass. The sensor input will automatically shift the bit pattern into memory serially. If they differ, it will update the previous bit pattern variable with the current one. Once a bit pattern has been found not to change (like right after the vehicle exits the underpass), it will set the new desired speed based on the bit pattern. The threshold time that was found to work best after testing was 1 second. Increm entC ounter Every 50 m s Counter> Threshold? Yes No IncrementTime C ounter ClearTime C ounter Previous Pattern = C urrentPattern? No Setnew D esiredSpeed Yes SetPrevious Pattern w ith C urrentPattern SetPrevious Pattern w ith C urrentPattern. R esetC urrentPattern Load SensorInput Every 50 m s InputD ifferent from last? No Yes LeftShiftitinto C urrentPattern

Autonomous Speed Control Vehicle RIT Computer Engineering Senior Design Project Fall 2006 Designed by: Laura Celentano, Glenn Ramsey, and Michael Szalkowski

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Autonomous Speed Control Vehicle RIT Computer Engineering Senior Design Project Fall 2006 Designed by: Laura Celentano, Glenn Ramsey, and Michael Szalkowski

Autonomous Speed Control Vehicle

RIT Computer Engineering Senior Design Project Fall 2006

Designed by: Laura Celentano, Glenn Ramsey, and Michael Szalkowski

User InterfaceThe user interface consists of two switches two lights, and two seven-segment displays. The seven-segment displays show the speed of the vehicle in ft/s. One switch/light pair corresponds to power, the other to operations. The details of the operation are in the tables below.

Switch Up Down

Power Power is off Power is on

Operational

System is halted

System is running

Light Function Description

Red Power On when the power is on

Green Operation

On when the system is running

Track Following

Load Sensor Input

CurrentSensor

Input Equal to PreviousSensorInput?

Yes

Lose Any Back Sensors

From Last Time?

No

Load Previous Sensor Input

Store Current Sensor Input to Previous Sensor Input

Use Sensor Input to Index into Look-up Table and Retrieve Turning Value

Yes No

FrontLeft

FrontMiddle

FrontRight

BackLeft

BackRight

Turn

Off Off Off Off Off Center

Off Off Off Off On Right Hard

Off Off Off On Off Left Hard

Off Off Off On On Right Hard

Off Off On Off Off Right Hard

Off Off On Off On Right Hard

Off Off On On Off Right Hard

Off Off On On On Right Hard

Off On Off Off Off Center

Off On Off Off On Center

Off On Off On Off Center

Off On Off On On Center

Off On On Off Off Right Soft

Off On On Off On Right Soft

Off On On On Off Right Soft

Off On On On On Right Hard

On Off Off Off Off Left Hard

On Off Off Off On Left Hard

On Off Off On Off Left Hard

On Off Off On On Left Hard

On Off On Off Off Center

On Off On Off On Center

On Off On On Off Center

On Off On On On Center

On On Off Off Off Left Soft

On On Off Off On Left Soft

On On Off On Off Left Soft

On On Off On On Left Hard

On On On Off Off Center

On On On Off On Left Hard

On On On On Off Right Hard

On On On On On Center

The track following algorithm utilizes five optoreflector sensors mounted on the underside of the vehicle. Three sensors are mounted at the front of the vehicle and two are mounted at the rear. When the vehicle is properly following the track, all five sensors should detect the track. The sensor values are polled by the microcontroller. The implemented algorithm can be seen in the flow chart below. The algorithm utilizes a look-up table to determine how the vehicle should turn to stay on the track depending on the sensor values. This look-up table can be seen below.

Speed Limit Detection

Speed Control

Project Costs

Power Operation

Off

On

Off

On

The speed control consists of both measuring and adjusting the speed of the vehicle. Measuring the speed is accomplished by a shaft encoder mounted on the rear axle. An opto-interrupter is mounted in such a way as to generate a square wave as the vehicle moves. The frequency of the wave is directly proportional to the speed of the vehicle. Controlling the speed is done through the use of an H-Bridge. The speed duty cycle is adjusted up and down according to the desired speed until it matches.

Additionally, the turning amount must be taken into account in the speed control. This is because the friction increases when the vehicle goes into a turn and decreases when it comes out of a turn. This is taken into account by detecting turn changes and adding or subtracting empirically determined constants from the speed duty cycle.

Item Our Cost Actual Cost

HCS12 Microcontroller $0 $130

Vehicle $40 $40

Direction Control Hardware $0 $10

Speed Control Hardware $15 $15

Speed Limit Detection Hardware $10 $10

Track Following Hardware $15 $15

Track and Overpass Construction $20 $50

User Interface Hardware $12 $12

Power Subsystem Hardware $30 $30

Total: $142 $312

The objective of this project was to create an autonomously speed controlled vehicle. The vehicle follows an oval reflective track through the use of infrared sensors mounted on the underside of the vehicle. Infrared sensors mounted on the roof of the vehicle detect reflective patterns on the underside of overpasses. These patterns correspond to different speeds. The vehicle’s speed is controlled to match the last recognized pattern.

Overview

From Left-to-Right

Laura Celentano

Responsiblity: Track-Following

Glenn Ramsey

Responsibility: Speed Control

Michael Szalkowski:

Responsibility: Speed Limit Detection

In order to detect the speed limit, it was important that the correct bit pattern be interpreted.   In order to alleviate this problem, a comparator algorithm was used, and can be seen in Figure 1.  By comparing the patterns stored in memory at the current time to some previous time, one can decipher the bit pattern under the underpass.   The sensor input will automatically shift the bit pattern into memory serially.  If they differ, it will update the previous bit pattern variable with the current one.   Once a bit pattern has been found not to change (like right after the vehicle exits the underpass), it will set the new desired speed based on the bit pattern.   The threshold time that was found to work best after testing was 1 second.

Increment Counter Every 50 ms

Counter > Threshold?

YesNoIncrement Time Counter

Clear Time Counter

Previous Pattern = Current Pattern?

No Set new DesiredSpeed

YesSet Previous Pattern with

Current Pattern

Set Previous Pattern with Current Pattern. Reset Current Pattern

Load Sensor Input Every 50 ms

Input Different from last?

No

Yes Left Shift it into Current Pattern