Escolar Documentos
Profissional Documentos
Cultura Documentos
Question # 1
What is a robot??
An entity designed for some specific Task In other words Your imagination
Question # 2
What is ROBOTICS ???
How Much Time do You Think A robot Requires ??? Depends on what everyone says
What does a Robot consists of ?? Mechanical Hardware Electronics Hardware Software And the toughest part is ?? Why ?
Classification of Robotics
Three types: Manual Robotics Semi-Autonomous Robotics Autonomous Robotics
Any thoughts about how tuff is making an autonomous or semi-autonomous robot??? Or which one is more tuff???
Power Management
ROBOT
Control System
Sensors
Power Management
One can use battery directly or use an adapter/SMPS as the situation demands. For Manual Adapter if wired remote Battery if radio controlled For Semi Autonomous SMPS if you cant manage on a battery For Autonomous You have to manage on Battery
Power Management
For Battery the options available are Ni-Cd rechargeable batteries providing around 700mA-hr each with 1.2V output. Emergency light battery 6V, 4A-hr, a heavy option though confirms you heavy duty.
Power Management
To operate the motors you will need higher voltage supply than what is required by general ICs. To derive all those voltage values from a given voltage supply LM317, 7805 5V voltage regulator PT5048C, PT5049 12V voltage regulator
Moving a Robot
How will a robot move??? Wheels Legs Wings All these run on motors powered by battery or IC engines.
copyright IIT Guwahati Robotics Club
Types Of Motors
DC Motors AC Motors Stepper Motors Servo Motors IC Engines
DC Motors
Run on DC power supply Can rotate in both directions To handle one has to control the speed
DC Motors
DC motors are low torque and high speed devices Gear set can be used to increase torque at the cost of speed The movement of the shaft is smooth Easiest to operate
Working of DC motor
Direction of rotation of a dc motor can be controlled by changing the direction of voltage applied to the motor
Working of DC motor
How to drive a dc motor without using a remote? to drive a motor we need certain circuits called Driver Circuits. Driver Circuits act as an interface by providing a link to main power supply based on input signal Readymade ICs are available.
copyright IIT Guwahati Robotics Club
Working of DC motor
H-Bridge Its a circuit to allow the rotation of motor in both the direction
Working of DC motor
Driving and Braking using H Bridge
Working of DC motor
H-Bridge in short
Working of DC motor
The Required IC L293D (Quad Half H-Bridge)
Working of DC motor
Working of DC motor
Speed control can be managed by controlling the Voltage across the motor in other words by controlling average power fed to the motor
Working of DC motor
Voltage across a motor can be changed using a resistor as a potential divider But is energy inefficient as a lot of useful power is wasted in resistor A better method is PWM (Pulse Width Modulation)
copyright IIT Guwahati Robotics Club
Working of DC motor
PWM - It means to change the width of a pulse train depending on the control signal
Working of DC motor
How does PWM help in controlling speed? It can be understood as using a typical average speed problem. Technically the average power fed to the motor is reduced thereby decreasing the speed
copyright IIT Guwahati Robotics Club
Stepper Motors
Widely use in Robotics ---why?? Because More precise than DC motor Measured rotation and can be held at a particular position- U can rotate the stepper motor with an accuracy of 0.9 degree!!!!!! Alignment is much better...
Comparison
Unipolar 1. Current flow in one direction 2. Simple drive circuit 3. Less torque Bipolar 1. Current flow in both direction 2. Complicated drive Circuit 3. High Torque
Modes of Operation
Single Coil Excitation: Only one out of the 4 coils is excited at a given time Double Coil: Two adjacent coils are excited at a given time Single and Double: Its a hybrid of both..(refer diagram for details)
copyright IIT Guwahati Robotics Club
a. Single-Coil Excitation
Each successive coil is energized in turn.
b. Two-Coil Excitation
Each successive pair of adjacent coils is energized in turn.
Comparison
Single coil
1. Low torque 2. Consume less energy 3. Settling time is more
Double coil
1. High torque 2. Consume double energy 3. Settling time is less
Note: The advantage of hybrid mode is that the step angle gets halved.. So we can control the rotation with double precision
Circuit Diagram
Pin details
Pin Details
D0-D7 are the data pins(used for output) C0-C3 are control pins. Note that C1 and C3 are hardware inverted. They can be used for both input and output S3-S7 are status pins. They are used for taking input from external circuit
copyright IIT Guwahati Robotics Club
PC parallel Port
The PC's Parallel Printer Port had a total of 12 digital outputs and 5 digital inputs accessed via 3 consecutive 8-bit ports in the processor's I/O space. 8 output pins accessed via the DATA Port 5 input pins (one inverted) accessed via the STATUS Port 4 output pins (three inverted) accessed via the CONTROL Port The remaining 8 pins are grounded
copyright IIT Guwahati Robotics Club
Control pins
The address for control pins can be obtained by adding 2 to the address of data pins. For eg, here the address of control pins will be 0x378+0x2=0x37a Therefore the command outportb(0x37a,3) will make both the 1st 2 control pins(C0,C1) low! Because 3=0011 and C0 and C1 are hardware inverted
Implementation of H bridge
Data Port1
Motor 1
Data Port2
Motor 2
Note connect a 15v zener diode to pin 10 of IC as shown to prevent damage to the IC due to "back emf" when loads such as motors switch on and off
Hybrid mode
The order of the values to be written to parallel port(data pins)
00000001 (1st coil is on) = 1 00000011 (1st & 2nd coil is on) = 3 00000010 (2rd coil is on) = 2 00000110 (2nd & 3rd coil is on) = 6 00000100 (3st coil is on) = 4 00001100 (4th & 3nd coil is on) = 12 00001000 (4rd coil is on) = 8 00001001 (1st & 4th coil is on) = 9 The values for the other coil can be determined by shifting the binary representation by 4 places left or multiply the decimal values by 2^4=16
main() { char a[]={3,6,12,9}; { char { char a[]={1,2,4,8}; a[]={1,3,2,6,4,12,8,9}; for (int for (int i=0;i<=100;i++) for (int i=0;i<=100;i++) i=0;i<=100;i++) { outportb(888,a[i%4]); { delay(10); outportb(888,a[i%8] {outportb(888,a[i% } ); 4]); outportb(888,0); delay(10); delay(10); }
} outportb(888,0);
} outportb(888,0);
main() main() main() { char a[]={3,6,12,9}; { char { char a[]={1,2,4,8}; a[]={1,3,2,6,4,12,8,9}; for (int i=100;i<=0;i-for (int i=100;i<=0;i--) ) for (int i=100;i<=0;i--) { outportb(888,a[i%4]); { delay(10); {outportb(888,a[i% outportb(888,a[i%8] } 4]); ); outportb(888,0); delay(10); delay(10); } } } outportb(888,0); outportb(888,0); } }
copyright IIT Guwahati Robotics Club
for (int i=0;i<=100;i++) { outportb(888,a[i%8 } ]|b[i%8]); outportb(888,0); delay(10); } } copyright IIT Guwahati outportb(888,0); Robotics Club }
for (int i=0;i<=100;i++) {outportb(888,a[(1 00-i)%4]|b[i%4]); { outportb(888,a[(10 delay(10); 0-i)%8]|b[i%8]); } delay(10); outportb(888,0); } } copyright IIT Guwahati outportb(888,0); Robotics Club }
for (int i=0;i<=100;i++) { outportb(888,a[i%8 ]|b[(100-i)%8]); delay(10); } copyright IIT Guwahati outportb(888,0); Robotics Club }
Please note....
Windows XP doesnt allow to directly access the parallel port so we have to use third party drivers which opens the specific ports.One such software is Userport. http://www.embeddedtronics.com/public/ Ele Generally the address of the parallel port is 0x378-0x37F.If not the check its address in the specific port properties in device manager.
copyright IIT Guwahati Robotics Club
PROGRAMMING IN MATLAB
Basics of Matlab Image Capturing. Image Processing.. Object Identification Movement Algorithm.
Basics Of Matlab
Pre-declaration of variable is not necessary, you can use variable whenever required. FOR loop for i=1:n body end IF condition if(condn) statement end Image is treated as an array in Matlab which can be in any format like RGB,Grayscale,BW,Intensity. Function[output variables]=name(input variables).Function should be written in an M-file. For calling function say add type add(4,5) in the prompt.
Image Capturing.
Make a video input object. Set various attributes of the object. Take Snap Shots. Save images in an array.
Image Capturing.
x=0; T=0; data=.2; imaqreset; imaqmem(inf); vid=videoinput('winvideo',1,'RGB24_640x480'); set(vid,'FramesPerTrigger',Inf); triggerconfig(vid, 'Immediate'); start(vid); dio=digitalio('parallel','LPT1');% for enabling parallel ports addline(dio,0:1,'out');
.continued
for ui=1:10 f=getsnapshot(vid); flushdata(vid); end disp('START');tic; f=getsnapshot(vid);flushdata(vid); prev_cen=0; flag=0; end_y=400; start_y=40; while x==0 T=T+1; f=getsnapshot(vid); {insert your code} end stop(vid);
Image Capturing.
Preview a stream of image frames. preview(obj); Acquire and display a single image frame.
delete(obj);
Image Processing..
imread : to read an image eg i=imread(name.jpg); imview : to view the image eg imview(i); im2bw : converts a coloured image to black and white eg b=im2bw(i); or b=im2bw(i,.4);
copyright IIT Guwahati Robotics Club
Image Processing..
RGB components For example, the red, green, and blue color components of the pixel (10,5) are stored in RGB(10,5,1), RGB(10,5,2), and RGB(10,5,3), respectively. eg a=imread(name.jpg); r=a(:,:,1); g=a(:,:,2); b=a(:,:,3); copyright IIT Guwahati
Robotics Club
Object identification
imcrop(image) Im2bw(image) medfilt2(image) bwlabel(image) Distinguishing the ball, robot, red square. regionprops area,centroid,perimeter Ratio of area to sqr of perimeter will be fixed number for a circular object.
copyright IIT Guwahati Robotics Club
Take [R,G,B] components of image. Check for area where R >threshold & G,B<threshold to identify red block. Use of rectangles of different shapes or use different colors to identify the orientation & position of robot.
Use of only 90 degrees turns for motion using DC motor. Use of stepper motor to move along shortest path. Implementation At each step find the angle between ball and direction of bot . If I I < 45 deg. Then move bot Repeat till bot hits ball.
copyright IIT Guwahati Robotics Club
Movement Algorithm
MATLAB CODE
dio=digitalio('parallel','LPT1'); addline(dio,0:3,'out'); putvalue(dio,[0 1 1 0]); Keep all the operating tactics of steps same as shown in C