cell phone operated robotic arm

15
Cell phone operated Robotic Arm Abstract: - This is also pick and place type robotic application. But this has a unique feature that it is controlled from cell phone. Its all the movements are controlled from any cell phone. That means you can control this robot from anywhere in the world where GSM / CDMA network service is available. Isn't it very interesting ??!!!!????..... The robot has built in GSM / CDMA cell phone that receives signals from other cell phone. One has to call the number of the cell phone (that is inside robot) from his cell phone to activate it. Then by pressing different keys from 0 - 9 form the phone he can control the movements of the robot. Its 4-axis robotic arm. Its all four motions are controlled by 2 DC gear motors and 2 servo motors. _____________________________ Let us start with mechanical structure of robot. Mechanical Structure: - it can be best understood with the help of snaps of the robot. here are some of the snaps.

Upload: mohsin-naqvi

Post on 23-Oct-2014

115 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cell Phone Operated Robotic Arm

Cell phone operated Robotic Arm

Abstract: - This is also pick and place type robotic application. But this has a unique feature that it is

controlled from cell phone. Its all the movements are controlled from any cell phone. That means you

can control this robot from anywhere in the world where GSM / CDMA network service is

available. Isn't it very interesting ??!!!!????.....

The robot has built in GSM / CDMA cell phone that receives signals from other cell phone. One has to

call the number of the cell phone (that is inside robot) from his cell phone to activate it. Then by

pressing different keys from 0 - 9 form the phone he can control the movements of the robot. Its 4-

axis robotic arm. Its all four motions are controlled by 2 DC gear motors and 2 servo motors.

                                                                                                                       ____________________________

_

Let us start with mechanical structure of robot.

Mechanical Structure: -

it can be best understood with the help of snaps of the robot. here are some of the snaps.

Page 2: Cell Phone Operated Robotic Arm

 

As shown in above figures complete structure is made up of wooden.

The most important part is the grip. As shown in above figure (in top pose) it has structure like scissor. At the end of grip there are two gear teeth wheels. One wheel is attached with servo motor 1 (this is shown in back pose). So when servo motor 1 rotates to 180 deg it will rotate the wheel. Due to it is coupled with another wheel both will rotate and opens

Page 3: Cell Phone Operated Robotic Arm

the grip. Now when motor rotates to 0 deg, both wheel moves reverse and grip closes. 

Complete grip rests on servo motor 2 (as shown in front and back poses). As the motor rotates 0 to 180 deg and back it will rotate grip clockwise and anticlockwise from center position in 3 to 4 steps.

Next comes the arm. The grip and both servo motors rests on one end of the arm and another end is coupled to DC Motor (as shown in front and back poses). As the motor rotates CW or CCW, the complete grip moves up and down.  

DC motor 1 rests on rotating platform rotated by DC Motor 2. As DC Motor 2 rotates CW or CCW, entire arm rotates CW / CCW.

This complete structure rests on wooden platform that also houses control circuit.

Now let us discuss the hardware and software used to control this mechanism. But before that first understand the block diagram of system

System Block diagram: -

Page 4: Cell Phone Operated Robotic Arm

The major building blocks are cell phone, DTMF decoder, micro-controller, DC motor and Servo motor driver circuits.

Cell phone: - This is very first and the most important part of the system because due to this only the entire system is activated and works. It will receive the signals from another cell phone and gives them as input to DTMF decoder. First the system is activated by calling the SIM card number inside the phone. Afterwards it will receive DTMF code signals dialed from another cell phone and gives it to DTMF decoder.

DTMF decoder: - The function of this block is self understood. It will take DTMF input given by cell phone decode it and gives 4-bit digital output to micro controller. It also generates an interrupt every time when it gives digital output

Micro-controller: - You can call this block as the heart of entire system because it actually performs all the controlling actions. Depending upon the code given by DTMF decoder it will perform following tasks

Open / close grip by giving actuating signals to servo motor 1 (SM1)

Rotate grip in either direction by giving actuating signals to servo motor 2 (SM2)

Moves up / down grip by giving actuating signals to DC motor 1 (DCM 1)

Rotate complete arm in either direction by giving actuating signals to DC motor 2 (DCM 2)

DC Motor driver: - It receives actuating signals from micro controller in terms of high / low logic, amplifies (current) it and rotates 2 DC motors in both directions

Servo motor driver: - It receives actuating signals from micro controller in terms of negative pulses, inverts it and provides required current to rotate 2 servo motors in both directions

Go to Next page for complete circuit

Page 5: Cell Phone Operated Robotic Arm

Robotic arm circuit

I have divided complete circuit into four major blocks

