kyle romero - autonomous line follower · size: 1.57"x0.79"x 1.44" (40x20x36.5mm...

43
1 Autonomous Line Follower Project Group 25: Kyle Romero Matthew Phelps Christopher Walls Bilal Bissat Advisor: Dr. Bredeson

Upload: others

Post on 10-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

1

Autonomous Line Follower

Project Group 25: Kyle Romero

Matthew Phelps Christopher Walls

Bilal Bissat Advisor: Dr. Bredeson

Page 2: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

2

Table of Contents

n  I. Project Overview n  II. Physical Design n  III. Sensor Array n  IV. Line Following n V. Symbol Recognition n VI. Problems, Solutions, and Possible

Improvements n VII. Budget and Gantt Chart

Page 3: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

3

I. Project Overview

Page 4: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

4

Project Objective

n  Design and build a mobile device that will follow a path in the shortest amount of time, while recognizing symbols along the way.

n  Tape: ½” Chrome Reflective Tape n  Curvature Radius= Min. 2 feet n  Path Marked By Symbols

Chris Walls End of course

Page 5: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

5

Demo Day Information

n Demo Day held outside in bright sunlight n Track created on top of red brick surface

in E.E. courtyard n Course would have taken approximately

1.5 minutes to complete without problems.

n Random sensor misfirings caused by ambient light and cracks in the brick. A sensor skirt was required.

Chris Walls

Page 6: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

6

II. Physical Design

Page 7: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

7

Custom Build

n The department supplied vehicle was rejected on the basis of size and “clunkiness”.

n A smaller RC car modeled after an Aston Martin was used.

n This vehicle was stripped of: Rear Motor, Front steering box, and suspension.

Kyle Romero

Page 8: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

8

Custom Build cont.

n New chassis made of Plexiglass n Roll cage made from Erector Set n Board 10v3 provided by Department n Originally, a Futaba S3003 was used,

replaced by: Hitec HS-322HD n Sensor Array built using 7 QRB1114’s,

mounted underneath @ mid-car. More on this later in presentation.

Kyle Romero

Page 9: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

9

Hitec HS-322HD Motor Type: 3 Pole Ferrite Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0 Volts Current Drain (4.8V): 7.4mA/idle and 160mA no load operating

Kyle Romero

Page 10: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

10

Steering Overview

n  Initially, Electrical Wire was used. This turned out to be too stretchable.

n This was replaced with Airplane steering wire. This snapped repeatedly due to bending.

n Finally, an Erector set was used to control steering with no dead zones.

Matthew Phelps

Page 11: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

11

Final Car Design

Kyle Romero

Page 12: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

12

Picture of Completed Car

Page 13: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

13

Final Car Physical Specs:

n  Battery: 9.6V RC Car Battery w/ Polarized Connector

n  Dimensions: (27.3cm) x (15.4cm) x (14.2cm) n  Wheel Diameter: 5.7cm n  Turning Radius: 1.7’ n  Weight: .7kg n  Motor Speed: 1100’ / min @ 100%

Bilal Bissat

Page 14: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

14

III. Sensor Array

Page 15: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

15

Sensor Readings Red Brick

Bilal Bissat

Page 16: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

16

• (2) 4x Schmitt Trigger ICs

• (7) QRB1114 IR Emitter/Collector Sensors

• Inverts Vout of Sensor

• Vout of Schmitt Trigger directed to input of Port 5 on Board 10v3

Sensor Array Schematic

Chris Walls

Page 17: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

17

Sensor Array Picture

Page 18: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

18

Optical Sensor (QRB1114)

• 13kΩ between NPN phototransistor and Vin

• 220Ω Between IR Emitter photodiode and Vin

• Vout Taken Between 13kΩ Resistor and Collector

Chris Walls

Page 19: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

19

Schmitt Triggers

Matthew Phelps

TI CD74HCT132E: 4-Input NAND Gate w/ Schmitt Trigger Inverter

2.4V Hysteresis Level for the Schmitt Triggers

Page 20: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

20

Schmitt Trigger Continued

Matthew Phelps

Set High (5.0V)

Page 21: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

21

Sensor Array Design Changes

n Rear row of sensors originally intended for symbol recognition not required.

n Originally, Analog input was intended. Schmitt triggers later added to increase reliability.

n Sensor Height went through several modifications. Final Height: .3cm

Bilal Bissat

Page 22: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

22

IV. Line Following

Page 23: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

23

Line Following Ideas

n Originally, the group was divided between a Logic Based line following implementation and P.I.D.

n P.I.D. won due to it’s ease of coding and reliability.

Chris Walls

Page 24: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

24

P.I.D. : How does it work?

§  P: Proportional §  This part of the algorithm controls steering power as

a percentage of max duty cycle

§  D: Derivative §  This part of the algorithm dampens the steering

correction, preventing over-correction and oscillations.

§  I: Integral §  This part of the algorithm forces the controller to

approach the center point quicker.

Matthew Phelps

Page 25: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

25

P.I.D. Flowchart

Kyle Romero

Page 26: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

