Sunteți pe pagina 1din 19

Coventry University

Design Coursework
Assignment

M04AEE Robotics: Kinematics, Dynamics and Applications




















Giovanna Di Palermo Perez
Student ID: 5594700
E-mail: dipalerg@uni.coventry.ac.uk
2014


Introduction
This assignment had the objective to design, using logical gates, a line
follower robot that could detect and react to obstacles. The use of microcontrollers
and FPGAs wasnt allowed.
Four photodiodes were responsible to recognise the white line in a darker
background. Also, to detect the object, a touch sensor was added to the project. To
control the motors, a L298 IC was connected. Each component should send a signal
to the motor controller, in order to indicate a different response, such as go forward,
turn left, turn right or spin. From the expected responses, a truth table for each
component were obtained. These tables helped to minimize the circuit, using the
Karnaugh Mapping methodology.
Once designed, the circuit was simulated using the software Protheus.

Design
Motor Control Methodology (L298IC)
Initially, the format of the robot must be considered. To be able to position
the wall sensors in a shape that will be explained later, a circular structure was
selected. Also, looking for a wheel configuration that allows the robot to move each
wheel independently and turn on the spot, the differential drive system, with two
additional points of contact, was chosen. Considering that the surface on which the
robot should walk is flat and even, a four wheel configuration can be utilised without
the need of an additional suspension system.
The differential drive adopted has two wheels driven by two independent
motors and two passive castors wheels. The two differential wheels axis are collinear
in the diameter line of the robot and the other two are positioned in the
perpendicular line of the differential wheels axis.
Both motors will be controlled by a L298 IC. This integrated circuit is a dual
full-bridge controller:


Figure 1: Dual Full-Bridge Driver Block Diagram (L298 IC)
A full bridge circuit drives a motor forward or backward depending on the
inputs given. When Input 1 is 1 and Input 2 is 0, a motor should drive in the opposite
direction than if Input 1 is 0 and 2 is 1. Also, the Enable pin allows to interruptions to
occur independently of the input signals.
To turn on the spot, each wheel has to drive at the same speed in opposite
directions. To drive forward, both wheels need to develop the same speed in the
same direction. To make a left curve, the right wheel will be driven while the left one
keeps stationary. To a curve to the right, the left wheel must be driven while the
right one keeps stationary.

Function
Inputs
EnA EnB In1 In2 In3 In4
Forward 1 1 1 0 1 0
Reverse 1 1 0 1 0 1
Left 0 1 0 0 1 0
Right 1 0 1 0 0 0
Spin 1 1 1 0 0 1
Table 1: Logic inputs to activate the L298 chip (Tickle, et al., 2008)
Line Sensor (Photodiode)
Based on the principle that a colour just reflect its own light frequency and
absorbs all others, to recognise the white line on a dark colour background, four
photodiode sensors will be utilised. Photodiodes are semiconductor devices that
generates current when absorb photons. So, when a LED emits a light, it is expected
that the photodiodes positioned above the white line (white is the addition of all
colours, so it reflects all light frequencies) will be more stimulated than the others
over the dark background.
Each photodiode will be positioned next to a LED that will emit the light to be
reflected. If the colour of the background is known, then it is a good choice to select
a LED from a different colour. This would improve the sensibility once the
background would reflect less. In the specific case, this information is not provided,
so the LEDs will emit infrared light. It is necessary also, to provide a physical barrier
between the LED and the photodiode so the emitted light doesnt distort the reading
of the reflected light. The photodiodes will be disposed in a way that the distance
between them is smaller than the width of the line, but not small enough for three
sensors to be perpendicularly over the line at the same time.








1 2 3 4
Figure 2: Four Photodiodes (grey dots) and
Four IR LEDs(black dots) configuration
Consider that high logical level means that the sensor is reading the white
line and low logic level means background. When the two central photodiodes are
set as 1, the robot must walk forward. If the two on the left are reading the white
light, then a curve to the left is necessary. If the two on the right are receiving high
logic level, then it must drive a curve to the right. If all of them are receiving low
logic, them the robot must respond to the wall sensor.


The output of each photodiode will pass through a comparator operational
amplifier. The inverting input will be connected to a potentiometer which will be
responsible to set a suitable threshold between the line and the background. So, if
the voltage generated by the photodiode is higher than the reference, which means
that it recognises the white line, the output will be 5V (high level), if it is smaller than
the reference, then the output will be 0V.
Based on the wanted results, the following truth table could be designed. In
it, when a photodiode is set by 1 it means that it is receiving the light reflected from
the line.

