Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: saba_rish91 on February 16, 2013, 08:42:07 AM

Title: Help! Quadruped servo problem
Post by: saba_rish91 on February 16, 2013, 08:42:07 AM
Hello guys,

I'm building a quadruped robot with 12 DOF. I'm using Arduino UNO and 7.4V LiPO battery (1600mAh).

When I connect the servo, and give command to position at any degree, motors keeps on oscillating or goes from 0 to 180 and back to 0... That is the motors go crazy.

What might be the problem?
Title: Re: Help! Quadruped servo problem
Post by: ErikY on February 16, 2013, 09:01:11 AM
Can u post your code?
Title: Re: Help! Quadruped servo problem
Post by: saba_rish91 on February 16, 2013, 09:05:18 AM
Code was just to position the hip motors at 90 degree and knee motors at 10 degree... Thats all...
Title: Re: Help! Quadruped servo problem
Post by: Gertlex on February 16, 2013, 10:37:47 AM
Well it sounds like a code issue...

What happens if you hook up a single servo?

What servos are you using?

Are you regulating the voltage down? A 2S LiPO is closer to 8.4 V fully charged, and hobby servos shouldn't be supplied much more than 6 V.
Title: Re: Help! Quadruped servo problem
Post by: saba_rish91 on February 16, 2013, 10:51:04 AM
I'm using 7806 metal case voltage regulator to power down LiPO battery.

For Hip and leg, I'm using the following servo motor.
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=2_5&products_id=187 (http://robokits.co.in/shop/index.php?main_page=product_info&cPath=2_5&products_id=187)

For the knee, I'm using the following servo motor.
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=2_5&products_id=188 (http://robokits.co.in/shop/index.php?main_page=product_info&cPath=2_5&products_id=188)

When I hook only one servo, it works properly.

Code: [Select]
#include <Servo.h>

int i=0;

Servo ser[13];

void setup()
{
  ser[1].attach(1);
  ser[2].attach(2);
  ser[3].attach(3);
  ser[4].attach(4);
  ser[5].attach(5);
  ser[6].attach(6);
  ser[7].attach(7);
  ser[8].attach(8);
  ser[9].attach(9);
  ser[10].attach(10);
  ser[11].attach(11);
  ser[12].attach(12);
 
  delay(1000);
}
 
 
void loop()
{
  ser[2].write(90);
  ser[3].write(0);
  ser[5].write(90);
  ser[6].write(0);
  ser[8].write(90);
  ser[9].write(0);
  ser[10].write(90);
  ser[11].write(0);
  delay(500);
}
Title: Re: Help! Quadruped servo problem
Post by: ErikY on February 16, 2013, 10:57:40 AM
I could be wrong, but the problem may be that not all those pins have PWM, and I beleive u need PWM to run the servo angle
Title: Re: Help! Quadruped servo problem
Post by: saba_rish91 on February 16, 2013, 10:59:18 AM
With servo.h library, it possible to generate pwm output on all the pins.
Title: Re: Help! Quadruped servo problem
Post by: billhowl on February 17, 2013, 09:14:09 AM
First connect your servo start with pin 2
Quote
// Sample sketch for driving 12 Servos from an Arduino UNO, servos are attached to digital pins 2,3,4,5,6,7,8,9,10,11,12,13
next, make sure your power supply can supply the current for all the servo, each servo will need about 0.5 to 1 Amp of current, 7806 can only supply 1A.
Title: Re: Help! Quadruped servo problem
Post by: saba_rish91 on February 17, 2013, 09:22:24 AM
Only the hip motors seems to oscillate like, it seems that it is unable to bear the weight. If current is the problem, then shall I go for LM2676? It looks like it will give a output current of 3A.
Title: Re: Help! Quadruped servo problem
Post by: billhowl on February 17, 2013, 10:45:20 AM
LM2676 is a Switching Regulator, is not easy build, you can get something like this UBEC (http://www.hobbyking.com/hobbyking/store/__24579__Turnigy_5V_6V_5A_Heli_UBEC_for_Lipoly_6_16V_.html)
(http://www.hobbyking.com/hobbyking/store/catalog/24579.jpg)