26

P.I.D. Code Overview //==========Algorithm==========================================// //-----------P.----------------// p_out = error * KP; //Multiply by KP //-----------I.----------------// i_error = error; //Set Integral Error to Sensor Error int_err = i_error + int_err; //Compute Integral Error i_out = int_err * KI; //Multiply by KI if(i_out>4)int_err=0; //Reset int_err when it gets large. //-----------D.----------------// delta_err = d_error - error; //Compute Derivative Error d_out = delta_err * KD; //Multiply by KD output = p_out + d_out + i_out; //Combine Output percentages //========End Algorithm==========================================// d_error = error; //Reset d_error for next sample return output; //Output Percentage

//

Kyle Romero

Currently:

KP = 17

KD = 7

KI = .0001

Page 27: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

27

V. Symbol Recognition

Page 28: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

28

Symbol Rec. Iterations

n 1st Method: Averaging – Averages of P5IN over symbol – Almost impossible to cover all cases

n 2nd Method: Three Samples – Compare Beginning, Middle, End – Need to hit symbol head-on every time

n 3rd Method: Individual Sensor Comparison – Chosen Method – Compare Left vs. Right side of sensor array.

Bilal Bissat

Page 29: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

29

Modified Din( int pin ) n  Included from SAL Compilation n  Send Din the Pin # you want to check n  It then bitwise &’s the current P5IN with a

threshold value. – EX: To check Pin 1

§ Temp = 0x02; Temp &= P5IN; If( Temp ==0x02 ) return 1; else return 0;

n  Similar Conditions exist for all pins with appropriate hex values

Bilal Bissat

Page 30: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

30

Use of Modified Din()

n For every sample, call Din for each Pin n Store Each Pin State in an array

– Basically mimicking P5IN, except each sensor is an index of the array.

n  Increment values based on Pin states – Pins 1-3 for Left Sensors (val1) – Pins 5-7 for Right Sensors (val2) – Pin 4 for Center Sensors (val3) – Number of times 5 or more sensors fire (val4)

Bilal Bissat

Page 31: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

31

Symbol Handling Flow Chart

Matthew Phelps

Page 32: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

32

Symbol Handling

n  If Left Symbol Detected – Mask Right 4 Sensors to 0 – Causes car to ignore Right path

n  If Right Symbol Detected – Mask Left 4 Sensors to 0 – Causes car to ignore Left path

n  If Ramp Symbol Detected – Up Power for set time

n  If Stop Symbol Detected – Stop

Chris Walls

Page 33: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

33

VI. Problems, Solutions, and Possible Improvements

Page 34: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

34

Problems Encountered

n  Servo connections kept breaking n  Chris Walls played with the Potentiometer on the

Futaba s3003 servo. Go Chris! n  Sensor array soldering was problematic n  4 x Schmitt Trigger IC’s fried n  Symbol Rec. Coding difficult n  Outside Ambient Light interfered with Sensors n  Repeated P.I.D. tuning required due to frequent

servo changes and repairs.

Chris Walls

Page 35: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

35

Problem Solutions n  Finally decided on Erector Set to prevent dead

zones and breakage n  We fired Chris…No actually we just replaced the

servo n  Sensor array was fine after repeated resoldering n  Breadboard used for Schmitt Triggers to prevent

heat damage n  Symbol Rec. Code took many trials and re-

codings n  Ambient light cut down with a sensor skirt n  P.I.D. worked better after steering solidified

Chris Walls

Page 36: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

36

Possible Improvements

n  More sensors in one row to improve P.I.D. sensitivity.

n  If back sensors are used, space them far enough apart to cover entire symbol.

n  Design sensor array to work in bright light conditions without impromptu additions

n  Pulse sensor array instead of continous read to eliminate many errors – John Carroll

n  Increase structural soundness. For example, ensure screws and glue will not come off.

Matthew Phelps

Page 37: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

37

VII. Budget and Gantt Chart

Page 38: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

38 Chris Walls

Page 39: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

39

Gantt Chart – Part 1

Page 40: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

40

Gantt Chart – Part 2

Page 41: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

41

Gantt Chart – Part 3

Page 42: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

42

References •  ‘Alldatasheet.com’, CD74HCT132E NAND Gates w/ Schmitt Trigger Inverter,

http://pdf1.alldatasheet.com/datasheet-pdf/view/27006/TI/CD74HCT132.html

• ‘ABRobotics’, Snuffy Line Follower Sensors: QRB1114, http://abrobotics.tripod.com/Snuffy/line_sensor.htm

• ‘Servocity’, Hitec HS-322HD Servo, http://www.servocity.com/html/hs-322hd_standard_deluxe.html

• ‘Wikipedia’, P.I.D., http://en.wikipedia.org/wiki/PID_controller

Page 43: Kyle Romero - Autonomous Line Follower · Size: 1.57"x0.79"x 1.44" (40x20x36.5mm Weight: 1.51oz (43g) Control System: +Pulse Width Control 1500usec Neutral Operating Voltage: 4.8-6.0

43

Questions?