Professional Documents
Culture Documents
HARDWARE
1)Components required (in general)
SOFTWARE
1)Language Selection
2)Program logic-----explains complete basis of a Line Follower
3)Writing Code (C considered here)
4)Compiling
5)Writing our code into the Microcontroller
6)Debugging
7)Simulating
From longer times it has been an human attempt to automate every appliance to reduce
the tensions….Thus the desire to design a robot replacing humans in undesirable or
dangerous jobs, and reducing the expenditure on manpower has led to the branch of
autonomous robotics…Today we have been able to build Asimov –an autonomous full
fledged robot…. .
Basically robot can be defined as “A versatile mechanical device equipped with actuators
and sensors under the control of a computing system”. Russell and Norvig define it as "an
active, artificial agent whose environment is the physical world."
Our autonomous competitions aim at developing a “Self contained vehicle which when
kept on the track should completely by itself travel along the track correctly”
Above discussion would have certainly explained how software and hardware are
required for autonomous robotics…
Block Diagram-------------------
Block 1:Here we have sensors which are sensitive to the presence or absence of the
object(here silver line or mirrors or fire) which produce output accordingly and are fed to
the next stage
Block 2:Output from sensors act as input to this stage.It basically consists of a device
able to analyse the input and generate output like microcontroller or computer.
Block 3:The output generated by microcontroller is suppose to drive motors(in our
case)but the power requirement of motors is higher than the output from muc..So we
want an external power supply to supply current to the motors in accordance with the
muc output.
Block 4:This is basically the mechanical part consisting of motors which drive the
system.
HARDWARE:
1)Components Required:
In general to make a line follower robot(car) we require following components:
Electronic components:
Sensors(Infra Red transmitter and receiver)
Op-amp (LM 324 Quad Comparator)
Microcontroller
Driver IC (L293D)
Mechanical components:
Motors(2 for differential driving)
Chassis material
Wires and PCBs
2)Sensors:
As said before sensors are used to detect the object …We will concentrate on line
follower robot…..Thus our object will be silver line and mirrors (also fire in some of the
competitions) ..
T R
\ /
\ /
\/
---------------Silver Line
Physical Arrangement:
3)Microcontroller (muc):
Now , you all know that Microcontroller is used to process the input and produce the
output accordingly……Huh it sounds like computer definition….yeah you are correct it’s
a microprocessor with on chip RAM, flash memory, clock, ROM, PORTS etc.
It stores a program to control the hardware as desired.
Mechanical Hardware:
5)Motors:
Depending on the requirement we select motors..
A variety of stepper motors with different degrees and forces are available
Generally people go for DC motors ..these motors are available with different rpm and
torque rating. A 60 rpm motor suits well for our Line Follower.
Geared motors are available providing better torque.
6)Chassis:
We may use any material for chassis .Generally that material which is tuff but light is
preferred.One can use plywood,acrylic,mechano,plastic etc.
For writing the Programs for specific muc in specific language various IDEs and
compilers/interpreters/assemblers are available.
ltm lt rt rtm
0 0 0 0 where 0 is a sensor pair
ltm =leftmost
lt=left
rt=right
rtm=rightmost
| |
| |
|0 |0
| |
when rt sensor is out of line it wont receive IR only lt will receive , so move the car to left
till both the sensors are on line.
A condition when both the sensors will be out of track wont arise if properly
programmed.
If it appears then write the program accordingly trying to bring it on line by trial and
error.
Cross Detection:
Its very simple to detect a cross by using the ltm and rtm sensors as follows
| |
____________ | |_______________
0 0 0 0
____________ _______________
| |
| |
when a sensor is detected all sensors ltm ,rtm,lt ,rt receive IR.
/*Consider Port B as input and Port D as output and lt and rt sensors only*/
int status=inport(B);
if(status<==1 && status&rt==1) //lt and rt receiving IR
gostraight(); //forward motion
if(status<==0 && status&rt==1) // rt receiving IR
goright_till_on_line(); //move right till online
if(status<==1 && status&rt==0) //lt receiving IR
goleft_till_on_line (); // move left till online
Thus we have written a simple Line follower code.
We may extend the same logic to suit our needs
4)Compiling:
So we are done with writing the piece of code as per our need BUT this code is in high
level language so we need to compile the code.
On compiling by using any of our favourite compilers we get the output file as a .hex
(Intel) file.
The .hex file stores the opcodes of the instructions in a normal text file.
Now ,we wish to write the hex file into the Flash of the muc…..As our programs on
computer reside on the hard disk ,in muc the programs reside in flash.
6)Debugging
Well I congratulated you for your successful write but lo you found that the program isn’t
working upto expectation………So you need to debug….But you think that its not as
easy to debug as on our PC .So better use LEDs ……….LEDs act as watches….. each
LED representing each sensor input (as watch tracks each variable)..thus you are able to
see which Sensor is not receiving IR and what should be expected output at such a
stage..Then you can enter your code and check in appropriate place and modify..
7)Simulation:
As far as I know there is NO such software that can directly simulate the Line Follower.
BUT you can use softwares like Proteus to simulate the code by giving manual
triggering to input as required.
BUILDING YOUR OWN PROGRAMMER FOR MUC
To build a programmer you need some capacitors , resistors ,crystal and that’s all…
These programming Hardwares use the concept of serial programming and drives the
muc in other mode (Write)....
The circuit diagram for SP12 for AT90Sxxxx is
PHOTOS OF MY LEVEL 3 AUTONOMOUS CAR