Figure 3: Perception of the line and Reaction

Truth Table Photodiodes
Photodiode 1 (A) Photodiode 2 (B) Photodiode 3 (C) Photodiode 4 (D)
Enable A Enable B Input 1 Input 2 Input 3 Input 4
0 0 0 0 Spin
1 1 1 0 0 1
0 0 0 1 Curve to the Right
1 0 1 0 0 0
0 0 1 0 Not applicable
x x X X X x
0 0 1 1 Curve to the Right
1 0 1 0 0 0
0 1 0 0 Not applicable
x x X X X X
0 1 0 1 Not applicable
x x X X X X
0 1 1 0 Drive Forward
1 1 1 0 1 0
0 1 1 1 Not applicable
x x X X X X
1 0 0 0 Curve to the Left
0 1 0 0 1 0
1 0 0 1 Not applicable
x x X X X X
1 0 1 0 Not applicable
x x X X X X
1 0 1 1 Not applicable
x x X X X X
1 1 0 0 Curve to the Left
0 1 0 0 1 0
1 1 0 1 Not applicable
x x X X X X
1 1 1 0 Not applicable
x x X X X X
1 1 1 1 Not applicable
x x X X x X
From it, a Karnaugh Map was designed for each output:






A

0 x 1 1



x x 1 x
C
B
x x x 1
0 x x x

1 x 0 1



x x 0 x
C
B
x x x 1
1 x x x





Enable A
Enable B




A

0 X 1 1



X x 1 x
C
B
x x x 1
0 X X x



1 =

0 x 0 0



x x 0 x
C
B
x x x 0
0 x x x




2 = 0






Input 1
Input 2





A

1 1 0 0



x x 0 X
C
B
x x X 1
1 x x x




3 = +




A

0 x 0 1



x x 0 x
C
B
x x x 0
0 x x x




4 =

= + +


These maps provide a simplified circuit for the connection with the motor.
This is not the final connection once the wall sensor still needs to be considered. But,
when no obstacles are detected, the inputs of the motor will be:
=


Input 4
Input 3
=


1 =


2 = 0
3 = +
4 =

= + +


Wall Sensor (Contact/touch)
To avoid the obstacles in the route, a contact sensor should be used.
Basically, when this device is pressed or bumps into something, it shorts a circuit,
pulling the signal line high or low (Society of Robots, 2014). There are several
tactile sensor types, some of them uses an active antenna that deflect when beats a
barrier. But, once it is wanted that the robot reach a distance smaller than 1 cm from
the obstacle, the contact sensor, recommendable to be utilised, is a micro switch,
which configuration will short the circuit in a smaller distance.
If considered that low logical level will indicate the absence of obstacles, the
micro switch will be wired to close the circuit when pressed (Normally Open):

Figure 4: Connection of the Micro Switch
To feel the obstacle, one micro switch in the front of the robot must be
utilised. When the contact is made, the robot will turn on the spot until it find the
line again. This means that for high logical level, independently of the value of the
photodiodes, the robot will spins. But, if the switch is not active, then the input in
the motor is going to depend on the photodiodes response:

Switch Enable A Enable B Input 1 Input 2 Input 3 Input 4
1 1 1 1 0 0 1
Table 2: Outputs of the Pressed Micro Switch
Assemble
To assemble the modules together, a truth table of the entire system can
help. It is similar to the truth table obtained to the photodiodes, adding another
input that is the wall sensor. When the wall sensor is active, the robot will spin
independently of the line sensors.
Truth Table
Switch (S) Photodiode 1 (A) Photodiode 2 (B) Photodiode 3 (C) Photodiode 4 (D)

