Society of Robots - Robot Forum
Electronics => Electronics => Topic started 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?
-
Can u post your code?
-
Code was just to position the hip motors at 90 degree and knee motors at 10 degree... Thats all...
-
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.
-
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.
#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);
}
-
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
-
With servo.h library, it possible to generate pwm output on all the pins.
-
First connect your servo start with pin 2
// 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.
-
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.
-
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)