University of Manchester
School of Electrical & Electronic Engineering
Embedded Systems Project
DESIGN REPORT #2
Sensor Selection and Navigation Strategy
Group Number: 35
Group Members:
Paul Gregory
7642415
Udara Perera
8023572
Sina Shaham Tutor: Prof Hong Wang
8205454
Date: 23/11/2012
Yundi Wang
8162888
Table of contents
Cedric Harry
8012097
Title Page number
Page 1
i. Introduction (1.0) 3-4
Description of task (1.1)
Aims and objectives (1.2)
ii. Motor characteristics (2.0) 4-7
Laboratory (2.1)
Laboratory results (2.2)
Calculations (2.3)
iii. Buggy measurements (3.0) 8-9
iv. Gearbox design (4.0) 9-10
Calculations (4.1)
v. Conclusion (5.0) 10
vi. References (6.0) 11
1.0 Introduction
Page 2
Designing a functioning sensor circuit is a key aspect to the embedded systems
project. It provides a way of measuring the physical quantity and converting the
signal into useable data for the PIC to interpret.
The sensor circuit allows the buggy to sufficiently navigate the entire track as well as
perform a controlled stop within the given distance before the target wall. In order to
achieve this, the team must select the appropriate sensors by taking a number of
considerations into account to efficiently navigate the buggy around an unknown
track with breaks and bends. The sensors will supply information to the motors and
gearbox to form a complete autonomous vehicle. The following report explains in
detail how the team plans to tackle these tasks and optimise the navigation for the
buggy.
1.1 Description of Task
To design a range of sensors that allows the buggy to navigate a particular track.
Target wall
Ramp - 15° slope Raised part of track – 330mm
high
White line – 150mm
Surrounding wall – from each wall
50mm high
Start
Fig.1 (rough layout of a track)
The track has a white line on a black background surrounded by a 50mm high wall.
The white line will be 150mm from each wall and terminates before the target wall.
The buggy must come to a controlled stop 200mm from the target wall. The buggy
must also navigate bends of up to 45° and cope with 2mm breaks in the track, in the
direction of travel and 50mm laterally.
Page 3
1.2 Aims and objectives
Firstly the aim is to decide which sensors the team will be selecting and how many,
Secondly how to interface these circuits to the microcontroller and thirdly a
navigation strategy for navigating the buggy around the track. The following list
details each process that needs to be undertaken in order to achieve the above.
Navigation strategies
Sensor characteristics
Testing of sensors
Circuit simulations
Interfacing ideas
Tests plans
2.0 Navigation strategies
Navigation is a key aspect in designing an effective autonomous buggy. There are
many ways to navigate the proposed track, some more effective than others. There
are certain constraints and obstacles to overcome such as breaks in the white line
(in direction of travel and lateral) and performing a controlled stop at the end of the
track. As a team we studied the following strategies as we believe these are the
most effective algorithms and techniques for navigation.
2.1 ALF Navigation Strategy
The ALF strategy is a line following technique using
light sensors to detect the change in voltage on
different coloured surfaces. This strategy is based
upon the fact that the sensors will give logic HIGH to
the controller or PIC when it detects a white line and
a logic LOW when the sensors see black. This
algorithm can be implemented using two middle
sensors for navigation (SR and SL). The algorithm
takes into consideration overshooting of the buggy,
which will lead to loss of control, by including a
‘search for the line’. Appendix 2 illustrates this
algorithm.
Fig.2 (movement of buggy)
The direction of the buggy will be determined by
the status of the sensors.
Page 4
If SR (right sensor) and SL (left sensor) are on the white line then the buggy
will stay true.
If SR is sensing black then it signals the right sensor to speed up and the left
motor to slow down i.e. turning the buggy left.
If SL senses black then it signals the left sensor to speed up and the right
sensor to slow down i.e. turning the buggy right.
Using just two sensors for the navigation is not very efficient as the buggy could
easily overshoot on bends at speed. Also the left and right approach to the
algorithm can cause the buggy to be quiet jerky whilst navigating the track.
2.2 Team Navigation Strategy
The team developed a navigation strategy based on the placement of the sensor
design.
•Ultrasonic sensors will detect the target wall
•5 central optical sensors will follow the line. Central sensors
will correct the buggy’s moving direction with voltage
changing.
•If the broken track changes direction, the 3 peripheral optical
sensors will detect that. They also have priority over the
central optical sensors, i.e. if both central and peripheral
sensors track the line, the buggy will follow the direction of the
peripheral ones.
Fig.4 (layout of sensor design; not to scale)
Ultrasonic sensors, to detect walls
Central optical sensors, to follow the line
Peripheral optical sensors (have priority), to detect broken track
The four outer sensors have slightly less voltage than the middle sensor due to the
sensors seeing part white and part black. These sensors can adjust the buggy when
it starts to veer left or right from the line. The two peripheral sensors on the sides of
the buggy detect the 50mm lateral breaks (in the direction of travel). The two ultra-
sonic sensors are for detecting the walls around the track breaks either travelling left
or right. Where the buggy can then begin to turn left or right and the peripheral
sensors can search for the white line. See Appendix 1 for full description and
operation of the navigation.
2.3 PID Navigation strategy
Page 5
PID (Proportional-integral-differential) controller is a very efficient control loop
mechanism that can be used to control the navigation of the buggy. It works by
calculating an error based on the difference between a variable (in this case light
differences between white and black) and a proportional constant (this is the
proportional range). P is the calculated error from the sensor array, I is the sum of all
these errors, and D is the prediction of the future errors.
P can be thought of as the equation of a straight line
Y =mx+b (1)
This is known as the proportional line follower. Using this equation the buggy turns
smoothly between the two error limits as appose to navigation strategy 2.1 and 2.2. If
the sensor readings say the buggy is close to the line it does a small turn, if the
buggy is further away from the line it does a sharper turn. This means there is a
linear relationship between the two error limits (error for black and error for white).
Equation 1 can then be related to a turn for the buggy by making the following
substitutions;
T urn=K∗error (2 )
Turn – Turn represents Y, which as can be seen from Fig.5 is the distance up
and down the Y-axis
K – is the proportional constant, this represents m which is the slope of the
line. K is always multiplied by the error to make a turn.
error – error represents X, which is the distance on the X-axis. This says how
far off the line the buggy is
Fig.5 (proportional line follower example)
This very important concept means that the proportional range (light sensors) can be
related to the motors, since they also have a proportional range i.e. -100 (full reverse
power) and 100 (full forward power). By using equations (3) and (4) the sensor
information can automatically set the power levels for each motor.
Tp+Turn ( 3 )
Tp−Turn(4 )
Page 6
Tp – is the Target Power level. This is the power level for both motors when the
buggy is going straight. Which is achieved when error = 0. The target power level
could be 50% for example. Equation (5) demonstrates how the final algorithm can be
implemented to achieve a turn
Turn=Kp∗error + Ki∗integral+ Kd∗derivative (5)
Kp – proportional constant for proportional
Ki – proportional constant for integral
Kd – proportional constant for derivative
3.0 Proposed Strategy
The team concluded that the most efficient navigation strategy would be using PID
with the sensor design in Fig.6
Fig.6 (sensor design layout)
The sensor array in Fig.6 uses an LED and LDR combination. This combination
offered the widest distinction between the two regions (black and white). They do not
offer the fastest reaction time but this could be used as an advantage for the breaks
in the white line.
It has 8 sensors and 1 ultra-sonic sensor (not in Fig.6). Each spaced roughly 5mm
apart and 10mm from the floor. This gives a wide range of detection as well as
proportional range and with reasonable ground clearance. Placing the sensors at
the front of the buggy also gives the sensors adequate time to relay the information
back to the motors.
The wide array layout of 120mm also allows the furthest sensors to detect lateral
breaks in the line. The two sensors in the centre will detect the white line and will
also be unaffected by the 2mm break (in the direction of travel) as at least one
sensor will always see white.
Page 7
Also because of the sensor array there will always be one sensor or more tracking a
white line. So when all sensors detect black the buggy will stop i.e. the controlled
stop at the end of the track. So in theory this array should cover all outcomes.
4.0 Sensor Characteristics
Voltage change using LED and LDR
3.5
3
2.5
white tape
2
voltage (v)
black tape
1.5 edge of white tape
break in line
1
0.5
0
0 5 10 15 20 25 30 35
distance (mm)
Voltage change using LED and Photodiode
5
4.5
4
3.5
3 white tape
voltge (v)
black tape
2.5
edge of white tape
2 break in line
1.5
1
0.5
0
0 5 10 15 20 25 30 35
distance (mm)
Page 8
Voltage change using LED and Phototransistor
5
4.5
4
3.5
3 white tape
votage (v)
black tape
2.5
edge of white tape
2
break in line
1.5
1
0.5
0
0 5 10 15 20 25 30 35
distance (mm)
Voltage change using Infra-Red LED and Pho-
totransistor
4.9
4.8
4.7
4.6
white tape
4.5 black tape
Voltage(v)
4.4 edge of white tape
break in line
4.3
4.2
4.1
4
3.9
0 5 10 15 20 25 30 35
Distance (mm)
Page 9
Page 10
6.0 References
http://robotic.iaun.ac.ir/files/robotic_10.pdf
http://www.societyofrobots.com/member_tutorials/book/export/html/353
http://www.inpharmix.com/jps/PID_Controller_For_Lego_Mindstorms_Robots.html
7.0 Appendix
Appendix 1
5 central optical sensors follow a straight line
Sensor in the middle have the highest voltage
4 surrounding sensors have same voltages, and it is a little bit lower than the middle
sensor’s (according to sensor testing result)
Page 11
Buggy shakes when following the straight line.
Voltage does not change
Voltages decrease. (for moving to the middle of line)
Voltages increase. (As moving out of the edge)
The buggy receives the specific signal and turns right to correct the direction
Page 12
Buggy at angled turn or curve
Voltages do not change
Voltages decrease. (for moving to the middle of line)
Voltages increase. (As moving out of the edge)
The buggy meets a broken track
Page 13
The voltages do not change
Sensors detect black areas.
Voltages do not change
Sensors detect black areas.
Peripheral sensor that track the line and have priority to make the buggy turn
Ultrasonic sensor detect the wall and make buggy turn to track new line.
Page 14
After turning the peripheral sensor detect the line and make buggy follow its direction.
Appendix 2
Page 15
Appendix 3
Table 1
White LED and LDR combination
Distance white tape black tape edge of white break in line
(mm) tape
5 2.9 1.5 2.4 2.4
10 2.6 1.4 2.03 2.25
15 2.27 1.22 1.88 1.87
20 1.67 1.17 1.48 1.47
25 1.49 1.13 1.34 1.4
30 1.31 1.07 1.18 1.2
Table 2
White LED and photodiode
Distance white tape black tape edge of white break in line
(mm) tape
5 4.371 3.833 4.125 4.035
10 4.143 3.825 4.012 3.971
15 4.026 3.817 3.955 3.891
20 3.921 3.797 3.892 3.875
25 3.872 3.798 3.831 3.848
30 3.787 3.56 3.819 3.841
Table 3
LED and phototransistor
Distance white tape black edge of white break in line
(mm) tape tape
5 4.581 3.978 4.387 4.322
10 4.532 3.982 4.339 3.342
15 4.52 3.933 4.401 4.347
20 4.527 3.989 4.068 4.331
25 4.453 4.012 4.234 4.37
30 4.423 4.013 4.262 4.251
Table 4
Page 16
Infar-red LED and phototransistor
Distance white tape black edge of white break in line
(mm) tape tape
5 4.782 4.316 4.717 4.748
10 4.768 4.333 4.633 4.695
15 4.745 4.322 4.628 4.552
20 4.68 4.26 4.614 4.549
25 4.641 4.255 4.605 4.45
30 4.604 4.252 4.31 4.505
Page 17