Robot


Introduction
Now day’s many industries are using robots due to their high level of performance and reliability and which is a great help for human beings. The obstacle avoidance robotics is used for detecting obstacles and avoiding the collision. This is an autonomous robot. The design of obstacle avoidance robot requires the integration of many sensors according to their task.
The obstacle detection is primary requirement of this autonomous robot. The robot gets the information from surrounding area through mounted sensors on the robot. Some sensing devices used for obstacle detection like bump sensor, infrared sensor, ultrasonic sensor etc. Ultrasonic sensor is most suitable for obstacle detection and it is of low cost and has high ranging capability.
Purpose
Designed an autonomous robot which when detects any obstacles in its path, would change direction to avoid collision.
Description
We have designed a simple robot which detects obstacles and correspondingly changes its direction to avoid collisions. We have used the mbed controller and interfaced it with an LCD display and 3 Infra-Red sensors. The LCD display indicates the distance of the robot from the obstacle when the robot is in the range of 80 cm to 10 cm and it also displays the direction in which the robot will turn when it sees an obstacle. The 3 infra-red sensors are used to detect obstacles in the front, right and left direction. The front sensor is the primary sensor which keeps checking if there are any obstacles in its path in the front direction. Simultaneously the right and left sensors also keep checking for obstacles in the right and left direction respectively. Whenever there is any obstacle detected in the range of 10 centimeters by the front sensor, the robot will stop and take a turn in either the right or left direction depending on which side is clear and free from obstacles. If both the right and left side are free from obstacles, we have made the robot turn right (One could make it turn left by choice). When the front sensor and left sensor both detect obstacles within the range of 10 centimeters, the robot is made to turn right. Similar logic is used to make the robot left turn. If all the 3 sensors detect obstacles within the range of 10 centimeters, the robot moves in the reverse direction.
Block Diagram
The project is designed to build an obstacle avoidance robotic vehicle using ultrasonic sensors for its movement. A microcontroller of 8051 family is used to achieve the desired operation.
A robot is a machine that can perform task automatically or with guidance. Robotics is generally a combination of computational intelligence and physical machines (motors). Computational intelligence involves the programmed instructions.
The project proposes robotic vehicle that has an intelligence built in it such that it guides itself whenever an obstacle comes ahead of it. This robotic vehicle is built, using a microcontroller of 8051 family. An ultrasonic sensor is used to detect any obstacle ahead of it and sends a command to the microcontroller.
Depending on the input signal received, the microcontroller redirects the robot to move in an alternate direction by actuating the motors interfaced to it through a motor driver IC.
This concept in future can be extended in such a way that if a destination is fed to the robot, the robot can map the whole terrain and can reach its destination by deciding a suitable path and avoiding obstacles.

Applications:
1) This line following robot can also be modified to a walking robot in any surface by using only one motor with homemade fixtures as per the detailed instructions give.
2) Similarly the same walking robot can be attached with special magnetic material as per instructions to climb a wall of any vertical metallic surface say a refrigerator body.
Equipment
  • Mbed NXP LPC1768
  • Magician Chassis Robot
  • Sharp IR sensor GP2Y0A21YK0F
  • Dual H-Bridge md08a
  • 16x2 LCD Text Display HD44780
Connections
MBEDDual H-Bridge BreakoutRobot DC MotorsBattery
VinVmot
+
GNDGND
-
VoutVcc

p21PWMB

P22BIN2

p23BIN1

p24AIN1

p25AIN2

p26PWMA

Vout/STBY


A01LEFT RED

A02LEFT BLACK

B02RIGHT BLACK

B01RIGHT RED

MBEDLCD Text Display
GNDGND
5VVcc
GND Via 1K ResistorVO
p15RS
GNDRW
p16E
N/CD0
N/CD1
N/CD2
N/CD3
p17D4
p11D5
p12D6
p13D7

MBEDIR-LEFTIR-CENTREIR-RIGHT
VOUT       VCC            VCC               VCC
GND          GND           GND              GND
p20
CONTROL
p18CONTROL

p19

CONTROL


       
#include "mbed.h"
#include "motordriver.h"
#include "TextLCD.h"
 DigitalOut myled(LED1);
 AnalogIn ain1(p20);
 AnalogIn ain2(p18);
 AnalogIn ain3(p19);
 TextLCD lcd(p15, p16, p17, p11, p12, p13); // rs, e, d4-d7
 
 
Motor left(p21, p22, p23, 1); // pwm, fwd, rev, has brake feature
Motor right(p26, p25, p24, 1);
 
int main() {
   
   float temp,temp2,temp3; 
   while (1) {       
   temp=100*(1- ain1);
   if(temp>40){  
   lcd.printf("distance=%f",temp);
   left.speed(0.4);
   right.speed(0.4);
   wait(0.5);
   left.stop(0.5);
   right.stop(0.5);
   wait(0.005);
   temp2=100*(1- ain2);
   temp3=100*(1- ain3);
   if(temp2<40){
   lcd.printf("Take right turn");
   left.speed(0.4);
   right.stop(1);
   wait(0.1);
   left.stop(1);
   right.stop(1);
   wait(0.1);
    }
   if(temp3<40)
   {
   lcd.printf("Take left turn");
   left.stop(1);
   right.speed(0.4);
   wait(0.1);
   left.stop(1);
   right.stop(1);
   wait(0.1);
    } 
   if(temp2<40 && temp3<40){
   float s;
   s=(-1)*(0.5);
   lcd.printf("Take reverse turn");
   left.speed(s);
   right.speed(s);
   wait(2);
   left.stop(1);
   right.stop(1);
   wait(0.5);
    }
   lcd.cls();
}
else
{
   temp2=100*(1- ain2);
   temp3=100*(1- ain3);
   
   if(temp2<40 && temp3>=40){
   lcd.printf("Take right turn");
   left.speed(0.4);
   right.stop(1);
   wait(0.6);
   left.stop(1);
   right.stop(1);
   wait(0.5);
    }
     
   if(temp2>=40 && temp3 <40){
   lcd.printf("Take left turn");
   left.stop(1);
   right.speed(0.4);
   wait(0.6);
   left.stop(1);
   right.stop(1);
   wait(0.5);
    }
   if(temp2 >40 && temp3 >40){
   lcd.printf("Take right turn by default");
   left.speed(0.4);
   right.stop(1);
   wait(0.6);
   left.stop(1);
   right.stop(1);
   wait(0.5);
    }
   }
  }
}
 
 
Problems Encountered and Possible Solutions
The robot turns approximately by 90 degrees since we have used the wait function to make it turn. It could be made to turn to exact 90 degrees by using a compass module. But the problem is that the robot DC motors have magnets. The magnetic field of these magnets interfere with the field of the compass and hence the compass gives stray values.
One can try to eliminate this problem by placing the compass as far as possible by placing the compass on a pole of a reasonably large height. The compass needs to be at a minimum distance of greater than 5 inches to work properly. Also one needs to take care of the magnetic fields of the surroundings in order to make the compass work properly.

No comments:

Post a Comment