Seminar on “Mobile Robotics” – First page

NIT Warangal

ACKNOWLEDGEMENT

Mobile Robotics Lab, AE, IISc POR Lab, NIT Warangal

NIT Warangal

AGENDA

• • • • •

Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion
<http://frontier123.blogspot.com>/

Evolution

The word robot comes from the Czech word "robota", meaning "forced labor." A robot is an electro-mechanical device that can perform autonomous or preprogrammed tasks.

<http://frontier123.blogspot.com>/

Laws of Robotics (Asimov, 1942)
Zeroth Law: Robot may not injure humanity, or, though inaction, allow humanity to come to harm. First Law: A robot may not injure a human being, or, through inaction, allow a human being to come to harm, unless this would violate a higher order law. Second Law: A robot must obey orders given it by human beings, except where such orders would conflict with a higher order law. Third Law: A robot must protect its own existence as long as such protection does not conflict with a higher order law.

<http://frontier123.blogspot.com>/

What is Robotics science? Robotics is the science or study of the technology associated with the design, fabrication, theory, and application of robots. The technology developed to combine software, mechanical manipulators, sensors, controllers and computers to provide programmable automation. Robots are nothing but very sophisticated and intelligent machines that are helpful.
<http://frontier123.blogspot.com>/

APPLICATION
Edutainment
Educational Robots, Robot Toys, Entertainment, Robotic Art

Outdoor Robotics
Land, Sea, Air, Space Industrial robotics Wheeled Mobile Robot

Advanced production systems Adaptive robot servants and intelligent homes
Indoor Service Robots, Ubiquitous Robotics

Network Robotics
Internet Robotics, Robot ecology

Health Care and Life Quality
Surgical Robotics, Bio-Robotics, Assistive Technology

Military Robotics
Intelligent Weapons, Robot Soldiers, Super-humans

<http://frontier123.blogspot.com>/

Wheeled Mobile Robot…
Easy to startup with, into robotics. There has been a convergence of research talents in recent years. Motor driven wheels are the only moving part. a self-propelled and self-contained robot that is capable of moving over a mechanically unconstrained course.
<http://frontier123.blogspot.com>/

AGENDA

• • • • •

Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion
<http://frontier123.blogspot.com>/

CONCEPT

Mechanics (31%) Electronics (29%) Mathematical modeling concepts (21%) Software (19%)

<http://frontier123.blogspot.com>/

MECHANICS The body structure
Chasis (Aluminum, wood)
Strength issue Dimension and weight issue

Wheel placement, and Payloads

Selection of motor
Brushed DC motor Common Brushless DC motor High speed requirement Servo motor Feedback requirement Stepper Motor Better control, but slow
<http://frontier123.blogspot.com>/

CONTINUED…

Requirements:
Aluminum sheets Nuts and bolts Hacksaw (for cutting) File (for smoothening) Rubber wheels with better grips Front free wheel

Aluminum chasis Front free wheel Two back wheels controlled by motor Wheels coupled to stepper motors

<http://frontier123.blogspot.com>/

electronics Component selection and Design (35%)
Controller, Sensors Circuit Design Power supply

Fabrication or assembling

(25%)

Soldering Interface between different modules

Testing and Debugging

(40%)

<http://frontier123.blogspot.com>/

Basic Electronics
Most of digital circuits use TTL (Transistor Transistor Logic) logic:
Logic High: 2 – 5V Logic Low: 0 – 0.8V

Basic components
Resistors (1/4 W, ½ W) (Fixed/Variable) Capacitors (Electrolytic, Ceramic) ICs, Transistors, Diodes, voltage regulator LEDs

Other requirements
Power supply Connecting wires, cables Twisser, Stripper Bread board, Vero-board
<http://frontier123.blogspot.com>/

Identifying components

Resistors

Variable resistors

Capacitors

LEDs

Voltage regulator

IR LEDs

TSOP 1738 (IR sensor)
<http://frontier123.blogspot.com>/

TOOLS and Equipments

Twisser and stripper

Soldering rod, flux and Lead

Digital Multimeter

C.R.O.

Function Generator
<http://frontier123.blogspot.com>/

Analog multimeter

