Help with Large Scale Servo Project

I am working on assembling the ROFI robot from Project Biped (Project Biped - ROFI) and I have not been able to run any arduino program as they will not function correctly.

To be more specific, when I attempt to run 12 servos on a single Arduino Mega, the servos twitch uncontrollably and do not move to the positions which are set in the program. At the same time the power light on the arduino mega blinks and does not turn solid (as opposed to if I use less than 11 servos when the pwr light is solid). I predict it might be the power source but after checking the batteries with the multimeter they check out to be fine (7.6 V). The circuit is pretty simple, I am using a servo shield connected to a 6V regulator connected in parallel to two 7.2 V 1350 mah LiPo batteries. The arduino is connected through the dc power jack to the same circuit in parallel.

Here is the code...

  #include <Servo.h>
    
    // 0 Right Ankle (roll)
    // 1 Right Lower Leg 
    // 2 Right Knee 
    // 3 Right Middle Leg 
    // 4 Right Upper Leg 
    // 5 Right Hip (roll)
    //LEFT LEG JOINTS
    // 6 Left Ankle (roll)
    // 7 Left Lower Leg 
    // 8 Left Knee 
    // 9 Left Middle Leg 
    // 10 Left Upper Leg 
    // 11 Left Hip (roll)
    
    int c=0;
    
    Servo rightAnkle;
    Servo lowerLeg;
    Servo rightKnee; 
    Servo rightMiddleLeg; 
    Servo rightUpperLeg; 
    Servo rightHip;
    Servo leftAnkle;
    Servo leftLowerLeg; 
    Servo leftKnee; 
    Servo leftMiddleLeg; 
    Servo leftUpperLeg; 
    Servo leftHip;
    
    void setup(){
      rightAnkle.attach(0);
      lowerLeg.attach(1);
      rightKnee.attach(2); 
      rightMiddleLeg.attach(3);
      rightUpperLeg.attach(4);
      rightHip.attach(5);
      leftAnkle.attach(6);
      leftLowerLeg.attach(7);
      //leftKnee.attach(8); 
      //leftMiddleLeg.attach(9); 
      leftUpperLeg.attach(10); 
      leftHip.attach(11);
    }
    
    void loop(){
      rightAnkle.write(90);
      lowerLeg.write(90);
      rightKnee.write(90);
      rightMiddleLeg.write(90);
      rightUpperLeg.write(90);
      rightHip.write(100);
      leftAnkle.write(90);
      leftLowerLeg.write(90); 
      leftKnee.write(90); 
      leftMiddleLeg.write(90); 
      leftUpperLeg.write(90); 
      leftHip.write(90);
    }

Hard pressed to give you advice without a schematic. Just from the symptoms, you are causing some sort of over-current issue but we need that road map.

Working on a friends computer and don't have Eagle to give you that schematic, do you have any suggestions for online schematic makers

ignatius_gim:
Working on a friends computer and don't have Eagle to give you that schematic, do you have any suggestions for online schematic makers

A photo of a pencil sketch would be fine.

...R

Ok, sorry in advance for lack of artistic ability...

It is also worth mentioning I am using a homemade version of this servo shield: SENSORS – SainSmart.com (the servo shield is definitely not the problem, I have used it many times before with even more servos, this is just the first time I've ever powered 12 servos with a single Mega) and HS-311 servo motors. Thanks.

Your drawing may be fine but the picture is far too big to view. Please reduce it to 640x480 or twice that size.

...R

If the power light is flickering at all, your supply is not up to the task.

Budget an amp per servo to start with. Remember the servo's only draw significant
current when moving or resisting a force, and that this current drain is 10x or more
the resting current.

I am using a servo shield connected to a 6V regulator connected in parallel to two 7.2 V 1350 mah LiPo batteries.

I bet the 6V regulator isn't rated at 12A... Is the Arduino powered direct from LiPos or
from the regulator?

The regulator is rated for 3A. The servos draw 180 mah with no load. And the arduino is powered via the regulator.

Is the regulator too small for the job, if soz what would youl recomend to step down the voltage?

The servos will use a lot more than 180 mA when running, or when holding a load.

The statement "the servos draw 180 mah with no load", is nonsense. Even "... draw 180 mAh... " is still nonsense.

Is the regulator too small for the job,

Yes.

I'd use two regulators, with a large capacitor on the output of each of them, and supply the arduino from one, and the servos from the other.

There's also the question of supplying the Arduino with 6 volts; unless the Mega you are using has a low-dropout regulator so it can convert 6 volts to 5 volts.

Normally, you must supply a minimum of 7 volts to the Arduino via the barrel jack because the regulator won't work properly (or it will be unstable) at anything less. I'd run the Arduino directly from the batteries, and only the servos from your 6 volt regulator.

Furthermore, you might want to incorporate a fuse on the positive line of the battery prior to the output to the Arduino and 6 volt regulator, for safety purposes.

michinyon:
The statement "the servos draw 180 mah with no load", is nonsense. Even "... draw 180 mAh... " is still nonsense.

I understand, but i was just quoting the data sheet. Sorry if I miscommunicated...

cr0sh:
Normally, you must supply a minimum of 7 volts to the Arduino via the barrel jack because the regulator won't work properly (or it will be unstable) at anything less. I'd run the Arduino directly from the batteries, and only the servos from your 6 volt regulator.

Furthermore, you might want to incorporate a fuse on the positive line of the battery prior to the output to the Arduino and 6 volt regulator, for safety purposes.

I have a fuse in the circuit between the baterry and regulator, would that work. Also if I split up the Arduino and servos from the voltage regulator, would the 3A regulator still work or should I buy something larger?

Sorry for all the questions, Im still learning.