Upload
albert-sutton
View
218
Download
0
Tags:
Embed Size (px)
Citation preview
ECE 485: Electrical ECE 485: Electrical Engineering Design I Engineering Design I
ProjectProjectBy Group 2: Joel Marcia,By Group 2: Joel Marcia,
Paul Rosensteel,Paul Rosensteel,Scott Laminack,Scott Laminack,
and Justin Lanhamand Justin Lanham
Overview: The ProblemOverview: The Problem
To design and implement the hardware To design and implement the hardware and software to control the Trekker and software to control the Trekker Robot in three competitions:Robot in three competitions:
1.1. Go around outside loop 3 times.Go around outside loop 3 times.2.2. Go around outside loop at least once, Go around outside loop at least once,
then take the inside loop twice.then take the inside loop twice.3.3. Evade an obstacle on the track and Evade an obstacle on the track and
follow the guidelines from competition 2.follow the guidelines from competition 2.
Overview: SpecificationsOverview: Specifications
OOPic R with a OOPic R with a L7806 – 6V L7806 – 6V Voltage Regulator Voltage Regulator (TO220 Package) (TO220 Package)
OOPic R OOPic R Expansion BoardExpansion Board
Pictures from http://www.superdroidrobots.com/shop/category.asp?catid=25
Overview: SpecificationsOverview: Specifications
A Sharp A Sharp GP2D12 IR GP2D12 IR SensorSensor
A Devantech A Devantech SRF04 SRF04 Ultrasonic Ultrasonic RangerRanger
IR1.Value vs. Dy = 6.1979x - 1.1019
R2 = 0.9984
00000
00020
00040
00060
00080
00100
00120
00140
0.0 2.0 4.0 6.0 8.0 10.0 12.0 14.0 16.0 18.0 20.0
D (inches)
IR1.
Valu
e
IR1.Value vs D
Linear (IR1.Value vs D)
U2.Value vs D
y = 5.2785x + 12.763
R2 = 0.9996
00000
00050
00100
00150
00200
00250
0.0 5.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0
D (inches)
U2.
Val
u
Overview: SpecificationsOverview: Specifications
4 QRB1134 4 QRB1134 Phototransistors Phototransistors with mounting with mounting bracketbracket
2 HiTec HS-422 2 HiTec HS-422 servos to control servos to control the wheels the wheels
1 HiTec HS-311 1 HiTec HS-311 servo to control servo to control the ranger or IR the ranger or IR sensorsensor
Pictures from http://www.superdroidrobots.com/shop/category.asp?catid=25
Optimizing Software andOptimizing Software andAlgorithmsAlgorithms
Game PlanGame Plan
No “If … Then” statementsNo “If … Then” statements Might be easier getting stated, but more Might be easier getting stated, but more
work in the long runwork in the long run
Use object codes to create a virtual Use object codes to create a virtual circuitcircuit Simplify the codeSimplify the code Easier to debugEasier to debug Changes are easier to makeChanges are easier to make
Key Object Codes UsedKey Object Codes Used
oServoSP1 oServoSP1
oTrackeroTracker
oNavConoNavCon
oCompare2oCompare2
oServoSP1oServoSP1 Designed to control servos or to interface Designed to control servos or to interface
servos with different objectsservos with different objects
Specifically used with hacked servosSpecifically used with hacked servos
Supports URCP values (positive and negative Supports URCP values (positive and negative values)values)
Unique property – set Value property to 0, no Unique property – set Value property to 0, no pulses are sent to the servo (wheels stop pulses are sent to the servo (wheels stop completely)completely)
*Key Points using *Key Points using oServoSP1oServoSP1
Set the left servo Set the left servo InvertOutInvertOut property property to “1” – sets wheels turning in the to “1” – sets wheels turning in the same directionsame direction
Set Set RefreshRefresh property to “1” – doubles property to “1” – doubles the pulses sent to servos (increases the pulses sent to servos (increases torque)torque) Tested using o’scope: 36.2 Hz to 73.53 Tested using o’scope: 36.2 Hz to 73.53
HzHz
oTrackeroTracker Designed to use digital sensor inputs Designed to use digital sensor inputs
(line followers) to determine the (line followers) to determine the location of a black line on a white location of a black line on a white backgroundbackground
Formats URCP readings to express how Formats URCP readings to express how much it needs turn much it needs turn Range of values +/-8, +/-16, +/-24, +/-32Range of values +/-8, +/-16, +/-24, +/-32
Maximum of four sensor inputs Maximum of four sensor inputs
*Key Points using oTracker*Key Points using oTracker
Setting the Setting the WidthWidth property to “1” property to “1” allows the use of only three sensors allows the use of only three sensors Range of values Range of values +/-8, +/-24, +/-32 (no +/-8, +/-24, +/-32 (no
+/-16)+/-16) The fourth sensor was used to detect The fourth sensor was used to detect
the “inner circle” with an oEventthe “inner circle” with an oEvent
oNavConoNavCon
Coverts the information received from Coverts the information received from oTracker into motor control speed for the oTracker into motor control speed for the servosservos
Takes the predetermined “Speed” value then Takes the predetermined “Speed” value then adds or subtracts the values received from adds or subtracts the values received from oTracker (URCP values) and send them to the oTracker (URCP values) and send them to the servosservos
*Key Point using oNavCon*Key Point using oNavCon
Set oNavCon to ”0” to turn off the Set oNavCon to ”0” to turn off the line following subroutineline following subroutine This allowed us to turn off or override This allowed us to turn off or override
the line following subroutine to make the line following subroutine to make adjustments for a special “event” adjustments for a special “event”
oCompare2oCompare2
Used with the sonar sensorUsed with the sonar sensor
Triggered depending on distanceTriggered depending on distance
Compares two numbers Compares two numbers (predetermined upper and lower (predetermined upper and lower limits) and sets the servo speed limits) and sets the servo speed values to follow a along a wall or go values to follow a along a wall or go around a “box”around a “box”
Basic Flow DiagramBasic Flow Diagram
Line following(oTracker)
oNavCon
Inner Circle(oEvent)
Go around box(oCompare2)
oNavCon on
Wheels(oServoSP1)
oNavCon off
oNavCon off
Competitions 1 & 2Competitions 1 & 2
Round #1 of Line Round #1 of Line Following CompetitionFollowing Competition
Objective: To complete three laps Objective: To complete three laps around the black line track where around the black line track where one lap must be around the outer one lap must be around the outer
loop of the track.loop of the track.
The Line Following SensorsThe Line Following Sensors
The Line Following CircuitThe Line Following Circuit The circuit for an individual line-followerThe circuit for an individual line-follower
• Pull-Up Resistor = 10 kPull-Up Resistor = 10 k• Rf Resistor = 220 Rf Resistor = 220 • Line follower Capacitor = 0.1 Line follower Capacitor = 0.1 FF
Complete Line Following CircuitComplete Line Following Circuit
The Line Following Printed Circuit The Line Following Printed Circuit BoardBoard
Capacitors Used in Line Following Capacitors Used in Line Following Circuit BoardCircuit Board
We found documentation explaining We found documentation explaining how capacitors could be included in how capacitors could be included in the line following circuit to reduce the line following circuit to reduce noise that the line followers may pick noise that the line followers may pick up.up.
The capacitors are connected to the The capacitors are connected to the line followers in hopes of leveling out line followers in hopes of leveling out the ripple in the signal out.the ripple in the signal out.
No Significant DifferenceNo Significant Difference We tested the Trekker with, and without We tested the Trekker with, and without
the capacitors in the circuitthe capacitors in the circuit No significant difference was found.No significant difference was found. Therefore we chose to remove the Therefore we chose to remove the
capacitors from the line following circuit capacitors from the line following circuit board.board.
Our design of the circuit board made Our design of the circuit board made removal of the capacitors easy, as they removal of the capacitors easy, as they were connected from behind using free were connected from behind using free wireswires
These wires were cut, electronically These wires were cut, electronically removing the capacitors from the circuitremoving the capacitors from the circuit
Direction of Travel Around the Direction of Travel Around the TrackTrack
Servo Values S4 and S5Servo Values S4 and S5
The coded values of S4 and S5 refer The coded values of S4 and S5 refer to server rotational speedsto server rotational speeds
S4’s value directly corresponds with S4’s value directly corresponds with the Right Wheel’s rotational speedthe Right Wheel’s rotational speed
S5’s value directly corresponds with S5’s value directly corresponds with the Left Wheel’s rotational speedthe Left Wheel’s rotational speed
Finding the center of the servos Finding the center of the servos rotational speed valuesrotational speed values
From Trekker Experiment #3From Trekker Experiment #3 S4 and S5 relationship with the rotational S4 and S5 relationship with the rotational
speed of the wheel was foundspeed of the wheel was found
Wheel Speed vs. SX.Value
-15.00
-10.00
-05.00
00.00
05.00
10.00
15.00
0 20 40 60 80 100 120
SX.Value
Wh
eel
Sp
eed
(in
/sec
)
Right Wheel
Left Wheel
Left and Right Wheel Speeds are Left and Right Wheel Speeds are not the samenot the same
Wheel Speed vs. SX.Value
-15.00
-10.00
-05.00
00.00
05.00
10.00
15.00
0 20 40 60 80 100 120
SX.Value
Wh
eel
Sp
eed
(in
/sec
)
Right Wheel
Left Wheel
Reversal of Direction Reversal of Direction
Because the left servo and the right Because the left servo and the right servo are opposite of each other, servo are opposite of each other, they each travel in opposite they each travel in opposite directions relative to one anotherdirections relative to one another
To remedy this, one of the servo’s To remedy this, one of the servo’s values is invertedvalues is inverted
Now both wheels will move the Now both wheels will move the Trekker forward at the same time.Trekker forward at the same time.
First Competition Program Works!!First Competition Program Works!!
The initial line following program was The initial line following program was uploaded to the OOPic R.uploaded to the OOPic R.
The Trekker successfully went The Trekker successfully went around the outer loop of the trackaround the outer loop of the track
First run around the track was very First run around the track was very slowslow
Improvements to ProgramImprovements to Program
Had to find a good value for the servo Had to find a good value for the servo speedsspeeds• Not too slow, or the Trekker would take too Not too slow, or the Trekker would take too
long around the turns. It would have a very long around the turns. It would have a very “jerky” stop and go manuever.“jerky” stop and go manuever.
• Not too fast, or the Trekker would leave the Not too fast, or the Trekker would leave the black line on the turns and not return.black line on the turns and not return.
A speed value of 31 was found to be the A speed value of 31 was found to be the best for what we neededbest for what we needed
Number of Line Following SensorsNumber of Line Following Sensors
The more line following sensors employed The more line following sensors employed in the design, the faster the Trekker in the design, the faster the Trekker should be able to traverse the courseshould be able to traverse the course
Using Four SensorsUsing Four Sensors• Time around track = 1 min 6 secTime around track = 1 min 6 sec
Using Three SensorsUsing Three Sensors• Time around track = 1 min 5 secTime around track = 1 min 5 sec
Three sensors are used in the final design Three sensors are used in the final design of the Line Following programof the Line Following program
Three Outer Loops, no Inner LoopsThree Outer Loops, no Inner Loops
Our Trekker made it successfully Our Trekker made it successfully around the outer loop of the track around the outer loop of the track three times.three times.
No inner loop attempt was madeNo inner loop attempt was made
Round #1 Line Following Round #1 Line Following Competition ResultsCompetition Results
Best time around the track:Best time around the track:• 01:00.75 01:00.75
Competition Ranking:Competition Ranking:• 44thth Place overall Place overall• 8 Points awarded8 Points awarded
Round #2 of Line Following Round #2 of Line Following CompetitionCompetition
Competition Objectives:Competition Objectives: To complete three laps around the black To complete three laps around the black
line trackline track One lap around track must be upon the One lap around track must be upon the
outside loopoutside loop
Group Objectives:Group Objectives: To complete two laps around the inner To complete two laps around the inner
loop of the trackloop of the track Make a better time around the track three Make a better time around the track three
times than in Round #1 of the Line times than in Round #1 of the Line Following Competition Following Competition
Line Following and Inner Track Line Following and Inner Track SensorsSensors
Line Following SensorsLine Following Sensors• Three used, as were used in the Round Three used, as were used in the Round
#1 of the competition#1 of the competition Inner Track SensorsInner Track Sensors
• One was used away from the three Line One was used away from the three Line Following SensorsFollowing Sensors
Direction of Travel and Inner Loop Direction of Travel and Inner Loop Sensor PlacementSensor Placement
Direction of Direction of Travel around Travel around tracktrack• ClockwiseClockwise
Placement of Placement of Inner Loops Inner Loops SensorSensor• On the left side of On the left side of
the Trekker when the Trekker when facing the Trekker facing the Trekker front first.front first.
Line Following and Inner Loop Line Following and Inner Loop Sensor PlacementSensor Placement
Outer Loop BehaviorOuter Loop Behavior
For the first lap, the Inner Loop For the first lap, the Inner Loop Sensor will record each time it Sensor will record each time it passes over the inner loop.passes over the inner loop.
Inner Loop BehaviorInner Loop Behavior
After the first lap, and the inner sensors After the first lap, and the inner sensors having noted the inner loop twice.having noted the inner loop twice.• Every time the inner loop sensor notices a Every time the inner loop sensor notices a
black line the Trekker will turn to the right, and black line the Trekker will turn to the right, and take the Inner Loop around until it finds the take the Inner Loop around until it finds the opposite side of the track on the Outer Loopopposite side of the track on the Outer Loop
Testing and ImprovementsTesting and Improvements
We needed to make the Trekker We needed to make the Trekker have smoother turns around the have smoother turns around the corners of both the outer and inner corners of both the outer and inner loops of the trackloops of the track• This was done by changing the coded This was done by changing the coded
values for the right servo’s center, the values for the right servo’s center, the left servo’s center, the oNav.Center, the left servo’s center, the oNav.Center, the LeftServo.Value, the RightServo.Value, LeftServo.Value, the RightServo.Value, and the overall speed of the Trekkerand the overall speed of the Trekker
Results of Testing and Round #2 of Results of Testing and Round #2 of the Line Following Competitionthe Line Following Competition
Round #2 Line Following Round #2 Line Following Competition ResultsCompetition Results
Best time around Best time around track:track:• 0:50.510:50.51
Competition Competition Ranking:Ranking:• 33rdrd Place Overall Place Overall• 18 Points Awarded18 Points Awarded
Competition 3Competition 3
Round #3 of Line Following Round #3 of Line Following CompetitionCompetition
A familiar problem:A familiar problem: Recognize Inner Recognize Inner
Loop Loop Recognize Tool BoxRecognize Tool Box Line Follow: once Line Follow: once
outer Loop, and outer Loop, and twice inner Looptwice inner Loop
Oh, and navigate Oh, and navigate at most 8.5 inches at most 8.5 inches from Tool Boxfrom Tool Box
Tool Box Solution Tool Box Solution
Hardware:Hardware: Devantech SRF04 Devantech SRF04
Ultrasonic Range Ultrasonic Range Finder Finder
HiTec HS-311 HiTec HS-311 ServoServo
Objects to utilize Objects to utilize hardware:hardware:
oSonarDVoSonarDV oServoSP1oServoSP1 oCompare2: oCompare2:
Properties Properties (Above, Below and (Above, Below and Between) Between)
The Set UpThe Set Up
11stst oCompare2.Input set oCompare2.Input set to oSonar.Valueto oSonar.Value
22ndnd ReferenceIn1 set to ReferenceIn1 set to Lower oSonar.Value = Lower oSonar.Value = 53 and ReferenceIn2 53 and ReferenceIn2 set to Upper set to Upper oSonar.Value = 58oSonar.Value = 58
33rdrd Allow oCompare to Allow oCompare to call Sub Routines to call Sub Routines to maintain 8.5 inches maintain 8.5 inches from tool boxfrom tool box
SonarSonar
Operation of Sonar Operation of Sonar device device
Maximize sample Maximize sample rate. How? (Link rate. How? (Link Sonar.Operate to Sonar.Operate to OOPIC.HZ60)OOPIC.HZ60)
SRF04 TimingSRF04 Timing
Need to toggle at a rate that sonar needs to monitorNeed to toggle at a rate that sonar needs to monitor
SRF04 GraphSRF04 GraphVE(t) vs D
y = 0.144x + 0.1348
R2 = 0.9988
0.000
1.000
2.000
3.000
4.000
5.000
6.000
0.0 5.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0
D (inches)
Pu
lse
Wid
th o
f V
E(t
) (
ms)
Function of Sub RoutinesFunction of Sub Routines
We had Four Sub Routines:We had Four Sub Routines: Flag Inner – Used differently than previous Flag Inner – Used differently than previous
competitions.competitions. Above - Servo control to turn left.Above - Servo control to turn left. Below – Servo control to turn right.Below – Servo control to turn right. Between – Servo control to go StraightBetween – Servo control to go Straight Note: Each Sub controlled operation of Note: Each Sub controlled operation of
oNavcon oNavcon
Competition DayCompetition Day
What Happened? A) What Happened? A) Failed to detect object consistently B) Failed to detect object consistently B) When oCompare operated, Sonar Servo When oCompare operated, Sonar Servo lost sight of object and Our Left Turn Sub lost sight of object and Our Left Turn Sub routine was called.routine was called.
Possible Solution:Possible Solution: A) First Right Turn was a hard turn, we A) First Right Turn was a hard turn, we
needed a set up sub routine and a means needed a set up sub routine and a means to return to line follower. to return to line follower.
B) Improve Sonar Performance.B) Improve Sonar Performance.
Overall ResultsOverall Results
Completed two of Completed two of the three the three competitions.competitions.
Placed 2Placed 2ndnd in the in the class overall.class overall.
Project was a Project was a success overallsuccess overall
ConclusionsConclusions
What we learned:What we learned: The importance of working as a The importance of working as a
team.team. Using indicators in a circuit to help Using indicators in a circuit to help
with troubleshooting.with troubleshooting. Integration of external devices with Integration of external devices with
a microcontroller.a microcontroller. Data sheets are helpful in design Data sheets are helpful in design
and implementation.and implementation.
Conclusions ContinuedConclusions Continued
What we learned:What we learned: How an infrared sensor, a sonar How an infrared sensor, a sonar
sensor, and optical sensor work.sensor, and optical sensor work. Utilization of these devices to Utilization of these devices to
accomplish an objective.accomplish an objective.
ReferencesReferences
““OOPic Manual.” Retrieved from OOPic Manual.” Retrieved from http://www.oopic.com/http://www.oopic.com/..
““Trekker Robot. Retrieved from Trekker Robot. Retrieved from ”http://www.superdroidrobots.com/sh”http://www.superdroidrobots.com/shop/.op/.