1. DTMF decoder2. Micro controller3. DC motor driver4. Servo motor driver

DTMF decoder: -

As shown in figure it is made up form readily available MT8870 chip that is widely used for DTMF based application. It receives DTMF tones and generates 4-bit digital output corresponding to received DTMF signal of digits 0 - 9 and other signals (like *, # etc) also. It receives input form cell phone to its pin no 2. It amplifies it through internal op-amp amplifier. If it receives valid DTMF tone, it will produce pulse output on StD (pin no 15). This is indicated by green LED connected as shown. The 4-bit digital output is latched on pins 11 - 14 and that is given to micro controller. The StD output is also given to interrupt pin of micro controller through transistor that will generate negative pulse every time when DTMF signal is received. This negative pulse will generate an interrupt. All the movements of robotic arm are controlled by cell phone digit switches 1 to 8. The 4 bit digital output corresponding to these switches form MT8870 are as given here

Page 6: Cell Phone Operated Robotic Arm

 

 

 

 

 

 

Micro-controller: -  

As shown in figure a 40 pin, 8-bit micro controller 89C51 is used for controlling purpose. It receives 4-bit digital output from DTMF decoder on its port P1 pins P1.0 - P1.3. And interrupt signal is given to P3.3 (external interrupt 1) pin. It drives two DC motors through port P2 pins P2.0 - P2.3 and two servo motors through port P0 pins P0.0 & P0.1. A 12 MHz crystal with two 33pf capacitors is connected to crystal pins (18 & 19) to provide basic clock signal to micro controller. One push button switch (RST) in parallel with 100nF capacitor forms power on reset circuit to reset the

Keypad switch on cell phone

4 bit digital output

D C B A1 0 0 0 12 0 0 1 03 0 0 1 14 0 1 0 05 0 1 0 16 0 1 1 07 0 1 1 18 1 0 0 0

Page 7: Cell Phone Operated Robotic Arm

micro controller. it will control the movement of robot depending upon the code it receives from DTMF decoder as given in table

4 bit digital input

Hex code Movement – controlling action

D C B A0 0 0 1 F1h Open grip by rotating SM1 to 180o

0 0 1 0 F2h Close grip by rotating SM1 to 0o

0 0 1 1 F3h Rotate grip CW to 180o by rotating SM2

0 1 0 0 F4h Rotate grip CCW to 0o by rotating SM20 1 0 1 F5h Move down grip by rotating DCM1 CW0 1 1 0 F6h Move up grip by rotating DCM1 CCW0 1 1 1 F7h Rotate hand CW by rotating DCM21 0 0 0 F8h Rotate hand CCW by rotating DCM2

DC Motor driver: -

   

As shown in figure L293D is quadruple H-Bridge driver chip that is widely used for DC motor and stepper motor driver applications. it receives inputs from micro controller as shown on its input pins 2,7,10 & 15 and rotates two DC motors in either direction as per given table

 W (pin no 2)  X (pin no 7)  Y (pin no 10)  Z (pin no 15)  motor

 1  0  0  0  left motor rotates CW

 0  1  0  0  left motor rotates CCW

 0  0  1  0  Right motor rotates CW

Page 8: Cell Phone Operated Robotic Arm

 0  0  0  1  Right motor rotates CCW

Thus, to rotate left motor CW micro controller has to send byte 01h on port P2. like wise 02h will rotate left motor CCW and so on.

Servo Motor driver: -

 

As shown in figure two IC555 (configured in monostable mode) are used to drive servo motors. it receives negative pulse as an input from micro controller on its trigger input pin and produce exactly same inverted (positive pulse) output of same pulse width and drives servo motor. the servo motor rotates on applied input pulse width. it rotates 180 deg when given pulse width is 5 ms and moves back to 0 deg position when given

Page 9: Cell Phone Operated Robotic Arm

pulse width is of 1ms. to retain the position successive pulses of same width must be given after every 20 ms to motor. so micro controller gives 3 consecutive negative pulse of 5 ms after 20 ms time period. this will move motor to complete 180 deg in 3 to 4 steps.

go to next page for software logic and program 

Robotic Arm C program

The program is very simple. It is written in embedded C language and compiled using KEIL (IDE). The complete program is made up of 8 different functions for 8 different movements corresponding to 8 switches. Along with that there are three delay functions for generating different time delays and one interrupt function to get the code from DTMF decoder

Initially in the main function, the ports are initializes as input or output. Then external interrupt 1 is enabled. Then the program waits in a continuous loop to for any input available from DTMF decoder. As interrupt arrives the program jumps to interrupt function and get the code. Then again it returns to main function and compares the code. As the match is found, it will call the particular subroutine to move the robotic arm. Now let us see all the functions one by one

gripopen function will send 4 pulses of 4ms after 20ms duration to servo motor 1. This will rotate the motor from 0 to 180 deg and opens the grip

gripclose function will send 4 pulses of 1ms after 20ms duration to servo motor 1. This will rotate the motor from 180 to 0 deg and closes the grip 

gripclk and gripaclk are same functions as above. They will move servo motor 2 from 0 to 180 deg and 180 to 0 in 3 to 4 steps. This will rotate grip in either direction from center position

gripup and gripdown functions will rotate DC motor 1 in CW and CCW direction for 1 sec time only. So grip will move up or down in steps

Similarly rotateleft and rotateright functions rotates DC motor 2 in CW and CCW direction for 2 sec time. This will rotate entire hand in either direction

int1 function simply gets the input on port P1 from DTMF decoder

Page 10: Cell Phone Operated Robotic Arm

keydly function is for generating random delay when interrupt arrives to stop multiple interrupts

delay1ms generates basic 1ms delay in loop. The delay generated by this function depends upon the value passed to it. So if the value is 4 then delay will be of 4 ms and likewise

delay50ms is also similar function. It will generate basic delay of 50 ms. The total delay generated depends upon the value passed to it. If the value is 20 then delay will be 20*50 = 1000 ms = 1 sec and likewise

Here is the complete C program.

#include<reg51.h>

sbit op1=P2^7;

sbit op2=P2^6;

unsigned char data byt=0xFF;

void keydly()

    {

          int a,b;

          for(a=0;a<50;a++)

          for(b=0;b<1000;b++);

    }

void delay1ms(int d)

   {

         int k;

         TL0 = 0x17;

         TH0 = 0xFC;

         TR0 = 1;

         for(k=0;k<d;k++)

              {

                 while(TF0==0);

                 TF0 = 0;

                 TL0 = 0x17;

                 TH0 = 0xFC;

              }

          TR0 = 0;

    }

void delay50ms(int c)

Page 11: Cell Phone Operated Robotic Arm

   {

       int p;

       TL1 = 0xAF;

       TH1 = 0x3C;

       TR1 = 1;

       for(p=0;p<c;p++)

         {

            while(TF1==0);

            TF1 = 0;

            TL1 = 0xAF;

            TH1 = 0x3C;

          }

       TR1 = 0;

    }

void gripopen()

   {

     int x;

     for(x=0;x<4;x++)               

     {

         op1=0;

         delay1ms(4);

         op1=1;

         delay1ms(20);

      }

  }

void gripclose()

  {

     int y;

     for(y=0;y<4;y++)

        {

           op1=0;

          delay1ms(1);

          op1=1;

         delay1ms(20);

        }

    }

void gripclk()

  {

        int w;

Page 12: Cell Phone Operated Robotic Arm

        for(w=0;w<4;w++)

           {

              op2=0;

             delay1ms(4);

             op2=1;

             delay1ms(20);

           }

  }

void gripaclk()

  {

       int z;

       for(z=0;z<4;z++)

          {

            op2=0;

            delay1ms(1);

            op2=1;

            delay1ms(20);

         }

   }

void gripup()

  {

       P2=0x01;

      delay50ms(20);

      P2=0x00;

  }

void gripdwn()

   {

        P2=0x02;

        delay50ms(20);

        P2=0x00;

  }

void rotetleft()

  {

         P2=0x04;

        delay50ms(40);

        P2=0x00;

  }

void rotetright()

   {

Page 13: Cell Phone Operated Robotic Arm

        P2=0x08;

       delay50ms(40);

        P2=0x00;

  }

void int1() interrupt 2

  {

       byt=P1;

       EA=0;

       keydly();

  }

void main()

  {

        TMOD = 0x11;

        P2=0x00;

        P0=0x00;

        op1=1;

        op2=1;

        P1=0xFF;

back: IE=0x84;

        byt=0xFF;

       while(byt==0xFF);

       switch(byt)

          {

               case 0xF1:

                         gripopen();

                         break;

                case 0xF2:

                         gripclose();

                         break;

                case 0xF3:

                         gripclk();

                          break;

               case 0xF4:

                       gripaclk();

                       break;

               case 0xF5:

                      gripup();

                       break;

              case 0xF6:

Page 14: Cell Phone Operated Robotic Arm

                     gripdwn();

                      break;

             case 0xF7:

                    rotetleft();

                    break;

            case 0xF8:

                   rotetright();

                    break;

         }    

      goto back;

 }