CIRCUIT BUILDING
First, test the circuit on bread-board if using first time. Choose the Veroboard and plan the proper placements of components on board. Practice well for soldering. All the grounds should be common. Always use voltage regulator 7805 IC for TTL circuits. Use IC sockets, extension pins, male-female connectors. Test for continuity, once soldering the circuits is completed. Take care of IC pin numbers while inserting into the socket. Switch the power supply before removing any chip.

<http://frontier123.blogspot.com>/

CONTINUED…

Fig. Perforated strip-board (Vero-board)
Select the kind of board as per requirement. Use twisser for placing components as well as ICs. Plan the placement of components well in advance. Place components on one the facing side as in fig (a). Connections to be made on the other side, with metallic layer. Scratch the wires before soldering, to remove oxides. Pointed soldering rod is a better option. Use flux and Lead

Use 7805 regulator, diode, IC socket, Connectors. Don’t make connection on the facing side.
<http://frontier123.blogspot.com>/

Mathematical Modeling
Each motor comes with specifications such as maximum current rating, number of steps per revolution, etc. For distance travel calculation Circumference of wheel = 2πr, is the distance covered by one revolution by wheel. One of the motor is put in flipped manner, i.e. clockwise motion of the flipped one will lead to backward motion rather than forward motion.
1 revolution = 200 steps (for e.g. from specifications) No. of steps required for X distance = X /(2πr) * 200 Where, r = radius of wheel

<http://frontier123.blogspot.com>/

Algorithm For Turning
For turning – 3 common strategies: Stop one wheel and move the other.
Move one in forward direction and the other in backward. [This strategy is followed in e.g. here.]

Slow down one of the wheel.

Fig. one wheel moving and the other stopped

Fig. Two wheel turning in forward and backward direction

Fig. One wheel moving faster than other

<http://frontier123.blogspot.com>/

… CONTINUED

For turning – by 2nd strategy:
1 revolution = 2πc = 200 steps of seqences

πc = 180o => xo =(π/180 * x)c = yc,
where d=width of robo, i.e. distance between wheels. yc=(200/2π * y) steps

<http://frontier123.blogspot.com>/

SOFTWARE C/C++
» Basic Linux environment » Serial/Parallel port interfacing

Assembly language
Emulator Embedded software developer » Keil » EZ programmer

<http://frontier123.blogspot.com>/

AGENDA

• • • • •

Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion
<http://frontier123.blogspot.com>/

Stepper Motor Stepper motors is a electromagnetic device that converts digital pulses into mechanical rotation. Stepper motor uses the simple principle of Lenz’s Law. When the stator coil is energized, electromagnetic field is produced which in turn rotates the permanent magnet (rotor).
<http://frontier123.blogspot.com>/

Continued…

Types of Stepper Motor
variable reluctant permanent magnet hybrid motor.

Leads configurations
4 lead 5 lead 6 lead

Configurations
Bipolar Unipolar

Modes of operation
Full step Half step Micro stepping

<http://frontier123.blogspot.com>/

Merits Stepper Motor

Draws almost constant current all the time. High torque at low speed. Input is digital signal . Better Control and precise positioning. Rapid discrete motion. Wide range of speed depending on input frequency pulses.
<http://frontier123.blogspot.com>/

Demerits of Stepper Motor

Consumption of current regardless of load. Low torque at high speed and resonance effect at low speed vibration. If a digital pulse input is missed, then it can exhibit a large error and oscillation. Requires dedicated controller. Costly. Not a good option when speed is the criterion.

<http://frontier123.blogspot.com>/

Characteristics

Fig. Torque Vs Speed

<http://frontier123.blogspot.com>/

Modes of Operation
Stepping Sequence

a) Scheme-I

b) Scheme-II Fig. Full Stepping Mode

<http://frontier123.blogspot.com>/

Fundamental Operation
Cross-section

Stepper Motor

Fig. Full Step Mode working
<http://frontier123.blogspot.com>/

SEQUENCE FOR DRIVING STEPPER MOTOR

A sequence (A 6 5 9) will move the motor in one direction and the reverse sequence will change the direction. Repeat the same 4 steps of sequences, and a total of 200 (from specification) steps will make one revolution.

<http://frontier123.blogspot.com>/

STEPPER MOTOR INTERFACING DETAILS

Fig: Various lead configurations
Fig. Driver IC uln2803

