cr0sh:
5V @ 1 amp is not likely enough to power 12 servos at one time (a single standard servo can easily pull up to amp of current by itself, under load; yours are smaller servos though); what is powering the Arduino? You should first figure out a few things before delving into the code as being an issue:
- How much current does a single servo take (and since you are using two different brands of servos - measure each) - when under load and without a load?
- How many servos are going to running under load -at the same time-?
Multiply the maximum current from 1) with the number of servos from 2) - this will give you a rough number of the amount of current needed for the servos. Add an extra 250-300 mA or so for the Arduino (if being powered by the same supply).
I have a feeling you are trying to run the servos from the same supply as the Arduino (this is just a guess though; it isn't clear from your post); if so, likely a current sag is happening, causing the Arduino to constantly reset. Given that you can -sometimes- get it to work, I wonder if you are somehow right on the edge of what is needed current wise, and sometimes things "settle" just right (or not as many servos move at one time in a gait cycle, or the same number aren't loaded, or something), allowing it to work briefly?
Thanks for the quick reply.
Currently I don't have the calculations with me but the power supply is enough for this sort of testing. Currently the robot is just sitting on the bench and legs are moving freely in the air. Besides, if they were drawing more than an amp, the fuse would've burned out on the board. Of course for it to actually walk, we will need more current.
The board has its own battery to power it (or sometimes the USB cable connected to my laptop). So there shouldn't be any current sags when starting the servos.