Saturday, 19 January 2013

HEXAPOD USING 8051 MICROCONTROLLER


Hexapod Using 8051

8051 based Hexapod Robot

A Hexapod is a six legged robot which looks like a spider. I was giving presentation on 8051 microcontroller a student asked me ,”Can  we make a hexapod using 8051 and I said yes we can  but he added that he searched on this topic on google and was not able to find good information about it. He added that he found some websites but they charge for it. So I decided to write a post on this topic. This is the very first version of hexapod and have only one function to move in the forward direction.

Now the very first thing is the material we used to make this 

project. The major components are shown in the picture below.


Major Components 



Control circuit:- The control circuit of the hexapod is very easy to make and totally based on the 8051 microcontroller(p89v51rd2).


8051 based hexapod control circuit
   The Circuit Shown here is use to control the three servo motor's which are subsequently connected to legs of the hexapod robot. 
  • ·      we already made the basic circuit of 8051 micrcontroller in our old posts so you can get the reference from there. Clickhere for 8051 basic circuit and description.
  • ·      we also learn the lm324 interfacingwith 8051.
  • ·      LM324 is uses because of its high gain
  • ·      There are different servos available in the market so you need to find out the pin description of the motor you are using.
  • ·      In our motor’s the RED is for +ve, brown is for –ve and yellow is for data.

Now you made the control circuit using 8051microconroller. you need to construct the robot.

Construction of the Hexapod:  While you are constructing the robot you need to use the step below very carefully.


** Join the three motor’s in the manner as shown below.
3motors connected to make the robot structure


** Now straight the paper clip as shown below
paper clip while straightening them


** For making front and back leg bend the wire at 90degre angle and then one more bend at the low edge as shown below.




** Now join this legs to the motor gear as shown below.

connected to the motor gear


** Attach the legs  to the motor’s  and your robot is on its feet. As shown below image.

robot which is connected to the control circuit via wires

Coding of hexapod:  The code of this hexapod is written in the embedded-c . you can also write it in the assembly language. For writing the program you have to keep the rotation of motor in your mind.

***************************************************************
***************************************************************
              Hexapod Robot Using 8051 microcontroller
***************************************************************
***************************************************************
#include<reg51.h>
sbit right=P2^0;          // Right motor data pin to P2.0
sbit middle=P2^1;      // middle motor data pin to P2.1
sbit left=P2^2;           // left motor data pin to P2.2
void timer(int msec)     // Function for timer
{
int i;
for(i=0;i<msec;i++)
{
TMOD=0x20;         // Mode2
TH1=-23;
//TH1= -23;        // 200usec timer
TR1=1;
while(TF1==0);
TF1=0;
TR1=0;
}
}
void main()
{
int i;
right=left=middle=0; // make the pin as output
while(1)
{

for(i=0;i<20;i++) //middle leg clockwise direction
{
middle=1;
timer(20);
middle=0;
timer(360);
}
for(i=0;i<20;i++) //right leg forward direction
{
right=1;
timer(20);
right=0;
timer(360);
}

while(1)
{
for(i=0;i<20;i++) //middle leg anti clockwise direction
{
middle=1;
timer(40);
middle=0;
timer(360);
}

for(i=0;i<20;i++) //left leg clockwise direction
{
left=1;
timer(20);
left=0;
timer(360);
}
for(i=0;i<20;i++) //right leg anti clockwise direction
{
right=1;
timer(40);
right=0;
timer(360);
}
for(i=0;i<20;i++) //middle leg clockwise direction
{
middle=1;
timer(20);
middle=0;
timer(360);
}

for(i=0;i<20;i++) //left leg anti clockwise direction
{
left=1;
timer(40);
left=0;
timer(360);
}
for(i=0;i<20;i++) //right leg  clockwise direction
{
right=1;
timer(20);
right=0;
timer(360);
}
}
}
}

NOW WATCH THE VIDEO...



*********************************************************************************

we will welcome your suggestion and projects suggest your project and we will try to post them on our blogs as soon as possible.
*********************************************************************************

*********************************************************************************

***********************THANK YOU FOR WATCHING **********************

******************************* BEST OF LUCK ******************************
*********************************************************************************
*********************************************************************************

About the Author

vikas

Author & Editor

Hobbyst Researcher and working in electronics domain, M.Tech in VLSI Design and Embedded Systems.

16 comments:

  1. i want to control 8 servo using 8051 is it possible with mobile

    ReplyDelete
  2. nice & whts ur next project dear vikas sir

    ReplyDelete
  3. Hi Vikas! I am searching for this code for the last few days and finally found it in this post. Thank you so much for sharing. Keep updating.

    ReplyDelete
  4. where to get that motor clamp to attach hexapod legs ??

    ReplyDelete
    Replies
    1. motor gears for connecting the legs

      Delete
    2. then whats the rating of servo motor used here ??

      Delete
    3. these are micro servo motor 6v and 6-7 diffrent gear's come with motor

      Delete
    4. what about the torque and load specification of motor??

      Delete
    5. it will be kindfull if u mention any online store to get these motors..

      Delete
    6. http://www.amazon.com/TowerPro-micro-small-Helicopter-Arduino/dp/B008Q6Z36Q

      http://www.nex-robotics.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=620&Itemid=45

      Delete
  5. can anybody suggest program how to control stepper motor..

    ReplyDelete
  6. Controlling the Stepper Motor is easy, just you have to generate the sequence 1010010 (Sequence should be matched)..run it in loop as you desire.

    ReplyDelete

 
2embeddedrobotics © 2015 - Designed by Templateism.com