Go Down

Topic: Me and my Quadrabot (Read 3902 times) previous topic - next topic

Sorry I have taken my sweet time returning to this forum, life has been busy.

All I've done at this stage is make a to the change to the movements. Now instead of making the foot move from point A to point B, it moves in a path between point A to point B, stopping at a predetermined (set at three in this example) number of points along the path. I have done this in an attempt to create a more accurate path. The path is made from the original coordinates and mathematically added within the program.


There are still a few glitches in it and it looks quite dumb imo, but its a start.

http://www.youtube.com/watch?v=i7LSH_QzORE

Code: [Select]

void doTest()
{
  for (h=0; h<testcount; h++) //step
  { 
    for (e=0; e<12; e++) //servo
  {
    for (d=1; d<testcount; d++)
    {
        if (h==0)  //if first step
      {
        move=test[e][h];
        myservo[e].write(move);
      }
      else
      {
        if (h!=0 && h<=testcount) //if subsequent steps
        {
          if (test[e][h]==test[e][h-1]) //if move-to is equal to
          {
            move=test[e][h];
            myservo[e].write(move);
          }
          else if (test[e][h]>test[e][h-1]) //if move-to is greater than
          {
            c=test[e][h]-test[e][h-1];
            c=c/3;
            move=test[e][h]-(c*d);
            myservo[e].write(move);
            delay(pause);
          }
          else if (test[e][h]<test[e][h-1]) //if move-to is less than
          {
            c=test[e][h-1]-test[e][h];
            c=c/3;
            move=test[e][h]+(c*d);
            myservo[e].write(move);
            delay(pause);
          }
        }
      }
    }
  }
  delay(pause);
  }
}


For all those that want to follow a little closer I have set up a Facebook page:
http://www.facebook.com/home.php#!/pages/Quadrabot/246637268735818
The average person doesn't read the manual; that's what makes them average.

Opps, I put the wrong code on there, sorry:

Code: [Select]
void doTest()
{
  for (h=0; h<testcount; h++) //step
  {
    for (d=divisor; d>0; d--) //divisions per movement
    {
      for (e=0; e<12; e++) //servo
      {
        savepos[e]=test[e][h];
        if (h==0) //if first step
        {
          if (test[e][h]==savepos[e]) //if move-to is equal to
          {
            move=test[e][h];
            myservo[e].write(move);
          }
          else if (test[e][h]>savepos[e]) //if move-to is greater than
          {
            c=test[e][h]-savepos[e];
            c=c/3;
            move=test[e][h]-(c*d);
            myservo[e].write(move);
          }
          else if (test[e][h]<savepos[e]) //if move-to is less than
          {
            c=savepos[e]-test[e][h];
            c=c/3;
            move=test[e][h]+(c*d);
            myservo[e].write(move);
          }
        }
        else
        {
          if (h!=0 && h<=testcount) //if subsequent steps
          {
            if (test[e][h]==test[e][h-1]) //if move-to is equal to
            {
              move=test[e][h];
              myservo[e].write(move);
            }
            else if (test[e][h]>test[e][h-1]) //if move-to is greater than
            {
              c=test[e][h]-test[e][h-1];
              c=c/3;
              move=test[e][h]-(c*d);
              myservo[e].write(move);
            }
            else if (test[e][h]<test[e][h-1]) //if move-to is less than
            {
              c=test[e][h-1]-test[e][h];
              c=c/3;
              move=test[e][h]+(c*d);
              myservo[e].write(move);
            }
          }
        }
        delay(pause/(divisor*2));
      }
    }
  }
}

The average person doesn't read the manual; that's what makes them average.

Cello62

#17
Feb 14, 2012, 09:04 am Last Edit: Feb 14, 2012, 03:12 pm by Cello62 Reason: 1
Hi
Nice project!
Would you mind to do a litte "instructables" with any photo, to explain how to assembly the legs,wires and sensor?
Thanks for all

Go Up