Fig: A typical translator-driver connection
<http://frontier123.blogspot.com>/

Darlington pair into the IC to amplify current

CIRCUIT CONNECTIONS

Vcc=12V is given to 10th pin and ground of SPP & Power supply is together connected to 9th pin of driver IC ‘ULN 2803’. Data pins are connected to driver IC, accordingly sequence of inputs for clockwise/anti-clockwise movement is given. Output of IC is given to data pins of motor. Two common points of motor is connected to 12V RPS.
<http://frontier123.blogspot.com>/

…CIRCUIT CONNECTIONS

<http://frontier123.blogspot.com>/

AGENDA

• • • • •

Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion
<http://frontier123.blogspot.com>/

Parallel Port programming

The DB25, also called printer port
Handling printer Faster communications with scanners, drives, and other devices that send data to the PC PC to PC communication

Programming Parallel Port in Linux
Application in robotics
<http://frontier123.blogspot.com>/

PARALLEL PORTS (DB-25) Port is a set of signal lines that the microprocessor, or CPU, uses to exchange data with other components/device. Parallel port, also called printer port is found on the back panel of CPU as a D-Type 25 pin female/male connector. A parallel port transfers multiple bits at once and the larger number of I/O pins makes external circuitry to implement many simpler tasks.
<http://frontier123.blogspot.com>/

HARDWARE SETTING
To find the existing port in windows: Click on control panel → system → hardware device manager → ports → Printer port(LPT1) → Resources
The parallel port’s hardware includes the back-panel connector and the circuits and cabling between the connector and the system’s expansion bus. The PC’s microprocessor uses the expansion bus’s data, address, and control lines to transfer information between the parallel port and the CPU, memory, and other system components.
<http://frontier123.blogspot.com>/

DB25 CONNECTOR

Figure illustrates DB25 connector, DB25 cable and DB25 breakout board
IEEE Std.1284-1994 Standard Signaling Method for a Bi-directional Parallel Peripheral Interface for Personal Computers"

<http://frontier123.blogspot.com>/

ADDRESSING

The standard parallel port uses three contiguous addresses (port’s base address/ or data register, Status register, Control register), usually in one of these ranges. 3BCh, 3BDh, 3BEh 378h, 379h, 37Ah (very common) 278h, 279h, 27Ah
<http://frontier123.blogspot.com>/

DB25 PIN CLASSIFICATIONS
The pins are classified as follows: 8 out (but I/0 for bidirectional) DATA BITS (pins: 2-9) 4 CONTROL In-Out lines (pins: 1, 14, 15, 17) 5 STATUS In lines (pins: 10-13 & 15) 8 GROUNDS (pins: 18-25) [Out of these 25 pins 1, 11, 14 & 17 are inverted.] Every port uses a range of addresses, and location of addresses varies.

<http://frontier123.blogspot.com>/

PIN CONFIGURATIONS (DB25):
Pin No.
1 2 3 4 5 6 7 8 9

Signal Name
Strobe Data 0 Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7

Pin No.
10 11 12 13 14 15 16 17 18-25

Signal Name
Acknowledge Busy Paper End Select Auto Feed Error Init Select In GND

Note: Pin nos. 10, 14, 15, 16, 17 are inverted.

<http://frontier123.blogspot.com>/

PROGRAMMING SPP UNDER LINUX

• Windows XP has put restrictions on I/O ports • I/O port operations with Linux is simple. You should be root login to access port.
• Header files to be used: <sys/io.h> or <asm/io.h> & <unistd.h> • ioperm() to obtain hardware i/o access permission

• inb() to read data from ports • outb() to send data to ports • usleep(delay in us) for delay in micro-second

<http://frontier123.blogspot.com>/

FUNCTIONS used…
outb writes the low byte of value to portid, the high byte to portid + 1, the function is defined as:
void outb(value, portid);

inb reads the low byte of a word from portid, the high byte from portid + 2, the syntax is:
int inb(portid);

ioperm sets the port access permission bits for the process for num bytes starting from port address from to the value turn_on. The use of ioperm requires root privileges.
int ioperm(unsigned long from, unsigned long num, int turn_on);
<http://frontier123.blogspot.com>/

