Friday, June 15, 2007

AUTONOMOUS ROBOT

With obstacle avoidance,Drive wheel synchronization
and line tracking capability






This article is in continuation with my earlier post.So it is expected that u know the basics of designing robot.It is strongly recomended that you go through that post for understanding basics.


The previous post deals with how we can take into account various parameters affecting the motion of robot analytically.Once we design a robot (i.e. fix all dimensions .) , the next question is about powering it .


One way to do this will be have a wired robot with motors attached to wheels.when we supply electric current ,this DC motor will convert that electric energy into mechanical energy and provide the necessary power to robot.The controls will also be handled through this wires.


But more and more application now-a-days require robots which are wire free.To accomplish this we need some power source on board.The only question unanswered is about controls for robot.
This is going to be discussed in this post thoroughly.


This project of ours uses a lot of electronics and electronic components.Hence, any knowledge in this field will be of added importance.Also many pictures and schematic diagrams have been shown along side to supplement the notes and for better understanding.


Project Features:

· ATMega16 Microcontroller
The ATMega16 monitors all robot sensors and
controls motor drive functions.
In system programming is available.
Microcode was developed using the MCS Bascom
AVR compiler.


· Obstacle avoidance
The robot maneuvers around obstacles while
seeking for a black line to track.
Obstacles cause direction reversal when the robot is
in line tracking mode.
The obstacle sensor is a Sharp GP2D15 sensor
connected to INT0 of the ATMega16.


· Line tracking
The robot is designed to search for a black line on
the terrain.
Once the line is found, the robot tracks the line
from end to end and reverses direction when it
encounters an obstacle in the path of the line.
Three infrared sensors mounted under the robot
and connected to port D of the Mega16 do line
sensing.


· Differential Drive
Two DC motors provide mechanical propulsion
through friction drive of the drive wheels.
The motors are electrically driven by two Allegro
3953 full bridge motor drivers connected to port A
of the ATMega16.

Figure 1 - AUTONOMOUS ROBOT DESIGN


· Drive Wheel Synchronization
Infrared wheel encoders and a microcode routine
provide wheel synchronization. This allows for
straight-line travel without guidance.


· Rechargeable Battery Pack
Power is provided by a rechargeable 9.6 Volt NiCad
battery pack.
There is a 5 Volt on-board regulator for logic power.
Project Number A3743
Autonomous Robot
With obstacle avoidance, drive wheel
synchronization and line tracking
capability

AUTONOMOUS ROBOT BRIEF DESCRIPTION


This project is an autonomous robot that is capable of obstacle avoidance, drive wheel
synchronization and line tracking. The robot initializes in seek mode, where it avoids obstacles and searches for a black line to track. Wheel synchronization, during seek mode, allows the robot to travel in a straight line without guidance. Once a black line is found, the robot tracks the line and reverses direction when an obstacle is encountered on the line.


The electronic control assembly consists of an Atmel ATMega16 MCU operating at 8Mhz with an internal clock. Two Allegro 3953 full-bridge motor drivers are used for motor control. Microcode for the project was written using the MCS Basic-AVR compiler. Microcode can be updated using the on-board ISP connector.


The Mechanical assembly uses a differential drive system made from two small DC motors, a friction drive system and two 78mm wheels. There are six on-board sensors that allow the robot to avoid obstacles, synchronize wheel rotation and track lines. Power is provided by a rechargeable 9.6V NiCad battery pack.














Figure 2 – Side View of Robot

















AUTONOMOUS ROBOT BLOCK DIAGRAM






AUTONOMOUS ROBOT





















AN OVERALL VIEW OF CIRCUITRY








CODE SAMPLE
Microcode for this project was written with the MCS Basic-AVR compiler. This code sample shows the
“Seek_line” routine and drive wheel synchronization method. The robot initializes into the Seek_line
routine, where it roams about looking for a black line to track. The robot must synchronize the two
differential drive wheel rotations, in order to travel in a straight line, when in seek mode. Calling the
“Poll_wheels” routine, where the encoder counters are updated at each wheel encoder pulse and
then comparing the left and right wheel counters does this. The wheel drive is altered if there is a
difference of 2 or more between “Leftc” and “Rightc”.
'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Seek_line: 'Roam around, avoid obstacles, seek the black line
Leftc = 0 'Initialize wheel counters
Rightc = 0
Motor = Forth 'Go forward
Seek_line1:
Op_mode = "seek"
Gosub Poll_wheels
If Csense = 1 Then 'Center line sensor found black line
Motor = Brake 'Stop
Waitms 300 'pause
Goto Track 'Goto track mode
End If
Motor = Forth 'Give both motors a forward pulse
Gp2 = Rightc + 2 'General Purpose reg = right counter + 2
If Leftc > Gp2 Then 'Is the left wheel 2 pulses ahead of the right wheel?
Motor = Turnl 'Adjust
End If
Gp2 = Leftc + 2 'General Purpose reg = left counter + 2
If Rightc > Gp2 Then 'Is the right wheel 2 pulses ahead of the left wheel?
Motor = Turnr 'Adjust
End If
If Leftc > 130 Then 'Clear the wheel counters after 10 wheel revolutions
Rightc = 0
Leftc = 0
End If
Goto Seek_line1
'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
'Returns (Leftc) the left wheel encoder count and (Rightc) the Right wheel encoder count.
Poll_wheels: 'Polls the wheel encoder sensors and counts pulses.
If Lwheel = 0 Then 'If left wheel encoder is uncovered
If Left_flag = 1 Then 'Do this once each encoder sensor transition
Incr Leftc 'Increment the wheel counter
Reset Left_flag
End If
End If
If Lwheel = 1 Then Set Left_flag 'Set the flag when the sensor is covered
If Rwheel = 0 Then 'If right wheel encoder is uncovered
If Right_flag = 1 Then 'Do this once each encoder sensor transition
Incr Rightc 'Increment the wheel counter
Reset Right_flag
End If
End If
If Rwheel = 1 Then Set Right_flag 'Set the flag when the sensor is covered
Return

2 comments:

virender said...

good infop..dude..keep it up

Anonymous said...

Predilection casinos? anatomize this untested [url=http://www.realcazinoz.com]casino[/url] exemplar and peculate up online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also search into our additional [url=http://freecasinogames2010.webs.com]casino[/url] manipulate at http://freecasinogames2010.webs.com and burgeon the president auspicious to memoirs fabulously touched in the skull !
another sui generis [url=http://www.ttittancasino.com]casino spiele[/url] locality is www.ttittancasino.com , because german gamblers, anoint freed online casino bonus.