robots made easy

15

Upload: bradleygh15

Post on 11-Jul-2015

89 views

Category:

Business


0 download

TRANSCRIPT

Page 1: Robots made easy
Page 2: Robots made easy

Peel Training Day

Robots Made Easy

Page 3: Robots made easy

Using the PICAXE Microcontroller

This presentation will show you: How to connect the PICAXE on breadboard

How to hook up sensors

How to wire up drive motors

How to download a program

Page 4: Robots made easy

We will be using the PICAXE 20-X2, however there

are many kinds of PICAXE microcontrollers. They

start as small as 8 pin and all the way to 40 pins.

Page 5: Robots made easy

PICAXE 20-X2

Made by Revolution Education and uses Microchip PICs

Has a program loaded on the chip that allows the program to be written in a form of BASIC and can be downloaded using a serial port and three wires.

Each pin can be set up to perform several tasks.

Can run over a voltage range 2.1V to 5.5V

Page 6: Robots made easy

The Breadboard

Hook up power and ground.

Hook up serial port circuit.

Hook up line following circuit. Hook up servo motor.

Hook up motor driving circuit.

Page 7: Robots made easy

Sensors

The line following sensors (OPB703WZ) works by detecting infra-red light. The diode emits IR light which bounces off the surface. The reflected light then turns on the photo transistor relative to the amount of light reflected. The circuit then provides an analog value which is then read by the microcontroller and converted into a digital value.

Page 8: Robots made easy

Sensor on White Surface

If the surface the

light is reflecting off

of is white, more IR

light is reflected thus

turning the transistor

on fully. This will

bring the output

close to 0V. (So the

theory goes…)

Page 9: Robots made easy

Sensor on Black Surface

However, if the IR light is

being reflected of a dark

surface, the amount of IR

reaching the photo

transistor will be greatly

diminished resulting in the

transistor being almost

off and the output from

the circuit being close to

5V.

Page 10: Robots made easy

Motor Control with L293D Half-H Driver

Make an H-Bridge with the two drivers.

External diodes not required with L293D.

Ground pins: 4, 5, 12 & 13.

Pins 1, 8, 9 & 16 to +5V.

Pins 1 & 7 control motor connected to pins 3 & 6. Pins 10 & 15 control motor connected to pins 11 & 14.

Motor should have a 0.1uF capacitor across the terminals (not shown here).

Pin 2 or

15

Pin 7 or

10

Motor

Direction

L L Stop

L H CW

H L CCW

Page 11: Robots made easy

Servo

Servos is a three wire DC motor that can be directed to a specific position by sending a specific pulse width. The standard servo can travel a max of 180°, whereas a modified servo can continuously move in a direction of CW or CCW depending on the pulse width sent.

PICAXE has a special command that will let you set the position of the servo.

Servo has three wires: Black – negative, Red – positive and White – signal.

For sample commands see page 19 of PICAXE Manual 3. Also page 30 for the thermistor.

Page 12: Robots made easy

Writing the Program

There are two

methods of writing

a program.

1) The flowchart

method

and

2) the program

language method.

Page 13: Robots made easy

Simple Line Following Program

Page 14: Robots made easy

Downloading the Program.

Make sure:

Code is written without any syntax errors.

Power is on.

Cable is connected to the serial port and the

PICAXE.

Correct PICAXE is selected.

Correct com port (serial port) is selected.

Page 15: Robots made easy

Thanks for coming out!