Dagu quadbot and Dagu spider help needed

Hi I got a Dagu quadbot and a Dagu spider controller and am trying to adapt the quaruped2 code to make it move but I havent had much success,What does FLHservo,FLKservo mean ? I get the front left bit and I think I have assigned them the correct pin in the code as follows,

#include <Servo.h>
#include "Constants.h"
#include "IOpins.h"

// define global variables and servos here

int Time=100;
int LShift=350;
int RShift=350;
int Raise=700;

Servo FLHservo;                                               // define servos
Servo FRHservo;
Servo RLHservo;
Servo RRHservo;
Servo FLKservo;
Servo FRKservo;
Servo RLKservo;
Servo RRKservo;

void setup()
{
  FLHservo.attach(FLHpin);                                    // attach servos
  FRHservo.attach(FRHpin); 
  RLHservo.attach(RLHpin); 
  RRHservo.attach(RRHpin); 
  FLKservo.attach(FLKpin); 
  FRKservo.attach(FRKpin); 
  RLKservo.attach(RLKpin); 
  RRKservo.attach(RRKpin);
 
  FLHservo.writeMicroseconds(FLHcenter);                      // center servos
  FRHservo.writeMicroseconds(FRHcenter); 
  RLHservo.writeMicroseconds(RLHcenter); 
  RRHservo.writeMicroseconds(RRHcenter); 
  FLKservo.writeMicroseconds(FLKcenter); 
  FRKservo.writeMicroseconds(FRKcenter); 
  RLKservo.writeMicroseconds(RLKcenter); 
  RRKservo.writeMicroseconds(RRKcenter);
  delay(2000);
 
  //Serial.begin(9600);
}

void loop()
{
  // run forwards
  LShift=350;
  RShift=350;
  for(int i=0;i<10;i++)
  {
    Run();
  }
 
  // turn left
  LShift=-350;
  RShift=350;
  for(int i=0;i<10;i++)
  {
    Run();
  }
 
  // run backward
  LShift=-350;
  RShift=-350;
  for(int i=0;i<10;i++)
  {
    Run();
  }
 
  // turn right
  LShift=350;
  RShift=-350;
  for(int i=0;i<10;i++)
  {
    Run();
  }
}

void Run()
{
  FRKservo.writeMicroseconds(FRKcenter+Raise);                // raise front right leg
  RLKservo.writeMicroseconds(RLKcenter+Raise);                // raise rear  left  leg
  FLHservo.writeMicroseconds(FLHcenter+LShift);               // move  front left  leg backward
  RRHservo.writeMicroseconds(RRHcenter-RShift);               // move  rear  right leg backward
  delay(Time/2);
  FRHservo.writeMicroseconds(FRHcenter+RShift);               // move  front right leg forward
  RLHservo.writeMicroseconds(RLHcenter-LShift);               // move  rear  left  leg forward
  delay(Time);
  FRKservo.writeMicroseconds(FRKcenter);                      // lower front right leg
  RLKservo.writeMicroseconds(RLKcenter);                      // lower rear  left  leg
  delay(Time);
 
  FLKservo.writeMicroseconds(FLKcenter+Raise);                // raise front left  leg
  RRKservo.writeMicroseconds(RRKcenter+Raise);                // raise rear  right leg
  FRHservo.writeMicroseconds(FRHcenter-RShift);               // move  front right leg backward
  RLHservo.writeMicroseconds(RLHcenter+LShift);               // move  rear  left  leg backward
  delay(Time/2);
  FLHservo.writeMicroseconds(FLHcenter-LShift);               // move  front left  leg forward
  RRHservo.writeMicroseconds(RRHcenter+RShift);               // move  rear  right leg forward
  delay(Time);
  FLKservo.writeMicroseconds(FLKcenter);                      // lower front left  leg
  RRKservo.writeMicroseconds(RRKcenter);                      // lower rear  right leg
  delay(Time); 
}

I have edited IOpins.h to reflect the pins used. When its connected to usb it does nothing just wriggles but when connected to battery its goes around in a circle, but not great.

What else do I need to change to make it walk ?

Is there any kind soul who would help a newbie. I thought this would be a good starter robot but am out of my depth already.

Many thanks

 

I would guess:FLKservo means

I would guess: FLKservo means Front Left Knee servo. RRHservo Rear Right Hip servo. 8 servos will not run when powered from USB, an external power source is needed.

Maybe you need to take care about that all servos should be in the neutral (center) position before assembling the robot.

Yeah Im using a 9v battery

Yeah Im using a 9v battery and Im sure I put them all in the centre during assembly, well guessing centre anyway is there a better way to centre ?.

H and K… I would assume

H and K… I would assume Hip and Knee.

So it looks like you found the I/0 tab. You should also make note of the constants.h file as well. I noticed that there are some servo numbers in there as well --min’s and max’s, centered numbers etc. 

Here is what I would do:

I would start with the servo “sweep” example in the arduino editor. To that example, I would modify the delay to slow the sweep way down, and I would add a Serial.println(pos); line as well. This way you can see the servo slowly sweep and also see the position numbers that relate to its movements. I would start with just one servo, maybe the knee joint on one corner. Note its pin number and substitue that in the example sketch. Now, let it sweep and open your serial monitor to see the postion numbers scroll by. (I think the quad sketch you are using uses the servo command with milliseconds --you should change this in the sweep example as well.

Now, here is the important part:  You need to grab your notebook and pen and start writing everything down. Write:

  • Servo name (what it is called in the code)
  • Pin number
  • What its minimum position number is
  • What its maximum positon number is
  • Is the min position up or down? Is Max up or down?
  • What number makes the servo perfectly centered?

Do this for each of your servos, one by one. Get all your numbers and all your data. Now, go back to your quad example sketch and take another look at it. Are the numbers in the constant.h tab anywhere close to yours? I would guess at lease a few things are going to be way off. (And these are the things that are probably preventing your robot from walking).

 

That’s the secret to this, my friend. The Scientific Method. Get your data step-by-step and then re-address the original issue.

 

Oh and yes…

I see now the 9v thing… 

As folks have said above, you can’t run off of a 9v (for a great number of reasons.)

**Thanks for the info Chris **

Thanks for the info Chris  much appreciated.

Thanks for all the info last

Thanks for all the info last night, I picked up some AA NiMH 2100mAh (1.2v) batteries how many would I need to use to power the Black spider controller and the 8 servos?.

 

 

So its a minium of 6 then,

So its a minium of 6 then, is there much difference in the weight between NiMH and Lipo batteries ?

I managed to get the bot to

I managed to get the bot to walk forward and do a turn and then walk backward using the quaruped example from OddBot. Im not really understanding the sketch tho. I am a beginner and maybe this bot is a bit too advanced for me anyhow I have a few questions if some kind soul can help.

int Time=100;
int LShift=350;
int RShift=350;
int Raise=700;

I adjusted the time integer and got it to run faster/slower

what are LShift, RShift and Raise for ?

Whats does this section do as all the values seem to be identical?

}

void loop()
{
// run forwards
LShift=350;
RShift=350;
for(int i=0;i<10;i++)
{
Run();
}

// turn left
LShift=-350;
RShift=350;
for(int i=0;i<10;i++)
{
Run();
}

// run backward
LShift=-350;
RShift=-350;
for(int i=0;i<10;i++)
{
Run();
}

// turn right
LShift=350;
RShift=-350;
for(int i=0;i<10;i++)
{
Run();
}
}

I can see where the bot gets its data to move forward but hows does it know to rotate and walk backwards?.

Many thanks for the assistance.