INITIALIZATION OF VARIABLES
#include <sys/io.h> #include<stdio.h> #define PORTADDRESS 0x378 /* Base Port Address */ #define DATA PORTADDRESS+0 #define STATUS PORTADDRESS+1 #define CONTROL PORTADDRESS+2 int main() { if(ioperm(0x378,3,1)) exit(1); //obtain hardware i/o access … return 0; }
<http://frontier123.blogspot.com>/

AN EXAMPLE
Simple programs can be now written as such as can be tested by glowing LED (Light Emitting Diode): #include <sys/io.h> #include <unistd.h> int main() { char a; //store 8 bit data if(ioperm(0x378,3,1)) exit(1); outb(0xF0,0x378); //write 1111 0000 to data line a = inb(0x378+1); //read data from input status register cout<<“\nCharacter read : “<<a; print(“\nHello parallel port\n”); return 0; }
<http://frontier123.blogspot.com>/

LEDs interfacing
Make a connection like aside. Write code for flashing LEDs, running light, 7 segment display Take input from Hexkeypad and accordingly control the LEDs
<http://frontier123.blogspot.com>/

SAMPLE FUNCTION CODE FOR STEPPER MOTOR CONTROL
#define BASEPORT 0x378 void forward(int delay) {
//delay in usec outb(0x59, BASEPORT); usleep(delay); outb(0x6A, BASEPORT); usleep(delay); outb(0xA6, BASEPORT); usleep(delay); outb(0x95, BASEPORT); usleep(delay);

void right(int delay) { //delay in usec outb(0x55, BASEPORT); usleep(delay); outb(0x66, BASEPORT); usleep(delay); outb(0xAA, BASEPORT); usleep(delay); outb(0x99, BASEPORT); usleep(delay); }

}
<http://frontier123.blogspot.com>/

AGENDA

• • • • •

Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion
<http://frontier123.blogspot.com>/

Pre-programmed LINE Follower Robot

<http://frontier123.blogspot.com>/

Video Demonstration
pre-programmed Line Follower

<http://frontier123.blogspot.com>/

Points to be noted…
ROBOT NO. 1 CONTROLLER 8051 MCU WHEEL Wooden (not very smooth) Wooden (comparatively good) Wood wrapped with cotton and then covered by tape Plastic wheels with better grip MATHEMATIC MODELLING Just an approximation made Compensation not taken into account Was not clear REMARKS Onboard controller More strain on one wheel at turns
a) on-board controller b) Very high speed – created problem c) Chasis not very strong

2

Parallel port programming 8051 MCU

3

4

Parallel port programming

Well done and error factors too compensated

Best of all, except for slow speed.

<http://frontier123.blogspot.com>/

Remote controlled robot

<http://frontier123.blogspot.com>/

Video Demonstration
Remote controlled Roborace

<http://frontier123.blogspot.com>/

Points to be noted…

After every 4 steps or sequences, the remote control input was constantly being checked. It is always better to practice with the kind of job robo should compete beforehand. Skill of remote operator matters. Though, here it proved to be better than the competitor, but stepper motor are never a good choice for tasks like racing.
<http://frontier123.blogspot.com>/

What’s Ahead?

Implement Microcontroller controlled robot.

Robo-controller

MCU programmer IR sensors using TSOP 1738 as receiver and IR LED flashing at 38Khz as transmitter
<http://frontier123.blogspot.com>/

Implement sensors.

AGENDA

• • • • •

Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion
<http://frontier123.blogspot.com>/

Conclusions

Implementing unique software strategies is possible to achieve low cost robot platform whose movement is controlled by software through Parallel Port.

<http://frontier123.blogspot.com>/

Useful Links
1. Datasheets
MCU
http://www.atmel.com/dyn/resources/prod_documents/doc0265.pdf http://ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf

Driver ICs
http://www.ortodoxism.ro/datasheets/motorola/ULN2804A.pdf

Voltage regulator
http://cache.national.com/ds/LM/LM341.pdf

Sensors
http://www.vishay.com/docs/82030/82030.pdf

2.

Softwares
http://www.keil.com/dd/chip/2976.htm http://www.electronics-lab.com/downloads/cnt/fclick.php?fid=21

<http://frontier123.blogspot.com>/

"It's

not

that

Thanks
i -

am

genius,

but i stay a little longer with problems" Einstein.

<http://frontier123.blogspot.com>/