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
/
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.
/
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.
/
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. /
APPLICATION
Edutainment ¾
Outdoor Robotics ¾
Internet Robotics, Robot ecology
Health Care and Life Quality ¾
Indoor Service Robots, Ubiquitous Robotics
Network Robotics ¾
Industrial robotics
Adaptive robot servants and intelligent homes ¾
Land, Sea, Air, Space Æ Wheeled Mobile Robot
Advanced production systems ¾
Educational Robots, Robot Toys, Entertainment, Robotic Art
Surgical Robotics, Bio-Robotics, Assistive Technology
Military Robotics ¾
Intelligent Weapons, Robot Soldiers, Super-humans
/
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. /
AGENDA
• • • • •
Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion /
CONCEPT
¾ Mechanics (31%) ¾ Electronics (29%) ¾ Mathematical modeling concepts (21%) ¾ Software (19%)
/
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 /
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
/
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%)
/
Basic Electronics
Most of digital circuits use TTL (Transistor Transistor Logic) logic: ¾ ¾
Basic components ¾ ¾ ¾ ¾
Logic High: 2 – 5V Logic Low: 0 – 0.8V
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 /
Identifying components
Resistors
Voltage regulator
Variable resistors
IR LEDs
Capacitors
TSOP 1738 (IR sensor) /
LEDs
TOOLS and Equipments
Twisser and stripper
C.R.O.
Soldering rod, flux and Lead
Function Generator /
Digital Multimeter
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.
/
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. /
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
/
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
… 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
/
SOFTWARE ¾ C/C++ » Basic Linux environment » Serial/Parallel port interfacing
¾ Assembly language
Emulator Embedded software developer » Keil » EZ programmer
/
AGENDA
• • • • •
Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion /
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). /
Continued…
Types of Stepper Motor ¾ variable reluctant ¾ permanent magnet ¾ hybrid motor.
Configurations ¾ Bipolar ¾ Unipolar
Leads configurations ¾ 4 lead ¾ 5 lead ¾ 6 lead
Modes of operation ¾ Full step ¾ Half step ¾ Micro stepping
/
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. /
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.
/
Characteristics
Fig. Torque Vs Speed
/
Modes of Operation Stepping Sequence
a) Scheme-I
b) Scheme-II Fig. Full Stepping Mode
/
Fundamental Operation ÅCross-section
Stepper MotorÆ
Fig. Full Step Mode working /
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.
/
STEPPER MOTOR INTERFACING DETAILS
Fig: Various lead configurations Fig. Driver IC uln2803
Fig: A typical translator-driver connection /
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. /
…CIRCUIT CONNECTIONS
/
AGENDA
• • • • •
Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion /
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 /
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. /
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. /
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"
/
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 /
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.
/
PIN CONFIGURATIONS (DB25): Pin No.
Signal Name
Pin No.
Signal Name
1
Strobe
10
Acknowledge
2
Data 0
11
Busy
3
Data 1
12
Paper End
4
Data 2
13
Select
5
Data 3
14
Auto Feed
6
Data 4
15
Error
7
Data 5
16
Init
8
Data 6
17
Select In
9
Data 7
18-25
GND
Note: Pin nos. 10, 14, 15, 16, 17 are inverted.
/
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 & • 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
/
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); /
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; } /
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 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 : “</
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
/
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); }
} /
AGENDA
• • • • •
Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion /
Pre-programmed LINE Follower Robot
/
Video Demonstration pre-programmed Line Follower
/
Points to be noted… ROBOT NO.
CONTROLLER
WHEEL
MATHEMATIC MODELLING
REMARKS
1
8051 MCU
Wooden (not very smooth)
Just an approximation made
Onboard controller
2
Parallel port programming
Wooden (comparatively good)
Compensation not taken into account
More strain on one wheel at turns
3
8051 MCU
Wood wrapped with cotton and then covered by tape
Was not clear
a) on-board controller b) Very high speed – created problem c) Chasis not very strong
4
Parallel port programming
Plastic wheels with better grip
Well done and error factors too compensated
Best of all, except for slow speed.
/
Remote controlled robot
/
Video Demonstration Remote controlled Roborace
/
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. /
What’s Ahead?
Implement Microcontroller controlled robot.
Robo-controller
MCU programmer
Implement sensors. IR sensors using TSOP 1738 as receiver and IR LED flashing at 38Khz as transmitter /
AGENDA
• • • • •
Introduction Concept Stepper Motor Basics Parallel port programming Robocar – an application Mobile robot • Discussion /
Conclusions
Implementing unique software strategies is possible to achieve low cost robot platform whose movement is controlled by software through Parallel Port.
/
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
2.
http://www.vishay.com/docs/82030/82030.pdf
Softwares
http://www.keil.com/dd/chip/2976.htm http://www.electronics-lab.com/downloads/cnt/fclick.php?fid=21
/
"It's
not
Thanks
that
i
am
genius,
but i stay a little longer with problems"
-
Einstein.
/