Arduino-Servos on and off problem

Hi, I need help for my project...I'm using arduino duemilanove with ATMega328 chip. I have connected a joystick to the analog input and six servos at the PWM pins. All the servos are connected in parallel to an external power supply (6V).The servo should move unless the joystick is released. The problem that I've accountered is that the servos seems to operate 'on and off' every 3-4 seconds eventhough the joystick still have not released. The problem seems to be form the output of the arduino but still reaching dead end. I hope that someone can guide me in troubleshooting this problem because my demo for this project is on the day after tomorrow... Thank you.

Don't worry dear Shariman with the wealth of information you provided, we'll assign our best faith healers and psychic mediums to your case. Look for columns of light outside your house to resolve your problems.

Seriously, you need to provide a little more data, like a circuit diagram of what you connected where and the program code you're using. Without that we won't be able to help you and your best option is to wait at your window for the column of light.

Korman

Even when i set the servos to stay at 0 degree, the servo still on-and-off.
This is the sketch:

#include <Servo.h>

Servo Arm1; //create servo object to control servo 1
Servo Arm2; //create servo object to control servo 2
Servo Arm3; //create servo object to control servo 3
Servo Arm4; //create servo object to control servo 4
Servo Arm5; //create servo object to control servo 5
Servo Arm6; //create servo object to control servo 6

int fnr = 0; // forward input control at analog pin 0
int lnr = 1; // reverse input control at analog pin 1
int fnrvalue = 0; //set initial value of analog input
int lnrvalue = 0; //set initial value of analog input
int ArmPos; //set initial value for servo position
int fnrspeed; //stores forward and reverse delay value
int lnrspeed; //stores left and right delay value

void setup()
{
pinMode(fnr,INPUT); //set pin 0 as input
pinMode(lnr,INPUT); //set pin 1 as input
Arm1.attach(3); // attaches the servo on pin 3 to the servo object
Arm2.attach(5); // attaches the servo on pin 5 to the servo object
Arm3.attach(6); // attaches the servo on pin 6 to the servo object
Arm4.attach(9); // attaches the servo on pin 9 to the servo object
Arm5.attach(10); // attaches the servo on pin 10 to the servo object
Arm6.attach(11); // attaches the servo on pin 11 to the servo object

}

void loop()
{

Arm1.write(0); // set servo to go to position to 0 degree pos.
Arm2.write(0); // set servo to go to position to 0 degree pos.
Arm3.write(0); // set servo to go to position to 0 degree pos.
Arm4.write(0); // set servo to go to position to 0 degree pos.
Arm5.write(0); // set servo to go to position to 0 degree pos.
Arm6.write(0); // set servo to go to position to 0 degree pos.
}

/…end…/

I do not have the schematic, but i have the block diagram that shows the connection of the input and output. sadly i do not know how to insert the picture :-/

Just a few comments:

pinMode(fnr,INPUT); //set pin 0 as input
 pinMode(lnr,INPUT); //set pin 1 as input

Analogue pins can only be inputs; here, you're trying to set the serial I/O pins to be inputs.

Servo Arm6;  //create servo object to control servo 6

That comment is just noise. If it had said "servo for wrist joint", then maybe it would have been more meaningful

Have you ever considered "for" loops and arrays as a way of making your code shorter and easier to debug?

This is the link to the block diagram of my project:

http://shw.shariman.fotopages.com/21892902/Block-diagram-of-my-project.html

You haven't connected the servo grounds to the Arduino

The sketch is just a sample of what i'm doing. I think that the sketch is not the problem...even i force the servos to be at 0 degree position, the servo still on-and-off...I mean if i upload the sketch into the arduino, all the servos should be at 0 position even if i try rotate them manually, it will hard to rotate because it is always in 0 postion rite? but what happen now, the servos seems to be not responsive. After I uploaded the sketch the servos rotates to 0 position but after several seconds, the servos can be rotated by hand as if it have no power to hold the 0 position. But after 3-4 seconds it rotate to 0 position back.

owh...that mean the ground pin of the servos need to conneted to the -ve side of the battery and also the ground of the arduino?

Yup - 0V all commoned.

owh..Thank you very much for your help :D I'll update if the problem occor again.