autonomous robotics

45
AUTONOMOUS ROBOTICS www.robotix.in

Upload: technology-robotix-society

Post on 03-Mar-2016

222 views

Category:

Documents


0 download

DESCRIPTION

Autonomous Robotics

TRANSCRIPT

Page 1: Autonomous Robotics

AUTONOMOUS ROBOTICS

www.robotix.in

Page 2: Autonomous Robotics

Components

www.robotix.in

Locomotion System

Power Supply

Sensors

Microcontrollers

Motor Driver

Speed Control

Line Follower-Algorithm

Page 3: Autonomous Robotics

LOCOMOTION SYSTEM

www.robotix.in

DIFFERENTIAL DRIVE

A differential drive is the most basic drive, which consists of two sets of wheels that can be driven independently.

Page 4: Autonomous Robotics

To turn the vehicle (or robot) LEFT or RIGHT, wheels are

rotated at "different" speeds or in “different” directions.

www.robotix.in

MOTION LEFT WHEEL RIGHT WHEEL

Forward

Backward

Left Turn

Right Turn

Page 5: Autonomous Robotics

Drives

www.robotix.in

Page 6: Autonomous Robotics

Power Supply

www.robotix.in

Our power supply consists of the rectifier circuit and

the transformer.

A rectifier is an electrical device that

converts alternating current (AC), current that

periodically reverses direction, to direct

current (DC), current that flows in only one direction.

Page 7: Autonomous Robotics

Power Supply

www.robotix.in

Page 8: Autonomous Robotics

The Rectifier Circuit

www.robotix.in

Page 9: Autonomous Robotics

www.robotix.in

Page 10: Autonomous Robotics
Page 11: Autonomous Robotics

Sensor Components

www.robotix.in

LED-LDR Circuit

Comparator Circuit

Page 12: Autonomous Robotics

www.robotix.in

LED-LDR

“A line follower is basically a robot or a machine that takes external inputs (sensory feeds) and decides whether it is on the path or off it.” Let us consider that we are trying to follow a certain white line on a black background.

How would the bot decide whether it is on the white line?.

Page 13: Autonomous Robotics

www.robotix.in

LED - LDR

LED – LDR sensors come into the picture here. For detecting a white line on a black surface the bot must be able to distinguish between them.

In an electric circuit distinguishing a difference in any field is achieved using difference in voltages. The sensors basically provide this voltage difference.

Here we take the example of a differential drive with a LED-LDR sensor array for line following.

Page 14: Autonomous Robotics

www.robotix.in

LED-LDR

LED LDR

and

Page 15: Autonomous Robotics

www.robotix.in

LED-LDR

LED-LDR sensor unit is used for detecting surfaces that reflect light at intensity different from the adjoining surfaces. **LED (Light Emitting Diode) : Small elongated bulb-like object that emits light. Available commonly in red, green, white etc. **LDR (Light Dependent Resistor) : Small resistor, resistance depending (non-linear) upon the intensity of incident light The resistance usually varies in the range of ~10k ohms. Hence a 10k ohm resistance should be used in series with a LDR.

Page 16: Autonomous Robotics

www.robotix.in

Comparator

Page 17: Autonomous Robotics

www.robotix.in

LM339 Pin Diagram

Page 18: Autonomous Robotics

www.robotix.in

Light Sensing Module using LED-LDR combination. As high intensity of light falls on the LDR, its resistance drops and the potential at -ve terminal of comparator increases. If this potential is less than that at the +ve terminal, a high signal is obtained as output.

Sensor Interfacing

Page 19: Autonomous Robotics

www.robotix.in

Calibration

Resistance of an LDR changes depending on the intensity of light that is incident on it.

Light (from LED) reflected from white surface -> brighter (i.e. more intense) Light reflected from the black surface ->Less intense

Two different voltages achieved, thus separating white from black.

Using these two voltages a mean voltage is decided which is used as the reference voltage. This is termed as calibration.

In comparator circuit,

Voltage higher than reference -> HIGH

Voltage lower than reference -> LOW

Page 20: Autonomous Robotics

www.robotix.in

Final Circuit

Page 21: Autonomous Robotics

www.robotix.in

Page 22: Autonomous Robotics

www.robotix.in

Final Circuit

Circuit has 4 sensors

Each is connected to a comparator of the IC

Each should have its own potentiometer for thresholding

Page 23: Autonomous Robotics

www.robotix.in

The Microcontroller

Brain of the autonomous robot

Has its own microprocessor, RAM and static flash storage

ATMEGA 16 [used here]: 16MHz processor, 1KB internal SRAM and 16KB of in-programmable memory

40 pins-8 are reserved for various functions; other 32 pins are general purpose pins which may be used for general input and output.

www.robotix.in

Page 24: Autonomous Robotics

www.robotix.in

Pin Configuration

www.robotix.in

Page 25: Autonomous Robotics

www.robotix.in

Pin Configuration-Contd.

Pins operate in highs and lows. +5 volt is termed as ‘high’; ground potential is ‘low’.

Code designates pins as ‘input’ pins or ‘output’ pins.

Input Pins: Used to take input from surroundings, say, by hooking up with the output of a sensor

