why there is a vibration in servomotor

hello all
I build a arm robot whit 2 micro servos and 3 standard servos and arduino uno and 2 joystick and one pot
but there is a vibration in micro servomotors
this is arm robot code

#include <Servo.h>

Servo myservo1; 
Servo myservo2; 
Servo myservo3; 
Servo myservo4; 
Servo myservo5; 
Servo myservo6;
int potpin1 = A0;
int potpin2 = A1;
int potpin3= A2;
int potpin4 = A3;
int potpin5 = A4;
int val1; 
int val2; 
int val3; 
int val4; 
int val5; 
int val6; 
void setup() {
  // put your setup code here, to run once:
myservo1.attach(3);
myservo2.attach(5);
myservo3.attach(6);

myservo4.attach(9);
myservo5.attach(10);
myservo6.attach(11);
}

void loop() {
  // put your main code here, to run repeatedly:
 val1 = analogRead(potpin1);
  val2 = analogRead(potpin3);
   val6 = analogRead(potpin2);
    val4 = analogRead(potpin4);
     val5 = analogRead(potpin5);
     int x = val2;
     val1 = map(val1, 0, 1024,0 ,180);
     val3= map(x, 0, 1024,205,0);

     
      val2 = map(val2, 0, 1024, 0, 195);
  
      
      val4 = map(val4, 0, 1023, 50, 180);
      val5 = map(val5, 0, 1023, 50,130);
      val6 = map(val6, 0, 1023,120, 60);
       
         myservo1.write(val1); 
         myservo2.write(val2); 
          myservo3.write(val3); 
            myservo4.write(val4); 
            myservo5.write(val5); 
              myservo6.write(val6); 
        
        delay(15);
}

When you press CTRL-T in the IDE all code will line up neatly which makes it a better read.

The servo's are vibrating as you change their value quite often. The analogRead()'s influence each other and will have some noise which results in vibration.

You can add code to compare the last value (for each servo) with the new value and if they do not differ more than e.g. 2 you should not update the servo.

You should also learn about array's, that would simplify your code a bit.

Thanks for your response
now I have another problem
my servos move very fast
and I want they move slower
what can I do?

or use another servo lib with speed settings or make it yourself by averaging and speedcontrol by not putting the new value but 0.1 * difference.

If you want the servos to move slowly you will have to make a substantial change to your code and use the technique shown in the servo sweep example and in the demo several things at a time

Basically you need to make the servo move a small amount each time with an interval between the movements.
DO NOT use delay() for the intervals as it blocks the Arduino from doing other things.

...R

p990:
Thanks for your response
now I have another problem
my servos move very fast
and I want they move slower
what can I do?

Move your joystick slower!

Move the servos at your choice of speed VarSpeedServo - a modified Servo library with speed control - Motors, Mechanics, Power and CNC - Arduino Forum