Let's Make Robots!

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

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thats exactly what I using, guess its off to ebay. been pulling my hair out all day trying to get this to work  I never thought about that. Can you recommend batteries to get ?

Many thanks and much appreciated for all the advice and help

In addition to batteries, Lipos, "rc car" packs, 6 and 8 cell AA packs etc, you also need to know where they should be plugged in. There are power inputs that run to the onboard regulator of the Arduino board, there are pwr inputs that probably go straight to the servo pwr rails. There is also the issue of regulating a 7.2v or 7.4v pack down to something your servos can use. Your board(s) may or may not be set up for this.

This may be a good time to stop and read the manual(s) --they contain all of this information.

 

 

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 ?.

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.