Enable A Enable B Input 1 Input 2 Input 3 Input 4
0 0 0 0 0 Spin 1 1 1 0 0 1
0 0 0 0 1 Curve to the Right 1 0 1 0 0 0
0 0 0 1 0 Not applicable x x X X X x
0 0 0 1 1 Curve to the Right 1 0 1 0 0 0
0 0 1 0 0 Not applicable x x X X X X
0 0 1 0 1 Not applicable x x X X X X
0 0 1 1 0 Drive Forward 1 1 1 0 1 0
0 0 1 1 1 Not applicable x x X X X x
0 1 0 0 0 Curve to the Left 0 1 0 0 1 0
0 1 0 0 1 Not applicable x x X x X X
0 1 0 1 0 Not applicable x x X X X x
0 1 0 1 1 Not applicable x x X x X X
0 1 1 0 0 Curve to the Left 0 1 0 0 1 0
0 1 1 0 1 Not applicable x x X X X X
0 1 1 1 0 Not applicable x x X X X X
0 1 1 1 1 Not applicable x x X x x x
1 0 0 0 0 Spin 1 1 1 0 0 1
1 0 0 0 1 Spin 1 1 1 0 0 1
1 0 0 1 0 Spin 1 1 1 0 0 1
1 0 0 1 1 Spin 1 1 1 0 0 1
1 0 1 0 0 Spin 1 1 1 0 0 1
1 0 1 0 1 Spin 1 1 1 0 0 1
1 0 1 1 0 Spin 1 1 1 0 0 1
1 0 1 1 1 Spin 1 1 1 0 0 1
1 1 0 0 0 Spin 1 1 1 0 0 1
1 1 0 0 1 Spin 1 1 1 0 0 1
1 1 0 1 0 Spin 1 1 1 0 0 1
1 1 0 1 1 Spin 1 1 1 0 0 1
1 1 1 0 0 Spin 1 1 1 0 0 1
1 1 1 0 1 Spin 1 1 1 0 0 1
1 1 1 1 0 Spin 1 1 1 0 0 1
1 1 1 1 1 Spin 1 1 1 0 0 1
1 x X x X Spin 1 1 1 0 0 1
Using this table and the results already gotten from the photodiodes
Karnaugh Maps, it is possible to minimize the circuit to:
=

+
=

+
1 =

+
2 = 0
3 = ( + )


4 = (

) +
From these logical relations, the following circuit was designed:

Figure 5:Logical Circuit
Simulation
The software Proteus can make a simulation of the designed circuit.
Unfortunately, the program does not have the model of a photodiode to be
implemented. So, potentiometers will represent the outputs of the sensors.
When the sensors in the middle recognise the line, Input1, Input 3, EnableA
and EnableB are ON, this behaviour can be seen by the red dots:


Figure 6: Simulation - Go Forward











When the left sensors (A and B) recognise the line, Input3 and EnableB are
ON, this behaviour can be seen by the red dots:


Figure 7: Simulation - Left Curve

When the right sensors (C and D) recognise the line, Input1 and EnableA are
ON, this behaviour can be seen by the red dots:

Figure 8: Simulation - Right Curve

When the contact sensor is pressed, EnableA, EnableB, Input1 and Input4 are
on:

Figure 9: Simulation - Spin
Even though the absence of the photodiodes does not allow to create the
designed circuit in it totallity, the simulation helps to validate the design.
Conclusion
The project, which aimed on creating a line follower with obstacles detection
was accomplished, the circuit was tested and validated.
However even though the circuit was validated using Protheus, some
environmental characteristics could affect the system. Initially, the photodiodes
need a good contrast between the two colours. And, also, they can be affected by
the ambient light. These two limitations need to be considered in case of building
the project.


References

Anon., 2013. Play With Robots. [Online]
Available at: http://playwithrobots.com/make-it-form-scratch/advance-line-
follower-robot
[Acesso em April 2014].
Daecto, G., 2013. Grace S Daecto. [Online]
Available at: http://www.fem.unicamp.br/~grace/Circuitos_Logicos.html
[Acesso em April 2014].
FARGO Controls, inc., 2011. Operating Principles for Capacitive Proximity
Sensors. [Online]
Available at: http://www.fargocontrols.com/sensors/capacitive_op.html
[Acesso em April 2014].
Society of Robots, 2014. Schematics - Tactile Bump Sensor Circuit. [Online]
Available at: http://www.societyofrobots.com/sensors_tactbumpswitch.shtml
[Acesso em April 2014].
STMicroelectronics, 2000. DUAL FULL-BRIDGE DRIVER. [Online]
Available at: https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf
[Acesso em April 2014].
Tickle, A. J., Harvey, P. K., Buckle, J. R. & Smith, J. S., 2008. United Kingdom
Automatic Control Council. [Online]
Available at:
http://ukacc.group.shef.ac.uk/proceedings/control2008/papers/p172.pdf
[Acesso em April 2014].

S-ar putea să vă placă și