Let's Make Robots!

Hexapod controlled by arduino+devantechSD21

Hello there,

I am working on a hexapod robot and i am trynig to controll it by using aruino + SD21 servo controller.When i am  test each servo separately ,are acting like i want but when i am connecting all of them its like most servos are not moving at all.

 

This is my code:

#include <Wire.h>

#define ADDRESS 0xC2  

 

int servo1  = 63;

int servo2  = 64;

int servo3  = 65;

int servo4  = 66;

int servo5  = 67;

int servo6  = 68;

int servo7  = 69;

int servo8  = 70;

int servo9  = 71;

int servo10 = 72;

int servo11 = 67;

int servo12 = 74;

int servo13 = 75;

int servo14 = 76;

int servo15 = 77;

int servo16 = 78;

int servo17 = 79;

int servo18 = 80;

 

void setup()

{ 

Wire.begin();

Wire.beginTransmission(ADDRESS); 

Wire.write(servo1);

Wire.write(190); 

Wire.write(servo2);              

Wire.write(130); 

Wire.write(servo3);

Wire.write(200);

Wire.write(servo4);

Wire.write(80); 

Wire.write(servo5);                     

Wire.write(100); 

Wire.write(servo6);

Wire.write(200); 

Wire.write(servo7);

Wire.write(128); 

Wire.write(servo8);          

Wire.write(130);

Wire.write(servo9);

Wire.write(200);

Wire.write(servo10);

Wire.write(178);  

Wire.write(servo11);                        

Wire.write(100); 

Wire.write(servo12);

Wire.write(60); 

Wire.write(servo13);

Wire.write(128);  

Wire.write(servo14);                  

Wire.write(150);  

Wire.write(servo15);

Wire.write(160); 

Wire.write(servo16);

Wire.write(138);  

Wire.write(servo17);

Wire.write(100);                            

Wire.write(servo18);

Wire.write(60); 

Wire.endTransmission();

}

void loop()

}

 

if someone can help me or send me a sample code i will really appreciate it.

Thanks alot

 

Comment viewing options

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

Take a look at this hexapod: http://letsmakerobots.com/node/31339 My code is a lot harder to understand then his.

My small hexapod uses an ATmega328 (Arduino Uno) , my big one an ATmega2560 (Arduino Mega).

if u can send me a code of your big hexapod i will really appreciate it ...  mine still not working , so probably i will use arduino at mega 2560... because my deadline is next thursday..

Never heard of that servo controller. I don't use any "servo controllers" on my hexapods. An Arduino is more then capable of controlling servos. It might be a bit harder to program, but that's the fun for me :)

That Hitec servo probably needs about 1A under load so you'll need an 18A power supply... What are you using now?

which arduino are u using ?  i am using a 10A power supply... these servos needs 0.450 A under load

Which servos are you using? Have you measured how much current 1 servo draws?

I have a small hexapod with 12 MG90 servos, it needs a 5A power supply to reliably power the servos. Before that I used 12 SG90 servos, they needed a 3A power supply. My big hexapod uses 18 MG996R servos and needs a 20A power supply. 

i am using 18 Hitec HS-645M ... are u using arduino and sd21 servo controller ?

if you have any sample code for arduino + devantech sd21 servo controller so i can work based on it .. i will be thankful... 

I would say you are not giving enough power to the servo board. Just a guess as I have never used the SD21 but have seen similar effects with under powering.