Output Pins: Used to control external actuators such as motors (via a motor driver).

ATMEGA 16 comes with several advanced features like timers, interrupts and analog to digital converters.

Code is burnt onto microcontroller using a programmer.

www.robotix.in

Page 26: Autonomous Robotics

www.robotix.in

Motor Drivers:H Bridge

It is an electronic circuit which enables a voltage to be applied across a load in either direction.

It allows a circuit full control over a standard electric DC motor. With an H-bridge, a microcontroller, logic chip, or remote control can electronically command the motor to go forward, reverse, brake, and coast.

Page 27: Autonomous Robotics

www.robotix.in

Motor Drivers : H Bridge (Contd)

H-bridges are available as integrated circuits, or can be built from discrete components.

The term "H-bridge" derived from the typical graphical representation of such a circuit, which is built with four switches, either solid-state (eg, L293/ L298) or mechanical (eg, relays).

Page 28: Autonomous Robotics

S1 S2 S3 S4 Result 1 0 0 1 Motor rotates in one direction 0 1 1 0 Motor rotates in opposite direction 0 0 0 0 Motor free runs (coasts) 0 1 0 1 Motor brakes 1 0 1 0 Motor brakes

Page 29: Autonomous Robotics

www.robotix.in

To power the motor, you turn on two switches that are diagonally opposed.

Page 30: Autonomous Robotics

www.robotix.in

DC Motor Direction Control

H – Bridge Circuit Diagram

S1

S3

S2

S4

M 1 2

VCC

Page 31: Autonomous Robotics

www.robotix.in

H – Bridge Working

Page 32: Autonomous Robotics

www.robotix.in

Need of Motor Driver IC

The current provided by the MCU is of the order of 5mA and that required by a motor is ~500mA. Hence, motor can’t be controlled directly by MCU and we need an interface between the MCU and the motor.

A Motor Driver IC like L293D or L298 is used for this purpose which has two H-bridge drivers. Hence, each IC can drive two motors

Note that a motor driver does not amplify the current; it only acts as a switch (An H bridge is nothing but 4 switches).

Page 33: Autonomous Robotics

www.robotix.in

L293D

Page 34: Autonomous Robotics

www.robotix.in

Motor Driver

Page 35: Autonomous Robotics

www.robotix.in

L293D : Motor Driver (Contd)

Drivers are enabled in pairs, with drivers 1 and 2 being enabled by the Enable pin. When an enable input is high (logic 1 or +5V), the associated drivers are enabled and their outputs are active and in phase with their inputs.

When the enable pin is low, the output is neither high nor low (disconnected), irrespective of the input.

Direction of the motor is controlled by asserting one of the inputs to motor to be high (logic 1) and the other to be low (logic 0).

To move the motor in opposite direction just interchange the logic applied to the two inputs of the motors.

Page 36: Autonomous Robotics

www.robotix.in

L239D : Motor Driver (Contd)

Asserting both inputs to logic high or logic low will stop the motor.

Difference between L293NE and L293D: Output current per channel = 1A for L293 and 600mA for L293D.

Vs is used to power the motors while Vss powers the L293NE.

Page 37: Autonomous Robotics

www.robotix.in

Speed Control:

To control motor speed we can use pulse width modulation (PWM), applied to the enable pins of L293 driver.

PWM is the scheme in which the duty cycle of a square wave output from the microcontroller is varied to provide a varying average DC output.

What actually happens by applying a PWM pulse is that the motor is switched ON and OFF at a given frequency. In this way, the motor reacts to the time average of the power supply

Page 38: Autonomous Robotics

www.robotix.in

Speed Control

Page 39: Autonomous Robotics

www.robotix.in

An Example - Line Follower

A line follower is a robot capable of tracking a line drawn on a surface

Optical sensors capture the line position at the front end of the robot

The robot is steered to keep it always over the line

Page 40: Autonomous Robotics

www.robotix.in

Block Layout of Line Follower

Page 41: Autonomous Robotics

www.robotix.in

Line Following

How many LED-LDR pairs are required to create an autonomous line following robot?

Page 42: Autonomous Robotics

www.robotix.in

1 Sensor (The Edge Finder)

Only 1 sensor is needed to follow a line. It actually follows one edge of the line, continually sensing the transition from dark to light. Assuming a 2 motor drive system, one motor is activated when the line is seen, the other is activated when the line is not seen.

Page 43: Autonomous Robotics

www.robotix.in

The Edge Finder

This works fine at slower speeds but becomes unusable as the bot goes faster -If the sensor crosses the other side of the line, it will may head back in the opposite direction or if it loses the line, it may spin in circles forever.

Page 44: Autonomous Robotics

www.robotix.in

Line Following with two LED – LDR pairs

Page 45: Autonomous Robotics

www.robotix.in

Algorithm : 2 Sensors

Left Sensor Right Sensor Left Motor Right Motor

1 1 1 1

0 1 0 1

1 0 1 0

There is a minimum of two sensors required for this task, one for detecting each edge of the line. If the LED – LDR sensor gives a high when above the floor and a low when above the ridge, then the simple algorithm for line following will be :